@social-data/social-neuron-user-query 0.0.0-stage → 1.0.0-beta.1

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.
package/manifest.json ADDED
@@ -0,0 +1,1986 @@
1
+ {
2
+ "revision": 9,
3
+ "capability": "user-query",
4
+ "command": "social-neuron-user-query",
5
+ "default_action": null,
6
+ "mcp_path": "/user-query/mcp",
7
+ "tools": [
8
+ {
9
+ "action": "aggregate",
10
+ "op": "aggregate",
11
+ "name": "user-query/aggregate",
12
+ "summary": "画像分布统计:group_by 声明树 + metrics(含 min/max)。",
13
+ "description": "画像分布统计:group_by 声明树 + metrics(含 min/max)。\n\n粉丝量分档 range(long_followerCount)、地域/性别 terms(kw_province/kw_gender)、认证 terms(bool_verified)。\n⚠ 聚合须用 kw_ 字段(text_ 不可聚合)。",
14
+ "input_schema": {
15
+ "$defs": {
16
+ "AndNode": {
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "and": {
20
+ "description": "全部满足(编译为 bool.filter);至少 1 个条件",
21
+ "items": {
22
+ "anyOf": [
23
+ {
24
+ "$ref": "#/$defs/AndNode"
25
+ },
26
+ {
27
+ "$ref": "#/$defs/OrNode"
28
+ },
29
+ {
30
+ "$ref": "#/$defs/NotNode"
31
+ },
32
+ {
33
+ "$ref": "#/$defs/Leaf"
34
+ }
35
+ ]
36
+ },
37
+ "minItems": 1,
38
+ "title": "And",
39
+ "type": "array"
40
+ }
41
+ },
42
+ "required": [
43
+ "and"
44
+ ],
45
+ "title": "AndNode",
46
+ "type": "object"
47
+ },
48
+ "GroupLevel": {
49
+ "additionalProperties": false,
50
+ "description": "一层分组声明。``group_by`` 递归 = 嵌套子层;缺省 = 本层为叶子(设计 §3.1)。",
51
+ "properties": {
52
+ "name": {
53
+ "description": "本层聚合名(出参 key)",
54
+ "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,31}$",
55
+ "title": "Name",
56
+ "type": "string"
57
+ },
58
+ "type": {
59
+ "description": "聚合类型;须与字段 data_type 匹配(§3.1.1)",
60
+ "enum": [
61
+ "terms",
62
+ "range",
63
+ "histogram",
64
+ "date_histogram"
65
+ ],
66
+ "title": "Type",
67
+ "type": "string"
68
+ },
69
+ "field": {
70
+ "description": "被分组字段 name_en",
71
+ "maxLength": 128,
72
+ "minLength": 1,
73
+ "title": "Field",
74
+ "type": "string"
75
+ },
76
+ "size": {
77
+ "anyOf": [
78
+ {
79
+ "type": "integer"
80
+ },
81
+ {
82
+ "type": "null"
83
+ }
84
+ ],
85
+ "default": null,
86
+ "description": "terms 桶数上限;缺省 10,≤ agg_max_size",
87
+ "title": "Size"
88
+ },
89
+ "order": {
90
+ "anyOf": [
91
+ {
92
+ "$ref": "#/$defs/Order"
93
+ },
94
+ {
95
+ "type": "null"
96
+ }
97
+ ],
98
+ "default": null,
99
+ "description": "terms 桶排序;缺省 count desc"
100
+ },
101
+ "ranges": {
102
+ "anyOf": [
103
+ {
104
+ "items": {
105
+ "$ref": "#/$defs/RangeBucket"
106
+ },
107
+ "type": "array"
108
+ },
109
+ {
110
+ "type": "null"
111
+ }
112
+ ],
113
+ "default": null,
114
+ "description": "range 档位,左闭右开",
115
+ "title": "Ranges"
116
+ },
117
+ "interval": {
118
+ "anyOf": [
119
+ {
120
+ "type": "integer"
121
+ },
122
+ {
123
+ "type": "number"
124
+ },
125
+ {
126
+ "type": "string"
127
+ },
128
+ {
129
+ "type": "null"
130
+ }
131
+ ],
132
+ "default": null,
133
+ "description": "histogram 数值间隔;date_histogram 粒度 hour|day|week|month",
134
+ "title": "Interval"
135
+ },
136
+ "group_by": {
137
+ "anyOf": [
138
+ {
139
+ "items": {
140
+ "$ref": "#/$defs/GroupLevel"
141
+ },
142
+ "type": "array"
143
+ },
144
+ {
145
+ "type": "null"
146
+ }
147
+ ],
148
+ "default": null,
149
+ "description": "嵌套子层(递归);缺省=本层为叶子",
150
+ "title": "Group By"
151
+ }
152
+ },
153
+ "required": [
154
+ "name",
155
+ "type",
156
+ "field"
157
+ ],
158
+ "title": "GroupLevel",
159
+ "type": "object"
160
+ },
161
+ "Leaf": {
162
+ "additionalProperties": false,
163
+ "description": "叶子条件 ``{field, op, value}``;value 传 ES 真实值(不翻译)。",
164
+ "properties": {
165
+ "field": {
166
+ "description": "字段 name_en",
167
+ "maxLength": 128,
168
+ "minLength": 1,
169
+ "title": "Field",
170
+ "type": "string"
171
+ },
172
+ "op": {
173
+ "description": "操作符;须在字段 data_type 允许集合内(§1.5)",
174
+ "enum": [
175
+ "eq",
176
+ "in",
177
+ "match",
178
+ "match_phrase",
179
+ "gt",
180
+ "gte",
181
+ "lt",
182
+ "lte",
183
+ "exists"
184
+ ],
185
+ "title": "Op",
186
+ "type": "string"
187
+ },
188
+ "value": {
189
+ "anyOf": [
190
+ {
191
+ "type": "string"
192
+ },
193
+ {
194
+ "type": "integer"
195
+ },
196
+ {
197
+ "type": "number"
198
+ },
199
+ {
200
+ "type": "boolean"
201
+ },
202
+ {
203
+ "items": {
204
+ "anyOf": [
205
+ {
206
+ "type": "string"
207
+ },
208
+ {
209
+ "type": "integer"
210
+ },
211
+ {
212
+ "type": "number"
213
+ },
214
+ {
215
+ "type": "boolean"
216
+ }
217
+ ]
218
+ },
219
+ "type": "array"
220
+ },
221
+ {
222
+ "type": "null"
223
+ }
224
+ ],
225
+ "default": null,
226
+ "description": "ES 真实值;in 传数组;exists 无需 value",
227
+ "title": "Value"
228
+ }
229
+ },
230
+ "required": [
231
+ "field",
232
+ "op"
233
+ ],
234
+ "title": "Leaf",
235
+ "type": "object"
236
+ },
237
+ "Metric": {
238
+ "additionalProperties": false,
239
+ "properties": {
240
+ "op": {
241
+ "description": "聚合算子;sum/avg/min/max 需 long/double 字段(min=最小值,如最少粉丝数)",
242
+ "enum": [
243
+ "count",
244
+ "sum",
245
+ "avg",
246
+ "min",
247
+ "max"
248
+ ],
249
+ "title": "Op",
250
+ "type": "string"
251
+ },
252
+ "field": {
253
+ "anyOf": [
254
+ {
255
+ "type": "string"
256
+ },
257
+ {
258
+ "type": "null"
259
+ }
260
+ ],
261
+ "default": null,
262
+ "description": "被聚合字段;count 无需",
263
+ "title": "Field"
264
+ }
265
+ },
266
+ "required": [
267
+ "op"
268
+ ],
269
+ "title": "Metric",
270
+ "type": "object"
271
+ },
272
+ "NotNode": {
273
+ "additionalProperties": false,
274
+ "properties": {
275
+ "not": {
276
+ "anyOf": [
277
+ {
278
+ "$ref": "#/$defs/AndNode"
279
+ },
280
+ {
281
+ "$ref": "#/$defs/OrNode"
282
+ },
283
+ {
284
+ "$ref": "#/$defs/NotNode"
285
+ },
286
+ {
287
+ "$ref": "#/$defs/Leaf"
288
+ }
289
+ ],
290
+ "description": "取反(编译为 bool.must_not)",
291
+ "title": "Not"
292
+ }
293
+ },
294
+ "required": [
295
+ "not"
296
+ ],
297
+ "title": "NotNode",
298
+ "type": "object"
299
+ },
300
+ "OrNode": {
301
+ "additionalProperties": false,
302
+ "properties": {
303
+ "or": {
304
+ "description": "任一满足(编译为 bool.should + minimum_should_match:1);至少 1 个条件",
305
+ "items": {
306
+ "anyOf": [
307
+ {
308
+ "$ref": "#/$defs/AndNode"
309
+ },
310
+ {
311
+ "$ref": "#/$defs/OrNode"
312
+ },
313
+ {
314
+ "$ref": "#/$defs/NotNode"
315
+ },
316
+ {
317
+ "$ref": "#/$defs/Leaf"
318
+ }
319
+ ]
320
+ },
321
+ "minItems": 1,
322
+ "title": "Or",
323
+ "type": "array"
324
+ }
325
+ },
326
+ "required": [
327
+ "or"
328
+ ],
329
+ "title": "OrNode",
330
+ "type": "object"
331
+ },
332
+ "Order": {
333
+ "additionalProperties": false,
334
+ "properties": {
335
+ "by": {
336
+ "description": "排序依据:\"count\" 或 metrics 里的某个名字(如 avg_long_followerCount)",
337
+ "title": "By",
338
+ "type": "string"
339
+ },
340
+ "direction": {
341
+ "default": "desc",
342
+ "description": "排序方向",
343
+ "enum": [
344
+ "asc",
345
+ "desc"
346
+ ],
347
+ "title": "Direction",
348
+ "type": "string"
349
+ }
350
+ },
351
+ "required": [
352
+ "by"
353
+ ],
354
+ "title": "Order",
355
+ "type": "object"
356
+ },
357
+ "RangeBucket": {
358
+ "additionalProperties": false,
359
+ "properties": {
360
+ "from": {
361
+ "anyOf": [
362
+ {
363
+ "type": "number"
364
+ },
365
+ {
366
+ "type": "null"
367
+ }
368
+ ],
369
+ "default": null,
370
+ "description": "下界(含);省=负无穷",
371
+ "title": "From"
372
+ },
373
+ "to": {
374
+ "anyOf": [
375
+ {
376
+ "type": "number"
377
+ },
378
+ {
379
+ "type": "null"
380
+ }
381
+ ],
382
+ "default": null,
383
+ "description": "上界(不含);省=正无穷",
384
+ "title": "To"
385
+ }
386
+ },
387
+ "title": "RangeBucket",
388
+ "type": "object"
389
+ }
390
+ },
391
+ "additionalProperties": false,
392
+ "properties": {
393
+ "query_summary": {
394
+ "description": "【必填】用一句简短中文概括**本次查询的意图** —— 基于用户的原始诉求来总结,不是复述参数。应能让人不看 DSL 就知道在查什么:覆盖账号库、主要筛选条件、以及排序/取数口径(若有)。例:「抖音广东百万粉女性账号」「按 uid 批量查账号画像」「微博账号各省粉丝量分布」。该概况会和 trace_id 一起写入查询日志,供审计回溯,请每次如实填写。",
395
+ "maxLength": 200,
396
+ "minLength": 1,
397
+ "title": "Query Summary",
398
+ "type": "string"
399
+ },
400
+ "platform": {
401
+ "description": "单个账号库 name_en(用 list-platforms 查)",
402
+ "minLength": 1,
403
+ "title": "Platform",
404
+ "type": "string"
405
+ },
406
+ "where": {
407
+ "anyOf": [
408
+ {
409
+ "$ref": "#/$defs/AndNode"
410
+ },
411
+ {
412
+ "$ref": "#/$defs/OrNode"
413
+ },
414
+ {
415
+ "$ref": "#/$defs/NotNode"
416
+ },
417
+ {
418
+ "$ref": "#/$defs/Leaf"
419
+ },
420
+ {
421
+ "type": "null"
422
+ }
423
+ ],
424
+ "default": null,
425
+ "description": "布尔条件树(可选);时间过滤用 date_udate/date_idate",
426
+ "title": "Where"
427
+ },
428
+ "group_by": {
429
+ "description": "分组声明树;顶层数组=并列聚合",
430
+ "items": {
431
+ "$ref": "#/$defs/GroupLevel"
432
+ },
433
+ "title": "Group By",
434
+ "type": "array"
435
+ },
436
+ "metrics": {
437
+ "description": "指标;挂在每一层",
438
+ "items": {
439
+ "$ref": "#/$defs/Metric"
440
+ },
441
+ "title": "Metrics",
442
+ "type": "array"
443
+ }
444
+ },
445
+ "required": [
446
+ "query_summary",
447
+ "platform",
448
+ "group_by",
449
+ "metrics"
450
+ ],
451
+ "title": "AggregateInput",
452
+ "type": "object"
453
+ },
454
+ "output_schema": {
455
+ "additionalProperties": true,
456
+ "properties": {
457
+ "took_ms": {
458
+ "description": "ES 耗时(毫秒)",
459
+ "title": "Took Ms",
460
+ "type": "integer"
461
+ },
462
+ "truncated": {
463
+ "description": "任一 terms 层 sum_other_doc_count>0",
464
+ "title": "Truncated",
465
+ "type": "boolean"
466
+ },
467
+ "warnings": {
468
+ "description": "部分索引不存在等提示;空=结果完整",
469
+ "items": {
470
+ "type": "string"
471
+ },
472
+ "title": "Warnings",
473
+ "type": "array"
474
+ },
475
+ "trace_id": {
476
+ "description": "查询审计标识",
477
+ "title": "Trace Id",
478
+ "type": "string"
479
+ }
480
+ },
481
+ "required": [
482
+ "took_ms",
483
+ "truncated",
484
+ "trace_id"
485
+ ],
486
+ "title": "AggregateOutput",
487
+ "type": "object"
488
+ },
489
+ "flags": [
490
+ {
491
+ "flag": "--query-summary",
492
+ "field": "query_summary",
493
+ "type": "string",
494
+ "required": true,
495
+ "desc": "【必填】用一句简短中文概括**本次查询的意图** —— 基于用户的原始诉求来总结,不是复述参数。应能让人不看 DSL 就知道在查什么:覆盖账号库、主要筛选条件、以及排序/取数口径(若有)。例:「抖音广东百万粉女性账号」「按 uid 批量查账号画像」「微博账号各省粉丝量分布」。该概况会和 trace_id 一起写入查询日志,供审计回溯,请每次如实填写。"
496
+ },
497
+ {
498
+ "flag": "--platform",
499
+ "field": "platform",
500
+ "type": "string",
501
+ "required": true,
502
+ "desc": "单个账号库 name_en(用 list-platforms 查)"
503
+ },
504
+ {
505
+ "flag": "--where",
506
+ "field": "where",
507
+ "type": "object(json)",
508
+ "required": false,
509
+ "desc": "布尔条件树(可选);时间过滤用 date_udate/date_idate"
510
+ },
511
+ {
512
+ "flag": "--group-by",
513
+ "field": "group_by",
514
+ "type": "list[object](json)",
515
+ "required": true,
516
+ "desc": "分组声明树;顶层数组=并列聚合"
517
+ },
518
+ {
519
+ "flag": "--metrics",
520
+ "field": "metrics",
521
+ "type": "list[object](json)",
522
+ "required": true,
523
+ "desc": "指标;挂在每一层"
524
+ }
525
+ ],
526
+ "transport": {
527
+ "method": "POST",
528
+ "path": "/user-query/aggregate",
529
+ "send": "args"
530
+ },
531
+ "errors": [
532
+ "auth_error",
533
+ "validation",
534
+ "api_error",
535
+ "network",
536
+ "internal"
537
+ ]
538
+ },
539
+ {
540
+ "action": "describe-capability",
541
+ "op": "describe_capability",
542
+ "name": "user-query/describe_capability",
543
+ "summary": "能力总览(agent 起点):查什么数据、有哪些账号库及各自画像、查询模型、取值约定、规模闸。",
544
+ "description": "能力总览(agent 起点):查什么数据、有哪些账号库及各自画像、查询模型、取值约定、规模闸。",
545
+ "input_schema": {
546
+ "type": "object",
547
+ "properties": {},
548
+ "additionalProperties": false
549
+ },
550
+ "output_schema": {
551
+ "$defs": {
552
+ "LibrarySummary": {
553
+ "additionalProperties": false,
554
+ "description": "单个账号库的画像 —— 让 agent 知道\"这个库有多少字段、主键是什么、能按什么搜\"。",
555
+ "properties": {
556
+ "name_en": {
557
+ "description": "账号库 name_en(get_user/search 的 platform 入参,即索引名主体)",
558
+ "title": "Name En",
559
+ "type": "string"
560
+ },
561
+ "name": {
562
+ "description": "库中文名(如 抖音账号)",
563
+ "title": "Name",
564
+ "type": "string"
565
+ },
566
+ "field_count": {
567
+ "description": "该库字段数(各库差异大,抖音 234、公众号 35)",
568
+ "title": "Field Count",
569
+ "type": "integer"
570
+ },
571
+ "has_follower": {
572
+ "description": "是否有 long_followerCount(可按粉丝量排序/分档)",
573
+ "title": "Has Follower",
574
+ "type": "boolean"
575
+ }
576
+ },
577
+ "required": [
578
+ "name_en",
579
+ "name",
580
+ "field_count",
581
+ "has_follower"
582
+ ],
583
+ "title": "LibrarySummary",
584
+ "type": "object"
585
+ },
586
+ "Limits": {
587
+ "additionalProperties": false,
588
+ "description": "规模闸(配置化)—— agent 据此预判边界,避免被拒后盲试。",
589
+ "properties": {
590
+ "query_default_size": {
591
+ "description": "get_user/search 默认返回条数",
592
+ "title": "Query Default Size",
593
+ "type": "integer"
594
+ },
595
+ "query_max_size": {
596
+ "description": "单次上限",
597
+ "title": "Query Max Size",
598
+ "type": "integer"
599
+ },
600
+ "where_max_depth": {
601
+ "description": "where 规范化后允许的最大嵌套深度",
602
+ "title": "Where Max Depth",
603
+ "type": "integer"
604
+ },
605
+ "agg_max_depth": {
606
+ "description": "聚合最大嵌套层数",
607
+ "title": "Agg Max Depth",
608
+ "type": "integer"
609
+ },
610
+ "agg_max_width": {
611
+ "description": "每层并列分支上限",
612
+ "title": "Agg Max Width",
613
+ "type": "integer"
614
+ },
615
+ "agg_max_size": {
616
+ "description": "单层 terms.size 上限",
617
+ "title": "Agg Max Size",
618
+ "type": "integer"
619
+ },
620
+ "agg_bucket_budget": {
621
+ "description": "聚合总桶数预算",
622
+ "title": "Agg Bucket Budget",
623
+ "type": "integer"
624
+ }
625
+ },
626
+ "required": [
627
+ "query_default_size",
628
+ "query_max_size",
629
+ "where_max_depth",
630
+ "agg_max_depth",
631
+ "agg_max_width",
632
+ "agg_max_size",
633
+ "agg_bucket_budget"
634
+ ],
635
+ "title": "Limits",
636
+ "type": "object"
637
+ },
638
+ "UserCoverage": {
639
+ "additionalProperties": false,
640
+ "properties": {
641
+ "platforms": {
642
+ "description": "账号库数量",
643
+ "title": "Platforms",
644
+ "type": "integer"
645
+ },
646
+ "libraries": {
647
+ "description": "逐库画像(下钻指引)",
648
+ "items": {
649
+ "$ref": "#/$defs/LibrarySummary"
650
+ },
651
+ "title": "Libraries",
652
+ "type": "array"
653
+ }
654
+ },
655
+ "required": [
656
+ "platforms",
657
+ "libraries"
658
+ ],
659
+ "title": "UserCoverage",
660
+ "type": "object"
661
+ }
662
+ },
663
+ "additionalProperties": false,
664
+ "description": "能力总览(agent 起点):查什么数据、覆盖范围、查询模型、规模闸、下钻指引。",
665
+ "properties": {
666
+ "data": {
667
+ "description": "数据类型(用户)",
668
+ "title": "Data",
669
+ "type": "string"
670
+ },
671
+ "description": {
672
+ "description": "能力一句话说明",
673
+ "title": "Description",
674
+ "type": "string"
675
+ },
676
+ "coverage": {
677
+ "$ref": "#/$defs/UserCoverage",
678
+ "description": "覆盖范围 + 逐库画像"
679
+ },
680
+ "query_model": {
681
+ "description": "查询模型说明(必填入参与 where 的关系)",
682
+ "title": "Query Model",
683
+ "type": "string"
684
+ },
685
+ "value_convention": {
686
+ "description": "取值约定:一律传 ES 真实值,系统不翻译",
687
+ "title": "Value Convention",
688
+ "type": "string"
689
+ },
690
+ "limits": {
691
+ "$ref": "#/$defs/Limits",
692
+ "description": "规模闸"
693
+ },
694
+ "discovery": {
695
+ "description": "其余发现接口名(下钻指引)",
696
+ "items": {
697
+ "type": "string"
698
+ },
699
+ "title": "Discovery",
700
+ "type": "array"
701
+ },
702
+ "query_tools": {
703
+ "description": "查询工具名",
704
+ "items": {
705
+ "type": "string"
706
+ },
707
+ "title": "Query Tools",
708
+ "type": "array"
709
+ }
710
+ },
711
+ "required": [
712
+ "data",
713
+ "description",
714
+ "coverage",
715
+ "query_model",
716
+ "value_convention",
717
+ "limits",
718
+ "discovery",
719
+ "query_tools"
720
+ ],
721
+ "title": "CapabilityOverview",
722
+ "type": "object"
723
+ },
724
+ "flags": [],
725
+ "transport": {
726
+ "method": "POST",
727
+ "path": "/user-query/describe_capability",
728
+ "send": "args"
729
+ },
730
+ "errors": [
731
+ "auth_error",
732
+ "validation",
733
+ "api_error",
734
+ "network",
735
+ "internal"
736
+ ]
737
+ },
738
+ {
739
+ "action": "get-field-examples",
740
+ "op": "get_field_examples",
741
+ "name": "user-query/get_field_examples",
742
+ "summary": "批量取字段样例值,看数据长相(如 kw_nickName / long_followerCount)。",
743
+ "description": "批量取字段样例值,看数据长相(如 kw_nickName / long_followerCount)。",
744
+ "input_schema": {
745
+ "additionalProperties": false,
746
+ "properties": {
747
+ "fields": {
748
+ "description": "想看样例值的字段 name_en 名单(如 kw_nickName / long_followerCount)",
749
+ "items": {
750
+ "type": "string"
751
+ },
752
+ "minItems": 1,
753
+ "title": "Fields",
754
+ "type": "array"
755
+ }
756
+ },
757
+ "required": [
758
+ "fields"
759
+ ],
760
+ "title": "FieldExamplesInput",
761
+ "type": "object"
762
+ },
763
+ "output_schema": {
764
+ "additionalProperties": false,
765
+ "properties": {
766
+ "items": {
767
+ "additionalProperties": {
768
+ "type": "string"
769
+ },
770
+ "description": "{字段 name_en: 样例值};**只含有样例的字段**,其余见 warnings",
771
+ "title": "Items",
772
+ "type": "object"
773
+ },
774
+ "warnings": {
775
+ "description": "未返回样例的字段说明(字段无 example_value,或名字拼错);空=要的都给了",
776
+ "items": {
777
+ "type": "string"
778
+ },
779
+ "title": "Warnings",
780
+ "type": "array"
781
+ }
782
+ },
783
+ "required": [
784
+ "items"
785
+ ],
786
+ "title": "FieldExamples",
787
+ "type": "object"
788
+ },
789
+ "flags": [
790
+ {
791
+ "flag": "--fields",
792
+ "field": "fields",
793
+ "type": "list[str](json)",
794
+ "required": true,
795
+ "desc": "想看样例值的字段 name_en 名单(如 kw_nickName / long_followerCount)"
796
+ }
797
+ ],
798
+ "transport": {
799
+ "method": "POST",
800
+ "path": "/user-query/get_field_examples",
801
+ "send": "args"
802
+ },
803
+ "errors": [
804
+ "auth_error",
805
+ "validation",
806
+ "api_error",
807
+ "network",
808
+ "internal"
809
+ ]
810
+ },
811
+ {
812
+ "action": "get-field-values",
813
+ "op": "get_field_values",
814
+ "name": "user-query/get_field_values",
815
+ "summary": "取字段值字典 [{code, value}] —— 枚举/code 字段的全部合法取值。",
816
+ "description": "取字段值字典 [{code, value}] —— 枚举/code 字段的全部合法取值。\n\n账号库字段多为明文;**空列表原样返回**(明文字段无字典,或该字段未配值来源)。",
817
+ "input_schema": {
818
+ "additionalProperties": false,
819
+ "properties": {
820
+ "field": {
821
+ "description": "字段 name_en;仅 is_enum/is_code 的字段有值字典(账号库多为明文,少数标签/类型字段有字典)",
822
+ "title": "Field",
823
+ "type": "string"
824
+ },
825
+ "keyword": {
826
+ "anyOf": [
827
+ {
828
+ "type": "string"
829
+ },
830
+ {
831
+ "type": "null"
832
+ }
833
+ ],
834
+ "default": null,
835
+ "description": "按值/code 模糊过滤;不传=全量",
836
+ "title": "Keyword"
837
+ }
838
+ },
839
+ "required": [
840
+ "field"
841
+ ],
842
+ "title": "FieldValuesInput",
843
+ "type": "object"
844
+ },
845
+ "output_schema": {
846
+ "$defs": {
847
+ "FieldValue": {
848
+ "additionalProperties": false,
849
+ "properties": {
850
+ "code": {
851
+ "description": "值 code(enum 的 code / 知识中心的 tagCode)",
852
+ "title": "Code",
853
+ "type": "string"
854
+ },
855
+ "value": {
856
+ "description": "人话(enum 的 value / 知识中心的 tagName)",
857
+ "title": "Value",
858
+ "type": "string"
859
+ }
860
+ },
861
+ "required": [
862
+ "code",
863
+ "value"
864
+ ],
865
+ "title": "FieldValue",
866
+ "type": "object"
867
+ }
868
+ },
869
+ "additionalProperties": false,
870
+ "properties": {
871
+ "field": {
872
+ "description": "字段 name_en",
873
+ "title": "Field",
874
+ "type": "string"
875
+ },
876
+ "items": {
877
+ "description": "值字典 [{code, value}]",
878
+ "items": {
879
+ "$ref": "#/$defs/FieldValue"
880
+ },
881
+ "title": "Items",
882
+ "type": "array"
883
+ },
884
+ "total": {
885
+ "description": "总数",
886
+ "title": "Total",
887
+ "type": "integer"
888
+ }
889
+ },
890
+ "required": [
891
+ "field",
892
+ "items",
893
+ "total"
894
+ ],
895
+ "title": "FieldValueList",
896
+ "type": "object"
897
+ },
898
+ "flags": [
899
+ {
900
+ "flag": "--field",
901
+ "field": "field",
902
+ "type": "string",
903
+ "required": true,
904
+ "desc": "字段 name_en;仅 is_enum/is_code 的字段有值字典(账号库多为明文,少数标签/类型字段有字典)"
905
+ },
906
+ {
907
+ "flag": "--keyword",
908
+ "field": "keyword",
909
+ "type": "string",
910
+ "required": false,
911
+ "desc": "按值/code 模糊过滤;不传=全量"
912
+ }
913
+ ],
914
+ "transport": {
915
+ "method": "POST",
916
+ "path": "/user-query/get_field_values",
917
+ "send": "args"
918
+ },
919
+ "errors": [
920
+ "auth_error",
921
+ "validation",
922
+ "api_error",
923
+ "network",
924
+ "internal"
925
+ ]
926
+ },
927
+ {
928
+ "action": "get-query",
929
+ "op": "get_query",
930
+ "name": "user-query/get_query",
931
+ "summary": "凭 trace_id 回看历史查询:原始入参、实际 DSL、命中索引与结果摘要。",
932
+ "description": "凭 trace_id 回看历史查询:原始入参、实际 DSL、命中索引与结果摘要。\n只能回看**本人**发起的查询。\n⚠ 审计异步落库,查询刚返回时通常还没写入,请至少等 30 秒再回看(否则同样返回 40426)。\n审计只保留近 3 个月(ILM),更早的 trace_id 查不到。",
933
+ "input_schema": {
934
+ "additionalProperties": false,
935
+ "properties": {
936
+ "trace_id": {
937
+ "description": "查询响应里返回的审计标识 trace_id(如 tr_703781746697984)",
938
+ "pattern": "^tr_\\d{1,16}$",
939
+ "title": "Trace Id",
940
+ "type": "string"
941
+ }
942
+ },
943
+ "required": [
944
+ "trace_id"
945
+ ],
946
+ "title": "GetQueryInput",
947
+ "type": "object"
948
+ },
949
+ "output_schema": {
950
+ "additionalProperties": false,
951
+ "description": "出参即审计文档去掉请求人字段;三个 JSON 字符串在服务端解析回对象(截断过的旧文档原样给串)。",
952
+ "properties": {
953
+ "trace_id": {
954
+ "description": "审计标识,与入参一致",
955
+ "title": "Trace Id",
956
+ "type": "string"
957
+ },
958
+ "queried_at": {
959
+ "description": "查询发起时间(东八区,无偏移)",
960
+ "title": "Queried At",
961
+ "type": "string"
962
+ },
963
+ "capability": {
964
+ "description": "能力 key",
965
+ "title": "Capability",
966
+ "type": "string"
967
+ },
968
+ "tool": {
969
+ "description": "查询工具:get_user / search / aggregate",
970
+ "title": "Tool",
971
+ "type": "string"
972
+ },
973
+ "env": {
974
+ "description": "写入环境后缀:test / prod",
975
+ "title": "Env",
976
+ "type": "string"
977
+ },
978
+ "schema_version": {
979
+ "description": "审计文档结构版本",
980
+ "title": "Schema Version",
981
+ "type": "string"
982
+ },
983
+ "status": {
984
+ "description": "当次查询结果:ok / error",
985
+ "title": "Status",
986
+ "type": "string"
987
+ },
988
+ "query_summary": {
989
+ "anyOf": [
990
+ {
991
+ "type": "string"
992
+ },
993
+ {
994
+ "type": "null"
995
+ }
996
+ ],
997
+ "description": "当次的中文意图概括",
998
+ "title": "Query Summary"
999
+ },
1000
+ "structured_params": {
1001
+ "description": "当次**原始入参**(对象)—— 回放:原样作为 get_user/search/aggregate 的入参再跑即可;历史截断文档给原始字符串",
1002
+ "title": "Structured Params"
1003
+ },
1004
+ "compiled_dsl": {
1005
+ "description": "当次实际执行的 ES DSL(对象,原文全量);历史截断文档给原始字符串",
1006
+ "title": "Compiled Dsl"
1007
+ },
1008
+ "resolved_indices": {
1009
+ "anyOf": [
1010
+ {
1011
+ "items": {
1012
+ "type": "string"
1013
+ },
1014
+ "type": "array"
1015
+ },
1016
+ {
1017
+ "type": "null"
1018
+ }
1019
+ ],
1020
+ "description": "实际命中的索引",
1021
+ "title": "Resolved Indices"
1022
+ },
1023
+ "missing_indices": {
1024
+ "anyOf": [
1025
+ {
1026
+ "items": {
1027
+ "type": "string"
1028
+ },
1029
+ "type": "array"
1030
+ },
1031
+ {
1032
+ "type": "null"
1033
+ }
1034
+ ],
1035
+ "description": "探活缺失的模式;空 = 全覆盖",
1036
+ "title": "Missing Indices"
1037
+ },
1038
+ "result": {
1039
+ "anyOf": [
1040
+ {
1041
+ "additionalProperties": true,
1042
+ "type": "object"
1043
+ },
1044
+ {
1045
+ "type": "null"
1046
+ }
1047
+ ],
1048
+ "description": "{total, tookMs, elapsedMs, returned, truncated};status=error 时为 null",
1049
+ "title": "Result"
1050
+ },
1051
+ "warnings": {
1052
+ "anyOf": [
1053
+ {
1054
+ "items": {
1055
+ "type": "string"
1056
+ },
1057
+ "type": "array"
1058
+ },
1059
+ {
1060
+ "type": "null"
1061
+ }
1062
+ ],
1063
+ "description": "当次的告警原文",
1064
+ "title": "Warnings"
1065
+ },
1066
+ "warning_kinds": {
1067
+ "anyOf": [
1068
+ {
1069
+ "items": {
1070
+ "type": "string"
1071
+ },
1072
+ "type": "array"
1073
+ },
1074
+ {
1075
+ "type": "null"
1076
+ }
1077
+ ],
1078
+ "description": "告警枚举:partial_index_missing / shard_failure / timeout",
1079
+ "title": "Warning Kinds"
1080
+ },
1081
+ "error": {
1082
+ "anyOf": [
1083
+ {
1084
+ "additionalProperties": true,
1085
+ "type": "object"
1086
+ },
1087
+ {
1088
+ "type": "null"
1089
+ }
1090
+ ],
1091
+ "description": "{code, msg};status=ok 时为 null",
1092
+ "title": "Error"
1093
+ },
1094
+ "result_sample": {
1095
+ "description": "结果头部切片(对象,结构感知截断,内置 _truncated 标记);空结果/失败为 null",
1096
+ "title": "Result Sample"
1097
+ }
1098
+ },
1099
+ "required": [
1100
+ "trace_id",
1101
+ "queried_at",
1102
+ "capability",
1103
+ "tool",
1104
+ "env",
1105
+ "schema_version",
1106
+ "status",
1107
+ "query_summary",
1108
+ "structured_params",
1109
+ "compiled_dsl",
1110
+ "resolved_indices",
1111
+ "missing_indices",
1112
+ "result",
1113
+ "warnings",
1114
+ "warning_kinds",
1115
+ "error",
1116
+ "result_sample"
1117
+ ],
1118
+ "title": "GetQueryOutput",
1119
+ "type": "object"
1120
+ },
1121
+ "flags": [
1122
+ {
1123
+ "flag": "--trace-id",
1124
+ "field": "trace_id",
1125
+ "type": "string",
1126
+ "required": true,
1127
+ "desc": "查询响应里返回的审计标识 trace_id(如 tr_703781746697984)"
1128
+ }
1129
+ ],
1130
+ "transport": {
1131
+ "method": "POST",
1132
+ "path": "/user-query/get_query",
1133
+ "send": "args"
1134
+ },
1135
+ "errors": [
1136
+ "auth_error",
1137
+ "validation",
1138
+ "api_error",
1139
+ "network",
1140
+ "internal"
1141
+ ]
1142
+ },
1143
+ {
1144
+ "action": "get-user",
1145
+ "op": "get_user",
1146
+ "name": "user-query/get_user",
1147
+ "summary": "按账号 ID 批量精确取画像:单库 + uids(一次≤10000)。",
1148
+ "description": "按账号 ID 批量精确取画像:单库 + uids(一次≤10000)。\n\n不传 fields 返回画像常用字段;传 fields 只返回指定。命中与否按入参 uids 对账,给 found/not_found。",
1149
+ "input_schema": {
1150
+ "additionalProperties": false,
1151
+ "properties": {
1152
+ "query_summary": {
1153
+ "description": "【必填】用一句简短中文概括**本次查询的意图** —— 基于用户的原始诉求来总结,不是复述参数。应能让人不看 DSL 就知道在查什么:覆盖账号库、主要筛选条件、以及排序/取数口径(若有)。例:「抖音广东百万粉女性账号」「按 uid 批量查账号画像」「微博账号各省粉丝量分布」。该概况会和 trace_id 一起写入查询日志,供审计回溯,请每次如实填写。",
1154
+ "maxLength": 200,
1155
+ "minLength": 1,
1156
+ "title": "Query Summary",
1157
+ "type": "string"
1158
+ },
1159
+ "platform": {
1160
+ "description": "单个账号库 name_en(用 list-platforms 查)",
1161
+ "minLength": 1,
1162
+ "title": "Platform",
1163
+ "type": "string"
1164
+ },
1165
+ "uids": {
1166
+ "description": "账号 ID 列表(kw_uid 值);单个也写成数组;一次最多 get_user_max_uids(默认 10000),超了拒",
1167
+ "items": {
1168
+ "type": "string"
1169
+ },
1170
+ "minItems": 1,
1171
+ "title": "Uids",
1172
+ "type": "array"
1173
+ },
1174
+ "fields": {
1175
+ "anyOf": [
1176
+ {
1177
+ "items": {
1178
+ "type": "string"
1179
+ },
1180
+ "type": "array"
1181
+ },
1182
+ {
1183
+ "type": "null"
1184
+ }
1185
+ ],
1186
+ "default": null,
1187
+ "description": "出参投影;不传=画像常用字段(DEFAULT_FIELDS),传则只返回指定;要全量先 list-fields 拿字段名",
1188
+ "title": "Fields"
1189
+ }
1190
+ },
1191
+ "required": [
1192
+ "query_summary",
1193
+ "platform",
1194
+ "uids"
1195
+ ],
1196
+ "title": "GetUserInput",
1197
+ "type": "object"
1198
+ },
1199
+ "output_schema": {
1200
+ "additionalProperties": true,
1201
+ "properties": {
1202
+ "platform": {
1203
+ "description": "账号库 name_en",
1204
+ "title": "Platform",
1205
+ "type": "string"
1206
+ },
1207
+ "requested": {
1208
+ "description": "入参 uids 个数",
1209
+ "title": "Requested",
1210
+ "type": "integer"
1211
+ },
1212
+ "found": {
1213
+ "description": "命中账号(每条含投影字段,含 kw_uid)",
1214
+ "items": {
1215
+ "additionalProperties": true,
1216
+ "type": "object"
1217
+ },
1218
+ "title": "Found",
1219
+ "type": "array"
1220
+ },
1221
+ "not_found": {
1222
+ "description": "查无的 uid(按入参对账)",
1223
+ "items": {
1224
+ "type": "string"
1225
+ },
1226
+ "title": "Not Found",
1227
+ "type": "array"
1228
+ },
1229
+ "took_ms": {
1230
+ "description": "ES 耗时(毫秒)",
1231
+ "title": "Took Ms",
1232
+ "type": "integer"
1233
+ },
1234
+ "warnings": {
1235
+ "description": "索引缺失等提示",
1236
+ "items": {
1237
+ "type": "string"
1238
+ },
1239
+ "title": "Warnings",
1240
+ "type": "array"
1241
+ },
1242
+ "trace_id": {
1243
+ "description": "查询审计标识",
1244
+ "title": "Trace Id",
1245
+ "type": "string"
1246
+ }
1247
+ },
1248
+ "required": [
1249
+ "platform",
1250
+ "requested",
1251
+ "found",
1252
+ "not_found",
1253
+ "took_ms",
1254
+ "trace_id"
1255
+ ],
1256
+ "title": "GetUserOutput",
1257
+ "type": "object"
1258
+ },
1259
+ "flags": [
1260
+ {
1261
+ "flag": "--query-summary",
1262
+ "field": "query_summary",
1263
+ "type": "string",
1264
+ "required": true,
1265
+ "desc": "【必填】用一句简短中文概括**本次查询的意图** —— 基于用户的原始诉求来总结,不是复述参数。应能让人不看 DSL 就知道在查什么:覆盖账号库、主要筛选条件、以及排序/取数口径(若有)。例:「抖音广东百万粉女性账号」「按 uid 批量查账号画像」「微博账号各省粉丝量分布」。该概况会和 trace_id 一起写入查询日志,供审计回溯,请每次如实填写。"
1266
+ },
1267
+ {
1268
+ "flag": "--platform",
1269
+ "field": "platform",
1270
+ "type": "string",
1271
+ "required": true,
1272
+ "desc": "单个账号库 name_en(用 list-platforms 查)"
1273
+ },
1274
+ {
1275
+ "flag": "--uids",
1276
+ "field": "uids",
1277
+ "type": "list[str](json)",
1278
+ "required": true,
1279
+ "desc": "账号 ID 列表(kw_uid 值);单个也写成数组;一次最多 get_user_max_uids(默认 10000),超了拒"
1280
+ },
1281
+ {
1282
+ "flag": "--fields",
1283
+ "field": "fields",
1284
+ "type": "list[str](json)",
1285
+ "required": false,
1286
+ "desc": "出参投影;不传=画像常用字段(DEFAULT_FIELDS),传则只返回指定;要全量先 list-fields 拿字段名"
1287
+ }
1288
+ ],
1289
+ "transport": {
1290
+ "method": "POST",
1291
+ "path": "/user-query/get_user",
1292
+ "send": "args"
1293
+ },
1294
+ "errors": [
1295
+ "auth_error",
1296
+ "validation",
1297
+ "api_error",
1298
+ "network",
1299
+ "internal"
1300
+ ]
1301
+ },
1302
+ {
1303
+ "action": "list-fields",
1304
+ "op": "list_fields",
1305
+ "name": "user-query/list_fields",
1306
+ "summary": "列出可用字段:中文名、类型、可用操作(不含具体值与样例)。建议按库或关键词收窄。",
1307
+ "description": "列出可用字段:中文名、类型、可用操作(不含具体值与样例)。建议按库或关键词收窄。",
1308
+ "input_schema": {
1309
+ "additionalProperties": false,
1310
+ "properties": {
1311
+ "platforms": {
1312
+ "anyOf": [
1313
+ {
1314
+ "items": {
1315
+ "type": "string"
1316
+ },
1317
+ "type": "array"
1318
+ },
1319
+ {
1320
+ "type": "null"
1321
+ }
1322
+ ],
1323
+ "default": null,
1324
+ "description": "账号库 name_en 名单(list_platforms 的 name_en,如 [\"user_v3_douyin\"]);不传/传 [\"*\"]=全部库。建议按库收窄(字段逐库取、各库差异大、全量较慢)",
1325
+ "title": "Platforms"
1326
+ },
1327
+ "keyword": {
1328
+ "anyOf": [
1329
+ {
1330
+ "type": "string"
1331
+ },
1332
+ {
1333
+ "type": "null"
1334
+ }
1335
+ ],
1336
+ "default": null,
1337
+ "description": "按字段中文名/name_en 模糊过滤(如「粉丝」「认证」「地域」)",
1338
+ "title": "Keyword"
1339
+ }
1340
+ },
1341
+ "title": "ListFieldsInput",
1342
+ "type": "object"
1343
+ },
1344
+ "output_schema": {
1345
+ "$defs": {
1346
+ "Field_": {
1347
+ "additionalProperties": false,
1348
+ "description": "字段出参(不含样例值 example;样例较大,单独经 field-examples 按需取)。",
1349
+ "properties": {
1350
+ "name_en": {
1351
+ "description": "字段标识(ES 字段名)",
1352
+ "title": "Name En",
1353
+ "type": "string"
1354
+ },
1355
+ "name": {
1356
+ "description": "字段中文名",
1357
+ "title": "Name",
1358
+ "type": "string"
1359
+ },
1360
+ "data_type": {
1361
+ "description": "语义类型:keyword/text/long/double/date/boolean/object/nested",
1362
+ "title": "Data Type",
1363
+ "type": "string"
1364
+ },
1365
+ "ops": {
1366
+ "description": "可用操作(由 data_type 推导)",
1367
+ "items": {
1368
+ "type": "string"
1369
+ },
1370
+ "title": "Ops",
1371
+ "type": "array"
1372
+ },
1373
+ "aggregatable": {
1374
+ "default": false,
1375
+ "description": "是否可聚合",
1376
+ "title": "Aggregatable",
1377
+ "type": "boolean"
1378
+ },
1379
+ "sortable": {
1380
+ "default": false,
1381
+ "description": "是否可排序",
1382
+ "title": "Sortable",
1383
+ "type": "boolean"
1384
+ },
1385
+ "is_enum": {
1386
+ "default": false,
1387
+ "description": "值来自内置枚举(value_source=enum)",
1388
+ "title": "Is Enum",
1389
+ "type": "boolean"
1390
+ },
1391
+ "is_code": {
1392
+ "default": false,
1393
+ "description": "值为 code、需经知识中心解析(value_source=kb)",
1394
+ "title": "Is Code",
1395
+ "type": "boolean"
1396
+ },
1397
+ "value_source": {
1398
+ "default": "none",
1399
+ "description": "值来源:none/enum/kb",
1400
+ "title": "Value Source",
1401
+ "type": "string"
1402
+ },
1403
+ "platforms": {
1404
+ "description": "出现该字段的平台 name_en 列表",
1405
+ "items": {
1406
+ "type": "string"
1407
+ },
1408
+ "title": "Platforms",
1409
+ "type": "array"
1410
+ },
1411
+ "description": {
1412
+ "default": "",
1413
+ "description": "字段描述",
1414
+ "title": "Description",
1415
+ "type": "string"
1416
+ }
1417
+ },
1418
+ "required": [
1419
+ "name_en",
1420
+ "name",
1421
+ "data_type"
1422
+ ],
1423
+ "title": "Field_",
1424
+ "type": "object"
1425
+ }
1426
+ },
1427
+ "additionalProperties": false,
1428
+ "properties": {
1429
+ "items": {
1430
+ "description": "字段列表(不含具体值与样例)",
1431
+ "items": {
1432
+ "$ref": "#/$defs/Field_"
1433
+ },
1434
+ "title": "Items",
1435
+ "type": "array"
1436
+ },
1437
+ "total": {
1438
+ "description": "总数",
1439
+ "title": "Total",
1440
+ "type": "integer"
1441
+ }
1442
+ },
1443
+ "required": [
1444
+ "items",
1445
+ "total"
1446
+ ],
1447
+ "title": "FieldList",
1448
+ "type": "object"
1449
+ },
1450
+ "flags": [
1451
+ {
1452
+ "flag": "--platforms",
1453
+ "field": "platforms",
1454
+ "type": "list[str](json)",
1455
+ "required": false,
1456
+ "desc": "账号库 name_en 名单(list_platforms 的 name_en,如 [\"user_v3_douyin\"]);不传/传 [\"*\"]=全部库。建议按库收窄(字段逐库取、各库差异大、全量较慢)"
1457
+ },
1458
+ {
1459
+ "flag": "--keyword",
1460
+ "field": "keyword",
1461
+ "type": "string",
1462
+ "required": false,
1463
+ "desc": "按字段中文名/name_en 模糊过滤(如「粉丝」「认证」「地域」)"
1464
+ }
1465
+ ],
1466
+ "transport": {
1467
+ "method": "POST",
1468
+ "path": "/user-query/list_fields",
1469
+ "send": "args"
1470
+ },
1471
+ "errors": [
1472
+ "auth_error",
1473
+ "validation",
1474
+ "api_error",
1475
+ "network",
1476
+ "internal"
1477
+ ]
1478
+ },
1479
+ {
1480
+ "action": "list-platforms",
1481
+ "op": "list_platforms",
1482
+ "name": "user-query/list_platforms",
1483
+ "summary": "列出账号库(name_en 即 get_user/search 的 platform 入参)。",
1484
+ "description": "列出账号库(name_en 即 get_user/search 的 platform 入参)。",
1485
+ "input_schema": {
1486
+ "type": "object",
1487
+ "properties": {},
1488
+ "additionalProperties": false
1489
+ },
1490
+ "output_schema": {
1491
+ "$defs": {
1492
+ "Platform": {
1493
+ "additionalProperties": false,
1494
+ "properties": {
1495
+ "name_en": {
1496
+ "description": "平台标识(= kw_platform 值)",
1497
+ "title": "Name En",
1498
+ "type": "string"
1499
+ },
1500
+ "name": {
1501
+ "description": "平台中文名",
1502
+ "title": "Name",
1503
+ "type": "string"
1504
+ },
1505
+ "description": {
1506
+ "default": "",
1507
+ "description": "平台描述",
1508
+ "title": "Description",
1509
+ "type": "string"
1510
+ },
1511
+ "index_prefix": {
1512
+ "default": "",
1513
+ "description": "索引前缀(索引名解析用)",
1514
+ "title": "Index Prefix",
1515
+ "type": "string"
1516
+ },
1517
+ "time_pattern": {
1518
+ "default": "",
1519
+ "description": "索引时间分片模式(如 yyyyMM)",
1520
+ "title": "Time Pattern",
1521
+ "type": "string"
1522
+ }
1523
+ },
1524
+ "required": [
1525
+ "name_en",
1526
+ "name"
1527
+ ],
1528
+ "title": "Platform",
1529
+ "type": "object"
1530
+ }
1531
+ },
1532
+ "additionalProperties": false,
1533
+ "properties": {
1534
+ "items": {
1535
+ "description": "账号库列表(name_en 即 get_user/search 的 platform 入参)",
1536
+ "items": {
1537
+ "$ref": "#/$defs/Platform"
1538
+ },
1539
+ "title": "Items",
1540
+ "type": "array"
1541
+ },
1542
+ "total": {
1543
+ "description": "总数",
1544
+ "title": "Total",
1545
+ "type": "integer"
1546
+ }
1547
+ },
1548
+ "required": [
1549
+ "items",
1550
+ "total"
1551
+ ],
1552
+ "title": "PlatformList",
1553
+ "type": "object"
1554
+ },
1555
+ "flags": [],
1556
+ "transport": {
1557
+ "method": "POST",
1558
+ "path": "/user-query/list_platforms",
1559
+ "send": "args"
1560
+ },
1561
+ "errors": [
1562
+ "auth_error",
1563
+ "validation",
1564
+ "api_error",
1565
+ "network",
1566
+ "internal"
1567
+ ]
1568
+ },
1569
+ {
1570
+ "action": "search",
1571
+ "op": "search",
1572
+ "name": "user-query/search",
1573
+ "summary": "多条件搜账号:单库 + where(可选);缺省按 long_followerCount 降序、精简投影。",
1574
+ "description": "多条件搜账号:单库 + where(可选);缺省按 long_followerCount 降序、精简投影。\n\n**不支持翻页**:单次最多 query_max_size 条;要更多请收窄 where,要统计用 aggregate。",
1575
+ "input_schema": {
1576
+ "$defs": {
1577
+ "AndNode": {
1578
+ "additionalProperties": false,
1579
+ "properties": {
1580
+ "and": {
1581
+ "description": "全部满足(编译为 bool.filter);至少 1 个条件",
1582
+ "items": {
1583
+ "anyOf": [
1584
+ {
1585
+ "$ref": "#/$defs/AndNode"
1586
+ },
1587
+ {
1588
+ "$ref": "#/$defs/OrNode"
1589
+ },
1590
+ {
1591
+ "$ref": "#/$defs/NotNode"
1592
+ },
1593
+ {
1594
+ "$ref": "#/$defs/Leaf"
1595
+ }
1596
+ ]
1597
+ },
1598
+ "minItems": 1,
1599
+ "title": "And",
1600
+ "type": "array"
1601
+ }
1602
+ },
1603
+ "required": [
1604
+ "and"
1605
+ ],
1606
+ "title": "AndNode",
1607
+ "type": "object"
1608
+ },
1609
+ "Leaf": {
1610
+ "additionalProperties": false,
1611
+ "description": "叶子条件 ``{field, op, value}``;value 传 ES 真实值(不翻译)。",
1612
+ "properties": {
1613
+ "field": {
1614
+ "description": "字段 name_en",
1615
+ "maxLength": 128,
1616
+ "minLength": 1,
1617
+ "title": "Field",
1618
+ "type": "string"
1619
+ },
1620
+ "op": {
1621
+ "description": "操作符;须在字段 data_type 允许集合内(§1.5)",
1622
+ "enum": [
1623
+ "eq",
1624
+ "in",
1625
+ "match",
1626
+ "match_phrase",
1627
+ "gt",
1628
+ "gte",
1629
+ "lt",
1630
+ "lte",
1631
+ "exists"
1632
+ ],
1633
+ "title": "Op",
1634
+ "type": "string"
1635
+ },
1636
+ "value": {
1637
+ "anyOf": [
1638
+ {
1639
+ "type": "string"
1640
+ },
1641
+ {
1642
+ "type": "integer"
1643
+ },
1644
+ {
1645
+ "type": "number"
1646
+ },
1647
+ {
1648
+ "type": "boolean"
1649
+ },
1650
+ {
1651
+ "items": {
1652
+ "anyOf": [
1653
+ {
1654
+ "type": "string"
1655
+ },
1656
+ {
1657
+ "type": "integer"
1658
+ },
1659
+ {
1660
+ "type": "number"
1661
+ },
1662
+ {
1663
+ "type": "boolean"
1664
+ }
1665
+ ]
1666
+ },
1667
+ "type": "array"
1668
+ },
1669
+ {
1670
+ "type": "null"
1671
+ }
1672
+ ],
1673
+ "default": null,
1674
+ "description": "ES 真实值;in 传数组;exists 无需 value",
1675
+ "title": "Value"
1676
+ }
1677
+ },
1678
+ "required": [
1679
+ "field",
1680
+ "op"
1681
+ ],
1682
+ "title": "Leaf",
1683
+ "type": "object"
1684
+ },
1685
+ "NotNode": {
1686
+ "additionalProperties": false,
1687
+ "properties": {
1688
+ "not": {
1689
+ "anyOf": [
1690
+ {
1691
+ "$ref": "#/$defs/AndNode"
1692
+ },
1693
+ {
1694
+ "$ref": "#/$defs/OrNode"
1695
+ },
1696
+ {
1697
+ "$ref": "#/$defs/NotNode"
1698
+ },
1699
+ {
1700
+ "$ref": "#/$defs/Leaf"
1701
+ }
1702
+ ],
1703
+ "description": "取反(编译为 bool.must_not)",
1704
+ "title": "Not"
1705
+ }
1706
+ },
1707
+ "required": [
1708
+ "not"
1709
+ ],
1710
+ "title": "NotNode",
1711
+ "type": "object"
1712
+ },
1713
+ "OrNode": {
1714
+ "additionalProperties": false,
1715
+ "properties": {
1716
+ "or": {
1717
+ "description": "任一满足(编译为 bool.should + minimum_should_match:1);至少 1 个条件",
1718
+ "items": {
1719
+ "anyOf": [
1720
+ {
1721
+ "$ref": "#/$defs/AndNode"
1722
+ },
1723
+ {
1724
+ "$ref": "#/$defs/OrNode"
1725
+ },
1726
+ {
1727
+ "$ref": "#/$defs/NotNode"
1728
+ },
1729
+ {
1730
+ "$ref": "#/$defs/Leaf"
1731
+ }
1732
+ ]
1733
+ },
1734
+ "minItems": 1,
1735
+ "title": "Or",
1736
+ "type": "array"
1737
+ }
1738
+ },
1739
+ "required": [
1740
+ "or"
1741
+ ],
1742
+ "title": "OrNode",
1743
+ "type": "object"
1744
+ },
1745
+ "SortSpec": {
1746
+ "additionalProperties": false,
1747
+ "properties": {
1748
+ "field": {
1749
+ "description": "排序字段;须为可排序类型(keyword/long/double/date/boolean)",
1750
+ "title": "Field",
1751
+ "type": "string"
1752
+ },
1753
+ "order": {
1754
+ "default": "desc",
1755
+ "description": "排序方向",
1756
+ "enum": [
1757
+ "asc",
1758
+ "desc"
1759
+ ],
1760
+ "title": "Order",
1761
+ "type": "string"
1762
+ }
1763
+ },
1764
+ "required": [
1765
+ "field"
1766
+ ],
1767
+ "title": "SortSpec",
1768
+ "type": "object"
1769
+ }
1770
+ },
1771
+ "additionalProperties": false,
1772
+ "properties": {
1773
+ "query_summary": {
1774
+ "description": "【必填】用一句简短中文概括**本次查询的意图** —— 基于用户的原始诉求来总结,不是复述参数。应能让人不看 DSL 就知道在查什么:覆盖账号库、主要筛选条件、以及排序/取数口径(若有)。例:「抖音广东百万粉女性账号」「按 uid 批量查账号画像」「微博账号各省粉丝量分布」。该概况会和 trace_id 一起写入查询日志,供审计回溯,请每次如实填写。",
1775
+ "maxLength": 200,
1776
+ "minLength": 1,
1777
+ "title": "Query Summary",
1778
+ "type": "string"
1779
+ },
1780
+ "platform": {
1781
+ "description": "单个账号库 name_en(用 list-platforms 查)",
1782
+ "minLength": 1,
1783
+ "title": "Platform",
1784
+ "type": "string"
1785
+ },
1786
+ "where": {
1787
+ "anyOf": [
1788
+ {
1789
+ "$ref": "#/$defs/AndNode"
1790
+ },
1791
+ {
1792
+ "$ref": "#/$defs/OrNode"
1793
+ },
1794
+ {
1795
+ "$ref": "#/$defs/NotNode"
1796
+ },
1797
+ {
1798
+ "$ref": "#/$defs/Leaf"
1799
+ },
1800
+ {
1801
+ "type": "null"
1802
+ }
1803
+ ],
1804
+ "default": null,
1805
+ "description": "布尔条件树(可选);昵称/简介用 text_ match,地域/性别/认证用 kw_/bool_,粉丝数用 long_ range;时间过滤用 date_udate",
1806
+ "title": "Where"
1807
+ },
1808
+ "sort": {
1809
+ "anyOf": [
1810
+ {
1811
+ "items": {
1812
+ "$ref": "#/$defs/SortSpec"
1813
+ },
1814
+ "type": "array"
1815
+ },
1816
+ {
1817
+ "type": "null"
1818
+ }
1819
+ ],
1820
+ "default": null,
1821
+ "description": "排序;缺省 long_followerCount desc;末位自动追加 _doc",
1822
+ "title": "Sort"
1823
+ },
1824
+ "fields": {
1825
+ "anyOf": [
1826
+ {
1827
+ "items": {
1828
+ "type": "string"
1829
+ },
1830
+ "type": "array"
1831
+ },
1832
+ {
1833
+ "type": "null"
1834
+ }
1835
+ ],
1836
+ "default": null,
1837
+ "description": "返回字段投影;缺省精简白名单",
1838
+ "title": "Fields"
1839
+ },
1840
+ "size": {
1841
+ "anyOf": [
1842
+ {
1843
+ "minimum": 0,
1844
+ "type": "integer"
1845
+ },
1846
+ {
1847
+ "type": "null"
1848
+ }
1849
+ ],
1850
+ "default": null,
1851
+ "description": "返回条数;0=只看 total;≤ query_max_size,缺省 query_default_size",
1852
+ "title": "Size"
1853
+ }
1854
+ },
1855
+ "required": [
1856
+ "query_summary",
1857
+ "platform"
1858
+ ],
1859
+ "title": "SearchInput",
1860
+ "type": "object"
1861
+ },
1862
+ "output_schema": {
1863
+ "additionalProperties": true,
1864
+ "properties": {
1865
+ "total": {
1866
+ "description": "命中总数(track_total_hits:true)",
1867
+ "title": "Total",
1868
+ "type": "integer"
1869
+ },
1870
+ "took_ms": {
1871
+ "description": "ES 耗时(毫秒)",
1872
+ "title": "Took Ms",
1873
+ "type": "integer"
1874
+ },
1875
+ "truncated": {
1876
+ "description": "total > size,还有更多命中",
1877
+ "title": "Truncated",
1878
+ "type": "boolean"
1879
+ },
1880
+ "hits": {
1881
+ "description": "命中账号(投影字段)",
1882
+ "items": {
1883
+ "additionalProperties": true,
1884
+ "type": "object"
1885
+ },
1886
+ "title": "Hits",
1887
+ "type": "array"
1888
+ },
1889
+ "warnings": {
1890
+ "description": "索引缺失等提示",
1891
+ "items": {
1892
+ "type": "string"
1893
+ },
1894
+ "title": "Warnings",
1895
+ "type": "array"
1896
+ },
1897
+ "trace_id": {
1898
+ "description": "查询审计标识",
1899
+ "title": "Trace Id",
1900
+ "type": "string"
1901
+ }
1902
+ },
1903
+ "required": [
1904
+ "total",
1905
+ "took_ms",
1906
+ "truncated",
1907
+ "hits",
1908
+ "trace_id"
1909
+ ],
1910
+ "title": "SearchOutput",
1911
+ "type": "object"
1912
+ },
1913
+ "flags": [
1914
+ {
1915
+ "flag": "--query-summary",
1916
+ "field": "query_summary",
1917
+ "type": "string",
1918
+ "required": true,
1919
+ "desc": "【必填】用一句简短中文概括**本次查询的意图** —— 基于用户的原始诉求来总结,不是复述参数。应能让人不看 DSL 就知道在查什么:覆盖账号库、主要筛选条件、以及排序/取数口径(若有)。例:「抖音广东百万粉女性账号」「按 uid 批量查账号画像」「微博账号各省粉丝量分布」。该概况会和 trace_id 一起写入查询日志,供审计回溯,请每次如实填写。"
1920
+ },
1921
+ {
1922
+ "flag": "--platform",
1923
+ "field": "platform",
1924
+ "type": "string",
1925
+ "required": true,
1926
+ "desc": "单个账号库 name_en(用 list-platforms 查)"
1927
+ },
1928
+ {
1929
+ "flag": "--where",
1930
+ "field": "where",
1931
+ "type": "object(json)",
1932
+ "required": false,
1933
+ "desc": "布尔条件树(可选);昵称/简介用 text_ match,地域/性别/认证用 kw_/bool_,粉丝数用 long_ range;时间过滤用 date_udate"
1934
+ },
1935
+ {
1936
+ "flag": "--sort",
1937
+ "field": "sort",
1938
+ "type": "list[object](json)",
1939
+ "required": false,
1940
+ "desc": "排序;缺省 long_followerCount desc;末位自动追加 _doc"
1941
+ },
1942
+ {
1943
+ "flag": "--fields",
1944
+ "field": "fields",
1945
+ "type": "list[str](json)",
1946
+ "required": false,
1947
+ "desc": "返回字段投影;缺省精简白名单"
1948
+ },
1949
+ {
1950
+ "flag": "--size",
1951
+ "field": "size",
1952
+ "type": "integer",
1953
+ "required": false,
1954
+ "desc": "返回条数;0=只看 total;≤ query_max_size,缺省 query_default_size"
1955
+ }
1956
+ ],
1957
+ "transport": {
1958
+ "method": "POST",
1959
+ "path": "/user-query/search",
1960
+ "send": "args"
1961
+ },
1962
+ "errors": [
1963
+ "auth_error",
1964
+ "validation",
1965
+ "api_error",
1966
+ "network",
1967
+ "internal"
1968
+ ]
1969
+ }
1970
+ ],
1971
+ "skill": {
1972
+ "slug": "social-neuron-user-query",
1973
+ "description": "使用场景:社交账号画像即时查询 —— 查微博/抖音/小红书/快手/B站/知乎等平台的账号库。能力:get_user 按账号 ID 批量取完整画像、search 多条件搜账号(昵称/地域/粉丝量/认证/标签)、aggregate 做画像分布统计(粉丝量分档、地域/性别分布)、get_query 凭 trace_id 回看历史查询。查询模型:platform(必填,单个账号库 name_en)+ get_user 的 uids(批量主键,一次≤10000)或 search/aggregate 的 where 布尔树;**无必填时间**(画像快照,时间过滤用 date_udate)。取值:一律传 ES 真实值(性别/地域是中文明文),系统不翻译;聚合/排序须用 kw_ 字段(text_ 不可聚合)。边界:①只读;②不支持翻页(单次≤1000);③部分库 helix name_en 可能有版本错位,查不到时核对。",
1974
+ "actions": [
1975
+ "aggregate",
1976
+ "describe-capability",
1977
+ "get-field-examples",
1978
+ "get-field-values",
1979
+ "get-query",
1980
+ "get-user",
1981
+ "list-fields",
1982
+ "list-platforms",
1983
+ "search"
1984
+ ]
1985
+ }
1986
+ }