@thinkingai/ae-cli 6.1.32 → 6.1.34

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 (119) hide show
  1. package/README.md +8 -5
  2. package/README.zh.md +10 -9
  3. package/bin/runtime-capabilities.json +1 -1
  4. package/cli-installation-guide.md +14 -4
  5. package/dist/{ai-monitor-MKMHSSNI.js → ai-monitor-TVRFVZBH.js} +11 -9
  6. package/dist/ai-monitor.js +18 -16
  7. package/dist/{auth-CZHHPZOQ.js → auth-JAXLMPBB.js} +33 -316
  8. package/dist/{automation-FLCPFMN4.js → automation-OQ647CSW.js} +7 -7
  9. package/dist/{capability-64KVJFIA.js → capability-2Z4ZXTPD.js} +19 -16
  10. package/dist/chunk-2H3SFJE3.js +344 -0
  11. package/dist/{chunk-TMQGS4TO.js → chunk-3PZNM5KN.js} +3 -3
  12. package/dist/chunk-3ZQY7SLZ.js +147 -0
  13. package/dist/chunk-6E6HCTP2.js +60 -0
  14. package/dist/{local-data-upload-client-KCMG6J62.js → chunk-6IUTXRAD.js} +32 -4
  15. package/dist/{chunk-5M5LBRR3.js → chunk-CYZV5AXW.js} +18 -9
  16. package/dist/{chunk-3ULDJJTZ.js → chunk-DE5XHQQ6.js} +2 -2
  17. package/dist/{chunk-FCAA7I2D.js → chunk-E5CJI7L3.js} +26 -10
  18. package/dist/{chunk-QVRIDN42.js → chunk-EQMGH32F.js} +2 -2
  19. package/dist/{chunk-DWBYNGSR.js → chunk-FNACCKQR.js} +372 -194
  20. package/dist/{chunk-OAWPT7VP.js → chunk-GD5JSAGV.js} +2 -2
  21. package/dist/{chunk-CF6JTT2U.js → chunk-GYODT7C4.js} +1 -1
  22. package/dist/chunk-HBI7IQH3.js +1207 -0
  23. package/dist/{chunk-4PSTYEG5.js → chunk-IGU3R2JD.js} +9 -5
  24. package/dist/{chunk-IDDWEZ7F.js → chunk-IWMDPHMI.js} +3 -3
  25. package/dist/{chunk-P7QDCWJ6.js → chunk-L7MT53VM.js} +8 -2
  26. package/dist/{chunk-F2VFZUGG.js → chunk-LXRALNNA.js} +2 -2
  27. package/dist/{chunk-6M7ZEDT2.js → chunk-M2OCZRVX.js} +14 -8
  28. package/dist/{chunk-Z3Q2AEIN.js → chunk-MTK4ZE7W.js} +17 -145
  29. package/dist/{chunk-T7WF4HYW.js → chunk-NK5PS5X7.js} +3 -3
  30. package/dist/{chunk-JEUXDY3B.js → chunk-NPH5J65M.js} +1 -1
  31. package/dist/chunk-PUSFEC6B.js +29 -0
  32. package/dist/{chunk-BNBCMCYN.js → chunk-Q764EZND.js} +78 -72
  33. package/dist/chunk-QOJXLXDJ.js +55 -0
  34. package/dist/{chunk-HVMCPKOZ.js → chunk-QPUPWGZ3.js} +1 -1
  35. package/dist/{chunk-72NJKS7O.js → chunk-RLPMXKDQ.js} +8921 -10119
  36. package/dist/{chunk-NLEXY2TM.js → chunk-S74XV3A6.js} +7 -5
  37. package/dist/{chunk-KTJXD27G.js → chunk-SHB7A2JE.js} +3 -3
  38. package/dist/{chunk-HTZ2MLYA.js → chunk-UWQXGF44.js} +25 -11
  39. package/dist/{data-integration-QE37EQ3A.js → chunk-V6UKLIM6.js} +160 -2258
  40. package/dist/{chunk-4XKTRCRK.js → chunk-VPLRZSMY.js} +22 -13
  41. package/dist/{chunk-2F64AZYH.js → chunk-Z6WSCIHM.js} +2 -2
  42. package/dist/{community-report-client-TJVCLZ3K.js → community-report-client-5VNT6HCV.js} +4 -2
  43. package/dist/{compat-check-ZJNCMNQV.js → compat-check-E7AQ7UCG.js} +6 -4
  44. package/dist/{config-FSH2NMNZ.js → config-PGSUWIK5.js} +16 -11
  45. package/dist/{context-YAQG6YQC.js → context-Y2A6QIS3.js} +9 -6
  46. package/dist/conversion-4FR3RA45.js +16 -0
  47. package/dist/data-integration-EIF5QHYF.js +2138 -0
  48. package/dist/{evaluation-2JSF4V47.js → evaluation-OZM54MES.js} +6 -5
  49. package/dist/index.js +79 -52
  50. package/dist/local-data-upload-client-2U3LFD7Z.js +16 -0
  51. package/dist/{memory-VEZZVAAP.js → memory-6QMZS4HF.js} +7 -7
  52. package/dist/{metadata-3IWHX3V4.js → metadata-7MZ3CJ2N.js} +11 -9
  53. package/dist/{model-T7H7Q6BG.js → model-LEYRQKOS.js} +8 -8
  54. package/dist/{personal-semantic-preference-YITU23SA.js → personal-semantic-preference-SWOUNDWJ.js} +46 -14
  55. package/dist/{project-semantic-MHEXJF3C.js → project-semantic-M2DDPAMD.js} +10 -8
  56. package/dist/{sync-AQHVCSPI.js → sync-PWC63JCO.js} +17 -16
  57. package/dist/{te-agent-RXI7WOH4.js → te-agent-S7UH657Z.js} +304 -16
  58. package/dist/{te-analysis-CZY74HVF.js → te-analysis-BK6PE333.js} +295 -223
  59. package/dist/{te-community-DKCYUBCM.js → te-community-OLNTKGCW.js} +17 -13
  60. package/dist/{te-dataops-QEH6VE56.js → te-dataops-XUWRIF5R.js} +18 -14
  61. package/dist/{te-engage-WK7WKDKF.js → te-engage-I3I4FJOM.js} +10 -8
  62. package/dist/{te-experiment-LH3RPIOE.js → te-experiment-XSDUL4KH.js} +216 -28
  63. package/dist/{te-kb-UPORIOVN.js → te-kb-QFH3YLFQ.js} +74 -21
  64. package/dist/{te-system-AL4B4XZL.js → te-system-DB5Z3LLF.js} +7 -7
  65. package/dist/{te-team-LLVTO2G4.js → te-team-UADF2HBO.js} +10 -8
  66. package/dist/{things-XLMLBYQR.js → things-G2QFXDK7.js} +10 -8
  67. package/dist/{update-7J5UQHSK.js → update-6I366ICW.js} +10 -9
  68. package/dist/web-runtime-3XFREWRF.js +2367 -0
  69. package/dist/{workspace-FF2HXJGR.js → workspace-RZESYB6T.js} +7 -7
  70. package/package.json +9 -5
  71. package/skills/ae-agent/SKILL.md +19 -5
  72. package/skills/ae-agent/references/a2a.md +103 -0
  73. package/skills/ae-agent/references/command_index.md +11 -0
  74. package/skills/ae-analysis/SKILL.md +35 -23
  75. package/skills/ae-analysis/references/analysis_data_retrieval.md +1 -1
  76. package/skills/ae-analysis/references/asset_authentication_export.md +1 -1
  77. package/skills/ae-analysis/references/asset_authentication_update.md +6 -2
  78. package/skills/ae-analysis/references/bad_case_review.md +4 -4
  79. package/skills/ae-analysis/references/command_index.md +7 -7
  80. package/skills/ae-analysis/references/governance_recommendation_export.md +2 -2
  81. package/skills/ae-analysis/references/personal_semantic_preference_add.md +9 -1
  82. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +2 -0
  83. package/skills/ae-analysis/references/personal_semantic_preference_get.md +2 -0
  84. package/skills/ae-analysis/references/personal_semantic_preference_list.md +10 -2
  85. package/skills/ae-analysis/references/personal_semantic_preference_update.md +8 -0
  86. package/skills/ae-analysis/references/project_owner_update.md +5 -1
  87. package/skills/ae-analysis/references/scenario_evaluation.md +17 -1
  88. package/skills/ae-analysis/references/scenario_list.md +5 -6
  89. package/skills/ae-capability/SKILL.md +8 -4
  90. package/skills/ae-data-integration/references/ue-mapping.md +2 -0
  91. package/skills/ae-experiment/SKILL.md +45 -16
  92. package/skills/ae-experiment/references/experiment_approval.md +87 -29
  93. package/skills/ae-experiment/references/manage_experiment.md +7 -3
  94. package/skills/ae-experiment/references/manage_traffic_domains.md +131 -0
  95. package/skills/ae-experiment/references/query_experiment_detail.md +8 -0
  96. package/skills/ae-experiment/references/query_experiment_list.md +6 -0
  97. package/skills/ae-experiment/references/save_experiment.md +39 -13
  98. package/skills/ae-experiment/references/save_metric.md +29 -2
  99. package/skills/ae-experiment/references/save_submit_experiment.md +11 -7
  100. package/skills/ae-experiment/references/save_submit_external_experiment.md +16 -14
  101. package/skills/ae-experiment/references/save_traffic_layer.md +17 -1
  102. package/skills/ae-kb/SKILL.md +4 -2
  103. package/skills/ae-kb/references/publication.md +45 -0
  104. package/skills/ae-onboarding/SKILL.md +64 -0
  105. package/skills/ae-onboarding/references/business-sdk.md +8 -0
  106. package/skills/ae-onboarding/references/demo-operations.md +79 -0
  107. package/skills/ae-onboarding/references/import.md +19 -0
  108. package/skills/ae-onboarding/references/onboarding_experiment_launch.md +12 -0
  109. package/skills/ae-onboarding/references/onboarding_experiment_plan.md +14 -0
  110. package/skills/ae-onboarding/references/onboarding_growth.md +36 -0
  111. package/skills/ae-onboarding/references/onboarding_run.md +11 -0
  112. package/skills/ae-onboarding/references/onboarding_status.md +5 -0
  113. package/skills/ae-onboarding/scripts/experiment-preset.json +252 -0
  114. package/skills/ae-onboarding/scripts/experiment-requests.mjs +120 -0
  115. package/skills/ae-onboarding/scripts/generate.mjs +170 -0
  116. package/skills/ae-onboarding/scripts/resolve-experiment-preset.mjs +26 -0
  117. package/skills/ae-onboarding/scripts/web-journey.mjs +39 -0
  118. package/dist/chunk-6ZIQV5GW.js +0 -26
  119. package/dist/chunk-Y74WTIKJ.js +0 -10
@@ -1,8 +1,11 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
- LocalDataUploadError,
4
3
  logger
5
- } from "./chunk-Z3Q2AEIN.js";
4
+ } from "./chunk-MTK4ZE7W.js";
5
+ import {
6
+ CliValidationError,
7
+ LocalDataUploadError
8
+ } from "./chunk-3ZQY7SLZ.js";
6
9
 
7
10
  // src/core/local-data-upload-client.ts
8
11
  import { createHash } from "crypto";
@@ -160,7 +163,32 @@ function logUpload(endpoint, status, requestBytes, responseBytes) {
160
163
  `LOCAL_DATA_UPLOAD target_sha256=${targetFingerprint} status=${status} request_bytes=${requestBytes} response_bytes=${responseBytes}`
161
164
  );
162
165
  }
166
+ function resolveSyncJsonEndpoint(raw) {
167
+ let url;
168
+ try {
169
+ url = new URL(raw.trim());
170
+ } catch {
171
+ throw endpointError();
172
+ }
173
+ const validProtocol = url.protocol === "http:" || url.protocol === "https:";
174
+ const forbidden = Boolean(url.username || url.password || url.search || url.hash);
175
+ if (!validProtocol || forbidden || !url.pathname.endsWith("/sync_json")) throw endpointError();
176
+ return url.toString();
177
+ }
178
+ function assembleSyncJsonBody(lines, appid, debug = false) {
179
+ const appidJson = JSON.stringify(appid);
180
+ const debugValue = debug ? 1 : 0;
181
+ return `[${lines.map((line) => `{"appid":${appidJson},"debug":${debugValue},"data":${line}}`).join(",")}]`;
182
+ }
183
+ function endpointError() {
184
+ return new CliValidationError("A complete http(s) receiver endpoint ending in /sync_json is required.", {
185
+ code: "LOCAL_DATA_ENDPOINT_INVALID",
186
+ location: { field: "endpoint" }
187
+ });
188
+ }
189
+
163
190
  export {
164
- LocalDataUploadError,
165
- localDataUpload
191
+ localDataUpload,
192
+ resolveSyncJsonEndpoint,
193
+ assembleSyncJsonBody
166
194
  };
@@ -1,20 +1,20 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
+ getCliToken,
3
4
  internalCallSourceHeaders
4
- } from "./chunk-Y74WTIKJ.js";
5
- import {
6
- getCliToken
7
- } from "./chunk-HTZ2MLYA.js";
5
+ } from "./chunk-UWQXGF44.js";
8
6
  import {
9
7
  getActiveHost,
10
8
  getSandboxRuntimeRoot
11
- } from "./chunk-4PSTYEG5.js";
9
+ } from "./chunk-IGU3R2JD.js";
12
10
  import {
13
- PermissionError,
14
11
  externalCliTokenRequestOptions,
15
- isApiErrorType,
16
12
  readExternalCliToken
17
- } from "./chunk-Z3Q2AEIN.js";
13
+ } from "./chunk-MTK4ZE7W.js";
14
+ import {
15
+ PermissionError,
16
+ isApiErrorType
17
+ } from "./chunk-3ZQY7SLZ.js";
18
18
 
19
19
  // src/core/te-agent-credentials.ts
20
20
  import { readFileSync } from "fs";
@@ -202,17 +202,20 @@ function teClaudeBaseFromActiveHost(hostOverride) {
202
202
  async function signRequest(method, path2, hostOverride, includeJsonContentType = true, authMode = "auto") {
203
203
  const external = readExternalCliToken(hostOverride);
204
204
  const configuredHost = hostOverride || getActiveHost();
205
- const sandboxOnly = !hostOverride && (/* @__PURE__ */ new Set([
205
+ const sandboxEndpoint = (/* @__PURE__ */ new Set([
206
206
  "/api/sandbox/models",
207
+ "/api/sandbox/onboarding/context",
207
208
  "/api/sandbox/models/select",
208
209
  "/api/sandbox/sync/push",
209
210
  "/api/sandbox/sync/push/skill",
210
211
  "/api/sandbox/sync/pull",
211
212
  "/api/sandbox/sync/pull/candidates"
212
213
  ])).has(path2.split("?")[0]);
214
+ const sandboxOnly = !hostOverride && sandboxEndpoint;
213
215
  const sandboxCred = external || configuredHost && !sandboxOnly ? null : tryLoadTeAgentSandboxCredentials();
214
216
  if (authMode === "auto" && !hostOverride && sandboxCred && sandboxCred.sandboxId && sandboxCred.sandboxSecretKey) {
215
217
  const headers = {
218
+ ...internalCallSourceHeaders(),
216
219
  "X-Sandbox-Id": sandboxCred.sandboxId,
217
220
  "X-Sandbox-Secret-Key": sandboxCred.sandboxSecretKey
218
221
  };
@@ -239,6 +242,12 @@ async function signRequest(method, path2, hostOverride, includeJsonContentType =
239
242
  url: `${baseUrl.replace(/\/$/, "")}${path2}`,
240
243
  headers: {
241
244
  "cli-token": cliToken,
245
+ ...sandboxEndpoint && external?.taskContext ? {
246
+ "X-Task-CLI-Grant": external.taskContext.grant,
247
+ "X-Task-CLI-Execution": external.taskContext.executionId,
248
+ "X-Task-CLI-Company": external.taskContext.companyId,
249
+ "X-Task-CLI-Sandbox": external.taskContext.sandboxId
250
+ } : {},
242
251
  ...internalCallSourceHeaders(),
243
252
  ...contentTypeHeader
244
253
  },
@@ -2,11 +2,11 @@ import { createRequire as __createRequire } from 'node:module'; const require =
2
2
  import {
3
3
  getPendingHostCompatNotice,
4
4
  getPendingUpdateNotice
5
- } from "./chunk-DWBYNGSR.js";
5
+ } from "./chunk-FNACCKQR.js";
6
6
  import {
7
7
  logger,
8
8
  redactExternalCliToken
9
- } from "./chunk-Z3Q2AEIN.js";
9
+ } from "./chunk-MTK4ZE7W.js";
10
10
 
11
11
  // src/framework/output.ts
12
12
  import Table from "cli-table3";
@@ -1,21 +1,25 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  CapabilityGatewayError
4
- } from "./chunk-4XKTRCRK.js";
4
+ } from "./chunk-VPLRZSMY.js";
5
5
  import {
6
6
  SecureStoreAuthError,
7
- getCliToken
8
- } from "./chunk-HTZ2MLYA.js";
7
+ getCliToken,
8
+ internalCallSourceHeaders
9
+ } from "./chunk-UWQXGF44.js";
9
10
  import {
10
11
  safeJsonParse
11
- } from "./chunk-4PSTYEG5.js";
12
+ } from "./chunk-IGU3R2JD.js";
12
13
  import {
13
- PermissionError,
14
14
  externalCliTokenRequestOptions,
15
15
  isKbQueryPath,
16
16
  kbReadHeaders,
17
+ readExternalCliToken,
17
18
  readKbExecutionContext
18
- } from "./chunk-Z3Q2AEIN.js";
19
+ } from "./chunk-MTK4ZE7W.js";
20
+ import {
21
+ PermissionError
22
+ } from "./chunk-3ZQY7SLZ.js";
19
23
 
20
24
  // src/core/mcp-access.ts
21
25
  function buildUrl(host, path, params = {}) {
@@ -174,6 +178,7 @@ function parseKbResponse(resp, text, options = {}) {
174
178
  async function fetchWithCliToken(input, init, cliToken, options = {}) {
175
179
  const headers = new Headers(init.headers);
176
180
  headers.set("cli-token", cliToken);
181
+ for (const [name, value] of Object.entries(internalCallSourceHeaders())) headers.set(name, value);
177
182
  const resp = await fetch(input, { ...init, headers, ...externalCliTokenRequestOptions(input) });
178
183
  if (options.responseType === "empty" && resp.status === 204) return null;
179
184
  if (options.responseType === "bytes" && resp.ok) {
@@ -218,19 +223,20 @@ async function requestWithCliToken(host, input, init, options) {
218
223
  }
219
224
  async function getAuthHeaders(ctx) {
220
225
  const cliToken = await getCliToken(ctx.host());
221
- return { "cli-token": cliToken };
226
+ return { "cli-token": cliToken, ...internalCallSourceHeaders() };
222
227
  }
223
228
  async function kbApi(ctx, method, path, params = {}, body, options = {}) {
224
229
  const upperMethod = method.toUpperCase();
230
+ const isAsk = upperMethod === "POST" && /^\/(?:agent\/)?api\/external\/knowledge-bases\/ask$/.test(path);
225
231
  const isQuery = isKbQueryPath(upperMethod, path);
226
232
  const execution = isQuery ? readKbExecutionContext() : void 0;
227
233
  const host = execution ? ctx.hostOverride?.() || execution.origin : ctx.host();
228
234
  const selectedHost = execution && !ctx.hostOverride ? ctx.host() : host;
229
235
  const url = buildUrl(selectedHost, path, params);
230
- const queryHeaders = isQuery ? kbReadHeaders(url, ctx.str("read-context")) : void 0;
236
+ const queryHeaders = isQuery || isAsk && ctx.str("read-context") ? kbReadHeaders(url, ctx.str("read-context")) : void 0;
231
237
  const init = {
232
238
  method: upperMethod,
233
- headers: { "Content-Type": "application/json", ...queryHeaders },
239
+ headers: { "Content-Type": "application/json", ...queryHeaders, ...internalCallSourceHeaders() },
234
240
  body: upperMethod === "GET" ? void 0 : JSON.stringify(body ?? {})
235
241
  };
236
242
  if (execution) {
@@ -240,13 +246,23 @@ async function kbApi(ctx, method, path, params = {}, body, options = {}) {
240
246
  let code = "KB_READ_CONTEXT_REQUEST_FAILED";
241
247
  try {
242
248
  const value = responseErrorMetadata(safeJsonParse(text)).code;
243
- if (value?.startsWith("KB_READ_CONTEXT_")) code = value;
249
+ if (value && /^KB_(READ_CONTEXT|CANDIDATE)_/.test(value)) code = value;
244
250
  } catch {
245
251
  }
246
252
  throw new KbHttpError(code, code, response.status);
247
253
  }
248
254
  return parseKbResponse(response, text, { ...options, redactErrorDetails: true });
249
255
  }
256
+ if (upperMethod === "POST" && /^\/(?:agent\/)?api\/external\/knowledge-bases\/(read|grep|index)$/.test(path)) {
257
+ const task = readExternalCliToken(host)?.taskContext;
258
+ if (task) init.headers = {
259
+ ...init.headers,
260
+ "X-Task-CLI-Grant": task.grant,
261
+ "X-Task-CLI-Execution": task.executionId,
262
+ "X-Task-CLI-Company": task.companyId,
263
+ "X-Task-CLI-Sandbox": task.sandboxId
264
+ };
265
+ }
250
266
  return requestWithCliToken(
251
267
  host,
252
268
  url,
@@ -5,11 +5,11 @@ import {
5
5
  require_node,
6
6
  require_process_nextick_args,
7
7
  require_util
8
- } from "./chunk-JEUXDY3B.js";
8
+ } from "./chunk-NPH5J65M.js";
9
9
  import {
10
10
  __commonJS,
11
11
  __require
12
- } from "./chunk-Z3Q2AEIN.js";
12
+ } from "./chunk-3ZQY7SLZ.js";
13
13
 
14
14
  // node_modules/jszip/node_modules/readable-stream/lib/internal/streams/stream.js
15
15
  var require_stream = __commonJS({