@thinkingai/ae-cli 6.0.36 → 6.0.37

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 (34) hide show
  1. package/README.md +216 -150
  2. package/README.zh.md +224 -159
  3. package/dist/{auth-B2BRSYMS.js → auth-56Z45UVR.js} +1 -1
  4. package/dist/{capability-6KPXYNO7.js → capability-2H6PAOA3.js} +1 -1
  5. package/dist/{capability-ROKYESAP.js → capability-YPOQX6PL.js} +1 -1
  6. package/dist/{chunk-JTKMDN4A.js → chunk-KTYR3U6D.js} +471 -31
  7. package/dist/{chunk-EBPXT3TN.js → chunk-LHVM35J4.js} +1 -1
  8. package/dist/{chunk-RRFK2W7I.js → chunk-PVBYJWC2.js} +1 -1
  9. package/dist/{config-DDYJPJX3.js → config-BSSALXEN.js} +1 -1
  10. package/dist/index.js +44 -14
  11. package/dist/{metadata-2ZFRMVOL.js → metadata-AN3YFZEV.js} +2 -2
  12. package/dist/{metadata-ABQCKU5P.js → metadata-JIQ77HFY.js} +2 -2
  13. package/dist/{raw-6HXFFHLV.js → raw-XJCAT3HX.js} +1 -1
  14. package/dist/{sync-BF3IWYFC.js → sync-QFP4XFN3.js} +1 -1
  15. package/dist/{te-agent-3GJ5H2XF.js → te-agent-JHUG6DVV.js} +27 -0
  16. package/dist/{te-analysis-PCGESPLW.js → te-analysis-IWQZO423.js} +2 -2
  17. package/dist/{te-analysis-DJ6KELTU.js → te-analysis-X222IRYR.js} +2 -2
  18. package/dist/{te-dataops-ROHUJOX5.js → te-dataops-PZQ5NQLY.js} +1 -1
  19. package/dist/{te-dataops-LXL5YULV.js → te-dataops-XTWVTJCA.js} +1 -1
  20. package/dist/{te-engage-2YDCA552.js → te-engage-E7F4HTXU.js} +2 -2
  21. package/dist/{te-engage-VW6NJZ5V.js → te-engage-NLZUPSBK.js} +2 -2
  22. package/dist/{te-team-RRZI4WRI.js → te-team-BQ3SKSZV.js} +1 -1
  23. package/dist/{update-ER7VFU55.js → update-DKG6UXEM.js} +44 -22
  24. package/package.json +4 -3
  25. package/skills/ae-agent/SKILL.md +2 -2
  26. package/skills/ae-agent/references/create-automation.md +11 -0
  27. package/skills/ae-agent/references/update-automation.md +11 -3
  28. package/skills/ae-generate-tracking-code/SKILL.md +5 -5
  29. package/skills/ae-generate-tracking-code/references/autotrack-enum.md +4 -4
  30. package/skills/ae-generate-tracking-code/references/client-sdk-insert.md +1 -1
  31. package/skills/ae-generate-tracking-code/references/debug-script.md +2 -2
  32. package/skills/ae-generate-tracking-code/references/logbus-config.md +1 -1
  33. package/skills/ae-generate-tracking-code/references/restful-call.md +1 -1
  34. package/skills/ae-generate-tracking-code/references/sdk-index.md +36 -36
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  printError,
19
19
  printOutput,
20
20
  runHostCompatCheck
21
- } from "./chunk-JTKMDN4A.js";
21
+ } from "./chunk-KTYR3U6D.js";
22
22
  import {
23
23
  clearCliToken,
24
24
  getCliToken
@@ -3388,7 +3388,7 @@ program.name("ae-cli").version(version).description("CLI tool for ThinkingAI (AE
3388
3388
  async function loadCommands() {
3389
3389
  const commands = [];
3390
3390
  try {
3391
- const teAnalysis = await import("./te-analysis-PCGESPLW.js");
3391
+ const teAnalysis = await import("./te-analysis-IWQZO423.js");
3392
3392
  commands.push(...teAnalysis.default);
3393
3393
  } catch {
3394
3394
  }
@@ -3398,7 +3398,7 @@ async function loadCommands() {
3398
3398
  } catch {
3399
3399
  }
3400
3400
  try {
3401
- const engage = await import("./te-engage-VW6NJZ5V.js");
3401
+ const engage = await import("./te-engage-NLZUPSBK.js");
3402
3402
  commands.push(...engage.default);
3403
3403
  } catch {
3404
3404
  }
@@ -3408,7 +3408,7 @@ async function loadCommands() {
3408
3408
  } catch {
3409
3409
  }
3410
3410
  try {
3411
- const dataops = await import("./te-dataops-LXL5YULV.js");
3411
+ const dataops = await import("./te-dataops-XTWVTJCA.js");
3412
3412
  commands.push(...dataops.default);
3413
3413
  } catch {
3414
3414
  }
@@ -3418,12 +3418,12 @@ async function loadCommands() {
3418
3418
  } catch {
3419
3419
  }
3420
3420
  try {
3421
- const teTeam = await import("./te-team-RRZI4WRI.js");
3421
+ const teTeam = await import("./te-team-BQ3SKSZV.js");
3422
3422
  commands.push(...teTeam.default);
3423
3423
  } catch {
3424
3424
  }
3425
3425
  try {
3426
- const teAgent = await import("./te-agent-3GJ5H2XF.js");
3426
+ const teAgent = await import("./te-agent-JHUG6DVV.js");
3427
3427
  commands.push(...teAgent.default);
3428
3428
  } catch {
3429
3429
  }
@@ -3433,7 +3433,7 @@ async function loadCommands() {
3433
3433
  } catch {
3434
3434
  }
3435
3435
  try {
3436
- const metadata = await import("./metadata-2ZFRMVOL.js");
3436
+ const metadata = await import("./metadata-AN3YFZEV.js");
3437
3437
  commands.push(...metadata.default);
3438
3438
  } catch {
3439
3439
  }
@@ -3441,35 +3441,35 @@ async function loadCommands() {
3441
3441
  }
3442
3442
  async function registerAuthCommands() {
3443
3443
  try {
3444
- const { registerAuth } = await import("./auth-B2BRSYMS.js");
3444
+ const { registerAuth } = await import("./auth-56Z45UVR.js");
3445
3445
  registerAuth(program);
3446
3446
  } catch {
3447
3447
  }
3448
3448
  }
3449
3449
  async function registerConfigCommands() {
3450
3450
  try {
3451
- const { registerConfig } = await import("./config-DDYJPJX3.js");
3451
+ const { registerConfig } = await import("./config-BSSALXEN.js");
3452
3452
  registerConfig(program);
3453
3453
  } catch {
3454
3454
  }
3455
3455
  }
3456
3456
  async function registerApiCommand() {
3457
3457
  try {
3458
- const { registerApi } = await import("./raw-6HXFFHLV.js");
3458
+ const { registerApi } = await import("./raw-XJCAT3HX.js");
3459
3459
  registerApi(program);
3460
3460
  } catch {
3461
3461
  }
3462
3462
  }
3463
3463
  async function registerCapabilityCommands() {
3464
3464
  try {
3465
- const { registerCapability } = await import("./capability-ROKYESAP.js");
3465
+ const { registerCapability } = await import("./capability-YPOQX6PL.js");
3466
3466
  registerCapability(program);
3467
3467
  } catch {
3468
3468
  }
3469
3469
  }
3470
3470
  async function registerSyncCommand() {
3471
3471
  try {
3472
- const { registerSync } = await import("./sync-BF3IWYFC.js");
3472
+ const { registerSync } = await import("./sync-QFP4XFN3.js");
3473
3473
  registerSync(program);
3474
3474
  } catch {
3475
3475
  }
@@ -3483,7 +3483,7 @@ async function registerModelCommand() {
3483
3483
  }
3484
3484
  async function registerUpdateCommand() {
3485
3485
  try {
3486
- const { registerUpdate } = await import("./update-ER7VFU55.js");
3486
+ const { registerUpdate } = await import("./update-DKG6UXEM.js");
3487
3487
  registerUpdate(program);
3488
3488
  } catch {
3489
3489
  }
@@ -3491,7 +3491,29 @@ async function registerUpdateCommand() {
3491
3491
  async function main() {
3492
3492
  const pkgInfo = getLocalCliPackageInfo();
3493
3493
  if (!isRootUpdateCommand(process.argv.slice(2))) {
3494
- await runHostCompatCheck(pkgInfo);
3494
+ const compat = await runHostCompatCheck(
3495
+ pkgInfo,
3496
+ globalOptionValue(process.argv.slice(2), "--host")
3497
+ );
3498
+ if (compat.status === "synced") {
3499
+ const message = compat.direction === "skills" ? `Skills were synchronized for ae-cli ${compat.expected}.` : `ae-cli changed from ${compat.current} to ${compat.expected} for this host.`;
3500
+ printError(
3501
+ "config",
3502
+ message,
3503
+ "Re-run the previous command to use the synchronized CLI and Skills.",
3504
+ "AE_CLI_VERSION_SYNCED",
3505
+ {
3506
+ current: compat.current,
3507
+ expected: compat.expected,
3508
+ cluster: compat.cluster,
3509
+ direction: compat.direction,
3510
+ retryOriginalCommand: true
3511
+ },
3512
+ { log: false }
3513
+ );
3514
+ process.exitCode = 1;
3515
+ return;
3516
+ }
3495
3517
  }
3496
3518
  const commands = await loadCommands();
3497
3519
  registerCommands(program, commands);
@@ -3541,6 +3563,14 @@ function optionConsumesValue(token) {
3541
3563
  }
3542
3564
  return token === "--host" || token === "--mcp-url" || token === "--format" || token === "--jq";
3543
3565
  }
3566
+ function globalOptionValue(args, option) {
3567
+ for (let i = 0; i < args.length; i += 1) {
3568
+ const token = args[i];
3569
+ if (token === option) return args[i + 1];
3570
+ if (token.startsWith(`${option}=`)) return token.slice(option.length + 1);
3571
+ }
3572
+ return void 0;
3573
+ }
3544
3574
  function isRootUpdateCommand(args) {
3545
3575
  for (let i = 0; i < args.length; i += 1) {
3546
3576
  const token = args[i];
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createCapabilityCommand
3
- } from "./chunk-RRFK2W7I.js";
3
+ } from "./chunk-PVBYJWC2.js";
4
4
  import {
5
5
  registerCapabilityGatewayRoute
6
6
  } from "./chunk-PTE56QPL.js";
7
7
  import "./chunk-HQ2A7ITL.js";
8
- import "./chunk-JTKMDN4A.js";
8
+ import "./chunk-KTYR3U6D.js";
9
9
  import "./chunk-E7UXXHO3.js";
10
10
  import "./chunk-IR4ZLVPW.js";
11
11
  import "./chunk-V6FR6WTW.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createCapabilityCommand
3
- } from "./chunk-EBPXT3TN.js";
3
+ } from "./chunk-LHVM35J4.js";
4
4
  import {
5
5
  registerCapabilityGatewayRoute
6
6
  } from "./chunk-PTE56QPL.js";
7
7
  import "./chunk-RGXCNC4N.js";
8
- import "./chunk-JTKMDN4A.js";
8
+ import "./chunk-KTYR3U6D.js";
9
9
  import "./chunk-E7UXXHO3.js";
10
10
  import "./chunk-IR4ZLVPW.js";
11
11
  import "./chunk-V6FR6WTW.js";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  printError,
7
7
  printOutput
8
- } from "./chunk-JTKMDN4A.js";
8
+ } from "./chunk-KTYR3U6D.js";
9
9
  import "./chunk-E7UXXHO3.js";
10
10
  import {
11
11
  SecureStoreAuthError,
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-J7MZHDHQ.js";
23
23
  import {
24
24
  printError
25
- } from "./chunk-JTKMDN4A.js";
25
+ } from "./chunk-KTYR3U6D.js";
26
26
  import "./chunk-E7UXXHO3.js";
27
27
  import "./chunk-IR4ZLVPW.js";
28
28
  import "./chunk-V6FR6WTW.js";
@@ -2169,6 +2169,17 @@ function readEnabledOptional(ctx) {
2169
2169
  }
2170
2170
  return enabled;
2171
2171
  }
2172
+ function readReuseConversation(ctx) {
2173
+ return readReuseConversationOptional(ctx) ?? false;
2174
+ }
2175
+ function readReuseConversationOptional(ctx) {
2176
+ const reuseConversation = ctx.json("reuseConversation");
2177
+ if (reuseConversation === void 0) return void 0;
2178
+ if (typeof reuseConversation !== "boolean") {
2179
+ throw new Error("--reuse-conversation must be true or false");
2180
+ }
2181
+ return reuseConversation;
2182
+ }
2172
2183
  function buildSchedule(ctx) {
2173
2184
  const kind = optional(ctx.str("scheduleKind"));
2174
2185
  if (!kind) return void 0;
@@ -2248,6 +2259,7 @@ function buildCreateBody(ctx) {
2248
2259
  schedule: buildSchedule(ctx),
2249
2260
  triggerType: "scheduled",
2250
2261
  model,
2262
+ reuseConversation: readReuseConversation(ctx),
2251
2263
  status: enabled ? "active" : "paused"
2252
2264
  };
2253
2265
  }
@@ -2276,6 +2288,7 @@ function validateList(ctx) {
2276
2288
  }
2277
2289
  function buildUpdateBody2(ctx) {
2278
2290
  const enabled = readEnabledOptional(ctx);
2291
+ const reuseConversation = readReuseConversationOptional(ctx);
2279
2292
  const body = {};
2280
2293
  const name = optional(ctx.str("name"));
2281
2294
  const message = optional(ctx.str("message"));
@@ -2284,6 +2297,8 @@ function buildUpdateBody2(ctx) {
2284
2297
  if (name) body.name = name;
2285
2298
  if (message !== void 0) body.message = message;
2286
2299
  if (enabled !== void 0) body.status = enabled ? "active" : "paused";
2300
+ if (reuseConversation !== void 0)
2301
+ body.reuseConversation = reuseConversation;
2287
2302
  if (cron) body.cronExpression = cron;
2288
2303
  if (schedule) body.schedule = schedule;
2289
2304
  return body;
@@ -2405,6 +2420,12 @@ var createAutomation = {
2405
2420
  required: false,
2406
2421
  desc: "Whether to enable the automation immediately; defaults to true"
2407
2422
  },
2423
+ {
2424
+ name: "reuse-conversation",
2425
+ type: "boolean",
2426
+ required: false,
2427
+ desc: "Continue future runs in the same conversation; defaults to false"
2428
+ },
2408
2429
  {
2409
2430
  name: "conversation-id",
2410
2431
  type: "string",
@@ -2456,6 +2477,12 @@ var updateAutomation = {
2456
2477
  required: false,
2457
2478
  desc: "true to enable, false to pause"
2458
2479
  },
2480
+ {
2481
+ name: "reuse-conversation",
2482
+ type: "boolean",
2483
+ required: false,
2484
+ desc: "true to reuse one conversation, false to create one per run"
2485
+ },
2459
2486
  ...scheduleFlags
2460
2487
  ],
2461
2488
  risk: "write",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCapabilityCommand
3
- } from "./chunk-RRFK2W7I.js";
3
+ } from "./chunk-PVBYJWC2.js";
4
4
  import {
5
5
  registerCapabilityGatewayRoute,
6
6
  resolveGatewayDomain
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-HQ2A7ITL.js";
19
19
  import {
20
20
  withOutputMetadata
21
- } from "./chunk-JTKMDN4A.js";
21
+ } from "./chunk-KTYR3U6D.js";
22
22
  import "./chunk-E7UXXHO3.js";
23
23
  import "./chunk-IR4ZLVPW.js";
24
24
  import "./chunk-V6FR6WTW.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCapabilityCommand
3
- } from "./chunk-EBPXT3TN.js";
3
+ } from "./chunk-LHVM35J4.js";
4
4
  import {
5
5
  registerCapabilityGatewayRoute,
6
6
  resolveGatewayDomain
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-RGXCNC4N.js";
19
19
  import {
20
20
  withOutputMetadata
21
- } from "./chunk-JTKMDN4A.js";
21
+ } from "./chunk-KTYR3U6D.js";
22
22
  import "./chunk-E7UXXHO3.js";
23
23
  import "./chunk-IR4ZLVPW.js";
24
24
  import "./chunk-V6FR6WTW.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  printError
3
- } from "./chunk-JTKMDN4A.js";
3
+ } from "./chunk-KTYR3U6D.js";
4
4
  import {
5
5
  clearCliToken,
6
6
  getCliToken
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  printError
3
- } from "./chunk-JTKMDN4A.js";
3
+ } from "./chunk-KTYR3U6D.js";
4
4
  import {
5
5
  clearCliToken,
6
6
  getCliToken
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCapabilityCommand
3
- } from "./chunk-EBPXT3TN.js";
3
+ } from "./chunk-LHVM35J4.js";
4
4
  import {
5
5
  registerCapabilityGatewayRoute
6
6
  } from "./chunk-PTE56QPL.js";
7
7
  import "./chunk-RGXCNC4N.js";
8
8
  import {
9
9
  printError
10
- } from "./chunk-JTKMDN4A.js";
10
+ } from "./chunk-KTYR3U6D.js";
11
11
  import "./chunk-E7UXXHO3.js";
12
12
  import "./chunk-IR4ZLVPW.js";
13
13
  import "./chunk-V6FR6WTW.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCapabilityCommand
3
- } from "./chunk-RRFK2W7I.js";
3
+ } from "./chunk-PVBYJWC2.js";
4
4
  import {
5
5
  registerCapabilityGatewayRoute
6
6
  } from "./chunk-PTE56QPL.js";
7
7
  import "./chunk-HQ2A7ITL.js";
8
8
  import {
9
9
  printError
10
- } from "./chunk-JTKMDN4A.js";
10
+ } from "./chunk-KTYR3U6D.js";
11
11
  import "./chunk-E7UXXHO3.js";
12
12
  import "./chunk-IR4ZLVPW.js";
13
13
  import "./chunk-V6FR6WTW.js";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  printError,
7
7
  printOutput
8
- } from "./chunk-JTKMDN4A.js";
8
+ } from "./chunk-KTYR3U6D.js";
9
9
  import "./chunk-E7UXXHO3.js";
10
10
  import "./chunk-IR4ZLVPW.js";
11
11
  import "./chunk-V6FR6WTW.js";
@@ -1,11 +1,13 @@
1
1
  import {
2
- AE_CLI_SKILLS_REPO,
3
- OPEN_SOURCE_AE_CLI_PACKAGE,
2
+ buildVersionInstallPlan,
4
3
  fetchCliConfig,
4
+ friendlyVersionSyncFailure,
5
5
  getCachedCompatForHost,
6
+ installVersion,
6
7
  printError,
7
- printOutput
8
- } from "./chunk-JTKMDN4A.js";
8
+ printOutput,
9
+ recordVersionSyncResult
10
+ } from "./chunk-KTYR3U6D.js";
9
11
  import {
10
12
  peekCliToken
11
13
  } from "./chunk-E7UXXHO3.js";
@@ -17,7 +19,6 @@ import {
17
19
  import "./chunk-LYVNONC4.js";
18
20
 
19
21
  // src/commands/update.ts
20
- import { spawnSync } from "child_process";
21
22
  var HOST_OPTION_DESC = "Override active AE host URL (e.g., https://ta.thinkingdata.cn)";
22
23
  var SEMVER_RE = /^\d+\.\d+\.\d+(?:[-+].*)?$/;
23
24
  function registerUpdate(program) {
@@ -30,9 +31,40 @@ function registerUpdate(program) {
30
31
  await printOutput({ action: "update", dryRun: true, ...plan }, program.opts().format || "json", program.opts().jq);
31
32
  return;
32
33
  }
33
- runCommand("npm", ["i", "-g", `${OPEN_SOURCE_AE_CLI_PACKAGE}@${target}`]);
34
- runCommand("npx", ["skills", "add", `${AE_CLI_SKILLS_REPO}#v${target}`, "-g", "-y"]);
35
- await printOutput({ action: "update", dryRun: false, ...plan }, program.opts().format || "json", program.opts().jq);
34
+ const result = installVersion(target, {
35
+ progress: (message) => process.stderr.write(`${message}
36
+ `)
37
+ });
38
+ if (host) {
39
+ recordVersionSyncResult(host, target, result);
40
+ }
41
+ if (!result.ok) {
42
+ const message = result.skillsPending ? `ae-cli ${target} was installed, but Skills synchronization failed.` : `Could not install ae-cli ${target}.`;
43
+ printError(
44
+ "config",
45
+ message,
46
+ `${friendlyVersionSyncFailure(result)} Check access and run: ae-cli update`,
47
+ "AE_CLI_UPDATE_FAILED",
48
+ {
49
+ target,
50
+ stage: result.stage,
51
+ cause: result.cause,
52
+ skillsPending: result.skillsPending
53
+ }
54
+ );
55
+ process.exitCode = 1;
56
+ return;
57
+ }
58
+ await printOutput(
59
+ {
60
+ action: "update",
61
+ dryRun: false,
62
+ ...plan,
63
+ skillsSource: result.skillsSource
64
+ },
65
+ program.opts().format || "json",
66
+ program.opts().jq
67
+ );
36
68
  });
37
69
  }
38
70
  async function resolveTargetVersion(program, opts) {
@@ -74,24 +106,14 @@ function resolveUpdateHost(program, opts) {
74
106
  return raw ? normalizeUrl(raw) : void 0;
75
107
  }
76
108
  function buildUpdatePlan(target, host) {
109
+ const installPlan = buildVersionInstallPlan(target);
77
110
  return {
78
- target,
111
+ target: installPlan.target,
79
112
  ...host ? { host } : {},
80
- commands: [
81
- `npm i -g ${OPEN_SOURCE_AE_CLI_PACKAGE}@${target}`,
82
- `npx skills add ${AE_CLI_SKILLS_REPO}#v${target} -g -y`
83
- ]
113
+ commands: installPlan.commands,
114
+ skillsSources: installPlan.skillsSources
84
115
  };
85
116
  }
86
- function runCommand(command, args) {
87
- const result = spawnSync(command, args, { stdio: "inherit" });
88
- if (result.error) {
89
- throw result.error;
90
- }
91
- if (result.status !== 0) {
92
- process.exit(result.status ?? 1);
93
- }
94
- }
95
117
  function failUpdate(message, hint) {
96
118
  printError("config", message, hint);
97
119
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkingai/ae-cli",
3
- "version": "6.0.36",
3
+ "version": "6.0.37",
4
4
  "description": "CLI tool for ThinkingAI (AE) analytics platform",
5
5
  "type": "module",
6
6
  "bin": {
@@ -44,10 +44,12 @@
44
44
  "verify:tracking-tools": "node test/tracking-client.test.mjs && node test/tracking-skill-flow.test.mjs && node test/tracking-commands.test.mjs",
45
45
  "verify:self-check-overlay": "node test/self-check-overlay.test.mjs",
46
46
  "verify:update-check": "npx tsx test/update-check.test.mjs",
47
+ "verify:version-sync": "npx tsx tests/version-sync.test.ts",
47
48
  "qa-changed": "node scripts/qa-changed.mjs",
48
49
  "self-check": "node self-check/scan.mjs",
49
50
  "check:release": "node self-check/release-gate.mjs",
50
- "sync:skills-to-db": "node scripts/sync-skills-to-db.mjs",
51
+ "sync:skills-to-system": "node scripts/sync-skills-to-system.mjs",
52
+ "verify:system-skills-sync": "node --test test/sync-system-skills.test.mjs",
51
53
  "check:agents-docs": "node scripts/check-agents-docs-sync.mjs",
52
54
  "prepublishOnly": "npm run check:release && npm run build",
53
55
  "start": "node dist/index.js",
@@ -86,7 +88,6 @@
86
88
  "@types/turndown": "^5.0.6",
87
89
  "@types/ws": "^8.5.0",
88
90
  "jszip": "^3.10.1",
89
- "mysql2": "^3.22.6",
90
91
  "tsup": "^8.0.0",
91
92
  "tsx": "^4.0.0",
92
93
  "typescript": "^5.5.0"
@@ -76,8 +76,8 @@ If the user's intent is data analysis, audience management, metadata governance,
76
76
  ### Automations (3)
77
77
 
78
78
  - `+list-automations` ([doc](references/list-automations.md)) — list current user's Agent automation tasks
79
- - `+create-automation` ([doc](references/create-automation.md)) — create an Agent automation task (hourly/daily/weekly/monthly or cron)
80
- - `+update-automation` ([doc](references/update-automation.md)) — update an automation's name, instruction, schedule, or enabled state
79
+ - `+create-automation` ([doc](references/create-automation.md)) — create an Agent automation task (hourly/daily/weekly/monthly or cron; optional continuous conversation)
80
+ - `+update-automation` ([doc](references/update-automation.md)) — update an automation's name, instruction, schedule, enabled state, or conversation mode
81
81
 
82
82
  ### Models (6)
83
83
 
@@ -8,6 +8,7 @@ Domain: **Automations / write**
8
8
  - Create an Agent automation task that runs on a schedule (hourly / daily / weekly / monthly or cron).
9
9
  - Returns the newly created automation object including its `id` and initial `status`.
10
10
  - Automations are **enabled by default**; pass `--enabled false` only when the user explicitly asks to create the task without enabling it.
11
+ - Automations create a new conversation for every run by default. Pass `--reuse-conversation true` only when the user explicitly wants future runs to continue in one conversation.
11
12
 
12
13
  ## Mandatory Rules (MUST)
13
14
  - `--name` and `--message` are required.
@@ -43,6 +44,14 @@ ae-cli agent +create-automation \
43
44
  --message "Summarize yesterday's AI news" \
44
45
  --enabled false
45
46
 
47
+ # Keep future runs in one visible conversation
48
+ ae-cli agent +create-automation \
49
+ --name "Daily AI Brief" \
50
+ --schedule-kind daily \
51
+ --time 09:00 \
52
+ --message "Summarize yesterday's AI news" \
53
+ --reuse-conversation true
54
+
46
55
  # Weekly schedule on Sunday
47
56
  ae-cli agent +create-automation \
48
57
  --name "Weekly Report" \
@@ -76,6 +85,7 @@ ae-cli agent +create-automation --dry-run --name "Test" --message "x" --schedule
76
85
  | `--agent-name` | No | Agent name; use only after `+list-agents` discovery |
77
86
  | `--model` | No | Model record ID; defaults to current selected model |
78
87
  | `--enabled` | No | `true` (default) \| `false` |
88
+ | `--reuse-conversation` | No | `true` to continue in one conversation; `false` (default) to create one per run |
79
89
  | `--conversation-id` | No | Conversation ID fallback for resolving current Agent |
80
90
 
81
91
  \* One of `--cron` or `--schedule-kind` is required.
@@ -84,6 +94,7 @@ ae-cli agent +create-automation --dry-run --name "Test" --message "x" --schedule
84
94
  - If the user provides a natural-language schedule ("every day at 9am"), translate it to `--schedule-kind daily --time 09:00`.
85
95
  - If the user wants a cron-only schedule not covered by the kinds, use `--cron`.
86
96
  - If no Agent is specified, the automation targets the current conversation's Agent; verify with `+list-agents` when in doubt.
97
+ - Set `--reuse-conversation true` only when the user explicitly requests continuity across runs. The platform may rotate the underlying provider session while retaining the visible conversation history.
87
98
  - Use `--dry-run` first to verify the request shape before executing.
88
99
 
89
100
  ## Next Steps on Failure
@@ -5,13 +5,13 @@
5
5
  Domain: **Automations / write**
6
6
 
7
7
  ## Use Cases
8
- - Update an existing Agent automation task's name, instruction, schedule, or enabled state.
8
+ - Update an existing Agent automation task's name, instruction, schedule, enabled state, or conversation mode.
9
9
  - Used to pause (`--enabled false`) or resume (`--enabled true`) an automation, or to change its schedule/message.
10
10
  - Obtain the automation `id` via `+list-automations` — never guess.
11
11
 
12
12
  ## Mandatory Rules (MUST)
13
13
  - `--id` is required. Obtain the real ID via `+list-automations` — do not guess.
14
- - At least one update field must be provided (`--name`, `--message`, `--enabled`, `--cron`, or a `--schedule-kind` with its time/day fields).
14
+ - At least one update field must be provided (`--name`, `--message`, `--enabled`, `--reuse-conversation`, `--cron`, or a `--schedule-kind` with its time/day fields).
15
15
  - `--cron` and `--schedule-kind` are mutually exclusive.
16
16
  - This is an ordinary `write` operation and does not require CLI confirmation.
17
17
  - Do not surface raw automation IDs, raw JSON, or concrete detail paths in user-facing replies.
@@ -32,6 +32,12 @@ ae-cli agent +update-automation --id <automation-id> --enabled false
32
32
  # Resume an automation
33
33
  ae-cli agent +update-automation --id <automation-id> --enabled true
34
34
 
35
+ # Reuse the most recent valid conversation on future runs
36
+ ae-cli agent +update-automation --id <automation-id> --reuse-conversation true
37
+
38
+ # Return to creating a new conversation for every run
39
+ ae-cli agent +update-automation --id <automation-id> --reuse-conversation false
40
+
35
41
  # Rename and change the instruction
36
42
  ae-cli agent +update-automation \
37
43
  --id <automation-id> \
@@ -59,6 +65,7 @@ ae-cli agent +update-automation --dry-run --id <automation-id> --enabled false
59
65
  | `--name` | No | New automation task name |
60
66
  | `--message` | No | New instruction sent to the Agent |
61
67
  | `--enabled` | No | `true` to enable, `false` to pause |
68
+ | `--reuse-conversation` | No | `true` to reuse one conversation, `false` to create one per run; omit to keep unchanged |
62
69
  | `--cron` | No | Cron expression (mutually exclusive with `--schedule-kind`) |
63
70
  | `--schedule-kind` | No | `hourly` \| `daily` \| `weekly` \| `monthly` |
64
71
  | `--time` | No | Time in `HH:mm` for daily/weekly/monthly |
@@ -68,12 +75,13 @@ ae-cli agent +update-automation --dry-run --id <automation-id> --enabled false
68
75
 
69
76
  ## Decision Rules
70
77
  - If the user wants to pause/resume, use `--enabled false` / `--enabled true` (no other fields needed).
78
+ - If the user wants future runs to share one conversation, use `--reuse-conversation true`; use `false` to restore one conversation per run.
71
79
  - If the user wants to change the schedule, provide `--schedule-kind` with its required time/day fields, or `--cron`.
72
80
  - At least one update field is required; a bare `--id` is rejected.
73
81
  - Use `--dry-run` first to verify the request shape before executing.
74
82
 
75
83
  ## Next Steps on Failure
76
- - `至少提供一个更新字段`: add at least one of `--name` / `--message` / `--enabled` / `--cron` / `--schedule-kind`.
84
+ - `至少提供一个更新字段`: add at least one of `--name` / `--message` / `--enabled` / `--reuse-conversation` / `--cron` / `--schedule-kind`.
77
85
  - `必须提供 --cron 或 --schedule-kind`: if schedule detail flags (`--time` / `--minute` / `--weekday` / `--day-of-month`) are present, a `--schedule-kind` (or `--cron`) must accompany them.
78
86
  - `--time 格式必须是 HH:mm`: use 24-hour `HH:mm` (e.g. `09:00`).
79
87
 
@@ -256,7 +256,7 @@ Without `.ae-cli/draft.json` or `.ae-cli/remote-plan.json`:
256
256
  **SDK document paths**:
257
257
  - Do not use hard-coded wiki paths from this section.
258
258
  - Always read `references/sdk-index.md` first and use the path listed there for the selected SDK.
259
- - If the path from `references/sdk-index.md` does not exist in the local wiki mirror, search under `~/.ae-cli/wiki/te-docs/raw/` with SDK-specific keywords and use the best matching latest main document.
259
+ - If the path from `references/sdk-index.md` does not exist in the local wiki mirror, search under `~/.ae-cli/wiki/raw/` with SDK-specific keywords and use the best matching latest main document.
260
260
 
261
261
  ---
262
262
 
@@ -669,14 +669,14 @@ All output mode rules are in `references/*.md`. This SKILL.md only handles phase
669
669
  - User guide: https://docs-v2.thinkingdata.cn/?version=latest&code=logbus2_installation&lan=en-US
670
670
  - Download link is in the official doc's "二、Download LogBus2" section
671
671
 
672
- **Wiki directory structure** (see `~/.ae-cli/wiki/te-docs/schema.md`):
673
- - `~/.ae-cli/wiki/te-docs/raw/` — AE official documentation mirror (read-only, maintained by crawler)
674
- - `~/.ae-cli/wiki/te-docs/synthesis/` — LLM-synthesized overview documents
672
+ **Wiki directory structure** (see `~/.ae-cli/wiki/schema.md`):
673
+ - `~/.ae-cli/wiki/raw/` — AE official documentation mirror (read-only, maintained by crawler)
674
+ - `~/.ae-cli/wiki/synthesis/` — LLM-synthesized overview documents
675
675
 
676
676
  **Document reading order during code generation**:
677
677
  1. Read `references/sdk-index.md` to find the selected SDK's main document and advanced guide paths.
678
678
  2. Verify the main document path exists in the local wiki mirror before reading it.
679
- 3. If the indexed path is missing, search under `~/.ae-cli/wiki/te-docs/raw/` with SDK-specific keywords such as SDK name, platform name, language name, and `main doc`; choose the latest main document, not historical/versioned documents.
679
+ 3. If the indexed path is missing, search under `~/.ae-cli/wiki/raw/` with SDK-specific keywords such as SDK name, platform name, language name, and `main doc`; choose the latest main document, not historical/versioned documents.
680
680
  4. Read the wiki main doc first (initialization, imports, package names, basic API).
681
681
  5. Read the advanced guide only after the main doc (LoggerConsumer, user properties, auto-track, preset properties, etc.).
682
682
  6. Check advanced guide sub-documents if needed.
@@ -177,7 +177,7 @@ TDAnalytics.enableAutoTrack(context,
177
177
  ## Cocos2d-x / CocosCreator / LayaAir / Unreal
178
178
 
179
179
  游戏引擎 SDK 的自动采集枚举值请直接读取对应 wiki 文档:
180
- - `~/.ae-cli/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/automatic-event-tracking.md`
181
- - `~/.ae-cli/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/automatic-event-tracking.md`
182
- - `~/.ae-cli/wiki/te-docs/raw/客户端-sdk/游戏引擎/layaair/进阶指南/自动采集.md`
183
- - `~/.ae-cli/wiki/te-docs/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/automatic-event-tracking.md`
180
+ - `~/.ae-cli/wiki/raw/data-ingestion-guide/client-sdk/game-engine/cocos2d-x/cocos2d-x-advanced/automatic-event-tracking.md`
181
+ - `~/.ae-cli/wiki/raw/data-ingestion-guide/client-sdk/game-engine/cocoscreator/cocoscreator-advance/automatic-event-tracking.md`
182
+ - `~/.ae-cli/wiki/raw/客户端-sdk/游戏引擎/layaair/进阶指南/自动采集.md`
183
+ - `~/.ae-cli/wiki/raw/data-ingestion-guide/client-sdk/game-engine/unreal/unreal-advanced/automatic-event-tracking.md`
@@ -16,7 +16,7 @@
16
16
  3. Choose integration method based on project characteristics:
17
17
  - Has `package.json` + build tool → npm integration
18
18
  - Plain HTML / no build tool → CDN method
19
- 4. Read `~/.ae-cli/wiki/te-docs/synthesis/sdk-selection.md` to confirm appType's npm package name and init signature
19
+ 4. Read `~/.ae-cli/wiki/synthesis/sdk-selection.md` to confirm appType's npm package name and init signature
20
20
  5. Read the corresponding cheatsheet (e.g. `js-sdk-cheatsheet.md`) for additional details
21
21
 
22
22
  **⚠️ Prohibited**: Skipping Stage 0 and writing code directly, guessing integration methods, using unverified CDN URLs