@thinkingai/ae-cli 6.0.45 → 6.0.47

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 (114) hide show
  1. package/README.md +2 -0
  2. package/README.zh.md +6 -0
  3. package/dist/{auth-77BUFLGC.js → auth-QPEVVBKT.js} +20 -15
  4. package/dist/auth-UMJAA72O.js +15 -0
  5. package/dist/{capability-ENHWPMTG.js → capability-RUSV77CO.js} +53 -15
  6. package/dist/{chunk-UW5UN47B.js → chunk-533JK3YX.js} +2 -0
  7. package/dist/{chunk-VPKZ7I72.js → chunk-6QK7SYYY.js} +5 -4
  8. package/dist/{chunk-TUKQZTMI.js → chunk-7K24F7T2.js} +2 -0
  9. package/dist/{chunk-OO6XR6LK.js → chunk-AMBFK2K3.js} +2 -0
  10. package/dist/{sync-DAVKYVMW.js → chunk-B5HMQAOM.js} +31 -540
  11. package/dist/{chunk-EE45RGOO.js → chunk-BVDST5YT.js} +5 -4
  12. package/dist/{chunk-VTWMIC5L.js → chunk-E2JKXMVO.js} +2 -0
  13. package/dist/{chunk-LYVNONC4.js → chunk-FR2EDAQM.js} +36 -0
  14. package/dist/{chunk-ILIU36SU.js → chunk-GJXRF7Y6.js} +6 -5
  15. package/dist/{chunk-DWO43OIB.js → chunk-JQ3ENZZH.js} +2 -0
  16. package/dist/chunk-JYMGHGCE.js +191 -0
  17. package/dist/{chunk-GT46FPXN.js → chunk-KEWVSO64.js} +18 -8
  18. package/dist/chunk-KZ6ZHF5J.js +294 -0
  19. package/dist/{chunk-QI524WPY.js → chunk-NSIVXKJH.js} +6 -5
  20. package/dist/chunk-O6K2ODUE.js +318 -0
  21. package/dist/chunk-QL6R6TSK.js +25215 -0
  22. package/dist/{chunk-4SGZG4XY.js → chunk-RWXIXOZG.js} +28 -13
  23. package/dist/{chunk-4NN5IWVN.js → chunk-T6OSFQZD.js} +2 -0
  24. package/dist/{chunk-PTE56QPL.js → chunk-TKHSULJT.js} +6 -0
  25. package/dist/{chunk-6EIJSNBD.js → chunk-Y74WTIKJ.js} +2 -0
  26. package/dist/{client-TKG4WBHN.js → client-N7NGZUNI.js} +6 -4
  27. package/dist/{community-report-client-FI4LNVYS.js → community-report-client-6OL6GBQW.js} +3 -3
  28. package/dist/{config-RE6CMGPK.js → config-XNMACCKX.js} +10 -8
  29. package/dist/{data-integration-XQYB4X4F.js → data-integration-4NZGZ45E.js} +2502 -272
  30. package/dist/index.js +130 -1243
  31. package/dist/{local-data-upload-client-BWHSUQQK.js → local-data-upload-client-EFHDLXFG.js} +3 -3
  32. package/dist/{memory-YK33G4T7.js → memory-HBJQ2GC5.js} +8 -7
  33. package/dist/{metadata-AXVHAAZG.js → metadata-PGDJE5RQ.js} +12 -11
  34. package/dist/{model-K3KLWIW6.js → model-BHLJ2QMT.js} +10 -9
  35. package/dist/personal-semantic-preference-E5NZ56DN.js +240 -0
  36. package/dist/sync-MUWPRM5I.js +522 -0
  37. package/dist/{te-agent-4BKBODMF.js → te-agent-WQZTMEK4.js} +12 -10
  38. package/dist/{te-analysis-WX7LRVAV.js → te-analysis-YWCSSLYL.js} +534 -48
  39. package/dist/{te-community-HLC43QKH.js → te-community-BNE6KREL.js} +8 -7
  40. package/dist/{te-dataops-EJP56W3K.js → te-dataops-TXLKM2W6.js} +469 -68
  41. package/dist/{te-engage-UBHPAJCO.js → te-engage-VEW4CJHK.js} +26 -10
  42. package/dist/{te-kb-SQCLHG6X.js → te-kb-BUD6N3NI.js} +312 -25
  43. package/dist/{te-system-YARIK4S5.js → te-system-44LZJDTQ.js} +573 -37
  44. package/dist/{te-team-EFKWYKMK.js → te-team-XMP47YXE.js} +10 -7
  45. package/dist/{update-OGPSZM5A.js → update-UODFOZ4P.js} +9 -7
  46. package/package.json +18 -9
  47. package/skills/ae-agent/SKILL.md +3 -4
  48. package/skills/ae-agent/references/edit-skill.md +3 -0
  49. package/skills/ae-agent/references/get-skill-content.md +1 -1
  50. package/skills/ae-agent/references/rescan-skills.md +15 -13
  51. package/skills/ae-agent/references/upload-skill.md +7 -4
  52. package/skills/ae-analysis/SKILL.md +29 -4
  53. package/skills/ae-analysis/metadata_resolution.md +38 -4
  54. package/skills/ae-analysis/references/analysis_data_retrieval.md +29 -0
  55. package/skills/ae-analysis/references/analysis_gateway_assets.md +1 -1
  56. package/skills/ae-analysis/references/asset_authentication_export.md +22 -0
  57. package/skills/ae-analysis/references/asset_authentication_list.md +18 -14
  58. package/skills/ae-analysis/references/asset_authentication_update.md +29 -14
  59. package/skills/ae-analysis/references/audience_models.md +18 -0
  60. package/skills/ae-analysis/references/command_index.md +19 -11
  61. package/skills/ae-analysis/references/dashboard_get.md +18 -1
  62. package/skills/ae-analysis/references/dashboard_update.md +3 -0
  63. package/skills/ae-analysis/references/personal_semantic_preference_add.md +23 -0
  64. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +17 -0
  65. package/skills/ae-analysis/references/personal_semantic_preference_get.md +17 -0
  66. package/skills/ae-analysis/references/personal_semantic_preference_list.md +19 -0
  67. package/skills/ae-analysis/references/personal_semantic_preference_update.md +19 -0
  68. package/skills/ae-analysis/references/project_timezone_update.md +13 -4
  69. package/skills/ae-analysis/references/property_create.md +2 -0
  70. package/skills/ae-analysis/references/super_metadata_batch_create.md +2 -0
  71. package/skills/ae-analysis/references/user_cluster_models.md +2 -0
  72. package/skills/ae-analysis/references/user_cluster_update.md +8 -4
  73. package/skills/ae-analysis/references/user_tag_create.md +7 -1
  74. package/skills/ae-analysis/references/user_tag_models.md +8 -2
  75. package/skills/ae-data-integration/SKILL.md +24 -4
  76. package/skills/ae-data-integration/references/custom-layer.md +93 -0
  77. package/skills/ae-data-integration/references/error-handling.md +145 -0
  78. package/skills/ae-data-integration/references/handoff.md +77 -18
  79. package/skills/ae-data-integration/references/local-analysis.md +1 -1
  80. package/skills/ae-data-integration/references/reuse.md +9 -5
  81. package/skills/ae-data-integration/references/sink-upload.md +1 -1
  82. package/skills/ae-data-integration/references/source-inspect.md +35 -13
  83. package/skills/ae-data-integration/references/tracking-plan.md +7 -5
  84. package/skills/ae-data-integration/references/transform.md +12 -10
  85. package/skills/ae-data-integration/references/ue-mapping.md +33 -11
  86. package/skills/ae-data-integration/references/ue-routing.md +23 -0
  87. package/skills/ae-dataops/SKILL.md +11 -1
  88. package/skills/ae-dataops/references/dataops-backfill.md +135 -0
  89. package/skills/ae-engage/SKILL.md +3 -0
  90. package/skills/ae-engage/references/build-task-save-guide.md +14 -1
  91. package/skills/ae-engage/references/save-task.md +88 -0
  92. package/skills/ae-kb/SKILL.md +121 -10
  93. package/skills/ae-system/SKILL.md +28 -30
  94. package/skills/ae-system/references/channel-management.md +303 -0
  95. package/dist/auth-2WTQOP77.js +0 -14
  96. package/dist/capability-WA37LSIR.js +0 -312
  97. package/dist/chunk-4KVPKXFX.js +0 -98
  98. package/dist/chunk-C4MGVGJW.js +0 -13
  99. package/dist/chunk-MGU2N3HW.js +0 -556
  100. package/dist/chunk-P3FGXJTU.js +0 -349
  101. package/dist/chunk-QEFCIRNJ.js +0 -71
  102. package/dist/chunk-QGM4M3NI.js +0 -37
  103. package/dist/chunk-UOUS37JQ.js +0 -509
  104. package/dist/chunk-ZZUOD757.js +0 -598
  105. package/dist/memory-CHRU2F7W.js +0 -893
  106. package/dist/metadata-GGEHHPBE.js +0 -339
  107. package/dist/model-NR3JHFSJ.js +0 -139
  108. package/dist/sync-FCKOVWWS.js +0 -10261
  109. package/dist/te-agent-HLW4VTQK.js +0 -3893
  110. package/dist/te-analysis-YKFDBMA6.js +0 -8958
  111. package/dist/te-community-6HPBWJUZ.js +0 -1859
  112. package/dist/te-dataops-HDRUXY4K.js +0 -2208
  113. package/dist/te-engage-WLDTS5J5.js +0 -4898
  114. package/dist/te-system-Z77IKZFN.js +0 -2213
@@ -36,12 +36,16 @@ compounds when reusing `definition_request`; flattening them changes audience se
36
36
  For the second sequence step, omit `relative_to_first` or set it to `false`; use `true` only
37
37
  from the third step onward when its window must be measured from step 1.
38
38
 
39
- For existing-cluster audiences (`targetClusterType=2`), you may copy server-authored definitions via:
39
+ For server-side existing-cluster audiences (`targetClusterType=2`), you may copy server-authored definitions via:
40
40
 
41
41
  ```bash
42
42
  ae-cli analysis user-cluster get --project-id <projectId> --cluster-names '["<cluster_name>"]'
43
43
  ```
44
44
 
45
+ Server-side channels allow custom (`1`) or existing (`2`) audiences and reject all users (`3`).
46
+ `client_push` (`channelType=3`) allows custom (`1`) or all users (`3`) and rejects existing (`2`).
47
+ Always pass `channelType` in `context` so the guide can validate this matrix.
48
+
45
49
  4. Build the final grouped `save_task.req`.
46
50
  5. Submit with `ae-cli engage-task task save --project-id <projectId> --req '{...}'`.
47
51
 
@@ -229,6 +233,8 @@ When experiment mode is enabled (`context.enableExp=true` or draft `expConfig.en
229
233
  - capability `engage-task.task.build-save-guide` enriches `handoff.reqTemplate.channelConfig.groupContentList`
230
234
  so each entry carries `expGroupName`, `expGroupType`, `percentageInExperiment`, `order`, and `contentList`
231
235
  - do not drop those association fields when filling content; they must stay aligned with `expConfig.expGroupList`
236
+ - copy the complete group tuple (`expGroupName`, `expGroupType`, `percentageInExperiment`, `order`)
237
+ into both lists; matching only by list position is not sufficient
232
238
 
233
239
  ### 4.8 `fieldRules`
234
240
 
@@ -300,6 +306,11 @@ Apply this rule only to
300
306
  `completionIndicatorDef.completionIndicators[].eventDefinition.filters`. Trigger-event filters have
301
307
  their own scenario rules and are not subject to this completion-filter restriction.
302
308
 
309
+ For `completionIndicatorType=0`, also read and preserve `requiredMainGoalFields` and
310
+ `touchCycleRule`. A valid main goal includes `touch_cycle_num` and `touch_cycle_num_unit`; use `1`
311
+ and `day` when no custom completion window is requested. Do not rely on static `--validate` alone
312
+ because the save service performs this additional business validation.
313
+
303
314
  ### 4.9 `handoff`
304
315
 
305
316
  This is the final section before `save_task`.
@@ -336,6 +347,8 @@ Recommended usage pattern:
336
347
  definition directly
337
348
  7. omit `clientConfig.clientQp`; partial updates preserve the server-authored value
338
349
  8. call `engage-task task save`
350
+ 9. after an experiment save succeeds, call `engage-task task get` and verify that both
351
+ `exp_config.exp_group_list` and `group_content_list` contain the expected group tuples
339
352
 
340
353
  ---
341
354
 
@@ -245,6 +245,12 @@ Use the guide to decide which audience shape applies:
245
245
  - `targetClusterType=2`: existing cluster, requires `clusterKey`
246
246
  - `targetClusterType=3`: all users, forbids `definitionRequest` and `clusterKey`
247
247
 
248
+ Audience availability depends on delivery side:
249
+
250
+ - Server-side channels support `targetClusterType=1` (custom) and `2` (existing), but not `3` (all users).
251
+ - `client_push` (`channelType=3`) supports `targetClusterType=1` (custom) and `3` (all users), but not `2` (existing).
252
+ - Determine the delivery side from the selected real channel; do not infer audience support from `triggerType` alone.
253
+
248
254
  For a custom audience, pass the semantic definition directly. Do not create an intermediate
249
255
  cluster or copy persisted QP.
250
256
 
@@ -426,6 +432,11 @@ When the guide points to event-based completion or experiment-driven main-goal r
426
432
  Read `fieldRules.blocks.controlConfig.completionIndicatorDef.filterPropertySelectTypes` and exclude
427
433
  every property type listed under `excluded` before constructing its `filters`.
428
434
 
435
+ For a main goal (`completionIndicatorType=0`), always include `touch_cycle_num` and
436
+ `touch_cycle_num_unit`. If the user does not request another completion window, use
437
+ `touch_cycle_num=1` and `touch_cycle_num_unit="day"`. Static Capability validation may accept a
438
+ main goal without these fields, but the Hermes save service rejects it.
439
+
429
440
  Important constraints that still apply:
430
441
 
431
442
  - `doNotDisturb.enableDoNotDisturb=true` requires `startTime` and `endTime` in `HH:mm`
@@ -444,6 +455,81 @@ compatibility field, and partial task updates preserve the existing server value
444
455
  client-side condition has no semantic field in the current contract, stop and report that it cannot
445
456
  be safely authored through this Capability.
446
457
 
458
+ ### 4.7 Verified A/B Task Template
459
+
460
+ Use this shape as the starting point for a server-channel split experiment. Replace every
461
+ placeholder with metadata discovered from the current project.
462
+
463
+ ```json
464
+ {
465
+ "baseInfo": {
466
+ "taskName": "<taskName>",
467
+ "taskDesc": "<taskDescription>",
468
+ "tzOffset": "<projectTimezoneOrDefaultSentinel>"
469
+ },
470
+ "channelConfig": {
471
+ "channelType": 1,
472
+ "channelId": "<verifiedChannelId>",
473
+ "groupContentList": [
474
+ {
475
+ "expGroupName": "Control",
476
+ "expGroupType": 1,
477
+ "percentageInExperiment": 50,
478
+ "order": 0,
479
+ "contentList": [{ "pushLanguageCode": "default", "content": "<channelContentJsonString>" }]
480
+ },
481
+ {
482
+ "expGroupName": "Experiment A",
483
+ "expGroupType": 2,
484
+ "percentageInExperiment": 50,
485
+ "order": 1,
486
+ "contentList": [{ "pushLanguageCode": "default", "content": "<channelContentJsonString>" }]
487
+ }
488
+ ]
489
+ },
490
+ "targetConfig": {
491
+ "targetClusterType": 1,
492
+ "definitionRequest": "<semanticAudienceDefinition>"
493
+ },
494
+ "triggerConfig": { "triggerType": 2 },
495
+ "controlConfig": {
496
+ "completionIndicatorDef": {
497
+ "completionIndicators": [
498
+ {
499
+ "completionIndicatorType": 0,
500
+ "touch_cycle_num": 1,
501
+ "touch_cycle_num_unit": "day",
502
+ "eventDefinition": {
503
+ "type": "event",
504
+ "event": "<verifiedGoalEvent>",
505
+ "aggregation": "count",
506
+ "operator": "gte",
507
+ "value": 1
508
+ }
509
+ }
510
+ ]
511
+ },
512
+ "frequencyLimits": { "enableFrequencyLimits": false, "ruleList": [] }
513
+ },
514
+ "expConfig": {
515
+ "enableExp": true,
516
+ "expType": 1,
517
+ "percentageInLayer": 100,
518
+ "expIndicatorBizType": 1,
519
+ "controlGroupSkipPush": false,
520
+ "expGroupList": [
521
+ { "expGroupName": "Control", "expGroupType": 1, "percentageInExperiment": 50, "order": 0 },
522
+ { "expGroupName": "Experiment A", "expGroupType": 2, "percentageInExperiment": 50, "order": 1 }
523
+ ]
524
+ }
525
+ }
526
+ ```
527
+
528
+ The experiment group tuple (`expGroupName`, `expGroupType`, `percentageInExperiment`, `order`)
529
+ must be identical between each `expConfig.expGroupList` entry and its corresponding
530
+ `channelConfig.groupContentList` entry. Validate the final request, save it, then call `task get`
531
+ and verify both persisted lists; a successful task ID alone is not sufficient verification.
532
+
447
533
  ---
448
534
 
449
535
  ## 5. Final Self-Check Before `engage-task task save`
@@ -461,6 +547,8 @@ Before submission, verify:
461
547
  9. No unsupported `triggerType=6` is used.
462
548
  10. Ordered steps contain `eventDefinition` and sequence metadata, not persisted aggregate fields.
463
549
  11. No placeholder IDs or fabricated resource names remain in the request.
550
+ 12. Every main goal includes `touch_cycle_num` and `touch_cycle_num_unit`.
551
+ 13. For experiments, `expGroupList` and `groupContentList` contain identical group tuples.
464
552
 
465
553
  ---
466
554
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ae-kb
3
3
  version: 1.0.0
4
- description: "AE/TE knowledge base CLI manual for creating, querying, LLM-powered ask, listing accessible knowledge bases, deterministic index/grep/read retrieval, checking status, uploading, compiling, schema generation, URL sources, source deletion, and knowledge base deletion. Use when the user asks to manage TE/AE/ThinkingEngine knowledge bases, upload documents or URLs to a knowledge base, query knowledge, ask knowledge bases with an LLM, list accessible knowledge bases, inspect knowledge base indexes, search knowledge base pages, read a specific knowledge base page, check knowledge base status, generate schemas, compile knowledge, remove sources, or delete a knowledge base. To choose which knowledge base is worth searching, use the ae-kb-discovery skill first; this skill runs the retrieval once a target is chosen. Must use ae-cli kb commands and must not guess knowledge base names, scopes, page paths, source display names, JSON payload shapes, or URL formats."
4
+ description: 'AE/TE knowledge base CLI manual for creating, importing read-only compiled snapshots, querying, LLM-powered ask, listing accessible knowledge bases and their sources, deterministic index/grep/read retrieval, checking status, uploading, compiling, schema generation, URL sources, source deletion, and knowledge base deletion. Use when the user asks to manage TE/AE/ThinkingEngine knowledge bases, import a compiled Markdown ZIP snapshot, upload documents or URLs to a knowledge base, query knowledge, ask knowledge bases with an LLM, list accessible knowledge bases or source metadata, inspect knowledge base indexes, search knowledge base pages, read a specific knowledge base page, check knowledge base status, generate schemas, compile knowledge, remove sources, or delete a knowledge base. To choose which knowledge base is worth searching, use the ae-kb-discovery skill first; this skill runs the retrieval once a target is chosen. Must use ae-cli kb commands and must not guess knowledge base names, scopes, page paths, source IDs, source display names, JSON payload shapes, or URL formats.'
5
5
  ---
6
6
 
7
7
  # ae-kb
@@ -14,11 +14,11 @@ ae-cli kb +<command> [options]
14
14
 
15
15
  ## Global Rules
16
16
 
17
- - Use this skill for TE/AE knowledge base tasks: create, query, ask with LLM, list accessible knowledge bases, inspect indexes, grep pages, read pages, check status, upload sources, add URL sources, generate schema, compile, remove source files, and delete knowledge bases.
17
+ - Use this skill for TE/AE knowledge base tasks: create, import a compiled snapshot, query, ask with LLM, list accessible knowledge bases and their sources, inspect indexes, grep pages, read pages, check status, upload sources, add URL sources, generate schema, compile, remove source files, and delete knowledge bases.
18
18
  - **Searching a knowledge base for an answer is the most common task. If that is what you are doing, go straight to [Explore Knowledge Base Pages](#explore-knowledge-base-pages) and read [`references/query-workflow.md`](references/query-workflow.md) first — it is the retrieval procedure. The other commands below are for managing knowledge bases, not answering from them.**
19
19
  - Read operations can run directly after required inputs are known. Write operations require explicit user intent and normally keep the confirmation prompt unless the user asks to bypass it.
20
20
  - Prefer `--dry-run` before destructive or broad writes when the user has not already validated the target.
21
- - Do not invent knowledge base names, scopes, source display names, or JSON payloads. Ask the user or query known context when values are missing.
21
+ - Do not invent knowledge base names, scopes, source IDs, source display names, or JSON payloads. Ask the user or query known context when values are missing.
22
22
  - When building a `--sources` ref (or `+read --source`), copy the exact `scope` and `name` from `+list` output — run `ae-cli kb +list` first when the scope of a named knowledge base is unknown.
23
23
  - JSON flags must be valid JSON strings, usually wrapped in single quotes in shell commands.
24
24
  - Successful commands return JSON by default. Use `--format table` only when a table is easier for a human to scan. Envelope may include optional `_notice.host_compat`.
@@ -33,16 +33,19 @@ ae-cli kb +<command> [options]
33
33
  | `+ask` | read | LLM-powered Q&A over knowledge bases; for multi-page synthesis or multi-hop questions. |
34
34
  | `+ask-status` | read | Query the current status of an ask execution by `--execution-id` without polling. |
35
35
  | `+list` | read | List accessible knowledge bases filtered by buildStatus (default: compiled). |
36
+ | `+list-sources` | read | List source metadata for one knowledge base so exact source identifiers can be discovered safely. |
36
37
  | `+index` | read | List accessible knowledge bases and their `index.md` navigation maps. |
37
38
  | `+grep` | read | Keyword-search knowledge base pages and return matched lines with context. |
38
39
  | `+read` | read | Read a full knowledge base page, a line window, or (with `--outline`) only the page heading tree. |
39
40
  | `+new` | write | Create a new personal or company knowledge base. |
41
+ | `+import` | write | Import a compiled Markdown ZIP as a personal read-only snapshot. |
42
+ | `+import-status` | read | Query one snapshot import task by `--request-id` without polling. |
40
43
  | `+add` | write | Upload local files, a non-recursive directory, or HTTP(S) pages converted to markdown. |
41
44
  | `+url` | write | Upload a URL source directly with optional display name and parsing instruction. |
42
45
  | `+schema` | write | Generate the compile schema for a knowledge base. |
43
46
  | `+compile` | write | Compile a knowledge base in incremental or full mode. |
44
47
  | `+status` | read | Query the current status of a knowledge base. |
45
- | `+rm-source` | write | Delete one source file from a knowledge base by display name. |
48
+ | `+rm-source` | high-risk-write | Delete one source from a knowledge base by stable ID; exact display name is legacy compatibility only. |
46
49
  | `+remove` | write | Delete an entire knowledge base. |
47
50
 
48
51
  ## Common Workflows
@@ -67,6 +70,36 @@ Optional fields:
67
70
  - `--project-id`: optional project ID to bind.
68
71
  - `--project-name`: optional project display name.
69
72
 
73
+ ### Import a Compiled Snapshot
74
+
75
+ Use `+import` only for a ZIP whose root contains `index.md` and at least one
76
+ `wiki/**/*.md` page. The server validates all archive paths, limits, UTF-8 text, and Wiki links.
77
+
78
+ ```bash
79
+ ae-cli kb +import \
80
+ --file ./knowledge-base.zip \
81
+ --name "Imported handbook" \
82
+ --description "Compiled documentation snapshot" \
83
+ --tags '["docs","handbook"]'
84
+
85
+ # The submission returns requestId + queued. Query one snapshot later:
86
+ ae-cli kb +import-status --request-id <requestId>
87
+ ```
88
+
89
+ - The result is always a `personal` read-only snapshot; there is no `--scope`, `--force`, or replace option.
90
+ - Imported snapshots support list, Index/Wiki reading, grep/read, Ask, and deletion. They do not expose source, Schema, usage, compile, member, settings, ownership-transfer, or company-publish operations.
91
+ - The ZIP is limited to 50 MB and supports Markdown text only. Local images, attachments, other binaries, broken Wiki links, and ambiguous Wiki links are rejected by the server.
92
+ - Submission returns `{requestId, status: "queued"}` immediately. It does not wait for ZIP validation or publication.
93
+ - `+import-status` returns one of `queued`, `running`, `succeeded`, or `failed`; success includes `knowledgeBaseId`, and failure includes a stable error code/message.
94
+ - If a `requestId` was returned, query it before retrying. If no request ID was received, run `ae-cli kb +list` before retrying the same name. A repeated same-name import is rejected.
95
+
96
+ - Transition status: transitional
97
+ - Owning module: te-claude External Knowledge Base Import API
98
+ - Current transport: authenticated KB external REST through `kbUpload` for submission and `kbApi` for status lookup.
99
+ - Gateway target: TBD (`kb.snapshot.import` proposed)
100
+ - Review after: 2026-12-01
101
+ - Exit condition: migrate to a typed Gateway capability when the equivalent multipart import capability is available, or remove this command if dynamic Gateway execution provides the same file-handling and output contract.
102
+
70
103
  ### Upload Files or Directories
71
104
 
72
105
  Use `+add` when sources are local files, local directories, or pages that should be fetched and converted to markdown before upload.
@@ -97,7 +130,7 @@ ae-cli kb +url \
97
130
  --parse-instruction "Keep headings and code blocks"
98
131
  ```
99
132
 
100
- `--url` must be `http(s)`.
133
+ `--url` must be `http(s)`. The server detects the platform from the URL automatically: URLs on a `*.feishu.cn` or `*.larksuite.com` subdomain are parsed with the Feishu pipeline (including sub-documents, using the server's own Feishu parsing instruction — `--parse-instruction` is ignored for them); all other URLs are fetched as regular web pages.
101
134
 
102
135
  ### Generate Schema and Compile
103
136
 
@@ -107,7 +140,17 @@ Generate the schema first when the knowledge base needs a compile schema.
107
140
  ae-cli kb +schema --name engineering-handbook
108
141
  ```
109
142
 
110
- Use `--force` only to recover a stuck `generating` status. Use `--model` only when the user provides the model display name.
143
+ Use `--force` only when `+status` reports `schema_generating` and the user explicitly wants to replace the current generation attempt. The replacement may consume additional tokens. Use `--model` only when the user provides the model display name.
144
+
145
+ To add one-time guidance for this generation without changing stored knowledge base metadata, pass `--custom-instructions`. The server trims the value, treats whitespace-only input as absent, and accepts up to 10,000 Unicode characters. Do not include secrets or credentials.
146
+
147
+ ```bash
148
+ ae-cli kb +schema \
149
+ --name engineering-handbook \
150
+ --custom-instructions "Prioritize troubleshooting workflows and preserve command examples"
151
+ ```
152
+
153
+ Use `--dry-run` to inspect the request body before sending it. While generation is running, a request without `--force` is idempotent only when it supplies no new model or effective custom instructions; otherwise it fails with `KB_SCHEMA_GENERATION_IN_PROGRESS`. With `--force`, the selected model and custom instructions apply to the replacement attempt. Invalid text fails with `KB_SCHEMA_CUSTOM_INSTRUCTIONS_INVALID`.
111
154
 
112
155
  Compile after sources and schema are ready:
113
156
 
@@ -213,9 +256,34 @@ ae-cli kb +read \
213
256
  --limit 60
214
257
  ```
215
258
 
259
+ ### List Sources
260
+
261
+ List sources first to discover the stable identifier for the intended source:
262
+
263
+ ```bash
264
+ ae-cli kb +list-sources --name engineering-handbook
265
+ ```
266
+
267
+ Copy the exact `id` from the response into `+rm-source`. Do not guess a source ID from a local filename, URL, display name, or an older upload response.
268
+
269
+ - Transition status: transitional
270
+ - Owning module: te-claude External Knowledge Base Sources API
271
+ - Current transport: authenticated KB external REST through `kbApi`.
272
+ - Gateway target: TBD (`kb.source.list` proposed)
273
+ - Review after: 2026-12-03
274
+ - Exit condition: migrate to a typed Gateway capability when an equivalent source-list capability is available, or remove this command if dynamic Gateway execution provides the same discoverability and safe output contract.
275
+
216
276
  ### Remove One Source
217
277
 
218
- Use `+rm-source` only when the source display name is known exactly.
278
+ Use `+rm-source --id` with the exact ID returned by the current `+list-sources` response. This is a `high-risk-write`; keep the interactive confirmation unless the user has explicitly authorized `--yes`.
279
+
280
+ ```bash
281
+ ae-cli kb +rm-source \
282
+ --name engineering-handbook \
283
+ --id cm-source-id
284
+ ```
285
+
286
+ `--display-name` is retained for legacy compatibility only when a stable source ID is unavailable:
219
287
 
220
288
  ```bash
221
289
  ae-cli kb +rm-source \
@@ -223,7 +291,7 @@ ae-cli kb +rm-source \
223
291
  --display-name kb-1780046712-guide.md
224
292
  ```
225
293
 
226
- If the user only gives a loose source name, do not guess. Ask for the exact uploaded display name.
294
+ If the user only gives a loose source name, do not guess a source ID. Run `+list-sources`, identify the intended row from returned metadata, and ask only when multiple rows remain ambiguous.
227
295
 
228
296
  ### Delete a Knowledge Base
229
297
 
@@ -316,6 +384,30 @@ ae-cli kb +new --name "<name>" [--scope personal|company] [--description "..."]
316
384
  ae-cli kb +add --name "<name>" --files '["./a.md","./docs","https://example.com/page"]'
317
385
  ```
318
386
 
387
+ ### `+import`
388
+
389
+ ```bash
390
+ ae-cli kb +import --file "./knowledge-base.zip" --name "<name>" [--description "..."] [--tags '["t1","t2"]'] [--project-id "..."]
391
+ ```
392
+
393
+ - `--file`: required local `.zip` file.
394
+ - `--name`: required personal knowledge-base name, up to 30 characters.
395
+ - `--description`: optional, up to 200 characters.
396
+ - `--tags`: optional JSON array, max 2 unique tags, each up to 15 characters.
397
+ - `--project-id`: optional project binding.
398
+ - Scope and terminal build state are generated by the server and cannot be supplied by the client.
399
+ - Output: `{requestId, status: "queued"}`. Use `+import-status`; the command does not poll.
400
+
401
+ ### `+import-status`
402
+
403
+ ```bash
404
+ ae-cli kb +import-status --request-id <requestId>
405
+ ```
406
+
407
+ - `--request-id`: required ID returned by `+import`.
408
+ - Output: `{requestId, status, knowledgeBaseId?, errorCode?, errorMessage?}`.
409
+ - Returns a single snapshot and does not poll. A failed import is returned as `status: "failed"` with its stable error code/message; an unknown or inaccessible request exits non-zero.
410
+
319
411
  ### `+url`
320
412
 
321
413
  ```bash
@@ -325,9 +417,14 @@ ae-cli kb +url --name "<name>" --url "https://example.com/page" [--display-name
325
417
  ### `+schema`
326
418
 
327
419
  ```bash
328
- ae-cli kb +schema --name "<name>" [--force] [--model "<model displayName>"]
420
+ ae-cli kb +schema --name "<name>" [--force] [--model "<model displayName>"] [--custom-instructions "<one-time guidance>"]
329
421
  ```
330
422
 
423
+ - `--custom-instructions`: Optional per-run schema-generation guidance. It is not persisted; whitespace-only input is omitted. The server allows at most 10,000 Unicode characters and rejects disallowed control characters. Do not include secrets or credentials.
424
+ - `--force`: Replace the current attempt only when schema generation is already running and the user explicitly requests the replacement. The selected model and custom instructions apply to the new attempt, which may consume additional tokens.
425
+ - `--dry-run`: Shows the same `customInstructions` request field that execution will send.
426
+ - Errors: `KB_SCHEMA_CUSTOM_INSTRUCTIONS_INVALID` means the field failed validation. `KB_SCHEMA_GENERATION_IN_PROGRESS` means generation is active and a request without `--force` supplied a new model or effective custom instructions.
427
+
331
428
  ### `+compile`
332
429
 
333
430
  ```bash
@@ -340,12 +437,26 @@ ae-cli kb +compile --name "<name>" [--mode incremental|full]
340
437
  ae-cli kb +status --name "<name>"
341
438
  ```
342
439
 
440
+ ### `+list-sources`
441
+
442
+ ```bash
443
+ ae-cli kb +list-sources --name "<name>"
444
+ ```
445
+
446
+ - `--name`: required knowledge base name.
447
+ - Output: Safe source metadata including the stable `id` needed by `+rm-source`; raw paths, hashes, credentials, and source content are not returned.
448
+ - Copy the exact `id` from the current response before deleting a source; never guess it.
449
+
343
450
  ### `+rm-source`
344
451
 
345
452
  ```bash
346
- ae-cli kb +rm-source --name "<name>" --display-name "<uploaded source display name>"
453
+ ae-cli kb +rm-source --name "<name>" --id "<source-id>"
347
454
  ```
348
455
 
456
+ - `--id`: preferred stable source identifier copied from `+list-sources`.
457
+ - `--display-name`: legacy compatibility selector used only when an ID is unavailable.
458
+ - If both are supplied, `--id` wins. The command removes one source only.
459
+
349
460
  ### `+remove`
350
461
 
351
462
  ```bash
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ae-system
3
- version: 1.1.0
4
- description: "AE Agent system administration CLI for root and agent administrators. Use when the user asks to manage Agent members, sandboxes and shared tools, company model visibility/defaults/pricing, usage statistics and exports, cost quotas, balance alerts, or IM channels. Must use ae-cli system commands, discover real IDs before writes, and never attempt to bypass a permission denial."
3
+ version: 1.2.0
4
+ description: "AE Agent system administration CLI for root and agent administrators. Use when the user asks to manage Agent members, sandboxes and shared tools, company model visibility/defaults/pricing, usage statistics and exports, cost quotas, balance alerts, IM channels, channel routing, WhatsApp Web linking, or Feishu user bindings. Must use ae-cli system commands, discover real IDs before writes, and never attempt to bypass a permission denial."
5
5
  ---
6
6
 
7
7
  # ae-system
@@ -10,12 +10,13 @@ Use the `system` domain for Agent system administration:
10
10
 
11
11
  ```bash
12
12
  ae-cli system +<command> [options]
13
+ ae-cli system <resource> <action> [options]
13
14
  ```
14
15
 
15
16
  ## Mandatory Rules
16
17
 
17
18
  - These commands are only for users whose Agent role is `root` or `agent_admin`.
18
- - The te-agent `/api/admin/**` endpoint is the final authorization boundary. A member receives a permission error (HTTP 403). Do not retry login or attempt a different endpoint after a 403.
19
+ - The te-agent `/api/admin/**` and `/api/cli/channel/v1/**` endpoints are the final authorization boundaries. A member receives a permission error (HTTP 403). Do not retry login or attempt a different endpoint after a 403.
19
20
  - Run `ae-cli auth login --host <host>` before using this domain. System administration requires a user access-token session; sandbox identity headers are not an authorization substitute.
20
21
  - `+npm-install` is the exception that must also run inside a Linux te-agent sandbox because it packages the installed Linux files. It still requires the logged-in user to be `root` or `agent_admin`.
21
22
  - Discover real IDs with a list command before any update or delete. Never guess a user, sandbox, model, quota rule, or channel ID.
@@ -353,41 +354,38 @@ Rules:
353
354
 
354
355
  ### Channels
355
356
 
357
+ For channel setup, routing, WhatsApp Web linking, or Feishu user binding, read [references/channel-management.md](references/channel-management.md) before taking action. It defines the two confirmation phases and the `ae-cli` plus Feishu OpenAPI MCP workflow.
358
+
356
359
  | Command | Risk | Purpose |
357
360
  | --- | --- | --- |
358
- | `+list-channels` | read | List Feishu, Lark, and Slack channels. |
361
+ | `+list-channels` | read | List all configured channels. |
362
+ | `channel get` | read | Read one channel, its verification state, and endpoints. |
359
363
  | `+create-channel` | write | Create one channel. |
360
364
  | `+update-channel` | write | Update channel settings, credentials, model, prompt, or enabled state. |
361
365
  | `+remove-channel` | high-risk-write | Delete a channel, unbind users, and stop its connection. |
362
-
363
- Always use `@file` for channel payloads when they contain credentials:
366
+ | `channel verify` | write | Verify credentials and discover endpoints. |
367
+ | `channel routing get` | read | Read one endpoint's group message routing. |
368
+ | `channel routing set` | write | Replace one endpoint's group message routing. |
369
+ | `channel whatsapp-web status` | read | Read a WhatsApp Web link state and QR data. |
370
+ | `channel whatsapp-web start` | write | Start or resume WhatsApp Web QR linking. |
371
+ | `channel whatsapp-web unlink` | high-risk-write | Unlink WhatsApp Web and remove stored credentials. |
372
+ | `channel binding list` | read | List channel user bindings. |
373
+ | `channel binding bind-feishu` | write | Bind one Feishu user. |
374
+ | `+bind-feishu-users` | write | Bind 1-100 Feishu users and optionally assign Agents. |
375
+ | `channel binding unbind` | high-risk-write | Delete one channel user binding. |
376
+ | `channel binding set-agent` | write | Set or clear one binding's private-chat default Agent. |
377
+
378
+ Use canonical snake_case request fields. The four original commands also accept their legacy camelCase JSON fields for compatibility. Always use `@file` for credentials and batch rosters:
364
379
 
365
380
  ```bash
366
381
  ae-cli system +create-channel --channel @channel.json
367
382
  ae-cli system +update-channel --id <channel-id> --channel @channel-update.json
383
+ ae-cli system +bind-feishu-users \
384
+ --channel-id <channel-id> \
385
+ --endpoint-id <endpoint-id> \
386
+ --bindings @bindings.json
368
387
  ```
369
388
 
370
- Create schema:
371
-
372
- ```json
373
- {
374
- "name": "Required display name",
375
- "type": "feishu",
376
- "config": {
377
- "appId": "Feishu/Lark",
378
- "appSecret": "Feishu/Lark",
379
- "botToken": "Slack",
380
- "appToken": "Slack",
381
- "clientId": "optional",
382
- "clientSecret": "optional"
383
- },
384
- "model": "optional Model.id or modelId::scope",
385
- "systemPrompt": "optional"
386
- }
387
- ```
388
-
389
- Update accepts a partial object with `name`, `config`, `model`, `systemPrompt`, `enabled`, or `unbindUsers`. Channel type is immutable after creation. Dry-run replaces secret values with `***`.
390
-
391
389
  ## Permission Errors
392
390
 
393
391
  A permission response looks like:
@@ -412,9 +410,9 @@ An authenticated `root` or `agent_admin` is still scoped to their own company. T
412
410
 
413
411
  ## Transport Status
414
412
 
415
- This is a Transitional L2 domain backed by te-agent `/api/admin/**`.
413
+ This is a Transitional domain backed by te-agent `/api/admin/**` and `/api/cli/channel/v1/**`.
416
414
 
417
- - Maintainer: te-agent admin routes and `src/commands/te-system/**`.
418
- - Migration target: system Capability Gateway.
415
+ - Maintainer: te-agent admin/channel-management routes and `src/commands/te-system/**`.
416
+ - Migration target: system and channel Capability Gateways.
419
417
  - Review date: 2026-10-24.
420
418
  - Exit condition: migrate after equivalent gateway schema, auth, risk, dry-run, and output contracts are stable.