@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
@@ -0,0 +1,91 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { brotliCompressSync, brotliDecompressSync, constants } from 'node:zlib';
4
+ import { createHash } from 'node:crypto';
5
+
6
+ const PART_DATA_LENGTH = 15_000;
7
+ const MAX_PART_BYTES = 16 * 1024;
8
+ const MAX_PAYLOAD_BYTES = 64 * 1024 * 1024;
9
+ const INDEX_MARKER = /<!-- pskb_refresh_state_index\n([^\n]+)\n-->/;
10
+
11
+ const sha256 = (value) => createHash('sha256').update(value).digest('hex');
12
+
13
+ export function readLegacyRefreshState(content) {
14
+ const match = String(content).match(/<!-- pskb_refresh_state_base64\n([A-Za-z0-9_=\-\s]+)\n-->/);
15
+ if (!match) throw new Error('Refresh state payload is missing.');
16
+ return JSON.parse(Buffer.from(match[1].replace(/\s+/g, ''), 'base64url').toString('utf8'));
17
+ }
18
+
19
+ export function readRefreshStateIndex(content) {
20
+ const match = String(content).match(INDEX_MARKER);
21
+ if (!match) return null;
22
+ if (Buffer.byteLength(content) > MAX_PART_BYTES) throw new Error('Refresh state index exceeds 16 KiB.');
23
+ const index = JSON.parse(match[1]);
24
+ if (index.schema_version !== '2.0' || index.encoding !== 'brotli-base64url'
25
+ || !/^[a-f0-9]{64}$/.test(index.payload_sha256)
26
+ || !/^[a-f0-9]{64}$/.test(index.normalized_content_hash)
27
+ || !Number.isInteger(index.payload_bytes) || index.payload_bytes < 1 || index.payload_bytes > MAX_PAYLOAD_BYTES
28
+ || !Array.isArray(index.parts) || !index.parts.length) {
29
+ throw new Error('Invalid refresh state index.');
30
+ }
31
+ const seen = new Set();
32
+ for (const part of index.parts) {
33
+ if (!/^[-a-z0-9]+-refresh-state-part-\d{3}\.md$/.test(part.file)
34
+ || !/^[a-f0-9]{64}$/.test(part.sha256)
35
+ || !Number.isInteger(part.bytes) || part.bytes < 1 || part.bytes > MAX_PART_BYTES
36
+ || seen.has(part.file)) throw new Error('Invalid refresh state part metadata.');
37
+ seen.add(part.file);
38
+ }
39
+ return index;
40
+ }
41
+
42
+ export function encodeRefreshState(content, statePath, normalizedContentHash, baseline = null) {
43
+ if (!/^[a-f0-9]{64}$/.test(normalizedContentHash)) throw new Error('Invalid normalized refresh state hash.');
44
+ const payload = readLegacyRefreshState(content);
45
+ if (baseline) payload.source_tree_baseline = baseline;
46
+ const raw = Buffer.from(JSON.stringify(payload));
47
+ const encoded = brotliCompressSync(raw, { params: { [constants.BROTLI_PARAM_QUALITY]: 11 } }).toString('base64url');
48
+ const stem = path.posix.basename(statePath, '.md');
49
+ const parts = [];
50
+ for (let offset = 0; offset < encoded.length; offset += PART_DATA_LENGTH) {
51
+ const number = parts.length + 1;
52
+ const file = `${stem}-part-${String(number).padStart(3, '0')}.md`;
53
+ const data = encoded.slice(offset, offset + PART_DATA_LENGTH);
54
+ const partContent = `# Refresh State Part ${number}\n\nMachine state only. Do not compile as business evidence.\n\n<!-- pskb_refresh_state_part\n${data}\n-->\n`;
55
+ const bytes = Buffer.byteLength(partContent);
56
+ if (bytes > MAX_PART_BYTES) throw new Error('Refresh state part exceeds 16 KiB.');
57
+ parts.push({ file, path: path.posix.join(path.posix.dirname(statePath), file), content: partContent, sha256: sha256(partContent), bytes });
58
+ }
59
+ const index = {
60
+ schema_version: '2.0', encoding: 'brotli-base64url', payload_sha256: sha256(raw),
61
+ payload_bytes: raw.length, normalized_content_hash: normalizedContentHash,
62
+ parts: parts.map(({ file, sha256: hash, bytes }) => ({ file, sha256: hash, bytes })),
63
+ };
64
+ const indexContent = `# Refresh State\n\nMachine state index. Do not compile as business evidence. Read parts only with the CLI refresh-state reader.\n\n<!-- pskb_refresh_state_index\n${JSON.stringify(index)}\n-->\n`;
65
+ if (Buffer.byteLength(indexContent) > MAX_PART_BYTES) throw new Error('Refresh state index exceeds 16 KiB.');
66
+ return { indexContent, parts };
67
+ }
68
+
69
+ export function decodeRefreshState(content, indexFile) {
70
+ const index = readRefreshStateIndex(content);
71
+ if (!index) return { payload: readLegacyRefreshState(content), index: null };
72
+ const stem = path.basename(indexFile, '.md');
73
+ const chunks = index.parts.map((part, position) => {
74
+ if (part.file !== `${stem}-part-${String(position + 1).padStart(3, '0')}.md`) {
75
+ throw new Error(`Unexpected refresh state part name: ${part.file}.`);
76
+ }
77
+ const file = path.join(path.dirname(indexFile), part.file);
78
+ const data = fs.readFileSync(file);
79
+ if (data.length !== part.bytes || data.length > MAX_PART_BYTES || sha256(data) !== part.sha256) {
80
+ throw new Error(`Refresh state part checksum mismatch: ${part.file}.`);
81
+ }
82
+ const match = data.toString('utf8').match(/<!-- pskb_refresh_state_part\n([A-Za-z0-9_-]+)\n-->/);
83
+ if (!match) throw new Error(`Invalid refresh state part: ${part.file}.`);
84
+ return match[1];
85
+ });
86
+ const raw = brotliDecompressSync(Buffer.from(chunks.join(''), 'base64url'), { maxOutputLength: MAX_PAYLOAD_BYTES });
87
+ if (raw.length !== index.payload_bytes || sha256(raw) !== index.payload_sha256) {
88
+ throw new Error('Refresh state payload checksum mismatch.');
89
+ }
90
+ return { payload: JSON.parse(raw.toString('utf8')), index };
91
+ }
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: ae-automation
3
+ description: "Manage AE Agent and Agent team automations with ae-cli: create and edit schedules, enable or disable, run now, stop or retry executions, delete, inspect history and read execution results. Use for scheduled tasks and unattended recurring Agent work, from a local computer or an AE sandbox."
4
+ ---
5
+
6
+ # AE Automation
7
+
8
+ See [command risks](references/command_index.md). Read [the command contract](references/cli.md) before writing or executing an automation. Use `ae-cli automation --help` and leaf help to discover flags.
9
+
10
+ 1. Resolve the host and space. A local user signs in with `ae-cli auth login`; a sandbox uses its injected credentials. Pass `--agent-space-id` when the user identifies a space. Without a space, the server uses a bound sandbox space or the personal default. Show the resolved space when it matters.
11
+ 2. Discover the automation with `automation list` and inspect `automation get`. Use the returned IDs; names are not unique.
12
+ 3. For creation, select an Agent or team through the corresponding discovery commands. Match configuration to the target type. Preview writes with `--dry-run` when useful; the CLI shows a redacted request and asks the server to validate authentication, space, permissions, target state, fields, and idempotency without applying the operation.
13
+ 4. Execute the requested operation. Deleting an automation or stopping an execution requires confirmation; use `--yes` only when the user already authorized that action. In a non-interactive shell, these operations fail immediately unless global `--yes` is present.
14
+ 5. Read the returned run ID, then `automation runs result`. Report acceptance separately from completion. Use `--wait` only when the user needs the final outcome now.
15
+
16
+ Results are read from the server and work outside the sandbox. This skill does not read complete conversations or continue a chat. Never infer an output from a different execution sharing the same conversation.
@@ -0,0 +1,53 @@
1
+ # Automation command contract
2
+
3
+ Transition status: transitional
4
+ Owning module: te-claude automation and team scheduling
5
+ Current transport: authenticated TE REST /api/cli/automation/v1
6
+ Gateway target: TBD (automation lifecycle)
7
+ Review after: 2026-12-15
8
+ Exit condition: equivalent gateway capabilities preserve permissions, idempotency, typed configuration and read-only results.
9
+
10
+ ## Discovery and management
11
+
12
+ - `ae-cli automation list [--agent-space-id ID] [--target-type agent|team] [--q NAME] [--status active|paused] [--limit 20] [--cursor CURSOR]`
13
+ - `ae-cli automation get --id ID`
14
+ - `ae-cli automation create --target-type agent --agent-id ID --name NAME --message TEXT --schedule-kind daily --time 09:00 [--model MODEL_CONFIG_ID] [--reuse-conversation true|false]`
15
+ - `ae-cli automation create --target-type team --team-id ID --name NAME --message TEXT --trigger-type manual [--scope JSON] [--channels JSON_ARRAY]`
16
+ - `ae-cli automation update --id ID --target-type agent|team <changed fields>`
17
+ - `ae-cli automation enable|disable --id ID`
18
+ - `ae-cli automation delete --id ID --yes`
19
+
20
+ Scheduled creation needs `--schedule-kind` or `--cron-expression`. Frequencies: hourly with `--minute 0..59`; daily with `--time HH:mm`; weekly also `--weekday 0..6`; monthly also `--day-of-month 1..28`. Times use the server timezone. Manual creation does not require a schedule. `--trigger-immediately` executes after creation; `--wait` then waits for that execution. Creation and immediate execution have separate results: do not create another automation if only its execution failed.
21
+
22
+ On update, omitted fields retain their values. `--model null`, `--scope null`, destination IDs set to `null`, and `--save-to-knowledge-base-id null` clear nullable fields. `--channels '[]'` clears notifications; `--clear-message` clears instructions; `--reuse-conversation false` disables reuse. An automation's target is immutable on update. Team fields are rejected for Agent targets and vice versa.
23
+
24
+ Team configuration supports `--scope`, `--channels`, `--feishu-chat-id`, `--lark-chat-id`, `--slack-channel-id`, `--save-to-knowledge-base-id`. Other supported notification channels use the team's existing notification configuration. Team visibility and management permissions follow the Web application.
25
+
26
+ `--dry-run` returns a redacted local request preview plus the server preflight result. The preflight applies the same authentication, space, schema, permissions, target state, run state, field applicability and idempotency checks as execution, but does not write data, create or cancel runs, or emit product events. A later real request validates current state again.
27
+
28
+ Disable stops future schedules and leaves the current execution running. Stop cancels one execution and leaves the schedule enabled. Delete soft-deletes the automation and cancels active execution.
29
+
30
+ Delete and stop are high-risk writes. Interactive shells ask for confirmation. Non-interactive shells require global `--yes` and otherwise exit with `CONFIRMATION_REQUIRED` before sending a request.
31
+
32
+ ## Executions and results
33
+
34
+ ```bash
35
+ ae-cli automation run --id ID --command-id REQUEST_ID
36
+ ae-cli automation runs list --id ID --limit 20
37
+ ae-cli automation runs get --id ID --run-id RUN_ID
38
+ ae-cli automation runs result --id ID --run-id RUN_ID
39
+ ae-cli automation runs stop --id ID --run-id RUN_ID --yes
40
+ ae-cli automation runs retry --id ID --run-id FAILED_RUN_ID --command-id REQUEST_ID --wait --timeout 300
41
+ ```
42
+
43
+ Retry creates a new complete execution from current configuration after failure or cancellation. It retains the original result and returns a new run ID with a source reference. It does not resume failed steps or erase the old run.
44
+
45
+ `--command-id` makes run/retry repeatable after uncertain responses. Within each target type, reuse the same value for the same request; changing its automation ID or source run produces a conflict. Preserve the generated command ID from output or an error hint. A network timeout is not proof that execution was rejected.
46
+
47
+ Without `--wait`, success means accepted. With `--wait`, output includes completion or timeout information; timeout preserves the run ID and does not restart or cancel the execution. Read the same result later. If polling fails, the accepted response and identifiers remain available with an `observation` error; query that run instead of triggering again. `partial_success` is distinct from success. Result availability is `pending`, `available`, `empty` or `unavailable`; missing historical links are not replaced with newer output.
48
+
49
+ `--format json` produces scriptable envelopes; `--format table` is available for interactive inspection. Full conversations, tool traces and terminal continuation are outside this interface. URLs are optional Web references and contain no credentials. The CLI does not automatically open a browser.
50
+
51
+ ## Compatibility
52
+
53
+ The retired Agent-domain automation commands are unavailable. Use the `automation` domain for the complete lifecycle, including teams.
@@ -0,0 +1,17 @@
1
+ # Automation commands
2
+
3
+ | Command | Purpose | Risk |
4
+ | ------------------------------- | -------------------- | --------------- |
5
+ | `ae-cli automation list` | Automation lifecycle | read |
6
+ | `ae-cli automation get` | Automation lifecycle | read |
7
+ | `ae-cli automation create` | Automation lifecycle | write |
8
+ | `ae-cli automation update` | Automation lifecycle | write |
9
+ | `ae-cli automation enable` | Automation lifecycle | write |
10
+ | `ae-cli automation disable` | Automation lifecycle | write |
11
+ | `ae-cli automation delete` | Automation lifecycle | high-risk-write |
12
+ | `ae-cli automation run` | Automation lifecycle | write |
13
+ | `ae-cli automation runs list` | Automation lifecycle | read |
14
+ | `ae-cli automation runs get` | Automation lifecycle | read |
15
+ | `ae-cli automation runs stop` | Automation lifecycle | high-risk-write |
16
+ | `ae-cli automation runs retry` | Automation lifecycle | write |
17
+ | `ae-cli automation runs result` | Automation lifecycle | read |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ae-capability
3
- version: 1.3.5
3
+ version: 1.3.7
4
4
  description: "AE capability gateway discovery and generic invocation with ae-cli. Use when the user needs to list or search available capabilities, inspect an unknown capability schema/risk/auth contract, optionally validate complex input or dry-run before execute, or invoke a long-tail capability that has no curated ae-cli command. Always discover and inspect before composing input; never guess capability IDs or input fields. Prefer on-demand validate OR dry-run — do not stack both by default."
5
5
  ---
6
6
 
@@ -22,27 +22,32 @@ Use this skill for progressive capability discovery and generic gateway invocati
22
22
 
23
23
  Never guess a capability ID, input field, enum value, resource ID, or project ID.
24
24
 
25
- **CRITICAL — Host compat (do this first):** After each `ae-cli` run, check stderr and `_notice.host_compat`. If either is present, open the user reply with a short ⚠️ version warning and **quote the `npm i -g` / `npx skills add` (or update-cluster) lines verbatim**, then present the business result. Soft tip; `ok: true` can still carry the notice.
25
+ **CRITICAL — Host compat (do this first):** After each `ae-cli` run, check stderr and `_notice.host_compat`. If either is present, open the user reply with a short ⚠️ version warning and quote the recommended `ae-cli update` (or update-cluster) guidance, then present the business result. For new local installations use `npx @thinkingai/ae-cli@latest install`. Soft tip; `ok: true` can still carry the notice.
26
26
 
27
27
  ## Agent Context Telemetry
28
28
 
29
29
  Hard rule: before running gateway-backed `ae-cli` commands, maintain the current Agent context in `.ae/cli-agent-context.json` at the working directory root, unless the user explicitly asks not to send intent telemetry. Keep the business command clean; do not append `--agent-context <base64url-json>` by default.
30
30
 
31
- Create or update the context file when starting a CLI-backed task and whenever the user's CLI purpose changes. Do not rewrite it before every command when the same purpose still applies. Use the user's original language for `session_initial_intent`, `user_intent`, and `session_goal`; for example, use Chinese text for a Chinese user request. At minimum, include:
31
+ Create or update the context file when starting a CLI-backed task and whenever the user's CLI purpose changes. Reuse it while the purpose and model remain unchanged. Use the user's original language for `session_initial_intent`, `user_intent`, and `session_goal`; for example, use Chinese text for a Chinese user request. At minimum, include:
32
32
 
33
33
  - `agent_client`
34
+ - `agent_model` whenever the current model can be confirmed
34
35
  - stable `agent_session_id`
35
36
  - `agent_turn_id` when available
36
37
  - `intent_source: "agent_context_file"`
37
38
  - concise `user_intent` for the current CLI-triggering purpose
38
39
  - current `session_goal`
39
40
 
41
+ The Agent must actively obtain the current model identifier and write it explicitly as `agent_model` in the context file. Use trusted runtime context or bounded metadata for the exact current session and turn; for example, Codex's current-session `turn_context.model`. Do not rely solely on a model environment variable being present. Never infer the model from the Agent/product name, a configured default, or another session. This requirement applies to every Agent client. Update the file when the model changes, even if the CLI purpose stays the same.
42
+
43
+ If the model cannot be confirmed, omit `agent_model`, set `context_capture_status: "partial"`, and continue; do not block or delay the business command or ask the user to identify the model just for telemetry. Once confirmed, write the model and remove the stale partial marker so the CLI can compute capture status from the remaining fields.
44
+
40
45
  Write this JSON object to `.ae/cli-agent-context.json`:
41
46
 
42
47
  ```json
43
48
  {
44
49
  "agent_client": "codex",
45
- "agent_model": "gpt-5.5",
50
+ "agent_model": "<confirmed-current-model-id>",
46
51
  "agent_session_id": "<stable conversation id>",
47
52
  "agent_turn_id": "<current turn id>",
48
53
  "parent_turn_id": "<previous turn id>",
@@ -55,13 +60,13 @@ Write this JSON object to `.ae/cli-agent-context.json`:
55
60
  }
56
61
  ```
57
62
 
58
- Use this local template when updating the file:
63
+ Use this local template when updating the file. Replace every placeholder with verified context before running it; write the confirmed model explicitly rather than reading an optional environment variable. For an unknown model, omit that field and add the partial status described above.
59
64
 
60
65
  ```bash
61
66
  mkdir -p .ae
62
67
  node -e 'const fs = require("fs"); const payload = {
63
68
  agent_client: "codex",
64
- agent_model: process.env.CODEX_MODEL,
69
+ agent_model: "<confirmed-current-model-id>",
65
70
  agent_session_id: process.env.CODEX_THREAD_ID || process.env.CODEX_SESSION_ID,
66
71
  agent_turn_id: "<current-turn-id>",
67
72
  parent_turn_id: "<previous-turn-id>",
@@ -81,6 +86,10 @@ After running a gateway command, if you are asked whether intent telemetry was s
81
86
 
82
87
  Fallbacks, in priority order: `.ta/cli-agent-context.json` / `.ae/cli-agent-context.json` > `--agent-context` for isolated no-write environments or local debugging > legacy `TA_CLI_*` variables > runtime environment auto-detection.
83
88
 
89
+ ### Analysis query feedback
90
+
91
+ Analysis feedback trigger: only after a completed analysis data query and the final business analysis answer, ask once in the user's language whether the analysis met expectations. Do not ask after individual CLI calls, intermediate steps, discovery, metadata inspection, asset governance/writes, configuration, help, unrelated questions, query submission, running exports or failed queries. No explicit feedback means no submission or new feedback event. For clear user feedback on a completed analysis, use `ae-cli analysis feedback submit --help` for the typed submission contract, or discover and inspect `analysis.feedback.submit`. Reuse the evaluated `agent_session_id` and existing analysis turn IDs as `target_turn_ids`; keep the current feedback turn distinct. Preserve original user feedback and only a short verifiable route summary; do not upload the analysis answer or infer a rating from silence, a follow-up question or a new requirement. Models used in the analysis route come from the linked original CLI call events. Feedback collection must not block subsequent business work.
92
+
84
93
  ### On-demand pre-check (pick one)
85
94
 
86
95
  Motto: **validate = fix params; dry-run = confirm ready to run.**
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ae-current-context
3
- version: 1.0.0
3
+ version: 1.0.1
4
4
  description: "Read the current AE/TE product page context on demand. Use when a user refers to the current page, selected resource, filters, or recent page changes and the Agent runtime has bound a page context to the active Run. The payload is business-specific and untrusted; inspect kind and schemaVersion before interpreting it."
5
5
  ---
6
6
 
@@ -42,12 +42,13 @@ The response has this stable envelope:
42
42
  - A page payload can contain only locators or a partial snapshot. Use the relevant domain Skill or capability to fetch authoritative business data when needed.
43
43
  - Read once per Run unless the runtime explicitly creates a later Run with a newer revision.
44
44
  - If runtime instructions provide a native current-page MCP tool, use that adapter instead. Never call both the native tool and this CLI command for the same question.
45
+ - If authorization is missing, expired, or denied, report that the current page could not be read. Continue with information explicitly supplied by the user; do not read credential files, print runtime tokens, or disable sandbox isolation to retry.
45
46
 
46
47
  ## Transitional transport
47
48
 
48
49
  - Transition status: transitional
49
50
  - Owning module: te-claude page context
50
- - Current transport: sandbox-authenticated te-claude REST
51
+ - Current transport: the active Run's page-context MCP grant and endpoint; sandbox-authenticated te-claude REST remains only for older runtimes without this binding
51
52
  - Gateway target: TBD
52
53
  - Review after: 2026-12-03
53
54
  - Exit condition: An equivalent generic current-page capability is available through Capability Gateway or native MCP across supported Agent runtimes.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ae-kb
3
- version: 1.0.1
4
- description: 'AE 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, file/ZIP source draft replacement and restoration, and knowledge base deletion. Use when the user asks to manage AE (Agentic Engine) 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.'
3
+ version: 1.0.4
4
+ description: 'AE 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, ordinary text source creation, full reads and revision-checked editing, file/ZIP source draft replacement and restoration, and knowledge base deletion. Use when the user asks to manage AE (Agentic Engine) 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, create or edit text sources, or delete a knowledge base. To choose which knowledge base is worth searching, use the ae-kb-discovery skill first; this skill runs the retrieval once a target is chosen. Must use ae-cli kb commands and must not guess knowledge base names, scopes, page paths, source IDs, source display names, JSON payload shapes, or URL formats.'
5
5
  ---
6
6
 
7
7
  # ae-kb
@@ -14,15 +14,15 @@ AE CLI (`ae-cli`) knowledge base commands are invoked through:
14
14
 
15
15
  ```bash
16
16
  ae-cli kb +<command> [options]
17
- ae-cli kb source <replace|restore|preview|commit|cancel|check-updates> [options]
17
+ ae-cli kb source <create-text|read-text|replace|restore|preview|commit|cancel|check-updates|check-url-updates> [options]
18
18
  ```
19
19
 
20
20
  ## Global Rules
21
21
 
22
22
  - Use this skill for AE knowledge base tasks: create, import a compiled snapshot, query, ask with LLM, list accessible knowledge bases and their sources, inspect indexes, grep pages, read pages, check status, upload sources, add URL sources, generate schema, compile, remove source files, and delete knowledge bases.
23
23
  - **Searching a knowledge base for an answer is the most common task. If that is what you are doing, go straight to [Explore Knowledge Base Pages](#explore-knowledge-base-pages) and read [`references/query-workflow.md`](references/query-workflow.md) first — it is the retrieval procedure. The other commands below are for managing knowledge bases, not answering from them.**
24
- - **When retrieved pages will guide project-scoped business data analysis, read and follow [`references/analysis-workflow.md`](references/analysis-workflow.md) before running any data query. This is mandatory after a KB hit identifies a saved asset, definition, parameter, time rule, conflict, or decision boundary; do not jump directly to ad-hoc analysis or SQL.**
25
- - Read operations can run directly after required inputs are known. Write operations require explicit user intent and normally keep the confirmation prompt unless the user asks to bypass it.
24
+ - **When retrieved pages will guide project-scoped business data analysis, read and follow [`references/analysis-workflow.md`](references/analysis-workflow.md) before running any data query. This is mandatory after a KB hit identifies an asset, definition, parameter, time rule, conflict, or decision boundary. Verify semantic coverage before execution; a related page or KB limitation is not task completion. Continue ordinary analysis for uncovered requirements without jumping directly to unverified ad-hoc analysis or SQL.**
25
+ - Read operations can run directly after required inputs are known. Write operations require explicit user intent. Only `high-risk-write` commands require the CLI confirmation prompt; use `--yes` after explicit authorization.
26
26
  - Prefer `--dry-run` before destructive or broad writes when the user has not already validated the target.
27
27
  - Do not invent knowledge base names, scopes, source IDs, source display names, or JSON payloads. Ask the user or query known context when values are missing.
28
28
  - When building a `--sources` ref (or `+read --source`), copy the exact `scope` and `name` from `+list` output — run `ae-cli kb +list` first when the scope of a named knowledge base is unknown.
@@ -36,6 +36,9 @@ ae-cli kb source <replace|restore|preview|commit|cancel|check-updates> [options]
36
36
 
37
37
  | Command | Risk | Purpose |
38
38
  |---|---:|---|
39
+ | `source create-text` | write | Create one ordinary Markdown source from text, UTF-8 file or explicit stdin; saves without compiling. |
40
+ | `source read-text` | read | Read complete ordinary text with its corresponding revision; optionally save original UTF-8 bytes to a new file. |
41
+ | `source check-url-updates` | write | Submit an asynchronous check for one compiled custom URL source; success means accepted only. |
39
42
  | `source check-updates` | write | Check one compiled Feishu source with the scheduled detector; mark changes without compiling. |
40
43
  | `+ask` | read | LLM-powered Q&A over knowledge bases; for multi-page synthesis or multi-hop questions. |
41
44
  | `+ask-status` | read | Query the current status of an ask execution by `--execution-id` without polling. |
@@ -52,9 +55,30 @@ ae-cli kb source <replace|restore|preview|commit|cancel|check-updates> [options]
52
55
  | `+schema` | write | Generate the compile schema for a knowledge base. |
53
56
  | `+compile` | write | Compile a knowledge base in incremental or full mode. |
54
57
  | `+status` | read | Query the current status of a knowledge base. |
58
+ | `usage list` | read | List one page of compilation usage logs, including elapsed time in milliseconds. |
55
59
  | `+rm-source` | high-risk-write | Delete one source from a knowledge base by stable ID; exact display name is legacy compatibility only. |
56
60
  | `+remove` | write | Delete an entire knowledge base. |
57
61
 
62
+ ## Compilation Usage Logs
63
+
64
+ ```bash
65
+ ae-cli kb usage list --name handbook --scope personal --page 1 --page-size 20
66
+ ae-cli kb usage list --name handbook --jq '.items | map({createdAt, taskType, status, durationMs})' --format table
67
+ ```
68
+
69
+ - Returns `{ items, total, page, pageSize }`. `--page` defaults to 1; `--page-size` defaults to 20 and accepts 1–100. Fetch each page explicitly.
70
+ - `durationMs` is the usage log's `finishedAt - startedAt`, in milliseconds. A missing or invalid timestamp yields `null`; zero remains zero. Failed records can have duration even when `usageAvailable` is false.
71
+ - Historical missing durations are not reconstructed from compile runs. `startedAt` and `finishedAt` are ISO timestamps or `null`.
72
+ - Requires the same Schema-read permission as the Web compilation usage list. Imported snapshots do not expose usage. `--scope` selects exactly personal or company; omission keeps the existing personal-then-company lookup.
73
+ - `--dry-run` previews the read without sending a request. Default output retains numeric/null values; use the existing `--jq` and `--format table` options for a compact table.
74
+
75
+ Transition status: transitional
76
+ Owning module: te-claude External Knowledge Base Usage API
77
+ Current transport: authenticated External REST via `kbApi`
78
+ Gateway target: TBD (compilation usage list)
79
+ Review after: 2026-12-14
80
+ Exit condition: migrate to the Gateway equivalent when available, preserving typed pagination and duration/null semantics.
81
+
58
82
  ## Published Version History
59
83
 
60
84
  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.
@@ -298,7 +322,7 @@ ae-cli kb +list --build-status compiled
298
322
 
299
323
  Use the deterministic retrieval primitives when an agent needs to explore knowledge base content like a code repository. These endpoints do not call an LLM on the server side.
300
324
 
301
- **Before running a real query, read [`references/query-workflow.md`](references/query-workflow.md)** — it is the step-by-step procedure for turning a question into an answer without crawling. It covers candidate indexing, copied-path grep, same-page read windows, linked-page re-grep, outline-derived ranges, and coverage assessment. This section below is the per-command reference the workflow draws on.
325
+ **Before running a real query, read [`references/query-workflow.md`](references/query-workflow.md)** — it selects the next useful retrieval step without crawling. It covers candidate indexing, copied-path grep, direct bounded reads of linked short pages, same-page read windows, linked-page re-grep when needed, optional outline-derived ranges, and coverage assessment. This section below is the per-command reference the workflow draws on.
302
326
 
303
327
  Start with `+list` or `+index` to discover accessible knowledge bases. Use `+index` when you also need navigation maps:
304
328
 
@@ -343,6 +367,10 @@ ae-cli kb +read \
343
367
  --expand block
344
368
  ```
345
369
 
370
+ ### Create, read or edit text sources
371
+
372
+ Read [the text source workflow](references/text-sources.md) when collecting text, reading full editable source content, or updating an ordinary `.md`, `.markdown` or `.txt` source. It covers explicit scope, UTF-8/BOM/newline preservation, exclusive local output, revision conflicts, redacted dry-run and manual compilation. Web and CLI maintain the same source ID.
373
+
346
374
  ### List Sources
347
375
 
348
376
  List sources first to discover the stable identifier for the intended source:
@@ -354,10 +382,10 @@ ae-cli kb +list-sources --name engineering-handbook --scope company
354
382
  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.
355
383
 
356
384
  - Transition status: transitional
357
- - Owning module: te-claude External Knowledge Base Sources API
358
- - Current transport: authenticated KB external REST through `kbApi`.
359
- - Gateway target: TBD (`kb.source.list` proposed)
360
- - Review after: 2026-12-03
385
+ - Owning module: te-claude knowledge-base source management
386
+ - Current transport: External Knowledge Base REST API
387
+ - Gateway target: TBD
388
+ - Review after: 2026-11-12
361
389
  - Exit condition: migrate to a typed Gateway capability when an equivalent source-list capability is available, or remove this command if dynamic Gateway execution provides the same discoverability and safe output contract.
362
390
 
363
391
  ### Remove One Source
@@ -441,7 +469,7 @@ ae-cli kb +grep --query "<keywords>" --sources '[{"scope":"company","name":"kb-n
441
469
 
442
470
  - `--query`, alias `-q`: required keywords to search.
443
471
  - `--sources`: required JSON array of knowledge base refs.
444
- - `--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).
472
+ - `--paths`: required JSON array of wiki pages or subdirectories **copied** from current `+index`, `+grep` or `+read` navigation links. Do not invent paths. A single page is still an array, e.g. `["wiki/sandbox.md"]`. Distinct from `+read --path` (one string).
445
473
  - `--top-k`: optional max number of hits, 1-50, default 10.
446
474
  - `--locale`: optional locale: `zh`, `en`, `ja`, or `ko`.
447
475
  - 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.
@@ -530,10 +558,11 @@ ae-cli kb +status --name "<name>" [--scope personal|company]
530
558
  ### `+list-sources`
531
559
 
532
560
  ```bash
533
- ae-cli kb +list-sources --name "<name>" [--scope personal|company]
561
+ ae-cli kb +list-sources --name "<name>" [--scope personal|company] [--content-type all|text]
534
562
  ```
535
563
 
536
564
  - `--name`: required knowledge base name.
565
+ - `--content-type`: defaults to `all`; `text` selects ordinary `.md`, `.markdown` and `.txt` sources (case-insensitive), excluding URL and ZIP sources. Scope remains optional for this list command.
537
566
  - 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.
538
567
  - 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.
539
568
  - A rollback creates a new current version. An older deletion receipt cannot override membership in that version. A later source deletion needs publication again.
@@ -580,3 +609,24 @@ Transport: `POST /agent/api/external/knowledge-bases/sources/check-updates`, bod
580
609
  - Gateway target: TBD; reuse an equivalent source update-check capability when available.
581
610
  - Review after: 2026-10-16.
582
611
  - Exit condition: once the Gateway exposes equivalent authorization and detector semantics, migrate the typed command to L2 or use L3 if it adds no value.
612
+
613
+
614
+ ### Submit an ordinary URL update check
615
+
616
+ ```bash
617
+ ae-cli kb source check-url-updates --name "Engineering Handbook" --id "<source-id>" --scope company --dry-run
618
+ ae-cli kb source check-url-updates --name "Engineering Handbook" --id "<source-id>" --scope company
619
+ ```
620
+
621
+ Only existing `sourceType=url`, `platform=custom`, compiled sources without pending updates qualify. The request is rejected while Wiki/Schema compilation or input preparation is active. Success returns `{accepted:true,sourceId}` and only means accepted. It has no final counts, task ID, checking state, wait mode or completion query. Read `kb +list-sources` for update markers; unchanged state cannot distinguish execution, no change, failure or a discarded result. When marked changed, explicitly run the existing incremental compile. Feishu continues to use synchronous `source check-updates`.
622
+
623
+ Transport: `POST /agent/api/external/knowledge-bases/sources/check-url-updates`, body `{name,sourceId,scope?}`. Dry-run previews without sending a request. Submission errors preserve the server error code, details and nonzero exit.
624
+
625
+ ### Admission record: source check-url-updates
626
+
627
+ - Transition status: transitional (this new KB external capability has no Gateway equivalent).
628
+ - Owning module: te-claude knowledge-base source management.
629
+ - Current transport: KB external REST through kbApi and CLI token.
630
+ - Gateway target: TBD; reuse an equivalent asynchronous ordinary URL source-check capability.
631
+ - Review after: 2026-10-24.
632
+ - Exit condition: when the Gateway provides equivalent authorization and asynchronous submission semantics, migrate to L2 if typed flags add value, otherwise use L3.