Commit Graph

1153 Commits

Author SHA1 Message Date
袁章洪 9e56e3613f chore: ignore all docs/superpowers artifacts, untrack accidentally-added plans/specs
The previous .gitignore un-ignored docs/superpowers/{plans,specs}/** wholesale,
so a broad `git add docs/` kept re-adding local planning docs (one failed
autocorrect CI on CJK punctuation). Simplified to ignore docs/superpowers/*
entirely and removed the six plan/spec files that slipped in. Already-tracked
astro-migration docs on main are unaffected (gitignore does not touch tracked
files).
2026-09-15 14:57:39 +08:00
袁章洪 175f3db8d4 docs: drop filter_ prefix from CLI --filter examples
The CLI --filter flag takes the bare indicator name (e.g. marketcap); it adds the
filter_ prefix internally before calling the gateway. Corrected the screener
search CLI examples in openapi.yaml and the screener .mdx pages from
--filter filter_marketcap:... to --filter marketcap:... (response keys still
carry the filter_ prefix — that is the raw wire field, unaffected).
2026-09-15 14:53:26 +08:00
袁章洪 8eb4de7e7e docs(api-reference): use concrete example values in screener_search filters description
Replace the <indicator>/<min>/<max> placeholders with a real example
(filter_pettm, 10, 30), consistent with the other filter_ key descriptions.
2026-09-15 14:52:37 +08:00
袁章洪 76c1b27f70 docs(api-reference): drop SDK/CLI transform meta-notes from screener endpoints
The API Reference documents the raw HTTP response, so notes that explain how the
SDK/CLI reshape it are noise. Removed the 'JSON output format' warning on
screener_search and the 'SDK response' warning on screener_indicators, and fixed
the screener_indicators key description which wrongly said 'no filter_ prefix'
(the raw response keys DO carry the prefix, e.g. filter_market). Also simplified
the returns-param prefix wording to an example (e.g. `filter_pettm`).
2026-09-15 14:45:46 +08:00
袁章洪 1d5aff371d chore: untrack superpowers planning/spec docs accidentally committed
An earlier `git add docs/` swept six untracked docs/superpowers plan and spec
files into the tree; one of them (2026-06-11-macroeconomic-docs.md) failed the
autocorrect CI on CJK-colon punctuation. These are local planning artifacts that
should not be version-controlled — removed from git (kept on disk).
2026-09-15 14:02:21 +08:00
袁章洪 bd66bcf4d6 fix(api-reference): convert remaining counter_id to symbol in examples
industry_rank / industry_peers: response-example JSON counter_id -> symbol
(BK/US/IN00258 -> IN00258.US) and request-example query params counter_id ->
symbol. Same cleanup for grid_symbol_info request examples and top_movers /
valuation_comparison examples (dropping counter_id where a symbol sibling
already exists).

Only today_orders / history_orders retain counter_id: monitor_counter_id
(conditional-order monitor) and the order response's 'Counter order ID', both
intentionally kept.

NOTE: depends on longbridge-mcp#128 and longbridge-terminal#319 — do not publish
until both merge.
2026-09-15 13:51:40 +08:00
袁章洪 e287d0a916 docs: align .mdx pages counter_id -> symbol (CLI #319 / MCP #128)
top_movers, valuation_comparison, industry_rank, industry_peers, cli
industry-rank/peers, and grid symbol_info now show symbol instead of the
internal counter_id, matching the openapi.yaml reference. Value examples
converted (ST/US/AAPL -> AAPL.US, BK/US/IN00258 -> IN00258.US); the top_movers
logo URL and the order files' 'Counter order ID' are intentionally untouched.

NOTE: this counter_id -> symbol migration depends on longbridge-mcp#128 and
longbridge-terminal#319 — the docs must not be published until BOTH PRs merge
(they move requests/responses to symbol end to end; until then production still
speaks counter_id).
2026-09-15 11:34:53 +08:00
袁章洪 20051a5a36 fix(api-reference): rename counter_id request params to symbol (align with CLI #319 / MCP #128)
industry_peers and grid_symbol_info query params counter_id -> symbol, matching
longbridge-terminal#319 and longbridge-mcp#128 which move every raw endpoint to
symbol-based requests. No counter_id request params remain in the reference.
2026-09-15 10:56:42 +08:00
袁章洪 72ec07ab0d fix(api-reference): also drop profit_max_symbol/loss_max_symbol from profit_analysis_summary
Per decision, the max-profit/max-loss security identifiers are not exposed at
all — only the amounts (profit_max/loss_max) and display names (*_name) remain.
2026-09-15 10:51:49 +08:00
袁章洪 59a660d8f0 fix(api-reference): expose symbol instead of counter_id per product decision
- screener_search: item counter_id -> symbol
- industry_rank: industry counter_id -> symbol (usable as symbol in industry_peers)
- industry_peers: sector counter_id -> symbol
- profit_analysis_summary: drop profit_max_counter_id / loss_max_counter_id
  (profit_max_symbol / loss_max_symbol already present)

monitor_counter_id on today_orders / history_orders is intentionally kept.
2026-09-15 10:46:31 +08:00
袁章洪 6dcc73e9ea fix(api-reference): correct filter_ prefix claim for screener_indicators/screener_strategy keys
The response 'key' field for screener_indicators and screener_strategy was
documented as 'no filter_ prefix', but the raw API actually returns keys WITH
the prefix (verified live: filter_market, filter_industry, ...) — the SDK strips
it. Corrected to show the real prefixed example instead.
2026-09-14 19:14:20 +08:00
袁章洪 87f03f6605 docs(api-reference): simplify filter_ prefix wording in screener descriptions
Let the example value carry the meaning instead of explaining the prefix in
prose: indicator key descriptions now read 'e.g. `filter_pettm`' and the
filters param description drops the trailing '— the indicator key is prefixed
with filter_' clause (the `filter_<indicator>` example already shows it).
2026-09-14 19:12:27 +08:00
袁章洪 15f25b13fc fix(api-reference): add missing holding_units to fund_positions
Verified against rust/src/trade/types.rs FundPosition: the account had no fund
holdings to capture live (empty list), so the field was cross-checked from the
Rust wire struct. holding_units was missing from the documented item shape.
2026-09-14 19:11:15 +08:00
袁章洪 19ce5058e9 fix(api-reference): reuse sibling structure for today_orders/today_executions
today_orders and today_executions return the same Order/Execution types as
history_orders and history_executions (verified in rust/src/trade/context.rs),
and share the same wire response format. The account had no same-day data to
capture live, so their response fields are reused from the history_* siblings
(already rebuilt from live data).
2026-09-14 19:09:24 +08:00
袁章洪 c31e96b315 fix(api-reference): rebuild remaining populated endpoints from live raw API
Relaxed the empty-container guard so an endpoint whose top-level payload is
populated is regenerated even when a deeper array/object is empty in the sample
(the empty container is kept as a leaf field rather than discarding the whole
endpoint). This recovers history_orders (35 real fields, replacing 65
SDK-invented ones), screener_indicators (nested groups[].indicators[]),
index_components, business_segments_history, popular_sharelists, operating, and
others — all with field names/nesting from the real responses.

valuation and valuation_history are excluded from auto-regeneration (empty-string
metric key / per-symbol dynamic map) and will be handled manually.
2026-09-14 19:02:28 +08:00
袁章洪 6e78f07165 fix(api-reference): rebuild 4 more endpoints from live raw API
etf_asset_allocation, us_etf_files, short_positions_us, short_trades_us —
re-captured with correct params/symbols (SPY.US for ETFs, AAPL.US for US short
data) and regenerated x-response-properties from the real responses.
2026-09-14 18:59:43 +08:00
袁章洪 44d5f0d9fa fix(api-reference): regenerate 46 endpoints' response fields from live raw API
The response definitions for 46 endpoints described the SDK-transformed shape
rather than the raw HTTP wire shape. Regenerated x-response-properties directly
from live API responses (captured with real credentials), so field names,
nesting, and types now match what the API actually returns.

Key corrections include: nested structures that were wrongly flattened
(valuation_comparison, industry_valuation, industry_valuation_dist,
financial_report_snapshot, us_company_dividends, us_valuation_overview,
security_facts, profit_analysis_summary), SDK-invented fields removed
(history-order fields, executives), and raw metric names restored
(price_close, market_value, div_yld, roe, net_margin, etc.).

counter_id policy: where the raw response carries both counter_id and a
sibling symbol, only symbol is documented; where counter_id is the sole
identifier it is kept.

Endpoints whose live sample contained an empty array/object (params could not
populate the data) were intentionally left untouched to avoid dropping
documented fields; those will be handled with correct params or manually.
2026-09-14 18:53:39 +08:00
袁章洪 a53f8b187c fix(api-reference): rewrite screener_search response to real raw API shape
Verified against the live API: the response is { total, items:[{ counter_id,
name, indicators:[{key,name,value,unit}] }] } — nested indicators, not the
flat SDK-transformed { symbol, pettm, marketcap, ... } that was documented.
Indicator keys carry the filter_ prefix and values are strings; the SDK strips
the prefix and the old docs described that transformed output. Also corrected
the JSON-output warning box and removed redundant hardcoded 'interface: POST ...'
lines duplicated across five screener endpoints (zh/zh-HK only).
2026-09-14 18:44:47 +08:00
袁章洪 9ffeb621ed fix(api-reference): use raw wire field names for option_volume_daily and company_profile
option_volume_daily documented SDK-transformed names (call_volume, pc_vol,
date, top-level symbol) instead of the raw HTTP wire shape. The Rust SDK's
RawDailyStat deserializes total_call_volume/total_put_volume/
total_call_open_interest/total_put_open_interest/total_volume/
total_open_interest/put_call_volume_ratio/put_call_open_interest_ratio with a
per-record timestamp, and the top-level symbol is injected from the request
param (not in the response). Rewrote x-response-properties accordingly.

company_profile documented 'phone' but the wire field is 'Phone' (the SDK
maps it via #[serde(rename = "Phone")]).
2026-09-14 18:27:41 +08:00
袁章洪 39d195a948 docs(api): correct response fields to raw wire shape (6 verified endpoints)
Verified against the live API: docs had SDK-shaped/wrong response fields. Rewrite
to the actual raw shape:
- option_volume: c / p (docs wrongly said call_volume / put_volume)
- short_positions_hk/us, short_trades_hk/us: real data[] item fields (HK and US
  differ; docs used one wrong shape for both)
- institution_rating: evaluate{}/target{}/industry_* (docs shape was entirely wrong)
2026-09-14 17:44:36 +08:00
袁章洪 9959d7a81e docs(api): drop internal counter_id from response fields
counter_id (internal identifier, e.g. ST/HK/700) is not meaningful to API
consumers. Remove it from response properties of top_movers,
valuation_comparison, today_orders, history_orders. Kept for industry_rank /
industry_peers, which are counter_id-based endpoints; params left untouched.
2026-09-14 17:37:46 +08:00
袁章洪 fd6f12da0e fix(i18n): zh-HK docs label 文件 → 文檔
Traditional Chinese nav/search used 文件 (file) for documentation; zh-CN uses
文档, so zh-HK should be 文檔. Fixes the top-nav Docs entry and the
nav.docs / nav.searchDocs / search.placeholder strings.
2026-09-14 17:16:49 +08:00
袁章洪 2b4e7a6a8a fix(shell): preserve endpoint path when switching locale on /docs/api
The language switcher used the server-rendered currentPath, which goes stale
after the API reference navigates client-side (pushState to /docs/api/<op>) —
switching locale dropped back to /docs/api. Read the live window.location when
the menu opens, and preserve any ?query (e.g. ?page=) across locales.
2026-09-14 17:06:53 +08:00
袁章洪 e182dbebaf docs(api): autocorrect openapi.yaml (CJK/Latin spacing, half-width punctuation) 2026-09-14 16:37:21 +08:00
袁章洪 6eac1cb656 fix(api-reference): cast markdown-it-container plugin type for astro check
@types/markdown-it-container targets a different @types/markdown-it build, so
its plugin signature doesn't unify with our MarkdownIt instance — astro check
(tsc) failed. Cast it to the expected use() parameter type.
2026-09-14 16:37:21 +08:00
袁章洪 486fd9f83e docs(api): fix Authentication timestamp unit (ms → seconds)
X-Timestamp is unix SECONDS, not milliseconds. Verified against a live API call
(seconds pass, ms fail the timestamp check) and the Rust SDK
(Timestamp::now() uses as_secs()). The headers table and all 7 signing
reference implementations (cURL/Python/Node/Java/Rust/C++/Go) computed
milliseconds — copying any of them produced a 403. Corrected to seconds.
2026-09-14 16:22:30 +08:00
袁章洪 a886101314 fix(api): restore 4 operations dropped by multi-method-path rebuild
list_alerts (GET /v1/notify/reminders), delete_alert (DELETE same),
list_sharelists (GET /v1/sharelists) and sharelist_remove_securities
(DELETE /v1/sharelists/{id}/items) were silently lost: an earlier
request-example regeneration rebuilt only body-bearing methods (post/put) for
each path and its removePaths+reinsert dropped the GET/DELETE siblings on those
multi-method paths. Restore them (verified against the Rust Path: doc-comments —
0 operations now missing) and clean their descriptions. 138 → 142 ops.
2026-09-14 16:07:21 +08:00
袁章洪 22a9257279 feat(api): path-based endpoint URLs (/docs/api/<op>)
Make /docs/api/<operationId> the canonical shareable URL for an endpoint
(previously only /docs/api?op=<id> worked). The React app now reads the op from
the pathname (query ?op= kept as a fallback for old links) and pushes path URLs
on navigation. Add prerendered [op].astro routes (en + zh-CN/zh-HK) so direct
load, refresh, and sharing of /docs/api/<op> resolve — rendering the same
interactive reference, with the endpoint summary in the page title.
2026-09-14 15:45:40 +08:00
袁章洪 2191109a75 docs(api): convert <br/> in descriptions to readable text
16 trade/asset ops had raw <br/><br/> / <br/> in param & response descriptions
(carried from docs table cells). With the reference's markdown-it html:false,
these rendered as literal '<br/>' in the CSR and .md. Convert consecutive <br/>
to '. ' (paragraph) and single <br/> to ', ' (inline enum lists) across 359
fields.
2026-09-14 13:42:38 +08:00
袁章洪 9c8334d028 docs(api): fix nested-body request examples + strip redundant Endpoint lines
The request-example generator flattened nested body objects into malformed JSON
— e.g. submit_order emitted both "attached_params":{} and dotted top-level keys
"attached_params.attached_order_type", which an AI would send verbatim as a
wrong payload. Build real nested JSON from dotted param names (skipping the bare
container param), keyed by leaf name. Also strip the redundant 'Endpoint:
`METHOD /path`' line from 5 descriptions (the header already shows method+path).
2026-09-14 12:29:36 +08:00
袁章洪 5b62fb3061 docs(api): strip 120 dead type-anchor links from response descriptions
Response-property descriptions carried docs-internal 'see [TypeName](#TypeName)'
links to Schema sections that don't exist in the reference (the nested fields
are already inlined below each object). Strip the dead anchors across 20 ops.
2026-09-14 12:23:41 +08:00
袁章洪 161996c8c0 docs(api): clean description artifacts (escapes + dead relative links)
Un-escape literal \n / \{ \} carried from docs tables (e.g. create_topic
body/tickers) and strip relative cross-ref links [text](./x)/(../x) that don't
resolve in the reference (some pointed to the removed questionnaire endpoint),
keeping the link text.
2026-09-14 12:09:50 +08:00
袁章洪 eb3a3c6fed docs(api): clearer no-params message
'No request body fields defined in this spec' was misleading for paramless GET
endpoints (screener_indicators, rank_categories, list_watchlist_groups, etc.).
Reword to 'This endpoint takes no request parameters.' / 此接口无需请求参数。
2026-09-14 11:57:00 +08:00
袁章洪 16bf8d1f21 docs(api): extract request params for content/AI ops (Request-Body format)
10 content/AI ops (create_topic, create_topic_reply, ai_conversation,
topic_detail, list_topic_replies, list_news, list_topics, list_my_topics,
ai_public_agents, ai_workspace_agents) documented their params under
'## Request' > '### Path/Query Parameters' / '### Request Body' — a format the
original generators (which only read '## Parameters') skipped, so they showed
the empty-body fallback with no params. Extract them trilingually, reconcile
path-param names with the URL placeholders (docs 'id' → '{agent_id}'), and
regenerate raw-HTTP request examples.
2026-09-14 11:56:03 +08:00
袁章洪 5e5efb3a94 docs(api): convert 7 legacy-format ops to the x-* model
list_securities, list_filings, list_market_temperature, market_temperature,
list_statements, get_statement_download_url and ai_continue were early
hand-authored entries using standard OpenAPI 'parameters' + x-codeSamples with
no x-parameters / x-request-examples / x-response-properties — so the reference
showed the empty-body fallback instead of a params table and emitted request
examples with no query/path substitution. Author trilingual x-parameters +
x-response-properties and regenerate raw-HTTP request examples for each.
2026-09-14 11:52:30 +08:00
袁章洪 88fe062d22 docs(api): render :::admonitions as docs-style callout boxes
Region warnings, tips, etc. were rendering as plain blockquotes in the
reference. Convert them back to ::: container syntax in the descriptions and
add a markdown-it-container plugin that emits the same DOM as the docs
remark-callout (.callout.callout-<type> + .callout-title), with the docs
callout.css copied into the package. Now :::warning/:::tip render as the same
colored boxes as docs; the .md keeps readable ::: blocks for AI consumers.
2026-09-14 11:44:08 +08:00
袁章洪 dd5fba5292 docs(api): style QuotePermission card to match docs
The reference's QuotePermission was rendering unstyled (plain text, no green
box / shield icon / badge pill) because its class names had no CSS and it only
supported 'command' (level-only watchlist ops rendered nothing). Port it 1:1
from the docs MDX component: shield icon, data-level color theming, market tag,
description, footer link + note; resolve command/level/market. Copy the docs
QuotePermission.css into the package and load it via api-reference.css.
2026-09-14 11:35:36 +08:00
袁章洪 ba609b634a docs(api): 3-level sidebar mirroring docs (section > subsection > endpoint)
Add x-subgroup (docs subsection) to every op and x-subgroups (ordered
subsection labels, trilingual) to each tag, so the reference sidebar nests
like the docs menu: e.g. 行情 > 个股行情/期权/数据分析/自选股, 交易 >
订单/网格交易/成交/资产. Screener stays flat (no docs subsections).

- Loader: SubGroup type; parseSpec partitions each tag's endpoints into
  ordered subgroups (by op x-subgroup, ordered per tag x-subgroups) plus
  leftover flat endpoints.
- ApiReference: nested collapsible subgroup level in the sidebar.
- openapi-markdown: render ## section > ### subsection > #### endpoint;
  fix endpointList / endpointMarkdownById to include subgroup endpoints
  (they previously only walked flat endpoints, 404-ing per-endpoint .md).
2026-09-14 11:30:19 +08:00
袁章洪 57f5c65f22 docs(api): align reference sidebar groups with docs sections
Retag every operation to its docs section (derived from the backing page's
top-level dir) so the reference menu mirrors the docs sidebar: Quote/行情,
Fundamental/基本面, Market/市场, News & Contents/资讯与社区, Screener/选股,
Trade/交易, Account/账户, AI Agent — trilingual, in docs order. Replaces the
prior function-based tags (Analytics/Assets/Grid/DCA/Alert/Signals/...).
2026-09-14 11:11:21 +08:00
袁章洪 07a0ab4e4a docs(api): inline OrderType/OrderStatus enum values into descriptions
The relative link '../trade-definition#ordertype|orderstatus' does not resolve
in the reference context (CSR page or per-endpoint .md), leaving the AI with no
enum values. Inline the full value list (33 param/response fields) so each
endpoint is self-contained.
2026-09-14 10:37:47 +08:00
袁章洪 c6a6abaf0b docs(api): carry special docs markers (quote permission, region warnings) into reference
Audited all 116 backing-page ops for special markers. Fixes:
- QuotePermission: render x-quote-command/level/market as a callout in BOTH
  the CSR page and the AI markdown (openapi-markdown resolves
  quote-permissions.yaml). Convert the 4 watchlist ops' leaked
  '<QuotePermission level="basic" />' raw tags to x-quote-level: basic.
- Convert 2 topics ops' leaked '<TipContainer>' tags to blockquotes.
- Restore 3 admonitions dropped by the description cut / descOverride:
  dca_toggle (US-account region warning), grid_trigger_history (uses
  grid_order_id not order_id), ai_conversation (how to find an Agent UID).
- Loader: add x-quote-level / x-quote-market. CSR: pass level+market to
  <QuotePermission>, render when any of command/level/market is set.
2026-09-14 10:34:23 +08:00
袁章洪 fa27c69ec1 docs(api): fix AI-consumption issues from review
- Correct 5 endpoints' request params to true HTTP wire names (Rust does
  client-side transforms): screener/search body (filters/returns/page/size),
  broker-holding (add type), broker-holding/daily (parti_number),
  ahpremium/klines (line_type/line_num), finance_calendar (date/date_end/
  types[]/markets[]); fix finance_calendar response type wire name.
- Make POST examples executable: include full body (not just required) with
  type-aware placeholders (arrays/ints/objects), so top_movers etc. no longer
  emit an empty POST.
- Disambiguate duplicate summaries: short_positions/short_trades hk vs us now
  carry market-specific titles.
- Strip embedded leading headings from descriptions (removes duplicate H1).
- Renderer: drop page-body heading that repeats the page title (fixes the
  doubled '## Error Codes' in the aggregated api.md).
2026-09-14 10:16:01 +08:00
袁章洪 270bc99933 docs(api): add Signals (/v1/signals, /v1/facts/security_facts) + ETF asset allocation — 4 hand-authored ops 2026-09-14 09:55:37 +08:00
袁章洪 773505ac99 docs(api): add Screener (/v1/quote/ai/screener/*) — 5 ops, tag 'Screener' 2026-09-11 18:36:38 +08:00
袁章洪 e5cd3d551e docs(api): add fundamental/market, market, options, short-interest, exec-all (23 ops) 2026-09-11 18:35:44 +08:00
袁章洪 a0767b2c92 docs(api): add Analytics/Fundamental batch (~40 ops, tag 'Analytics') 2026-09-11 18:28:40 +08:00
袁章洪 a35b7ac292 docs(api): add AI (/v1/ai/*) — 5 ops, tag 'AI' 2026-09-11 17:11:39 +08:00
袁章洪 50009b99e9 docs(api): add Alert (/v1/notify/reminders) — 4 ops, tag 'Alert' 2026-09-11 17:11:10 +08:00
袁章洪 727eff2bd9 docs(api): add Content (news/topics/sharelists) — 15 ops, tag 'Content' 2026-09-11 17:10:45 +08:00
袁章洪 86869c59eb docs(api): migrate Assets (/v1/asset/*, /v1/portfolio/*, /v1/risk/*, /v1/us/assets/*) — 12 ops, tag 'Assets' 2026-09-11 17:09:41 +08:00