@thinkingai/ae-cli 6.1.38 → 6.1.40

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 (191) hide show
  1. package/README.md +2 -0
  2. package/README.zh.md +2 -0
  3. package/dist/{ai-monitor-UL2O7J4X.js → ai-monitor-DST4NDOK.js} +5 -5
  4. package/dist/ai-monitor.js +7 -7
  5. package/dist/{auth-ERWVKQDG.js → auth-BD3NIY3T.js} +3 -3
  6. package/dist/{automation-OQ647CSW.js → automation-IMDCJUML.js} +85 -9
  7. package/dist/{capability-HPP6E3ZX.js → capability-3NJOQHZQ.js} +3 -3
  8. package/dist/{chunk-DKOGWIYQ.js → chunk-24DCOJBJ.js} +2 -2
  9. package/dist/{chunk-SHB7A2JE.js → chunk-2RORKIF6.js} +2 -2
  10. package/dist/{chunk-HBI7IQH3.js → chunk-6NJZSWUT.js} +3 -28
  11. package/dist/{chunk-QPUPWGZ3.js → chunk-DTODOQ6T.js} +1 -1
  12. package/dist/{chunk-PCQTBRPT.js → chunk-FRJUB66C.js} +1 -1
  13. package/dist/{chunk-ZLJZPPPV.js → chunk-IY5G42YY.js} +2 -2
  14. package/dist/{chunk-JRXSLFCA.js → chunk-KBJHBVO7.js} +1 -1
  15. package/dist/{chunk-CYZV5AXW.js → chunk-KE5WGBXS.js} +2 -1
  16. package/dist/chunk-N2MAYIRU.js +32 -0
  17. package/dist/{chunk-BWEQIKA3.js → chunk-RW6Z2NN3.js} +5 -5
  18. package/dist/{chunk-DULCIC67.js → chunk-SQEK6S4X.js} +2 -3
  19. package/dist/{chunk-VPLRZSMY.js → chunk-STHIGWWC.js} +10 -1
  20. package/dist/{chunk-LXRALNNA.js → chunk-UK7HQ4IL.js} +1 -1
  21. package/dist/{chunk-NDX4VJO7.js → chunk-VXKKTUU2.js} +2 -2
  22. package/dist/{chunk-E5CJI7L3.js → chunk-WRYXVIJP.js} +1 -1
  23. package/dist/{compat-check-WRPEFB5N.js → compat-check-7VBBE7KO.js} +1 -1
  24. package/dist/{config-IS33K45R.js → config-LFRZBPH5.js} +3 -3
  25. package/dist/{context-Y2A6QIS3.js → context-WJQGJD6F.js} +1 -1
  26. package/dist/{data-integration-EIF5QHYF.js → data-integration-KMJWYAKK.js} +2 -1
  27. package/dist/index.js +35 -33
  28. package/dist/{memory-6QMZS4HF.js → memory-VPOPSU52.js} +3 -3
  29. package/dist/{metadata-TMAXVLOL.js → metadata-AR64J76Z.js} +5 -5
  30. package/dist/{model-LEYRQKOS.js → model-2F2354QP.js} +1 -1
  31. package/dist/{personal-semantic-preference-RMZEDRCJ.js → personal-semantic-preference-BCOSI4DO.js} +4 -4
  32. package/dist/{project-semantic-UD3OAZ6K.js → project-semantic-DJLXAXLD.js} +4 -4
  33. package/dist/{sync-GVF3OI2U.js → sync-4TUIQ2PZ.js} +3 -3
  34. package/dist/{te-agent-S7UH657Z.js → te-agent-EMDWA3M6.js} +4 -4
  35. package/dist/{te-analysis-SJIE5OZY.js → te-analysis-NJHSEKGW.js} +8 -6
  36. package/dist/{te-community-VNHJDEID.js → te-community-JSUSZEYH.js} +4 -4
  37. package/dist/{te-dataops-AO4OQBQV.js → te-dataops-I264BUTI.js} +2 -2
  38. package/dist/{te-engage-EZJRFG3Q.js → te-engage-XNMQYO5N.js} +68 -16
  39. package/dist/{te-experiment-R2MNSAKV.js → te-experiment-5SCHMYVO.js} +4 -4
  40. package/dist/{te-kb-C44A4BHM.js → te-kb-QQ53TNRZ.js} +44 -13
  41. package/dist/{te-system-DB5Z3LLF.js → te-system-Z4VEB6PL.js} +1 -1
  42. package/dist/{te-team-J52STTEZ.js → te-team-V6BBI52R.js} +87 -6
  43. package/dist/{things-G2QFXDK7.js → things-THHGDSEC.js} +4 -4
  44. package/dist/{update-GEKOZMHU.js → update-53ZUXWV5.js} +2 -2
  45. package/dist/{web-runtime-5M7PRY7R.js → web-runtime-HIXOSNJ6.js} +89 -9
  46. package/dist/{workspace-RZESYB6T.js → workspace-W5ZPVWJS.js} +3 -3
  47. package/package.json +3 -3
  48. package/skills/ae-automation/SKILL.md +6 -2
  49. package/skills/ae-automation/references/cli.md +9 -3
  50. package/skills/ae-engage/SKILL.md +6 -1
  51. package/skills/ae-engage/references/common-metric.md +47 -1
  52. package/skills/ae-engage/references/flow-metric-update.md +1 -1
  53. package/skills/ae-engage/references/task-metric-update.md +1 -1
  54. package/skills/ae-experiment/SKILL.md +1 -1
  55. package/skills/ae-experiment/references/save_experiment.md +1 -1
  56. package/skills/ae-kb/SKILL.md +8 -6
  57. package/skills/ae-kb/references/query-workflow.md +5 -1
  58. package/skills/ae-onboarding/SKILL.md +2 -2
  59. package/skills/ae-onboarding/references/demo-operations.md +3 -2
  60. package/skills/ae-onboarding/references/onboarding_experiment_launch.md +4 -2
  61. package/skills/ae-team/SKILL.md +7 -3
  62. package/skills/ae-team/references/copy-to-personal.md +7 -0
  63. package/skills/ae-team/references/promote.md +7 -0
  64. package/skills/ae-team/references/update.md +3 -3
  65. package/skills/ae-tracking-matrix/SKILL.md +0 -170
  66. package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
  67. package/skills/ae-tracking-matrix/i18n.yaml +0 -12
  68. package/skills/ae-tracking-matrix/references/ae-capabilities.md +0 -93
  69. package/skills/ae-tracking-matrix/references/business-semantic-checks.md +0 -30
  70. package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +0 -256
  71. package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +0 -213
  72. package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +0 -407
  73. package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +0 -218
  74. package/skills/ae-tracking-matrix/references/categories/casual_music.md +0 -112
  75. package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +0 -301
  76. package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +0 -356
  77. package/skills/ae-tracking-matrix/references/categories/fishing.md +0 -775
  78. package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +0 -89
  79. package/skills/ae-tracking-matrix/references/categories/idle_card.md +0 -27
  80. package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +0 -415
  81. package/skills/ae-tracking-matrix/references/categories/interactive_video.md +0 -133
  82. package/skills/ae-tracking-matrix/references/categories/merge.md +0 -639
  83. package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +0 -406
  84. package/skills/ae-tracking-matrix/references/categories/mmo_web.md +0 -230
  85. package/skills/ae-tracking-matrix/references/categories/music.md +0 -137
  86. package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +0 -414
  87. package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +0 -199
  88. package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +0 -158
  89. package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +0 -546
  90. package/skills/ae-tracking-matrix/references/categories/rpg.md +0 -195
  91. package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +0 -115
  92. package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +0 -151
  93. package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +0 -260
  94. package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +0 -232
  95. package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +0 -359
  96. package/skills/ae-tracking-matrix/references/categories/tower_defense.md +0 -365
  97. package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +0 -211
  98. package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +0 -132
  99. package/skills/ae-tracking-matrix/references/category-registry.md +0 -77
  100. package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +0 -230
  101. package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +0 -406
  102. package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +0 -128
  103. package/skills/ae-tracking-matrix/references/eval-cases.md +0 -74
  104. package/skills/ae-tracking-matrix/references/naming-dict.md +0 -238
  105. package/skills/ae-tracking-matrix/references/optimization-checklist.md +0 -85
  106. package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +0 -142
  107. package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +0 -47
  108. package/skills/ae-tracking-matrix/references/plan-generation/reference.md +0 -794
  109. package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +0 -94
  110. package/skills/ae-tracking-matrix/references/scene-routing.md +0 -80
  111. package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +0 -3787
  112. package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +0 -827
  113. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +0 -655
  114. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +0 -953
  115. package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +0 -1128
  116. package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +0 -714
  117. package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +0 -1268
  118. package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +0 -776
  119. package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +0 -182
  120. package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +0 -2755
  121. package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +0 -1182
  122. package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +0 -1300
  123. package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +0 -1369
  124. package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +0 -1692
  125. package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +0 -902
  126. package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +0 -763
  127. package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +0 -1107
  128. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +0 -1532
  129. package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +0 -845
  130. package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +0 -228
  131. package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +0 -149
  132. package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +0 -407
  133. package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +0 -163
  134. package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +0 -149
  135. package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +0 -153
  136. package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +0 -232
  137. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +0 -314
  138. package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +0 -117
  139. package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +0 -148
  140. package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +0 -645
  141. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +0 -307
  142. package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +0 -347
  143. package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +0 -72
  144. package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +0 -264
  145. package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +0 -566
  146. package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +0 -409
  147. package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +0 -446
  148. package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +0 -557
  149. package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +0 -457
  150. package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +0 -490
  151. package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +0 -523
  152. package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +0 -484
  153. package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +0 -442
  154. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +0 -391
  155. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +0 -91
  156. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +0 -635
  157. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +0 -113
  158. package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +0 -466
  159. package/skills/ae-tracking-matrix/references/standard-base/README.md +0 -22
  160. package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +0 -174
  161. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +0 -20
  162. package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +0 -7
  163. package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +0 -14
  164. package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +0 -370
  165. package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +0 -47
  166. package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +0 -37
  167. package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +0 -27
  168. package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +0 -23
  169. package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +0 -14
  170. package/skills/ae-tracking-matrix/references/standard-base/user_data.md +0 -46
  171. package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +0 -13
  172. package/skills/ae-tracking-matrix/references/system-fields.md +0 -297
  173. package/skills/ae-tracking-matrix/references/te-field-translations.md +0 -1791
  174. package/skills/ae-tracking-matrix/references/workflows/data-verification.md +0 -232
  175. package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +0 -829
  176. package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +0 -355
  177. package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +0 -283
  178. package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +0 -168
  179. package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +0 -205
  180. package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +0 -75
  181. package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +0 -36
  182. package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +0 -107
  183. package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +0 -114
  184. package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +0 -53
  185. package/skills/ae-tracking-matrix/scripts/finalize_plan.py +0 -166
  186. package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +0 -674
  187. package/skills/ae-tracking-matrix/scripts/plan_contract.py +0 -200
  188. package/skills/ae-tracking-matrix/scripts/plan_types.py +0 -60
  189. package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +0 -169
  190. package/skills/ae-tracking-matrix/scripts/sync_plan.py +0 -296
  191. package/skills/ae-tracking-matrix/scripts/upload_plan.py +0 -340
@@ -2,18 +2,18 @@ import { createRequire as __createRequire } from 'node:module'; const require =
2
2
  import {
3
3
  kbApi,
4
4
  kbUpload
5
- } from "./chunk-E5CJI7L3.js";
5
+ } from "./chunk-WRYXVIJP.js";
6
6
  import {
7
7
  printError
8
- } from "./chunk-JRXSLFCA.js";
8
+ } from "./chunk-KBJHBVO7.js";
9
9
  import {
10
10
  TeAgentApiError
11
- } from "./chunk-CYZV5AXW.js";
11
+ } from "./chunk-KE5WGBXS.js";
12
12
  import {
13
13
  CapabilityGatewayError
14
- } from "./chunk-VPLRZSMY.js";
14
+ } from "./chunk-STHIGWWC.js";
15
15
  import "./chunk-6E6HCTP2.js";
16
- import "./chunk-DULCIC67.js";
16
+ import "./chunk-SQEK6S4X.js";
17
17
  import "./chunk-PUSFEC6B.js";
18
18
  import "./chunk-UWQXGF44.js";
19
19
  import "./chunk-IGU3R2JD.js";
@@ -1114,6 +1114,29 @@ var add = {
1114
1114
  }
1115
1115
  };
1116
1116
 
1117
+ // src/commands/te-kb/content-language.ts
1118
+ function requestedContentLanguage(ctx) {
1119
+ const value = ctx.str("content-language");
1120
+ if (!value) return void 0;
1121
+ if (!/^[A-Za-z]{2,8}$/.test(value.trim())) {
1122
+ throw new Error("--content-language must be a BCP-47 primary language subtag, such as ko.");
1123
+ }
1124
+ return value.trim().toLowerCase();
1125
+ }
1126
+ async function requestWithContentLanguage(ctx, path9, body4, api = kbApi, preserveBusinessErrorCode = false) {
1127
+ try {
1128
+ if (preserveBusinessErrorCode) {
1129
+ return await api(ctx, "POST", path9, {}, body4, { preserveBusinessErrorCode: true });
1130
+ }
1131
+ return await api(ctx, "POST", path9, {}, body4);
1132
+ } catch (error) {
1133
+ if (body4.contentLanguage && error instanceof Error && /^body:\s/.test(error.message)) {
1134
+ throw new Error("The server does not support the requested knowledge-base language option.", { cause: error });
1135
+ }
1136
+ throw error;
1137
+ }
1138
+ }
1139
+
1117
1140
  // src/commands/te-kb/compile.ts
1118
1141
  var API_PATH5 = "/agent/api/external/knowledge-bases/compile";
1119
1142
  var VALID_MODES = /* @__PURE__ */ new Set(["incremental", "full"]);
@@ -1133,6 +1156,8 @@ function buildBody(ctx) {
1133
1156
  if (scope) body4.scope = scope;
1134
1157
  const model = ctx.str("model");
1135
1158
  if (model) body4.model = model;
1159
+ const contentLanguage = requestedContentLanguage(ctx);
1160
+ if (contentLanguage) body4.contentLanguage = contentLanguage;
1136
1161
  return body4;
1137
1162
  }
1138
1163
  var compile = {
@@ -1140,6 +1165,7 @@ var compile = {
1140
1165
  command: "+compile",
1141
1166
  description: "Compile a knowledge.",
1142
1167
  flags: [
1168
+ { name: "content-language", type: "string", required: false, desc: "Require the working guidelines to declare this language before compilation." },
1143
1169
  { name: "name", type: "string", required: true, desc: "Knowledge base name" },
1144
1170
  { name: "mode", type: "string", required: false, default: "incremental", desc: "Compile mode: incremental | full (default: incremental)" },
1145
1171
  { name: "scope", type: "string", required: false, desc: "Exact knowledge base scope: personal | company (omit for personal \u2192 company fallback)" },
@@ -1147,15 +1173,14 @@ var compile = {
1147
1173
  ],
1148
1174
  risk: "write",
1149
1175
  validate: (ctx) => {
1150
- getMode(ctx);
1151
- getExternalKnowledgeBaseTargetScope(ctx);
1176
+ buildBody(ctx);
1152
1177
  },
1153
1178
  dryRun: (ctx) => ({
1154
1179
  method: "POST",
1155
1180
  url: `${ctx.host().replace(/\/$/, "")}${API_PATH5}`,
1156
1181
  body: buildBody(ctx)
1157
1182
  }),
1158
- execute: async (ctx) => kbApi(ctx, "POST", API_PATH5, {}, buildBody(ctx))
1183
+ execute: async (ctx) => requestWithContentLanguage(ctx, API_PATH5, buildBody(ctx))
1159
1184
  };
1160
1185
 
1161
1186
  // src/commands/te-kb/remove.ts
@@ -1341,18 +1366,24 @@ function buildBody5(ctx) {
1341
1366
  if (model) body4.model = model;
1342
1367
  const customInstructions = getCustomInstructions(ctx);
1343
1368
  if (customInstructions) body4.customInstructions = customInstructions;
1369
+ const contentLanguage = requestedContentLanguage(ctx);
1370
+ if (contentLanguage) body4.contentLanguage = contentLanguage;
1371
+ if (ctx.bool("rewrite-language")) {
1372
+ if (!contentLanguage) throw new Error("--rewrite-language requires --content-language.");
1373
+ body4.schemaMode = "rewrite-language";
1374
+ }
1344
1375
  return body4;
1345
1376
  }
1346
1377
  async function executeSchema(ctx, api = kbApi) {
1347
- return api(ctx, "POST", API_PATH9, {}, buildBody5(ctx), {
1348
- preserveBusinessErrorCode: true
1349
- });
1378
+ return requestWithContentLanguage(ctx, API_PATH9, buildBody5(ctx), api, true);
1350
1379
  }
1351
1380
  var schema = {
1352
1381
  service: "kb",
1353
1382
  command: "+schema",
1354
1383
  description: "Generate the compile schema for a knowledge base via POST /agent/api/external/knowledge-bases/schema.",
1355
1384
  flags: [
1385
+ { name: "content-language", type: "string", required: false, desc: "Set the knowledge-base content language while generating the guidelines." },
1386
+ { name: "rewrite-language", type: "boolean", required: false, desc: "Rewrite the language of the existing guidelines while preserving their rules." },
1356
1387
  { name: "name", type: "string", required: true, desc: "Knowledge base name (looked up personal \u2192 company)" },
1357
1388
  { name: "scope", type: "string", required: false, desc: "Exact knowledge base scope: personal | company (omit for personal \u2192 company fallback)" },
1358
1389
  { name: "force", type: "boolean", required: false, desc: "Preempt generation even when status is `generating` (use only for stuck recovery)" },
@@ -1375,7 +1406,7 @@ var schema = {
1375
1406
  risk: "write",
1376
1407
  validate: (ctx) => {
1377
1408
  getExternalKnowledgeBaseTargetScope(ctx);
1378
- getCustomInstructions(ctx);
1409
+ buildBody5(ctx);
1379
1410
  },
1380
1411
  dryRun: (ctx) => ({
1381
1412
  method: "POST",
@@ -1685,7 +1716,7 @@ var kbGrep = {
1685
1716
  name: "paths",
1686
1717
  type: "json",
1687
1718
  required: true,
1688
- desc: 'JSON array of wiki pages or subdirectories copied from +index, e.g. ["wiki/sandbox.md"] or ["wiki/guides"]'
1719
+ desc: 'JSON array of files or subdirectories strictly under wiki/, copied from returned navigation, e.g. ["wiki/sandbox.md"] or ["wiki/guides"]. The roots "wiki" and "wiki/", index.md, raw/, absolute paths and paths escaping wiki/ are invalid. If navigation provides no usable paths, skip +grep; never use the wiki root as a fallback.'
1689
1720
  },
1690
1721
  { name: "top-k", type: "number", required: false, min: 1, max: 50, desc: "Max number of pages to return (1-50, default 10)" },
1691
1722
  { name: "locale", type: "string", required: false, desc: "Optional locale: zh | en | ja | ko" }
@@ -12,7 +12,7 @@ import {
12
12
  postToMainApp,
13
13
  putToMainApp,
14
14
  uploadToMainApp
15
- } from "./chunk-CYZV5AXW.js";
15
+ } from "./chunk-KE5WGBXS.js";
16
16
  import "./chunk-UWQXGF44.js";
17
17
  import {
18
18
  isAeSandboxRuntime,
@@ -2,14 +2,17 @@ import { createRequire as __createRequire } from 'node:module'; const require =
2
2
  import {
3
3
  getAuthHeaders,
4
4
  kbApi
5
- } from "./chunk-E5CJI7L3.js";
5
+ } from "./chunk-WRYXVIJP.js";
6
+ import {
7
+ detectCliLocale
8
+ } from "./chunk-N2MAYIRU.js";
6
9
  import {
7
10
  printError,
8
11
  printOutput
9
- } from "./chunk-JRXSLFCA.js";
10
- import "./chunk-VPLRZSMY.js";
12
+ } from "./chunk-KBJHBVO7.js";
13
+ import "./chunk-STHIGWWC.js";
11
14
  import "./chunk-6E6HCTP2.js";
12
- import "./chunk-DULCIC67.js";
15
+ import "./chunk-SQEK6S4X.js";
13
16
  import "./chunk-PUSFEC6B.js";
14
17
  import "./chunk-UWQXGF44.js";
15
18
  import "./chunk-IGU3R2JD.js";
@@ -78,6 +81,12 @@ var createTeam = {
78
81
  };
79
82
 
80
83
  // src/commands/te-team/team/update-team.ts
84
+ var scopeHelp = {
85
+ en: "For compatibility, pass the current scope only. Use +promote or +copy-to-personal to change ownership.",
86
+ zh: "\u4EC5\u7528\u4E8E\u517C\u5BB9\u539F\u6837\u4F20\u56DE\u5F53\u524D\u8303\u56F4\u3002\u8981\u66F4\u6539\u5F52\u5C5E\uFF0C\u8BF7\u4F7F\u7528 +promote \u6216 +copy-to-personal\u3002",
87
+ ja: "\u4E92\u63DB\u6027\u306E\u305F\u3081\u73FE\u5728\u306E\u516C\u958B\u7BC4\u56F2\u306E\u307F\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\u6240\u6709\u7BC4\u56F2\u306E\u5909\u66F4\u306F +promote \u307E\u305F\u306F +copy-to-personal \u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
88
+ ko: "\uD638\uD658\uC131\uC744 \uC704\uD574 \uD604\uC7AC \uACF5\uAC1C \uBC94\uC704\uB9CC \uC804\uB2EC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC18C\uC720 \uBC94\uC704\uB97C \uBCC0\uACBD\uD558\uB824\uBA74 +promote \uB610\uB294 +copy-to-personal\uC744 \uC0AC\uC6A9\uD558\uC138\uC694."
89
+ };
81
90
  var VALID_SCOPES2 = /* @__PURE__ */ new Set(["personal", "company"]);
82
91
  function buildBody2(ctx) {
83
92
  const body = {};
@@ -102,7 +111,7 @@ var updateTeam = {
102
111
  { name: "name", type: "string", required: false, desc: "New team name" },
103
112
  { name: "config", type: "json", required: false, desc: "New TeamConfig JSON" },
104
113
  { name: "description", type: "string", required: false, desc: "New description" },
105
- { name: "scope", type: "string", required: false, desc: "personal | company" },
114
+ { name: "scope", type: "string", required: false, desc: scopeHelp[detectCliLocale()] },
106
115
  { name: "enabled", type: "boolean", required: false, desc: "Whether enabled" }
107
116
  ],
108
117
  risk: "write",
@@ -117,7 +126,7 @@ var updateTeam = {
117
126
  url: `${ctx.host().replace(/\/$/, "")}${BASE_TEAM_PATH}/${ctx.str("id")}`,
118
127
  body: buildBody2(ctx)
119
128
  }),
120
- execute: async (ctx) => kbApi(ctx, "PATCH", `${BASE_TEAM_PATH}/${ctx.str("id")}`, {}, buildBody2(ctx))
129
+ execute: async (ctx) => kbApi(ctx, "PATCH", `${BASE_TEAM_PATH}/${ctx.str("id")}`, { lang: detectCliLocale() }, buildBody2(ctx))
121
130
  };
122
131
 
123
132
  // src/commands/te-team/team/delete-team.ts
@@ -202,10 +211,82 @@ var listProjects = {
202
211
  }
203
212
  };
204
213
 
214
+ // src/commands/te-team/team/scope-command.ts
215
+ var scopeText = {
216
+ en: {
217
+ id: "Team ID",
218
+ revision: "Use expectedRevision from the preview",
219
+ required: "Preview this Team with --dry-run, then pass its --expected-revision.",
220
+ promote: "Convert your personal Team to a company Team after reviewing the preview.",
221
+ copy: "Create an independent personal copy of a company Team."
222
+ },
223
+ zh: {
224
+ id: "Team ID",
225
+ revision: "\u4F7F\u7528\u9884\u89C8\u8FD4\u56DE\u7684 expectedRevision",
226
+ required: "\u8BF7\u5148\u8FD0\u884C --dry-run \u9884\u89C8\uFF0C\u518D\u4F20\u5165\u5BF9\u5E94\u7684 --expected-revision\u3002",
227
+ promote: "\u786E\u8BA4\u9884\u89C8\u540E\uFF0C\u5C06\u672C\u4EBA\u7684\u4E2A\u4EBA Team \u8F6C\u4E3A\u516C\u53F8 Team\u3002",
228
+ copy: "\u628A\u516C\u53F8 Team \u590D\u5236\u4E3A\u72EC\u7ACB\u7684\u4E2A\u4EBA Team\u3002"
229
+ },
230
+ ja: {
231
+ id: "Team ID",
232
+ revision: "\u30D7\u30EC\u30D3\u30E5\u30FC\u3067\u53D6\u5F97\u3057\u305F expectedRevision",
233
+ required: "--dry-run \u3067\u78BA\u8A8D\u3057\u3066\u304B\u3089 --expected-revision \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
234
+ promote: "\u78BA\u8A8D\u3057\u305F\u500B\u4EBA\u7528 Team \u3092\u4F1A\u793E\u306E Team \u306B\u5909\u66F4\u3057\u307E\u3059\u3002",
235
+ copy: "\u4F1A\u793E\u306E Team \u306E\u72EC\u7ACB\u3057\u305F\u500B\u4EBA\u7528\u30B3\u30D4\u30FC\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002"
236
+ },
237
+ ko: {
238
+ id: "Team ID",
239
+ revision: "\uBBF8\uB9AC \uBCF4\uAE30\uC5D0\uC11C \uBC1B\uC740 expectedRevision",
240
+ required: "\uBA3C\uC800 --dry-run\uC73C\uB85C \uD655\uC778\uD55C \uD6C4 --expected-revision\uC744 \uC804\uB2EC\uD558\uC138\uC694.",
241
+ promote: "\uBBF8\uB9AC \uBCF4\uAE30 \uD655\uC778 \uD6C4 \uAC1C\uC778 Team\uC744 \uD68C\uC0AC Team\uC73C\uB85C \uC804\uD658\uD569\uB2C8\uB2E4.",
242
+ copy: "\uD68C\uC0AC Team\uC758 \uB3C5\uB9BD\uC801\uC778 \uAC1C\uC778 \uBCF5\uC0AC\uBCF8\uC744 \uB9CC\uB4ED\uB2C8\uB2E4."
243
+ }
244
+ };
245
+ function teamScopeCommand(action) {
246
+ const txt = scopeText[detectCliLocale()];
247
+ const endpoint = (ctx) => BASE_TEAM_PATH + "/" + encodeURIComponent(ctx.str("id")) + "/" + action;
248
+ return {
249
+ service: "team",
250
+ description: txt[action],
251
+ risk: "write",
252
+ flags: [
253
+ { name: "id", type: "string", required: true, desc: txt.id },
254
+ { name: "expected-revision", type: "string", desc: txt.revision }
255
+ ],
256
+ dryRun: (ctx) => kbApi(ctx, "GET", endpoint(ctx), { lang: detectCliLocale() }),
257
+ execute: (ctx) => {
258
+ const expectedRevision = ctx.str("expected-revision");
259
+ if (!expectedRevision) throw new Error(txt.required);
260
+ return kbApi(
261
+ ctx,
262
+ "POST",
263
+ endpoint(ctx),
264
+ { lang: detectCliLocale() },
265
+ { expectedRevision },
266
+ { preserveBusinessErrorCode: true }
267
+ );
268
+ }
269
+ };
270
+ }
271
+
272
+ // src/commands/te-team/team/promote-team.ts
273
+ var promoteTeam = {
274
+ command: "+promote",
275
+ ...teamScopeCommand("promote")
276
+ };
277
+
278
+ // src/commands/te-team/team/copy-team.ts
279
+ var copyTeam = {
280
+ command: "+copy-to-personal",
281
+ ...teamScopeCommand("copy")
282
+ };
283
+
205
284
  // src/commands/te-team/team/index.ts
206
285
  var commands = [
207
286
  listTeams,
208
287
  createTeam,
288
+ promoteTeam,
289
+ copyTeam,
209
290
  updateTeam,
210
291
  deleteTeam,
211
292
  aiGenerate,
@@ -1,14 +1,14 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  resolveMemoryApiBaseUrl
4
- } from "./chunk-QPUPWGZ3.js";
5
- import "./chunk-LXRALNNA.js";
6
- import "./chunk-CYZV5AXW.js";
4
+ } from "./chunk-DTODOQ6T.js";
5
+ import "./chunk-UK7HQ4IL.js";
6
+ import "./chunk-KE5WGBXS.js";
7
7
  import {
8
8
  CapabilityGatewayError,
9
9
  buildCapabilityGatewayUrl,
10
10
  callCapabilityApi
11
- } from "./chunk-VPLRZSMY.js";
11
+ } from "./chunk-STHIGWWC.js";
12
12
  import "./chunk-6E6HCTP2.js";
13
13
  import "./chunk-PUSFEC6B.js";
14
14
  import "./chunk-UWQXGF44.js";
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module'; const require =
2
2
  import {
3
3
  printError,
4
4
  printOutput
5
- } from "./chunk-JRXSLFCA.js";
5
+ } from "./chunk-KBJHBVO7.js";
6
6
  import {
7
7
  buildVersionInstallPlan,
8
8
  exactVersion,
@@ -14,7 +14,7 @@ import {
14
14
  missingAeHostHint,
15
15
  recordVersionSyncResult,
16
16
  rememberBusinessConfig
17
- } from "./chunk-DULCIC67.js";
17
+ } from "./chunk-SQEK6S4X.js";
18
18
  import {
19
19
  getLocalCliPackageInfo
20
20
  } from "./chunk-PUSFEC6B.js";
@@ -4,11 +4,11 @@ import {
4
4
  } from "./chunk-QOJXLXDJ.js";
5
5
  import {
6
6
  fetchSigned
7
- } from "./chunk-CYZV5AXW.js";
7
+ } from "./chunk-KE5WGBXS.js";
8
8
  import {
9
9
  CapabilityGatewayError,
10
10
  executeCapability
11
- } from "./chunk-VPLRZSMY.js";
11
+ } from "./chunk-STHIGWWC.js";
12
12
  import "./chunk-6E6HCTP2.js";
13
13
  import {
14
14
  assembleSyncJsonBody,
@@ -43,7 +43,7 @@ import {
43
43
  websiteEnvironment,
44
44
  websiteOrigin,
45
45
  withCliEntryContext
46
- } from "./chunk-DULCIC67.js";
46
+ } from "./chunk-SQEK6S4X.js";
47
47
  import {
48
48
  getLocalCliPackageInfo
49
49
  } from "./chunk-PUSFEC6B.js";
@@ -1291,6 +1291,59 @@ async function prepareExperimentReplay(options) {
1291
1291
  }
1292
1292
  }
1293
1293
 
1294
+ // src/core/onboarding/experiment-report-wait.ts
1295
+ function replayReportDates(receipt) {
1296
+ const zone = /^([+-])(\d{2}):(\d{2})$/.exec(receipt.timezone);
1297
+ if (!zone || Number(zone[2]) > 14 || Number(zone[3]) > 59 || Number(zone[2]) === 14 && Number(zone[3]) !== 0) throw new Error("The replay reporting timezone is invalid.");
1298
+ const offset = (Number(zone[2]) * 60 + Number(zone[3])) * 6e4 * (zone[1] === "-" ? -1 : 1);
1299
+ const start = Date.parse(receipt.start);
1300
+ const end = Date.parse(receipt.end);
1301
+ if (!Number.isFinite(start) || !Number.isFinite(end) || end < start) throw new Error("The replay interval is invalid.");
1302
+ return {
1303
+ start_time: new Date(start + offset).toISOString().slice(0, 10),
1304
+ end_time: new Date(end + offset).toISOString().slice(0, 10)
1305
+ };
1306
+ }
1307
+ function isReportPending(error, projectId) {
1308
+ if (!(error instanceof CapabilityGatewayError) || error.type === "validation" || error.httpStatus === 401 || error.httpStatus === 403) return false;
1309
+ const view = `hive.hermes.v_atlas_experiment_exposure_${projectId}`.replaceAll(".", "\\.");
1310
+ return new RegExp("\\bTable\\s+['\"`]?" + view + "['\"`]?\\s+does not exist\\b", "i").test(error.message) || /^(atlas\.service\.error\.report\.data_unavailable|Report data is temporarily unavailable\.|报告数据暂不可用|レポートデータを一時的に利用できません|리포트 데이터를 일시적으로 사용할 수 없습니다)/.test(error.message);
1311
+ }
1312
+ async function waitForExperimentSampleSize(query, input, budgetMs = 25e3, delayMs = 5e3) {
1313
+ const deadline = Date.now() + budgetMs;
1314
+ let attempts = 0;
1315
+ do {
1316
+ attempts++;
1317
+ try {
1318
+ const response = await query(
1319
+ { ...input, force_refresh: true },
1320
+ AbortSignal.timeout(Math.max(1, Math.min(NETWORK_BUDGET_MS, deadline - Date.now())))
1321
+ );
1322
+ if (!response || typeof response.report !== "object" || response.report === null) {
1323
+ throw new Error("The sample-size query returned no report.");
1324
+ }
1325
+ if (response.report.has_data !== false) {
1326
+ return { phase: "complete", next_action: "verify_experiment_results", report_dates: {
1327
+ start_time: input.start_time,
1328
+ end_time: input.end_time
1329
+ }, sample_size_report: response.report, report_query_attempts: attempts };
1330
+ }
1331
+ } catch (error) {
1332
+ if (!isReportPending(error, input.project_id) && !(error instanceof DOMException && ["TimeoutError", "AbortError"].includes(error.name))) throw error;
1333
+ }
1334
+ const remaining = deadline - Date.now();
1335
+ if (remaining <= 0) break;
1336
+ await new Promise((resolve) => setTimeout(resolve, Math.min(delayMs, remaining)));
1337
+ } while (Date.now() < deadline);
1338
+ return {
1339
+ phase: "pending",
1340
+ next_action: "wait_experiment_report",
1341
+ poll_after_ms: delayMs,
1342
+ report_dates: { start_time: input.start_time, end_time: input.end_time },
1343
+ report_query_attempts: attempts
1344
+ };
1345
+ }
1346
+
1294
1347
  // src/core/onboarding/experiment-launch.ts
1295
1348
  function isApprovalBlocker(error) {
1296
1349
  return error instanceof SecureStoreAuthError || error instanceof PermissionError || error instanceof CapabilityGatewayError && (error.httpStatus === 401 || error.httpStatus === 403 || error.type === "validation");
@@ -1336,7 +1389,7 @@ async function runOnboardingExperimentLaunch(store, deps, input, preview) {
1336
1389
  ...plan.approver ? [] : ["add_signed_in_approver_if_needed"],
1337
1390
  "approve",
1338
1391
  "start",
1339
- ...input.start_only ? [] : ["upload_one_replay_batch"]
1392
+ ...input.start_only ? [] : ["upload_one_replay_batch", ...input.wait_report ? ["wait_for_sample_size_report"] : []]
1340
1393
  ] };
1341
1394
  const key = session.credential_key;
1342
1395
  const checkAccount = () => {
@@ -1344,9 +1397,9 @@ async function runOnboardingExperimentLaunch(store, deps, input, preview) {
1344
1397
  throw new Error("Resume onboarding with the signed-in account that generated the Demo plan.");
1345
1398
  }
1346
1399
  };
1347
- const request2 = async (id, params) => {
1400
+ const request2 = async (id, params, waitSignal) => {
1348
1401
  checkAccount();
1349
- const signal = AbortSignal.timeout(NETWORK_BUDGET_MS);
1402
+ const signal = waitSignal ?? AbortSignal.timeout(NETWORK_BUDGET_MS);
1350
1403
  const response = await deps.capability(host, id, params, signal);
1351
1404
  signal.throwIfAborted();
1352
1405
  return response;
@@ -1372,7 +1425,34 @@ async function runOnboardingExperimentLaunch(store, deps, input, preview) {
1372
1425
  next_action: "verify_experiment_results"
1373
1426
  });
1374
1427
  const started = () => ({ ...result("running"), approval_state: "approved", next_action: "upload_experiment_replay" });
1375
- if (progress.replay?.status === "receiver_accepted") return completed();
1428
+ const finishReplay = async () => {
1429
+ const accepted = completed();
1430
+ if (!input.wait_report) return accepted;
1431
+ try {
1432
+ const receipt = store.read(`experiment-replay-${runId}.json`);
1433
+ if (!receipt || receipt.run_id !== runId || receipt.experiment_id !== progress.experiment_id || receipt.sample_id !== scope.sample_id || receipt.item_id !== scope.item_id) {
1434
+ throw new Error("The replay receipt does not match this Demo experiment.");
1435
+ }
1436
+ const dates = replayReportDates(receipt);
1437
+ const report = await waitForExperimentSampleSize(
1438
+ (params, signal) => request2("experiment.report.sample-size", params, signal),
1439
+ { project_id: scope.project_id, exp_id: progress.experiment_id, ...dates }
1440
+ );
1441
+ return { ...accepted, ...report };
1442
+ } catch (error) {
1443
+ return {
1444
+ ...accepted,
1445
+ phase: "action_required",
1446
+ failed_stage: "wait_experiment_report",
1447
+ next_action: "inspect_experiment_report",
1448
+ error: {
1449
+ message: error instanceof Error ? error.message : "The report query failed.",
1450
+ ...error instanceof CapabilityGatewayError ? { code: error.code, meta: error.meta } : {}
1451
+ }
1452
+ };
1453
+ }
1454
+ };
1455
+ if (progress.replay?.status === "receiver_accepted") return finishReplay();
1376
1456
  if (progress.replay) return { ...result("action_required"), next_action: "reconcile_replay_delivery" };
1377
1457
  let stage = "prepare_requests";
1378
1458
  const call = (id, params = {}) => request2(id, { ...project, ...params });
@@ -1624,7 +1704,7 @@ async function runOnboardingExperimentLaunch(store, deps, input, preview) {
1624
1704
  }
1625
1705
  progress.replay.status = "receiver_accepted";
1626
1706
  });
1627
- return completed();
1707
+ return finishReplay();
1628
1708
  } catch (error) {
1629
1709
  return {
1630
1710
  ...result("action_required"),
@@ -1774,7 +1854,7 @@ var defaults = {
1774
1854
  authorize: authorizeLoginDevice,
1775
1855
  poll: (issuer, code, signal) => pollDeviceToken(issuer, code, code.startsWith("uba_") ? "uba" : "legacy", signal),
1776
1856
  async persist(host, tokens, signal) {
1777
- const { persistDeviceTokens, activateHostAfterLogin } = await import("./auth-ERWVKQDG.js");
1857
+ const { persistDeviceTokens, activateHostAfterLogin } = await import("./auth-BD3NIY3T.js");
1778
1858
  await persistDeviceTokens(host, tokens, { signal, checkCompatibility: false });
1779
1859
  activateHostAfterLogin(host, host);
1780
1860
  },
@@ -13,12 +13,12 @@ import {
13
13
  workspaceResourcePath,
14
14
  workspaceTargetFlags,
15
15
  workspaceTargetPath
16
- } from "./chunk-SHB7A2JE.js";
16
+ } from "./chunk-2RORKIF6.js";
17
17
  import "./chunk-RK6GLDGI.js";
18
18
  import {
19
19
  getAgentBuffer
20
- } from "./chunk-LXRALNNA.js";
21
- import "./chunk-CYZV5AXW.js";
20
+ } from "./chunk-UK7HQ4IL.js";
21
+ import "./chunk-KE5WGBXS.js";
22
22
  import "./chunk-UWQXGF44.js";
23
23
  import "./chunk-IGU3R2JD.js";
24
24
  import "./chunk-MTK4ZE7W.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkingai/ae-cli",
3
- "version": "6.1.38",
3
+ "version": "6.1.40",
4
4
  "description": "CLI tool for ThinkingAI (AE) analytics platform",
5
5
  "type": "module",
6
6
  "bin": {
@@ -52,7 +52,7 @@
52
52
  "verify:retired-api-command": "node --test test/retired-api-command.test.mjs",
53
53
  "verify:analysis-common-tools": "node scripts/verify-te-common-tools.mjs",
54
54
  "verify:experiment-tools": "node scripts/verify-te-experiment-tools.mjs && node --import tsx test/experiment/experiment-capability-command.test.mjs && node --import tsx --test test/experiment/experiment-approval-command.test.mjs && node --import tsx test/experiment/traffic-domain-command.test.mjs",
55
- "verify:team-tools": "node scripts/verify-te-team-tools.mjs && node --import tsx --test tests/team-run-watch.test.ts test/team-run-start-command.test.mjs",
55
+ "verify:team-tools": "node scripts/verify-te-team-tools.mjs && node --import tsx --test tests/team-run-watch.test.ts test/team-run-start-command.test.mjs test/team-scope-command.test.mjs",
56
56
  "verify:evaluation-tools": "node scripts/verify-evaluation-tools.mjs && node --import tsx tests/evaluation-client.test.ts && node --import tsx tests/evaluation-sandbox-session.test.ts && node --import tsx tests/evaluation-security.test.ts && node --import tsx tests/evaluation-command-contract.test.ts && node --import tsx --test tests/evaluation-onboarding.test.ts",
57
57
  "verify:a2a": "node --import tsx --test tests/a2a-client.test.ts",
58
58
  "verify:agent-tools": "npm run verify:a2a && node --test test/agent-command-registry.test.mjs && tsx tests/te-agent-credentials.test.ts && tsx tests/te-agent-unified-auth.test.ts && node --import tsx --test tests/te-agent-env-isolation.test.ts && tsx tests/te-agent-conversations.test.ts && tsx scripts/verify-agent-tools.mjs && npm run verify:resource-package && npm run verify:approval && npm run verify:agent-distribution && npm run verify:agent-context && npm run verify:sandbox-tools && npm run verify:notifications",
@@ -101,7 +101,7 @@
101
101
  "verify:skill-businesses": "node --test test/release-gate-skill-businesses.test.mjs",
102
102
  "verify:notifications": "tsx tests/notification-command.test.ts",
103
103
  "verify:mcp-int64-request": "npx tsx tests/mcp-int64-request.test.ts",
104
- "verify:cli-source-logging": "node --import tsx --test tests/source-logged-fetch.test.ts",
104
+ "verify:cli-source-logging": "node --import tsx --test tests/source-logged-fetch.test.ts tests/cli-agent-context-transports.test.ts",
105
105
  "verify:capability-api": "npx tsx tests/capability-api.test.ts",
106
106
  "verify:community-ux": "npm run build && npx tsx tests/community-ux.test.ts",
107
107
  "verify:community-evidence": "node --import tsx tests/community-evidence.test.ts",
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: ae-automation
3
+ version: 1.1.2
3
4
  description: "Schedule AE platform automations: every day/week, daily reports, recurring reminders, monitoring, or repeat this task. Use ae-cli automation for persistent Agent/Agent Team tasks in the current space, instead of session-local CronCreate or /loop. Also manage schedules, runs, and results."
4
5
  ---
5
6
 
@@ -11,8 +12,11 @@ See [command risks](references/command_index.md). Read [the command contract](re
11
12
 
12
13
  1. Resolve the host and space. A local user signs in with `ae-cli auth login`; a sandbox uses the current conversation user's injected CLI token, never a shared sandbox's user binding. Pass `--agent-space-id` when the user identifies a space. Without an explicit space, the CLI inherits the current AgentSpace from its runtime context, working directory or verified current conversation; only a local invocation without space context uses the personal default. Show the resolved space when it matters.
13
14
  2. Discover the automation with `automation list` and inspect `automation get`. Use the returned IDs; names are not unique.
14
- 3. For creation, select an Agent or team through the corresponding discovery commands. Match configuration to the target type. Use `--weekdays` or `--days-of-month` JSON arrays for multiple days with one time; skip dates absent in a month. For the actual last day of every month use `--days-of-month '["L"]'`, or combine it with dates, e.g. `'[1,15,"L"]'`; overlapping selections execute only once. Both Agent and Agent Team accept result notifications. Confirm the complete configuration before creation; save only the recurring task instructions as `--message`, never the automation-creation guide. Preview writes with `--dry-run` when useful; the CLI shows a redacted request and asks the server to validate authentication, space, permissions, target state, fields, and idempotency without applying the operation.
15
- 4. Execute the requested operation. After creation, read back the returned automation ID with `automation get` and verify the saved space and configuration before reporting success; a local schedule or a promise to run later is not a platform creation receipt. Deleting an automation or stopping an execution requires confirmation; use `--yes` only when the user already authorized that action. In a non-interactive shell, these operations fail immediately unless global `--yes` is present.
15
+ 3. For creation, select an Agent or team through the corresponding discovery commands. Match configuration to the target type. Use `--weekdays` or `--days-of-month` JSON arrays for multiple days with one time; skip dates absent in a month. For the actual last day of every month use `--days-of-month '["L"]'`, or combine it with dates, e.g. `'[1,15,"L"]'`; overlapping selections execute only once. Both Agent and Agent Team accept result notifications. Save only the recurring task instructions as `--message`.
16
+ - In a conversation, run `ae-cli automation create --dry-run` for each new task, including a second task in the same chat or one that will start paused. Show the name, space, target, task instructions, schedule, model and depth, notifications, conversation mode and initial state, including any immediate run. Ask the user to confirm this preview and wait for their reply. Use AskUserQuestion when available. Selecting a target or answering a clarification only completes the preview. A changed configuration needs a new preview and confirmation. A cancellation ends that draft. Only an explicit reply approving this task authorizes one creation.
17
+ - For a single Agent, include reasoning depth in the confirmation. If no depth was requested, use adaptive without asking or copying the current conversation's setting. For an explicit depth, pass `--effort low|medium|high|max`. If the request is ambiguous or conflicting, clarify before creating.
18
+ - In a shared workspace, select an enabled company Team. A personal Team is only a valid target in a personal workspace; do not silently switch workspace or Team. For an Agent Team, ignore any requested depth, even an unrecognized one. Use the team's own settings and continue without asking about depth. For a request to change only Team depth, use the CLI update with the supplied effort to verify permission. A successful `unchanged: true` means the override was ignored and the team still uses its own settings. With a mixed update, report the fields that were saved and the ignored depth separately.
19
+ 4. Execute the requested operation. After creation, read back the returned automation ID with `automation get` and verify the saved space and configuration, including the Agent effort (`null` means adaptive) before reporting success. Link to the returned `detailPath` including its `agentSpaceId` query. A local schedule or a promise to run later is not a platform creation receipt. Deleting an automation or stopping an execution requires confirmation; use `--yes` only when the user already authorized that action. In a non-interactive shell, these operations fail immediately unless global `--yes` is present.
16
20
  5. Read the returned run ID, then `automation runs result`. Report acceptance separately from completion. Use `--wait` only when the user needs the final outcome now.
17
21
 
18
22
  Results are read from the server and work outside the sandbox. This skill does not read complete conversations or continue a chat. Never infer an output from a different execution sharing the same conversation.
@@ -1,5 +1,7 @@
1
1
  # Automation command contract
2
2
 
3
+ Shared workspace automations require an enabled company Team. Personal Teams can be used in personal workspaces. Validate the saved workspace and target in the server dry-run.
4
+
3
5
  Transition status: transitional
4
6
  Owning module: te-claude automation and team scheduling
5
7
  Current transport: authenticated TE REST /api/cli/automation/v1
@@ -11,7 +13,7 @@ Exit condition: equivalent gateway capabilities preserve permissions, idempotenc
11
13
 
12
14
  - `ae-cli automation list [--agent-space-id ID] [--target-type agent|team] [--q NAME] [--status active|paused] [--limit 20] [--cursor CURSOR]`
13
15
  - `ae-cli automation get --id ID`
14
- - `ae-cli automation create --target-type agent --agent-id ID --name NAME --message TEXT --schedule-kind daily --time 09:00 [--model MODEL_CONFIG_ID] [--reuse-conversation true|false]`
16
+ - `ae-cli automation create --target-type agent --agent-id ID --name NAME --message TEXT --schedule-kind daily --time 09:00 [--model MODEL_CONFIG_ID] [--effort adaptive|low|medium|high|max] [--reuse-conversation true|false]`
15
17
  - `ae-cli automation create --target-type team --team-id ID --name NAME --message TEXT --trigger-type manual [--scope JSON] [--channels JSON_ARRAY]`
16
18
  - `ae-cli automation update --id ID --target-type agent|team <changed fields>`
17
19
  - `ae-cli automation enable|disable --id ID`
@@ -19,7 +21,11 @@ Exit condition: equivalent gateway capabilities preserve permissions, idempotenc
19
21
 
20
22
  Scheduled creation needs `--schedule-kind` or `--cron-expression`. Frequencies: hourly with `--minute 0..59`; daily with `--time HH:mm`; weekly also `--weekdays '[1,3,5]'` (0=Sunday through 6=Saturday); monthly also `--days-of-month '[1,15,31]'` (integers 1–31 and `"L"` for the actual last day of the month). Existing single-day flags `--weekday 0..6` and `--day-of-month 1..31` remain supported; do not combine a single-day flag with its plural array. Arrays must be non-empty; duplicates are removed and dates sorted. Dates absent in the current month are skipped, never shifted into the next month. `"L"` follows the actual month end in the server timezone (including leap years). It can be selected alone or with numeric dates; overlapping selections at the same time run only once. Any minute 00–59 is valid in `--time`. Times use the server timezone. Manual creation does not require a schedule. `--trigger-immediately` executes after creation; `--wait` then waits for that execution. Creation and immediate execution have separate results: do not create another automation if only its execution failed.
21
23
 
22
- On update, omitted fields retain their values. `--model null`, `--scope null`, destination IDs set to `null`, and `--save-to-knowledge-base-id null` clear nullable fields. `--channels '[]'` clears notifications; `--clear-message` clears instructions; `--reuse-conversation false` disables reuse. An automation's target is immutable on update. Team fields are rejected for Agent targets and vice versa.
24
+ On update, omitted fields retain their values. `--model null`, `--scope null`, destination IDs set to `null`, and `--save-to-knowledge-base-id null` clear nullable fields. `--channels '[]'` clears notifications; `--clear-message` clears instructions; `--reuse-conversation false` disables reuse. An automation's target is immutable on update. Target-specific fields are rejected on the other target, except for `--effort` on Team automations.
25
+
26
+ For a single Agent, `--effort` accepts `adaptive`, `low`, `medium`, `high`, or `max`. Omit it on create for adaptive reasoning. Omit it on update to keep the saved depth, or pass `--effort adaptive` to clear an override. Verify the saved `effort` with `automation get` (`null` means adaptive). Never infer a depth from the current chat.
27
+
28
+ For an Agent Team, ignore any `--effort` value before validating the other fields. Create or update with the remaining settings. An update containing only `--effort` verifies the existing target and update permission and returns `unchanged: true` without writing. Preflight and successful command results identify an explicit Team depth in `ignoredFields: ["effort"]`. An effort-only success means the team kept its own settings. For a mixed update, report the saved changes and the ignored depth. Report permission and validation errors from their error envelope.
23
29
 
24
30
  Team configuration supports `--scope`, `--channels`, `--feishu-chat-id`, `--lark-chat-id`, `--slack-channel-id`, `--save-to-knowledge-base-id`. Other supported notification channels use the team's existing notification configuration. Team visibility and management permissions follow the Web application.
25
31
 
@@ -58,7 +64,7 @@ Agent and Agent Team both accept `--channels '["feishu","slack"]'`, `--feishu-ch
58
64
 
59
65
  Automation requests use the current user's `cli-token`, including in a shared sandbox. They do not infer an owner from `SandboxUser` or fall back to a different member. `--agent-space-id` takes precedence over `TE_AGENT_CURRENT_AGENT_SPACE_ID` or the current AgentSpace working directory. When the shell has changed directories, `TE_AGENT_CONVERSATION_ID` resolves the space through the existing authenticated workspace target API; a resolution failure never falls back to the personal space. Membership and write permissions are enforced by the server.
60
66
 
61
- For conversational creation, keep the supplied prompt editable until the user sends it. Resolve missing or ambiguous targets, summarize the configuration and obtain confirmation before creating. Agent runs inherit its model unless explicitly overridden; Agent Team retains its own configuration. Omit `--trigger-immediately` unless the user requests an immediate run.
67
+ For conversational creation, keep the supplied prompt editable until the user sends it. Resolve missing or ambiguous targets, then run `automation create --dry-run` and present the complete draft. Wait for the user to approve that specific preview before the real create, including paused tasks. Each new task in the same chat and each revised configuration requires a fresh preview and confirmation. A clarification or an earlier approval does not authorize this write. After saving, share the complete `detailPath` returned by `automation get`, including the space query. A single Agent inherits its model unless explicitly overridden. Include its reasoning depth (adaptive by default) in the confirmation and ask only about ambiguous or conflicting depth requests. For an Agent Team, ignore any requested depth and state that the team uses its own settings. Omit `--trigger-immediately` unless the user requests an immediate run.
62
68
 
63
69
  ## Multi-date examples
64
70
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ae-engage
3
- version: 1.0.1
3
+ version: 1.0.2
4
4
  description: "AE Engage capability gateway: config center, flows, push/config channels, strategies, templates, task management, operation activities, and query lifecycle. Trigger words: config center, scene config, push channel, config channel, operation strategy, operation task, operation activity, query lifecycle, template, config item, Engage, Hermes, engage-scene, engage-setting, engage-flow, engage-task, engage-activity, engage-query."
5
5
  ---
6
6
 
@@ -170,6 +170,11 @@ ae-cli engage-setting common-metric update --project-id <project_id> --metric-ty
170
170
  ae-cli engage-setting common-metric delete --project-id <project_id> --metric-name <name> --yes
171
171
  ```
172
172
 
173
+ Common metrics support rolling windows and natural day/week/month windows via
174
+ `--time-cycle-def`. Read [common-metric.md](references/common-metric.md) for the public
175
+ snake_case definition, update omission/null semantics, and required backend support.
176
+
177
+
173
178
  ### 2. task
174
179
 
175
180
  ```bash