@thinkingai/ae-cli 6.0.53 → 6.0.54

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 (121) hide show
  1. package/README.md +28 -9
  2. package/README.zh.md +25 -9
  3. package/bin/ae-cli.js +6 -1
  4. package/cli-installation-guide.md +91 -0
  5. package/dist/{auth-LHM7NQPR.js → auth-MBWRZTB6.js} +9 -11
  6. package/dist/automation-NWWVLWG2.js +459 -0
  7. package/dist/{capability-F2RIR5DS.js → capability-7SSN6PNZ.js} +6 -6
  8. package/dist/chunk-4655PUNX.js +43 -0
  9. package/dist/{chunk-KS4DE3MX.js → chunk-5XJYLEVC.js} +4 -4
  10. package/dist/{chunk-N4BLPJC7.js → chunk-7QXISROD.js} +1 -1
  11. package/dist/{chunk-7WZACOAI.js → chunk-AP7YP2NX.js} +2 -2
  12. package/dist/{chunk-SO5LKIWP.js → chunk-CT7QDJS6.js} +2 -2
  13. package/dist/chunk-D6ACFILC.js +56 -0
  14. package/dist/{chunk-QYXDJOLA.js → chunk-EOYSKMXN.js} +19 -11
  15. package/dist/{chunk-5XRQ3CZR.js → chunk-FMNNGNYO.js} +43 -8
  16. package/dist/{chunk-DU72X2IO.js → chunk-GIK6EDUG.js} +22 -10
  17. package/dist/{chunk-PGCIKZRE.js → chunk-HBLK3ZHW.js} +3 -3
  18. package/dist/chunk-HVHR4SCP.js +133 -0
  19. package/dist/{chunk-BW7JUDEI.js → chunk-KFNMQTZI.js} +514 -213
  20. package/dist/{chunk-KJDOTPYU.js → chunk-PLE722AJ.js} +28 -11
  21. package/dist/chunk-RK6GLDGI.js +27 -0
  22. package/dist/{chunk-GK7WDY7E.js → chunk-S6M42KND.js} +1 -1
  23. package/dist/{chunk-IG3DYEIR.js → chunk-UQ77JXYH.js} +4 -3
  24. package/dist/{chunk-YVGXGTD6.js → chunk-WNGFSIOB.js} +7 -1
  25. package/dist/{chunk-647BRKZK.js → chunk-ZIQWCZTS.js} +3 -3
  26. package/dist/{community-report-client-6VJDDMJJ.js → community-report-client-PEERQCX2.js} +1 -1
  27. package/dist/{config-XQWOPDHN.js → config-FF6YVJKI.js} +8 -8
  28. package/dist/context-YAE3QXP3.js +136 -0
  29. package/dist/{data-integration-XBTCGXQT.js → data-integration-HESZET7E.js} +6 -6
  30. package/dist/index.js +125 -48
  31. package/dist/{local-data-upload-client-3P7NIVQ4.js → local-data-upload-client-TWMHFLUA.js} +1 -1
  32. package/dist/memory-62BJOULV.js +580 -0
  33. package/dist/{metadata-V5ZDTKWZ.js → metadata-7CUMWIB4.js} +7 -7
  34. package/dist/{model-ZS7HVGKN.js → model-SBV2JFJI.js} +9 -5
  35. package/dist/{personal-semantic-preference-2XANU3F6.js → personal-semantic-preference-6SRCYPGE.js} +117 -11
  36. package/dist/{project-semantic-LP3LY7QP.js → project-semantic-YYEM4OSU.js} +6 -6
  37. package/dist/{sync-EQLSTUS7.js → sync-SU33KYX7.js} +12 -8
  38. package/dist/{te-agent-Z3HCTKR7.js → te-agent-F5QBZSQA.js} +90 -454
  39. package/dist/{te-analysis-3EVYQ3IO.js → te-analysis-U4I2W2WC.js} +297 -20
  40. package/dist/{te-community-Z7JACGF3.js → te-community-PFLDLPP4.js} +3 -3
  41. package/dist/{te-dataops-F7GQOIS6.js → te-dataops-FOQSRIAZ.js} +5 -5
  42. package/dist/{te-engage-LFBU6WWH.js → te-engage-ZX76CNAB.js} +6 -6
  43. package/dist/{te-kb-QJLJEX5K.js → te-kb-MHDOST62.js} +494 -214
  44. package/dist/{te-system-IXC43QHZ.js → te-system-J2FQF5ER.js} +6 -6
  45. package/dist/{te-team-BIZIKIHZ.js → te-team-5UOZPTU3.js} +6 -6
  46. package/dist/things-VPPXXLHB.js +1091 -0
  47. package/dist/{update-W2SGQNKT.js → update-EEUTEI6R.js} +59 -51
  48. package/dist/workspace-O3EEIYQM.js +554 -0
  49. package/package.json +21 -9
  50. package/skills/ae-agent/SKILL.md +89 -139
  51. package/skills/ae-agent/references/add-model.md +1 -1
  52. package/skills/ae-agent/references/create-agent.md +1 -1
  53. package/skills/ae-agent/references/find-archived-conversations.md +12 -5
  54. package/skills/ae-agent/references/get-agent.md +1 -1
  55. package/skills/ae-agent/references/list-agents.md +2 -2
  56. package/skills/ae-agent/references/list-models.md +2 -2
  57. package/skills/ae-agent/references/restore-conversation.md +3 -1
  58. package/skills/ae-analysis/SKILL.md +15 -6
  59. package/skills/ae-analysis/references/ai_models/funnel.md +5 -3
  60. package/skills/ae-analysis/references/ai_models.md +27 -0
  61. package/skills/ae-analysis/references/command_index.md +12 -4
  62. package/skills/ae-analysis/references/dashboard_move.md +21 -0
  63. package/skills/ae-analysis/references/dashboard_report_add.md +2 -0
  64. package/skills/ae-analysis/references/dashboard_report_get.md +19 -0
  65. package/skills/ae-analysis/references/dashboard_report_update.md +27 -0
  66. package/skills/ae-analysis/references/dashboard_update.md +1 -1
  67. package/skills/ae-analysis/references/event_report_presentation.md +76 -0
  68. package/skills/ae-analysis/references/feedback_submit.md +37 -0
  69. package/skills/ae-analysis/references/metadata_resolution.md +15 -0
  70. package/skills/ae-analysis/references/personal_semantic_preference_review.md +9 -0
  71. package/skills/ae-analysis/references/personal_semantic_preference_review_list.md +7 -0
  72. package/skills/ae-analysis/references/personal_semantic_preference_submit.md +7 -0
  73. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +90 -31
  74. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +99 -1
  75. package/skills/ae-analysis/references/report_create.md +13 -3
  76. package/skills/ae-analysis/references/report_get.md +5 -1
  77. package/skills/ae-analysis/references/report_update.md +15 -4
  78. package/skills/ae-analysis/references/system_query_monitor_overview.md +2 -0
  79. package/skills/ae-analysis/references/system_query_task_cancel.md +2 -0
  80. package/skills/ae-analysis/references/system_query_task_export.md +6 -2
  81. package/skills/ae-analysis/references/system_query_task_get.md +2 -0
  82. package/skills/ae-analysis/references/system_query_task_list.md +7 -3
  83. package/skills/ae-analysis/references/system_query_task_options.md +2 -2
  84. package/skills/ae-analysis/references/system_query_task_realtime_list.md +15 -0
  85. package/skills/ae-analysis/references/user_tag_models.md +2 -0
  86. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-empty-skeleton.mjs +105 -0
  87. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +669 -29
  88. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +21 -8
  89. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +28 -10
  90. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +66 -0
  91. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/generate-build-ir.mjs +285 -24
  92. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/package-wiki-source-zip.mjs +262 -30
  93. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/plan-kb-source-sync.mjs +1 -1
  94. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/precompiled-source.mjs +46 -2
  95. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/prepare-compile-schema.mjs +64 -0
  96. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/refresh-state-parts.mjs +91 -0
  97. package/skills/ae-automation/SKILL.md +16 -0
  98. package/skills/ae-automation/references/cli.md +53 -0
  99. package/skills/ae-automation/references/command_index.md +17 -0
  100. package/skills/ae-capability/SKILL.md +15 -6
  101. package/skills/ae-current-context/SKILL.md +3 -2
  102. package/skills/ae-kb/SKILL.md +62 -12
  103. package/skills/ae-kb/references/analysis-workflow.md +73 -36
  104. package/skills/ae-kb/references/query-workflow.md +67 -33
  105. package/skills/ae-kb/references/schema-import.md +5 -3
  106. package/skills/ae-kb/references/source-mutations.md +6 -4
  107. package/skills/ae-kb/references/text-sources.md +53 -0
  108. package/skills/ae-kb-discovery/SKILL.md +1 -1
  109. package/skills/ae-team/SKILL.md +23 -17
  110. package/skills/ae-things/SKILL.md +85 -0
  111. package/skills/ae-things/references/cli.md +103 -0
  112. package/skills/ae-things-progress/SKILL.md +43 -0
  113. package/skills/ae-things-review/SKILL.md +42 -0
  114. package/skills/ae-workspace/SKILL.md +43 -0
  115. package/skills/ae-workspace/references/commands.md +51 -0
  116. package/dist/chunk-E2JKXMVO.js +0 -29
  117. package/dist/context-M3HDGEIR.js +0 -46
  118. package/dist/memory-6APEB2JB.js +0 -892
  119. package/skills/ae-agent/references/create-automation.md +0 -125
  120. package/skills/ae-agent/references/list-automations.md +0 -56
  121. package/skills/ae-agent/references/update-automation.md +0 -107
@@ -1,10 +1,10 @@
1
1
  # Knowledge-guided analysis workflow
2
2
 
3
3
  Use this workflow after knowledge-base retrieval when the pages will guide a
4
- project-scoped business data analysis. The knowledge base determines which
5
- saved asset to execute, which business definition applies, and which
6
- conclusions are out of bounds. Current values still require an `ae-analysis`
7
- data query.
4
+ project-scoped business data analysis. The knowledge base supplies candidate
5
+ assets, verified definitions, and decision boundaries. Check their coverage of
6
+ the user's original question before choosing execution. Current values still
7
+ require an `ae-analysis` data query; a related KB page is not task completion.
8
8
 
9
9
  This workflow does not define knowledge-base compilation rules. Do not use it
10
10
  to create, upload, generate a schema for, compile, or delete a knowledge base.
@@ -89,25 +89,33 @@ pages actually read:
89
89
  | Decision boundaries | Case-only, frontend-only, adoption-only, not revenue, non-generalizable, expired, conflicting, or human-decision-required constraints |
90
90
  | KB evidence | Exact KB name, page path, and section actually read |
91
91
 
92
- Classify the contract before querying:
92
+ Classify each candidate's coverage before querying. These states classify the
93
+ asset, not completion of the original task:
93
94
 
94
95
  - `executable`: exact asset identity and semantics cover the question, with no
95
96
  unresolved conflict.
96
- - `partially_executable`: evidence covers only some subquestions; query and
97
- answer only those parts.
97
+ - `partially_executable`: evidence covers only some subquestions; execute the
98
+ applicable parts and retain their results, then continue discovery for the
99
+ uncovered parts.
100
+ - `semantic_only`: read evidence supplies useful events, properties, or
101
+ limitations, but the candidate's definition cannot produce the requested
102
+ measure, entity, or scope. Retain that evidence and continue ordinary analysis.
98
103
  - `blocked`: a required asset, metric, aggregation, entity, filter, parameter,
99
- time rule, or decision boundary is missing or conflicting; stop the affected
100
- query and report the gap.
104
+ time rule, or decision boundary is missing or conflicting; do not execute
105
+ that unsupported definition. Continue discovery for the affected requirement
106
+ when an independently verified, authorized path remains possible.
101
107
 
102
108
  Do not fill a contract gap with general knowledge, a similarly named asset, or
103
- a technically valid query. When the task forbids clarification, return that the
104
- available evidence cannot answer the affected part instead of choosing an
105
- interpretation silently.
109
+ a technically valid query. Resolve missing evidence through the ordinary
110
+ analysis path below. If a material business choice remains ambiguous, request
111
+ that choice once; if clarification is forbidden, disclose the unresolved part
112
+ instead of choosing silently. Do not ask the user to authorize continuation of
113
+ the same read-only data request merely because the KB covers only part of it.
106
114
 
107
115
  ## Execute the exact saved-asset chain
108
116
 
109
- An exact asset identified by a source page takes priority over fuzzy search and
110
- ad-hoc analysis:
117
+ An exact, semantically applicable asset identified by a source page takes
118
+ priority over fuzzy search and ad-hoc analysis:
111
119
 
112
120
  1. For a dashboard ID, call `analysis dashboard get` once with the verified
113
121
  project ID. Verify its name, child reports, `effective_settings`,
@@ -116,6 +124,10 @@ ad-hoc analysis:
116
124
  2. For a report ID, call `analysis report get` with the verified project ID.
117
125
  Verify its model, metric, aggregation, dimensions, filters, saved parameters,
118
126
  and time definition before querying data.
127
+ Definition inspection that establishes an unsuitable saved asset does not
128
+ require a data query to prove the mismatch. Record the incompatible fields
129
+ and continue ordinary discovery; do not execute a known wrong definition
130
+ merely to satisfy an attempt-first rule.
119
131
  3. Read the matching `ae-analysis` data-command reference before execution. Use
120
132
  [`report_data_run.md`](../../ae-analysis/references/report_data_run.md) for a
121
133
  bounded saved report result and
@@ -131,9 +143,9 @@ ad-hoc analysis:
131
143
  `ae-analysis`.
132
144
  6. For a metric or another saved asset, use its exact identity and corresponding
133
145
  command. Never replace it with a same-name object.
134
- 7. Use the saved-asset discovery procedure from `ae-analysis` only when the KB
135
- page provides no exact identity. A discovered candidate still requires
136
- semantic equality, not title similarity.
146
+ 7. Use the saved-asset discovery procedure from `ae-analysis` when the KB
147
+ provides no suitable executable identity or leaves requirements uncovered.
148
+ A discovered candidate still requires semantic coverage, not title similarity.
137
149
 
138
150
  If the user asks for multiple groupings that one saved dynamic report supports,
139
151
  execute that same report once per required parameter variant. Keep the common
@@ -142,9 +154,11 @@ identical data command merely to inspect output that was locally truncated;
142
154
  capture or export the complete result through the supported data command.
143
155
 
144
156
  The statement "the KB contains definitions but not current values" means that
145
- the matched saved asset must be attempted first. It does not authorize jumping
146
- directly to a reconstructed SQL or ad-hoc query. If the attempt cannot produce
147
- a usable result, follow the explicit ordinary-analysis fallback below.
157
+ an exact, semantically applicable saved asset must be attempted first. It does
158
+ not require executing a related but unsuitable asset, nor authorize skipping
159
+ saved-asset discovery directly to SQL. If inspection establishes a mismatch or
160
+ execution cannot produce the requested result, follow the ordinary-analysis
161
+ fallback below.
148
162
 
149
163
  When the live definition agrees with the KB, use the query result as data
150
164
  evidence and the KB page as routing, semantic, and boundary evidence.
@@ -173,9 +187,10 @@ definition or hide it with a replacement query.
173
187
 
174
188
  ## Fall back without hiding the knowledge-base result
175
189
 
176
- None of these conditions alone authorizes an ad-hoc or SQL reconstruction:
190
+ These conditions require the state-specific handling and ordinary-analysis
191
+ checks below; none alone establishes a verified ad-hoc or SQL definition:
177
192
 
178
- - The exact saved asset has not yet been attempted.
193
+ - An applicable exact saved asset has not yet been attempted.
179
194
  - The exact saved asset returns an empty result.
180
195
  - The exact asset has a validation, transport, capability, or definition
181
196
  execution failure.
@@ -200,8 +215,8 @@ Handle these states without changing the contract:
200
215
  the input mapping allowed by its saved definition. Do not translate the report
201
216
  into SQL.
202
217
  - Partial success: retain successful saved-asset results and apply these rules
203
- independently to each failed part. Do not discard valid sub-results or replace
204
- the whole request with one reconstructed query.
218
+ independently to each failed or semantically uncovered part. Do not discard
219
+ valid sub-results or replace the whole request with one reconstructed query.
205
220
  - Permission denial: preserve the denied asset, error, and request ID. Do not
206
221
  retry the denied operation or use an undocumented lower-level API. The
207
222
  ordinary analysis fallback may still use another standard `ae-analysis`
@@ -222,8 +237,9 @@ Handle these states without changing the contract:
222
237
  may answer under a different, independently verified definition, but it must
223
238
  not claim to resolve the KB asset's conflict or present the result as
224
239
  definition-equivalent.
225
- - Fixed historical window: answer only for that window. If it cannot answer a
226
- current-period question, state that it cannot be extrapolated.
240
+ - Fixed historical window: do not extrapolate its values to the requested
241
+ period. If the window cannot be overridden, inspect alternatives through
242
+ ordinary analysis instead of presenting that window as the requested result.
227
243
  - Limited applicability: keep the conclusion within the declared scope. Do not
228
244
  expand adoption into revenue or intent, one module into the whole product, or
229
245
  one case into all customers.
@@ -234,25 +250,34 @@ applicable scope is not an equivalent validation.
234
250
 
235
251
  ## Degrade to the ordinary analysis path
236
252
 
237
- The KB path is preferred, not exclusive. If the exact KB-selected asset cannot
238
- produce the requested live result after a real attempt, continue as though no
239
- executable KB asset had been found and follow the ordinary `ae-analysis`
240
- "Existing business asset before ad-hoc" workflow:
253
+ The KB path is preferred, not exclusive. If definition inspection establishes
254
+ that the KB-selected asset cannot cover the request, or a real execution attempt
255
+ cannot produce the requested live result, continue through the ordinary
256
+ `ae-analysis` "Existing business asset before ad-hoc" workflow. Preserve the KB
257
+ evidence and already verified definitions; do not restart from zero:
241
258
 
242
259
  1. Search for another accessible saved report or dashboard whose current live
243
260
  definition covers the request.
244
- 2. Verify semantic equality before using it. A title match is not enough.
245
- 3. If no saved definition matches, use ad-hoc analysis only when the normal
261
+ 2. Compare live definitions with the original request, including distinctions
262
+ such as creation versus creation-and-editing, user versus customer, and
263
+ event count versus distinct entity count. A title match is not enough.
264
+ 3. Follow [`metadata_resolution.md`](../../ae-analysis/references/metadata_resolution.md)
265
+ for uncovered definitions. Reuse verified KB and live-asset evidence; discover
266
+ only missing metadata, filters, dimensions, or scope. A missing descriptive
267
+ field does not invalidate independently supported action counts.
268
+ 4. If no saved definition matches, use authorized ad-hoc analysis only when the normal
246
269
  `ae-analysis` rules permit it and the required event, properties, metric,
247
270
  aggregation, entity, filters, time, and timezone can be established.
248
- 4. Use only documented standard capabilities. Each fallback command remains
271
+ 5. Use only documented standard capabilities. Each fallback command remains
249
272
  subject to the backend's independent authorization checks.
250
273
 
251
274
  Fallback is available when the KB-selected asset is missing from the live
252
275
  project, inaccessible, empty for the requested scope, outside its supported
253
- time or breakdown, or persistently fails after the documented correction or
254
- retry path. The user does not need to restate the original data request merely
255
- to allow this ordinary fallback.
276
+ time or breakdown, semantically unsuitable, missing requested fields or
277
+ submetrics, or persistently fails after the documented correction or retry
278
+ path. Technical success with a partial or wrong definition is also a coverage
279
+ gap, not a reason to stop. The user does not need to restate the original data
280
+ request merely to allow this ordinary fallback.
256
281
 
257
282
  Ad-hoc analysis must still satisfy the safety conditions below. SQL must also
258
283
  satisfy the additional SQL constraints in `ae-analysis`.
@@ -274,6 +299,18 @@ material difference from the KB-selected definition. Never claim that the KB
274
299
  asset produced a fallback result. An empty or denied KB result remains part of
275
300
  the audit record even when the fallback succeeds.
276
301
 
302
+ ## Check task completion
303
+
304
+ Before answering, check each requirement of the original question against the
305
+ actual definition and returned data. Finish when it is answered, or when bounded
306
+ discovery establishes a concrete unavailable prerequisite, authorization
307
+ boundary, or material choice requiring clarification. An asset state of
308
+ `semantic_only`, `partially_executable`, or `blocked` is not by itself a terminal
309
+ task state. Do not label creation-and-editing totals as pure creation, substitute
310
+ another entity, or stop at a KB limitation while verified metadata supports a
311
+ remaining authorized query. Keep genuine unknown fields unknown and label
312
+ partial results explicitly; do not broaden an empty result merely to get rows.
313
+
277
314
  ## Answer with traceable boundaries
278
315
 
279
316
  Make these three layers distinguishable in the final answer:
@@ -1,9 +1,9 @@
1
1
  # ae-kb deterministic query workflow
2
2
 
3
3
  How to answer a knowledge question with the deterministic retrieval primitives
4
- (`+list` / `+index` / `+grep` / `+read`) instead of `+ask`. Follow this order;
5
- it is designed to reach the right section in a few calls and to avoid crawling a
6
- page line by line.
4
+ (`+list` / `+index` / `+grep` / `+read`) instead of `+ask`. Choose the next step
5
+ from the evidence already returned; these are branches, not commands to run on
6
+ every page. Reach relevant evidence without crawling a page line by line.
7
7
 
8
8
  Use `+ask` when the question requires synthesizing across multiple pages or
9
9
  multi-hop reasoning; simple factual lookups are served by the steps below.
@@ -17,7 +17,17 @@ and ranked candidates. Start here with a chosen candidate; scope every `+index`
17
17
  turns out not to cover the question, go back to `ae-kb-discovery` for the next
18
18
  candidate rather than searching everything blindly.
19
19
 
20
- 1. **Index the candidate.** Call `+index --sources` with the discovery pick.
20
+ **Known-page fast path:** within the same host, identity, KB and published revision,
21
+ reuse navigation and read evidence already obtained in this task. Copy exact
22
+ links returned by `+index`, `+grep` or `+read`; go to step 3 for a relevant page
23
+ whose path is known. Do not guess filenames. Once a path is known,
24
+ do not repeat indexing or broad directory searches to rediscover it;
25
+ only read a domain, catalog or parent page when its additional
26
+ context is needed to resolve scope, applicability or an uncovered requirement.
27
+ A revision or access-context change requires revalidation, not silent reuse.
28
+
29
+ 1. **Index the candidate.** If no usable navigation is in context, call
30
+ `+index --sources` with the discovery pick.
21
31
  Use `index.md` for navigation, a fit check, and **query wording** — the real
22
32
  terms in the index (product names, API identifiers, section titles) become
23
33
  your `+grep` keywords. The root index routes at module level only; when a
@@ -30,32 +40,33 @@ candidate rather than searching everything blindly.
30
40
  **Done when:** you have the candidate's `index.md`, and a list of `wiki/...`
31
41
  links you can **copy** (0 items still counts as done).
32
42
 
33
- 2. **Grep copied paths.** Copy 1–3 `wiki/...` entries from the index (a page
43
+ 2. **Grep copied paths.** When no sufficiently specific page link is known,
44
+ copy 1–3 `wiki/...` entries from the navigation already returned (a page
34
45
  such as `wiki/sandbox.md`, or a subdirectory such as `wiki/guides`). Call
35
46
  `+grep` with the candidate `--sources` and the copied list as `--paths`. Search
36
- with the index terms. If the first grep misses, rewrite the query **once**
37
- using different index terms **only** — never paraphrase the user's wording
38
- from memory — still with this same `--paths`. If the rewrite also misses,
39
- stop grepping entirely: `+read --outline` the index page whose title or
40
- section name relates to the question and read the matching heading range
41
- from it. A third rewrite of the same idea produces no new recall.
47
+ with the terms in the returned navigation. If the first grep misses, rewrite
48
+ the query **once** using different terms from that navigation, still with
49
+ the same `--paths`. If the rewrite also misses, choose the likeliest linked
50
+ page and use step 3, or return to discovery. A third rewrite of the same
51
+ idea produces no new recall.
42
52
 
43
53
  **Done when:** you have hits, or you have rewritten once, or step 1 copied
44
- 0 paths. Copied 0 paths → skip grep and `+read --outline` the likeliest
45
- title page, or go back to discovery for the next candidate.
54
+ 0 paths. Copied 0 paths → skip grep and go back to discovery rather than
55
+ constructing a path from a title.
46
56
 
47
57
  **Reading the result — the page-level `results` view.** The response is a page-level
48
58
  `results` array: each entry is one page with its full `hitCount`, a
49
59
  `pageKind`, and up to 4 `sections` previews (each with its breadcrumb,
50
60
  `sectionStartLine`/`sectionEndLine`, and a text preview). Read the top
51
61
  relevant pages until every subquestion of the question is backed by
52
- sections you have actually read. `hitCount` tells you how dense the matches
62
+ sections you have actually read (step 4 distinguishes business analysis
63
+ from knowledge-only coverage). `hitCount` tells you how dense the matches
53
64
  are on a page; `pageKind: "catalog"` marks a module directory page — its
54
65
  previews are detail-page entries, so treat them as navigation: add the
55
66
  detail-page paths you see there to your read list instead of reading the
56
67
  catalog as an answer source. When a page has `moreSections > 0` and the
57
- answer is not in the previews, re-grep that single page to see all its
58
- hits.
68
+ answer is not in the previews, locate the missing evidence on that single
69
+ page using step 3 rather than searching its entire directory again.
59
70
 
60
71
  Each page-group section preview carries its enclosing heading-section
61
72
  boundaries:
@@ -73,6 +84,15 @@ candidate rather than searching everything blindly.
73
84
  3. **Choose the section locator.** Pick one locator for the current target
74
85
  page:
75
86
 
87
+ - **Short or unknown-length linked page:** for a focused recall card or
88
+ asset-definition page, read once with
89
+ `--offset 1 --limit 200 --expand none`; an outline is not a prerequisite.
90
+ If a response already shows a longer page or a precise relevant section,
91
+ use the section branches below instead. Check the returned coverage:
92
+ `startLine: 1`, `endLine: totalLines`, and `truncated: false` prove a
93
+ complete page. If partial, locate only the missing evidence on the same page
94
+ with scoped grep or an outline; a bounded prefix is not proof of full
95
+ coverage. Do not reuse a range from another page.
76
96
  - **Section preview of a page group:** read the section range with
77
97
  `--offset sectionStartLine` and
78
98
  `--limit sectionEndLine - sectionStartLine + 1`. For narrow
@@ -80,10 +100,10 @@ candidate rather than searching everything blindly.
80
100
  once you see the preview text. If the window turns out too small, widen
81
101
  once up to the section range. Do not crawl by shifting offsets line by
82
102
  line.
83
- - **Linked or related page:** if you follow a catalog/detail/related link to
84
- a different page, the old grep range no longer applies. If you have
85
- concrete terms for that new page, run `+grep --paths '["<new-page>"]'`
86
- scoped to that page and use the new hit range.
103
+ - **Linked or related page needing section localization:** if the direct
104
+ read branch does not apply and you have concrete terms for that new page,
105
+ run `+grep --paths '["<new-page>"]'` scoped to that page and use the new
106
+ hit range. An explicit child link needs no catalog or directory lookup.
87
107
  - **No reliable range:** if the new page has no concrete grep terms, its
88
108
  grep misses, or headings are needed to choose the right section, call
89
109
  `+read --outline` for that page. It returns only the heading tree
@@ -102,30 +122,44 @@ candidate rather than searching everything blindly.
102
122
  come from a page-group section preview's boundaries or two adjacent outline
103
123
  headings (`heading.line` of the target section to `heading.line - 1` of the
104
124
  next). If a window turns out too small, widen to the section boundary in one
105
- more call.
125
+ more call. A completed direct read in step 3 needs no additional read or
126
+ outline. Independent, already identified pages may be read in parallel;
127
+ follow only links needed for the question, not every related page.
106
128
 
107
129
  **Done when:** the needed evidence is in context without shell truncation,
108
130
  or the page response is complete and untruncated.
109
131
 
110
- **Read coverage:** read the relevant candidate pages from the page results
111
- until every subquestion of the user's question is backed by sections you
112
- have actually read — not until a page "looks like the answer". Do not stop
113
- to compose the answer while any subquestion still has no read evidence
114
- behind it, and do not pick a single page by surface similarity between the
115
- question wording and the page/module name or hit line.
132
+ **Read coverage:** for knowledge-only answers, read relevant candidate pages
133
+ until every answered subquestion is backed by sections actually read — not
134
+ until a page "looks like the answer". For business data analysis, read the
135
+ relevant definitions and boundaries, then hand off verified coverage and
136
+ remaining gaps in step 5; live values do not need KB text as their source.
137
+ Do not pick a single page by surface similarity between the question wording
138
+ and the page/module name or hit line.
116
139
 
117
140
  5. **Assess coverage, then answer or iterate.** Map the user's question into
118
141
  subquestions and check each one against the sections you actually read. If a
119
142
  subquestion is covered, answer with citations (knowledge base + page path +
120
143
  section). If a gap remains, go back to step 2 with another set of `--paths`
121
- **copied** from the index, or return to discovery for the next candidate.
122
- If the evidence is missing after the allowed search, the only acceptable
123
- output for that subquestion is "not covered by the knowledge base" — do not
124
- attach a confident value from general knowledge, not even with a disclaimer
125
- or a self-declared boundary.
144
+ **copied** from current navigation, or return to discovery for the next candidate.
145
+ For a knowledge-only question, missing evidence after the allowed search
146
+ means "not covered by the knowledge base" — do not attach a confident fact
147
+ from general knowledge, even with a disclaimer. For business data analysis,
148
+ this is a KB coverage gap, not completion of the original task. Preserve the
149
+ read KB evidence and continue through `ae-analysis` using
150
+ [`analysis-workflow.md`](analysis-workflow.md): verify suitable saved assets,
151
+ resolve only missing metadata, and execute an independently supported,
152
+ authorized query. Never attribute that live result to unread KB content.
153
+
154
+ Once relevant definitions, parameters and boundaries are covered, proceed
155
+ to the analysis handoff. Do not keep navigating to validate already verified
156
+ links or to seek live numbers in a semantic snapshot. Return to KB retrieval
157
+ only for a concrete unresolved semantic question.
126
158
 
127
159
  **Done when:** every answered subquestion is supported by read sections, or
128
- the remaining gaps are explicitly reported as missing evidence.
160
+ the remaining knowledge gaps are explicitly reported as missing evidence.
161
+ A business data request still requires the analysis handoff and its task
162
+ completion check; routing or definition-only coverage is not a live answer.
129
163
 
130
164
  ## Anti-pattern: same-page offset crawling
131
165
 
@@ -5,7 +5,7 @@
5
5
  | Command | Required flags | Purpose |
6
6
  | --- | --- | --- |
7
7
  | `+schema-download` | `--name --output` | Download original formal bytes |
8
- | `+schema-import` | `--name --file --request-id` | Upload Markdown; automatically validate |
8
+ | `+schema-import` | `--name --file --request-id` | Upload Markdown with basic checks; AI validation is explicit |
9
9
  | `+schema-import-list` | `--name` | List pending candidates; `--cursor/--limit` |
10
10
  | `+schema-import-status` | `--import-id` | Read report, revision and receipt |
11
11
  | `+schema-import-content` | `--import-id` | Read full candidate; `--target/--output` |
@@ -14,7 +14,7 @@
14
14
  | `+schema-import-validate` | `--import-id --revision --request-id --hash` | Explicit validation |
15
15
  | `+schema-import-optimize` | `--import-id --revision --request-id --hash` | One repair and independent revalidation; repeat `--issue-id` |
16
16
  | `+schema-import-reject` | `--import-id --revision --request-id` | Restore latest repair input; no recursive undo |
17
- | `+schema-import-apply` | `--import-id --revision --request-id --hash --report-id` and exactly one of `--schema-hash/--schema-absent` | Explicit formal replacement |
17
+ | `+schema-import-apply` | `--import-id --revision --request-id --hash` and exactly one of `--schema-hash/--schema-absent` | Explicit formal replacement; optional `--report-id` |
18
18
  | `+schema-import-abandon` | `--import-id --revision --request-id` | Abandon draft; high-risk write |
19
19
 
20
20
  Use `--scope personal|company` for name lookup. All subsequent operations use the returned import ID, never resolve a name again. Upload may explicitly replace one pending import with `--replaces-import-id/--replaced-revision`; otherwise it creates an additional draft.
@@ -23,7 +23,9 @@ Upload, validation, optimization and status support `--wait --timeout <seconds>`
23
23
 
24
24
  Before applying, read `+schema-import-diff --baseline current-schema`, the entire candidate and advisories. Use the returned formal hash. `KB_SCHEMA_IMPORT_BASE_CHANGED` requires reviewing a fresh diff and explicit confirmation; never refresh the hash and automatically replay apply. Revision/request conflicts preserve your file. `settlementPending/recoveryRequired` means an administrator must inspect the operation; it is not an applied success. Applying does not compile or create a published version. Existing Wiki content needs a later compilation.
25
25
 
26
- Candidates are shared between Web and CLI for the same user. Closing either client does not abandon saved work. Save makes a new human baseline only when bytes change. Failed/unavailable validation never permits apply. No automatic model retry loop exists.
26
+ Normal initialization can apply a reviewed, release-accepted preset without a new AI report. Existing valid formal rules are reused on refresh without upload, application, generation or AI validation. Legacy callers may still pass `--report-id`; it is omitted from JSON when absent. Servers with an older mandatory-report contract reject this fast path; surface that incompatibility rather than invent a report or silently generate rules.
27
+
28
+ Candidates are shared between Web and CLI for the same user. Closing either client does not abandon saved work. Save makes a new human baseline only when bytes change. Application admission follows the current server's basic checks and `canApply` response. AI validation is explicit and optional; it is recommended once when authoring a reusable preset. Keep its complete passing report and exact content hash before releasing that preset. No automatic model retry loop exists.
27
29
 
28
30
  ## Transitional transport
29
31
 
@@ -11,6 +11,8 @@ These commands require a host exposing the External KB source-mutation and previ
11
11
 
12
12
  All new commands use `kb source <action>`. Existing `+source-put`, `+source-rm` and whole-KB `+rollback` keep their original behavior.
13
13
 
14
+ For ordinary `.md`, `.markdown` and `.txt` sources, [the text workflow](text-sources.md) also supports `replace --text` or `--stdin` using the complete text API and the same required revision. `--file` continues to use the original multipart replacement contract below.
15
+
14
16
  ## Replace a file source
15
17
 
16
18
  ```bash
@@ -88,8 +90,8 @@ Keep the structured `error.code` and `hint`. `SOURCE_CONTENT_REVISION_CONFLICT`,
88
90
  ## Transitional admission
89
91
 
90
92
  - Transition status: transitional
91
- - Owning module: te-claude External Knowledge Base source mutation/version APIs
92
- - Current transport: authenticated external REST through `kbApi` / `kbUpload`, using only the standard CLI token
93
- - Gateway target: TBD; no equivalent typed source replacement/restore capability is registered in the current backend implementation
94
- - Review after: 2026-12-15
93
+ - Owning module: te-claude knowledge-base source management
94
+ - Current transport: External Knowledge Base REST API
95
+ - Gateway target: TBD
96
+ - Review after: 2026-11-12
95
97
  - Exit condition: migrate to equivalent Gateway capabilities while retaining typed file handling, revision guards, preview confirmation and stable outcomes, or remove redundant wrappers when dynamic invocation provides the same contract
@@ -0,0 +1,53 @@
1
+ # Ordinary text sources
2
+
3
+ Use these commands for ordinary `.md`, `.markdown` and `.txt` sources, including existing uploads. Text is a content filter on `sourceType=file`, not a new source type. ZIP children and URL collection output use their original commands.
4
+
5
+ ## Create
6
+
7
+ Copy the exact knowledge base name and `personal` or `company` scope from `kb +list`. Choose exactly one input:
8
+
9
+ ```bash
10
+ ae-cli kb source create-text --name "Handbook" --scope company --text "Release notes" --dry-run
11
+ ae-cli kb source create-text --name "Handbook" --scope company --title "Release notes" --file ./notes.md
12
+ cat ./notes.txt | ae-cli kb source create-text --name "Handbook" --scope company --stdin
13
+ ```
14
+
15
+ Each request creates one independent Markdown file source. `--file` reads one UTF-8 `.md`, `.markdown` or `.txt` file (case-insensitive); the server generates a title from the content unless `--title` is supplied, adds `.md`, and resolves duplicate names with a sequence number. To retain a local filename or upload other formats, use `kb +add`. The response `item` contains the final display name, stable ID, current `contentRevision` and pending compilation state.
16
+
17
+ Transport: `POST /agent/api/external/knowledge-bases/sources/text`, JSON `{name, scope, content, title?, inputMethod:"text_input"}`.
18
+
19
+ ## Read and edit the same source
20
+
21
+ ```bash
22
+ ae-cli kb +list-sources --name "Handbook" --scope company --content-type text
23
+ ae-cli kb source read-text --name "Handbook" --scope company --id <source-id>
24
+ ae-cli kb source read-text --name "Handbook" --scope company --id <source-id> --out ./original.md
25
+ ae-cli kb source replace --name "Handbook" --scope company --id <source-id> \
26
+ --source-type file --expected-revision <contentRevision> --text "Revised notes"
27
+ cat ./revised.md | ae-cli kb source replace --name "Handbook" --scope company --id <source-id> \
28
+ --source-type file --expected-revision <contentRevision> --stdin
29
+ ```
30
+
31
+ `read-text` returns complete `{item, content, contentFormat}` in the standard JSON envelope. `item.contentRevision` corresponds to these exact bytes; `contentFormat` is `markdown` or `text`. `--out` exclusively creates a new local file and returns only `{item, contentFormat, out}`. Existing files and symlinks are never overwritten. A read does not establish write permission.
32
+
33
+ Text replacement sends `PUT .../sources/<id>/text?name=...&scope=...` with `{content, expectedRevision, inputMethod:"text_input"}`. It preserves the existing source ID, name and format. The original `replace --file` path continues to send multipart data to `/raw` or prepare a ZIP preview, as described in [source mutations](source-mutations.md).
34
+
35
+ Read after saving and compare the complete bytes and revision. An unchanged save reports `outcome=unchanged` without increasing the revision; a real change reports the actual mutation result and new revision. `SOURCE_CONTENT_REVISION_CONFLICT` exits nonzero: retain local input, read current content and explicitly resolve the conflict. The CLI never obtains a new revision or retries a write automatically.
36
+
37
+ ## Encoding, limits and outcomes
38
+
39
+ - File and stdin input must be strict UTF-8. BOM, LF/CRLF/CR, mixed line endings and the presence or absence of a trailing newline are preserved. Quotes, backticks and Unicode remain business data. `--stdin` is explicit and requires a pipe; missing input never waits for interactive text.
40
+ - Empty or whitespace-only text is rejected. The limit is 50 MiB (52,428,800 UTF-8 bytes), including BOM and newlines. Exactly the limit is allowed. JSON escaping overhead is separate; valid content is never truncated.
41
+ - Creation and replacement are ordinary `write` commands without a second confirmation. A `--dry-run` validates local input and previews the request with content redacted, sends no business request, and cannot prove host permissions or a current revision.
42
+ - Text flags are sensitive. Text input, full read responses and server error details are excluded from command and HTTP diagnostics; structured errors retain the server code and safe recovery guidance. Explicit `read-text` JSON or `--out` content is the requested business result.
43
+ - An unsupported host fails explicitly; the CLI does not fall back to upload or delete/re-add. If the outcome is unknown, inspect `+list-sources` and read the source before deciding on another request; retrying creation can create another independent source.
44
+ - Saving does not compile or publish. After reviewing all changes, explicitly use `kb +compile` and inspect `kb +status`. Failed compilation preserves prior published knowledge. Deletion uses existing `+rm-source` confirmation and publication semantics.
45
+
46
+ ## Admission record
47
+
48
+ - Transition status: transitional
49
+ - Owning module: te-claude knowledge-base source management
50
+ - Current transport: External Knowledge Base REST API
51
+ - Gateway target: TBD
52
+ - Review after: 2026-11-12
53
+ - Exit condition: when equivalent text and revision capabilities enter the Gateway, migrate the typed commands to the shared transport where their file, stdin, revision and output handling adds value, while preserving released command compatibility.
@@ -72,7 +72,7 @@ A candidate returned by `+list`, navigation returned by `+index`, a successful c
72
72
 
73
73
  ## Use Knowledge Base Evidence in Analysis
74
74
 
75
- For project-scoped business data analysis, the `analysis-workflow.md` handoff above is mandatory after relevant source pages have been read. In particular, a KB statement that current values require live execution means attempting the matched saved asset first. If that attempt cannot produce a usable result, the workflow permits a traceable fallback to ordinary analysis.
75
+ For project-scoped business data analysis, the `analysis-workflow.md` handoff above is mandatory after relevant source pages have been read. Attempt an exact, semantically applicable saved asset first. If definition inspection proves it unsuitable, or execution cannot produce the requested result, continue ordinary analysis for the uncovered requirements without discarding verified KB evidence. A KB statement that current values require execution does not require running a known mismatching asset or asking the user to repeat the data request.
76
76
 
77
77
  When using internal context to explain data analysis results, anomalies, or trends:
78
78
 
@@ -16,20 +16,22 @@ AE CLI (`ae-cli`) is the command-line tool for the AE (Agentic Engine) analysis
16
16
 
17
17
  Global parameters:
18
18
 
19
- | Parameter | Description |
20
- |---|---|
21
- | `--format <json\|table>` | Output format. Default is JSON. |
22
- | `--jq <expr>` | jq filter expression for JSON output. |
23
- | `--host <url>` | Override the active AE host. Available on every command and may be placed after the subcommand, e.g. `ae-cli team +<command> --host <url>`. |
24
- | `--yes` | Skip confirmation for `high-risk-write` (delete) operations. |
25
- | `--dry-run` | Show request details without executing. |
19
+ | Parameter | Description |
20
+ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | `--format <json\|table>` | Output format. Default is JSON. |
22
+ | `--jq <expr>` | jq filter expression for JSON output. |
23
+ | `--host <url>` | Override the active AE host. Available on every command and may be placed after the subcommand, e.g. `ae-cli team +<command> --host <url>`. |
24
+ | `--yes` | Skip confirmation for `high-risk-write` (delete) operations. |
25
+ | `--dry-run` | Show request details without executing. |
26
26
 
27
27
  Output and errors:
28
+
28
29
  - Successful commands return machine-readable JSON by default. Envelope may include optional `_notice.host_compat`.
29
30
  - Failed commands return `{ "ok": false, "error": { "type": "...", "message": "...", "hint": "..." } }` and exit non-zero.
30
31
  - **CRITICAL — Host compat (do this first):** If stderr or `_notice.host_compat` has a version warning, open the user reply with ⚠️ and **quote `npm i -g` / `npx skills add` (or update-cluster) lines verbatim**, then list projects/results. Never omit when summarizing. Soft tip; `ok: true` may still include the notice.
31
32
 
32
33
  Safety constraints:
34
+
33
35
  - Read commands (`+list`, `+list-templates`, `+list-projects`, `+run-result`, `+run-artifacts`, `+ai-generate`) can execute directly once required IDs are known.
34
36
  - Ordinary `write` commands require explicit user intent but no CLI confirmation. Only `high-risk-write` commands use the confirmation gate and may receive `--yes` after explicit user authorization.
35
37
  - Never invent team IDs, run IDs, `agentId` values, `mcpServerIds`, `skillIds`, `knowledgeBaseIds`, project IDs, or any resource identifiers. Discover them with list commands or accept them from the user.
@@ -81,16 +83,16 @@ ae-cli team +run-start --help
81
83
 
82
84
  ## TeamRun Status Reference
83
85
 
84
- | Status | Description |
85
- |---|---|
86
- | `pending` | Queued, waiting to start |
87
- | `running` | Actively executing |
88
- | `waiting_user` | Paused — `+run-watch` exits with code 2; read `pendingQuestion` from stdout, present to user, then call `+run-reply` |
89
- | `waiting_approval` | Paused — waiting for approval |
90
- | `paused` | Manually paused |
91
- | `completed` | Finished successfully |
92
- | `failed` | Execution failed |
93
- | `cancelled` | Cancelled by user |
86
+ | Status | Description |
87
+ | ------------------ | -------------------------------------------------------------------------------------------------------------------- |
88
+ | `pending` | Queued, waiting to start |
89
+ | `running` | Actively executing |
90
+ | `waiting_user` | Paused — `+run-watch` exits with code 2; read `pendingQuestion` from stdout, present to user, then call `+run-reply` |
91
+ | `waiting_approval` | Paused — waiting for approval |
92
+ | `paused` | Manually paused |
93
+ | `completed` | Finished successfully |
94
+ | `failed` | Execution failed |
95
+ | `cancelled` | Cancelled by user |
94
96
 
95
97
  Terminal statuses: `completed`, `failed`, `cancelled`. Poll `+run-result` until one of these is reached.
96
98
 
@@ -163,3 +165,7 @@ ae-cli team +create --name "我的分析团队" --config '<template_config>'
163
165
  ```bash
164
166
  ae-cli team --help
165
167
  ```
168
+
169
+ ## Automation lifecycle
170
+
171
+ For Agent or team automation schedules, immediate execution, stop, retry, deletion, history and read-only results, use [ae-automation](../ae-automation/SKILL.md). Existing Agent automation aliases remain compatible.