@thinkingai/ae-cli 6.1.19 → 6.1.20
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/README.md +95 -38
- package/README.zh.md +95 -38
- package/dist/{auth-QPEVVBKT.js → auth-FUM37MHF.js} +236 -127
- package/dist/{capability-ASI62I4A.js → capability-AXFQW5WM.js} +45 -32
- package/dist/{chunk-FR2EDAQM.js → chunk-4P355ZWB.js} +69 -1
- package/dist/chunk-6ZIQV5GW.js +26 -0
- package/dist/chunk-ATSM5XAW.js +623 -0
- package/dist/{chunk-6QK7SYYY.js → chunk-BBEFP4SB.js} +29 -37
- package/dist/{chunk-KEWVSO64.js → chunk-CZU3V3DQ.js} +4 -15
- package/dist/chunk-ECBLHAZO.js +15 -0
- package/dist/{chunk-B5HMQAOM.js → chunk-I4WQAEYB.js} +1 -1
- package/dist/{chunk-QL6R6TSK.js → chunk-LNZBEQXW.js} +6 -5
- package/dist/{chunk-GJXRF7Y6.js → chunk-QJQZH5GQ.js} +47 -78
- package/dist/{chunk-S5PONFBM.js → chunk-RSG4ONOI.js} +7 -7
- package/dist/{chunk-DKEXH6Q5.js → chunk-TAL6CZH6.js} +6 -6
- package/dist/{chunk-JYMGHGCE.js → chunk-VXNMYUXU.js} +24 -13
- package/dist/{chunk-KZ6ZHF5J.js → chunk-WZ6YVQSF.js} +14 -14
- package/dist/{community-report-client-6OL6GBQW.js → community-report-client-XXWGSBSD.js} +2 -4
- package/dist/{config-XNMACCKX.js → config-EXUGQN5T.js} +8 -9
- package/dist/{data-integration-4NZGZ45E.js → data-integration-4NZ53OMT.js} +17 -15
- package/dist/index.js +52 -79
- package/dist/{local-data-upload-client-EFHDLXFG.js → local-data-upload-client-KYOKVYZV.js} +2 -4
- package/dist/{memory-HBJQ2GC5.js → memory-ATNKZNW5.js} +4 -6
- package/dist/{metadata-62EWBEIG.js → metadata-VZVC7YMH.js} +7 -9
- package/dist/{model-BHLJ2QMT.js → model-E4JMQ4V2.js} +4 -6
- package/dist/{personal-semantic-preference-JBVMAI7L.js → personal-semantic-preference-7S2SQ3UV.js} +6 -8
- package/dist/{project-semantic-BQ4MPUS5.js → project-semantic-2SZP2OPO.js} +11 -13
- package/dist/{sync-MUWPRM5I.js → sync-YV3E66IF.js} +6 -8
- package/dist/{te-agent-WQZTMEK4.js → te-agent-JB5T3PO7.js} +393 -90
- package/dist/{te-analysis-MNCG65LU.js → te-analysis-3YJAAT2D.js} +99 -33
- package/dist/{te-community-BNE6KREL.js → te-community-UDBI672N.js} +9 -32
- package/dist/{te-dataops-TXLKM2W6.js → te-dataops-ZLYOCXZ4.js} +19 -20
- package/dist/{te-engage-TPKLRVTL.js → te-engage-4XG6OJML.js} +12 -14
- package/dist/{te-experiment-6BYKTCY7.js → te-experiment-VXUWPINJ.js} +6 -8
- package/dist/{te-kb-BUD6N3NI.js → te-kb-WYQWHFSC.js} +595 -85
- package/dist/{te-system-44LZJDTQ.js → te-system-7G6F2LJA.js} +6 -8
- package/dist/{te-team-XMP47YXE.js → te-team-E7FBBXMQ.js} +6 -8
- package/dist/{update-UODFOZ4P.js → update-D47BUG25.js} +7 -8
- package/package.json +12 -9
- package/skills/ae-agent/SKILL.md +30 -13
- package/skills/ae-agent/references/agent-distribution.md +94 -0
- package/skills/ae-agent/references/approval-request.md +4 -0
- package/skills/ae-agent/references/command_index.md +9 -2
- package/skills/ae-agent/references/create-automation.md +20 -2
- package/skills/ae-agent/references/get-agent-context.md +70 -0
- package/skills/ae-agent/references/list-automations.md +18 -3
- package/skills/ae-agent/references/list-mcp-credentials.md +1 -1
- package/skills/ae-agent/references/mcp-token.md +3 -3
- package/skills/ae-agent/references/set-mcp-credential.md +0 -1
- package/skills/ae-agent/references/update-automation.md +18 -0
- package/skills/ae-analysis/SKILL.md +11 -2
- package/skills/ae-analysis/references/adhoc_run.md +2 -0
- package/skills/ae-analysis/references/ai_models.md +23 -3
- package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -2
- package/skills/ae-analysis/references/command_index.md +7 -7
- package/skills/ae-analysis/references/cross_source_config.md +84 -0
- package/skills/ae-analysis/references/dashboard_update.md +1 -1
- package/skills/ae-analysis/references/user_tag_create.md +23 -1
- package/skills/ae-analysis/references/user_tag_models.md +9 -1
- package/skills/ae-analysis/references/user_tag_update.md +14 -2
- package/skills/ae-data-integration/SKILL.md +2 -1
- package/skills/ae-data-integration/references/dimension-routing.md +36 -0
- package/skills/ae-data-integration/references/local-analysis.md +2 -0
- package/skills/ae-data-integration/references/source-inspect.md +1 -1
- package/skills/ae-data-integration/references/tracking-plan.md +1 -1
- package/skills/ae-data-integration/references/transform.md +1 -1
- package/skills/ae-data-integration/references/ue-mapping.md +5 -2
- package/skills/ae-data-integration/references/ue-routing.md +17 -1
- package/skills/ae-generate-tracking-plan/SKILL.md +25 -13
- package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +1 -1
- package/skills/ae-kb/SKILL.md +107 -36
- package/skills/ae-kb/references/query-workflow.md +59 -29
- package/skills/ae-kb/references/versions.md +46 -0
- package/skills/ae-system/SKILL.md +1 -1
- package/skills/ae-use-agent/SKILL.md +42 -0
- package/skills/ae-use-agent/references/local-agent.md +114 -0
- package/dist/auth-UMJAA72O.js +0 -15
- package/dist/chunk-533JK3YX.js +0 -72
- package/dist/chunk-O6K2ODUE.js +0 -318
- package/dist/chunk-RWXIXOZG.js +0 -326
- package/dist/client-N7NGZUNI.js +0 -204
- package/skills/ae-agent/references/auto-provision-mcp-credentials.md +0 -57
package/skills/ae-kb/SKILL.md
CHANGED
|
@@ -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, importing read-only compiled snapshots, querying, LLM-powered ask, listing accessible knowledge bases and their sources, deterministic index/grep/read retrieval, checking status,
|
|
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, ZIP source upload and directory management, raw child-file reading, revision-checked child updates and deletion, 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
|
|
@@ -35,12 +35,12 @@ ae-cli kb +<command> [options]
|
|
|
35
35
|
| `+list` | read | List accessible knowledge bases filtered by buildStatus (default: compiled). |
|
|
36
36
|
| `+list-sources` | read | List source metadata for one knowledge base so exact source identifiers can be discovered safely. |
|
|
37
37
|
| `+index` | read | List accessible knowledge bases and their `index.md` navigation maps. |
|
|
38
|
-
| `+grep` | read | Keyword-search knowledge base pages
|
|
38
|
+
| `+grep` | read | Keyword-search knowledge base pages; returns a page-level results array (hitCount / pageKind / sections previews). |
|
|
39
39
|
| `+read` | read | Read a full knowledge base page, a line window, or (with `--outline`) only the page heading tree. |
|
|
40
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
|
|
43
|
-
| `+add` | write | Upload local files, a non-recursive directory, or HTTP(S) pages converted to markdown. |
|
|
41
|
+
| `+import` | write | Import a compiled Markdown ZIP as a personal or company read-only snapshot; `--scope` defaults to `personal`. |
|
|
42
|
+
| `+import-status` | read | Query one snapshot import task by `--request-id` without polling; output includes the persisted `scope`. |
|
|
43
|
+
| `+add` | write | Upload local files (including ZIP directory sources), a non-recursive directory, or HTTP(S) pages converted to markdown. |
|
|
44
44
|
| `+url` | write | Upload a URL source directly with optional display name and parsing instruction. |
|
|
45
45
|
| `+schema` | write | Generate the compile schema for a knowledge base. |
|
|
46
46
|
| `+compile` | write | Compile a knowledge base in incremental or full mode. |
|
|
@@ -48,6 +48,67 @@ ae-cli kb +<command> [options]
|
|
|
48
48
|
| `+rm-source` | high-risk-write | Delete one source from a knowledge base by stable ID; exact display name is legacy compatibility only. |
|
|
49
49
|
| `+remove` | write | Delete an entire knowledge base. |
|
|
50
50
|
|
|
51
|
+
## Published Version History
|
|
52
|
+
|
|
53
|
+
Use the nine version commands described in [`references/versions.md`](references/versions.md) to inspect immutable published history, compare source changes, and explicitly roll back an earlier version as a new publication. These commands manage history; `+index/+grep/+read/+ask` continue to use current published content.
|
|
54
|
+
|
|
55
|
+
| Command | Risk | Purpose |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `+versions` | read | List published versions and latestVersionId. |
|
|
58
|
+
| `+version-show` | read | Show one version summary. |
|
|
59
|
+
| `+version-sources` | read | Discover historical source IDs. |
|
|
60
|
+
| `+version-diff` | read | Compare two versions. |
|
|
61
|
+
| `+version-tree` | read | List a historical ZIP/URL source directory. |
|
|
62
|
+
| `+version-read` | read | Preview a historical directory child file. |
|
|
63
|
+
| `+version-download` | read | Save one ordinary historical file source; no directory download. |
|
|
64
|
+
| `+rollback` | high-risk-write | Restore an earlier version and create a new version. |
|
|
65
|
+
| `+rollback-status` | read | Query a persisted rollback Operation without polling. |
|
|
66
|
+
|
|
67
|
+
## ZIP Directory Sources
|
|
68
|
+
|
|
69
|
+
Use `+add --files '["./sources.zip"]'` to upload one ZIP as one editable parent source, preserving its internal hierarchy. Archive validation and limits are enforced by the server. This is different from `+import`, which creates a read-only compiled snapshot. Passing a local directory to `+add` still uploads only its immediate supported files; it does not recursively package that directory.
|
|
70
|
+
|
|
71
|
+
Discover the exact parent ID with `+list-sources`. ZIP rows include `fileCount`, `sizeBytes`, `contentRevision`, and `updateStatus`.
|
|
72
|
+
|
|
73
|
+
| Command | Risk | Purpose |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| `+source-ls` | read | List one directory page with revision, current children and deleted paths relative to the successful baseline. |
|
|
76
|
+
| `+source-read` | read | Read a child source file as UTF-8/base64, or save original bytes. |
|
|
77
|
+
| `+source-put` | write | Add one local file or explicitly replace the exact ZIP-relative path. |
|
|
78
|
+
| `+source-rm` | high-risk-write | Delete one child file or recursively delete a child directory. |
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
ae-cli kb +source-ls --name handbook --id <source-id> --path "" --limit 100
|
|
82
|
+
ae-cli kb +source-ls --name handbook --id <source-id> --path "guides" --cursor <nextCursor>
|
|
83
|
+
ae-cli kb +source-read --name handbook --id <source-id> --path "guides/intro.md"
|
|
84
|
+
ae-cli kb +source-read --name handbook --id <source-id> --path "images/chart.png" --output ./chart.png
|
|
85
|
+
ae-cli kb +source-read --name handbook --id <source-id> --path "images/chart.png" --encoding base64
|
|
86
|
+
ae-cli kb +source-put --name handbook --id <source-id> --path "guides/new.md" --file ./new.md --action add --expected-revision 7 --dry-run
|
|
87
|
+
ae-cli kb +source-put --name handbook --id <source-id> --path "guides/new.md" --file ./new.md --action add --expected-revision 7
|
|
88
|
+
ae-cli kb +source-put --name handbook --id <source-id> --path "guides/new.md" --file ./revised.md --action replace --expected-revision 8
|
|
89
|
+
ae-cli kb +source-rm --name handbook --id <source-id> --path "guides/new.md" --expected-revision 9
|
|
90
|
+
ae-cli kb +source-rm --name handbook --id <source-id> --path "guides/obsolete" --recursive --expected-revision 10
|
|
91
|
+
ae-cli kb +compile --name handbook --mode incremental
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- Copy the source ID, paths and revision from current discovery. Names resolve personal then company, following the existing External API; no scope override is available on these commands.
|
|
95
|
+
- `--path` is relative to the ZIP root, not a local filesystem or `raw/zip/...` path. Root listing uses an empty path. Nonempty paths cannot be absolute or contain empty, dot, parent or backslash segments.
|
|
96
|
+
- Listing returns one page; continue using `nextCursor` and the same path. On a revision change, restart discovery before writing.
|
|
97
|
+
- `+source-read` reads source bytes; `+read` reads compiled Wiki pages. Default UTF-8 output fails on invalid UTF-8. Base64 preserves binary data. `--output` creates a new local file and refuses to overwrite an existing file.
|
|
98
|
+
- `+source-put` accepts one file up to 50 MB. Default `--action add` rejects an existing path; `--action replace` explicitly authorizes overwriting an existing child. There is no silent upsert. Dry-run shows metadata and redacts file content.
|
|
99
|
+
- `--expected-revision` is mandatory for writes. A 409 conflict is returned with its server error code; the command never refreshes and retries the write automatically.
|
|
100
|
+
- `+source-rm` keeps the parent source. Nonempty directory removal requires `--recursive`; deletion follows the CLI confirmation gate. Use `--yes` only when automated deletion of the exact target is already authorized. `+rm-source --id` deletes the entire parent.
|
|
101
|
+
- A mutation marks the parent changed but does not start compilation or regenerate Schema. Run incremental compilation explicitly; wait for successful publication before the next test stage.
|
|
102
|
+
- `+status` is the existing aggregate status query; it is not a per-run event or ZIP Diff reader. Do not interpret its compilation submission response as successful publication.
|
|
103
|
+
- No Gateway equivalent is registered in the current KB implementation. These commands reuse the typed External source APIs.
|
|
104
|
+
|
|
105
|
+
Transition status: transitional
|
|
106
|
+
Owning module: te-claude External Knowledge Base Sources API
|
|
107
|
+
Current transport: authenticated External REST via `kbApi` and multipart `kbUpload`.
|
|
108
|
+
Gateway target: TBD (ZIP source directory and raw-file capabilities)
|
|
109
|
+
Review after: 2026-12-06
|
|
110
|
+
Exit condition: migrate when equivalent typed Gateway file, directory and revision-aware mutation capabilities exist; retain CLI file handling and explicit mutation semantics.
|
|
111
|
+
|
|
51
112
|
## Common Workflows
|
|
52
113
|
|
|
53
114
|
### Create a Knowledge Base
|
|
@@ -107,6 +168,7 @@ Use `+add` when sources are local files, local directories, or pages that should
|
|
|
107
168
|
```bash
|
|
108
169
|
ae-cli kb +add \
|
|
109
170
|
--name engineering-handbook \
|
|
171
|
+
--scope company \
|
|
110
172
|
--files '["./README.md","./docs","https://example.com/guide"]'
|
|
111
173
|
```
|
|
112
174
|
|
|
@@ -125,6 +187,7 @@ Use `+url` when adding one URL source and optionally passing a display name or p
|
|
|
125
187
|
```bash
|
|
126
188
|
ae-cli kb +url \
|
|
127
189
|
--name engineering-handbook \
|
|
190
|
+
--scope company \
|
|
128
191
|
--url https://example.com/guide \
|
|
129
192
|
--display-name guide \
|
|
130
193
|
--parse-instruction "Keep headings and code blocks"
|
|
@@ -137,16 +200,20 @@ ae-cli kb +url \
|
|
|
137
200
|
Generate the schema first when the knowledge base needs a compile schema.
|
|
138
201
|
|
|
139
202
|
```bash
|
|
140
|
-
ae-cli kb +schema --name engineering-handbook
|
|
203
|
+
ae-cli kb +schema --name engineering-handbook --scope company
|
|
141
204
|
```
|
|
142
205
|
|
|
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.
|
|
206
|
+
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.
|
|
207
|
+
|
|
208
|
+
Schema and Compile accept the same optional model reference. Prefer the model record `id` returned by `ae-cli agent +list-models` (`Model.id`). Historical `modelId` and the unambiguous `modelId::scope` form remain compatible. A model `displayName` is presentation text, not a stable reference.
|
|
144
209
|
|
|
145
210
|
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
211
|
|
|
147
212
|
```bash
|
|
148
213
|
ae-cli kb +schema \
|
|
149
214
|
--name engineering-handbook \
|
|
215
|
+
--scope company \
|
|
216
|
+
--model <model-ref> \
|
|
150
217
|
--custom-instructions "Prioritize troubleshooting workflows and preserve command examples"
|
|
151
218
|
```
|
|
152
219
|
|
|
@@ -155,7 +222,7 @@ Use `--dry-run` to inspect the request body before sending it. While generation
|
|
|
155
222
|
Compile after sources and schema are ready:
|
|
156
223
|
|
|
157
224
|
```bash
|
|
158
|
-
ae-cli kb +compile --name engineering-handbook --mode incremental
|
|
225
|
+
ae-cli kb +compile --name engineering-handbook --scope company --mode incremental --model <model-ref>
|
|
159
226
|
```
|
|
160
227
|
|
|
161
228
|
Valid compile modes are `incremental` and `full`; default is `incremental`.
|
|
@@ -165,14 +232,14 @@ Valid compile modes are `incremental` and `full`; default is `incremental`.
|
|
|
165
232
|
Use `+status` to inspect the current status of a knowledge base.
|
|
166
233
|
|
|
167
234
|
```bash
|
|
168
|
-
ae-cli kb +status --name engineering-handbook
|
|
235
|
+
ae-cli kb +status --name engineering-handbook --scope company
|
|
169
236
|
```
|
|
170
237
|
|
|
171
238
|
### Ask Knowledge (LLM)
|
|
172
239
|
|
|
173
240
|
Use `+ask` when the question requires synthesizing across multiple pages or multi-hop reasoning — a server-side agent runs the full retrieval loop and returns a synthesized answer with its source paths. Prefer `+index` -> `+grep` -> `+read` when deterministic retrieval is enough.
|
|
174
241
|
|
|
175
|
-
The `+ask` command uses asynchronous submit/poll: by default, it automatically polls for completion (every 5s, up to 10 minutes) and prints the final answer
|
|
242
|
+
The `+ask` command uses asynchronous submit/poll: by default, it automatically polls for completion (every 5s, up to 10 minutes) and prints the final answer with its execution ID, sources, model usage, tool call count, and model ID.
|
|
176
243
|
|
|
177
244
|
```bash
|
|
178
245
|
# Default: submit and poll for completion
|
|
@@ -180,7 +247,6 @@ ae-cli kb +ask \
|
|
|
180
247
|
--question "How do we troubleshoot payment alerts?" \
|
|
181
248
|
--sources '[{"scope":"company","name":"engineering-handbook"}]' \
|
|
182
249
|
--model-id claude-sonnet-4-6 \
|
|
183
|
-
--max-turns 50 \
|
|
184
250
|
--locale zh
|
|
185
251
|
|
|
186
252
|
# Submit only, return executionId immediately (for batch processing)
|
|
@@ -193,10 +259,9 @@ ae-cli kb +ask-status --execution-id <id>
|
|
|
193
259
|
- `--question`, alias `-q`: required natural-language question (1-2000 characters).
|
|
194
260
|
- `--sources`: optional JSON array of knowledge base refs. Omit to search all accessible knowledge bases.
|
|
195
261
|
- `--model-id`: optional LLM model ID. Omit to use the platform default.
|
|
196
|
-
- `--max-turns`: optional agent turn limit (1-100, server default 50).
|
|
197
262
|
- `--locale`: optional locale: `zh`, `en`, `ja`, or `ko`.
|
|
198
263
|
- `--no-wait`: optional boolean flag. Return immediately after submission with `{executionId, status}`, without polling.
|
|
199
|
-
- **Failure handling**: If execution fails, the command exits non-zero and prints
|
|
264
|
+
- **Failure handling**: If execution fails, the command exits non-zero and prints the unified JSON error envelope on stderr: `{"ok":false,"error":{"type":"api","code":"<server-code>","message":"..."}}`. Stable server codes are `model_unavailable`, `sandbox_unavailable`, `agent_skill_unavailable`, `dispatch_auth_unavailable`, `provider_failed`, `retrieval_error`, `timeout`, and `process_restart`.
|
|
200
265
|
|
|
201
266
|
### List Accessible Knowledge Bases
|
|
202
267
|
|
|
@@ -225,7 +290,7 @@ ae-cli kb +index \
|
|
|
225
290
|
--sources '[{"scope":"company","name":"engineering-handbook"}]'
|
|
226
291
|
```
|
|
227
292
|
|
|
228
|
-
Then use `+grep` to locate likely pages
|
|
293
|
+
Then use `+grep` to locate likely pages:
|
|
229
294
|
|
|
230
295
|
```bash
|
|
231
296
|
ae-cli kb +grep \
|
|
@@ -235,7 +300,7 @@ ae-cli kb +grep \
|
|
|
235
300
|
--top-k 10
|
|
236
301
|
```
|
|
237
302
|
|
|
238
|
-
|
|
303
|
+
The response is a page-level `results` array: each entry is one page with its full `hitCount`, a `pageKind` (`content` or `catalog`), up to 4 `sections` previews (breadcrumb, `sectionStartLine`/`sectionEndLine`, text preview), and `moreSections`. Use `hitCount` and the previews to decide which pages to read; `pageKind: "catalog"` marks a module directory page — treat its entries as detail-page navigation, not as an answer source. Read the section range with `--offset sectionStartLine` / `--limit sectionEndLine - sectionStartLine + 1`; when `moreSections > 0` and the answer is not in the previews, re-grep that single page to see all its hits.
|
|
239
304
|
|
|
240
305
|
Use `+read --outline` when the current target page has no reliable grep range and headings are needed to choose a section:
|
|
241
306
|
|
|
@@ -246,14 +311,15 @@ ae-cli kb +read \
|
|
|
246
311
|
--outline
|
|
247
312
|
```
|
|
248
313
|
|
|
249
|
-
Then use `+read` to open the selected window, using
|
|
314
|
+
Then use `+read` to open the selected window, using a page-group section boundary or two adjacent outline headings:
|
|
250
315
|
|
|
251
316
|
```bash
|
|
252
317
|
ae-cli kb +read \
|
|
253
318
|
--source '{"scope":"company","name":"engineering-handbook"}' \
|
|
254
319
|
--path "wiki/sandbox.md" \
|
|
255
320
|
--offset 42 \
|
|
256
|
-
--limit 60
|
|
321
|
+
--limit 60 \
|
|
322
|
+
--expand block
|
|
257
323
|
```
|
|
258
324
|
|
|
259
325
|
### List Sources
|
|
@@ -261,7 +327,7 @@ ae-cli kb +read \
|
|
|
261
327
|
List sources first to discover the stable identifier for the intended source:
|
|
262
328
|
|
|
263
329
|
```bash
|
|
264
|
-
ae-cli kb +list-sources --name engineering-handbook
|
|
330
|
+
ae-cli kb +list-sources --name engineering-handbook --scope company
|
|
265
331
|
```
|
|
266
332
|
|
|
267
333
|
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.
|
|
@@ -280,6 +346,7 @@ Use `+rm-source --id` with the exact ID returned by the current `+list-sources`
|
|
|
280
346
|
```bash
|
|
281
347
|
ae-cli kb +rm-source \
|
|
282
348
|
--name engineering-handbook \
|
|
349
|
+
--scope company \
|
|
283
350
|
--id cm-source-id
|
|
284
351
|
```
|
|
285
352
|
|
|
@@ -298,7 +365,7 @@ If the user only gives a loose source name, do not guess a source ID. Run `+list
|
|
|
298
365
|
Use `+remove` for deleting the entire knowledge base. Confirm the target name with the user if there is any ambiguity.
|
|
299
366
|
|
|
300
367
|
```bash
|
|
301
|
-
ae-cli kb +remove --name engineering-handbook
|
|
368
|
+
ae-cli kb +remove --name engineering-handbook --scope company
|
|
302
369
|
```
|
|
303
370
|
|
|
304
371
|
## Command Reference
|
|
@@ -306,17 +373,16 @@ ae-cli kb +remove --name engineering-handbook
|
|
|
306
373
|
### `+ask`
|
|
307
374
|
|
|
308
375
|
```bash
|
|
309
|
-
ae-cli kb +ask --question "<question>" [--sources '[{"scope":"company","name":"kb-name"}]'] [--model-id claude-sonnet-4-6] [--
|
|
376
|
+
ae-cli kb +ask --question "<question>" [--sources '[{"scope":"company","name":"kb-name"}]'] [--model-id claude-sonnet-4-6] [--locale zh|en|ja|ko] [--no-wait]
|
|
310
377
|
```
|
|
311
378
|
|
|
312
379
|
- `--question`, alias `-q`: required natural-language question (1-2000 characters).
|
|
313
380
|
- `--sources`: optional JSON array of knowledge base refs. Omit to search all accessible knowledge bases.
|
|
314
381
|
- `--model-id`: optional LLM model ID. Omit to use the platform default.
|
|
315
|
-
- `--max-turns`: optional agent turn limit (1-100, server default 50).
|
|
316
382
|
- `--locale`: optional locale: `zh`, `en`, `ja`, or `ko`.
|
|
317
383
|
- `--no-wait`: optional. Return immediately with `{executionId, status}` instead of polling.
|
|
318
384
|
- When to use: multi-page synthesis or multi-hop questions. For simple factual lookups, prefer `+index` / `+grep` / `+read`.
|
|
319
|
-
- Output: By default, polls and returns `{executionId, answer, sources, modelUsage, toolCallCount,
|
|
385
|
+
- Output: By default, polls and returns `{executionId, answer, sources, modelUsage, toolCallCount, modelId}`. With `--no-wait`, returns `{executionId, status}` immediately. On failure, exits non-zero with the unified stderr envelope containing `error.type="api"`, the server `error.code` (`model_unavailable`, `sandbox_unavailable`, `agent_skill_unavailable`, `dispatch_auth_unavailable`, `provider_failed`, `retrieval_error`, `timeout`, or `process_restart`), and `error.message`.
|
|
320
386
|
|
|
321
387
|
### `+ask-status`
|
|
322
388
|
|
|
@@ -325,7 +391,7 @@ ae-cli kb +ask-status --execution-id <id>
|
|
|
325
391
|
```
|
|
326
392
|
|
|
327
393
|
- `--execution-id`: required. The execution ID returned by `+ask` submission.
|
|
328
|
-
- Output: Returns
|
|
394
|
+
- Output: Returns one successful CLI envelope snapshot. For a failed execution, the stable server code remains at `data.error.code`: `{"ok":true,"data":{"executionId":"...","status":"failed","error":{"code":"retrieval_error","message":"..."}}}`. Does not poll.
|
|
329
395
|
|
|
330
396
|
### `+list`
|
|
331
397
|
|
|
@@ -357,18 +423,19 @@ ae-cli kb +grep --query "<keywords>" --sources '[{"scope":"company","name":"kb-n
|
|
|
357
423
|
- `--paths`: required JSON array of wiki pages or subdirectories **copied** from `+index`. A single page is still an array, e.g. `["wiki/sandbox.md"]`. Distinct from `+read --path` (one string).
|
|
358
424
|
- `--top-k`: optional max number of hits, 1-50, default 10.
|
|
359
425
|
- `--locale`: optional locale: `zh`, `en`, `ja`, or `ko`.
|
|
360
|
-
- Each
|
|
426
|
+
- Each page entry in results carries `hitCount` (full match count), `pageKind`, and `sections` previews with `sectionStartLine` / `sectionEndLine` — use the section range as the `+read` window.
|
|
361
427
|
|
|
362
428
|
### `+read`
|
|
363
429
|
|
|
364
430
|
```bash
|
|
365
|
-
ae-cli kb +read --source '{"scope":"company","name":"kb-name"}' --path "index.md" [--offset 1] [--limit 200] [--outline] [--locale zh|en|ja|ko]
|
|
431
|
+
ae-cli kb +read --source '{"scope":"company","name":"kb-name"}' --path "index.md" [--offset 1] [--limit 200] [--expand block|none] [--outline] [--locale zh|en|ja|ko]
|
|
366
432
|
```
|
|
367
433
|
|
|
368
434
|
- `--source`: required JSON object pointing to exactly one knowledge base.
|
|
369
435
|
- `--path`: required page path relative to the knowledge base root, such as `index.md` or `wiki/concepts/data-model.md`.
|
|
370
|
-
- `--offset`: optional 1-based start line.
|
|
371
|
-
- `--limit`: optional max line count, 1-
|
|
436
|
+
- `--offset`: optional 1-based integer start line.
|
|
437
|
+
- `--limit`: optional max line count, 1-2000.
|
|
438
|
+
- `--expand`: optional Markdown block expansion mode. `block` lets the server include a complete Markdown block outside the requested line window; `none` keeps the exact offset/limit window. Omit it to use the server default, `block`.
|
|
372
439
|
- `--outline`: optional. Return only the whole-page heading tree (`{level, heading, line}`) with empty content, independent of `--offset` / `--limit`. Use it on long pages to choose which section to read.
|
|
373
440
|
- `--locale`: optional locale: `zh`, `en`, `ja`, or `ko`.
|
|
374
441
|
|
|
@@ -381,7 +448,7 @@ ae-cli kb +new --name "<name>" [--scope personal|company] [--description "..."]
|
|
|
381
448
|
### `+add`
|
|
382
449
|
|
|
383
450
|
```bash
|
|
384
|
-
ae-cli kb +add --name "<name>" --files '["./a.md","./docs","https://example.com/page"]'
|
|
451
|
+
ae-cli kb +add --name "<name>" --files '["./a.md","./docs","https://example.com/page"]' [--scope personal|company]
|
|
385
452
|
```
|
|
386
453
|
|
|
387
454
|
### `+import`
|
|
@@ -411,46 +478,50 @@ ae-cli kb +import-status --request-id <requestId>
|
|
|
411
478
|
### `+url`
|
|
412
479
|
|
|
413
480
|
```bash
|
|
414
|
-
ae-cli kb +url --name "<name>" --url "https://example.com/page" [--display-name "..."] [--parse-instruction "..."]
|
|
481
|
+
ae-cli kb +url --name "<name>" --url "https://example.com/page" [--scope personal|company] [--display-name "..."] [--parse-instruction "..."]
|
|
415
482
|
```
|
|
416
483
|
|
|
417
484
|
### `+schema`
|
|
418
485
|
|
|
419
486
|
```bash
|
|
420
|
-
ae-cli kb +schema --name "<name>" [--force] [--model
|
|
487
|
+
ae-cli kb +schema --name "<name>" [--scope personal|company] [--force] [--model <model-ref>] [--custom-instructions "<one-time guidance>"]
|
|
421
488
|
```
|
|
422
489
|
|
|
423
490
|
- `--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
491
|
- `--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
492
|
- `--dry-run`: Shows the same `customInstructions` request field that execution will send.
|
|
493
|
+
- `--model`: Optional stable model reference. Prefer `Model.id` from `ae-cli agent +list-models`; historical `modelId` and `modelId::scope` remain compatible.
|
|
494
|
+
- `--scope`: Optional exact knowledge-base scope. Omit it to retain the legacy personal-to-company lookup order.
|
|
426
495
|
- 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
496
|
|
|
428
497
|
### `+compile`
|
|
429
498
|
|
|
430
499
|
```bash
|
|
431
|
-
ae-cli kb +compile --name "<name>" [--mode incremental|full]
|
|
500
|
+
ae-cli kb +compile --name "<name>" [--scope personal|company] [--mode incremental|full] [--model <model-ref>]
|
|
432
501
|
```
|
|
433
502
|
|
|
434
503
|
### `+status`
|
|
435
504
|
|
|
436
505
|
```bash
|
|
437
|
-
ae-cli kb +status --name "<name>"
|
|
506
|
+
ae-cli kb +status --name "<name>" [--scope personal|company]
|
|
438
507
|
```
|
|
439
508
|
|
|
440
509
|
### `+list-sources`
|
|
441
510
|
|
|
442
511
|
```bash
|
|
443
|
-
ae-cli kb +list-sources --name "<name>"
|
|
512
|
+
ae-cli kb +list-sources --name "<name>" [--scope personal|company]
|
|
444
513
|
```
|
|
445
514
|
|
|
446
515
|
- `--name`: required knowledge base name.
|
|
447
|
-
- Output:
|
|
516
|
+
- Output: `items` contains effective sources with stable `id`. `pendingDeletions` contains soft-deleted sources still included in the current successful version. `deletionMaintenance` is separate and may report already-published deletions awaiting cleanup. Paths, hashes, credentials, and source content are not returned.
|
|
517
|
+
- Check `deletionProjection.state` and its `baseline` before interpreting deletion lists. `ready` with `pendingDeletions: []` means no pending deletion at that baseline. `changing`, `review_required`, or `unavailable` with `pendingDeletions: null` means undetermined; display the `reasonCode`, never turn null into an empty list. Legacy libraries without a verifiable complete publication manifest return unavailable until a real version is published.
|
|
518
|
+
- A rollback creates a new current version. An older deletion receipt cannot override membership in that version. A later source deletion needs publication again.
|
|
448
519
|
- Copy the exact `id` from the current response before deleting a source; never guess it.
|
|
449
520
|
|
|
450
521
|
### `+rm-source`
|
|
451
522
|
|
|
452
523
|
```bash
|
|
453
|
-
ae-cli kb +rm-source --name "<name>" --id "<source-id>"
|
|
524
|
+
ae-cli kb +rm-source --name "<name>" --id "<source-id>" [--scope personal|company]
|
|
454
525
|
```
|
|
455
526
|
|
|
456
527
|
- `--id`: preferred stable source identifier copied from `+list-sources`.
|
|
@@ -460,5 +531,5 @@ ae-cli kb +rm-source --name "<name>" --id "<source-id>"
|
|
|
460
531
|
### `+remove`
|
|
461
532
|
|
|
462
533
|
```bash
|
|
463
|
-
ae-cli kb +remove --name "<name>"
|
|
534
|
+
ae-cli kb +remove --name "<name>" [--scope personal|company]
|
|
464
535
|
```
|
|
@@ -20,7 +20,12 @@ candidate rather than searching everything blindly.
|
|
|
20
20
|
1. **Index the candidate.** Call `+index --sources` with the discovery pick.
|
|
21
21
|
Use `index.md` for navigation, a fit check, and **query wording** — the real
|
|
22
22
|
terms in the index (product names, API identifiers, section titles) become
|
|
23
|
-
your `+grep` keywords.
|
|
23
|
+
your `+grep` keywords. The root index routes at module level only; when a
|
|
24
|
+
module is too coarse for your question (it has many detail pages), read that
|
|
25
|
+
module's catalog page (`wiki/modules/<module>/catalog.md`) — it groups
|
|
26
|
+
detail pages by topic with one-line summaries. **Copy** detail-page paths
|
|
27
|
+
from the catalog as additional `--paths` candidates; the catalog itself is
|
|
28
|
+
navigation, not an answer source.
|
|
24
29
|
|
|
25
30
|
**Done when:** you have the candidate's `index.md`, and a list of `wiki/...`
|
|
26
31
|
links you can **copy** (0 items still counts as done).
|
|
@@ -29,36 +34,52 @@ candidate rather than searching everything blindly.
|
|
|
29
34
|
such as `wiki/sandbox.md`, or a subdirectory such as `wiki/guides`). Call
|
|
30
35
|
`+grep` with the candidate `--sources` and the copied list as `--paths`. Search
|
|
31
36
|
with the index terms. If the first grep misses, rewrite the query **once**
|
|
32
|
-
using different index terms —
|
|
33
|
-
|
|
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.
|
|
34
42
|
|
|
35
43
|
**Done when:** you have hits, or you have rewritten once, or step 1 copied
|
|
36
44
|
0 paths. Copied 0 paths → skip grep and `+read --outline` the likeliest
|
|
37
45
|
title page, or go back to discovery for the next candidate.
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
**Reading the result — the page-level `results` view.** The response is a page-level
|
|
48
|
+
`results` array: each entry is one page with its full `hitCount`, a
|
|
49
|
+
`pageKind`, and up to 4 `sections` previews (each with its breadcrumb,
|
|
50
|
+
`sectionStartLine`/`sectionEndLine`, and a text preview). Read the top
|
|
51
|
+
relevant pages until every subquestion of the question is backed by
|
|
52
|
+
sections you have actually read. `hitCount` tells you how dense the matches
|
|
53
|
+
are on a page; `pageKind: "catalog"` marks a module directory page — its
|
|
54
|
+
previews are detail-page entries, so treat them as navigation: add the
|
|
55
|
+
detail-page paths you see there to your read list instead of reading the
|
|
56
|
+
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.
|
|
59
|
+
|
|
60
|
+
Each page-group section preview carries its enclosing heading-section
|
|
61
|
+
boundaries:
|
|
62
|
+
|
|
63
|
+
- `sectionStartLine` / `sectionEndLine` are the section boundaries. Use
|
|
64
|
+
them as the read window (or as the maximum boundary when choosing a
|
|
65
|
+
smaller window under them).
|
|
46
66
|
- `+read --offset` / `--limit` are the actual read window. Choose the
|
|
47
67
|
smallest reliable window that preserves the needed evidence; do not
|
|
48
68
|
shell-truncate with `| head`.
|
|
69
|
+
- `+read --expand block` may include the rest of a Markdown block just
|
|
70
|
+
outside the requested window. Use `+read --expand none` when the line
|
|
71
|
+
window must be exact. Omit the flag to keep the server default, `block`.
|
|
49
72
|
|
|
50
73
|
3. **Choose the section locator.** Pick one locator for the current target
|
|
51
74
|
page:
|
|
52
75
|
|
|
53
|
-
- **
|
|
54
|
-
fact/table/code evidence, read a bounded window anchored at `line`; stay
|
|
55
|
-
within `sectionStartLine`–`sectionEndLine`. For section-level meaning,
|
|
56
|
-
field definitions, caveats, or rows that depend on the heading context,
|
|
57
|
-
read the section range with
|
|
76
|
+
- **Section preview of a page group:** read the section range with
|
|
58
77
|
`--offset sectionStartLine` and
|
|
59
|
-
`--limit sectionEndLine - sectionStartLine + 1`.
|
|
60
|
-
|
|
61
|
-
|
|
78
|
+
`--limit sectionEndLine - sectionStartLine + 1`. For narrow
|
|
79
|
+
fact/table/code evidence, narrow the window under the section boundary
|
|
80
|
+
once you see the preview text. If the window turns out too small, widen
|
|
81
|
+
once up to the section range. Do not crawl by shifting offsets line by
|
|
82
|
+
line.
|
|
62
83
|
- **Linked or related page:** if you follow a catalog/detail/related link to
|
|
63
84
|
a different page, the old grep range no longer applies. If you have
|
|
64
85
|
concrete terms for that new page, run `+grep --paths '["<new-page>"]'`
|
|
@@ -78,32 +99,41 @@ candidate rather than searching everything blindly.
|
|
|
78
99
|
page response.
|
|
79
100
|
|
|
80
101
|
4. **Read the selected window.** Read the selected window in one call. Windows
|
|
81
|
-
come from
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
come from a page-group section preview's boundaries or two adjacent outline
|
|
103
|
+
headings (`heading.line` of the target section to `heading.line - 1` of the
|
|
104
|
+
next). If a window turns out too small, widen to the section boundary in one
|
|
105
|
+
more call.
|
|
85
106
|
|
|
86
107
|
**Done when:** the needed evidence is in context without shell truncation,
|
|
87
108
|
or the page response is complete and untruncated.
|
|
88
109
|
|
|
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.
|
|
116
|
+
|
|
89
117
|
5. **Assess coverage, then answer or iterate.** Map the user's question into
|
|
90
118
|
subquestions and check each one against the sections you actually read. If a
|
|
91
119
|
subquestion is covered, answer with citations (knowledge base + page path +
|
|
92
120
|
section). If a gap remains, go back to step 2 with another set of `--paths`
|
|
93
121
|
**copied** from the index, or return to discovery for the next candidate.
|
|
94
|
-
If the evidence is missing after the allowed search,
|
|
95
|
-
not covered
|
|
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.
|
|
96
126
|
|
|
97
127
|
**Done when:** every answered subquestion is supported by read sections, or
|
|
98
128
|
the remaining gaps are explicitly reported as missing evidence.
|
|
99
129
|
|
|
100
130
|
## Anti-pattern: same-page offset crawling
|
|
101
131
|
|
|
102
|
-
The failure this workflow prevents:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
The failure this workflow prevents: reading a tiny window, finding it cut
|
|
133
|
+
mid-evidence, and nudging the window one line at a time. That wastes calls and
|
|
134
|
+
never shows page structure. Instead: read the page-group section range, widen
|
|
135
|
+
once up to the section boundary, or open `--outline` and read the selected
|
|
136
|
+
heading range.
|
|
107
137
|
|
|
108
138
|
## Related
|
|
109
139
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Published knowledge-base versions
|
|
2
|
+
|
|
3
|
+
Versions are immutable successful publications. No historical version is created until the first successful compile. Failed or cancelled compiles do not consume a version number. Existing `+compile`, `+status` and `+list-sources` responses pass through server version labels and draft state; `+index`, `+grep`, `+read` and `+ask` always address current content.
|
|
4
|
+
|
|
5
|
+
When `+status` returns `wiki_review_required`, inspect `publicationReview.code`, report that administrator review is required, and stop ordinary compile polling. The active Run and write lock remain in place; do not cancel or force another compile. This also covers an interrupted publication after server restart.
|
|
6
|
+
|
|
7
|
+
Discover exact names/scopes via `kb +list`, then inspect history:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ae-cli kb +versions --name handbook --scope company --limit 100
|
|
11
|
+
ae-cli kb +version-show --name handbook --scope company --version 2
|
|
12
|
+
ae-cli kb +version-sources --name handbook --scope company --version 2 --source-type zip
|
|
13
|
+
ae-cli kb +version-diff --name handbook --scope company --from 1 --to 2
|
|
14
|
+
ae-cli kb +version-tree --name handbook --scope company --version 2 --id <historical-source-id>
|
|
15
|
+
ae-cli kb +version-read --name handbook --scope company --version 2 --id <historical-source-id> --path guides/start.md
|
|
16
|
+
ae-cli kb +version-download --name handbook --scope company --version 2 --id <historical-file-source-id> --output ./manual.pdf
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- `--version`, `--from` and `--to` use integer version numbers, without a `v` prefix. `+version-sources` IDs come from that historical snapshot; never substitute current source metadata.
|
|
20
|
+
- `+versions`, `+version-sources` and `+version-tree` return one page. Use `--cursor` with the returned `nextCursor`, retaining the same target and filters. `--limit` is 1–200.
|
|
21
|
+
- `--scope personal|company` is exact. Omitting it keeps the existing personal-then-company lookup. A missing target in an explicit scope never falls back.
|
|
22
|
+
- `+version-tree/+version-read` accept ZIP or URL parent sources. Paths are source-relative and cannot contain absolute, parent or backslash segments. Text preview is bounded; supported PDF/images use a typed data URL. Unsupported or oversized files return metadata and `previewable: false`.
|
|
23
|
+
- `+version-download` accepts ordinary file sources only and creates a new local file with exclusive creation. It never overwrites an existing file. Directory sources return `KB_VERSION_DIRECTORY_DOWNLOAD_UNSUPPORTED`; the CLI does not reconstruct ZIPs or export an entire version.
|
|
24
|
+
|
|
25
|
+
## Rollback
|
|
26
|
+
|
|
27
|
+
Copy `latestVersionId` and an earlier target version from `+versions`. Explicitly explain the effects before requesting rollback: target-source edits and deletion intents are replaced; target-external sources with a previous successful publication are soft-deleted; target-external unpublished additions and their files remain unchanged.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
ae-cli kb +rollback --name handbook --scope company --version 1 --expected-latest-version-id <latestVersionId> --request-id <stable-request-id> --dry-run
|
|
31
|
+
ae-cli kb +rollback --name handbook --scope company --version 1 --expected-latest-version-id <latestVersionId> --request-id <stable-request-id>
|
|
32
|
+
ae-cli kb +rollback-status --name handbook --scope company --operation-id <operationId>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`+rollback` is `high-risk-write`; use `--yes` only for an already authorized exact operation. A target must be strictly older than the current version. Success creates a new version (for example v3 → v1 produces v4), retaining all previous snapshots.
|
|
36
|
+
|
|
37
|
+
The caller must supply a stable ASCII `request-id` containing letters, digits, underscores or hyphens (1–191 characters). Reuse that exact ID, target and expected latest ID after a network interruption. The CLI does not generate another request ID, pick a different target, or retry a 409 automatically. A changed request under the same ID returns `KB_VERSION_OPERATION_REQUEST_CONFLICT`.
|
|
38
|
+
|
|
39
|
+
`queued/running` means accepted but not completed. Query `+rollback-status` using the returned `operationId`; only `status: success` with `resultVersionId` proves publication. `failed` is a terminal result; a later intentional attempt needs a new request ID. When `running` includes `KB_PUBLICATION_COMMIT_UNKNOWN`, `KB_PUBLICATION_ROLLBACK_INCOMPLETE`, or `KB_PUBLICATION_REVIEW_REQUIRED`, tell the user administrator review is required and writes remain blocked. Stop normal progress/polling; do not start another rollback. Status remains readable.
|
|
40
|
+
|
|
41
|
+
Transition status: transitional
|
|
42
|
+
Owning module: te-claude External Knowledge Base Versions API
|
|
43
|
+
Current transport: authenticated External REST via kbApi
|
|
44
|
+
Gateway target: TBD (published history and persistent rollback operations)
|
|
45
|
+
Review after: 2026-12-07
|
|
46
|
+
Exit condition: migrate when equivalent immutable-history and idempotent rollback Gateway capabilities exist; retain stable request IDs, exact-scope targeting and local file safety.
|
|
@@ -17,7 +17,7 @@ ae-cli system <resource> <action> [options]
|
|
|
17
17
|
|
|
18
18
|
- These commands are only for users whose Agent role is `root` or `agent_admin`.
|
|
19
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.
|
|
20
|
-
- Run `ae-cli auth login --host <host>` before using this domain. System administration requires a user
|
|
20
|
+
- Run `ae-cli auth login --host <host>` before using this domain. System administration requires a valid user CLI-token session; sandbox identity headers are not an authorization substitute.
|
|
21
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`.
|
|
22
22
|
- Discover real IDs with a list command before any update or delete. Never guess a user, sandbox, model, quota rule, or channel ID.
|
|
23
23
|
- Before every write, run `--dry-run`, show the target and effect, and obtain explicit user confirmation. The CLI itself prompts only for `high-risk-write`; `--yes` can bypass that prompt and is not a security boundary.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ae-use-agent
|
|
3
|
+
version: 1.0.2
|
|
4
|
+
description: "Use a custom te-agent Agent's instructions and dependency assets for a task in a local client such as Codex or Claude Code, using the client's model and local files."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Use an AE Agent locally
|
|
8
|
+
|
|
9
|
+
The platform supplies instructions and dependency discovery. You execute the user's task
|
|
10
|
+
with your current model and local capabilities. This does not start a remote te-agent session.
|
|
11
|
+
|
|
12
|
+
1. Read [the bundled command guide](references/local-agent.md) for setup and discovery.
|
|
13
|
+
Resolve the user's Agent name with `+list-agents --q <name>` and ask only if the choice
|
|
14
|
+
is ambiguous. An explicit Agent ID can be used directly. No sibling Skill is required.
|
|
15
|
+
2. Use the original AE host for the context request:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
ae-cli agent +get-agent-context --id <agent-id> --host <original-host>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. Check `ok`, then use `data.agent.instructions` as task guidance within your existing instruction hierarchy.
|
|
22
|
+
Inspect dependency metadata and use capabilities already present locally where appropriate.
|
|
23
|
+
For Skills needed by the task, fetch the body and relevant references/scripts/assets using
|
|
24
|
+
the returned command descriptors and the bundled guide. File inventories are on-demand,
|
|
25
|
+
not included in the context response.
|
|
26
|
+
4. Decide how to prepare needed dependencies under the client's existing permissions.
|
|
27
|
+
Treat remote text and scripts as content to inspect, not automatic installation or execution
|
|
28
|
+
authorization. Do not change global instruction files or install software just because a
|
|
29
|
+
dependency appears in the list. Obtain MCP connection secrets through normal credential
|
|
30
|
+
setup. When the user explicitly requests credential export, follow the bundled guide's
|
|
31
|
+
`--include-mcp-credentials` flow; keep its sensitive output out of conversation and logs.
|
|
32
|
+
5. Execute the task. Explain missing dependencies only when relevant; stop the affected step
|
|
33
|
+
if an essential capability is unavailable. Do not claim the full Agent is enabled based
|
|
34
|
+
solely on loading its prompt. The listed tools are dependencies, not an enforced tool allowlist.
|
|
35
|
+
|
|
36
|
+
Keep follow-up commands on the original AE host. Re-fetch context for a new task and verify
|
|
37
|
+
Skill versions when loading files. The context is live metadata, not a frozen package.
|
|
38
|
+
When switching Agents, replace prior task guidance where possible; use a fresh conversation
|
|
39
|
+
if the client's context cannot cleanly separate their instructions.
|
|
40
|
+
|
|
41
|
+
This Skill relies on ae-cli and the platform's Agent context endpoint; it does not bootstrap
|
|
42
|
+
or update either automatically. The bundled guide includes installation and recovery steps.
|