@thinkingai/ae-cli 6.1.12 → 6.1.14

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 (154) hide show
  1. package/README.md +0 -2
  2. package/README.zh.md +0 -2
  3. package/dist/{auth-NN55553T.js → auth-GBMV6TEJ.js} +2 -2
  4. package/dist/{auth-GDV3H5I4.js → auth-NDSXE54J.js} +4 -4
  5. package/dist/{capability-DRLGDVS4.js → capability-TAMDRZYV.js} +18 -8
  6. package/dist/{capability-P6GK3AQH.js → capability-U7TDEEEG.js} +18 -8
  7. package/dist/{chunk-GJJA4CQZ.js → chunk-3FY3RJ26.js} +0 -4
  8. package/dist/{chunk-GS2P7LFD.js → chunk-5XUSIK27.js} +2 -2
  9. package/dist/{chunk-7KQWSBSL.js → chunk-753BUTNZ.js} +3 -3
  10. package/dist/{chunk-VTXHDCBW.js → chunk-AFXA7BRK.js} +2 -2
  11. package/dist/chunk-IBH3LDAH.js +556 -0
  12. package/dist/{chunk-RBNKI5ZW.js → chunk-JUW4AJXN.js} +2 -2
  13. package/dist/{chunk-TS6BUGUY.js → chunk-QATA32VR.js} +3 -3
  14. package/dist/{chunk-Z3OXWCIA.js → chunk-S5NTSDBS.js} +2 -2
  15. package/dist/chunk-UIHQJK5E.js +556 -0
  16. package/dist/{chunk-VKD5WQKN.js → chunk-VLWOLBGZ.js} +142 -24
  17. package/dist/{chunk-YTG6Q75E.js → chunk-WZRX4KOH.js} +25 -3
  18. package/dist/{chunk-YV52FB5G.js → chunk-ZQKDZXDO.js} +1 -1
  19. package/dist/{cli-token-GL5MS5FK.js → cli-token-4UPER74P.js} +3 -3
  20. package/dist/{chunk-6A2FUCIS.js → client-L2YDMHQ6.js} +5 -6
  21. package/dist/{config-4VZNLBKF.js → config-OL2LWGBV.js} +4 -33
  22. package/dist/index.js +25 -38
  23. package/dist/{memory-RWJW4XFO.js → memory-MUP7PPL7.js} +4 -4
  24. package/dist/{memory-VO2ZJCRT.js → memory-U4O5PMXH.js} +4 -4
  25. package/dist/{metadata-ZRN2GHPN.js → metadata-5MIMNIMT.js} +33 -20
  26. package/dist/{metadata-YGTHR2XJ.js → metadata-LERKDJN6.js} +33 -20
  27. package/dist/{model-CLUIK3K5.js → model-JTUEO5M4.js} +2 -2
  28. package/dist/{sync-3REDHGY6.js → sync-MOSFNBVR.js} +5 -5
  29. package/dist/{te-agent-XNPELAKX.js → te-agent-IFKZDHZI.js} +25 -18
  30. package/dist/{te-analysis-GJI5FZUL.js → te-analysis-FCHRTNIY.js} +1267 -492
  31. package/dist/{te-analysis-N2BRDJZ5.js → te-analysis-QG7UKGDA.js} +1267 -492
  32. package/dist/{te-community-SQXKE5OO.js → te-community-HNKVTERD.js} +207 -12
  33. package/dist/{te-community-TYSNU3NQ.js → te-community-IWE5B7W6.js} +208 -12
  34. package/dist/{te-dataops-OWIADNSM.js → te-dataops-KQPYNAE3.js} +262 -145
  35. package/dist/{te-dataops-5TM7WZDI.js → te-dataops-KXCEB4CS.js} +262 -145
  36. package/dist/{te-engage-L72HWRGO.js → te-engage-D6EG3NOR.js} +951 -17
  37. package/dist/{te-engage-QWM4GFS7.js → te-engage-ZSMIJLUW.js} +951 -17
  38. package/dist/{te-experiment-2T2HEZML.js → te-experiment-K5US7RMG.js} +6 -6
  39. package/dist/{te-experiment-PVEY7AEZ.js → te-experiment-WA7TFMEL.js} +6 -6
  40. package/dist/{te-kb-VRMEY3D4.js → te-kb-OIH3T6CS.js} +4 -4
  41. package/dist/{te-system-XGS5EQIQ.js → te-system-AZ3URMUO.js} +515 -11
  42. package/dist/{te-team-BZRDV2CM.js → te-team-GZPU6UWA.js} +5 -5
  43. package/dist/{update-HEDXGOJH.js → update-TOBFXF2V.js} +4 -4
  44. package/package.json +5 -5
  45. package/skills/ae-agent/SKILL.md +3 -3
  46. package/skills/ae-agent/references/list-skill-references.md +4 -4
  47. package/skills/ae-agent/references/read-skill-reference.md +10 -7
  48. package/skills/ae-agent/references/upload-skill-reference.md +11 -9
  49. package/skills/ae-analysis/SKILL.md +15 -12
  50. package/skills/ae-analysis/metadata_resolution.md +150 -0
  51. package/skills/ae-analysis/references/adhoc_export.md +17 -2
  52. package/skills/ae-analysis/references/adhoc_run.md +12 -8
  53. package/skills/ae-analysis/references/ai_models.md +35 -6
  54. package/skills/ae-analysis/references/alert_list.md +2 -3
  55. package/skills/ae-analysis/references/analysis_data_retrieval.md +104 -16
  56. package/skills/ae-analysis/references/analysis_drilldown_contract.md +4 -4
  57. package/skills/ae-analysis/references/analysis_gateway_assets.md +17 -15
  58. package/skills/ae-analysis/references/artifact_download.md +4 -3
  59. package/skills/ae-analysis/references/asset_abnormal_list.md +5 -3
  60. package/skills/ae-analysis/references/asset_authentication_list.md +5 -3
  61. package/skills/ae-analysis/references/asset_search.md +5 -3
  62. package/skills/ae-analysis/references/bi_panel_list.md +2 -2
  63. package/skills/ae-analysis/references/bi_panel_page_data_export.md +1 -1
  64. package/skills/ae-analysis/references/bi_panel_page_data_run.md +4 -4
  65. package/skills/ae-analysis/references/catalog_export.md +28 -0
  66. package/skills/ae-analysis/references/catalog_list.md +44 -0
  67. package/skills/ae-analysis/references/command_index.md +78 -69
  68. package/skills/ae-analysis/references/dashboard_list.md +2 -2
  69. package/skills/ae-analysis/references/dashboard_report_data_run.md +11 -4
  70. package/skills/ae-analysis/references/datatable_version_list.md +5 -3
  71. package/skills/ae-analysis/references/drilldown_entities_run.md +4 -4
  72. package/skills/ae-analysis/references/drilldown_events_run.md +2 -2
  73. package/skills/ae-analysis/references/drilldown_user_events_export.md +1 -1
  74. package/skills/ae-analysis/references/drilldown_user_events_run.md +2 -2
  75. package/skills/ae-analysis/references/entity_detail_run.md +4 -4
  76. package/skills/ae-analysis/references/entity_id_import_options.md +1 -1
  77. package/skills/ae-analysis/references/event_detail_run.md +4 -4
  78. package/skills/ae-analysis/references/event_export.md +21 -0
  79. package/skills/ae-analysis/references/event_list.md +7 -6
  80. package/skills/ae-analysis/references/exchange_rule_list.md +5 -3
  81. package/skills/ae-analysis/references/favorite_add.md +2 -2
  82. package/skills/ae-analysis/references/favorite_remove.md +2 -2
  83. package/skills/ae-analysis/references/history_tag_data_drilldown_export.md +4 -2
  84. package/skills/ae-analysis/references/history_tag_data_drilldown_run.md +2 -2
  85. package/skills/ae-analysis/references/history_tag_data_run.md +2 -2
  86. package/skills/ae-analysis/references/metric_create.md +7 -8
  87. package/skills/ae-analysis/references/metric_export.md +21 -0
  88. package/skills/ae-analysis/references/metric_list.md +8 -7
  89. package/skills/ae-analysis/references/project_space_list.md +2 -2
  90. package/skills/ae-analysis/references/property_export.md +21 -0
  91. package/skills/ae-analysis/references/property_list.md +9 -8
  92. package/skills/ae-analysis/references/public_link_list.md +2 -2
  93. package/skills/ae-analysis/references/query_context_get.md +20 -0
  94. package/skills/ae-analysis/references/query_create_result_cluster.md +1 -1
  95. package/skills/ae-analysis/references/report_change_log_list.md +1 -1
  96. package/skills/ae-analysis/references/report_create.md +3 -3
  97. package/skills/ae-analysis/references/report_data_run.md +8 -8
  98. package/skills/ae-analysis/references/report_list.md +3 -3
  99. package/skills/ae-analysis/references/report_list_export.md +2 -2
  100. package/skills/ae-analysis/references/report_update.md +3 -3
  101. package/skills/ae-analysis/references/report_version_rollback.md +1 -1
  102. package/skills/ae-analysis/references/rule_list.md +6 -4
  103. package/skills/ae-analysis/references/run_inspect.md +8 -5
  104. package/skills/ae-analysis/references/run_wait.md +37 -0
  105. package/skills/ae-analysis/references/sql_table_list.md +3 -2
  106. package/skills/ae-analysis/references/user_cluster_export.md +13 -0
  107. package/skills/ae-analysis/references/user_cluster_list.md +6 -2
  108. package/skills/ae-analysis/references/user_cluster_member_export.md +5 -3
  109. package/skills/ae-analysis/references/user_cluster_member_list.md +4 -4
  110. package/skills/ae-analysis/references/user_cluster_update.md +4 -2
  111. package/skills/ae-analysis/references/user_tag_export.md +13 -0
  112. package/skills/ae-analysis/references/user_tag_list.md +6 -2
  113. package/skills/ae-analysis/references/user_tag_member_export.md +5 -3
  114. package/skills/ae-analysis/references/user_tag_member_list.md +4 -4
  115. package/skills/ae-analysis/references/user_tag_update.md +4 -2
  116. package/skills/ae-analysis/references/virtual_property_create.md +2 -2
  117. package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +3 -3
  118. package/skills/ae-community/SKILL.md +2 -2
  119. package/skills/ae-dataops/SKILL.md +4 -3
  120. package/skills/ae-dataops/references/dataops-flow-create.md +47 -3
  121. package/skills/ae-engage/SKILL.md +55 -7
  122. package/skills/ae-engage/references/build-task-save-guide.md +12 -0
  123. package/skills/ae-engage/references/cancel-query-run.md +31 -0
  124. package/skills/ae-engage/references/config-item-analysis-report.md +14 -1
  125. package/skills/ae-engage/references/config-item-strategy-comparison.md +11 -1
  126. package/skills/ae-engage/references/config-item-trigger-report.md +15 -1
  127. package/skills/ae-engage/references/flow-metric-detail-report.md +134 -0
  128. package/skills/ae-engage/references/flow-metric-update.md +77 -0
  129. package/skills/ae-engage/references/flow-metric-user.md +119 -0
  130. package/skills/ae-engage/references/flow-node-metric-user.md +123 -0
  131. package/skills/ae-engage/references/flow-node-user.md +123 -0
  132. package/skills/ae-engage/references/push-record-query.md +32 -1
  133. package/skills/ae-engage/references/save-task.md +9 -0
  134. package/skills/ae-engage/references/task-data-detail.md +9 -2
  135. package/skills/ae-engage/references/task-indicator-user.md +104 -0
  136. package/skills/ae-engage/references/task-metric-detail.md +9 -2
  137. package/skills/ae-engage/references/task-submit-approval.md +3 -0
  138. package/skills/ae-engage/references/task-user-detail-export.md +31 -0
  139. package/skills/ae-experiment/references/save_experiment.md +4 -0
  140. package/skills/ae-experiment-design/SKILL.md +1 -1
  141. package/skills/ae-experiment-design/references/platform-operations.md +1 -1
  142. package/skills/ae-experiment-insight/references/platform-operations.md +1 -1
  143. package/skills/ae-metadata/SKILL.md +2 -1
  144. package/skills/ae-metadata/references/metadata_data_table_download.md +10 -2
  145. package/skills/ae-metadata/references/metadata_data_table_list.md +5 -2
  146. package/skills/ae-metadata/references/metadata_property_dimension_table_bind_existing.md +1 -1
  147. package/skills/ae-system/SKILL.md +66 -3
  148. package/dist/chunk-DT6Y3TD7.js +0 -232
  149. package/dist/chunk-MVDZ7DBQ.js +0 -231
  150. package/dist/chunk-NBPKWKRA.js +0 -51
  151. package/dist/client-DAIPF7XN.js +0 -23
  152. package/dist/raw-52B4UKO4.js +0 -71
  153. package/dist/te-meta-53BVXPFI.js +0 -95
  154. package/dist/te-meta-TOCBPBXI.js +0 -95
@@ -1,231 +0,0 @@
1
- import {
2
- getAnalysisMappingPathForClusterMode
3
- } from "./chunk-NBPKWKRA.js";
4
- import {
5
- clearCliToken,
6
- getCliToken
7
- } from "./chunk-Z3OXWCIA.js";
8
- import {
9
- getActiveHost,
10
- safeJsonParse
11
- } from "./chunk-GJJA4CQZ.js";
12
- import {
13
- PermissionError
14
- } from "./chunk-AXDXJTPC.js";
15
- import {
16
- logger
17
- } from "./chunk-JHENBQ5B.js";
18
-
19
- // src/core/mcp.ts
20
- async function permissionMessage(resp) {
21
- const text = await resp.text().catch(() => "");
22
- try {
23
- const d = safeJsonParse(text);
24
- const msg = d && (d.error?.message || (typeof d.error === "string" ? d.error : void 0) || d.message);
25
- if (msg && typeof msg === "string") return msg;
26
- } catch {
27
- }
28
- return "Permission denied for this resource (HTTP 403)";
29
- }
30
- function isInvalidCliTokenMessage(message) {
31
- return /\b(cli[-_\s]?token|token)\b.*\binvalid\b/i.test(message) || /\binvalid\b.*\b(cli[-_\s]?token|token)\b/i.test(message);
32
- }
33
- var MCP_PROTOCOL_VERSION = "2025-11-25";
34
- var JSONRPC_VERSION = "2.0";
35
- var serviceMappingMap = /* @__PURE__ */ new Map();
36
- registerMcpMapping("analysis", {
37
- componentName: "analysis",
38
- mappingPath: "analysis"
39
- });
40
- registerMcpMapping("te_analysis_extend", {
41
- componentName: "analysis",
42
- mappingPath: "analysis-extend"
43
- });
44
- function registerMcpMapping(serviceName, mapping) {
45
- serviceMappingMap.set(serviceName, mapping);
46
- }
47
- function registerMcpMappings(mappings) {
48
- for (const [serviceName, mapping] of Object.entries(mappings)) {
49
- serviceMappingMap.set(serviceName, mapping);
50
- }
51
- }
52
- function getMcpMapping(serviceName) {
53
- const mapping = serviceMappingMap.get(serviceName);
54
- if (!mapping) {
55
- throw new Error(`MCP mapping not found for service: '${serviceName}'. Please register it using registerMcpMapping() first.`);
56
- }
57
- if (serviceName === "analysis") {
58
- return { ...mapping, mappingPath: getAnalysisMappingPathForClusterMode() };
59
- }
60
- return mapping;
61
- }
62
- function buildMcpUrl(host, serviceName) {
63
- const mapping = getMcpMapping(serviceName);
64
- const base = host.replace(/\/+$/, "");
65
- return `${base}/mcp/${mapping.componentName}/http/${mapping.mappingPath}`;
66
- }
67
- function resolveMcpUrl(mcpUrlOverride, host, serviceName) {
68
- if (mcpUrlOverride) {
69
- return mcpUrlOverride;
70
- }
71
- return buildMcpUrl(host, serviceName);
72
- }
73
- var requestIdCounter = 1;
74
- function genRequestId() {
75
- return requestIdCounter++;
76
- }
77
- function buildAuthHeaders(cliToken) {
78
- return {
79
- "cli-token": cliToken
80
- };
81
- }
82
- async function mcpRequest(url, method, params = {}, hostOverride) {
83
- const hostUrl = hostOverride || getActiveHost();
84
- const token = await getCliToken(hostUrl);
85
- const requestId = genRequestId();
86
- const paramsWithMeta = {
87
- ...params,
88
- _meta: { progressToken: requestId }
89
- };
90
- const body = {
91
- jsonrpc: JSONRPC_VERSION,
92
- id: requestId,
93
- method,
94
- params: paramsWithMeta
95
- };
96
- const headers = {
97
- "Content-Type": "application/json",
98
- "Accept": "application/json, text/event-stream",
99
- "mcp-protocol-version": MCP_PROTOCOL_VERSION,
100
- ...buildAuthHeaders(token)
101
- };
102
- const resp = await fetch(url, {
103
- method: "POST",
104
- headers,
105
- body: JSON.stringify(body)
106
- });
107
- if (!resp.ok) {
108
- let permissionMsg;
109
- if (resp.status === 403) {
110
- permissionMsg = await permissionMessage(resp);
111
- if (!isInvalidCliTokenMessage(permissionMsg)) {
112
- throw new PermissionError(permissionMsg);
113
- }
114
- }
115
- if (resp.status === 401 || resp.status === 403 && permissionMsg) {
116
- logger.warn(`MCP request failed (${resp.status === 403 ? permissionMsg : "HTTP 401"}) for ${hostUrl}, refreshing CLI token`);
117
- clearCliToken(hostUrl);
118
- const newToken = await getCliToken(hostUrl);
119
- logger.info(`CLI token refreshed for ${hostUrl}`);
120
- process.stderr.write(`[ae-cli] CLI token refreshed for ${hostUrl}
121
- `);
122
- Object.assign(headers, buildAuthHeaders(newToken));
123
- const retryResp = await fetch(url, {
124
- method: "POST",
125
- headers,
126
- body: JSON.stringify(body)
127
- });
128
- if (retryResp.status === 403) {
129
- throw new PermissionError(await permissionMessage(retryResp));
130
- }
131
- if (!retryResp.ok) {
132
- throw new Error(`MCP HTTP error: ${retryResp.status} ${retryResp.statusText}`);
133
- }
134
- const retryData = safeJsonParse(await retryResp.text());
135
- if (retryData.error) {
136
- throw new Error(`MCP error: ${retryData.error.message || JSON.stringify(retryData.error)}`);
137
- }
138
- return retryData.result;
139
- }
140
- throw new Error(`MCP HTTP error: ${resp.status} ${resp.statusText}`);
141
- }
142
- const data = safeJsonParse(await resp.text());
143
- if (data.error) {
144
- throw new Error(`MCP error: ${data.error.message || JSON.stringify(data.error)}`);
145
- }
146
- return data.result;
147
- }
148
- async function callMcpTool(url, toolName, args = {}, hostOverride) {
149
- const params = {
150
- name: toolName,
151
- arguments: args
152
- };
153
- logger.info(`MCP tool call: ${toolName}`);
154
- const result = await mcpRequest(url, "tools/call", params, hostOverride);
155
- if (result.isError) {
156
- logger.warn(`MCP tool call failed: ${toolName}`);
157
- }
158
- return {
159
- content: result.content.map((item) => {
160
- if (item.type === "text") {
161
- return { type: "text", text: item.text };
162
- } else if (item.type === "image") {
163
- return { type: "image", data: item.data, mimeType: item.mimeType };
164
- } else {
165
- return { type: "resource", ...item };
166
- }
167
- }),
168
- isError: result.isError
169
- };
170
- }
171
- function parseMcpResult(result) {
172
- if (result.isError) {
173
- const firstText = result.content.find((item) => item.type === "text")?.text || "";
174
- let errorMessage = firstText.trim() || "MCP tool call failed";
175
- try {
176
- const parsed = safeJsonParse(firstText);
177
- errorMessage = mcpResultErrorMessage(parsed) || errorMessage;
178
- } catch {
179
- }
180
- throwMcpError(errorMessage);
181
- }
182
- if (result.content.length > 0 && result.content[0].type === "text") {
183
- const text = result.content[0].text || "";
184
- let parsed;
185
- try {
186
- parsed = safeJsonParse(text);
187
- } catch {
188
- return text;
189
- }
190
- const errMsg = mcpResultErrorMessage(parsed);
191
- if (errMsg !== null) {
192
- throwMcpError(errMsg);
193
- }
194
- return parsed;
195
- }
196
- return result;
197
- }
198
- function mcpResultErrorMessage(parsed) {
199
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
200
- if (parsed.success === true || parsed.ok === true) return null;
201
- const explicitlyFailed = parsed.success === false || parsed.ok === false;
202
- const e = parsed.error;
203
- if (typeof e === "string" && e.trim()) return e;
204
- if (e && typeof e === "object") {
205
- const msg = typeof e.message === "string" && e.message || void 0;
206
- const code = typeof e.code === "string" && e.code || void 0;
207
- if (msg && code) return `${code}: ${msg}`;
208
- if (msg || code) return msg || code;
209
- }
210
- if (explicitlyFailed) {
211
- const msg = typeof parsed.message === "string" && parsed.message.trim() ? parsed.message.trim() : void 0;
212
- const codeValue = parsed.errorCode ?? parsed.error_code ?? parsed.code;
213
- const code = typeof codeValue === "string" && codeValue.trim() ? codeValue.trim() : void 0;
214
- if (msg && code) return `${code}: ${msg}`;
215
- return msg || code || "MCP tool call failed";
216
- }
217
- return null;
218
- }
219
- function throwMcpError(message) {
220
- if (/no_auth|auth_error|permission|forbidden|unauthor|\u65e0\u6743/i.test(message)) {
221
- throw new PermissionError(message);
222
- }
223
- throw new Error(message);
224
- }
225
-
226
- export {
227
- registerMcpMappings,
228
- resolveMcpUrl,
229
- callMcpTool,
230
- parseMcpResult
231
- };
@@ -1,51 +0,0 @@
1
- import {
2
- getSandboxClusterInfoFilePath,
3
- safeReadJsonFile
4
- } from "./chunk-GJJA4CQZ.js";
5
- import {
6
- logger
7
- } from "./chunk-JHENBQ5B.js";
8
-
9
- // src/core/cluster-info.ts
10
- import fs from "fs";
11
- import path from "path";
12
- var GLOBAL_QUERY_CONFIG_KEY = "sw_cfg_enable_global_query";
13
- var CLUSTER_INFO_FILE_ENV = "AE_CLUSTER_INFO_FILE";
14
- function getClusterInfoFilePath() {
15
- return process.env[CLUSTER_INFO_FILE_ENV] || getSandboxClusterInfoFilePath();
16
- }
17
- function loadClusterInfo() {
18
- const file = getClusterInfoFilePath();
19
- try {
20
- if (!fs.existsSync(file)) {
21
- return {};
22
- }
23
- const raw = safeReadJsonFile(file);
24
- return raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
25
- } catch (err) {
26
- logger.warn(`Failed to load cluster info from ${file}: ${err.message}`);
27
- return {};
28
- }
29
- }
30
- function isGlobalQueryModeEnabled() {
31
- return loadClusterInfo()[GLOBAL_QUERY_CONFIG_KEY] === true;
32
- }
33
- function setGlobalQueryModeEnabled(enabled) {
34
- const file = getClusterInfoFilePath();
35
- const dir = path.dirname(file);
36
- fs.mkdirSync(dir, { recursive: true });
37
- const next = { [GLOBAL_QUERY_CONFIG_KEY]: enabled };
38
- fs.writeFileSync(file, JSON.stringify(next, null, 2));
39
- return next;
40
- }
41
- function getAnalysisMappingPathForClusterMode(enabled = isGlobalQueryModeEnabled()) {
42
- return enabled ? "analysis-global" : "analysis";
43
- }
44
-
45
- export {
46
- GLOBAL_QUERY_CONFIG_KEY,
47
- getClusterInfoFilePath,
48
- isGlobalQueryModeEnabled,
49
- setGlobalQueryModeEnabled,
50
- getAnalysisMappingPathForClusterMode
51
- };
@@ -1,23 +0,0 @@
1
- import {
2
- httpDelete,
3
- httpGet,
4
- httpPost,
5
- httpRequest,
6
- httpUpload,
7
- queryReportData,
8
- querySql,
9
- wsQuery
10
- } from "./chunk-6A2FUCIS.js";
11
- import "./chunk-YV52FB5G.js";
12
- import "./chunk-GJJA4CQZ.js";
13
- import "./chunk-JHENBQ5B.js";
14
- export {
15
- httpDelete,
16
- httpGet,
17
- httpPost,
18
- httpRequest,
19
- httpUpload,
20
- queryReportData,
21
- querySql,
22
- wsQuery
23
- };
@@ -1,71 +0,0 @@
1
- import {
2
- httpGet,
3
- httpPost
4
- } from "./chunk-6A2FUCIS.js";
5
- import {
6
- printError,
7
- printOutput
8
- } from "./chunk-YTG6Q75E.js";
9
- import "./chunk-Z3OXWCIA.js";
10
- import {
11
- SecureStoreAuthError,
12
- missingAeHostHint,
13
- resolveHost
14
- } from "./chunk-YV52FB5G.js";
15
- import {
16
- safeJsonParse
17
- } from "./chunk-GJJA4CQZ.js";
18
- import "./chunk-JHENBQ5B.js";
19
-
20
- // src/api/raw.ts
21
- function registerApi(program) {
22
- program.command("api").description("Raw API call: ae-cli api <METHOD> <PATH> [options]").argument("<method>", "HTTP method (GET, POST)").argument("<path>", "API path (e.g., /v1/ta/event/catalog/listEvent)").option("--params <json>", "URL parameters as JSON").option("--data <json>", "Request body as JSON").action(async (method, apiPath, opts) => {
23
- const globalOpts = program.opts();
24
- const host = resolveHost(globalOpts.host);
25
- const format = globalOpts.format || "json";
26
- const jq = globalOpts.jq;
27
- if (!host) {
28
- printError("config", "No AE host configured.", missingAeHostHint());
29
- process.exit(1);
30
- }
31
- try {
32
- let params = {};
33
- let body = void 0;
34
- if (opts.params) {
35
- try {
36
- params = safeJsonParse(opts.params);
37
- } catch {
38
- printError("validation", `Invalid JSON for --params: ${opts.params}`);
39
- process.exit(1);
40
- }
41
- }
42
- if (opts.data) {
43
- try {
44
- body = safeJsonParse(opts.data);
45
- } catch {
46
- printError("validation", `Invalid JSON for --data: ${opts.data}`);
47
- process.exit(1);
48
- }
49
- }
50
- let result;
51
- if (method.toUpperCase() === "GET") {
52
- result = await httpGet(apiPath, params, host);
53
- } else {
54
- result = await httpPost(apiPath, params, body, host);
55
- }
56
- await printOutput(result, format, jq);
57
- } catch (err) {
58
- if (err?.type === "validation" && String(err.message || "").includes("--jq")) {
59
- printError("validation", err.message, err.hint);
60
- } else if (err instanceof SecureStoreAuthError) {
61
- printError("auth", err.message, "Run: ae-cli auth login");
62
- } else {
63
- printError("api", err.message);
64
- }
65
- process.exit(1);
66
- }
67
- });
68
- }
69
- export {
70
- registerApi
71
- };
@@ -1,95 +0,0 @@
1
- import {
2
- callMcpTool,
3
- parseMcpResult,
4
- resolveMcpUrl
5
- } from "./chunk-MVDZ7DBQ.js";
6
- import "./chunk-NBPKWKRA.js";
7
- import "./chunk-Z3OXWCIA.js";
8
- import "./chunk-YV52FB5G.js";
9
- import "./chunk-GJJA4CQZ.js";
10
- import "./chunk-AXDXJTPC.js";
11
- import "./chunk-JHENBQ5B.js";
12
-
13
- // src/commands/te-meta/shared.ts
14
- function createMcpCommand(config) {
15
- const toolName = config.command.slice(1);
16
- const mcpService = config.mcpService || "analysis";
17
- return {
18
- service: "analysis_meta",
19
- command: config.command,
20
- description: config.description,
21
- flags: config.flags,
22
- risk: config.risk,
23
- dryRun: (ctx) => ({
24
- method: "tools/call",
25
- url: resolveMcpUrl(ctx.mcpUrl(), ctx.host(), mcpService),
26
- body: {
27
- name: toolName,
28
- arguments: config.buildArgs(ctx)
29
- }
30
- }),
31
- execute: async (ctx) => {
32
- const url = resolveMcpUrl(ctx.mcpUrl(), ctx.host(), mcpService);
33
- const result = await callMcpTool(url, toolName, config.buildArgs(ctx), ctx.host());
34
- return parseMcpResult(result);
35
- }
36
- };
37
- }
38
- function optionalJson(ctx, name) {
39
- const value = ctx.str(name);
40
- return value === "" ? void 0 : ctx.json(name);
41
- }
42
-
43
- // src/commands/te-meta/meta/batch-edit-metadata.ts
44
- var batchEditMetadata = createMcpCommand({
45
- command: "+batch_edit_metadata",
46
- description: "Batch edit effective system metadata only",
47
- flags: [
48
- { name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
49
- { name: "type", type: "string", required: true, desc: "Metadata type: event, event_property, or user_property" },
50
- { name: "items", type: "json", required: true, desc: "Batch edit item list JSON array" }
51
- ],
52
- risk: "write",
53
- mcpService: "te_analysis_extend",
54
- buildArgs: (ctx) => ({
55
- projectId: ctx.num("project_id"),
56
- type: ctx.str("type"),
57
- items: ctx.json("items")
58
- })
59
- });
60
-
61
- // src/commands/te-meta/meta/batch-create-metadata.ts
62
- var batchCreateMetadata = createMcpCommand({
63
- command: "+batch_create_metadata",
64
- description: "Batch create effective system metadata only",
65
- flags: [
66
- { name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
67
- { name: "events", type: "json", required: false, desc: "Event creation list JSON array" },
68
- { name: "event_properties", type: "json", required: false, desc: "Event property creation list JSON array" },
69
- { name: "user_properties", type: "json", required: false, desc: "User property creation list JSON array" }
70
- ],
71
- risk: "write",
72
- mcpService: "te_analysis_extend",
73
- buildArgs: (ctx) => ({
74
- projectId: ctx.num("project_id"),
75
- events: optionalJson(ctx, "events"),
76
- eventProperties: optionalJson(ctx, "event_properties"),
77
- userProperties: optionalJson(ctx, "user_properties")
78
- })
79
- });
80
-
81
- // src/commands/te-meta/meta/index.ts
82
- var commands = [
83
- batchEditMetadata,
84
- batchCreateMetadata
85
- ];
86
- var meta_default = commands;
87
-
88
- // src/commands/te-meta/index.ts
89
- var commands2 = [
90
- ...meta_default
91
- ];
92
- var te_meta_default = commands2;
93
- export {
94
- te_meta_default as default
95
- };
@@ -1,95 +0,0 @@
1
- import {
2
- callMcpTool,
3
- parseMcpResult,
4
- resolveMcpUrl
5
- } from "./chunk-DT6Y3TD7.js";
6
- import "./chunk-NBPKWKRA.js";
7
- import "./chunk-Z3OXWCIA.js";
8
- import "./chunk-YV52FB5G.js";
9
- import "./chunk-GJJA4CQZ.js";
10
- import "./chunk-AXDXJTPC.js";
11
- import "./chunk-JHENBQ5B.js";
12
-
13
- // src/commands/te-meta/shared.ts
14
- function createMcpCommand(config) {
15
- const toolName = config.command.slice(1);
16
- const mcpService = config.mcpService || "analysis";
17
- return {
18
- service: "analysis_meta",
19
- command: config.command,
20
- description: config.description,
21
- flags: config.flags,
22
- risk: config.risk,
23
- dryRun: (ctx) => ({
24
- method: "tools/call",
25
- url: resolveMcpUrl(ctx.mcpUrl(), ctx.host(), mcpService),
26
- body: {
27
- name: toolName,
28
- arguments: config.buildArgs(ctx)
29
- }
30
- }),
31
- execute: async (ctx) => {
32
- const url = resolveMcpUrl(ctx.mcpUrl(), ctx.host(), mcpService);
33
- const result = await callMcpTool(url, toolName, config.buildArgs(ctx), ctx.host());
34
- return parseMcpResult(result);
35
- }
36
- };
37
- }
38
- function optionalJson(ctx, name) {
39
- const value = ctx.str(name);
40
- return value === "" ? void 0 : ctx.json(name);
41
- }
42
-
43
- // src/commands/te-meta/meta/batch-edit-metadata.ts
44
- var batchEditMetadata = createMcpCommand({
45
- command: "+batch_edit_metadata",
46
- description: "Batch edit effective system metadata only",
47
- flags: [
48
- { name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
49
- { name: "type", type: "string", required: true, desc: "Metadata type: event, event_property, or user_property" },
50
- { name: "items", type: "json", required: true, desc: "Batch edit item list JSON array" }
51
- ],
52
- risk: "write",
53
- mcpService: "te_analysis_extend",
54
- buildArgs: (ctx) => ({
55
- projectId: ctx.num("project_id"),
56
- type: ctx.str("type"),
57
- items: ctx.json("items")
58
- })
59
- });
60
-
61
- // src/commands/te-meta/meta/batch-create-metadata.ts
62
- var batchCreateMetadata = createMcpCommand({
63
- command: "+batch_create_metadata",
64
- description: "Batch create effective system metadata only",
65
- flags: [
66
- { name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
67
- { name: "events", type: "json", required: false, desc: "Event creation list JSON array" },
68
- { name: "event_properties", type: "json", required: false, desc: "Event property creation list JSON array" },
69
- { name: "user_properties", type: "json", required: false, desc: "User property creation list JSON array" }
70
- ],
71
- risk: "write",
72
- mcpService: "te_analysis_extend",
73
- buildArgs: (ctx) => ({
74
- projectId: ctx.num("project_id"),
75
- events: optionalJson(ctx, "events"),
76
- eventProperties: optionalJson(ctx, "event_properties"),
77
- userProperties: optionalJson(ctx, "user_properties")
78
- })
79
- });
80
-
81
- // src/commands/te-meta/meta/index.ts
82
- var commands = [
83
- batchEditMetadata,
84
- batchCreateMetadata
85
- ];
86
- var meta_default = commands;
87
-
88
- // src/commands/te-meta/index.ts
89
- var commands2 = [
90
- ...meta_default
91
- ];
92
- var te_meta_default = commands2;
93
- export {
94
- te_meta_default as default
95
- };