@thinkingai/ae-cli 1.0.27 → 1.0.28

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 (88) hide show
  1. package/dist/auth-5NSDQFQB.js +454 -0
  2. package/dist/{auth-TXFJHPXU.js → auth-H2376DEF.js} +2 -3
  3. package/dist/chunk-AD5V3ZPJ.js +217 -0
  4. package/dist/chunk-CAQYQA4R.js +399 -0
  5. package/dist/{chunk-B4UL2VIJ.js → chunk-CLJF7MQA.js} +1 -1
  6. package/dist/chunk-GSJGPNKK.js +49 -0
  7. package/dist/{chunk-6T7245YE.js → chunk-IMBKVXKY.js} +8 -8
  8. package/dist/chunk-KAEZTSXN.js +99 -0
  9. package/dist/{chunk-VT6VC4PA.js → chunk-LU7SXK4Q.js} +24 -11
  10. package/dist/chunk-OJDNO5QY.js +63 -0
  11. package/dist/chunk-SRJIAOBN.js +244 -0
  12. package/dist/{chunk-2NGWYMLB.js → chunk-WCHI7725.js} +45 -50
  13. package/dist/{client-IU2E5IOL.js → client-FCMK3XEK.js} +3 -4
  14. package/dist/config-64G36TJL.js +130 -0
  15. package/dist/index.js +28 -23
  16. package/dist/{model-CC7U5XOJ.js → model-EZ6K7FXI.js} +15 -12
  17. package/dist/{raw-TUHZQ4UB.js → raw-VEF3D6UD.js} +11 -7
  18. package/dist/{sync-EVEDS7YE.js → sync-NRODEVNH.js} +36 -34
  19. package/dist/{te-agent-FLTDYV3L.js → te-agent-7U7JLJKU.js} +25 -23
  20. package/dist/{te-analysis-CMXADIJM.js → te-analysis-A2OSGHQ4.js} +59 -13
  21. package/dist/{te-audience-LPZFFSXM.js → te-audience-LI67PPGO.js} +5 -5
  22. package/dist/{te-common-BXQFKTB3.js → te-common-35WVU3C5.js} +19 -9
  23. package/dist/{te-community-K5S3VOZY.js → te-community-LEAP6PWT.js} +4 -4
  24. package/dist/{te-dataops-567IMCQG.js → te-dataops-N2LGZBOX.js} +4 -4
  25. package/dist/{te-engage-TBUTGW5F.js → te-engage-H7C72Z46.js} +4 -4
  26. package/dist/{te-kb-XHVBWP5E.js → te-kb-I2OKTBAI.js} +5 -5
  27. package/dist/{te-meta-NQ4U3VJW.js → te-meta-HBTIEDRO.js} +4 -4
  28. package/dist/{te-team-556APRIU.js → te-team-EM5OWRQL.js} +7 -7
  29. package/package.json +6 -2
  30. package/skills/ae-agent/SKILL.md +1 -0
  31. package/skills/ae-analysis/SKILL.md +1 -1
  32. package/skills/ae-analysis/references/list_clusters.md +4 -2
  33. package/skills/ae-analysis-global/SKILL.md +51 -0
  34. package/skills/ae-analysis-global/references/list_query_clusters.md +67 -0
  35. package/skills/ae-community/SKILL.md +2 -3
  36. package/skills/ae-dataops/SKILL.md +1 -2
  37. package/skills/ae-engage/SKILL.md +1 -0
  38. package/skills/ae-engage/references/add-approver.md +0 -1
  39. package/skills/ae-engage/references/add-channel.md +0 -1
  40. package/skills/ae-engage/references/approver-list.md +0 -1
  41. package/skills/ae-engage/references/cancel-query-by-request-id.md +0 -1
  42. package/skills/ae-engage/references/channel-detail.md +0 -1
  43. package/skills/ae-engage/references/channel-list.md +0 -1
  44. package/skills/ae-engage/references/config-channel-detail.md +0 -1
  45. package/skills/ae-engage/references/config-channel-list.md +0 -1
  46. package/skills/ae-engage/references/config-item-analysis-report.md +0 -1
  47. package/skills/ae-engage/references/config-item-detail.md +0 -1
  48. package/skills/ae-engage/references/config-item-list.md +0 -1
  49. package/skills/ae-engage/references/config-item-strategy-comparison.md +0 -1
  50. package/skills/ae-engage/references/config-item-trigger-report.md +0 -1
  51. package/skills/ae-engage/references/copy-config-template.md +0 -1
  52. package/skills/ae-engage/references/delete-channel.md +0 -1
  53. package/skills/ae-engage/references/delete-config-channel.md +0 -1
  54. package/skills/ae-engage/references/delete-config-item.md +0 -1
  55. package/skills/ae-engage/references/delete-flow.md +0 -1
  56. package/skills/ae-engage/references/flow-ab-split-node-report.md +0 -1
  57. package/skills/ae-engage/references/flow-detail.md +0 -1
  58. package/skills/ae-engage/references/flow-list.md +0 -1
  59. package/skills/ae-engage/references/flow-node-config-schema.md +0 -1
  60. package/skills/ae-engage/references/flow-node-detail-report.md +0 -1
  61. package/skills/ae-engage/references/flow-node-overview-report.md +0 -1
  62. package/skills/ae-engage/references/flow-process-report.md +0 -1
  63. package/skills/ae-engage/references/manage-flow.md +0 -1
  64. package/skills/ae-engage/references/manage-strategy.md +0 -1
  65. package/skills/ae-engage/references/manage-task.md +0 -1
  66. package/skills/ae-engage/references/modify-flow-base-info.md +0 -1
  67. package/skills/ae-engage/references/strategy-detail.md +0 -1
  68. package/skills/ae-engage/references/strategy-list.md +0 -1
  69. package/skills/ae-engage/references/task-data-detail.md +0 -1
  70. package/skills/ae-engage/references/task-data-overview.md +0 -1
  71. package/skills/ae-engage/references/task-detail.md +0 -1
  72. package/skills/ae-engage/references/task-experiment-report.md +0 -1
  73. package/skills/ae-engage/references/task-list.md +0 -1
  74. package/skills/ae-engage/references/task-metric-detail.md +0 -1
  75. package/skills/ae-engage/references/task-stats.md +0 -1
  76. package/skills/ae-engage/references/update-channel-status.md +0 -1
  77. package/skills/ae-engage/references/update-config-channel-status.md +0 -1
  78. package/skills/ae-engage/references/validate-flow-node-config.md +0 -1
  79. package/skills/ae-engage/references/whitelist-list.md +0 -1
  80. package/skills/ae-kb/SKILL.md +1 -0
  81. package/skills/ae-team/SKILL.md +1 -1
  82. package/dist/auth-W2JZ3DKA.js +0 -170
  83. package/dist/chunk-BI5ZVD6T.js +0 -186
  84. package/dist/chunk-MNHE6SSI.js +0 -79
  85. package/dist/chunk-MWWYGZ76.js +0 -130
  86. package/dist/chunk-SRRUNQIM.js +0 -312
  87. package/dist/chunk-TG64AQV4.js +0 -262
  88. package/dist/config-WH3R3IRY.js +0 -258
@@ -2,10 +2,12 @@ import {
2
2
  callMcpTool,
3
3
  parseMcpResult,
4
4
  resolveMcpUrl
5
- } from "./chunk-2NGWYMLB.js";
6
- import "./chunk-SRRUNQIM.js";
7
- import "./chunk-BI5ZVD6T.js";
8
- import "./chunk-MNHE6SSI.js";
5
+ } from "./chunk-WCHI7725.js";
6
+ import {
7
+ isGlobalQueryModeEnabled
8
+ } from "./chunk-GSJGPNKK.js";
9
+ import "./chunk-CAQYQA4R.js";
10
+ import "./chunk-SRJIAOBN.js";
9
11
 
10
12
  // src/commands/te-analysis/shared.ts
11
13
  function createMcpCommand(config) {
@@ -56,6 +58,24 @@ function optionalJsonString(ctx, name) {
56
58
  function requiredJsonString(ctx, name) {
57
59
  return JSON.stringify(ctx.json(name));
58
60
  }
61
+ function clusterQueryFlags(scopeDesc) {
62
+ if (!isGlobalQueryModeEnabled()) {
63
+ return [];
64
+ }
65
+ return [
66
+ { name: "cluster_query_scope", type: "string", required: false, desc: scopeDesc },
67
+ { name: "slave_cluster_id", type: "string", required: false, desc: "Slave cluster ID. Required when cluster_query_scope=SLAVE. Use +list_query_clusters first to choose this value." }
68
+ ];
69
+ }
70
+ function optionalClusterQueryArgs(ctx) {
71
+ if (!isGlobalQueryModeEnabled()) {
72
+ return {};
73
+ }
74
+ return {
75
+ clusterQueryScope: optionalString(ctx, "cluster_query_scope"),
76
+ slaveClusterId: optionalString(ctx, "slave_cluster_id")
77
+ };
78
+ }
59
79
  var DEFAULT_QUERY_LIMIT = 1e3;
60
80
  var MAX_QUERY_LIMIT = 1e5;
61
81
  function assertLimitWithinCap(value, flagName) {
@@ -249,7 +269,8 @@ var queryReportData = createMcpCommand({
249
269
  { name: "start_date", type: "string", required: false, desc: "Optional start date in yyyy-MM-dd format" },
250
270
  { name: "end_date", type: "string", required: false, desc: "Optional end date in yyyy-MM-dd format" },
251
271
  { name: "time_granularity", type: "string", required: false, desc: "Optional time granularity used to override the report default. Supported values: minute, minute5, minute10, hour, day, week, month, quarter, year, total." },
252
- { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
272
+ { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." },
273
+ ...clusterQueryFlags("Optional cluster query scope. Supported values: GLOBAL, SLAVE. Omit to query the current self cluster.")
253
274
  ],
254
275
  risk: "read",
255
276
  buildArgs: (ctx) => ({
@@ -262,7 +283,8 @@ var queryReportData = createMcpCommand({
262
283
  startDate: optionalString(ctx, "start_date"),
263
284
  endDate: optionalString(ctx, "end_date"),
264
285
  timeGranularity: optionalString(ctx, "time_granularity"),
265
- timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
286
+ timeoutMinutes: optionalNumber(ctx, "timeout_minutes"),
287
+ ...optionalClusterQueryArgs(ctx)
266
288
  })
267
289
  });
268
290
 
@@ -350,7 +372,8 @@ var queryDashboardReportData = createMcpCommand({
350
372
  { name: "end_date", type: "string", required: false, desc: "Optional end date in yyyy-MM-dd format" },
351
373
  { name: "time_granularity", type: "string", required: false, desc: "Optional time granularity used to override the report default. Supported values: minute, minute5, minute10, hour, day, week, month, quarter, year, total." },
352
374
  { name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
353
- { name: "report_ids", type: "json", required: false, desc: "Optional report IDs JSON array" }
375
+ { name: "report_ids", type: "json", required: false, desc: "Optional report IDs JSON array" },
376
+ ...clusterQueryFlags("Optional cluster query scope. Supported values: GLOBAL, SLAVE. Omit to follow dashboard configuration.")
354
377
  ],
355
378
  risk: "read",
356
379
  buildArgs: (ctx) => ({
@@ -361,7 +384,8 @@ var queryDashboardReportData = createMcpCommand({
361
384
  endDate: optionalString(ctx, "end_date"),
362
385
  timeGranularity: optionalString(ctx, "time_granularity"),
363
386
  useCache: optionalBoolean(ctx, "use_cache"),
364
- reportIds: optionalJson(ctx, "report_ids")
387
+ reportIds: optionalJson(ctx, "report_ids"),
388
+ ...optionalClusterQueryArgs(ctx)
365
389
  })
366
390
  });
367
391
 
@@ -562,7 +586,8 @@ var queryAdhoc = createMcpCommand({
562
586
  { name: "fields", type: "json", required: false, desc: "Optional fields to return. Must match column names in result." },
563
587
  { name: "limit", type: "number", required: false, desc: "Optional limit. Default: 1000, maximum: 100000. For model_type=sql, either omit LIMIT in the SQL or keep it equal to --limit (the two must not differ)." },
564
588
  { name: "offset", type: "number", required: false, desc: "Optional offset. Default: 0." },
565
- { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
589
+ { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." },
590
+ ...clusterQueryFlags("Optional cluster query scope. Supported values: GLOBAL, SLAVE. Omit to query the current self cluster. SQL model analysis does not support this parameter.")
566
591
  ],
567
592
  risk: "read",
568
593
  validate: (ctx) => {
@@ -584,7 +609,8 @@ var queryAdhoc = createMcpCommand({
584
609
  fields: optionalJson(ctx, "fields"),
585
610
  limit: resolveSqlAwareLimit(optionalNumber(ctx, "limit"), ctx.str("model_type"), ctx.json("qp")),
586
611
  offset: optionalNumber(ctx, "offset"),
587
- timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
612
+ timeoutMinutes: optionalNumber(ctx, "timeout_minutes"),
613
+ ...optionalClusterQueryArgs(ctx)
588
614
  })
589
615
  });
590
616
 
@@ -1069,16 +1095,36 @@ var commands6 = [
1069
1095
  ];
1070
1096
  var schema_default = commands6;
1071
1097
 
1072
- // src/commands/te-analysis/index.ts
1098
+ // src/commands/te-analysis/global/list-query-clusters.ts
1099
+ var listQueryClusters = createMcpCommand({
1100
+ command: "+list_query_clusters",
1101
+ description: "List query cluster options accessible to the current account in the project. Use this to decide whether to query the current self cluster, global aggregated data, or one specific slave cluster.",
1102
+ flags: [
1103
+ { name: "project_id", type: "number", required: true, desc: "Project ID used to resolve cluster query permissions", alias: "p" }
1104
+ ],
1105
+ risk: "read",
1106
+ buildArgs: (ctx) => ({
1107
+ projectId: ctx.num("project_id")
1108
+ })
1109
+ });
1110
+
1111
+ // src/commands/te-analysis/global/index.ts
1073
1112
  var commands7 = [
1113
+ listQueryClusters
1114
+ ];
1115
+ var global_default = commands7;
1116
+
1117
+ // src/commands/te-analysis/index.ts
1118
+ var commands8 = [
1074
1119
  ...meta_default,
1075
1120
  ...report_default,
1076
1121
  ...dashboard_default,
1077
1122
  ...model_default,
1078
1123
  ...entity_default,
1079
- ...schema_default
1124
+ ...schema_default,
1125
+ ...isGlobalQueryModeEnabled() ? global_default : []
1080
1126
  ];
1081
- var te_analysis_default = commands7;
1127
+ var te_analysis_default = commands8;
1082
1128
  export {
1083
1129
  te_analysis_default as default
1084
1130
  };
@@ -2,10 +2,10 @@ import {
2
2
  callMcpTool,
3
3
  parseMcpResult,
4
4
  resolveMcpUrl
5
- } from "./chunk-2NGWYMLB.js";
6
- import "./chunk-SRRUNQIM.js";
7
- import "./chunk-BI5ZVD6T.js";
8
- import "./chunk-MNHE6SSI.js";
5
+ } from "./chunk-WCHI7725.js";
6
+ import "./chunk-GSJGPNKK.js";
7
+ import "./chunk-CAQYQA4R.js";
8
+ import "./chunk-SRJIAOBN.js";
9
9
 
10
10
  // src/commands/te-audience/shared.ts
11
11
  function createMcpCommand(config) {
@@ -59,7 +59,7 @@ function requiredJsonString(ctx, name) {
59
59
  // src/commands/te-audience/cluster/list-clusters.ts
60
60
  var listClusters = createMcpCommand({
61
61
  command: "+list_clusters",
62
- description: "List cluster metadata with optional query/fields/limit/offset",
62
+ description: "List user cohort/segment cluster metadata with optional query/fields/limit/offset.",
63
63
  flags: [
64
64
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
65
65
  { name: "query", type: "string", required: false, desc: "Keyword filter", alias: "q" },
@@ -2,10 +2,10 @@ import {
2
2
  callMcpTool,
3
3
  parseMcpResult,
4
4
  resolveMcpUrl
5
- } from "./chunk-2NGWYMLB.js";
6
- import "./chunk-SRRUNQIM.js";
7
- import "./chunk-BI5ZVD6T.js";
8
- import "./chunk-MNHE6SSI.js";
5
+ } from "./chunk-WCHI7725.js";
6
+ import "./chunk-GSJGPNKK.js";
7
+ import "./chunk-CAQYQA4R.js";
8
+ import "./chunk-SRJIAOBN.js";
9
9
 
10
10
  // src/commands/te-common/shared.ts
11
11
  function createMcpCommand(config) {
@@ -49,15 +49,25 @@ var commands = [
49
49
  var project_default = commands;
50
50
 
51
51
  // src/commands/te-common/resource/get-resource-url.ts
52
- function normalizeResourceUrlFields(node) {
52
+ function normalizeResourceUrlFields(node, host) {
53
53
  if (!node || typeof node !== "object") return;
54
54
  const obj = node;
55
- for (const value of Object.values(obj)) {
56
- if (value && typeof value === "object") {
57
- normalizeResourceUrlFields(value);
55
+ for (const [key, value] of Object.entries(obj)) {
56
+ if (typeof value === "string") {
57
+ if (/url|link/i.test(key) || value.includes("/#/")) {
58
+ obj[key] = absolutizeRelativeUrls(value, host);
59
+ }
60
+ } else if (value && typeof value === "object") {
61
+ normalizeResourceUrlFields(value, host);
58
62
  }
59
63
  }
60
64
  }
65
+ function absolutizeRelativeUrls(s, host) {
66
+ const base = host.replace(/\/+$/, "");
67
+ s = s.replace(/\]\((\/(?!\/)[^)]*)\)/g, `](${base}$1)`);
68
+ if (/^\/(?!\/)/.test(s)) s = base + s;
69
+ return s;
70
+ }
61
71
  var getResourceUrl = {
62
72
  service: "analysis_common",
63
73
  command: "+get_resource_url",
@@ -96,7 +106,7 @@ var getResourceUrl = {
96
106
  if (typeof parsed !== "object" || parsed === null) {
97
107
  return parsed;
98
108
  }
99
- normalizeResourceUrlFields(parsed);
109
+ normalizeResourceUrlFields(parsed, ctx.host());
100
110
  return parsed;
101
111
  }
102
112
  };
@@ -3,10 +3,10 @@ import {
3
3
  parseMcpResult,
4
4
  registerMcpMappings,
5
5
  resolveMcpUrl
6
- } from "./chunk-2NGWYMLB.js";
7
- import "./chunk-SRRUNQIM.js";
8
- import "./chunk-BI5ZVD6T.js";
9
- import "./chunk-MNHE6SSI.js";
6
+ } from "./chunk-WCHI7725.js";
7
+ import "./chunk-GSJGPNKK.js";
8
+ import "./chunk-CAQYQA4R.js";
9
+ import "./chunk-SRJIAOBN.js";
10
10
 
11
11
  // src/commands/te-community/get_channel_info.ts
12
12
  var getChannelInfo = {
@@ -3,10 +3,10 @@ import {
3
3
  parseMcpResult,
4
4
  registerMcpMappings,
5
5
  resolveMcpUrl
6
- } from "./chunk-2NGWYMLB.js";
7
- import "./chunk-SRRUNQIM.js";
8
- import "./chunk-BI5ZVD6T.js";
9
- import "./chunk-MNHE6SSI.js";
6
+ } from "./chunk-WCHI7725.js";
7
+ import "./chunk-GSJGPNKK.js";
8
+ import "./chunk-CAQYQA4R.js";
9
+ import "./chunk-SRJIAOBN.js";
10
10
 
11
11
  // src/commands/te-dataops/datatable/list-tables-by-page.ts
12
12
  var listTablesByPage = {
@@ -3,10 +3,10 @@ import {
3
3
  parseMcpResult,
4
4
  registerMcpMappings,
5
5
  resolveMcpUrl
6
- } from "./chunk-2NGWYMLB.js";
7
- import "./chunk-SRRUNQIM.js";
8
- import "./chunk-BI5ZVD6T.js";
9
- import "./chunk-MNHE6SSI.js";
6
+ } from "./chunk-WCHI7725.js";
7
+ import "./chunk-GSJGPNKK.js";
8
+ import "./chunk-CAQYQA4R.js";
9
+ import "./chunk-SRJIAOBN.js";
10
10
 
11
11
  // src/commands/te-engage/utils.ts
12
12
  function buildMcpDryRun(ctx, serviceName46, toolName46, args) {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  kbApi,
3
3
  kbUpload
4
- } from "./chunk-MWWYGZ76.js";
5
- import "./chunk-2NGWYMLB.js";
6
- import "./chunk-SRRUNQIM.js";
7
- import "./chunk-BI5ZVD6T.js";
8
- import "./chunk-MNHE6SSI.js";
4
+ } from "./chunk-OJDNO5QY.js";
5
+ import "./chunk-WCHI7725.js";
6
+ import "./chunk-GSJGPNKK.js";
7
+ import "./chunk-CAQYQA4R.js";
8
+ import "./chunk-SRJIAOBN.js";
9
9
 
10
10
  // src/commands/te-kb/query.ts
11
11
  var API_PATH = "/agent/api/external/knowledge-bases/query";
@@ -2,10 +2,10 @@ import {
2
2
  callMcpTool,
3
3
  parseMcpResult,
4
4
  resolveMcpUrl
5
- } from "./chunk-2NGWYMLB.js";
6
- import "./chunk-SRRUNQIM.js";
7
- import "./chunk-BI5ZVD6T.js";
8
- import "./chunk-MNHE6SSI.js";
5
+ } from "./chunk-WCHI7725.js";
6
+ import "./chunk-GSJGPNKK.js";
7
+ import "./chunk-CAQYQA4R.js";
8
+ import "./chunk-SRJIAOBN.js";
9
9
 
10
10
  // src/commands/te-meta/shared.ts
11
11
  function createMcpCommand(config) {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  kbApi
3
- } from "./chunk-MWWYGZ76.js";
3
+ } from "./chunk-OJDNO5QY.js";
4
4
  import {
5
5
  printError,
6
6
  printOutput
7
- } from "./chunk-B4UL2VIJ.js";
8
- import "./chunk-2NGWYMLB.js";
9
- import "./chunk-SRRUNQIM.js";
10
- import "./chunk-BI5ZVD6T.js";
11
- import "./chunk-MNHE6SSI.js";
7
+ } from "./chunk-CLJF7MQA.js";
8
+ import "./chunk-WCHI7725.js";
9
+ import "./chunk-GSJGPNKK.js";
10
+ import "./chunk-CAQYQA4R.js";
11
+ import "./chunk-SRJIAOBN.js";
12
12
 
13
13
  // src/commands/te-team/shared.ts
14
14
  var API_PREFIX = process.env.AE_API_PREFIX ?? "/agent";
@@ -176,7 +176,7 @@ var listTemplates = {
176
176
  };
177
177
 
178
178
  // src/commands/te-team/team/list-projects.ts
179
- var OAUTH_CHECK_PATH = "/api/oauth/check";
179
+ var OAUTH_CHECK_PATH = `${API_PREFIX}/api/oauth/check`;
180
180
  var listProjects = {
181
181
  service: "team",
182
182
  command: "+list-projects",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkingai/ae-cli",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "CLI tool for ThinkingAI (AE) analytics platform",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,13 +16,17 @@
16
16
  "scripts": {
17
17
  "dev": "tsx src/index.ts",
18
18
  "build": "tsup src/index.ts --format esm --outDir dist",
19
- "verify:analysis-tools": "node scripts/verify-te-analysis-tools.mjs",
19
+ "verify:config": "node test/config-commands.test.mjs",
20
+ "verify:analysis-tools": "tsx scripts/verify-te-analysis-tools.mjs",
21
+ "verify:analysis-cluster-routing": "node scripts/verify-analysis-cluster-routing.mjs",
22
+ "verify:multi-cluster-mode": "node test/multi-cluster-mode.test.mjs",
20
23
  "verify:analysis-builder-dry-run": "node scripts/verify-te-analysis-builder-dry-run.mjs",
21
24
  "verify:analysis-audience-tools": "node scripts/verify-te-audience-tools.mjs",
22
25
  "verify:analysis-meta-tools": "node scripts/verify-te-meta-tools.mjs",
23
26
  "verify:analysis-common-tools": "node scripts/verify-te-common-tools.mjs",
24
27
  "verify:team-tools": "node scripts/verify-te-team-tools.mjs",
25
28
  "verify:agent-tools": "node scripts/verify-agent-tools.mjs",
29
+ "verify:self-check-overlay": "node test/self-check-overlay.test.mjs",
26
30
  "verify:update-check": "npx tsx test/update-check.test.mjs",
27
31
  "self-check": "node self-check/scan.mjs",
28
32
  "check:agents-docs": "node scripts/check-agents-docs-sync.mjs",
@@ -21,6 +21,7 @@ ae-cli agent +<command> [options]
21
21
  - Toggle operations on company/system resources only affect the current user's preference, not the global state.
22
22
  - JSON flags must be valid JSON strings, usually wrapped in single quotes in shell.
23
23
  - Successful commands return JSON by default. Use `--format table` when a table is easier to scan.
24
+ - `--host <url>` overrides the active AE host. It is available on every command and may be placed after the subcommand, e.g. `ae-cli agent +<command> --host <url>`.
24
25
 
25
26
  ## Commands
26
27
 
@@ -6,7 +6,6 @@ description: "AE/TE/ThinkingEngine/ThinkingAI ae-cli manual for analysis-side ta
6
6
 
7
7
  # ae-analysis
8
8
 
9
- > **CRITICAL - This skill is self-contained.** Use the Global AE CLI Rules below; do not require a separate shared skill for analysis-side tasks.
10
9
  > **CRITICAL - For all commands that require `project_id`, you MUST satisfy `PROJECT_ID_GATE` first (no guessing): verify the project by ID/name with `analysis_common +list_projects` only when there is no valid project context yet, when the user switches project/host/environment, or when the supplied project is ambiguous. Reuse a project already verified in the same continuous conversation and same host/environment.**
11
10
  > **CRITICAL - For write operations in this skill, you MUST complete the post-write link loop when applicable:** after success and extractable `resource_id`, call `analysis_common +get_resource_url` and return the main result + resource link (or explicit link-failure reason).
12
11
  > **CRITICAL - Before running any `+<tool_name>` command, you MUST first read the corresponding `references/<tool_name>.md`.** The reference filename always equals the command name without the leading `+`, for example `+query_adhoc` -> `references/query_adhoc.md`.
@@ -21,6 +20,7 @@ Global parameters:
21
20
  |---|---|
22
21
  | `--format <json\|table>` | Output format. Default is JSON. |
23
22
  | `--jq <expr>` | jq filter expression for JSON output. |
23
+ | `--host <url>` | Override the active AE host. Available on every command and may be placed after the subcommand, e.g. `ae-cli analysis +list_dashboards --host <url>`. |
24
24
 
25
25
  Output and errors:
26
26
  - Successful commands return machine-readable JSON by default.
@@ -1,4 +1,4 @@
1
- # analysis_audience +list_clusters (Cluster Search)
1
+ # analysis_audience +list_clusters (Audience/User Segment Cluster Search)
2
2
 
3
3
  > **Prerequisite:** Follow the Global AE CLI Rules in [`../SKILL.md`](../SKILL.md).
4
4
 
@@ -8,8 +8,10 @@ Domain: **Cluster Management**
8
8
 
9
9
  **Fuzzy Search Fallback:** If `--query` returns no results, retry with broader keywords (max 3 attempts), then fall back to full list. See [SKILL.md § C. FUZZY_SEARCH_FALLBACK](../SKILL.md#c-fuzzy_search_fallback).
10
10
 
11
+ **Term boundary:** This command lists audience/user segment clusters only. It is not a server, region, or deployment inventory tool.
12
+
11
13
  ## Use Cases
12
- - List cluster metadata accessible to the current user in the project.
14
+ - List audience/user segment cluster metadata accessible to the current user in the project.
13
15
  - Supports payload governance parameters: `query`, `fields`, `limit`, `offset`.
14
16
  - Returns a paginated envelope (items + total + limit + offset + hasMore), not cluster members.
15
17
 
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: ae-analysis-global
3
+ version: 1.0.0
4
+ description: "Overlay rules for AE/TE analysis global multi-cluster mode. Use only when ae-cli config cluster-mode status reports sw_cfg_enable_global_query=true. This skill supplements ae-analysis; it does not replace it."
5
+ ---
6
+
7
+ # ae-analysis-global
8
+
9
+
10
+ This is an overlay for `ae-analysis`. First use the normal `ae-analysis` rules and matching command references. Apply the rules below only when local multi-cluster mode is enabled (`ae-cli config cluster-mode status`):
11
+
12
+ ```bash
13
+ ae-cli config cluster-mode status
14
+ ```
15
+
16
+ The result must contain:
17
+
18
+ ```json
19
+ {"sw_cfg_enable_global_query": true}
20
+ ```
21
+
22
+ If the mode is not enabled, do not use this overlay.
23
+
24
+ For commands added only by this overlay, read this skill's matching reference file before composing commands. Example: `+list_query_clusters` -> `references/list_query_clusters.md`.
25
+
26
+ Every command accepts `--host <url>` to override the active AE host, and it may be placed after the subcommand (e.g. `ae-cli analysis +list_query_clusters --project_id <id> --host <url>`). Host selection is independent of `--cluster_query_scope`: `--host` chooses which AE instance to call, while `--cluster_query_scope` / `--slave_cluster_id` choose which cluster within global mode.
27
+
28
+ ## Routing Rules
29
+
30
+ - In this overlay, **query cluster / service cluster / deployment cluster** means multi-cluster routing for analysis queries. **audience/user segment cluster** means audience membership assets under `analysis_audience`.
31
+ - If the user asks for cluster inventory or cluster info, call `ae-cli analysis +list_query_clusters --project_id <project_id>`. Localized examples include "集群信息" and "有哪些集群".
32
+ - Do not answer query-cluster inventory questions with `ae-cli analysis_audience +list_clusters` unless the user explicitly asks for audience clusters, cohorts, segments, user membership, or cluster definitions.
33
+ - If the user mentions country, region, server, shard, site, market, or deployment area semantics, call `ae-cli analysis +list_query_clusters --project_id <project_id>` before choosing query scope.
34
+ - Match slave cluster intent only against `slaveClusters[].clusterId`, `slaveClusters[].clusterName`, and `slaveClusters[].clusterDesc` returned by `+list_query_clusters`.
35
+ - If a matching accessible slave cluster exists, pass `--cluster_query_scope SLAVE --slave_cluster_id <clusterId>` to `+query_report_data`, `+query_dashboard_report_data`, or `+query_adhoc`.
36
+ - Use `--cluster_query_scope GLOBAL` only when the user clearly asks for global, all clusters, all servers, or cross-cluster aggregated data, and `permissions.canQueryGlobal=true`.
37
+ - If the user does not express global or slave-cluster intent, omit `--cluster_query_scope`.
38
+ - If requested global/slave scope is not allowed, explain `permissions.allowedClusterQueryParams` instead of guessing forbidden parameters.
39
+ - For `+query_adhoc --model_type sql`, never pass `--cluster_query_scope`; SQL model analysis only supports the current self cluster.
40
+
41
+ ## Response Wording
42
+
43
+ - For `+list_query_clusters`, call the result "query clusters" and summarize `currentCluster`, `slaveClusters`, and `permissions.allowedClusterQueryParams`.
44
+ - For `analysis_audience +list_clusters`, call the result "audience clusters" or "user segments"; do not call those results query clusters.
45
+
46
+ ## Commands Added By Multi-Cluster Mode
47
+
48
+ - `ae-cli analysis +list_query_clusters --project_id <project_id>`
49
+ - `ae-cli analysis +query_report_data ... --cluster_query_scope <GLOBAL|SLAVE> [--slave_cluster_id <id>]`
50
+ - `ae-cli analysis +query_dashboard_report_data ... --cluster_query_scope <GLOBAL|SLAVE> [--slave_cluster_id <id>]`
51
+ - `ae-cli analysis +query_adhoc ... --cluster_query_scope <GLOBAL|SLAVE> [--slave_cluster_id <id>]`
@@ -0,0 +1,67 @@
1
+ # analysis +list_query_clusters (Query Cluster Options)
2
+
3
+ > **Prerequisite:** Use this reference only after `ae-analysis-global` confirms local multi-cluster mode is enabled. This command is added by the global overlay, not by the base `ae-analysis` skill.
4
+
5
+ Domain: **Multi-Cluster Query Routing**
6
+
7
+ ## Use Cases
8
+
9
+ - List the query cluster options accessible to the current account in the project.
10
+ - Answer user questions such as "cluster info", "available query clusters", or "current cluster". Localized examples include "集群信息" and "有哪些集群".
11
+ - Decide whether a later report/dashboard/ad-hoc query should use the current self cluster, global aggregated data, or one specific slave cluster.
12
+ - Resolve country, region, game server, service shard, site, market, or deployment area wording to an accessible slave cluster before passing `cluster_query_scope=SLAVE`.
13
+
14
+ This command is not for audience/user segment clusters. For cohort, audience, or segment assets, use `analysis_audience +list_clusters`.
15
+
16
+ ## Commands
17
+
18
+ ```bash
19
+ ae-cli analysis +list_query_clusters --project_id <project_id>
20
+ ae-cli analysis +list_query_clusters --dry-run
21
+ ```
22
+
23
+ ## Parameters
24
+
25
+ | Parameter | Required | Description |
26
+ |---|---|---|
27
+ | `--project_id` / `-p` | Yes | Project ID used to resolve the current account's cluster query permissions. |
28
+
29
+ ## Output Shape
30
+
31
+ The result data follows the server DTO used by `list_query_clusters`:
32
+
33
+ | Field | Description |
34
+ |---|---|
35
+ | `globalQueryEnabled` | Whether global query is enabled by server config. |
36
+ | `currentCluster` | The current self query cluster. Fields: `clusterId`, `clusterName`, `clusterDesc`. |
37
+ | `slaveClusters` | Accessible slave query clusters for this account and project. Each item has `clusterId`, `clusterName`, `clusterDesc`. |
38
+ | `permissions` | Permission summary for choosing query scope. |
39
+ | `permissions.canQueryCurrent` | Whether the user can query the current self cluster. Usually true. |
40
+ | `permissions.canQueryGlobal` | Whether `cluster_query_scope=GLOBAL` is allowed. |
41
+ | `permissions.canQueryAllSlaveClusters` | Whether any enabled slave cluster may be queried. |
42
+ | `permissions.allowedSlaveClusterIds` | Slave cluster IDs this account may use. |
43
+ | `permissions.allowedClusterQueryParams` | Human-readable allowed query parameter combinations, e.g. `omit clusterQueryScope`, `clusterQueryScope=GLOBAL`, or `clusterQueryScope=SLAVE, slaveClusterId in [...]`. |
44
+
45
+ ## Decision Rules
46
+
47
+ - For query-cluster inventory or cluster-info questions, call this command and answer with "query clusters", not "audience clusters".
48
+ - Default query behavior is to omit `cluster_query_scope`, which queries the current self cluster or follows the tool-specific default.
49
+ - Pass `--cluster_query_scope GLOBAL` only when the user clearly asks for global, all clusters, all servers, cross-cluster aggregation, or equivalent aggregate wording, and `permissions.canQueryGlobal=true`.
50
+ - Pass `--cluster_query_scope SLAVE --slave_cluster_id <clusterId>` only after this command confirms a requested country, region, server, site, market, or deployment maps to an accessible `slaveClusters[]` item.
51
+ - Match slave intent only against `slaveClusters[].clusterId`, `slaveClusters[].clusterName`, and `slaveClusters[].clusterDesc`.
52
+ - If the requested scope is not allowed, do not guess forbidden parameters. Explain `permissions.allowedClusterQueryParams`.
53
+ - For `+query_adhoc --model_type sql`, never pass `cluster_query_scope`; SQL model analysis only supports the current self cluster.
54
+
55
+ ## Recommended Chains
56
+
57
+ - Cluster inventory / cluster info -> `analysis +list_query_clusters`
58
+ - Query DAU for Japan server -> `analysis +list_query_clusters` -> match JP/Japan slave cluster -> query report/dashboard/ad-hoc with `--cluster_query_scope SLAVE --slave_cluster_id <clusterId>`
59
+ - Query all-cluster aggregated DAU -> `analysis +list_query_clusters` -> if `permissions.canQueryGlobal=true`, query with `--cluster_query_scope GLOBAL`
60
+ - View audience cohorts or user segments -> `analysis_audience +list_clusters` instead
61
+
62
+ ## Response Wording
63
+
64
+ - Use "current query cluster" for `currentCluster`.
65
+ - Use "accessible slave query clusters" for `slaveClusters`.
66
+ - Use "allowed query-scope parameters" for `permissions.allowedClusterQueryParams`.
67
+ - Do not call `analysis_audience +list_clusters` results query clusters; those are audience clusters or user segments.
@@ -1,13 +1,11 @@
1
1
  ---
2
2
  name: ae-community
3
3
  version: 2.0.0
4
- description: "AE community analysis: post search, comment sentiment, topic trends, risky content, livestream data. Includes AE CLI authentication, global parameters, and safety rules (self-contained)."
4
+ description: "AE community analysis: post search, comment sentiment, topic trends, risky content, livestream data."
5
5
  ---
6
6
 
7
7
  # ae-community
8
8
 
9
- > **CRITICAL - This skill is self-contained.** Use the Global AE CLI Rules below; do not require a separate shared skill for community-side tasks.
10
-
11
9
  The AE Community domain provides social data analysis: post/video search, comment analytics, sentiment and topics, risk monitoring, and livestream metrics. Commands run as **`ae-cli community +<subcommand>`** — every community subcommand uses the **`+` prefix**.
12
10
 
13
11
  | Route (MCP) | CLI service | Responsibility |
@@ -28,6 +26,7 @@ Global parameters:
28
26
  |---|---|
29
27
  | `--format <json\|table>` | Output format. Default is JSON. |
30
28
  | `--jq <expr>` | jq filter expression for JSON output. |
29
+ | `--host <url>` | Override the active AE host. Available on every command and may be placed after the subcommand, e.g. `ae-cli community +<command> --host <url>`. |
31
30
 
32
31
  Output and errors:
33
32
  - Successful commands return machine-readable JSON by default.
@@ -6,8 +6,6 @@ description: "AE Data Development and Operations: Data warehouse management, flo
6
6
 
7
7
  # ae-dataops
8
8
 
9
- > **CRITICAL - This skill is self-contained.** Use the Global AE CLI Rules below; do not require a separate shared skill for DataOps-side tasks.
10
-
11
9
  The AE Data Development and Operations domain provides capabilities for data warehouse management, flow orchestration, IDE SQL queries, data integration, operations and backfill management, including the following subcommands:
12
10
 
13
11
  | Subcommand | Responsibility | Corresponding Scenario Skill |
@@ -33,6 +31,7 @@ Global parameters:
33
31
  |---|---|
34
32
  | `--format <json\|table>` | Output format. Default is JSON. |
35
33
  | `--jq <expr>` | jq filter expression for JSON output. |
34
+ | `--host <url>` | Override the active AE host. Available on every command and may be placed after the subcommand, e.g. `ae-cli dataops_ide +<command> --host <url>`. |
36
35
 
37
36
  Output and errors:
38
37
  - Successful commands return machine-readable JSON by default.
@@ -18,6 +18,7 @@ Global parameters:
18
18
  |---|---|
19
19
  | `--format <json\|table>` | Output format. Default is JSON. |
20
20
  | `--jq <expr>` | jq filter expression for JSON output. |
21
+ | `--host <url>` | Override the active AE host. Available on every command and may be placed after the subcommand, e.g. `ae-cli engage +<command> --host <url>`. |
21
22
 
22
23
  Output and errors:
23
24
  - Successful commands return machine-readable JSON by default.
@@ -1,6 +1,5 @@
1
1
  # ae-engage +add_approver
2
2
 
3
- > **Prerequisite:** Read [`../../ae-shared/SKILL.md`](../../ae-shared/SKILL.md)
4
3
 
5
4
  Batch add approvers.
6
5
 
@@ -1,6 +1,5 @@
1
1
  # ae-engage +add_channel
2
2
 
3
- > **Prerequisite:** Read [`../../ae-shared/SKILL.md`](../../ae-shared/SKILL.md)
4
3
 
5
4
  Create a new Engage channel.
6
5
 
@@ -1,6 +1,5 @@
1
1
  # ae-engage +approver_list
2
2
 
3
- > **Prerequisite:** Read [`../../ae-shared/SKILL.md`](../../ae-shared/SKILL.md)
4
3
 
5
4
  Query the project approver list.
6
5
 
@@ -1,6 +1,5 @@
1
1
  # ae-engage +cancel_query_by_request_id
2
2
 
3
- > **Prerequisite:** Read [`../../ae-shared/SKILL.md`](../../ae-shared/SKILL.md)
4
3
 
5
4
  Cancel a running data query by requestId.
6
5
 
@@ -1,6 +1,5 @@
1
1
  # ae-engage +channel_detail
2
2
 
3
- > **Prerequisite:** Read [`../../ae-shared/SKILL.md`](../../ae-shared/SKILL.md)
4
3
 
5
4
  Query the details of a single Engage channel.
6
5
 
@@ -1,6 +1,5 @@
1
1
  # ae-engage +channel_list
2
2
 
3
- > **Prerequisite:** Read [`../../ae-shared/SKILL.md`](../../ae-shared/SKILL.md)
4
3
 
5
4
  Query the list of Engage channels in a project.
6
5
 
@@ -1,6 +1,5 @@
1
1
  # ae-engage +config_channel_detail
2
2
 
3
- > **Prerequisite:** Read [`../../ae-shared/SKILL.md`](../../ae-shared/SKILL.md)
4
3
 
5
4
  Query config channel details.
6
5
 
@@ -1,6 +1,5 @@
1
1
  # ae-engage +config_channel_list
2
2
 
3
- > **Prerequisite:** Read [`../../ae-shared/SKILL.md`](../../ae-shared/SKILL.md)
4
3
 
5
4
  Query the config channel list.
6
5