@thinkingai/ae-cli 6.1.18 → 6.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +97 -38
  2. package/README.zh.md +101 -38
  3. package/dist/{auth-ROB2EDYV.js → auth-FUM37MHF.js} +241 -126
  4. package/dist/{capability-DKMYUTLC.js → capability-AXFQW5WM.js} +49 -35
  5. package/dist/{chunk-JHENBQ5B.js → chunk-4P355ZWB.js} +70 -1
  6. package/dist/chunk-6ZIQV5GW.js +26 -0
  7. package/dist/{chunk-TUKQZTMI.js → chunk-7K24F7T2.js} +2 -0
  8. package/dist/{chunk-OO6XR6LK.js → chunk-AMBFK2K3.js} +2 -0
  9. package/dist/chunk-ATSM5XAW.js +623 -0
  10. package/dist/{chunk-4XXOWOTA.js → chunk-BBEFP4SB.js} +31 -38
  11. package/dist/{chunk-BYYS3ANB.js → chunk-CZU3V3DQ.js} +5 -15
  12. package/dist/{chunk-VTWMIC5L.js → chunk-E2JKXMVO.js} +2 -0
  13. package/dist/chunk-ECBLHAZO.js +15 -0
  14. package/dist/{sync-HKIOZXQE.js → chunk-I4WQAEYB.js} +31 -540
  15. package/dist/{chunk-DWO43OIB.js → chunk-JQ3ENZZH.js} +2 -0
  16. package/dist/chunk-LNZBEQXW.js +25216 -0
  17. package/dist/{chunk-ZQ47LWTI.js → chunk-QJQZH5GQ.js} +49 -79
  18. package/dist/{chunk-QZ3AS4KK.js → chunk-RSG4ONOI.js} +9 -8
  19. package/dist/{chunk-4NN5IWVN.js → chunk-T6OSFQZD.js} +2 -0
  20. package/dist/{chunk-Y3LOALAV.js → chunk-TAL6CZH6.js} +8 -7
  21. package/dist/{chunk-3KWQYGYI.js → chunk-TKHSULJT.js} +2 -0
  22. package/dist/chunk-VXNMYUXU.js +202 -0
  23. package/dist/{chunk-3FY3RJ26.js → chunk-WZ6YVQSF.js} +15 -14
  24. package/dist/{chunk-6EIJSNBD.js → chunk-Y74WTIKJ.js} +2 -0
  25. package/dist/{community-report-client-C7WDGET3.js → community-report-client-XXWGSBSD.js} +3 -4
  26. package/dist/{config-BMYZX2UE.js → config-EXUGQN5T.js} +10 -10
  27. package/dist/{data-integration-QEKDWQDY.js → data-integration-4NZ53OMT.js} +920 -97
  28. package/dist/index.js +56 -81
  29. package/dist/{local-data-upload-client-4YYHSYD6.js → local-data-upload-client-KYOKVYZV.js} +3 -4
  30. package/dist/{memory-I2WXDTV2.js → memory-ATNKZNW5.js} +6 -7
  31. package/dist/{metadata-I4C2EWUN.js → metadata-VZVC7YMH.js} +10 -11
  32. package/dist/{model-HLHIEFMU.js → model-E4JMQ4V2.js} +8 -9
  33. package/dist/{personal-semantic-preference-LIPACBDX.js → personal-semantic-preference-7S2SQ3UV.js} +9 -10
  34. package/dist/{project-semantic-RT3R2VQD.js → project-semantic-2SZP2OPO.js} +13 -14
  35. package/dist/sync-YV3E66IF.js +520 -0
  36. package/dist/{te-agent-BR6VDBNX.js → te-agent-JB5T3PO7.js} +396 -92
  37. package/dist/{te-analysis-7VUNUYWZ.js → te-analysis-3YJAAT2D.js} +196 -43
  38. package/dist/{te-community-5DMNKJWY.js → te-community-UDBI672N.js} +12 -34
  39. package/dist/{te-dataops-6P5IKWNJ.js → te-dataops-ZLYOCXZ4.js} +480 -81
  40. package/dist/{te-engage-KZPR5R22.js → te-engage-4XG6OJML.js} +88 -16
  41. package/dist/{te-experiment-6BITX4RD.js → te-experiment-VXUWPINJ.js} +83 -12
  42. package/dist/te-kb-WYQWHFSC.js +1732 -0
  43. package/dist/{te-system-FXITO2JG.js → te-system-7G6F2LJA.js} +569 -35
  44. package/dist/{te-team-ADOC2ROP.js → te-team-E7FBBXMQ.js} +8 -7
  45. package/dist/{update-YCYCKJOO.js → update-D47BUG25.js} +8 -8
  46. package/package.json +22 -10
  47. package/skills/ae-agent/SKILL.md +30 -13
  48. package/skills/ae-agent/references/agent-distribution.md +94 -0
  49. package/skills/ae-agent/references/approval-request.md +4 -0
  50. package/skills/ae-agent/references/command_index.md +9 -2
  51. package/skills/ae-agent/references/create-automation.md +20 -2
  52. package/skills/ae-agent/references/get-agent-context.md +70 -0
  53. package/skills/ae-agent/references/list-automations.md +18 -3
  54. package/skills/ae-agent/references/list-mcp-credentials.md +1 -1
  55. package/skills/ae-agent/references/mcp-token.md +3 -3
  56. package/skills/ae-agent/references/set-mcp-credential.md +0 -1
  57. package/skills/ae-agent/references/update-automation.md +18 -0
  58. package/skills/ae-analysis/SKILL.md +11 -2
  59. package/skills/ae-analysis/references/adhoc_run.md +2 -0
  60. package/skills/ae-analysis/references/ai_models.md +23 -3
  61. package/skills/ae-analysis/references/analysis_gateway_assets.md +3 -3
  62. package/skills/ae-analysis/references/audience_models.md +18 -0
  63. package/skills/ae-analysis/references/command_index.md +9 -9
  64. package/skills/ae-analysis/references/cross_source_config.md +84 -0
  65. package/skills/ae-analysis/references/dashboard_update.md +1 -1
  66. package/skills/ae-analysis/references/project_timezone_update.md +13 -4
  67. package/skills/ae-analysis/references/property_create.md +2 -0
  68. package/skills/ae-analysis/references/super_metadata_batch_create.md +2 -0
  69. package/skills/ae-analysis/references/user_cluster_models.md +2 -0
  70. package/skills/ae-analysis/references/user_cluster_update.md +8 -4
  71. package/skills/ae-analysis/references/user_tag_create.md +30 -2
  72. package/skills/ae-analysis/references/user_tag_models.md +17 -3
  73. package/skills/ae-analysis/references/user_tag_update.md +14 -2
  74. package/skills/ae-data-integration/SKILL.md +3 -1
  75. package/skills/ae-data-integration/references/dimension-routing.md +36 -0
  76. package/skills/ae-data-integration/references/error-handling.md +54 -1
  77. package/skills/ae-data-integration/references/local-analysis.md +2 -0
  78. package/skills/ae-data-integration/references/source-inspect.md +18 -2
  79. package/skills/ae-data-integration/references/tracking-plan.md +1 -1
  80. package/skills/ae-data-integration/references/transform.md +4 -2
  81. package/skills/ae-data-integration/references/ue-mapping.md +5 -2
  82. package/skills/ae-data-integration/references/ue-routing.md +40 -1
  83. package/skills/ae-dataops/SKILL.md +11 -1
  84. package/skills/ae-dataops/references/dataops-backfill.md +135 -0
  85. package/skills/ae-engage/SKILL.md +5 -0
  86. package/skills/ae-engage/references/build-task-save-guide.md +5 -1
  87. package/skills/ae-engage/references/save-flow.md +37 -1
  88. package/skills/ae-engage/references/save-task.md +6 -0
  89. package/skills/ae-experiment/SKILL.md +6 -2
  90. package/skills/ae-experiment/references/save_metric.md +20 -8
  91. package/skills/ae-generate-tracking-plan/SKILL.md +25 -13
  92. package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +1 -1
  93. package/skills/ae-kb/SKILL.md +218 -36
  94. package/skills/ae-kb/references/query-workflow.md +59 -29
  95. package/skills/ae-kb/references/versions.md +46 -0
  96. package/skills/ae-system/SKILL.md +29 -31
  97. package/skills/ae-system/references/channel-management.md +303 -0
  98. package/skills/ae-use-agent/SKILL.md +42 -0
  99. package/skills/ae-use-agent/references/local-agent.md +114 -0
  100. package/dist/auth-GBMV6TEJ.js +0 -14
  101. package/dist/capability-HYVVPG25.js +0 -352
  102. package/dist/chunk-EFH4XWYC.js +0 -556
  103. package/dist/chunk-J2DEBMRF.js +0 -313
  104. package/dist/chunk-JRJY5DMJ.js +0 -71
  105. package/dist/chunk-OMPRXM3V.js +0 -349
  106. package/dist/chunk-QNOLN2LJ.js +0 -509
  107. package/dist/chunk-RJDU7NYP.js +0 -1198
  108. package/dist/chunk-RNAALWJK.js +0 -98
  109. package/dist/chunk-SERWF6G5.js +0 -13
  110. package/dist/chunk-UW5UN47B.js +0 -70
  111. package/dist/chunk-ZQKDZXDO.js +0 -317
  112. package/dist/client-L2YDMHQ6.js +0 -203
  113. package/dist/memory-3ORCR7JH.js +0 -893
  114. package/dist/metadata-VUOQJE26.js +0 -339
  115. package/dist/model-UGRDX4MW.js +0 -139
  116. package/dist/personal-semantic-preference-OEISBRHM.js +0 -239
  117. package/dist/project-semantic-FFPWFPIW.js +0 -1114
  118. package/dist/sync-TFHU2UTG.js +0 -10261
  119. package/dist/te-agent-VLYOV7S4.js +0 -3894
  120. package/dist/te-analysis-4YGQL5RC.js +0 -9357
  121. package/dist/te-community-ISDQWJU7.js +0 -1859
  122. package/dist/te-dataops-CVULXNVB.js +0 -2209
  123. package/dist/te-engage-N5WI32H6.js +0 -4898
  124. package/dist/te-experiment-UVR4HLND.js +0 -988
  125. package/dist/te-kb-RCLSSH2Q.js +0 -935
  126. package/dist/te-system-K2GYMCTB.js +0 -2213
  127. package/skills/ae-agent/references/auto-provision-mcp-credentials.md +0 -57
@@ -1,17 +1,17 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
1
2
  import {
2
3
  internalCallSourceHeaders
3
- } from "./chunk-SERWF6G5.js";
4
+ } from "./chunk-Y74WTIKJ.js";
4
5
  import {
5
- clearCliToken,
6
6
  getCliToken
7
- } from "./chunk-J2DEBMRF.js";
7
+ } from "./chunk-ATSM5XAW.js";
8
8
  import {
9
9
  getActiveHost,
10
10
  getSandboxRuntimeRoot
11
- } from "./chunk-3FY3RJ26.js";
11
+ } from "./chunk-WZ6YVQSF.js";
12
12
  import {
13
13
  PermissionError
14
- } from "./chunk-UW5UN47B.js";
14
+ } from "./chunk-4P355ZWB.js";
15
15
 
16
16
  // src/core/te-agent-credentials.ts
17
17
  import { readFileSync } from "fs";
@@ -108,6 +108,17 @@ import { open, unlink } from "fs/promises";
108
108
  import path from "path";
109
109
  import { Readable } from "stream";
110
110
  import { pipeline } from "stream/promises";
111
+
112
+ // src/core/te-claude-base-url.ts
113
+ function resolveTeClaudeBaseUrl(host) {
114
+ const base = host.replace(/\/+$/, "");
115
+ const configured = (process.env.TE_CLAUDE_BASE_PATH ?? process.env.AE_API_PREFIX ?? "/agent").trim();
116
+ const path2 = configured.replace(/^\/+|\/+$/g, "");
117
+ const basePath = path2 ? `/${path2}` : "";
118
+ return basePath && !base.endsWith(basePath) ? `${base}${basePath}` : base;
119
+ }
120
+
121
+ // src/core/te-agent-client.ts
111
122
  var TeAgentApiError = class extends Error {
112
123
  constructor(message, status, code, body) {
113
124
  super(message);
@@ -169,9 +180,7 @@ function teClaudeBaseFromActiveHost(hostOverride) {
169
180
  if (override) return override.replace(/\/+$/, "");
170
181
  const h = hostOverride || getActiveHost();
171
182
  if (!h) return void 0;
172
- const base = h.replace(/\/+$/, "");
173
- const bp = process.env.TE_CLAUDE_BASE_PATH || "/agent";
174
- return base.endsWith(bp) ? base : base + bp;
183
+ return resolveTeClaudeBaseUrl(h);
175
184
  }
176
185
  async function signRequest(method, path2, hostOverride, includeJsonContentType = true) {
177
186
  const sandboxCred = tryLoadTeAgentSandboxCredentials();
@@ -210,34 +219,22 @@ async function signRequest(method, path2, hostOverride, includeJsonContentType =
210
219
  tokenHost: hostForToken
211
220
  };
212
221
  }
213
- async function fetchSignedWithRetry(options) {
214
- let signed = await signRequest(
222
+ async function fetchSigned(options) {
223
+ const signed = await signRequest(
215
224
  options.method,
216
225
  options.path,
217
226
  options.hostOverride,
218
227
  options.includeJsonContentType
219
228
  );
220
- const request = (requestToSend) => fetchWithTimeout(
221
- requestToSend.url,
229
+ return fetchWithTimeout(
230
+ signed.url,
222
231
  {
223
232
  method: options.method,
224
- headers: requestToSend.headers,
233
+ headers: signed.headers,
225
234
  body: options.body
226
235
  },
227
236
  options.timeoutMs
228
237
  );
229
- let response = await request(signed);
230
- if (response.status === 401 && signed.authKind === "cli-token" && signed.tokenHost) {
231
- clearCliToken(signed.tokenHost);
232
- signed = await signRequest(
233
- options.method,
234
- options.path,
235
- options.hostOverride,
236
- options.includeJsonContentType
237
- );
238
- response = await request(signed);
239
- }
240
- return response;
241
238
  }
242
239
  function errorDetails(parsed, defaultErrorPrefix, status) {
243
240
  const nested = parsed && typeof parsed === "object" && parsed.error && typeof parsed.error === "object" ? parsed.error : parsed;
@@ -275,7 +272,7 @@ async function parseResponse(response, defaultErrorPrefix) {
275
272
  }
276
273
  async function postToMainApp(path2, body, hostOverride) {
277
274
  const rawBody = JSON.stringify(body);
278
- const response = await fetchSignedWithRetry({
275
+ const response = await fetchSigned({
279
276
  method: "POST",
280
277
  path: path2,
281
278
  body: rawBody,
@@ -284,7 +281,7 @@ async function postToMainApp(path2, body, hostOverride) {
284
281
  return parseResponse(response, "Main app returned");
285
282
  }
286
283
  async function getFromMainApp(path2, hostOverride) {
287
- const response = await fetchSignedWithRetry({
284
+ const response = await fetchSigned({
288
285
  method: "GET",
289
286
  path: path2,
290
287
  hostOverride
@@ -318,7 +315,7 @@ async function postSandboxSyncPull(args) {
318
315
  });
319
316
  }
320
317
  async function deleteFromMainApp(path2, hostOverride) {
321
- const response = await fetchSignedWithRetry({
318
+ const response = await fetchSigned({
322
319
  method: "DELETE",
323
320
  path: path2,
324
321
  hostOverride
@@ -327,7 +324,7 @@ async function deleteFromMainApp(path2, hostOverride) {
327
324
  }
328
325
  async function patchToMainApp(path2, body, hostOverride) {
329
326
  const rawBody = JSON.stringify(body);
330
- const response = await fetchSignedWithRetry({
327
+ const response = await fetchSigned({
331
328
  method: "PATCH",
332
329
  path: path2,
333
330
  body: rawBody,
@@ -337,7 +334,7 @@ async function patchToMainApp(path2, body, hostOverride) {
337
334
  }
338
335
  async function putToMainApp(path2, body, hostOverride) {
339
336
  const rawBody = JSON.stringify(body);
340
- const response = await fetchSignedWithRetry({
337
+ const response = await fetchSigned({
341
338
  method: "PUT",
342
339
  path: path2,
343
340
  body: rawBody,
@@ -346,7 +343,7 @@ async function putToMainApp(path2, body, hostOverride) {
346
343
  return parseResponse(response, "Main app returned");
347
344
  }
348
345
  async function getBufferFromMainApp(path2, hostOverride) {
349
- const response = await fetchSignedWithRetry({
346
+ const response = await fetchSigned({
350
347
  method: "GET",
351
348
  path: path2,
352
349
  hostOverride
@@ -410,7 +407,7 @@ async function downloadFromMainApp(requestPath, outputPath, hostOverride) {
410
407
  "OUTPUT_ERROR"
411
408
  );
412
409
  }
413
- let signed = await signRequest("GET", requestPath, hostOverride);
410
+ const signed = await signRequest("GET", requestPath, hostOverride);
414
411
  let response;
415
412
  const request = async (requestToSend) => {
416
413
  try {
@@ -431,11 +428,6 @@ async function downloadFromMainApp(requestPath, outputPath, hostOverride) {
431
428
  }
432
429
  };
433
430
  response = await request(signed);
434
- if (response.status === 401 && signed.authKind === "cli-token" && signed.tokenHost) {
435
- clearCliToken(signed.tokenHost);
436
- signed = await signRequest("GET", requestPath, hostOverride);
437
- response = await request(signed);
438
- }
439
431
  if (!response.ok) {
440
432
  await parseResponse(response, "Main app returned");
441
433
  }
@@ -478,7 +470,7 @@ async function downloadFromMainApp(requestPath, outputPath, hostOverride) {
478
470
  }
479
471
  }
480
472
  async function uploadToMainApp(path2, formData, hostOverride) {
481
- const response = await fetchSignedWithRetry({
473
+ const response = await fetchSigned({
482
474
  method: "POST",
483
475
  path: path2,
484
476
  body: formData,
@@ -493,6 +485,7 @@ export {
493
485
  TeAgentCredentialsError,
494
486
  tryLoadTeAgentSandboxCredentials,
495
487
  getClaudeConfigDir,
488
+ resolveTeClaudeBaseUrl,
496
489
  TeAgentApiError,
497
490
  postToMainApp,
498
491
  getFromMainApp,
@@ -1,18 +1,16 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
1
2
  import {
2
3
  peekCliToken
3
- } from "./chunk-J2DEBMRF.js";
4
- import {
5
- getToken
6
- } from "./chunk-ZQKDZXDO.js";
4
+ } from "./chunk-ATSM5XAW.js";
7
5
  import {
8
6
  getActiveHost,
9
7
  getConfigDir,
10
8
  isAeSandboxRuntime,
11
9
  normalizeUrl
12
- } from "./chunk-3FY3RJ26.js";
10
+ } from "./chunk-WZ6YVQSF.js";
13
11
  import {
14
12
  logger
15
- } from "./chunk-JHENBQ5B.js";
13
+ } from "./chunk-4P355ZWB.js";
16
14
 
17
15
  // src/core/version-sync.ts
18
16
  import { spawnSync } from "child_process";
@@ -649,20 +647,12 @@ function shouldSkipAutoSync(argv = process.argv) {
649
647
  async function fetchCliConfig(host, cliToken) {
650
648
  const url = new URL(CLI_CONFIG_PATH, host.endsWith("/") ? host : `${host}/`);
651
649
  url.searchParams.set("cli-token", cliToken);
652
- const headers = { Accept: "application/json" };
653
- try {
654
- const accessToken = await getToken(host);
655
- if (accessToken) {
656
- headers.Authorization = `bearer ${accessToken}`;
657
- }
658
- } catch {
659
- }
660
650
  const controller = new AbortController();
661
651
  const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
662
652
  try {
663
653
  const resp = await fetch(url.toString(), {
664
654
  signal: controller.signal,
665
- headers
655
+ headers: { Accept: "application/json" }
666
656
  });
667
657
  if (!resp.ok) return null;
668
658
  const body = await resp.json();
@@ -1,3 +1,5 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+
1
3
  // src/core/package-info.ts
2
4
  import fs from "fs";
3
5
  import path from "path";
@@ -0,0 +1,15 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ getActiveHost,
4
+ normalizeUrl
5
+ } from "./chunk-WZ6YVQSF.js";
6
+
7
+ // src/core/auth.ts
8
+ function resolveHost(hostOverride) {
9
+ if (hostOverride) return normalizeUrl(hostOverride);
10
+ return getActiveHost();
11
+ }
12
+
13
+ export {
14
+ resolveHost
15
+ };