echopai 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +63 -348
  2. package/dist/bin.js +8388 -190
  3. package/package.json +11 -13
  4. package/dist/_generated/commands.js +0 -378
  5. package/dist/_generated/help.js +0 -295
  6. package/dist/_generated/operations.js +0 -2385
  7. package/dist/runtime/auth.js +0 -95
  8. package/dist/runtime/envelope.js +0 -52
  9. package/dist/runtime/errors.js +0 -186
  10. package/dist/runtime/filters.js +0 -153
  11. package/dist/runtime/format.js +0 -143
  12. package/dist/runtime/http.js +0 -65
  13. package/dist/runtime/idempotency.js +0 -18
  14. package/dist/runtime/invoker.js +0 -391
  15. package/dist/runtime/io.js +0 -16
  16. package/dist/runtime/paginator.js +0 -146
  17. package/dist/runtime/trace.js +0 -99
  18. package/dist/runtime/tty.js +0 -51
  19. package/dist/runtime/update_check.js +0 -120
  20. package/dist/runtime/update_worker.js +0 -63
  21. package/dist/runtime/verb_cmd.js +0 -72
  22. package/dist/runtime/verb_runner.js +0 -152
  23. package/dist/runtime/whoami_cache.js +0 -109
  24. package/dist/tools/api.js +0 -81
  25. package/dist/tools/completion.js +0 -116
  26. package/dist/tools/config.js +0 -123
  27. package/dist/tools/doctor.js +0 -183
  28. package/dist/tools/login.js +0 -99
  29. package/dist/tools/mcp.js +0 -141
  30. package/dist/tools/raw.js +0 -96
  31. package/dist/tools/schema.js +0 -58
  32. package/dist/tools/trace.js +0 -54
  33. package/dist/tools/upgrade.js +0 -103
  34. package/dist/tools/welcome.js +0 -225
  35. package/dist/tools/whoami.js +0 -132
  36. package/dist/verbs/_spec.js +0 -15
  37. package/dist/verbs/announcements.js +0 -195
  38. package/dist/verbs/bars_batch.js +0 -66
  39. package/dist/verbs/chart.js +0 -110
  40. package/dist/verbs/concepts.js +0 -393
  41. package/dist/verbs/digest.js +0 -351
  42. package/dist/verbs/financials.js +0 -212
  43. package/dist/verbs/hot.js +0 -29
  44. package/dist/verbs/index.js +0 -88
  45. package/dist/verbs/limit_up.js +0 -156
  46. package/dist/verbs/lookup.js +0 -72
  47. package/dist/verbs/market.js +0 -185
  48. package/dist/verbs/news.js +0 -81
  49. package/dist/verbs/quote.js +0 -53
  50. package/dist/verbs/scan.js +0 -42
  51. package/dist/verbs/search.js +0 -105
  52. package/dist/verbs/sentiment.js +0 -231
  53. package/dist/verbs/views.js +0 -85
  54. package/dist/version.js +0 -5
@@ -1,2385 +0,0 @@
1
- /**
2
- * AUTO-GENERATED — DO NOT EDIT BY HAND.
3
- *
4
- * Source: docs/api-contract/openapi.yaml (operations with x-cli-key + x-visibility: public)
5
- * Generator: scripts/codegen/generate_cli_v2.py
6
- *
7
- * Regenerate:
8
- * make codegen
9
- */
10
- export const OPERATIONS = {
11
- "agent.session-end": {
12
- "cliKey": "agent.session-end",
13
- "cliName": "agent session-end",
14
- "method": "POST",
15
- "path": "/v1/agent/session/{id}/end",
16
- "description": "关闭 `/v1/agent/session/start` 开启的会话,最终用量提交入库。",
17
- "summary": "End a billable agent session",
18
- "positional": [
19
- "id"
20
- ],
21
- "outputDefault": "json",
22
- "pagination": "none",
23
- "stream": false,
24
- "billable": false,
25
- "idempotencyRequired": true,
26
- "scopesAny": [
27
- "agent:session.create",
28
- "agent:session.read"
29
- ],
30
- "sideEffect": "write",
31
- "dryRunSupported": false,
32
- "inputSchema": {
33
- "type": "object",
34
- "properties": {
35
- "id": {
36
- "type": "string",
37
- "description": "Session id returned by /v1/agent/session/start."
38
- }
39
- },
40
- "additionalProperties": false,
41
- "required": [
42
- "id"
43
- ]
44
- }
45
- },
46
- "agent.session-start": {
47
- "cliKey": "agent.session-start",
48
- "cliName": "agent session-start",
49
- "method": "POST",
50
- "path": "/v1/agent/session/start",
51
- "description": "开启 agent kind 凭据的计费会话。返回 session_id,用于将多次调用归并到一次 billable 单位。需要 `Idempotency-Key` 头。",
52
- "summary": "Start a billable agent session",
53
- "positional": [],
54
- "outputDefault": "json",
55
- "pagination": "none",
56
- "stream": false,
57
- "billable": false,
58
- "idempotencyRequired": true,
59
- "scopesAny": [
60
- "agent:session.create"
61
- ],
62
- "sideEffect": "write",
63
- "dryRunSupported": true,
64
- "inputSchema": {
65
- "type": "object",
66
- "properties": {
67
- "agent_id": {
68
- "type": "string",
69
- "maxLength": 200,
70
- "description": "Partner-defined agent identifier (max 200 chars).",
71
- "example": "agent-prod-1"
72
- },
73
- "conversation_id": {
74
- "type": "string",
75
- "maxLength": 200,
76
- "description": "Optional conversation thread id (max 200 chars)."
77
- },
78
- "scopes": {
79
- "type": "array",
80
- "items": {
81
- "type": "string"
82
- },
83
- "description": "Subset of partner scopes to derive into the agent token. Omit for \"all derivable from partner scopes\"."
84
- },
85
- "budget_usd": {
86
- "type": "number",
87
- "exclusiveMinimum": 0,
88
- "maximum": 1000,
89
- "default": 1.0,
90
- "description": "Hard USD budget cap; session terminates when exhausted (0 < x ≤ 1000).",
91
- "example": 1.0
92
- },
93
- "ttl_seconds": {
94
- "type": "integer",
95
- "minimum": 60,
96
- "maximum": 28800,
97
- "default": 3600,
98
- "description": "Session lifetime cap (60 ≤ x ≤ 28800, default 1h)."
99
- },
100
- "metadata": {
101
- "type": "object",
102
- "description": "Free-form JSON object for partner bookkeeping (e.g. user_intent, model name)."
103
- }
104
- },
105
- "additionalProperties": false,
106
- "required": [
107
- "agent_id"
108
- ]
109
- }
110
- },
111
- "agent.session-usage": {
112
- "cliKey": "agent.session-usage",
113
- "cliName": "agent session-usage",
114
- "method": "GET",
115
- "path": "/v1/agent/session/{id}/usage",
116
- "description": "返回 session 内累计 billable 调用次数、各 scope 配额消耗。",
117
- "summary": "Get cumulative usage of an agent session",
118
- "positional": [
119
- "id"
120
- ],
121
- "outputDefault": "json",
122
- "pagination": "none",
123
- "stream": false,
124
- "billable": false,
125
- "idempotencyRequired": false,
126
- "scopesAny": [
127
- "agent:session.create",
128
- "agent:session.read"
129
- ],
130
- "sideEffect": "read",
131
- "dryRunSupported": false,
132
- "inputSchema": {
133
- "type": "object",
134
- "properties": {
135
- "id": {
136
- "type": "string",
137
- "description": "Session id returned by /v1/agent/session/start."
138
- }
139
- },
140
- "additionalProperties": false,
141
- "required": [
142
- "id"
143
- ]
144
- }
145
- },
146
- "announcements.detail": {
147
- "cliKey": "announcements.detail",
148
- "cliName": "announcements detail",
149
- "method": "GET",
150
- "path": "/v1/announcements/{announcement_id}",
151
- "description": "返回公告完整内容:content_md、content_text、cninfo 元数据、解析状态。",
152
- "summary": "Fetch a single announcement by id",
153
- "positional": [
154
- "announcement_id"
155
- ],
156
- "outputDefault": "json",
157
- "pagination": "none",
158
- "stream": false,
159
- "billable": true,
160
- "idempotencyRequired": false,
161
- "scopesAny": [
162
- "announcements:read"
163
- ],
164
- "sideEffect": "read",
165
- "dryRunSupported": false,
166
- "inputSchema": {
167
- "type": "object",
168
- "properties": {
169
- "announcement_id": {
170
- "type": "string",
171
- "format": "uuid",
172
- "description": "UUID(feed / stock 返回的 items[].id)。"
173
- }
174
- },
175
- "additionalProperties": false,
176
- "required": [
177
- "announcement_id"
178
- ]
179
- }
180
- },
181
- "announcements.feed": {
182
- "cliKey": "announcements.feed",
183
- "cliName": "announcements feed",
184
- "method": "GET",
185
- "path": "/v1/announcements/feed",
186
- "description": "A 股公告 feed,按 published_at 降序、同日按 cninfo source_id 降序。可按 type / since 过滤。需要 `announcements:read` scope。",
187
- "summary": "List recent A-share announcements",
188
- "positional": [],
189
- "outputDefault": "json",
190
- "pagination": "offset",
191
- "stream": false,
192
- "billable": true,
193
- "idempotencyRequired": false,
194
- "scopesAny": [
195
- "announcements:read"
196
- ],
197
- "sideEffect": "read",
198
- "dryRunSupported": false,
199
- "inputSchema": {
200
- "type": "object",
201
- "properties": {
202
- "since": {
203
- "type": "string",
204
- "format": "date-time",
205
- "description": "ISO datetime 下限(published_at >= since)。"
206
- },
207
- "type": {
208
- "type": "string",
209
- "maxLength": 64,
210
- "description": "分类 slug(见 classifier.py TYPES,如 annual_report、equity_change)。"
211
- },
212
- "limit": {
213
- "type": "integer",
214
- "minimum": 1,
215
- "maximum": 200,
216
- "default": 50,
217
- "description": "Max items per page."
218
- },
219
- "offset": {
220
- "type": "integer",
221
- "minimum": 0,
222
- "default": 0,
223
- "description": "Pagination offset (items to skip)."
224
- }
225
- },
226
- "additionalProperties": false
227
- }
228
- },
229
- "announcements.stock": {
230
- "cliKey": "announcements.stock",
231
- "cliName": "announcements stock",
232
- "method": "GET",
233
- "path": "/v1/announcements/stock",
234
- "description": "指定股票代码的公告列表(含历史窗口)。代码接受 6 位纯数字或 SSE:600519 / SZSE:000001 / BSE:430000 形式。需要 `announcements:read` scope。",
235
- "summary": "List announcements for a specific A-share security",
236
- "positional": [],
237
- "outputDefault": "json",
238
- "pagination": "offset",
239
- "stream": false,
240
- "billable": true,
241
- "idempotencyRequired": false,
242
- "scopesAny": [
243
- "announcements:read"
244
- ],
245
- "sideEffect": "read",
246
- "dryRunSupported": false,
247
- "inputSchema": {
248
- "type": "object",
249
- "properties": {
250
- "code": {
251
- "type": "string",
252
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
253
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
254
- "example": "SSE:600519"
255
- },
256
- "since_days": {
257
- "type": "integer",
258
- "minimum": 1,
259
- "maximum": 1825,
260
- "default": 30,
261
- "description": "回看天数(最多 5 年)。"
262
- },
263
- "type": {
264
- "type": "string",
265
- "maxLength": 64,
266
- "description": "分类 slug 过滤(与 /v1/announcements/feed 同集合)。"
267
- },
268
- "limit": {
269
- "type": "integer",
270
- "minimum": 1,
271
- "maximum": 200,
272
- "default": 50,
273
- "description": "Max items per page."
274
- },
275
- "offset": {
276
- "type": "integer",
277
- "minimum": 0,
278
- "default": 0,
279
- "description": "Pagination offset (items to skip)."
280
- }
281
- },
282
- "additionalProperties": false,
283
- "required": [
284
- "code"
285
- ]
286
- }
287
- },
288
- "auth.whoami": {
289
- "cliKey": "auth.whoami",
290
- "cliName": "auth whoami",
291
- "method": "GET",
292
- "path": "/v1/auth/whoami",
293
- "description": "Returns the calling token's kind, scopes, audience, app metadata,\nrate_limit, allowed_clients, agent_budget (if kind=agent), api_version,\nfeature_flags. Any valid JWT can call — no specific scope required.\n\nCLI/MCP call this once at startup, cache 5 minutes in-process, and use\nthe response to derive `verbs.available` (intersection of curated verb\nscopes with token scopes) and to populate `echopai doctor` checks.\n\nSee `docs/PLAN_CLI_V2_AGENT_SURFACE.md` §5.1.\n",
294
- "summary": "Token introspection (CLI/MCP capability discovery)",
295
- "positional": [],
296
- "outputDefault": "json",
297
- "pagination": "none",
298
- "stream": false,
299
- "billable": false,
300
- "idempotencyRequired": false,
301
- "scopesAny": [],
302
- "sideEffect": "read",
303
- "dryRunSupported": false,
304
- "inputSchema": {
305
- "type": "object",
306
- "properties": {},
307
- "additionalProperties": false
308
- }
309
- },
310
- "bars.daily": {
311
- "cliKey": "bars.daily",
312
- "cliName": "bars daily",
313
- "method": "GET",
314
- "path": "/v1/bars/daily",
315
- "description": "Daily OHLC bars for one A-share security over a date range. Returns open / high / low / close / volume / turnover per trading day. Requires `bars:30d` (last 30 trading days) or `bars:full` (full history) scope.",
316
- "summary": "Daily OHLC bars for one A-share security",
317
- "positional": [],
318
- "outputDefault": "json",
319
- "pagination": "none",
320
- "stream": false,
321
- "billable": true,
322
- "idempotencyRequired": false,
323
- "scopesAny": [
324
- "bars:30d",
325
- "bars:full"
326
- ],
327
- "sideEffect": "read",
328
- "dryRunSupported": false,
329
- "inputSchema": {
330
- "type": "object",
331
- "properties": {
332
- "code": {
333
- "type": "string",
334
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
335
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
336
- "example": "SSE:600519"
337
- },
338
- "from": {
339
- "type": "string",
340
- "format": "date",
341
- "description": "Inclusive start date (YYYY-MM-DD).",
342
- "example": "2026-01-01"
343
- },
344
- "to": {
345
- "type": "string",
346
- "format": "date",
347
- "description": "Inclusive end date (YYYY-MM-DD).",
348
- "example": "2026-05-01"
349
- }
350
- },
351
- "additionalProperties": false,
352
- "required": [
353
- "code",
354
- "from",
355
- "to"
356
- ]
357
- }
358
- },
359
- "bars.daily-batch": {
360
- "cliKey": "bars.daily-batch",
361
- "cliName": "bars daily-batch",
362
- "method": "GET",
363
- "path": "/v1/bars/daily-batch",
364
- "description": "Batch daily OHLC bars for multiple A-share securities. Up to 100 codes\nper call, up to 1-year date range. Single round-trip; ClickHouse `IN(...)`\nunder the hood.\n\nReturns partial success envelope: codes denied by `allowed_securities`\nappear in `errors[]`, others in `items[]` (with empty `bars[]` if no\ndata found). Order in `items[]` matches input order.\n\nRequires `bars:30d` or `bars:full` scope.\n",
365
- "summary": "Batch daily OHLC bars for up to 100 A-share securities",
366
- "positional": [],
367
- "outputDefault": "json",
368
- "pagination": "none",
369
- "stream": false,
370
- "billable": true,
371
- "idempotencyRequired": false,
372
- "scopesAny": [
373
- "bars:30d",
374
- "bars:full"
375
- ],
376
- "sideEffect": "read",
377
- "dryRunSupported": false,
378
- "inputSchema": {
379
- "type": "object",
380
- "properties": {
381
- "codes": {
382
- "type": "array",
383
- "items": {
384
- "type": "string",
385
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
386
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
387
- "example": "SSE:600519"
388
- },
389
- "minItems": 1,
390
- "maxItems": 100,
391
- "description": "1-100 canonical codes; CSV-encoded on the wire.",
392
- "example": [
393
- "SSE:600519",
394
- "SZSE:000001"
395
- ]
396
- },
397
- "from": {
398
- "type": "string",
399
- "format": "date",
400
- "description": "Inclusive start date (YYYY-MM-DD)."
401
- },
402
- "to": {
403
- "type": "string",
404
- "format": "date",
405
- "description": "Inclusive end date (YYYY-MM-DD). Range must be ≤ 365 days."
406
- }
407
- },
408
- "additionalProperties": false,
409
- "required": [
410
- "codes",
411
- "from",
412
- "to"
413
- ]
414
- }
415
- },
416
- "bars.minute": {
417
- "cliKey": "bars.minute",
418
- "cliName": "bars minute",
419
- "method": "GET",
420
- "path": "/v1/bars/minute",
421
- "description": "Minute-level OHLC bars for one A-share security on a single trade date. Requires `bars:30d` or `bars:full` scope.",
422
- "summary": "Minute-level OHLC bars for one A-share security",
423
- "positional": [],
424
- "outputDefault": "json",
425
- "pagination": "none",
426
- "stream": false,
427
- "billable": true,
428
- "idempotencyRequired": false,
429
- "scopesAny": [
430
- "bars:30d",
431
- "bars:full"
432
- ],
433
- "sideEffect": "read",
434
- "dryRunSupported": false,
435
- "inputSchema": {
436
- "type": "object",
437
- "properties": {
438
- "code": {
439
- "type": "string",
440
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
441
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
442
- "example": "SSE:600519"
443
- },
444
- "date": {
445
- "type": "string",
446
- "format": "date",
447
- "description": "Single trade date (YYYY-MM-DD). Returns 240 minute bars for that session.",
448
- "example": "2026-05-09"
449
- }
450
- },
451
- "additionalProperties": false,
452
- "required": [
453
- "code",
454
- "date"
455
- ]
456
- }
457
- },
458
- "bars.minute-batch": {
459
- "cliKey": "bars.minute-batch",
460
- "cliName": "bars minute-batch",
461
- "method": "GET",
462
- "path": "/v1/bars/minute-batch",
463
- "description": "Batch minute OHLC bars for multiple A-share securities. Up to 20 codes\nper call, up to 7 calendar days (≈5 trading days) date range. Single\nClickHouse round-trip; app groups rows by canonical_code.\n\nPartial success envelope same as daily-batch: codes denied by\n`allowed_securities` go to `errors[]`; others to `items[]` with flat\n`bars[]` (each bar carries its own `trade_date` for client grouping).\n\nRequires `bars:30d` or `bars:full` scope.\n",
464
- "summary": "Batch minute OHLC bars for up to 20 A-share securities",
465
- "positional": [],
466
- "outputDefault": "json",
467
- "pagination": "none",
468
- "stream": false,
469
- "billable": true,
470
- "idempotencyRequired": false,
471
- "scopesAny": [
472
- "bars:30d",
473
- "bars:full"
474
- ],
475
- "sideEffect": "read",
476
- "dryRunSupported": false,
477
- "inputSchema": {
478
- "type": "object",
479
- "properties": {
480
- "codes": {
481
- "type": "array",
482
- "items": {
483
- "type": "string",
484
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
485
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
486
- "example": "SSE:600519"
487
- },
488
- "minItems": 1,
489
- "maxItems": 20,
490
- "description": "1-20 canonical codes; CSV-encoded on the wire.",
491
- "example": [
492
- "SSE:600519",
493
- "SZSE:000001"
494
- ]
495
- },
496
- "from": {
497
- "type": "string",
498
- "format": "date",
499
- "description": "Inclusive start date (YYYY-MM-DD)."
500
- },
501
- "to": {
502
- "type": "string",
503
- "format": "date",
504
- "description": "Inclusive end date. Range must be ≤ 7 calendar days."
505
- }
506
- },
507
- "additionalProperties": false,
508
- "required": [
509
- "codes",
510
- "from",
511
- "to"
512
- ]
513
- }
514
- },
515
- "concepts.alerts": {
516
- "cliKey": "concepts.alerts",
517
- "cliName": "concepts alerts",
518
- "method": "GET",
519
- "path": "/v1/concepts/alerts",
520
- "description": "Returns the live `concept_alerts:active` hash. Two rules:\n - big_move: abs(pct_change) > 3%\n - limit_up_cluster: limit_up_count >= 3 AND stock_count >= 5\nSee PLAN_CONCEPT_INDUSTRY_QUOTE §5.5 \"异动检测与推送\".\n",
521
- "summary": "Currently active concept alerts (big_move / limit_up_cluster)",
522
- "positional": [],
523
- "outputDefault": "json",
524
- "pagination": "none",
525
- "stream": false,
526
- "billable": false,
527
- "idempotencyRequired": false,
528
- "scopesAny": [
529
- "quote:l1",
530
- "quote:l2",
531
- "quote:delayed"
532
- ],
533
- "sideEffect": "read",
534
- "dryRunSupported": false,
535
- "inputSchema": {
536
- "type": "object",
537
- "properties": {},
538
- "additionalProperties": false
539
- }
540
- },
541
- "concepts.alerts-history": {
542
- "cliKey": "concepts.alerts-history",
543
- "cliName": "concepts alerts-history",
544
- "method": "GET",
545
- "path": "/v1/concepts/alerts/history",
546
- "description": "Concept异动 historical events (default last 24h). Filter by rule (big_move / limit_up_cluster) and time window. Used by AI agent / admin review.",
547
- "summary": "Concept alerts history (last 24h)",
548
- "positional": [],
549
- "outputDefault": "json",
550
- "pagination": "none",
551
- "stream": false,
552
- "billable": false,
553
- "idempotencyRequired": false,
554
- "scopesAny": [
555
- "quote:l1",
556
- "quote:l2",
557
- "quote:delayed"
558
- ],
559
- "sideEffect": "read",
560
- "dryRunSupported": false,
561
- "inputSchema": {
562
- "type": "object",
563
- "properties": {
564
- "from": {
565
- "type": "integer",
566
- "description": "Unix ms; default = now - 24h"
567
- },
568
- "to": {
569
- "type": "integer",
570
- "description": "Window end. For daily/minute bars: ISO date `YYYY-MM-DD`. For alerts history: Unix milliseconds (default = now)."
571
- },
572
- "rule": {
573
- "type": "string",
574
- "enum": [
575
- "big_move",
576
- "limit_up_cluster"
577
- ],
578
- "description": "Filter by alert rule: big_move (|pct| > 3%) or limit_up_cluster (≥3 limit-ups & ≥5 stocks)."
579
- },
580
- "limit": {
581
- "type": "integer",
582
- "minimum": 1,
583
- "maximum": 2000,
584
- "default": 500,
585
- "description": "Maximum number of items to return."
586
- }
587
- },
588
- "additionalProperties": false
589
- }
590
- },
591
- "concepts.daily-bars": {
592
- "cliKey": "concepts.daily-bars",
593
- "cliName": "concepts daily-bars",
594
- "method": "GET",
595
- "path": "/v1/concepts/{concept_id}/daily-bars",
596
- "description": "Returns daily OHLC (concept index points, not stock prices average),\nbreadth fields, and is_backfilled flag. See PLAN §5.4 algorithm.\n",
597
- "summary": "Concept index daily bars (chain-linked equal-weight, base 1000)",
598
- "positional": [
599
- "concept_id"
600
- ],
601
- "outputDefault": "json",
602
- "pagination": "none",
603
- "stream": false,
604
- "billable": true,
605
- "idempotencyRequired": false,
606
- "scopesAny": [
607
- "bars:read"
608
- ],
609
- "sideEffect": "read",
610
- "dryRunSupported": false,
611
- "inputSchema": {
612
- "type": "object",
613
- "properties": {
614
- "concept_id": {
615
- "type": "integer",
616
- "description": "Concept primary key (PG concepts.id)."
617
- },
618
- "from": {
619
- "type": "string",
620
- "format": "date",
621
- "description": "Window start. For daily/minute bars: ISO date `YYYY-MM-DD`. For alerts history: Unix milliseconds (default = now - 24h)."
622
- },
623
- "to": {
624
- "type": "string",
625
- "format": "date",
626
- "description": "Window end. For daily/minute bars: ISO date `YYYY-MM-DD`. For alerts history: Unix milliseconds (default = now)."
627
- }
628
- },
629
- "additionalProperties": false,
630
- "required": [
631
- "concept_id",
632
- "from",
633
- "to"
634
- ]
635
- }
636
- },
637
- "concepts.list": {
638
- "cliKey": "concepts.list",
639
- "cliName": "concepts list",
640
- "method": "GET",
641
- "path": "/v1/concepts",
642
- "description": "Concept list joining CH `v_concept_meta` with Redis snapshot hash\n`stockpulse:concept_snapshots:latest`. Each item includes 6 live\nfields (pct_change / index_value / up/down_count / limit_up_count /\namount) refreshed every ~15s by stockpulse-rs collector.\n\nSource / status / index are computed per PLAN_CONCEPT_INDUSTRY_QUOTE\n§5.4 algorithm (chain-linked equal-weight returns, base = 1000).\n",
643
- "summary": "List concepts with live snapshot (6 fields)",
644
- "positional": [],
645
- "outputDefault": "json",
646
- "pagination": "none",
647
- "stream": false,
648
- "billable": true,
649
- "idempotencyRequired": false,
650
- "scopesAny": [
651
- "quote:l1",
652
- "quote:l2",
653
- "quote:delayed"
654
- ],
655
- "sideEffect": "read",
656
- "dryRunSupported": false,
657
- "inputSchema": {
658
- "type": "object",
659
- "properties": {
660
- "status": {
661
- "type": "string",
662
- "enum": [
663
- "active",
664
- "pending_review",
665
- "deprecated"
666
- ],
667
- "default": "active",
668
- "description": "Concept status filter (active / pending_review / deprecated)."
669
- },
670
- "sort": {
671
- "type": "string",
672
- "enum": [
673
- "pct",
674
- "amount",
675
- "limit_up",
676
- "stock_count"
677
- ],
678
- "default": "pct",
679
- "description": "Sort field for the snapshot view: pct / amount / limit_up / stock_count."
680
- },
681
- "limit": {
682
- "type": "integer",
683
- "minimum": 1,
684
- "maximum": 1000,
685
- "default": 500,
686
- "description": "Maximum number of items to return."
687
- }
688
- },
689
- "additionalProperties": false
690
- }
691
- },
692
- "concepts.minute-bars": {
693
- "cliKey": "concepts.minute-bars",
694
- "cliName": "concepts minute-bars",
695
- "method": "GET",
696
- "path": "/v1/concepts/{concept_id}/minute-bars",
697
- "description": "Concept index minute-level OHLC (chain-linked equal-weight, base = 1000), max 7 days per request. See PLAN_CONCEPT_INDUSTRY_QUOTE §5.4.",
698
- "summary": "Concept index minute bars (max 7 days)",
699
- "positional": [
700
- "concept_id"
701
- ],
702
- "outputDefault": "json",
703
- "pagination": "none",
704
- "stream": false,
705
- "billable": true,
706
- "idempotencyRequired": false,
707
- "scopesAny": [
708
- "bars:read"
709
- ],
710
- "sideEffect": "read",
711
- "dryRunSupported": false,
712
- "inputSchema": {
713
- "type": "object",
714
- "properties": {
715
- "concept_id": {
716
- "type": "integer",
717
- "description": "Concept primary key (PG concepts.id)."
718
- },
719
- "from": {
720
- "type": "string",
721
- "format": "date",
722
- "description": "Window start. For daily/minute bars: ISO date `YYYY-MM-DD`. For alerts history: Unix milliseconds (default = now - 24h)."
723
- },
724
- "to": {
725
- "type": "string",
726
- "format": "date",
727
- "description": "Window end. For daily/minute bars: ISO date `YYYY-MM-DD`. For alerts history: Unix milliseconds (default = now)."
728
- }
729
- },
730
- "additionalProperties": false,
731
- "required": [
732
- "concept_id",
733
- "from",
734
- "to"
735
- ]
736
- }
737
- },
738
- "concepts.news": {
739
- "cliKey": "concepts.news",
740
- "cliName": "concepts news",
741
- "method": "GET",
742
- "path": "/v1/concepts/{concept_id}/news",
743
- "description": "Short-term implementation: ILIKE on news.title + content with the\nconcept name and full_name. Long-term: news AI tagging.\n",
744
- "summary": "Related news matching concept name (ILIKE)",
745
- "positional": [
746
- "concept_id"
747
- ],
748
- "outputDefault": "json",
749
- "pagination": "none",
750
- "stream": false,
751
- "billable": true,
752
- "idempotencyRequired": false,
753
- "scopesAny": [
754
- "news:read"
755
- ],
756
- "sideEffect": "read",
757
- "dryRunSupported": false,
758
- "inputSchema": {
759
- "type": "object",
760
- "properties": {
761
- "concept_id": {
762
- "type": "integer",
763
- "description": "Concept primary key (PG concepts.id)."
764
- },
765
- "days": {
766
- "type": "integer",
767
- "minimum": 1,
768
- "maximum": 365,
769
- "default": 30,
770
- "description": "Lookback window in days for news search."
771
- },
772
- "limit": {
773
- "type": "integer",
774
- "minimum": 1,
775
- "maximum": 200,
776
- "default": 50,
777
- "description": "Maximum number of items to return."
778
- }
779
- },
780
- "additionalProperties": false,
781
- "required": [
782
- "concept_id"
783
- ]
784
- }
785
- },
786
- "concepts.show": {
787
- "cliKey": "concepts.show",
788
- "cliName": "concepts show",
789
- "method": "GET",
790
- "path": "/v1/concepts/{concept_id}",
791
- "description": "Detail view for one concept: meta (full_name / source / status / approved_at / first_listed_at) plus current member securities with their latest snapshots.",
792
- "summary": "Concept detail (meta + member securities)",
793
- "positional": [
794
- "concept_id"
795
- ],
796
- "outputDefault": "json",
797
- "pagination": "none",
798
- "stream": false,
799
- "billable": true,
800
- "idempotencyRequired": false,
801
- "scopesAny": [
802
- "quote:l1",
803
- "quote:l2",
804
- "quote:delayed"
805
- ],
806
- "sideEffect": "read",
807
- "dryRunSupported": false,
808
- "inputSchema": {
809
- "type": "object",
810
- "properties": {
811
- "concept_id": {
812
- "type": "integer",
813
- "description": "Concept primary key (PG concepts.id)."
814
- }
815
- },
816
- "additionalProperties": false,
817
- "required": [
818
- "concept_id"
819
- ]
820
- }
821
- },
822
- "concepts.snapshot": {
823
- "cliKey": "concepts.snapshot",
824
- "cliName": "concepts snapshot",
825
- "method": "GET",
826
- "path": "/v1/concepts/snapshot",
827
- "description": "Returns the full concept_snapshots:latest hash. Use ?codes= to filter.",
828
- "summary": "Bulk Redis snapshot of all concepts",
829
- "positional": [],
830
- "outputDefault": "json",
831
- "pagination": "none",
832
- "stream": false,
833
- "billable": true,
834
- "idempotencyRequired": false,
835
- "scopesAny": [
836
- "quote:l1",
837
- "quote:l2",
838
- "quote:delayed"
839
- ],
840
- "sideEffect": "read",
841
- "dryRunSupported": false,
842
- "inputSchema": {
843
- "type": "object",
844
- "properties": {
845
- "codes": {
846
- "type": "string",
847
- "description": "Comma-separated concept_id list (e.g. `1,2,3`); omit for all."
848
- }
849
- },
850
- "additionalProperties": false
851
- }
852
- },
853
- "concepts.views": {
854
- "cliKey": "concepts.views",
855
- "cliName": "concepts views",
856
- "method": "GET",
857
- "path": "/v1/concepts/{concept_id}/views",
858
- "description": "JOIN concept_views × broker_views (ai_status=done) sorted by published_at desc.",
859
- "summary": "Broker views associated with this concept",
860
- "positional": [
861
- "concept_id"
862
- ],
863
- "outputDefault": "json",
864
- "pagination": "none",
865
- "stream": false,
866
- "billable": true,
867
- "idempotencyRequired": false,
868
- "scopesAny": [
869
- "views:read"
870
- ],
871
- "sideEffect": "read",
872
- "dryRunSupported": false,
873
- "inputSchema": {
874
- "type": "object",
875
- "properties": {
876
- "concept_id": {
877
- "type": "integer",
878
- "description": "Concept primary key (PG concepts.id)."
879
- },
880
- "limit": {
881
- "type": "integer",
882
- "minimum": 1,
883
- "maximum": 200,
884
- "default": 50,
885
- "description": "Maximum number of items to return."
886
- }
887
- },
888
- "additionalProperties": false,
889
- "required": [
890
- "concept_id"
891
- ]
892
- }
893
- },
894
- "digest.get": {
895
- "cliKey": "digest.get",
896
- "cliName": "digest get",
897
- "method": "GET",
898
- "path": "/v1/digest/{code}",
899
- "description": "Composite endpoint: in one HTTP call returns views (PRIMARY research),\nreal-time quote, valuation snapshot (PE/PB/PS/换手率/股息率/量比 等 14 字段),\nmarket sentiment context, and supplementary news.\nPartial-failure tolerant:\neach bucket is independently fetched and per-bucket failures surface\nin `meta.partial_failures[]` rather than poisoning the response. If\nevery sub-bucket fails the endpoint returns 502.\n\nBucket scopes are checked *per bucket* (not at gateway level): a\ntoken with only `views:read` gets the views bucket populated and the\nrest reported as `scope_insufficient` partial failures. This mirrors\nthe CLI fan-out contract exactly so `echopai digest` can either call\nthis endpoint (preferred, single round-trip) or fall back to local\nfan-out without behavior drift.\n\nSee `docs/PLAN_CLI_V2_AGENT_SURFACE.md` §3.3 (digest spec) and §11\nPhase 5.2 (server endpoint).\n",
900
- "summary": "One-shot research digest for a single security (composite)",
901
- "positional": [
902
- "code"
903
- ],
904
- "outputDefault": "json",
905
- "pagination": "none",
906
- "stream": false,
907
- "billable": true,
908
- "idempotencyRequired": false,
909
- "scopesAny": [],
910
- "sideEffect": "read",
911
- "dryRunSupported": false,
912
- "inputSchema": {
913
- "type": "object",
914
- "properties": {
915
- "code": {
916
- "type": "string",
917
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
918
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
919
- "example": "SSE:600519"
920
- },
921
- "views_since_days": {
922
- "type": "integer",
923
- "minimum": 1,
924
- "maximum": 90,
925
- "default": 7,
926
- "description": "Views lookback in days (1-90)."
927
- },
928
- "news_hours": {
929
- "type": "integer",
930
- "minimum": 1,
931
- "maximum": 168,
932
- "default": 24,
933
- "description": "News lookback in hours (1-168)."
934
- },
935
- "limit_per_bucket": {
936
- "type": "integer",
937
- "minimum": 1,
938
- "maximum": 50,
939
- "default": 10,
940
- "description": "Per-bucket item cap for views / news (1-50)."
941
- }
942
- },
943
- "additionalProperties": false,
944
- "required": [
945
- "code"
946
- ]
947
- }
948
- },
949
- "financials.pit": {
950
- "cliKey": "financials.pit",
951
- "cliName": "financials pit",
952
- "method": "GET",
953
- "path": "/v1/financials/pit",
954
- "description": "基于 TDX 财务数据的 Point-in-time 查询。给定 `code` 和 `date`,返回该\n`trade_date` 当时市场上可见的最新一期财务报告(`announce_date <= date`,\n无公告日时保守延迟 90 天)。专为回测、AI agent、量化策略防未来函数泄漏。\n\n返回字段包括:EPS(基本/扣非/稀释)、BPS、ROE、毛利率、营收/净利润/总资产/\n归母权益等核心 ~25 字段。\n",
955
- "summary": "Point-in-time financial indicators for one A-share at a given date",
956
- "positional": [],
957
- "outputDefault": "json",
958
- "pagination": "none",
959
- "stream": false,
960
- "billable": true,
961
- "idempotencyRequired": false,
962
- "scopesAny": [
963
- "financials:read"
964
- ],
965
- "sideEffect": "read",
966
- "dryRunSupported": false,
967
- "inputSchema": {
968
- "type": "object",
969
- "properties": {
970
- "code": {
971
- "type": "string",
972
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
973
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
974
- "example": "SSE:600519"
975
- },
976
- "date": {
977
- "type": "string",
978
- "format": "date",
979
- "description": "Trade date in YYYY-MM-DD; defaults to today.",
980
- "example": "2024-11-01"
981
- }
982
- },
983
- "additionalProperties": false,
984
- "required": [
985
- "code"
986
- ]
987
- }
988
- },
989
- "financials.quote-snapshot": {
990
- "cliKey": "financials.quote-snapshot",
991
- "cliName": "financials quote-snapshot",
992
- "method": "GET",
993
- "path": "/v1/financials/quote-snapshot",
994
- "description": "一站式估值快照 —— 一次返回 14 个字段,**全部基于 TDX 原始数据 + Sina 实时\n价自算,不依赖 Tushare**:\n\n- 估值: `pe` / `pe_ttm` / `pb` / `ps` / `ps_ttm`\n- 股本(万股): `total_share` / `float_share` / `free_share`\n- 市值(万元): `total_mv` / `circ_mv`\n- 流动性: `turnover_rate` / `turnover_rate_f`(%)/ `volume_ratio`(倍)\n- 分红: `dv_ratio` / `dv_ttm`(%)\n\n计算口径:\n- PE-TTM = 当前总市值 / 近 4 季度滚动净利润(PIT 表 `ni_parent_ttm`)\n- PE = 当前总市值 / 上年报净利润(`ni_parent_last1y`)\n- PB = 当前总市值 / 归母净资产(`equity_parent`,PIT 防穿越)\n- 换手率 = 当日累计成交量 / 流通股本 × 100\n- 量比 = 当日累计 / 近 5 日同时段累计平均(实时模式)\n / 近 5 日全日成交量平均(指定历史日期模式)\n- 股息率 = Σ(去年 / 近12月内派息事件 派现/10) / 现价 × 100\n\n默认 `date` 留空 → 实时(Sina 5s 快照价 + 当日累计成交量);\n给 `date=YYYY-MM-DD` 则按当日 close 取值(用于历史回测 / 校验)。\n\n财报数据走 `security_financial_indicators_pit` PIT 视图:保证 `visible_date`\n≤ trade_date,避免未来函数。\n\n准确性已对照 Tushare `daily_basic` 校验(见 `scripts/validation/validate_quote_snapshot_vs_tushare.py`)。\n",
995
- "summary": "Real-time valuation / share / turnover snapshot for one A-share",
996
- "positional": [],
997
- "outputDefault": "json",
998
- "pagination": "none",
999
- "stream": false,
1000
- "billable": true,
1001
- "idempotencyRequired": false,
1002
- "scopesAny": [
1003
- "financials:read"
1004
- ],
1005
- "sideEffect": "read",
1006
- "dryRunSupported": false,
1007
- "inputSchema": {
1008
- "type": "object",
1009
- "properties": {
1010
- "code": {
1011
- "type": "string",
1012
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
1013
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
1014
- "example": "SSE:600519"
1015
- },
1016
- "date": {
1017
- "type": "string",
1018
- "format": "date",
1019
- "description": "Trade date YYYY-MM-DD; omit for real-time (Redis snapshot price).\n",
1020
- "example": "2026-05-13"
1021
- }
1022
- },
1023
- "additionalProperties": false,
1024
- "required": [
1025
- "code"
1026
- ]
1027
- }
1028
- },
1029
- "financials.reports": {
1030
- "cliKey": "financials.reports",
1031
- "cliName": "financials reports",
1032
- "method": "GET",
1033
- "path": "/v1/financials/reports",
1034
- "description": "返回该股票最近 N 期财务报告的核心指标(EPS/BPS/ROE/毛利率/营收/净利润/总\n资产/归母权益/经营现金流/总股本 等 ~25 字段)。可按 `kind` 过滤季报/半年报/\n年报。每期 `announce_date` 字段告知何时市场可见,建议结合回测时使用。\n\n**`kind` 口径说明**:\n\n- `Q1` / `H1` / `Q3` / `annual` —— 四个标准季度末快照(3-31 / 6-30 /\n 9-30 / 12-31),TDX 财务源数据全部落在这四个 report_date。\n- `preliminary` —— **当前数据源结构上不存在**。业绩预告 / 快报 是 indicators\n 行内的字段(`forecast_ni_lower` / `forecast_ni_upper` /\n `express_ni_parent` / `express_revenue` 等),通过 `financials.series`\n metric 参数访问,不是单独的 report_kind 行。`kind=preliminary` 会返\n 空列表 + meta.note。\n",
1035
- "summary": "Recent financial reports for one A-share security",
1036
- "positional": [],
1037
- "outputDefault": "json",
1038
- "pagination": "none",
1039
- "stream": false,
1040
- "billable": true,
1041
- "idempotencyRequired": false,
1042
- "scopesAny": [
1043
- "financials:read"
1044
- ],
1045
- "sideEffect": "read",
1046
- "dryRunSupported": false,
1047
- "inputSchema": {
1048
- "type": "object",
1049
- "properties": {
1050
- "code": {
1051
- "type": "string",
1052
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
1053
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
1054
- "example": "SSE:600519"
1055
- },
1056
- "limit": {
1057
- "type": "integer",
1058
- "minimum": 1,
1059
- "maximum": 100,
1060
- "default": 12,
1061
- "description": "Max periods to return (1-100, default 12)."
1062
- },
1063
- "kind": {
1064
- "type": "string",
1065
- "enum": [
1066
- "Q1",
1067
- "H1",
1068
- "Q3",
1069
- "annual",
1070
- "preliminary"
1071
- ],
1072
- "description": "Filter by report kind."
1073
- }
1074
- },
1075
- "additionalProperties": false,
1076
- "required": [
1077
- "code"
1078
- ]
1079
- }
1080
- },
1081
- "financials.series": {
1082
- "cliKey": "financials.series",
1083
- "cliName": "financials series",
1084
- "method": "GET",
1085
- "path": "/v1/financials/series",
1086
- "description": "返回某只股票某个财务指标的历史时间序列(按报告期排列)。`metric` 是\nindicators 表中的字段名(如 `roe_simple` / `revenue` / `ni_parent` /\n`debt_asset_ratio` / `gross_margin` / `eps_basic` 等共 150 个)。\n\n典型用法:画茅台 10 年 ROE 走势、对比 5 只白酒股 net_margin。\n",
1087
- "summary": "Time series of a single financial metric for one security",
1088
- "positional": [],
1089
- "outputDefault": "json",
1090
- "pagination": "none",
1091
- "stream": false,
1092
- "billable": true,
1093
- "idempotencyRequired": false,
1094
- "scopesAny": [
1095
- "financials:read"
1096
- ],
1097
- "sideEffect": "read",
1098
- "dryRunSupported": false,
1099
- "inputSchema": {
1100
- "type": "object",
1101
- "properties": {
1102
- "code": {
1103
- "type": "string",
1104
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
1105
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
1106
- "example": "SSE:600519"
1107
- },
1108
- "metric": {
1109
- "type": "string",
1110
- "minLength": 1,
1111
- "maxLength": 64,
1112
- "description": "Indicator field name (e.g. roe_simple, revenue, ni_parent).",
1113
- "example": "roe_simple"
1114
- },
1115
- "from": {
1116
- "type": "string",
1117
- "format": "date",
1118
- "description": "Inclusive earliest report_date."
1119
- },
1120
- "to": {
1121
- "type": "string",
1122
- "format": "date",
1123
- "description": "Inclusive latest report_date."
1124
- },
1125
- "limit": {
1126
- "type": "integer",
1127
- "minimum": 1,
1128
- "maximum": 200,
1129
- "default": 40,
1130
- "description": "Max points (1-200, default 40)."
1131
- }
1132
- },
1133
- "additionalProperties": false,
1134
- "required": [
1135
- "code",
1136
- "metric"
1137
- ]
1138
- }
1139
- },
1140
- "index.daily-bars": {
1141
- "cliKey": "index.daily-bars",
1142
- "cliName": "index daily-bars",
1143
- "method": "GET",
1144
- "path": "/v1/index/bars/daily",
1145
- "description": "指数日线 OHLC。覆盖 v2 表中的指数(上证综指 `SSE:000001` / 深证成指\n`SZSE:399001` / 沪深300 `SSE:000300` / 北证50 `BSE:899050` / 中证系列 `CSI:000922` 等)。\n与 `/v1/bars/daily` 同语义,但 index 没有 `turnover_rate` / `paused` 等股票特有字段。\n",
1146
- "summary": "Daily OHLC bars for one A-share index",
1147
- "positional": [],
1148
- "outputDefault": "json",
1149
- "pagination": "none",
1150
- "stream": false,
1151
- "billable": true,
1152
- "idempotencyRequired": false,
1153
- "scopesAny": [
1154
- "quote:l1",
1155
- "quote:l2",
1156
- "quote:delayed"
1157
- ],
1158
- "sideEffect": "read",
1159
- "dryRunSupported": false,
1160
- "inputSchema": {
1161
- "type": "object",
1162
- "properties": {
1163
- "code": {
1164
- "type": "string",
1165
- "description": "Canonical index code.",
1166
- "example": "SSE:000001"
1167
- },
1168
- "from": {
1169
- "type": "string",
1170
- "format": "date",
1171
- "description": "Inclusive start date (YYYY-MM-DD).",
1172
- "example": "2024-01-01"
1173
- },
1174
- "to": {
1175
- "type": "string",
1176
- "format": "date",
1177
- "description": "Inclusive end date.",
1178
- "example": "2024-12-31"
1179
- }
1180
- },
1181
- "additionalProperties": false,
1182
- "required": [
1183
- "code",
1184
- "from",
1185
- "to"
1186
- ]
1187
- }
1188
- },
1189
- "index.minute-bars": {
1190
- "cliKey": "index.minute-bars",
1191
- "cliName": "index minute-bars",
1192
- "method": "GET",
1193
- "path": "/v1/index/bars/minute",
1194
- "description": "指数 1min OHLC。日期范围 ≤ 7 天(与 `/v1/bars/minute-batch` 对齐)。\n返回 `bar_time` / `trade_date` / OHLC / volume / amount / pct_change。\n",
1195
- "summary": "Minute OHLC bars for one A-share index",
1196
- "positional": [],
1197
- "outputDefault": "json",
1198
- "pagination": "none",
1199
- "stream": false,
1200
- "billable": true,
1201
- "idempotencyRequired": false,
1202
- "scopesAny": [
1203
- "quote:l1",
1204
- "quote:l2",
1205
- "quote:delayed"
1206
- ],
1207
- "sideEffect": "read",
1208
- "dryRunSupported": false,
1209
- "inputSchema": {
1210
- "type": "object",
1211
- "properties": {
1212
- "code": {
1213
- "type": "string",
1214
- "description": "Canonical index code.",
1215
- "example": "SSE:000001"
1216
- },
1217
- "from": {
1218
- "type": "string",
1219
- "format": "date",
1220
- "description": "Inclusive start date (YYYY-MM-DD)."
1221
- },
1222
- "to": {
1223
- "type": "string",
1224
- "format": "date",
1225
- "description": "Inclusive end date. Range ≤ 7 calendar days."
1226
- }
1227
- },
1228
- "additionalProperties": false,
1229
- "required": [
1230
- "code",
1231
- "from",
1232
- "to"
1233
- ]
1234
- }
1235
- },
1236
- "index.snapshot": {
1237
- "cliKey": "index.snapshot",
1238
- "cliName": "index snapshot",
1239
- "method": "GET",
1240
- "path": "/v1/index/snapshot",
1241
- "description": "Returns the latest real-time snapshot for the 172 indices that Sina\nexposes a quote for (SSE / SZSE / BSE — includes 北证50 `BSE:899050`\nand 专精特新 `899601.BJ`). Source is the Redis hash\n`stockpulse:index_snapshots:latest` which the Rust collector refreshes\nevery ~15 seconds during market hours; outside trading hours the last\nintraday snapshot is returned.\n\nUse `codes` to narrow to a subset (canonical format `SSE:000001` (exchange-prefix; legacy `000001.SH` is also accepted but discouraged)).\nOmit to receive all 172.\n\nNote: CSI-series indices (e.g. `CSI:000922`) are not available here —\nSina has no quote feed for them. Daily/minute history for those still\nlives behind `/api/internal/index/{daily-bars,minute-bars-range}`.\n\nRequires `quote:l1`, `quote:l2`, or `quote:delayed` scope.\n",
1242
- "summary": "Real-time snapshot of all Sina-OK A-share indices (172 indices)",
1243
- "positional": [],
1244
- "outputDefault": "json",
1245
- "pagination": "none",
1246
- "stream": false,
1247
- "billable": true,
1248
- "idempotencyRequired": false,
1249
- "scopesAny": [
1250
- "quote:l1",
1251
- "quote:l2",
1252
- "quote:delayed"
1253
- ],
1254
- "sideEffect": "read",
1255
- "dryRunSupported": false,
1256
- "inputSchema": {
1257
- "type": "object",
1258
- "properties": {
1259
- "codes": {
1260
- "type": "string",
1261
- "description": "Comma-separated canonical index codes (e.g. `SSE:000001,SZSE:399001,BSE:899050`).\nOmit to return all 172.\n",
1262
- "example": "SSE:000001,SZSE:399001,BSE:899050"
1263
- }
1264
- },
1265
- "additionalProperties": false
1266
- }
1267
- },
1268
- "industries.alerts": {
1269
- "cliKey": "industries.alerts",
1270
- "cliName": "industries alerts",
1271
- "method": "GET",
1272
- "path": "/v1/industries/alerts",
1273
- "description": "Currently active industry alerts (big_move / limit_up_cluster). Same rule set as concepts.",
1274
- "summary": "Currently active industry alerts",
1275
- "positional": [],
1276
- "outputDefault": "json",
1277
- "pagination": "none",
1278
- "stream": false,
1279
- "billable": false,
1280
- "idempotencyRequired": false,
1281
- "scopesAny": [
1282
- "quote:l1",
1283
- "quote:l2",
1284
- "quote:delayed"
1285
- ],
1286
- "sideEffect": "read",
1287
- "dryRunSupported": false,
1288
- "inputSchema": {
1289
- "type": "object",
1290
- "properties": {},
1291
- "additionalProperties": false
1292
- }
1293
- },
1294
- "industries.daily-bars": {
1295
- "cliKey": "industries.daily-bars",
1296
- "cliName": "industries daily-bars",
1297
- "method": "GET",
1298
- "path": "/v1/industries/{key}/daily-bars",
1299
- "description": "Industry index daily OHLC (chain-linked equal-weight, base = 1000). Path key format `<sw_industry_code>:<sw_level>` (e.g. `401001:1`).",
1300
- "summary": "Industry index daily bars",
1301
- "positional": [
1302
- "key"
1303
- ],
1304
- "outputDefault": "json",
1305
- "pagination": "none",
1306
- "stream": false,
1307
- "billable": true,
1308
- "idempotencyRequired": false,
1309
- "scopesAny": [
1310
- "bars:read"
1311
- ],
1312
- "sideEffect": "read",
1313
- "dryRunSupported": false,
1314
- "inputSchema": {
1315
- "type": "object",
1316
- "properties": {
1317
- "key": {
1318
- "type": "string",
1319
- "description": "Industry key in `<sw_industry_code>:<sw_level>` format (e.g. `401001:1`).",
1320
- "example": "401001:1"
1321
- },
1322
- "from": {
1323
- "type": "string",
1324
- "format": "date",
1325
- "description": "Window start. For daily/minute bars: ISO date `YYYY-MM-DD`. For alerts history: Unix milliseconds (default = now - 24h)."
1326
- },
1327
- "to": {
1328
- "type": "string",
1329
- "format": "date",
1330
- "description": "Window end. For daily/minute bars: ISO date `YYYY-MM-DD`. For alerts history: Unix milliseconds (default = now)."
1331
- }
1332
- },
1333
- "additionalProperties": false,
1334
- "required": [
1335
- "key",
1336
- "from",
1337
- "to"
1338
- ]
1339
- }
1340
- },
1341
- "industries.list": {
1342
- "cliKey": "industries.list",
1343
- "cliName": "industries list",
1344
- "method": "GET",
1345
- "path": "/v1/industries",
1346
- "description": "Industry index list joining CH `v_industry_meta` with Redis snapshot.\n申万一级 (level=1) ≈ 127 industries, 申万二级 (level=2) ≈ 348.\nChain-linked equal-weight algorithm identical to concepts (PLAN §5.4).\n",
1347
- "summary": "List industries (申万 L1/L2) with live snapshot",
1348
- "positional": [],
1349
- "outputDefault": "json",
1350
- "pagination": "none",
1351
- "stream": false,
1352
- "billable": true,
1353
- "idempotencyRequired": false,
1354
- "scopesAny": [
1355
- "quote:l1",
1356
- "quote:l2",
1357
- "quote:delayed"
1358
- ],
1359
- "sideEffect": "read",
1360
- "dryRunSupported": false,
1361
- "inputSchema": {
1362
- "type": "object",
1363
- "properties": {
1364
- "level": {
1365
- "type": "integer",
1366
- "enum": [
1367
- 1,
1368
- 2
1369
- ],
1370
- "default": 1,
1371
- "description": "申万 industry level (1 or 2)."
1372
- },
1373
- "limit": {
1374
- "type": "integer",
1375
- "minimum": 1,
1376
- "maximum": 1000,
1377
- "default": 500,
1378
- "description": "Maximum number of items to return."
1379
- }
1380
- },
1381
- "additionalProperties": false
1382
- }
1383
- },
1384
- "industries.show": {
1385
- "cliKey": "industries.show",
1386
- "cliName": "industries show",
1387
- "method": "GET",
1388
- "path": "/v1/industries/{key}",
1389
- "description": "Path key format: `<sw_industry_code>:<sw_level>` (e.g. `401001:1`).",
1390
- "summary": "Industry detail (meta + today members)",
1391
- "positional": [
1392
- "key"
1393
- ],
1394
- "outputDefault": "json",
1395
- "pagination": "none",
1396
- "stream": false,
1397
- "billable": true,
1398
- "idempotencyRequired": false,
1399
- "scopesAny": [
1400
- "quote:l1",
1401
- "quote:l2",
1402
- "quote:delayed"
1403
- ],
1404
- "sideEffect": "read",
1405
- "dryRunSupported": false,
1406
- "inputSchema": {
1407
- "type": "object",
1408
- "properties": {
1409
- "key": {
1410
- "type": "string",
1411
- "description": "Industry key in `<sw_industry_code>:<sw_level>` format (e.g. `401001:1`).",
1412
- "example": "401001:1"
1413
- }
1414
- },
1415
- "additionalProperties": false,
1416
- "required": [
1417
- "key"
1418
- ]
1419
- }
1420
- },
1421
- "industries.snapshot": {
1422
- "cliKey": "industries.snapshot",
1423
- "cliName": "industries snapshot",
1424
- "method": "GET",
1425
- "path": "/v1/industries/snapshot",
1426
- "description": "Bulk Redis snapshot for 申万 industries (level 1 ≈ 127, level 2 ≈ 348). Use `codes` to narrow. Mirrors `/v1/concepts/snapshot` shape.",
1427
- "summary": "Bulk Redis snapshot of all industries",
1428
- "positional": [],
1429
- "outputDefault": "json",
1430
- "pagination": "none",
1431
- "stream": false,
1432
- "billable": true,
1433
- "idempotencyRequired": false,
1434
- "scopesAny": [
1435
- "quote:l1",
1436
- "quote:l2",
1437
- "quote:delayed"
1438
- ],
1439
- "sideEffect": "read",
1440
- "dryRunSupported": false,
1441
- "inputSchema": {
1442
- "type": "object",
1443
- "properties": {
1444
- "codes": {
1445
- "type": "string",
1446
- "description": "Comma-separated `sw_code:level` (e.g. `401001:1,401002:1`); omit for all"
1447
- }
1448
- },
1449
- "additionalProperties": false
1450
- }
1451
- },
1452
- "limit-up.history": {
1453
- "cliKey": "limit-up.history",
1454
- "cliName": "limit-up history",
1455
- "method": "GET",
1456
- "path": "/v1/limit-up/history",
1457
- "description": "近 N 个交易日每日涨停数 + 最高连板 + 炸板数。涨停数 / 最高连板来源\n`market_limit_up_pool` (仅 status=limit_up);炸板数来源\n`market_breadth_intraday`(all_a_ex_st 当日最新分钟行)。\n\n响应按 trade_date asc 排序(旧日期在前)。需要 `quote:*` scope。\n",
1458
- "summary": "A-share limit-up daily trend (last N days)",
1459
- "positional": [],
1460
- "outputDefault": "json",
1461
- "pagination": "none",
1462
- "stream": false,
1463
- "billable": true,
1464
- "idempotencyRequired": false,
1465
- "scopesAny": [
1466
- "quote:l1",
1467
- "quote:l2",
1468
- "quote:delayed"
1469
- ],
1470
- "sideEffect": "read",
1471
- "dryRunSupported": false,
1472
- "inputSchema": {
1473
- "type": "object",
1474
- "properties": {
1475
- "days": {
1476
- "type": "integer",
1477
- "minimum": 1,
1478
- "maximum": 250,
1479
- "default": 30,
1480
- "description": "回看天数(1-250,默认 30)。"
1481
- }
1482
- },
1483
- "additionalProperties": false
1484
- }
1485
- },
1486
- "limit-up.pool": {
1487
- "cliKey": "limit-up.pool",
1488
- "cliName": "limit-up pool",
1489
- "method": "GET",
1490
- "path": "/v1/limit-up/pool",
1491
- "description": "当日(或指定 `trade_date`)涨停股池逐股明细:首/末次封板时间、最终涨幅、\n封单金额/封单量、炸板次数、连板数、N 日板内统计、一字板标记、当前 status\n(limit_up / broken)、板块分类。\n\n盘前回退规则(与所有行情类页面一致):\n - `< 9:00`:返回 max(trade_date) 的最新一日数据(昨日)\n - `9:00-9:14`:集合竞价前空窗期,items=[] / trade_date=null\n - `>= 9:15`:collector 已写入今日数据\n\n排序:连板数 desc → 板内板数 desc → 封单金额 desc。需要 `quote:*` scope。\n",
1492
- "summary": "A-share limit-up pool (per-stock detail) for a given trade date",
1493
- "positional": [],
1494
- "outputDefault": "json",
1495
- "pagination": "none",
1496
- "stream": false,
1497
- "billable": true,
1498
- "idempotencyRequired": false,
1499
- "scopesAny": [
1500
- "quote:l1",
1501
- "quote:l2",
1502
- "quote:delayed"
1503
- ],
1504
- "sideEffect": "read",
1505
- "dryRunSupported": false,
1506
- "inputSchema": {
1507
- "type": "object",
1508
- "properties": {
1509
- "trade_date": {
1510
- "type": "string",
1511
- "format": "date",
1512
- "description": "ISO date YYYY-MM-DD;不传走 latest(含盘前回退)。"
1513
- },
1514
- "include": {
1515
- "type": "string",
1516
- "enum": [
1517
- "active",
1518
- "all"
1519
- ],
1520
- "default": "active",
1521
- "description": "active(默认)= 排除 ST/退市;all = 全部。"
1522
- },
1523
- "include_broken": {
1524
- "type": "boolean",
1525
- "default": false,
1526
- "description": "true 时连炸板(status=broken)也一起返回;默认只返回当前封板 status=limit_up。"
1527
- }
1528
- },
1529
- "additionalProperties": false
1530
- }
1531
- },
1532
- "limit-up.summary": {
1533
- "cliKey": "limit-up.summary",
1534
- "cliName": "limit-up summary",
1535
- "method": "GET",
1536
- "path": "/v1/limit-up/summary",
1537
- "description": "涨停股池聚合统计:涨停数、炸板数、跌停数、最高连板高度、连板梯队\n`ladder: [{ height, count }, ...]`。\n\n炸板数 / 跌停数 与情绪页同源(`market_breadth_intraday` 当日最新分钟行);\n连板梯队仅统计当前封板 status=limit_up 的个股。\n\n盘前回退规则与 `limit-up/pool` 一致。需要 `quote:*` scope。\n",
1538
- "summary": "A-share limit-up summary (counts + height ladder) for a given trade date",
1539
- "positional": [],
1540
- "outputDefault": "json",
1541
- "pagination": "none",
1542
- "stream": false,
1543
- "billable": true,
1544
- "idempotencyRequired": false,
1545
- "scopesAny": [
1546
- "quote:l1",
1547
- "quote:l2",
1548
- "quote:delayed"
1549
- ],
1550
- "sideEffect": "read",
1551
- "dryRunSupported": false,
1552
- "inputSchema": {
1553
- "type": "object",
1554
- "properties": {
1555
- "trade_date": {
1556
- "type": "string",
1557
- "format": "date",
1558
- "description": "ISO date YYYY-MM-DD;不传走 latest。"
1559
- },
1560
- "include": {
1561
- "type": "string",
1562
- "enum": [
1563
- "active",
1564
- "all"
1565
- ],
1566
- "default": "active",
1567
- "description": "active(默认 all_a_ex_st 口径)/ all(all_a 口径)。"
1568
- }
1569
- },
1570
- "additionalProperties": false
1571
- }
1572
- },
1573
- "market.status": {
1574
- "cliKey": "market.status",
1575
- "cliName": "market status",
1576
- "method": "GET",
1577
- "path": "/v1/market/status",
1578
- "description": "Current A-share market session: pre-open / open / lunch / closed; current and next trading day; holiday flag. Requires `market:read` or any `quote:*` scope.",
1579
- "summary": "Current A-share market session state",
1580
- "positional": [],
1581
- "outputDefault": "json",
1582
- "pagination": "none",
1583
- "stream": false,
1584
- "billable": false,
1585
- "idempotencyRequired": false,
1586
- "scopesAny": [
1587
- "market:read",
1588
- "quote:l1",
1589
- "quote:l2",
1590
- "quote:delayed"
1591
- ],
1592
- "sideEffect": "read",
1593
- "dryRunSupported": false,
1594
- "inputSchema": {
1595
- "type": "object",
1596
- "properties": {},
1597
- "additionalProperties": false
1598
- }
1599
- },
1600
- "news.feed": {
1601
- "cliKey": "news.feed",
1602
- "cliName": "news feed",
1603
- "method": "GET",
1604
- "path": "/v1/news",
1605
- "description": "与 `/v1/news/list` 行为一致,旧客户端兼容用。",
1606
- "summary": "List recent news (alias of /v1/news/list)",
1607
- "positional": [],
1608
- "outputDefault": "json",
1609
- "pagination": "offset",
1610
- "stream": false,
1611
- "billable": false,
1612
- "idempotencyRequired": false,
1613
- "scopesAny": [],
1614
- "sideEffect": "read",
1615
- "dryRunSupported": false,
1616
- "inputSchema": {
1617
- "type": "object",
1618
- "properties": {},
1619
- "additionalProperties": false
1620
- }
1621
- },
1622
- "news.get": {
1623
- "cliKey": "news.get",
1624
- "cliName": "news get",
1625
- "method": "GET",
1626
- "path": "/v1/news/{news_id}",
1627
- "description": "返回新闻完整内容:title、content snippet、tagged securities。(采集端字段 source / source_id / source_url 对外不暴露,admin 路径 /v1/admin/news/{id} 可见。)",
1628
- "summary": "Fetch a single news item by id",
1629
- "positional": [
1630
- "news_id"
1631
- ],
1632
- "outputDefault": "json",
1633
- "pagination": "none",
1634
- "stream": false,
1635
- "billable": false,
1636
- "idempotencyRequired": false,
1637
- "scopesAny": [],
1638
- "sideEffect": "read",
1639
- "dryRunSupported": false,
1640
- "inputSchema": {
1641
- "type": "object",
1642
- "properties": {
1643
- "news_id": {
1644
- "type": "string",
1645
- "description": "News item id (returned by news.list / search items[].id)."
1646
- }
1647
- },
1648
- "additionalProperties": false,
1649
- "required": [
1650
- "news_id"
1651
- ]
1652
- }
1653
- },
1654
- "news.list": {
1655
- "cliKey": "news.list",
1656
- "cliName": "news list",
1657
- "method": "GET",
1658
- "path": "/v1/news/list",
1659
- "description": "List news mentioning a specific A-share security, ordered by published_at desc. Requires `news:read` scope.",
1660
- "summary": "List news mentioning a specific security",
1661
- "positional": [],
1662
- "outputDefault": "json",
1663
- "pagination": "none",
1664
- "stream": false,
1665
- "billable": true,
1666
- "idempotencyRequired": false,
1667
- "scopesAny": [
1668
- "news:read"
1669
- ],
1670
- "sideEffect": "read",
1671
- "dryRunSupported": false,
1672
- "inputSchema": {
1673
- "type": "object",
1674
- "properties": {
1675
- "security": {
1676
- "type": "string",
1677
- "description": "Any-market canonical code: A-share | HK (5-digit zero-padded) | US (uppercase ticker). For search/views/news endpoints.",
1678
- "pattern": "^((SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}|HK:[0-9]{5}|US:[A-Z][A-Z0-9.\\-]{0,5})$",
1679
- "example": "HK:00700"
1680
- },
1681
- "since_hours": {
1682
- "type": "integer",
1683
- "minimum": 1,
1684
- "maximum": 720,
1685
- "default": 24,
1686
- "description": "Lookback window in hours (max 720 = 30 days)."
1687
- },
1688
- "limit": {
1689
- "type": "integer",
1690
- "minimum": 1,
1691
- "maximum": 100,
1692
- "default": 20,
1693
- "description": "Max items per page."
1694
- }
1695
- },
1696
- "additionalProperties": false,
1697
- "required": [
1698
- "security"
1699
- ]
1700
- }
1701
- },
1702
- "news.search": {
1703
- "cliKey": "news.search",
1704
- "cliName": "news search",
1705
- "method": "GET",
1706
- "path": "/v1/news/search",
1707
- "description": "Full-text search recent news / market briefs. Returns title, published_at, snippet, tagged securities. (Internal collector identifiers — `source`/`source_id`/`source_url` — are NOT exposed publicly; admin tools see them via /v1/admin/*.) Requires `news:read` scope. Note: news fields are user-generated; meta.untrusted_text_fields lists fields that need sanitization before passing to an LLM.",
1708
- "summary": "Full-text search recent news",
1709
- "positional": [],
1710
- "outputDefault": "json",
1711
- "pagination": "none",
1712
- "stream": false,
1713
- "billable": true,
1714
- "idempotencyRequired": false,
1715
- "scopesAny": [
1716
- "news:read"
1717
- ],
1718
- "sideEffect": "read",
1719
- "dryRunSupported": false,
1720
- "inputSchema": {
1721
- "type": "object",
1722
- "properties": {
1723
- "query": {
1724
- "type": "string",
1725
- "minLength": 1,
1726
- "maxLength": 200,
1727
- "description": "Free-text query (Chinese or English).",
1728
- "example": "光伏龙头"
1729
- },
1730
- "since_hours": {
1731
- "type": "integer",
1732
- "minimum": 1,
1733
- "maximum": 168,
1734
- "default": 24,
1735
- "description": "Lookback window in hours."
1736
- },
1737
- "limit": {
1738
- "type": "integer",
1739
- "minimum": 1,
1740
- "maximum": 100,
1741
- "default": 20,
1742
- "description": "Max items per page."
1743
- }
1744
- },
1745
- "additionalProperties": false,
1746
- "required": [
1747
- "query"
1748
- ]
1749
- }
1750
- },
1751
- "payment.plans": {
1752
- "cliKey": "payment.plans",
1753
- "cliName": "payment plans",
1754
- "method": "GET",
1755
- "path": "/v1/payment/plans",
1756
- "description": "返回订阅计划清单(plan_id + 价格 + 时长 + 描述)。",
1757
- "summary": "List subscription plans",
1758
- "positional": [],
1759
- "outputDefault": "json",
1760
- "pagination": "none",
1761
- "stream": false,
1762
- "billable": false,
1763
- "idempotencyRequired": false,
1764
- "scopesAny": [],
1765
- "sideEffect": "read",
1766
- "dryRunSupported": false,
1767
- "inputSchema": {
1768
- "type": "object",
1769
- "properties": {},
1770
- "additionalProperties": false
1771
- }
1772
- },
1773
- "quote": {
1774
- "cliKey": "quote",
1775
- "cliName": "quote",
1776
- "method": "GET",
1777
- "path": "/v1/quote/realtime",
1778
- "description": "Real-time quote for one or more A-share securities. Returns last price, volume, change %, bid/ask. Up to 200 codes per call. Requires `quote:l1`, `quote:l2`, or `quote:delayed` scope.",
1779
- "summary": "Real-time quote for one or more A-share securities",
1780
- "positional": [],
1781
- "outputDefault": "json",
1782
- "pagination": "none",
1783
- "stream": false,
1784
- "billable": true,
1785
- "idempotencyRequired": false,
1786
- "scopesAny": [
1787
- "quote:l1",
1788
- "quote:l2",
1789
- "quote:delayed"
1790
- ],
1791
- "sideEffect": "read",
1792
- "dryRunSupported": false,
1793
- "inputSchema": {
1794
- "type": "object",
1795
- "properties": {
1796
- "codes": {
1797
- "type": "array",
1798
- "items": {
1799
- "type": "string",
1800
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
1801
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
1802
- "example": "SSE:600519"
1803
- },
1804
- "minItems": 1,
1805
- "maxItems": 200,
1806
- "description": "1-200 canonical codes; CSV-encoded on the wire.",
1807
- "example": [
1808
- "SSE:600519",
1809
- "SZSE:000001"
1810
- ]
1811
- },
1812
- "include_l2": {
1813
- "type": "boolean",
1814
- "default": false,
1815
- "description": "Include L2 5-level order book (requires quote:l2 scope)."
1816
- }
1817
- },
1818
- "additionalProperties": false,
1819
- "required": [
1820
- "codes"
1821
- ]
1822
- }
1823
- },
1824
- "quote.scan": {
1825
- "cliKey": "quote.scan",
1826
- "cliName": "quote scan",
1827
- "method": "GET",
1828
- "path": "/v1/quote/scan",
1829
- "description": "Dumps the entire Redis snapshot of A-share real-time quotes in a single\nround-trip. Use for \"全市场扫描\" / agent universe-of-interest discovery\nwhen you don't yet know which codes to query.\n\nFiltering:\n- `exchange=SSE|SZSE|BSE` narrows to one exchange (canonical_code prefix)\n- `app.allowed_securities` is ALWAYS applied; codes outside drop silently\n\nResponse size: ~3 MB unfiltered (~5800 items). CLI users should pair\nwith `--max-bytes` / `--fields` / `--query` from Phase 1.4.\n\n9:00–9:14 集合竞价时段返回空 items + `note` 字段说明。\n\nRequires `quote:l1`, `quote:l2`, or `quote:delayed` scope.\n",
1830
- "summary": "Full-market real-time quote scan (~5800 A-share securities)",
1831
- "positional": [],
1832
- "outputDefault": "json",
1833
- "pagination": "none",
1834
- "stream": false,
1835
- "billable": true,
1836
- "idempotencyRequired": false,
1837
- "scopesAny": [
1838
- "quote:l1",
1839
- "quote:l2",
1840
- "quote:delayed"
1841
- ],
1842
- "sideEffect": "read",
1843
- "dryRunSupported": false,
1844
- "inputSchema": {
1845
- "type": "object",
1846
- "properties": {
1847
- "exchange": {
1848
- "type": "string",
1849
- "enum": [
1850
- "SSE",
1851
- "SZSE",
1852
- "BSE",
1853
- "sse",
1854
- "szse",
1855
- "bse"
1856
- ],
1857
- "description": "Filter by exchange: SSE / SZSE / BSE (case-insensitive). Omit for all."
1858
- }
1859
- },
1860
- "additionalProperties": false
1861
- }
1862
- },
1863
- "search.semantic": {
1864
- "cliKey": "search.semantic",
1865
- "cliName": "search semantic",
1866
- "method": "GET",
1867
- "path": "/v1/search",
1868
- "description": "语义 + 模糊泛化搜索。结合 entity 精确匹配(公司代码/分析师)、向量召回(pgvector\n+ DashScope embedding)、trigram 模糊、ILIKE 精确四路召回,RRF 融合后用 reranker\n精排,叠时间衰减 + views 加权(views 主源优先)。\n\n- 搜\"锂电池\"会带出新能源产业链(正极/负极/碳酸锂/宁德时代…)\n- 搜\"芯片\"会带出存储芯片/洁净室/晶圆代工…\n- mode=exact 兼容老 ILIKE 行为,仅在精确关键词命中时返回。\n",
1869
- "summary": "Hybrid semantic search across news + analyst views",
1870
- "positional": [],
1871
- "outputDefault": "json",
1872
- "pagination": "none",
1873
- "stream": false,
1874
- "billable": true,
1875
- "idempotencyRequired": false,
1876
- "scopesAny": [
1877
- "news:read",
1878
- "views:read"
1879
- ],
1880
- "sideEffect": "read",
1881
- "dryRunSupported": false,
1882
- "inputSchema": {
1883
- "type": "object",
1884
- "properties": {
1885
- "q": {
1886
- "type": "string",
1887
- "minLength": 1,
1888
- "maxLength": 200,
1889
- "description": "Free-text query (Chinese or English).",
1890
- "example": "锂电池"
1891
- },
1892
- "type": {
1893
- "type": "string",
1894
- "enum": [
1895
- "news",
1896
- "views",
1897
- "all"
1898
- ],
1899
- "default": "all",
1900
- "description": "Search scope: news | views | all"
1901
- },
1902
- "mode": {
1903
- "type": "string",
1904
- "enum": [
1905
- "hybrid",
1906
- "exact"
1907
- ],
1908
- "default": "hybrid",
1909
- "description": "hybrid = 语义 + 精确融合 + rerank;exact = 仅 ILIKE 兼容老逻辑"
1910
- },
1911
- "hours": {
1912
- "type": "integer",
1913
- "minimum": 1,
1914
- "maximum": 720,
1915
- "description": "Lookback window in hours."
1916
- },
1917
- "limit": {
1918
- "type": "integer",
1919
- "minimum": 1,
1920
- "maximum": 50,
1921
- "default": 20,
1922
- "description": "Max items returned."
1923
- }
1924
- },
1925
- "additionalProperties": false,
1926
- "required": [
1927
- "q"
1928
- ]
1929
- }
1930
- },
1931
- "securities.industry": {
1932
- "cliKey": "securities.industry",
1933
- "cliName": "securities industry",
1934
- "method": "GET",
1935
- "path": "/v1/securities/industry",
1936
- "description": "返回该股票的 TDX 自定义行业代码(T1001 食品饮料等)与申万行业三级代码\nL1/L2/L3(X5001 食品饮料 / X500102 白酒 等)。\n\n用法:\n- 股票详情页\"申万行业:白酒 / 食品饮料\"标签\n- 筛选器交叉过滤:行业 + ROE/营收增长率\n- AI agent `find_peers(code)` 用申万二级行业找同业\n",
1937
- "summary": "TDX + 申万 industry classification for one A-share security",
1938
- "positional": [],
1939
- "outputDefault": "json",
1940
- "pagination": "none",
1941
- "stream": false,
1942
- "billable": false,
1943
- "idempotencyRequired": false,
1944
- "scopesAny": [],
1945
- "sideEffect": "read",
1946
- "dryRunSupported": false,
1947
- "inputSchema": {
1948
- "type": "object",
1949
- "properties": {
1950
- "code": {
1951
- "type": "string",
1952
- "description": "A-share canonical code (SSE/SZSE/BSE only). For quote/chart/bars/financials endpoints.",
1953
- "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
1954
- "example": "SSE:600519"
1955
- }
1956
- },
1957
- "additionalProperties": false,
1958
- "required": [
1959
- "code"
1960
- ]
1961
- }
1962
- },
1963
- "semantic.find": {
1964
- "cliKey": "semantic.find",
1965
- "cliName": "semantic find",
1966
- "method": "GET",
1967
- "path": "/v1/securities/search",
1968
- "description": "Find A-share securities matching a name (Chinese), code (e.g. 600519), or pinyin initials (e.g. gzmt). Use this when an agent has a description and needs canonical codes.",
1969
- "summary": "Find A-share securities by name / code / pinyin",
1970
- "positional": [],
1971
- "outputDefault": "json",
1972
- "pagination": "none",
1973
- "stream": false,
1974
- "billable": false,
1975
- "idempotencyRequired": false,
1976
- "scopesAny": [],
1977
- "sideEffect": "read",
1978
- "dryRunSupported": false,
1979
- "inputSchema": {
1980
- "type": "object",
1981
- "properties": {
1982
- "query": {
1983
- "type": "string",
1984
- "minLength": 1,
1985
- "maxLength": 20,
1986
- "description": "Search query: Chinese name, A-share code, or pinyin initials.",
1987
- "example": "贵州茅台"
1988
- },
1989
- "limit": {
1990
- "type": "integer",
1991
- "minimum": 1,
1992
- "maximum": 30,
1993
- "default": 10,
1994
- "description": "Max matches."
1995
- }
1996
- },
1997
- "additionalProperties": false,
1998
- "required": [
1999
- "query"
2000
- ]
2001
- }
2002
- },
2003
- "sentiment.breadth": {
2004
- "cliKey": "sentiment.breadth",
2005
- "cliName": "sentiment breadth",
2006
- "method": "GET",
2007
- "path": "/v1/sentiment/breadth",
2008
- "description": "Intraday breadth time series for one trading day.\n`trade_date` 缺省 → 今日(盘前 9:00 前返回空 items);显式传 YYYY-MM-DD 可\n拉历史任意交易日(来源 ClickHouse `market_breadth_intraday`,剔除 13:00\n稀疏分钟,单日最多 241 行)。Requires `sentiment:read` scope.\n",
2009
- "summary": "Intraday breadth time series",
2010
- "positional": [],
2011
- "outputDefault": "json",
2012
- "pagination": "none",
2013
- "stream": false,
2014
- "billable": true,
2015
- "idempotencyRequired": false,
2016
- "scopesAny": [
2017
- "sentiment:read"
2018
- ],
2019
- "sideEffect": "read",
2020
- "dryRunSupported": false,
2021
- "inputSchema": {
2022
- "type": "object",
2023
- "properties": {
2024
- "scope": {
2025
- "type": "string",
2026
- "enum": [
2027
- "all_a",
2028
- "all_a_ex_st",
2029
- "main_board",
2030
- "star_market",
2031
- "chinext",
2032
- "bse"
2033
- ],
2034
- "default": "all_a_ex_st",
2035
- "description": "Universe filter."
2036
- },
2037
- "trade_date": {
2038
- "type": "string",
2039
- "format": "date",
2040
- "description": "ISO date YYYY-MM-DD;不传走今日(盘前 9:00 前返空)。"
2041
- }
2042
- },
2043
- "additionalProperties": false
2044
- }
2045
- },
2046
- "sentiment.overview": {
2047
- "cliKey": "sentiment.overview",
2048
- "cliName": "sentiment overview",
2049
- "method": "GET",
2050
- "path": "/v1/sentiment/overview",
2051
- "description": "Aggregate sentiment snapshot for one trading day's latest minute:\nlimit-up/down counts, breadth, divergence index, MA / 52w breadth.\n`trade_date` 缺省 → 今日(Redis 实时,盘前 9:00 前返空结构);显式传\nYYYY-MM-DD 拉历史任意日(最后一分钟聚合行,来源 ClickHouse\n`market_breadth_intraday`)。Requires `sentiment:read` scope.\n",
2052
- "summary": "Aggregate market sentiment indicators",
2053
- "positional": [],
2054
- "outputDefault": "json",
2055
- "pagination": "none",
2056
- "stream": false,
2057
- "billable": true,
2058
- "idempotencyRequired": false,
2059
- "scopesAny": [
2060
- "sentiment:read"
2061
- ],
2062
- "sideEffect": "read",
2063
- "dryRunSupported": false,
2064
- "inputSchema": {
2065
- "type": "object",
2066
- "properties": {
2067
- "scope": {
2068
- "type": "string",
2069
- "enum": [
2070
- "all_a",
2071
- "all_a_ex_st",
2072
- "main_board",
2073
- "star_market",
2074
- "chinext",
2075
- "bse"
2076
- ],
2077
- "default": "all_a_ex_st",
2078
- "description": "Universe filter.",
2079
- "example": "main_board"
2080
- },
2081
- "trade_date": {
2082
- "type": "string",
2083
- "format": "date",
2084
- "description": "ISO date YYYY-MM-DD;不传走今日(实时)。"
2085
- }
2086
- },
2087
- "additionalProperties": false
2088
- }
2089
- },
2090
- "sentiment.pct-distribution": {
2091
- "cliKey": "sentiment.pct-distribution",
2092
- "cliName": "sentiment pct-distribution",
2093
- "method": "GET",
2094
- "path": "/v1/sentiment/pct-distribution",
2095
- "description": "返回 A 股全市场涨跌幅分桶(≤-10% / -9% / ... / +10% / 涨停)的家数分布,用于市场宽度可视化。",
2096
- "summary": "Distribution of intraday percent change across the universe",
2097
- "positional": [],
2098
- "outputDefault": "json",
2099
- "pagination": "none",
2100
- "stream": false,
2101
- "billable": true,
2102
- "idempotencyRequired": false,
2103
- "scopesAny": [
2104
- "sentiment:read"
2105
- ],
2106
- "sideEffect": "read",
2107
- "dryRunSupported": false,
2108
- "inputSchema": {
2109
- "type": "object",
2110
- "properties": {},
2111
- "additionalProperties": false
2112
- }
2113
- },
2114
- "sentiment.turnover": {
2115
- "cliKey": "sentiment.turnover",
2116
- "cliName": "sentiment turnover",
2117
- "method": "GET",
2118
- "path": "/v1/sentiment/turnover",
2119
- "description": "Intraday turnover time series across one or more trading days.\n`trade_date` 缺省 → 今日(盘前 9:00 前返空 items);显式 YYYY-MM-DD 拉\n历史任意交易日的当日 + 之前 `days-1` 天。Response 含 `current_turnover`\n/ `predicted_total` / `delta_vs_yesterday` headline 字段。Requires\n`sentiment:read` scope.\n",
2120
- "summary": "Intraday turnover time series",
2121
- "positional": [],
2122
- "outputDefault": "json",
2123
- "pagination": "none",
2124
- "stream": false,
2125
- "billable": true,
2126
- "idempotencyRequired": false,
2127
- "scopesAny": [
2128
- "sentiment:read"
2129
- ],
2130
- "sideEffect": "read",
2131
- "dryRunSupported": false,
2132
- "inputSchema": {
2133
- "type": "object",
2134
- "properties": {
2135
- "scope": {
2136
- "type": "string",
2137
- "enum": [
2138
- "all_a",
2139
- "all_a_ex_st",
2140
- "main_board",
2141
- "star_market",
2142
- "chinext",
2143
- "bse"
2144
- ],
2145
- "default": "all_a_ex_st",
2146
- "description": "Universe filter."
2147
- },
2148
- "trade_date": {
2149
- "type": "string",
2150
- "format": "date",
2151
- "description": "ISO date YYYY-MM-DD;不传走今日。"
2152
- },
2153
- "days": {
2154
- "type": "integer",
2155
- "minimum": 1,
2156
- "maximum": 5,
2157
- "default": 1,
2158
- "description": "取该 trade_date 当日 + 之前 days-1 天的时序,用于同分钟同比 (1-5)。"
2159
- }
2160
- },
2161
- "additionalProperties": false
2162
- }
2163
- },
2164
- "squawk.audio": {
2165
- "cliKey": "squawk.audio",
2166
- "cliName": "squawk audio",
2167
- "method": "GET",
2168
- "path": "/v1/squawk/{item_id}/audio",
2169
- "description": "返回 squawk 项的 TTS 音频(MP3)。直接 stream,可作为 `<audio>` src 用。",
2170
- "summary": "Stream squawk TTS audio",
2171
- "positional": [
2172
- "item_id"
2173
- ],
2174
- "outputDefault": "json",
2175
- "pagination": "none",
2176
- "stream": false,
2177
- "billable": false,
2178
- "idempotencyRequired": false,
2179
- "scopesAny": [],
2180
- "sideEffect": "read",
2181
- "dryRunSupported": false,
2182
- "inputSchema": {
2183
- "type": "object",
2184
- "properties": {
2185
- "item_id": {
2186
- "type": "string",
2187
- "description": "Squawk item id (returned by squawk.recent items[].id)."
2188
- }
2189
- },
2190
- "additionalProperties": false,
2191
- "required": [
2192
- "item_id"
2193
- ]
2194
- }
2195
- },
2196
- "squawk.waveform": {
2197
- "cliKey": "squawk.waveform",
2198
- "cliName": "squawk waveform",
2199
- "method": "GET",
2200
- "path": "/v1/squawk/{item_id}/waveform",
2201
- "description": "返回 squawk 音频的预计算波形 peak 数据,用于客户端波形可视化。",
2202
- "summary": "Waveform peaks for squawk audio",
2203
- "positional": [
2204
- "item_id"
2205
- ],
2206
- "outputDefault": "json",
2207
- "pagination": "none",
2208
- "stream": false,
2209
- "billable": false,
2210
- "idempotencyRequired": false,
2211
- "scopesAny": [],
2212
- "sideEffect": "read",
2213
- "dryRunSupported": false,
2214
- "inputSchema": {
2215
- "type": "object",
2216
- "properties": {
2217
- "item_id": {
2218
- "type": "string",
2219
- "description": "Squawk item id (returned by squawk.recent items[].id)."
2220
- }
2221
- },
2222
- "additionalProperties": false,
2223
- "required": [
2224
- "item_id"
2225
- ]
2226
- }
2227
- },
2228
- "stocks.hot": {
2229
- "cliKey": "stocks.hot",
2230
- "cliName": "stocks hot",
2231
- "method": "GET",
2232
- "path": "/v1/stocks/hot",
2233
- "description": "今日最热股票榜(来源 East-Money),按搜索 / 关注 / 评论综合分排序。",
2234
- "summary": "Today's hot-stock leaderboard",
2235
- "positional": [],
2236
- "outputDefault": "json",
2237
- "pagination": "none",
2238
- "stream": false,
2239
- "billable": false,
2240
- "idempotencyRequired": false,
2241
- "scopesAny": [],
2242
- "sideEffect": "read",
2243
- "dryRunSupported": false,
2244
- "inputSchema": {
2245
- "type": "object",
2246
- "properties": {},
2247
- "additionalProperties": false
2248
- }
2249
- },
2250
- "stocks.social-hot": {
2251
- "cliKey": "stocks.social-hot",
2252
- "cliName": "stocks social-hot",
2253
- "method": "GET",
2254
- "path": "/v1/stocks/social-hot",
2255
- "description": "跨平台(微博 / 雪球 / Twitter)社交媒体提及聚合榜,按提及量 / 情感打分。",
2256
- "summary": "Cross-platform social-hot stocks",
2257
- "positional": [],
2258
- "outputDefault": "json",
2259
- "pagination": "none",
2260
- "stream": false,
2261
- "billable": false,
2262
- "idempotencyRequired": false,
2263
- "scopesAny": [],
2264
- "sideEffect": "read",
2265
- "dryRunSupported": false,
2266
- "inputSchema": {
2267
- "type": "object",
2268
- "properties": {},
2269
- "additionalProperties": false
2270
- }
2271
- },
2272
- "views.feed": {
2273
- "cliKey": "views.feed",
2274
- "cliName": "views feed",
2275
- "method": "GET",
2276
- "path": "/v1/views",
2277
- "description": "分析师观点 / 卖方研报 / 长文本观点流。可按机构 / 分析师 / 证券 / hours 过滤。需要 `views:read` scope。",
2278
- "summary": "List analyst views",
2279
- "positional": [],
2280
- "outputDefault": "json",
2281
- "pagination": "offset",
2282
- "stream": false,
2283
- "billable": false,
2284
- "idempotencyRequired": false,
2285
- "scopesAny": [],
2286
- "sideEffect": "read",
2287
- "dryRunSupported": false,
2288
- "inputSchema": {
2289
- "type": "object",
2290
- "properties": {},
2291
- "additionalProperties": false
2292
- }
2293
- },
2294
- "views.get": {
2295
- "cliKey": "views.get",
2296
- "cliName": "views get",
2297
- "method": "GET",
2298
- "path": "/v1/views/{view_id}",
2299
- "description": "返回单条 view 完整内容、附件图片、tagged securities、AI 摘要。",
2300
- "summary": "Fetch a single analyst view",
2301
- "positional": [
2302
- "view_id"
2303
- ],
2304
- "outputDefault": "json",
2305
- "pagination": "none",
2306
- "stream": false,
2307
- "billable": false,
2308
- "idempotencyRequired": false,
2309
- "scopesAny": [],
2310
- "sideEffect": "read",
2311
- "dryRunSupported": false,
2312
- "inputSchema": {
2313
- "type": "object",
2314
- "properties": {
2315
- "view_id": {
2316
- "type": "string",
2317
- "description": "Analyst-view id (returned by views.recent / list items[].id)."
2318
- }
2319
- },
2320
- "additionalProperties": false,
2321
- "required": [
2322
- "view_id"
2323
- ]
2324
- }
2325
- },
2326
- "views.recent": {
2327
- "cliKey": "views.recent",
2328
- "cliName": "views recent",
2329
- "method": "GET",
2330
- "path": "/v1/views/recent",
2331
- "description": "List recent broker / analyst views (research notes, price targets, ratings). Filter by analyst, institution, or a specific security. Requires `views:read` scope.",
2332
- "summary": "Recent broker / analyst views",
2333
- "positional": [],
2334
- "outputDefault": "json",
2335
- "pagination": "none",
2336
- "stream": false,
2337
- "billable": true,
2338
- "idempotencyRequired": false,
2339
- "scopesAny": [
2340
- "views:read"
2341
- ],
2342
- "sideEffect": "read",
2343
- "dryRunSupported": false,
2344
- "inputSchema": {
2345
- "type": "object",
2346
- "properties": {
2347
- "analyst": {
2348
- "type": "string",
2349
- "description": "Analyst name (Chinese), exact or fuzzy."
2350
- },
2351
- "institution": {
2352
- "type": "string",
2353
- "description": "Broker / institution Chinese name."
2354
- },
2355
- "security": {
2356
- "type": "string",
2357
- "description": "Any-market canonical code: A-share | HK (5-digit zero-padded) | US (uppercase ticker). For search/views/news endpoints.",
2358
- "pattern": "^((SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}|HK:[0-9]{5}|US:[A-Z][A-Z0-9.\\-]{0,5})$",
2359
- "example": "HK:00700"
2360
- },
2361
- "since_days": {
2362
- "type": "integer",
2363
- "minimum": 1,
2364
- "maximum": 90,
2365
- "default": 7,
2366
- "description": "Lookback window in days. (Translated to hours upstream.)"
2367
- },
2368
- "limit": {
2369
- "type": "integer",
2370
- "minimum": 1,
2371
- "maximum": 100,
2372
- "default": 30,
2373
- "description": "Max items per page."
2374
- }
2375
- },
2376
- "additionalProperties": false
2377
- }
2378
- }
2379
- };
2380
- export function getOperation(key) {
2381
- return OPERATIONS[key];
2382
- }
2383
- export function listOperations() {
2384
- return Object.values(OPERATIONS);
2385
- }