@thinkingai/ae-cli 6.1.24 → 6.1.26

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 (195) hide show
  1. package/README.md +35 -10
  2. package/README.zh.md +32 -10
  3. package/bin/ae-cli.js +6 -1
  4. package/cli-installation-guide.md +91 -0
  5. package/dist/{auth-XZNXFRJS.js → auth-YHMC3GDH.js} +168 -10
  6. package/dist/automation-NWWVLWG2.js +459 -0
  7. package/dist/{capability-FYTU3X6L.js → capability-3QLLIVFB.js} +11 -6
  8. package/dist/chunk-4655PUNX.js +43 -0
  9. package/dist/{chunk-4NRCTUZJ.js → chunk-5XJYLEVC.js} +4 -4
  10. package/dist/{chunk-JOCDD4ON.js → chunk-7QXISROD.js} +1 -1
  11. package/dist/{chunk-EQ255HKO.js → chunk-AP7YP2NX.js} +2 -2
  12. package/dist/{chunk-DVMLWQD4.js → chunk-CT7QDJS6.js} +2 -2
  13. package/dist/chunk-D6ACFILC.js +56 -0
  14. package/dist/{chunk-HFGZGYCG.js → chunk-EOYSKMXN.js} +264 -10
  15. package/dist/{chunk-57RRFUEZ.js → chunk-FMNNGNYO.js} +43 -8
  16. package/dist/{chunk-7XGFSUOM.js → chunk-GIK6EDUG.js} +291 -84
  17. package/dist/chunk-HVHR4SCP.js +133 -0
  18. package/dist/{chunk-CCS66K4K.js → chunk-KAEHZZH4.js} +3 -3
  19. package/dist/{chunk-DX5CDO34.js → chunk-KFNMQTZI.js} +580 -214
  20. package/dist/{chunk-HBGADCKA.js → chunk-PLE722AJ.js} +28 -11
  21. package/dist/chunk-RK6GLDGI.js +27 -0
  22. package/dist/{chunk-V2NUHPXF.js → chunk-S6M42KND.js} +1 -1
  23. package/dist/{chunk-7FTTULED.js → chunk-UQ77JXYH.js} +7 -3
  24. package/dist/{chunk-MAPZ7VB6.js → chunk-WNGFSIOB.js} +20 -1
  25. package/dist/{chunk-VYXXOKYS.js → chunk-XCHAYMSF.js} +7 -4
  26. package/dist/{community-report-client-CU22W53K.js → community-report-client-PEERQCX2.js} +1 -1
  27. package/dist/{config-XO3LI3SA.js → config-AHPMEW5A.js} +25 -6
  28. package/dist/context-YAE3QXP3.js +136 -0
  29. package/dist/{data-integration-HNGUKFIC.js → data-integration-HESZET7E.js} +6 -6
  30. package/dist/index.js +167 -53
  31. package/dist/{local-data-upload-client-GTRIT64F.js → local-data-upload-client-TWMHFLUA.js} +1 -1
  32. package/dist/memory-62BJOULV.js +580 -0
  33. package/dist/{metadata-DI5BMYFU.js → metadata-C7CEDHOJ.js} +7 -7
  34. package/dist/{model-RNPQXIBI.js → model-SBV2JFJI.js} +9 -5
  35. package/dist/{personal-semantic-preference-5C3WUXFI.js → personal-semantic-preference-QECDPHND.js} +119 -11
  36. package/dist/project-semantic-Z4QAMBWF.js +356 -0
  37. package/dist/{sync-O45NXEQY.js → sync-SU33KYX7.js} +12 -8
  38. package/dist/{te-agent-K5MSPNHJ.js → te-agent-F5QBZSQA.js} +423 -494
  39. package/dist/{te-analysis-AISWCOOZ.js → te-analysis-2ECAAIFK.js} +1227 -154
  40. package/dist/{te-community-4OYU3BDA.js → te-community-PFLDLPP4.js} +3 -3
  41. package/dist/{te-dataops-NFIPB6FX.js → te-dataops-FOQSRIAZ.js} +644 -276
  42. package/dist/{te-engage-BAM3GBFX.js → te-engage-QKUGIWSR.js} +6 -6
  43. package/dist/{te-experiment-GUTZXZ5Z.js → te-experiment-26PXR2UO.js} +6 -6
  44. package/dist/{te-kb-3TS73NO6.js → te-kb-MHDOST62.js} +666 -244
  45. package/dist/{te-system-STMHLS5J.js → te-system-J2FQF5ER.js} +6 -6
  46. package/dist/{te-team-3I5AOX3N.js → te-team-5UOZPTU3.js} +6 -6
  47. package/dist/things-VPPXXLHB.js +1091 -0
  48. package/dist/{update-RZXLPCRH.js → update-EEUTEI6R.js} +59 -51
  49. package/dist/workspace-O3EEIYQM.js +554 -0
  50. package/package.json +30 -11
  51. package/skills/ae-agent/SKILL.md +95 -140
  52. package/skills/ae-agent/references/add-model.md +1 -1
  53. package/skills/ae-agent/references/create-agent.md +1 -1
  54. package/skills/ae-agent/references/find-archived-conversations.md +12 -5
  55. package/skills/ae-agent/references/get-agent.md +1 -1
  56. package/skills/ae-agent/references/list-agents.md +2 -2
  57. package/skills/ae-agent/references/list-models.md +2 -2
  58. package/skills/ae-agent/references/notification.md +40 -0
  59. package/skills/ae-agent/references/restore-conversation.md +3 -1
  60. package/skills/ae-analysis/SKILL.md +55 -23
  61. package/skills/ae-analysis/references/adhoc_export.md +1 -1
  62. package/skills/ae-analysis/references/adhoc_run.md +1 -1
  63. package/skills/ae-analysis/references/agent_review_submit_to_page.md +2 -0
  64. package/skills/ae-analysis/references/ai_models/event.md +6 -1
  65. package/skills/ae-analysis/references/ai_models/funnel.md +12 -4
  66. package/skills/ae-analysis/references/ai_models/heat_map.md +23 -0
  67. package/skills/ae-analysis/references/ai_models/interval.md +24 -0
  68. package/skills/ae-analysis/references/ai_models/path.md +20 -0
  69. package/skills/ae-analysis/references/ai_models/prop_analysis.md +2 -0
  70. package/skills/ae-analysis/references/ai_models/rank_list.md +30 -0
  71. package/skills/ae-analysis/references/ai_models/retention.md +45 -1
  72. package/skills/ae-analysis/references/ai_models/revenue.md +20 -2
  73. package/skills/ae-analysis/references/ai_models/session.md +76 -0
  74. package/skills/ae-analysis/references/ai_models/tag.md +2 -0
  75. package/skills/ae-analysis/references/ai_models.md +100 -3
  76. package/skills/ae-analysis/references/analysis_data_retrieval.md +4 -0
  77. package/skills/ae-analysis/references/analysis_drilldown_contract.md +4 -1
  78. package/skills/ae-analysis/references/asset_batch_info_export.md +10 -0
  79. package/skills/ae-analysis/references/asset_batch_sql_export.md +13 -1
  80. package/skills/ae-analysis/references/asset_export.md +12 -1
  81. package/skills/ae-analysis/references/asset_list.md +1 -0
  82. package/skills/ae-analysis/references/asset_search.md +11 -5
  83. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  84. package/skills/ae-analysis/references/catalog_list.md +1 -1
  85. package/skills/ae-analysis/references/collaboration.md +48 -0
  86. package/skills/ae-analysis/references/command_index.md +29 -19
  87. package/skills/ae-analysis/references/dashboard_list.md +4 -4
  88. package/skills/ae-analysis/references/dashboard_move.md +21 -0
  89. package/skills/ae-analysis/references/dashboard_report_add.md +2 -0
  90. package/skills/ae-analysis/references/dashboard_report_data_export.md +2 -0
  91. package/skills/ae-analysis/references/dashboard_report_get.md +19 -0
  92. package/skills/ae-analysis/references/dashboard_report_update.md +27 -0
  93. package/skills/ae-analysis/references/dashboard_update.md +1 -1
  94. package/skills/ae-analysis/references/drilldown_session_details_run.md +41 -0
  95. package/skills/ae-analysis/references/event_export.md +3 -1
  96. package/skills/ae-analysis/references/event_report_presentation.md +76 -0
  97. package/skills/ae-analysis/references/feedback_submit.md +37 -0
  98. package/skills/ae-analysis/references/governance_recommendation_auto_review.md +77 -0
  99. package/skills/ae-analysis/references/governance_recommendation_export.md +11 -0
  100. package/skills/ae-analysis/references/metadata_resolution.md +18 -3
  101. package/skills/ae-analysis/references/metric_export.md +3 -1
  102. package/skills/ae-analysis/references/metric_list.md +1 -1
  103. package/skills/ae-analysis/references/operation_record_export.md +10 -0
  104. package/skills/ae-analysis/references/personal_semantic_preference_add.md +2 -2
  105. package/skills/ae-analysis/references/personal_semantic_preference_get.md +4 -4
  106. package/skills/ae-analysis/references/personal_semantic_preference_list.md +4 -4
  107. package/skills/ae-analysis/references/personal_semantic_preference_review.md +9 -0
  108. package/skills/ae-analysis/references/personal_semantic_preference_review_list.md +7 -0
  109. package/skills/ae-analysis/references/personal_semantic_preference_submit.md +7 -0
  110. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +91 -32
  111. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +99 -1
  112. package/skills/ae-analysis/references/property_export.md +3 -1
  113. package/skills/ae-analysis/references/report_create.md +18 -4
  114. package/skills/ae-analysis/references/report_data_export.md +6 -0
  115. package/skills/ae-analysis/references/report_get.md +7 -1
  116. package/skills/ae-analysis/references/report_list.md +5 -5
  117. package/skills/ae-analysis/references/report_update.md +21 -4
  118. package/skills/ae-analysis/references/sql_table_columns.md +4 -4
  119. package/skills/ae-analysis/references/sql_table_list.md +5 -5
  120. package/skills/ae-analysis/references/system_query_monitor_overview.md +2 -0
  121. package/skills/ae-analysis/references/system_query_task_cancel.md +2 -0
  122. package/skills/ae-analysis/references/system_query_task_export.md +6 -2
  123. package/skills/ae-analysis/references/system_query_task_get.md +2 -0
  124. package/skills/ae-analysis/references/system_query_task_list.md +7 -3
  125. package/skills/ae-analysis/references/system_query_task_options.md +2 -2
  126. package/skills/ae-analysis/references/system_query_task_realtime_list.md +15 -0
  127. package/skills/ae-analysis/references/user_cluster_models.md +8 -0
  128. package/skills/ae-analysis/references/user_tag_create.md +7 -1
  129. package/skills/ae-analysis/references/user_tag_get.md +1 -1
  130. package/skills/ae-analysis/references/user_tag_models.md +20 -2
  131. package/skills/ae-analysis/references/user_tag_refresh.md +1 -1
  132. package/skills/ae-analysis/references/user_tag_update.md +2 -2
  133. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-empty-skeleton.mjs +105 -0
  134. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +669 -29
  135. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +21 -8
  136. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +28 -10
  137. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +66 -0
  138. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/generate-build-ir.mjs +285 -24
  139. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/package-wiki-source-zip.mjs +262 -30
  140. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/plan-kb-source-sync.mjs +1 -1
  141. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/precompiled-source.mjs +46 -2
  142. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/prepare-compile-schema.mjs +64 -0
  143. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/refresh-state-parts.mjs +91 -0
  144. package/skills/ae-automation/SKILL.md +16 -0
  145. package/skills/ae-automation/references/cli.md +53 -0
  146. package/skills/ae-automation/references/command_index.md +17 -0
  147. package/skills/ae-capability/SKILL.md +73 -2
  148. package/skills/ae-capability/references/collaboration.md +48 -0
  149. package/skills/ae-community/SKILL.md +5 -1
  150. package/skills/ae-community/references/collaboration.md +48 -0
  151. package/skills/ae-current-context/SKILL.md +3 -2
  152. package/skills/ae-data-integration/SKILL.md +4 -0
  153. package/skills/ae-data-integration/references/collaboration.md +48 -0
  154. package/skills/ae-dataops/SKILL.md +54 -74
  155. package/skills/ae-dataops/references/collaboration.md +48 -0
  156. package/skills/ae-dataops/references/dataops-backfill.md +23 -18
  157. package/skills/ae-dataops/references/dataops-flow-create.md +74 -23
  158. package/skills/ae-dataops/references/dataops-flow-monitor.md +45 -13
  159. package/skills/ae-dataops/references/dataops-integration.md +57 -30
  160. package/skills/ae-dataops/references/dataops-query.md +21 -4
  161. package/skills/ae-dataops/references/dataops-table.md +143 -11
  162. package/skills/ae-engage/SKILL.md +21 -6
  163. package/skills/ae-engage/references/channel-mgmt.md +3 -3
  164. package/skills/ae-engage/references/collaboration.md +48 -0
  165. package/skills/ae-engage/references/scene-config-channel.md +4 -4
  166. package/skills/ae-generate-tracking-plan/SKILL.md +4 -0
  167. package/skills/ae-generate-tracking-plan/references/collaboration.md +48 -0
  168. package/skills/ae-kb/SKILL.md +70 -12
  169. package/skills/ae-kb/references/analysis-workflow.md +73 -36
  170. package/skills/ae-kb/references/collaboration.md +48 -0
  171. package/skills/ae-kb/references/query-workflow.md +67 -33
  172. package/skills/ae-kb/references/schema-import.md +32 -0
  173. package/skills/ae-kb/references/source-mutations.md +6 -4
  174. package/skills/ae-kb/references/text-sources.md +53 -0
  175. package/skills/ae-kb-discovery/SKILL.md +8 -3
  176. package/skills/ae-kb-discovery/references/collaboration.md +48 -0
  177. package/skills/ae-metadata/SKILL.md +20 -12
  178. package/skills/ae-metadata/references/collaboration.md +48 -0
  179. package/skills/ae-team/SKILL.md +23 -17
  180. package/skills/ae-things/SKILL.md +85 -0
  181. package/skills/ae-things/references/cli.md +103 -0
  182. package/skills/ae-things-progress/SKILL.md +43 -0
  183. package/skills/ae-things-review/SKILL.md +42 -0
  184. package/skills/ae-workspace/SKILL.md +43 -0
  185. package/skills/ae-workspace/references/commands.md +51 -0
  186. package/dist/chunk-E2JKXMVO.js +0 -29
  187. package/dist/context-IFJI3LIT.js +0 -46
  188. package/dist/memory-QGPSNCQS.js +0 -892
  189. package/dist/project-semantic-3LF6Q6JZ.js +0 -1119
  190. package/skills/ae-agent/references/create-automation.md +0 -125
  191. package/skills/ae-agent/references/list-automations.md +0 -56
  192. package/skills/ae-agent/references/update-automation.md +0 -107
  193. package/skills/ae-project-semantic/SKILL.md +0 -193
  194. package/skills/ae-project-semantic/references/query-routing-v5.md +0 -165
  195. package/skills/ae-project-semantic/references/recommendation-quality.md +0 -68
package/dist/index.js CHANGED
@@ -14,54 +14,61 @@ import {
14
14
  validateAndFix,
15
15
  validateDraft,
16
16
  writeDraftXlsx
17
- } from "./chunk-4NRCTUZJ.js";
18
- import {
19
- getLocalCliPackageInfo
20
- } from "./chunk-E2JKXMVO.js";
17
+ } from "./chunk-5XJYLEVC.js";
18
+ import "./chunk-CT7QDJS6.js";
21
19
  import {
22
20
  requiresConfirmation
23
21
  } from "./chunk-AMBFK2K3.js";
24
- import "./chunk-DVMLWQD4.js";
25
- import "./chunk-EQ255HKO.js";
26
- import "./chunk-V2NUHPXF.js";
22
+ import "./chunk-AP7YP2NX.js";
23
+ import "./chunk-S6M42KND.js";
27
24
  import {
28
25
  TeAgentApiError,
29
26
  TeAgentCredentialsError
30
- } from "./chunk-HBGADCKA.js";
27
+ } from "./chunk-PLE722AJ.js";
31
28
  import {
32
29
  CapabilityGatewayError,
33
30
  executeCapability,
34
31
  uploadInputFileBytes
35
- } from "./chunk-HFGZGYCG.js";
32
+ } from "./chunk-EOYSKMXN.js";
36
33
  import {
37
34
  resolveHost
38
- } from "./chunk-JOCDD4ON.js";
35
+ } from "./chunk-7QXISROD.js";
39
36
  import {
37
+ failInstallation,
38
+ fetchCliConfig,
40
39
  formatCapabilityMissCompatHint,
40
+ getLocalCliPackageInfo,
41
+ installVersion,
42
+ newInstallationReport,
41
43
  printError,
42
44
  printOutput,
43
- runHostCompatCheck
44
- } from "./chunk-DX5CDO34.js";
45
+ resolveKbAutoDiscoveryFeature,
46
+ runHostCompatCheck,
47
+ shouldSkipAutoSync
48
+ } from "./chunk-KFNMQTZI.js";
45
49
  import "./chunk-Y74WTIKJ.js";
46
50
  import {
51
+ CredentialStoreUnreadableError,
47
52
  SecureStoreAuthError,
48
- getCliToken
49
- } from "./chunk-7XGFSUOM.js";
53
+ getCliToken,
54
+ peekCliToken
55
+ } from "./chunk-GIK6EDUG.js";
50
56
  import {
51
57
  getActiveHost,
52
58
  getConfigDir,
53
59
  safeJsonParse
54
- } from "./chunk-7FTTULED.js";
60
+ } from "./chunk-UQ77JXYH.js";
55
61
  import {
62
+ CliApiError,
56
63
  CliValidationError,
57
64
  CommunityReportError,
58
65
  LocalDataUploadError,
59
66
  PermissionError,
60
67
  logger
61
- } from "./chunk-MAPZ7VB6.js";
68
+ } from "./chunk-WNGFSIOB.js";
62
69
 
63
70
  // src/index.ts
64
- import { Command as CommanderCommand } from "commander";
71
+ import { Command as CommanderCommand, Option } from "commander";
65
72
  import { createRequire } from "module";
66
73
 
67
74
  // src/framework/runner.ts
@@ -73,6 +80,9 @@ function missingRequiredFlagsError(cmdName, missing) {
73
80
  const hint = hintParts.length > 0 ? hintParts.join(" ") : `Usage: ae-cli ${cmdName} ${names.map((name) => `${name} <value>`).join(" ")}`;
74
81
  return { message, hint };
75
82
  }
83
+ function canPromptForConfirmation(input = process.stdin, output = process.stderr) {
84
+ return input.isTTY === true && output.isTTY === true;
85
+ }
76
86
  function readSkillCurrentVersion(body) {
77
87
  if (!body || typeof body !== "object" || Array.isArray(body)) return void 0;
78
88
  const currentVersion = body.currentVersion;
@@ -202,6 +212,15 @@ async function runCommand(cmd, opts, globalOpts) {
202
212
  if (requiresConfirmation(cmd.risk)) {
203
213
  cmd.preflight?.(ctx);
204
214
  if (!globalOpts.yes) {
215
+ if (!canPromptForConfirmation()) {
216
+ throw new CliValidationError(
217
+ "Non-interactive high-risk writes require global --yes.",
218
+ {
219
+ code: "CONFIRMATION_REQUIRED",
220
+ hint: "After explicit authorization, retry with the global --yes flag."
221
+ }
222
+ );
223
+ }
205
224
  const confirmed = await confirm(`This is a high-risk-write operation (${cmdName}). Continue?`);
206
225
  if (!confirmed) {
207
226
  process.stderr.write("Aborted.\n");
@@ -231,28 +250,33 @@ async function runCommand(cmd, opts, globalOpts) {
231
250
  } else if (err instanceof TeAgentCredentialsError) {
232
251
  printError("config", message, err.hint);
233
252
  } else if (err instanceof PermissionError) {
234
- printError("permission", message, err.hint, err.code);
253
+ printError("permission", message, err.hint, err.code, void 0, { details: err.details });
254
+ } else if (err instanceof CliApiError) {
255
+ printError("api", message, err.hint, err.code, err.meta);
235
256
  } else if (err instanceof CapabilityGatewayError) {
236
257
  printError(err.type, message, err.hint ?? capabilityGatewayHint(err), err.code, err.meta);
237
258
  } else if (err instanceof CommunityReportError) {
238
259
  printError("api", message, err.hint, err.code, err.meta, { log: false });
239
260
  } else if (err instanceof LocalDataUploadError) {
240
261
  printError("api", message, err.hint, err.code, err.meta, { log: false });
262
+ } else if (err instanceof CredentialStoreUnreadableError) {
263
+ printError("config", message, err.hint, err.code);
241
264
  } else if (err instanceof SecureStoreAuthError) {
242
- printError("auth", message, "Run: ae-cli auth login");
265
+ printError("auth", message, "Run: ae-cli auth login", err.code);
243
266
  } else if (err instanceof TeAgentApiError) {
244
267
  if (err.status === 403) {
245
- printError("permission", message);
268
+ printError("permission", message, err.hint, err.code, void 0, { details: err.details });
246
269
  } else if (err.status === 401) {
247
- printError("auth", message, "Run: ae-cli auth login");
270
+ printError("auth", message, err.hint ?? "Run: ae-cli auth login", err.code, void 0, { details: err.details });
248
271
  } else {
249
272
  const presentation = teAgentApiErrorPresentation(err);
250
273
  printError(
251
- "api",
274
+ err.errorType,
252
275
  presentation.message ?? message,
253
- presentation.hint,
276
+ presentation.hint ?? err.hint,
254
277
  presentation.code ?? err.code,
255
- presentation.meta
278
+ presentation.meta,
279
+ { details: err.details }
256
280
  );
257
281
  }
258
282
  } else if (looksLikeAuthFailure(message)) {
@@ -302,14 +326,14 @@ function createRuntimeContext(cmd, opts, globalOpts) {
302
326
  let _communityReportModule = null;
303
327
  async function getCommunityReportClient() {
304
328
  if (!_communityReportModule) {
305
- _communityReportModule = await import("./community-report-client-CU22W53K.js");
329
+ _communityReportModule = await import("./community-report-client-PEERQCX2.js");
306
330
  }
307
331
  return _communityReportModule;
308
332
  }
309
333
  let _localDataUploadModule = null;
310
334
  async function getLocalDataUploadClient() {
311
335
  if (!_localDataUploadModule) {
312
- _localDataUploadModule = await import("./local-data-upload-client-GTRIT64F.js");
336
+ _localDataUploadModule = await import("./local-data-upload-client-TWMHFLUA.js");
313
337
  }
314
338
  return _localDataUploadModule;
315
339
  }
@@ -346,7 +370,7 @@ function createRuntimeContext(cmd, opts, globalOpts) {
346
370
  list(name) {
347
371
  const val = opts[camelCase(name)];
348
372
  if (Array.isArray(val)) return val.map(String);
349
- if (val === void 0 || val === null || val === "") return [];
373
+ if (val === void 0 || val === null) return [];
350
374
  return [String(val)];
351
375
  },
352
376
  async communityReport(endpoint, rawBody) {
@@ -357,6 +381,9 @@ function createRuntimeContext(cmd, opts, globalOpts) {
357
381
  const client = await getLocalDataUploadClient();
358
382
  return client.localDataUpload(endpoint, rawBody, options);
359
383
  },
384
+ hostOverride() {
385
+ return globalOpts.host;
386
+ },
360
387
  host() {
361
388
  if (globalOpts.host) return globalOpts.host;
362
389
  return getActiveHost();
@@ -368,7 +395,7 @@ function createRuntimeContext(cmd, opts, globalOpts) {
368
395
  return cmd.service;
369
396
  },
370
397
  async out(data) {
371
- await printOutput(data, globalOpts.format, globalOpts.jq);
398
+ await printOutput(data, globalOpts.format, globalOpts.jq, { redactErrors: cmd.sensitiveOutput });
372
399
  }
373
400
  };
374
401
  return ctx;
@@ -482,6 +509,20 @@ function extractGlobalOptions(program2) {
482
509
  };
483
510
  }
484
511
 
512
+ // src/core/feature-config-check.ts
513
+ async function runFeatureConfigCheck(hostOverride, argv = process.argv) {
514
+ if (shouldSkipAutoSync(argv) || argv.slice(2).some((arg) => arg === "--help" || arg === "-h" || arg === "--version" || arg === "-V")) return void 0;
515
+ try {
516
+ const host = hostOverride || getActiveHost();
517
+ if (!host) return void 0;
518
+ const token = peekCliToken(host);
519
+ if (!token) return void 0;
520
+ return await resolveKbAutoDiscoveryFeature(host, token, () => fetchCliConfig(host, token));
521
+ } catch {
522
+ return void 0;
523
+ }
524
+ }
525
+
485
526
  // src/commands/tracking/plan.ts
486
527
  import { readFile, writeFile, cp } from "fs/promises";
487
528
  import path2, { resolve as resolve2 } from "path";
@@ -1502,7 +1543,10 @@ async function detectProject(cwd) {
1502
1543
  // src/tracking/xlsx/read.ts
1503
1544
  import * as nodeFs from "fs";
1504
1545
  import path3 from "path";
1505
- set_fs(nodeFs);
1546
+ var setXlsxFs = set_fs;
1547
+ if (typeof setXlsxFs === "function") {
1548
+ setXlsxFs(nodeFs);
1549
+ }
1506
1550
  var VALID_PROP_TYPES = /* @__PURE__ */ new Set(["string", "number", "bool", "datetime", "object", "array_row", "array_string"]);
1507
1551
  var VALID_UPDATE_TYPES = /* @__PURE__ */ new Set(["user_set", "user_setOnce", "user_add", "user_append"]);
1508
1552
  function normalizeHeader(h) {
@@ -2258,7 +2302,13 @@ function getOrCreateCommand(parent, name, description) {
2258
2302
 
2259
2303
  // src/framework/program-lifecycle.ts
2260
2304
  async function parseProgram(program2, argv = process.argv) {
2261
- await program2.parseAsync(normalizeSubcommandVersionOption(program2, argv));
2305
+ try {
2306
+ await program2.parseAsync(normalizeSubcommandVersionOption(program2, argv));
2307
+ } catch (error) {
2308
+ if (!(error instanceof CredentialStoreUnreadableError)) throw error;
2309
+ printError("config", error.message, error.hint, error.code);
2310
+ process.exitCode = 1;
2311
+ }
2262
2312
  }
2263
2313
  function normalizeSubcommandVersionOption(program2, argv) {
2264
2314
  const normalized = [...argv];
@@ -2315,6 +2365,51 @@ function findOption(command, flag) {
2315
2365
  return void 0;
2316
2366
  }
2317
2367
 
2368
+ // src/commands/install.ts
2369
+ function registerInstall(program2) {
2370
+ program2.command("install").description("Install and verify this CLI distribution and its matching global Skills").option("--host <url>", "Check authentication for this AE host after installation").addHelpText("after", "\nExamples:\n npx @thinkingai/ae-cli@latest install\n ae-cli install --dry-run --format json\n ae-cli install --host https://your-ae-host.example.com\n\nSkills are installed globally in ~/.agents/skills with client adaptation handled automatically.\nGlobal options: --dry-run, --format json|table. Supports macOS, Linux, and native Windows.\n").action(async (opts) => {
2371
+ const pkg2 = getLocalCliPackageInfo();
2372
+ const global = program2.opts();
2373
+ const format = program2.getOptionValueSource("format") === "default" && process.stdout.isTTY ? "table" : global.format;
2374
+ let report = newInstallationReport(pkg2.name, pkg2.version, Boolean(global.dryRun));
2375
+ try {
2376
+ if (!["json", "table"].includes(format) || global.jq || global.validate) {
2377
+ throw new Error("Installation supports --format json|table and --dry-run; --jq and --validate are not supported.");
2378
+ }
2379
+ const result = installVersion(pkg2.version, {
2380
+ packageName: pkg2.name,
2381
+ host: opts.host || global.host,
2382
+ dryRun: global.dryRun,
2383
+ progress: (message) => process.stderr.write(`${message}
2384
+ `)
2385
+ });
2386
+ report = result.report ?? failInstallation(
2387
+ report,
2388
+ result.ok ? "environment" : result.stage,
2389
+ result.ok ? "Installation result is unavailable." : result.message,
2390
+ result.ok ? "unknown" : result.cause
2391
+ );
2392
+ } catch (error) {
2393
+ report = failInstallation(report, "environment", error instanceof Error ? error.message : "Installation failed.");
2394
+ }
2395
+ const output = format === "table" ? [
2396
+ report.dry_run ? "AE CLI installation plan (no changes)" : report.ok ? "AE CLI installation complete" : "AE CLI installation incomplete",
2397
+ `CLI: ${report.cli.package}@${report.cli.version} (${report.cli.verified ? "verified" : "not verified"})`,
2398
+ `Command: ${report.cli.path ?? "pending"}`,
2399
+ `Global Skills: ${report.skills.installed_count}/${report.skills.expected_count} verified in ${report.skills.directory}`,
2400
+ ...report.skills.failures.map((failure) => `- ${failure.skill}: ${failure.reason}`),
2401
+ ...report.cli.warnings,
2402
+ ...report.auth.warnings,
2403
+ ...report.error ? [report.error.message] : [],
2404
+ ...report.commands ?? [],
2405
+ ...report.next_steps
2406
+ ].join("\n") : JSON.stringify(report, null, 2);
2407
+ process.stdout.write(`${output}
2408
+ `);
2409
+ if (!report.ok) process.exitCode = 1;
2410
+ });
2411
+ }
2412
+
2318
2413
  // src/index.ts
2319
2414
  var require2 = createRequire(import.meta.url);
2320
2415
  var pkg = require2("../package.json");
@@ -2329,6 +2424,9 @@ program.name("ae-cli").version(version).description("CLI tool for ThinkingAI (AE
2329
2424
  "Optional: pre-execution preview without business logic (gateway /dry-run; other transports preview). Use alone to confirm a run; do not stack with --validate",
2330
2425
  false
2331
2426
  ).option("--yes", "Skip confirmation for high-risk write operations", false).option("--no-update-check", "Skip host compatibility checks", false);
2427
+ program.addOption(
2428
+ new Option("--agent-context <base64url-json>", "Internal agent context payload for gateway telemetry").hideHelp()
2429
+ );
2332
2430
  function warnLoadFailure(label, err) {
2333
2431
  const reason = err instanceof Error ? err.message : String(err);
2334
2432
  process.stderr.write(`warning: failed to load ${label}: ${reason}
@@ -2337,91 +2435,105 @@ function warnLoadFailure(label, err) {
2337
2435
  async function loadCommands() {
2338
2436
  const commands = [];
2339
2437
  try {
2340
- const teAnalysis = await import("./te-analysis-AISWCOOZ.js");
2438
+ const teAnalysis = await import("./te-analysis-2ECAAIFK.js");
2341
2439
  commands.push(...teAnalysis.default);
2342
2440
  } catch (err) {
2343
2441
  warnLoadFailure("domain te-analysis", err);
2344
2442
  }
2345
2443
  try {
2346
- const engage = await import("./te-engage-BAM3GBFX.js");
2444
+ const engage = await import("./te-engage-QKUGIWSR.js");
2347
2445
  commands.push(...engage.default);
2348
2446
  } catch (err) {
2349
2447
  warnLoadFailure("domain te-engage", err);
2350
2448
  }
2351
2449
  try {
2352
- const experiment = await import("./te-experiment-GUTZXZ5Z.js");
2450
+ const experiment = await import("./te-experiment-26PXR2UO.js");
2353
2451
  commands.push(...experiment.default);
2354
2452
  } catch (err) {
2355
2453
  warnLoadFailure("domain te-experiment", err);
2356
2454
  }
2357
2455
  try {
2358
- const community = await import("./te-community-4OYU3BDA.js");
2456
+ const community = await import("./te-community-PFLDLPP4.js");
2359
2457
  commands.push(...community.default);
2360
2458
  } catch (err) {
2361
2459
  warnLoadFailure("domain te-community", err);
2362
2460
  }
2363
2461
  try {
2364
- const dataops = await import("./te-dataops-NFIPB6FX.js");
2462
+ const dataops = await import("./te-dataops-FOQSRIAZ.js");
2365
2463
  commands.push(...dataops.default);
2366
2464
  } catch (err) {
2367
2465
  warnLoadFailure("domain te-dataops", err);
2368
2466
  }
2369
2467
  try {
2370
- const teKb = await import("./te-kb-3TS73NO6.js");
2468
+ const teKb = await import("./te-kb-MHDOST62.js");
2371
2469
  commands.push(...teKb.default);
2372
2470
  } catch (err) {
2373
2471
  warnLoadFailure("domain te-kb", err);
2374
2472
  }
2375
2473
  try {
2376
- const teTeam = await import("./te-team-3I5AOX3N.js");
2474
+ const teTeam = await import("./te-team-5UOZPTU3.js");
2377
2475
  commands.push(...teTeam.default);
2378
2476
  } catch (err) {
2379
2477
  warnLoadFailure("domain te-team", err);
2380
2478
  }
2381
2479
  try {
2382
- const teAgent = await import("./te-agent-K5MSPNHJ.js");
2480
+ const teAgent = await import("./te-agent-F5QBZSQA.js");
2383
2481
  commands.push(...teAgent.default);
2384
2482
  } catch (err) {
2385
2483
  warnLoadFailure("domain te-agent", err);
2386
2484
  }
2387
2485
  try {
2388
- const memory = await import("./memory-QGPSNCQS.js");
2486
+ const memory = await import("./memory-62BJOULV.js");
2389
2487
  commands.push(...memory.default);
2390
2488
  } catch (err) {
2391
2489
  warnLoadFailure("domain memory", err);
2392
2490
  }
2491
+ const automation = await import("./automation-NWWVLWG2.js");
2492
+ commands.push(...automation.default);
2493
+ try {
2494
+ const things = await import("./things-VPPXXLHB.js");
2495
+ commands.push(...things.default);
2496
+ } catch (err) {
2497
+ warnLoadFailure("domain things", err);
2498
+ }
2499
+ try {
2500
+ const workspace = await import("./workspace-O3EEIYQM.js");
2501
+ commands.push(...workspace.default);
2502
+ } catch (err) {
2503
+ warnLoadFailure("domain workspace", err);
2504
+ }
2393
2505
  try {
2394
- const teSystem = await import("./te-system-STMHLS5J.js");
2506
+ const teSystem = await import("./te-system-J2FQF5ER.js");
2395
2507
  commands.push(...teSystem.default);
2396
2508
  } catch (err) {
2397
2509
  warnLoadFailure("domain te-system", err);
2398
2510
  }
2399
2511
  try {
2400
- const metadata = await import("./metadata-DI5BMYFU.js");
2512
+ const metadata = await import("./metadata-C7CEDHOJ.js");
2401
2513
  commands.push(...metadata.default);
2402
2514
  } catch (err) {
2403
2515
  warnLoadFailure("domain metadata", err);
2404
2516
  }
2405
2517
  try {
2406
- const personalSemanticPreference = await import("./personal-semantic-preference-5C3WUXFI.js");
2518
+ const personalSemanticPreference = await import("./personal-semantic-preference-QECDPHND.js");
2407
2519
  commands.push(...personalSemanticPreference.default);
2408
2520
  } catch (err) {
2409
2521
  warnLoadFailure("domain personal-semantic-preference", err);
2410
2522
  }
2411
2523
  try {
2412
- const projectSemantic = await import("./project-semantic-3LF6Q6JZ.js");
2524
+ const projectSemantic = await import("./project-semantic-Z4QAMBWF.js");
2413
2525
  commands.push(...projectSemantic.default);
2414
2526
  } catch (err) {
2415
2527
  warnLoadFailure("domain project-semantic", err);
2416
2528
  }
2417
2529
  try {
2418
- const dataIntegration = await import("./data-integration-HNGUKFIC.js");
2530
+ const dataIntegration = await import("./data-integration-HESZET7E.js");
2419
2531
  commands.push(...dataIntegration.default);
2420
2532
  } catch (err) {
2421
2533
  warnLoadFailure("domain data-integration", err);
2422
2534
  }
2423
2535
  try {
2424
- const context = await import("./context-IFJI3LIT.js");
2536
+ const context = await import("./context-YAE3QXP3.js");
2425
2537
  commands.push(...context.default);
2426
2538
  } catch (err) {
2427
2539
  warnLoadFailure("domain context", err);
@@ -2430,7 +2542,7 @@ async function loadCommands() {
2430
2542
  }
2431
2543
  async function registerAuthCommands() {
2432
2544
  try {
2433
- const { registerAuth } = await import("./auth-XZNXFRJS.js");
2545
+ const { registerAuth } = await import("./auth-YHMC3GDH.js");
2434
2546
  registerAuth(program);
2435
2547
  } catch (err) {
2436
2548
  warnLoadFailure("auth commands", err);
@@ -2438,7 +2550,7 @@ async function registerAuthCommands() {
2438
2550
  }
2439
2551
  async function registerConfigCommands() {
2440
2552
  try {
2441
- const { registerConfig } = await import("./config-XO3LI3SA.js");
2553
+ const { registerConfig } = await import("./config-AHPMEW5A.js");
2442
2554
  registerConfig(program);
2443
2555
  } catch (err) {
2444
2556
  warnLoadFailure("config commands", err);
@@ -2446,7 +2558,7 @@ async function registerConfigCommands() {
2446
2558
  }
2447
2559
  async function registerCapabilityCommands() {
2448
2560
  try {
2449
- const { registerCapability } = await import("./capability-FYTU3X6L.js");
2561
+ const { registerCapability } = await import("./capability-3QLLIVFB.js");
2450
2562
  registerCapability(program);
2451
2563
  } catch (err) {
2452
2564
  warnLoadFailure("capability commands", err);
@@ -2454,7 +2566,7 @@ async function registerCapabilityCommands() {
2454
2566
  }
2455
2567
  async function registerSyncCommand() {
2456
2568
  try {
2457
- const { registerSync } = await import("./sync-O45NXEQY.js");
2569
+ const { registerSync } = await import("./sync-SU33KYX7.js");
2458
2570
  registerSync(program);
2459
2571
  } catch (err) {
2460
2572
  warnLoadFailure("sync commands", err);
@@ -2462,7 +2574,7 @@ async function registerSyncCommand() {
2462
2574
  }
2463
2575
  async function registerModelCommand() {
2464
2576
  try {
2465
- const { registerModel } = await import("./model-RNPQXIBI.js");
2577
+ const { registerModel } = await import("./model-SBV2JFJI.js");
2466
2578
  registerModel(program);
2467
2579
  } catch (err) {
2468
2580
  warnLoadFailure("model commands", err);
@@ -2470,7 +2582,7 @@ async function registerModelCommand() {
2470
2582
  }
2471
2583
  async function registerUpdateCommand() {
2472
2584
  try {
2473
- const { registerUpdate } = await import("./update-RZXLPCRH.js");
2585
+ const { registerUpdate } = await import("./update-EEUTEI6R.js");
2474
2586
  registerUpdate(program);
2475
2587
  } catch (err) {
2476
2588
  warnLoadFailure("update commands", err);
@@ -2503,6 +2615,7 @@ async function main() {
2503
2615
  return;
2504
2616
  }
2505
2617
  }
2618
+ await runFeatureConfigCheck(globalOptionValue(process.argv.slice(2), "--host"));
2506
2619
  const commands = await loadCommands();
2507
2620
  registerCommands(program, commands);
2508
2621
  await registerAuthCommands();
@@ -2511,6 +2624,7 @@ async function main() {
2511
2624
  await registerSyncCommand();
2512
2625
  await registerModelCommand();
2513
2626
  await registerUpdateCommand();
2627
+ registerInstall(program);
2514
2628
  registerTracking(program);
2515
2629
  rejectUnknownHelpCommandPath(program, process.argv.slice(2));
2516
2630
  await parseProgram(program);
@@ -2548,7 +2662,7 @@ function optionConsumesValue(token) {
2548
2662
  if (token.includes("=")) {
2549
2663
  return false;
2550
2664
  }
2551
- return token === "--host" || token === "--mcp-url" || token === "--format" || token === "--jq";
2665
+ return token === "--host" || token === "--mcp-url" || token === "--format" || token === "--jq" || token === "--agent-context";
2552
2666
  }
2553
2667
  function globalOptionValue(args, option) {
2554
2668
  for (let i = 0; i < args.length; i += 1) {
@@ -2568,7 +2682,7 @@ function isRootUpdateCommand(args) {
2568
2682
  }
2569
2683
  continue;
2570
2684
  }
2571
- return token === "update";
2685
+ return token === "update" || token === "install";
2572
2686
  }
2573
2687
  return false;
2574
2688
  }
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module'; const require =
2
2
  import {
3
3
  LocalDataUploadError,
4
4
  logger
5
- } from "./chunk-MAPZ7VB6.js";
5
+ } from "./chunk-WNGFSIOB.js";
6
6
 
7
7
  // src/core/local-data-upload-client.ts
8
8
  import { createHash } from "crypto";