@thinkingai/ae-cli 6.0.18-1 → 6.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +7 -6
  2. package/README.zh.md +8 -7
  3. package/dist/index.js +11 -6
  4. package/dist/{te-agent-KZRIEN4N.js → te-agent-CYZUC4US.js} +543 -19
  5. package/dist/{te-analysis-VAR4KUOK.js → te-analysis-HJ22TUAA.js} +318 -40
  6. package/dist/te-audience-MYDE5WEH.js +590 -0
  7. package/dist/te-dataops-ZTS7XMXM.js +1842 -0
  8. package/dist/{te-kb-B62KFP2A.js → te-kb-OWM3RQRH.js} +46 -21
  9. package/dist/{te-meta-EPZGQN56.js → te-meta-JVO4QJBH.js} +28 -11
  10. package/package.json +1 -1
  11. package/skills/ae-agent/SKILL.md +103 -4
  12. package/skills/ae-analysis/SKILL.md +66 -19
  13. package/skills/ae-analysis/references/build_attribution_analysis_qp.md +60 -0
  14. package/skills/ae-analysis/references/build_cluster_definition.md +60 -0
  15. package/skills/ae-analysis/references/build_distribution_analysis_qp.md +65 -0
  16. package/skills/ae-analysis/references/build_heat_map_analysis_qp.md +52 -0
  17. package/skills/ae-analysis/references/build_interval_analysis_qp.md +58 -0
  18. package/skills/ae-analysis/references/build_path_analysis_qp.md +51 -0
  19. package/skills/ae-analysis/references/build_rank_list_analysis_qp.md +61 -0
  20. package/skills/ae-analysis/references/build_tag_definition.md +63 -0
  21. package/skills/ae-analysis/references/cancel_query.md +2 -3
  22. package/skills/ae-analysis/references/copy_dashboard.md +33 -0
  23. package/skills/ae-analysis/references/create_id_cluster.md +40 -0
  24. package/skills/ae-analysis/references/create_id_tag.md +39 -0
  25. package/skills/ae-analysis/references/delete_alert.md +27 -0
  26. package/skills/ae-analysis/references/delete_cluster.md +27 -0
  27. package/skills/ae-analysis/references/delete_dashboard.md +30 -0
  28. package/skills/ae-analysis/references/delete_metric.md +27 -0
  29. package/skills/ae-analysis/references/delete_report.md +27 -0
  30. package/skills/ae-analysis/references/delete_tag.md +27 -0
  31. package/skills/ae-analysis/references/drilldown_user_events.md +4 -4
  32. package/skills/ae-analysis/references/drilldown_users.md +3 -3
  33. package/skills/ae-analysis/references/freeze_dashboards.md +29 -0
  34. package/skills/ae-analysis/references/get_table_columns.md +11 -12
  35. package/skills/ae-analysis/references/list_cluster_members.md +4 -4
  36. package/skills/ae-analysis/references/list_clusters.md +3 -3
  37. package/skills/ae-analysis/references/list_dashboards.md +3 -3
  38. package/skills/ae-analysis/references/list_entities.md +1 -1
  39. package/skills/ae-analysis/references/list_events.md +3 -3
  40. package/skills/ae-analysis/references/list_metrics.md +2 -2
  41. package/skills/ae-analysis/references/list_properties.md +3 -3
  42. package/skills/ae-analysis/references/list_reports.md +3 -3
  43. package/skills/ae-analysis/references/list_spaces.md +27 -0
  44. package/skills/ae-analysis/references/list_tag_members.md +4 -4
  45. package/skills/ae-analysis/references/list_tags.md +2 -2
  46. package/skills/ae-analysis/references/move_dashboard.md +33 -0
  47. package/skills/ae-analysis/references/query_adhoc.md +2 -2
  48. package/skills/ae-analysis/references/query_bi_panel_data.md +2 -2
  49. package/skills/ae-analysis/references/query_dashboard_report_data.md +4 -4
  50. package/skills/ae-analysis/references/query_entity_details.md +4 -4
  51. package/skills/ae-analysis/references/query_event_details.md +3 -3
  52. package/skills/ae-analysis/references/query_report_data.md +37 -3
  53. package/skills/ae-analysis/references/update_id_cluster.md +36 -0
  54. package/skills/ae-analysis/references/update_id_tag.md +37 -0
  55. package/skills/ae-analysis/references/update_report.md +35 -0
  56. package/skills/ae-analysis-intent/SKILL.md +1 -1
  57. package/skills/ae-dataops/SKILL.md +54 -522
  58. package/skills/ae-dataops/references/dataops-flow-create.md +78 -75
  59. package/skills/ae-dataops/references/dataops-flow-monitor.md +58 -51
  60. package/skills/ae-dataops/references/dataops-integration.md +80 -41
  61. package/skills/ae-dataops/references/dataops-query.md +54 -53
  62. package/skills/ae-dataops/references/dataops-table.md +28 -59
  63. package/dist/te-audience-KMKYI2YJ.js +0 -400
  64. package/dist/te-dataops-GD3XBYCS.js +0 -1830
@@ -0,0 +1,1842 @@
1
+ import {
2
+ printError
3
+ } from "./chunk-2DUEAXV3.js";
4
+ import {
5
+ clearToken,
6
+ getToken,
7
+ resolveHost
8
+ } from "./chunk-RSHMZ3LG.js";
9
+ import {
10
+ logger,
11
+ safeJsonParse
12
+ } from "./chunk-6W4QOZAL.js";
13
+
14
+ // src/commands/te-dataops/shared.ts
15
+ var TOOL_API_MAP = {
16
+ repo_list_spaces: { method: "GET", path: "/v1/gaia/mcp/api/repo/spaces" },
17
+ datatable_get_table_detail: { method: "GET", path: "/v1/gaia/mcp/api/datatable/table-detail" },
18
+ datatable_dict_search_tables: { method: "GET", path: "/v1/gaia/mcp/api/datatable/dict-tables" },
19
+ datatable_create_table: { method: "POST", path: "/v1/gaia/mcp/api/datatable/tables" },
20
+ datatable_create_view: { method: "POST", path: "/v1/gaia/mcp/api/datatable/views" },
21
+ datatable_publish_entity: { method: "POST", path: "/v1/gaia/mcp/api/datatable/publish" },
22
+ flow_list_flows: { method: "GET", path: "/v1/gaia/mcp/api/workflow/flows" },
23
+ flow_get_flow_overview: { method: "GET", path: "/v1/gaia/mcp/api/workflow/flow-overview" },
24
+ flow_list_high_frequency_release_flows: { method: "GET", path: "/v1/gaia/mcp/api/workflow/flow-release/high-frequency" },
25
+ flow_create_flow: { method: "POST", path: "/v1/gaia/mcp/api/workflow/flows" },
26
+ flow_update_flow: { method: "POST", path: "/v1/gaia/mcp/api/workflow/flow-basic" },
27
+ flow_save_schedule_config: { method: "POST", path: "/v1/gaia/mcp/api/workflow/schedule-config" },
28
+ flow_execute_flow: { method: "POST", path: "/v1/gaia/mcp/api/workflow/flow-execution" },
29
+ flow_preview_release_flow: { method: "GET", path: "/v1/gaia/mcp/api/workflow/flow-release/preview" },
30
+ flow_release_flow: { method: "POST", path: "/v1/gaia/mcp/api/workflow/flow-release" },
31
+ flow_create_sql_task: { method: "POST", path: "/v1/gaia/mcp/api/workflow/tasks" },
32
+ flow_update_sql_task: { method: "POST", path: "/v1/gaia/mcp/api/workflow/sql-task-definition" },
33
+ flow_create_integration_task: { method: "POST", path: "/v1/gaia/mcp/api/workflow/integration-tasks" },
34
+ flow_update_integration_task: { method: "POST", path: "/v1/gaia/mcp/api/workflow/integration-task-definition" },
35
+ flow_add_task_relation: { method: "POST", path: "/v1/gaia/mcp/api/workflow/task-relation" },
36
+ flow_get_task_params: { method: "GET", path: "/v1/gaia/mcp/api/workflow/task-params" },
37
+ operations_search_flow_instances: { method: "POST", path: "/v1/gaia/mcp/api/operations/flow-instances/search" },
38
+ operations_get_flow_instance_detail: { method: "GET", path: "/v1/gaia/mcp/api/operations/flow-instances/detail" },
39
+ operations_get_task_instance_detail: { method: "GET", path: "/v1/gaia/mcp/api/operations/task-instances/detail" },
40
+ operations_stop_flow_instance: { method: "POST", path: "/v1/gaia/mcp/api/operations/flow-instances/stop" },
41
+ integration_list_datasource_components: { method: "GET", path: "/v1/gaia/mcp/api/integration/datasource-components" },
42
+ integration_get_datasource_component_template: { method: "GET", path: "/v1/gaia/mcp/api/integration/datasource-component-template" },
43
+ integration_list_space_datasources: { method: "GET", path: "/v1/gaia/mcp/api/integration/datasources" },
44
+ integration_get_datasource_detail: { method: "GET", path: "/v1/gaia/mcp/api/integration/datasource-detail" },
45
+ integration_test_datasource_connect: { method: "POST", path: "/v1/gaia/mcp/api/integration/datasource-connect-test" },
46
+ integration_list_datasource_databases: { method: "GET", path: "/v1/gaia/mcp/api/integration/datasource-databases" },
47
+ integration_list_datasource_tables: { method: "GET", path: "/v1/gaia/mcp/api/integration/datasource-tables" },
48
+ integration_get_table_structure: { method: "GET", path: "/v1/gaia/mcp/api/integration/table-structure" },
49
+ integration_list_sync_datasources: { method: "GET", path: "/v1/gaia/mcp/api/integration/sync-datasources" },
50
+ integration_add_datasource: { method: "POST", path: "/v1/gaia/mcp/api/integration/datasources" },
51
+ integration_modify_datasource: { method: "POST", path: "/v1/gaia/mcp/api/integration/datasource-modification" },
52
+ integration_online_datasource: { method: "POST", path: "/v1/gaia/mcp/api/integration/datasource-online" },
53
+ integration_list_sync_solutions: { method: "GET", path: "/v1/gaia/mcp/api/integration/sync-solutions" },
54
+ integration_get_sync_detail: { method: "GET", path: "/v1/gaia/mcp/api/integration/sync-detail" },
55
+ integration_list_sync_runs: { method: "GET", path: "/v1/gaia/mcp/api/integration/sync-runs" },
56
+ integration_add_sync_solution: { method: "POST", path: "/v1/gaia/mcp/api/integration/sync-solutions" },
57
+ integration_save_sync_solution: { method: "POST", path: "/v1/gaia/mcp/api/integration/sync-solution-save" },
58
+ integration_exec_sync_solution: { method: "POST", path: "/v1/gaia/mcp/api/integration/sync-execution" },
59
+ integration_stop_sync_solution: { method: "POST", path: "/v1/gaia/mcp/api/integration/sync-stop" },
60
+ ide_list_repos: { method: "GET", path: "/v1/gaia/mcp/api/ide/repos" },
61
+ ide_list_catalogs: { method: "GET", path: "/v1/gaia/mcp/api/ide/catalogs" },
62
+ ide_list_tables: { method: "GET", path: "/v1/gaia/mcp/api/ide/tables" },
63
+ ide_search_tables: { method: "GET", path: "/v1/gaia/mcp/api/ide/table-search" },
64
+ ide_get_table_detail: { method: "GET", path: "/v1/gaia/mcp/api/ide/table-detail" },
65
+ ide_get_schema_info: { method: "GET", path: "/v1/gaia/mcp/api/ide/schema-info" },
66
+ ide_submit_sql_query: { method: "POST", path: "/v1/gaia/mcp/api/ide/sql-query-submit" },
67
+ ide_get_sql_query_status: { method: "GET", path: "/v1/gaia/mcp/api/ide/sql-query-status" },
68
+ ide_cancel_sql_query: { method: "POST", path: "/v1/gaia/mcp/api/ide/sql-query-cancel" }
69
+ };
70
+ async function callDataopsApi(ctx, toolName54, args = {}) {
71
+ const spec = TOOL_API_MAP[toolName54];
72
+ if (!spec) {
73
+ throw new Error(`DataOps API mapping not found for tool: ${toolName54}`);
74
+ }
75
+ const params = compactArgs(args);
76
+ if (spec.method === "GET") {
77
+ return dataopsRequest(ctx, spec.method, spec.path, params);
78
+ }
79
+ return dataopsRequest(ctx, spec.method, spec.path, {}, params);
80
+ }
81
+ function buildDataopsApiDryRun(ctx, toolName54, args = {}) {
82
+ const spec = TOOL_API_MAP[toolName54];
83
+ if (!spec) {
84
+ throw new Error(`DataOps API mapping not found for tool: ${toolName54}`);
85
+ }
86
+ const params = compactArgs(args);
87
+ if (spec.method === "GET") {
88
+ return {
89
+ method: spec.method,
90
+ url: buildUrl(resolveHost(ctx.host()), spec.path, params),
91
+ params
92
+ };
93
+ }
94
+ return {
95
+ method: spec.method,
96
+ url: buildUrl(resolveHost(ctx.host()), spec.path),
97
+ body: params
98
+ };
99
+ }
100
+ async function dataopsRequest(ctx, method, path2, params = {}, body, retry = true) {
101
+ const host = resolveHost(ctx.host());
102
+ const token = await getToken(host);
103
+ const url = buildUrl(host, path2, params);
104
+ const headers = {
105
+ Authorization: `bearer ${token}`,
106
+ "Content-Type": "application/json",
107
+ "X-Source": "ae-cli"
108
+ };
109
+ const options = { method, headers };
110
+ if (method !== "GET") {
111
+ options.body = JSON.stringify(body ?? {});
112
+ }
113
+ const resp = await fetch(url, options);
114
+ const text = await resp.text();
115
+ const data = parseResponseBody(text, url, resp.status);
116
+ logger.api(method, url, resp.status, body, data);
117
+ if ((resp.status === 401 || resp.status === 403) && retry) {
118
+ clearToken(host);
119
+ return dataopsRequest(ctx, method, path2, params, body, false);
120
+ }
121
+ if (!resp.ok) {
122
+ throw new Error(formatHttpError(resp.status, resp.statusText, data));
123
+ }
124
+ return unwrapDataResponse(data);
125
+ }
126
+ function buildUrl(host, path2, params = {}) {
127
+ const base = host.replace(/\/+$/, "");
128
+ const normalizedPath = path2.startsWith("/") ? path2 : `/${path2}`;
129
+ const url = new URL(`${base}${normalizedPath}`);
130
+ for (const [key, value] of Object.entries(params)) {
131
+ if (value !== void 0 && value !== null) {
132
+ url.searchParams.set(key, String(value));
133
+ }
134
+ }
135
+ return url.toString();
136
+ }
137
+ function compactArgs(args) {
138
+ const result = {};
139
+ for (const [key, value] of Object.entries(args)) {
140
+ if (value === void 0 || value === null || value === "") {
141
+ continue;
142
+ }
143
+ result[key] = value;
144
+ }
145
+ return result;
146
+ }
147
+ function unwrapDataResponse(data) {
148
+ const returnCode = data?.returnCode ?? data?.return_code;
149
+ const returnMessage = data?.returnMessage ?? data?.return_message;
150
+ if (returnCode !== void 0 && returnCode !== 0) {
151
+ throw new Error(`AE API error: ${returnMessage || "unknown"} (code: ${returnCode})`);
152
+ }
153
+ if (data?.data !== void 0) {
154
+ return data.data;
155
+ }
156
+ return data;
157
+ }
158
+ function parseResponseBody(text, url, status) {
159
+ try {
160
+ return safeJsonParse(text);
161
+ } catch {
162
+ const preview = text.trim().slice(0, 120);
163
+ throw new Error(`AE API error: non-JSON response from ${url} (HTTP ${status}): ${preview || "<empty>"}`);
164
+ }
165
+ }
166
+ function formatHttpError(status, statusText, data) {
167
+ const detail = data?.message || data?.error || data?.return_message || data?.returnMessage;
168
+ const path2 = data?.path ? ` path: ${data.path}` : "";
169
+ return `AE API error: HTTP ${status} ${statusText}${detail ? ` - ${detail}` : ""}${path2}`;
170
+ }
171
+
172
+ // src/commands/te-dataops/datatable/get-table-detail.ts
173
+ var toolName = "datatable_get_table_detail";
174
+ function optionalString(ctx, name) {
175
+ const value = ctx.str(name);
176
+ return value === "" ? void 0 : value;
177
+ }
178
+ function buildArgs(ctx) {
179
+ return {
180
+ spaceCode: ctx.str("spaceCode"),
181
+ tableName: ctx.str("tableName"),
182
+ manageMode: ctx.str("manageMode"),
183
+ env: ctx.str("env"),
184
+ entityType: optionalString(ctx, "entityType")
185
+ };
186
+ }
187
+ var getTableDetail = {
188
+ service: "dataops_datatable",
189
+ command: "+get_table_detail",
190
+ description: "Get compact DataOps catalog detail for a table/view. Resolves tableName across task, IDE, system, and authorized-space tables unless manageMode is set. TASK_ENV without env returns environments.DEV/PRODUCT; otherwise returns detail. Detail contains identity/status/owner/columns plus optional description/partitionColumns/ddl/lineages. Ambiguous matches return candidates. Unlike ide_get_table_detail, this includes DataOps lifecycle/status/lineage when available.",
191
+ flags: [
192
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
193
+ { name: "tableName", type: "string", required: true, desc: "Table name keyword; exact name recommended" },
194
+ { name: "manageMode", type: "string", required: false, desc: "Optional mode filter: TASK_ENV, IDE, SYSTEM, or AUTHED_SPACE. Omit to auto-match across modes" },
195
+ { name: "env", type: "string", required: false, desc: "Optional environment: DEV or PRODUCT. If omitted, TASK_ENV returns both environments" },
196
+ { name: "entityType", type: "string", required: false, desc: "Optional type hint: TABLE or VIEW. Omit unless the table name is ambiguous" }
197
+ ],
198
+ validate: (ctx) => {
199
+ const entityType = optionalString(ctx, "entityType");
200
+ if (entityType !== void 0 && entityType.toUpperCase() !== "TABLE" && entityType.toUpperCase() !== "VIEW") {
201
+ throw new Error("entityType must be TABLE or VIEW");
202
+ }
203
+ },
204
+ risk: "read",
205
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName, buildArgs(ctx)),
206
+ execute: async (ctx) => {
207
+ return callDataopsApi(ctx, toolName, buildArgs(ctx));
208
+ }
209
+ };
210
+
211
+ // src/commands/te-dataops/datatable/dict-search-tables.ts
212
+ var toolName2 = "datatable_dict_search_tables";
213
+ function buildArgs2(ctx) {
214
+ return {
215
+ spaceCode: ctx.str("spaceCode"),
216
+ search: ctx.str("search"),
217
+ maxResults: ctx.optionalNum("maxResults")
218
+ };
219
+ }
220
+ var dictSearchTables = {
221
+ service: "dataops_datatable",
222
+ command: "+dict_search_tables",
223
+ description: "Search the DataOps table catalog visible to a space, including task, IDE, system, and authorized-space tables. Use a precise keyword; empty or broad searches can be large. Matches table name, catalog, schema, comment, and remark where available. Returns tables plus totalCount, returnedCount, hasMore, and hint when truncated. Table summaries include identity, location, type, management mode, owner/subject, optional comment/remark, status, env, and createTime. Unlike ide_search_tables, this returns DataOps-enriched catalog results, not raw engine metadata.",
224
+ flags: [
225
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
226
+ { name: "search", type: "string", required: false, desc: "Keyword matching table name/catalog/schema/comment/remark where available" },
227
+ { name: "maxResults", type: "number", required: false, desc: "Max return count, default 50, max 200" }
228
+ ],
229
+ risk: "read",
230
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName2, buildArgs2(ctx)),
231
+ execute: async (ctx) => {
232
+ return callDataopsApi(ctx, toolName2, buildArgs2(ctx));
233
+ }
234
+ };
235
+
236
+ // src/commands/te-dataops/datatable/create-table.ts
237
+ var toolName3 = "datatable_create_table";
238
+ function buildArgs3(ctx) {
239
+ return {
240
+ spaceCode: ctx.str("spaceCode"),
241
+ ddl: ctx.str("ddl")
242
+ };
243
+ }
244
+ var createTable = {
245
+ service: "dataops_datatable",
246
+ command: "+create_table",
247
+ description: "Create a DataOps physical table in DEV from Trino-compatible CREATE TABLE DDL. Saves TASK_ENV metadata in the default workspace warehouse (repo=te_etl, catalog=hive) and does not publish PROD. Returns action/result/status; result contains success details or parse/errors on failure. Publish by name with +publish_entity.",
248
+ flags: [
249
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
250
+ { name: "ddl", type: "string", required: true, desc: "Complete Trino-compatible CREATE TABLE DDL statement" }
251
+ ],
252
+ risk: "write",
253
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName3, buildArgs3(ctx)),
254
+ execute: async (ctx) => {
255
+ return callDataopsApi(ctx, toolName3, buildArgs3(ctx));
256
+ }
257
+ };
258
+
259
+ // src/commands/te-dataops/datatable/create-view.ts
260
+ var toolName4 = "datatable_create_view";
261
+ function buildArgs4(ctx) {
262
+ return {
263
+ spaceCode: ctx.str("spaceCode"),
264
+ ddl: ctx.str("ddl")
265
+ };
266
+ }
267
+ function escapeRegExp(value) {
268
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
269
+ }
270
+ function validateEnvPlaceholder(ctx) {
271
+ const spaceCode = ctx.str("spaceCode");
272
+ const ddl = ctx.str("ddl");
273
+ const schemaPattern = new RegExp(`\\bws_${escapeRegExp(spaceCode)}_(?:dev|product)?(?=\\.)`, "i");
274
+ const match = ddl.match(schemaPattern);
275
+ if (!match) return;
276
+ const message = `CREATE VIEW DDL references workspace task schema "${match[0]}". Use the literal \${env} placeholder to avoid cross-environment dependencies. For a concrete space code, wrap the DDL in single quotes, for example: --ddl 'CREATE VIEW ... FROM hive.ws_${spaceCode}_\${env}.table'. If you use double quotes with shell variables, escape only env as ws_${spaceCode}_\\\${env}.`;
277
+ printError("validation", message);
278
+ process.exit(1);
279
+ }
280
+ var createView = {
281
+ service: "dataops_datatable",
282
+ command: "+create_view",
283
+ description: "Create a DataOps view in DEV from Trino-compatible CREATE VIEW DDL. Saves TASK_ENV metadata through the DataView save flow in the default workspace warehouse (repo=te_etl, catalog=hive) and does not publish PROD. Returns action/result/status; result contains success details or errors on failure. Publish by name with +publish_entity. Keep ${env} literal when referencing current-space task tables.",
284
+ flags: [
285
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
286
+ { name: "ddl", type: "string", required: true, desc: "Complete Trino-compatible CREATE VIEW DDL statement; keep ${env} literal when referencing current-space task tables" }
287
+ ],
288
+ risk: "write",
289
+ validate: validateEnvPlaceholder,
290
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName4, buildArgs4(ctx)),
291
+ execute: async (ctx) => {
292
+ return callDataopsApi(ctx, toolName4, buildArgs4(ctx));
293
+ }
294
+ };
295
+
296
+ // src/commands/te-dataops/datatable/publish-entity.ts
297
+ var toolName5 = "datatable_publish_entity";
298
+ function buildArgs5(ctx) {
299
+ return {
300
+ spaceCode: ctx.str("spaceCode"),
301
+ entityType: ctx.str("entityType"),
302
+ entityId: ctx.str("entityId"),
303
+ name: ctx.str("name")
304
+ };
305
+ }
306
+ var publishEntity = {
307
+ service: "dataops_datatable",
308
+ command: "+publish_entity",
309
+ description: "Publish one existing TASK_ENV DataOps table/view from DEV to PROD. Requires spaceCode and name. entityId disambiguates same-name matches; entityType (TABLE or VIEW) is an optional validation constraint. Returns action/result/status; result includes the resolved entity, published ids/names, onlineStatus=ONLINE, or errorType/candidates/errors on failure.",
310
+ flags: [
311
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
312
+ { name: "name", type: "string", required: true, desc: "Existing table or view name to publish" },
313
+ { name: "entityId", type: "string", required: false, desc: "Optional DataOps entity ID for disambiguating same-name matches" },
314
+ { name: "entityType", type: "string", required: false, desc: "Optional validation constraint: TABLE or VIEW" }
315
+ ],
316
+ risk: "write",
317
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName5, buildArgs5(ctx)),
318
+ execute: async (ctx) => {
319
+ return callDataopsApi(ctx, toolName5, buildArgs5(ctx));
320
+ }
321
+ };
322
+
323
+ // src/commands/te-dataops/datatable/index.ts
324
+ var commands = [
325
+ getTableDetail,
326
+ dictSearchTables,
327
+ createTable,
328
+ createView,
329
+ publishEntity
330
+ ];
331
+ var datatable_default = commands;
332
+
333
+ // src/commands/te-dataops/flow/get-flow-overview.ts
334
+ var toolName6 = "flow_get_flow_overview";
335
+ function requireFlowTarget(ctx) {
336
+ if (ctx.optionalNum("flowCode") == null && !ctx.str("flowName").trim()) {
337
+ throw new Error("Pass --flowCode or --flowName");
338
+ }
339
+ }
340
+ function buildArgs6(ctx) {
341
+ requireFlowTarget(ctx);
342
+ return {
343
+ spaceCode: ctx.str("spaceCode"),
344
+ flowCode: ctx.optionalNum("flowCode"),
345
+ flowName: ctx.str("flowName"),
346
+ env: ctx.str("env")
347
+ };
348
+ }
349
+ var getFlowOverview = {
350
+ service: "dataops_flow",
351
+ command: "+get_flow_overview",
352
+ description: "Get a DEV/PROD flow overview. Requires spaceCode and either flowCode or exact flowName; flowCode wins. env defaults to DEV. Returns success, env, resolvedBy, flow, schedule, dag, and summary; PROD may include latest instance fields.",
353
+ flags: [
354
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
355
+ { name: "flowCode", type: "number", required: false, desc: "Optional task flow code; takes precedence over flowName" },
356
+ { name: "flowName", type: "string", required: false, desc: "Optional exact task flow name; required when flowCode is omitted" },
357
+ { name: "env", type: "string", required: false, desc: "Optional environment: DEV (default) or PROD" }
358
+ ],
359
+ risk: "read",
360
+ validate: requireFlowTarget,
361
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName6, buildArgs6(ctx)),
362
+ execute: async (ctx) => {
363
+ return callDataopsApi(ctx, toolName6, buildArgs6(ctx));
364
+ }
365
+ };
366
+
367
+ // src/commands/te-dataops/flow/list-flows.ts
368
+ var toolName7 = "flow_list_flows";
369
+ function buildArgs7(ctx) {
370
+ return {
371
+ spaceCode: ctx.str("spaceCode"),
372
+ keyword: ctx.str("keyword"),
373
+ pageNum: ctx.optionalNum("pageNum"),
374
+ pageSize: ctx.optionalNum("pageSize")
375
+ };
376
+ }
377
+ var listFlows = {
378
+ service: "dataops_flow",
379
+ command: "+list_flows",
380
+ description: "List task flows in a space. Requires spaceCode; keyword, pageNum, and pageSize are optional. Returns flows plus totalCount, returnedCount, pageNum, pageSize, and hasMore. Each flow includes basic metadata and latestProductionInstance when available. keyword matches flowName by contains and remark as a comma-delimited token. pageNum defaults to 1; pageSize defaults to 20 and maxes at 100.",
381
+ flags: [
382
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
383
+ { name: "keyword", type: "string", required: false, desc: "Optional search keyword: flowName contains it; remark matches it as a comma-delimited token" },
384
+ { name: "pageNum", type: "number", required: false, desc: "Optional page number; default 1" },
385
+ { name: "pageSize", type: "number", required: false, desc: "Optional page size; default 20, max 100" }
386
+ ],
387
+ risk: "read",
388
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName7, buildArgs7(ctx)),
389
+ execute: async (ctx) => {
390
+ return callDataopsApi(ctx, toolName7, buildArgs7(ctx));
391
+ }
392
+ };
393
+
394
+ // src/commands/te-dataops/flow/save-schedule-config.ts
395
+ var toolName8 = "flow_save_schedule_config";
396
+ function buildArgs8(ctx) {
397
+ return {
398
+ spaceCode: ctx.str("spaceCode"),
399
+ flowCode: ctx.num("flowCode"),
400
+ enabled: ctx.bool("enabled"),
401
+ cron: ctx.str("cron")
402
+ };
403
+ }
404
+ var saveScheduleConfig = {
405
+ service: "dataops_flow",
406
+ command: "+save_schedule_config",
407
+ description: "Save DEV flow schedule config. Requires spaceCode, flowCode, and enabled. cron is required only when enabled=true; enabled=false disables scheduling. Returns action/result/status; result includes enabled, flow, message, and cron when enabled=true. Release the flow to apply changes in PROD",
408
+ flags: [
409
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
410
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
411
+ { name: "enabled", type: "boolean", required: true, desc: "Whether scheduling is enabled: true or false" },
412
+ { name: "cron", type: "string", required: false, desc: "Quartz CRON expression. Required only when enabled=true, e.g., '0 0 2 * * ?'" }
413
+ ],
414
+ risk: "write",
415
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName8, buildArgs8(ctx)),
416
+ execute: async (ctx) => {
417
+ return callDataopsApi(ctx, toolName8, buildArgs8(ctx));
418
+ }
419
+ };
420
+
421
+ // src/commands/te-dataops/flow/execute-flow.ts
422
+ var toolName9 = "flow_execute_flow";
423
+ function buildArgs9(ctx) {
424
+ return {
425
+ spaceCode: ctx.str("spaceCode"),
426
+ flowCode: ctx.num("flowCode"),
427
+ baseDate: ctx.str("baseDate")
428
+ };
429
+ }
430
+ var executeFlow = {
431
+ service: "dataops_flow",
432
+ command: "+execute_flow",
433
+ description: "Trigger one full PROD task flow execution. Requires spaceCode and flowCode; baseDate is optional and maps to runtime parameter bd. Returns action/result/status; result includes flowCode, executeId, operationStatus, nextAction, and optional flowInstanceId.",
434
+ flags: [
435
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
436
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
437
+ { name: "baseDate", type: "string", required: false, desc: "Optional data date, format yyyy-MM-dd. Maps to runtime parameter bd" }
438
+ ],
439
+ risk: "write",
440
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName9, buildArgs9(ctx)),
441
+ execute: async (ctx) => {
442
+ return callDataopsApi(ctx, toolName9, buildArgs9(ctx));
443
+ }
444
+ };
445
+
446
+ // src/commands/te-dataops/flow/release-flow.ts
447
+ var toolName10 = "flow_release_flow";
448
+ function buildArgs10(ctx) {
449
+ return {
450
+ spaceCode: ctx.str("spaceCode"),
451
+ flowCode: ctx.num("flowCode")
452
+ };
453
+ }
454
+ var releaseFlow = {
455
+ service: "dataops_flow",
456
+ command: "+release_flow",
457
+ description: "Submit one DEV-to-PROD task flow release. Requires spaceCode and flowCode. Returns action/result/status; result includes flowCode, releaseStatus, message, optional packageCode, and optional changes with scheduleConfigChange and task changed items. Preview with +preview_release_flow first.",
458
+ flags: [
459
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
460
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" }
461
+ ],
462
+ risk: "write",
463
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName10, buildArgs10(ctx)),
464
+ execute: async (ctx) => {
465
+ return callDataopsApi(ctx, toolName10, buildArgs10(ctx));
466
+ }
467
+ };
468
+
469
+ // src/commands/te-dataops/flow/preview-release-flow.ts
470
+ var toolName11 = "flow_preview_release_flow";
471
+ function buildArgs11(ctx) {
472
+ return {
473
+ spaceCode: ctx.str("spaceCode"),
474
+ flowCode: ctx.num("flowCode")
475
+ };
476
+ }
477
+ var previewReleaseFlow = {
478
+ service: "dataops_flow",
479
+ command: "+preview_release_flow",
480
+ description: "Preview pending DEV-to-PROD release changes for one task flow without publishing. Requires spaceCode and flowCode. Returns flowCode, releaseStatus, message, and changes with scheduleConfigChange and task diffs. Use before +release_flow.",
481
+ flags: [
482
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
483
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" }
484
+ ],
485
+ risk: "read",
486
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName11, buildArgs11(ctx)),
487
+ execute: async (ctx) => {
488
+ return callDataopsApi(ctx, toolName11, buildArgs11(ctx));
489
+ }
490
+ };
491
+
492
+ // src/commands/te-dataops/flow/update-flow.ts
493
+ var toolName12 = "flow_update_flow";
494
+ function requireUpdateField(ctx) {
495
+ if (!ctx.str("flowName").trim() && !ctx.str("remark").trim()) {
496
+ throw new Error("Pass at least one of --flowName or --remark");
497
+ }
498
+ }
499
+ function buildArgs12(ctx) {
500
+ requireUpdateField(ctx);
501
+ return {
502
+ spaceCode: ctx.str("spaceCode"),
503
+ flowCode: ctx.num("flowCode"),
504
+ flowName: ctx.str("flowName"),
505
+ remark: ctx.str("remark")
506
+ };
507
+ }
508
+ var updateFlow = {
509
+ service: "dataops_flow",
510
+ command: "+update_flow",
511
+ description: "Update DEV workflow name and/or remark. Requires spaceCode, flowCode, and at least one of flowName or remark. Returns action/result/status; result is an array with flowCode, operationStatus, nameChanged, and optional flowName.",
512
+ flags: [
513
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
514
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
515
+ { name: "flowName", type: "string", required: false, desc: "Optional new workflow name" },
516
+ { name: "remark", type: "string", required: false, desc: "Optional new workflow remark" }
517
+ ],
518
+ risk: "write",
519
+ validate: requireUpdateField,
520
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName12, buildArgs12(ctx)),
521
+ execute: async (ctx) => {
522
+ return callDataopsApi(ctx, toolName12, buildArgs12(ctx));
523
+ }
524
+ };
525
+
526
+ // src/commands/te-dataops/flow/create-flow.ts
527
+ var toolName13 = "flow_create_flow";
528
+ function buildArgs13(ctx) {
529
+ return {
530
+ spaceCode: ctx.str("spaceCode"),
531
+ flowName: ctx.str("flowName"),
532
+ remark: ctx.str("remark")
533
+ };
534
+ }
535
+ var createFlow = {
536
+ service: "dataops_flow",
537
+ command: "+create_flow",
538
+ description: "Create a DEV task flow. Requires spaceCode and flowName; remark is optional. Returns action/result/status; result contains flowCode and flowName. Add task nodes separately, then configure scheduling if needed.",
539
+ flags: [
540
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
541
+ { name: "flowName", type: "string", required: true, desc: "Task flow name" },
542
+ { name: "remark", type: "string", required: false, desc: "Optional flow description" }
543
+ ],
544
+ risk: "write",
545
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName13, buildArgs13(ctx)),
546
+ execute: async (ctx) => {
547
+ return callDataopsApi(ctx, toolName13, buildArgs13(ctx));
548
+ }
549
+ };
550
+
551
+ // src/commands/te-dataops/flow/get-task-params.ts
552
+ var toolName14 = "flow_get_task_params";
553
+ function buildArgs14(ctx) {
554
+ return {
555
+ spaceCode: ctx.str("spaceCode"),
556
+ flowCode: ctx.num("flowCode"),
557
+ taskCode: ctx.num("taskCode")
558
+ };
559
+ }
560
+ var getTaskParams = {
561
+ service: "dataops_flow",
562
+ command: "+get_task_params",
563
+ description: "Query DEV task parameters. Requires spaceCode, flowCode, and taskCode. Returns an array; items include paramKey, paramType, paramDataType, paramFrom, and built-in flags like isBd",
564
+ flags: [
565
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
566
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
567
+ { name: "taskCode", type: "number", required: true, desc: "Task code" }
568
+ ],
569
+ risk: "read",
570
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName14, buildArgs14(ctx)),
571
+ execute: async (ctx) => {
572
+ return callDataopsApi(ctx, toolName14, buildArgs14(ctx));
573
+ }
574
+ };
575
+
576
+ // src/commands/te-dataops/flow/add-task-relation.ts
577
+ var toolName15 = "flow_add_task_relation";
578
+ function buildArgs15(ctx) {
579
+ return {
580
+ spaceCode: ctx.str("spaceCode"),
581
+ flowCode: ctx.num("flowCode"),
582
+ preTaskCode: ctx.num("preTaskCode"),
583
+ taskCode: ctx.num("taskCode")
584
+ };
585
+ }
586
+ var addTaskRelation = {
587
+ service: "dataops_flow",
588
+ command: "+add_task_relation",
589
+ description: "Add a DEV dependency from preTaskCode (upstream) to taskCode (downstream). Requires spaceCode, flowCode, preTaskCode, and taskCode. Returns action/result/status; result includes status, flowCode, preTaskCode, taskCode, and message",
590
+ flags: [
591
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
592
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
593
+ { name: "preTaskCode", type: "number", required: true, desc: "Pre-task code (upstream)" },
594
+ { name: "taskCode", type: "number", required: true, desc: "Current task code (downstream)" }
595
+ ],
596
+ risk: "write",
597
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName15, buildArgs15(ctx)),
598
+ execute: async (ctx) => {
599
+ return callDataopsApi(ctx, toolName15, buildArgs15(ctx));
600
+ }
601
+ };
602
+
603
+ // src/commands/te-dataops/flow/create-sql-task.ts
604
+ var toolName16 = "flow_create_sql_task";
605
+ function buildArgs16(ctx) {
606
+ return {
607
+ spaceCode: ctx.str("spaceCode"),
608
+ flowCode: ctx.num("flowCode"),
609
+ taskName: ctx.str("taskName"),
610
+ sql: ctx.str("sql"),
611
+ preSql: ctx.str("preSql"),
612
+ postSql: ctx.str("postSql"),
613
+ preTaskCode: ctx.optionalNum("preTaskCode"),
614
+ remark: ctx.str("remark")
615
+ };
616
+ }
617
+ var createSqlTask = {
618
+ service: "dataops_flow",
619
+ command: "+create_sql_task",
620
+ description: "Create a DEV Trino SQL task and save its SQL. Requires spaceCode, flowCode, taskName, and sql; preSql, postSql, preTaskCode, and remark are optional. Returns action/result/status; result includes flowCode, taskCode, taskName, taskType=TRINO_SQL, and sqlSaved=true",
621
+ flags: [
622
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
623
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
624
+ { name: "taskName", type: "string", required: true, desc: "Task name" },
625
+ { name: "sql", type: "string", required: true, desc: "Trino SQL content for the task" },
626
+ { name: "preSql", type: "string", required: false, desc: "Optional SQL to run before the main SQL" },
627
+ { name: "postSql", type: "string", required: false, desc: "Optional SQL to run after the main SQL" },
628
+ { name: "preTaskCode", type: "number", required: false, desc: "Pre-task code (upstream dependency)" },
629
+ { name: "remark", type: "string", required: false, desc: "Description" }
630
+ ],
631
+ risk: "write",
632
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName16, buildArgs16(ctx)),
633
+ execute: async (ctx) => {
634
+ return callDataopsApi(ctx, toolName16, buildArgs16(ctx));
635
+ }
636
+ };
637
+
638
+ // src/commands/te-dataops/flow/update-sql-task.ts
639
+ var toolName17 = "flow_update_sql_task";
640
+ function buildArgs17(ctx) {
641
+ return {
642
+ spaceCode: ctx.str("spaceCode"),
643
+ flowCode: ctx.num("flowCode"),
644
+ taskCode: ctx.num("taskCode"),
645
+ sql: ctx.str("sql"),
646
+ preSql: ctx.str("preSql"),
647
+ postSql: ctx.str("postSql")
648
+ };
649
+ }
650
+ var updateSqlTask = {
651
+ service: "dataops_flow",
652
+ command: "+update_sql_task",
653
+ description: "Update an existing DEV Trino SQL task. Requires spaceCode, flowCode, taskCode, and sql; preSql and postSql are optional and keep existing values when omitted. Returns action/result/status; result includes sqlSaved, flowCode, taskCode, taskType=TRINO_SQL, and task",
654
+ flags: [
655
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
656
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
657
+ { name: "taskCode", type: "number", required: true, desc: "Trino SQL task code" },
658
+ { name: "sql", type: "string", required: true, desc: "Main Trino SQL content" },
659
+ { name: "preSql", type: "string", required: false, desc: "Optional SQL to run before the main SQL. Omit to keep existing preSql" },
660
+ { name: "postSql", type: "string", required: false, desc: "Optional SQL to run after the main SQL. Omit to keep existing postSql" }
661
+ ],
662
+ risk: "write",
663
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName17, buildArgs17(ctx)),
664
+ execute: async (ctx) => {
665
+ return callDataopsApi(ctx, toolName17, buildArgs17(ctx));
666
+ }
667
+ };
668
+
669
+ // src/commands/te-dataops/flow/create-integration-task.ts
670
+ var toolName18 = "flow_create_integration_task";
671
+ function validateInteger(ctx, name, required = true) {
672
+ const value = ctx.str(name).trim();
673
+ if (!value && !required) return;
674
+ if (!/^\d+$/.test(value)) {
675
+ throw new Error(`Invalid --${name}: expected an integer, got "${value}"`);
676
+ }
677
+ }
678
+ function buildArgs18(ctx) {
679
+ return {
680
+ spaceCode: ctx.str("spaceCode"),
681
+ flowCode: ctx.num("flowCode"),
682
+ taskName: ctx.str("taskName"),
683
+ syncId: ctx.str("syncId"),
684
+ preTaskCode: ctx.optionalNum("preTaskCode"),
685
+ remark: ctx.str("remark")
686
+ };
687
+ }
688
+ var createIntegrationTask = {
689
+ service: "dataops_flow",
690
+ command: "+create_integration_task",
691
+ description: "Create a DEV integration sync task node bound to an existing DataOps sync solution. Use dataops_integration +list_sync_solutions or +get_sync_detail to find syncId. Returns action, result, and status; result includes syncTaskSaved, flowCode, taskCode, taskName, taskType=OFFLINE_SYNC, syncId, and nextAction",
692
+ flags: [
693
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
694
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
695
+ { name: "taskName", type: "string", required: true, desc: "Task name" },
696
+ { name: "syncId", type: "string", required: true, desc: "DataOps sync solution ID to bind" },
697
+ { name: "preTaskCode", type: "number", required: false, desc: "Pre-task code (upstream dependency)" },
698
+ { name: "remark", type: "string", required: false, desc: "Description" }
699
+ ],
700
+ risk: "write",
701
+ validate: (ctx) => {
702
+ validateInteger(ctx, "flowCode");
703
+ validateInteger(ctx, "preTaskCode", false);
704
+ },
705
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName18, buildArgs18(ctx)),
706
+ execute: async (ctx) => callDataopsApi(ctx, toolName18, buildArgs18(ctx))
707
+ };
708
+
709
+ // src/commands/te-dataops/flow/update-integration-task.ts
710
+ var toolName19 = "flow_update_integration_task";
711
+ function validateInteger2(ctx, name) {
712
+ const value = ctx.str(name).trim();
713
+ if (!/^\d+$/.test(value)) {
714
+ throw new Error(`Invalid --${name}: expected an integer, got "${value}"`);
715
+ }
716
+ }
717
+ function buildArgs19(ctx) {
718
+ return {
719
+ spaceCode: ctx.str("spaceCode"),
720
+ flowCode: ctx.num("flowCode"),
721
+ taskCode: ctx.num("taskCode"),
722
+ syncId: ctx.str("syncId")
723
+ };
724
+ }
725
+ var updateIntegrationTask = {
726
+ service: "dataops_flow",
727
+ command: "+update_integration_task",
728
+ description: "Update an existing DEV integration sync task to bind a DataOps sync solution. The task must be taskType=OFFLINE_SYNC. Preserves task name, dependencies, retry policy, timeout, and other task configuration",
729
+ flags: [
730
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
731
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
732
+ { name: "taskCode", type: "number", required: true, desc: "Integration task code" },
733
+ { name: "syncId", type: "string", required: true, desc: "DataOps sync solution ID to bind" }
734
+ ],
735
+ risk: "write",
736
+ validate: (ctx) => {
737
+ validateInteger2(ctx, "flowCode");
738
+ validateInteger2(ctx, "taskCode");
739
+ },
740
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName19, buildArgs19(ctx)),
741
+ execute: async (ctx) => callDataopsApi(ctx, toolName19, buildArgs19(ctx))
742
+ };
743
+
744
+ // src/commands/te-dataops/flow/list-high-frequency-release-flows.ts
745
+ var toolName20 = "flow_list_high_frequency_release_flows";
746
+ function buildArgs20(ctx) {
747
+ return {
748
+ spaceCode: ctx.str("spaceCode"),
749
+ days: ctx.optionalNum("days"),
750
+ topN: ctx.optionalNum("topN"),
751
+ minCount: ctx.optionalNum("minCount"),
752
+ status: ctx.str("status")
753
+ };
754
+ }
755
+ var listHighFrequencyReleaseFlows = {
756
+ service: "dataops_flow",
757
+ command: "+list_high_frequency_release_flows",
758
+ description: "List flows ranked by release count, not execution count. Requires spaceCode; days, topN, minCount, and status are optional. Defaults to days=30, topN=10, status=SUCCESS. Returns period, filters, flows, returnedCount, and nextAction.",
759
+ flags: [
760
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
761
+ { name: "days", type: "number", required: false, desc: "Optional lookback days; default 30, max 365" },
762
+ { name: "topN", type: "number", required: false, desc: "Optional top N flows; default 10, max 100" },
763
+ { name: "minCount", type: "number", required: false, desc: "Optional minimum release count" },
764
+ { name: "status", type: "string", required: false, desc: "Optional release status: SUCCESS, FAIL, PART_SUCCESS, or ALL; default SUCCESS" }
765
+ ],
766
+ risk: "read",
767
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName20, buildArgs20(ctx)),
768
+ execute: async (ctx) => {
769
+ return callDataopsApi(ctx, toolName20, buildArgs20(ctx));
770
+ }
771
+ };
772
+
773
+ // src/commands/te-dataops/flow/index.ts
774
+ var commands2 = [
775
+ getFlowOverview,
776
+ listFlows,
777
+ listHighFrequencyReleaseFlows,
778
+ saveScheduleConfig,
779
+ executeFlow,
780
+ previewReleaseFlow,
781
+ releaseFlow,
782
+ updateFlow,
783
+ createFlow,
784
+ getTaskParams,
785
+ updateSqlTask,
786
+ updateIntegrationTask,
787
+ addTaskRelation,
788
+ createSqlTask,
789
+ createIntegrationTask
790
+ ];
791
+ var flow_default = commands2;
792
+
793
+ // src/commands/te-dataops/integration/list-datasource-components.ts
794
+ var toolName21 = "integration_list_datasource_components";
795
+ var listDatasourceComponents = {
796
+ service: "dataops_integration",
797
+ command: "+list_datasource_components",
798
+ description: "List supported datasource components. Requires no arguments. Returns componentName, componentType, and description. Use +get_datasource_component_template before creating a datasource.",
799
+ flags: [],
800
+ risk: "read",
801
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName21, {}),
802
+ execute: async (ctx) => {
803
+ return callDataopsApi(ctx, toolName21, {});
804
+ }
805
+ };
806
+
807
+ // src/commands/te-dataops/integration/get-datasource-component-template.ts
808
+ var toolName22 = "integration_get_datasource_component_template";
809
+ function buildArgs21(ctx) {
810
+ return {
811
+ componentName: ctx.str("componentName")
812
+ };
813
+ }
814
+ var getDatasourceComponentTemplate = {
815
+ service: "dataops_integration",
816
+ command: "+get_datasource_component_template",
817
+ description: "Get the envJsonList template for one datasource component. Requires componentName. Returns component metadata, requiredFields, optionalFields, envJsonExampleObject, and importantNotes.",
818
+ flags: [
819
+ { name: "componentName", type: "string", required: true, desc: "Exact componentName returned by +list_datasource_components, e.g. MySQL, ClickHouse, DatabricksJdbc, LarkBitable, OSS, S3, HDFS" }
820
+ ],
821
+ risk: "read",
822
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName22, buildArgs21(ctx)),
823
+ execute: async (ctx) => {
824
+ return callDataopsApi(ctx, toolName22, buildArgs21(ctx));
825
+ }
826
+ };
827
+
828
+ // src/commands/te-dataops/integration/list-space-datasources.ts
829
+ var toolName23 = "integration_list_space_datasources";
830
+ function buildArgs22(ctx) {
831
+ return {
832
+ spaceCode: ctx.str("spaceCode"),
833
+ dataSourceName: ctx.str("datasourceName"),
834
+ componentName: ctx.str("componentName")
835
+ };
836
+ }
837
+ var listSpaceDatasources = {
838
+ service: "dataops_integration",
839
+ command: "+list_space_datasources",
840
+ description: "List datasource summaries in a space. Requires spaceCode; datasourceName and componentName are optional filters. Returns datasourceId, dataSourceComponentName, dataSourceName, dataSourceRemark, dataSourceStatus, connectStatus, syncTaskNum, and sharedConfig.",
841
+ flags: [
842
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
843
+ { name: "datasourceName", type: "string", required: false, desc: "Optional exact datasource name filter" },
844
+ { name: "componentName", type: "string", required: false, desc: "Optional component type filter, e.g. MySQL or ClickHouse" }
845
+ ],
846
+ risk: "read",
847
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName23, buildArgs22(ctx)),
848
+ execute: async (ctx) => {
849
+ return callDataopsApi(ctx, toolName23, buildArgs22(ctx));
850
+ }
851
+ };
852
+
853
+ // src/commands/te-dataops/integration/get-datasource-detail.ts
854
+ var toolName24 = "integration_get_datasource_detail";
855
+ function buildArgs23(ctx) {
856
+ return {
857
+ spaceCode: ctx.str("spaceCode"),
858
+ dataSourceName: ctx.str("datasourceName")
859
+ };
860
+ }
861
+ var getDatasourceDetail = {
862
+ service: "dataops_integration",
863
+ command: "+get_datasource_detail",
864
+ description: "Get one datasource detail by exact name. Required: spaceCode, datasourceName. Returns datasourceId, dataSourceComponentName, dataSourceName, dataSourceRemark, dataSourceStatus, connectStatus, syncTaskNum, sharedConfig, masked connectConfig, connectFails, and lastConnectTime.",
865
+ flags: [
866
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
867
+ { name: "datasourceName", type: "string", required: true, desc: "Exact datasource name within the space" }
868
+ ],
869
+ risk: "read",
870
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName24, buildArgs23(ctx)),
871
+ execute: async (ctx) => {
872
+ return callDataopsApi(ctx, toolName24, buildArgs23(ctx));
873
+ }
874
+ };
875
+
876
+ // src/commands/te-dataops/integration/test-datasource-connect.ts
877
+ var toolName25 = "integration_test_datasource_connect";
878
+ var testDatasourceConnect = {
879
+ service: "dataops_integration",
880
+ command: "+test_datasource_connect",
881
+ description: "Test a saved datasource connection by name. Returns datasourceName, connectStatus, connectFails, lastConnectTime, and nextAction. May take longer for slow external systems.",
882
+ flags: [
883
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
884
+ { name: "datasourceName", type: "string", required: true, desc: "Existing datasource name, exact match within the space" }
885
+ ],
886
+ risk: "read",
887
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName25, {
888
+ spaceCode: ctx.str("spaceCode"),
889
+ datasourceName: ctx.str("datasourceName")
890
+ }),
891
+ execute: async (ctx) => {
892
+ return callDataopsApi(ctx, toolName25, {
893
+ spaceCode: ctx.str("spaceCode"),
894
+ datasourceName: ctx.str("datasourceName")
895
+ });
896
+ }
897
+ };
898
+
899
+ // src/commands/te-dataops/integration/list-datasource-tables.ts
900
+ var toolName26 = "integration_list_datasource_tables";
901
+ function buildArgs24(ctx) {
902
+ return {
903
+ spaceCode: ctx.str("spaceCode"),
904
+ datasourceId: ctx.str("datasourceId"),
905
+ catalog: ctx.str("catalog"),
906
+ database: ctx.str("database"),
907
+ env: ctx.str("env")
908
+ };
909
+ }
910
+ var listDatasourceTables = {
911
+ service: "dataops_integration",
912
+ command: "+list_datasource_tables",
913
+ description: "List tables under a datasource database. Required: spaceCode, datasourceId, database. Optional: catalog, env (DEV default or PROD). Returns an array of table metadata with database, tableName, tableType, tableComment, engine, disabled, disabledReasons, sameVersion, and supportSharding.",
914
+ flags: [
915
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
916
+ { name: "datasourceId", type: "string", required: true, desc: "Datasource ID" },
917
+ { name: "catalog", type: "string", required: false, desc: "Catalog name for catalog-based datasources such as Databricks" },
918
+ { name: "database", type: "string", required: true, desc: "Database/schema name" },
919
+ { name: "env", type: "string", required: false, desc: "Environment: DEV (default) or PROD" }
920
+ ],
921
+ risk: "read",
922
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName26, buildArgs24(ctx)),
923
+ execute: async (ctx) => {
924
+ return callDataopsApi(ctx, toolName26, buildArgs24(ctx));
925
+ }
926
+ };
927
+
928
+ // src/commands/te-dataops/integration/get-table-structure.ts
929
+ var toolName27 = "integration_get_table_structure";
930
+ function buildArgs25(ctx) {
931
+ return {
932
+ spaceCode: ctx.str("spaceCode"),
933
+ datasourceId: ctx.str("datasourceId"),
934
+ catalog: ctx.str("catalog"),
935
+ database: ctx.str("database"),
936
+ tablePath: ctx.str("tablePath"),
937
+ env: ctx.str("env")
938
+ };
939
+ }
940
+ var getTableStructure = {
941
+ service: "dataops_integration",
942
+ command: "+get_table_structure",
943
+ description: "Get structure for a datasource table. Required: spaceCode, datasourceId, database, tablePath. Optional: catalog, env (DEV default or PROD). Returns columns and partitionColumns.",
944
+ flags: [
945
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
946
+ { name: "datasourceId", type: "string", required: true, desc: "Datasource ID" },
947
+ { name: "catalog", type: "string", required: false, desc: "Catalog name for catalog-based datasources such as Databricks" },
948
+ { name: "database", type: "string", required: true, desc: "Database name" },
949
+ { name: "tablePath", type: "string", required: true, desc: "Table name or path" },
950
+ { name: "env", type: "string", required: false, desc: "Environment: DEV (default) or PROD" }
951
+ ],
952
+ risk: "read",
953
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName27, buildArgs25(ctx)),
954
+ execute: async (ctx) => {
955
+ return callDataopsApi(ctx, toolName27, buildArgs25(ctx));
956
+ }
957
+ };
958
+
959
+ // src/commands/te-dataops/integration/list-sync-datasources.ts
960
+ var toolName28 = "integration_list_sync_datasources";
961
+ function buildArgs26(ctx) {
962
+ return {
963
+ spaceCode: ctx.str("spaceCode"),
964
+ env: ctx.str("env")
965
+ };
966
+ }
967
+ var listSyncDatasources = {
968
+ service: "dataops_integration",
969
+ command: "+list_sync_datasources",
970
+ description: "List datasources usable by sync solutions. Required: spaceCode. Optional: env (DEV default or PROD). Returns sourceComponentSet and sinkComponentSet grouped by component, with dataSourceList and supportableComponent.",
971
+ flags: [
972
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
973
+ { name: "env", type: "string", required: false, desc: "Environment: DEV (default) or PROD" }
974
+ ],
975
+ risk: "read",
976
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName28, buildArgs26(ctx)),
977
+ execute: async (ctx) => {
978
+ return callDataopsApi(ctx, toolName28, buildArgs26(ctx));
979
+ }
980
+ };
981
+
982
+ // src/commands/te-dataops/integration/list-datasource-databases.ts
983
+ var toolName29 = "integration_list_datasource_databases";
984
+ function buildArgs27(ctx) {
985
+ return {
986
+ spaceCode: ctx.str("spaceCode"),
987
+ datasourceId: ctx.str("datasourceId"),
988
+ catalog: ctx.str("catalog"),
989
+ env: ctx.str("env")
990
+ };
991
+ }
992
+ var listDatasourceDatabases = {
993
+ service: "dataops_integration",
994
+ command: "+list_datasource_databases",
995
+ description: "List databases/schemas under a datasource. Required: spaceCode, datasourceId. Optional: catalog, env (DEV default or PROD). Returns an array of objects with databaseName.",
996
+ flags: [
997
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
998
+ { name: "datasourceId", type: "string", required: true, desc: "Datasource ID" },
999
+ { name: "catalog", type: "string", required: false, desc: "Catalog name for catalog-based datasources such as Databricks" },
1000
+ { name: "env", type: "string", required: false, desc: "Environment: DEV (default) or PROD" }
1001
+ ],
1002
+ risk: "read",
1003
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName29, buildArgs27(ctx)),
1004
+ execute: async (ctx) => {
1005
+ return callDataopsApi(ctx, toolName29, buildArgs27(ctx));
1006
+ }
1007
+ };
1008
+
1009
+ // src/commands/te-dataops/integration/online-datasource.ts
1010
+ var toolName30 = "integration_online_datasource";
1011
+ function buildArgs28(ctx) {
1012
+ return {
1013
+ spaceCode: ctx.str("spaceCode"),
1014
+ dataSourceNames: ctx.str("dataSourceNames")
1015
+ };
1016
+ }
1017
+ var onlineDatasource = {
1018
+ service: "dataops_integration",
1019
+ command: "+online_datasource",
1020
+ description: "Online one or more datasources. Requires spaceCode and comma-separated dataSourceNames.",
1021
+ flags: [
1022
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1023
+ { name: "dataSourceNames", type: "string", required: true, desc: "Datasource name list (comma-separated)" }
1024
+ ],
1025
+ risk: "write",
1026
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName30, buildArgs28(ctx)),
1027
+ execute: async (ctx) => {
1028
+ return callDataopsApi(ctx, toolName30, buildArgs28(ctx));
1029
+ }
1030
+ };
1031
+
1032
+ // src/commands/te-dataops/integration/add-datasource.ts
1033
+ var toolName31 = "integration_add_datasource";
1034
+ function buildArgs29(ctx) {
1035
+ return {
1036
+ spaceCode: ctx.str("spaceCode"),
1037
+ componentName: ctx.str("componentName"),
1038
+ dataSourceName: ctx.str("dataSourceName"),
1039
+ dataSourceRemark: ctx.str("dataSourceRemark"),
1040
+ sharedConfig: ctx.bool("sharedConfig"),
1041
+ envJsonList: ctx.str("envJsonList")
1042
+ };
1043
+ }
1044
+ var addDatasource = {
1045
+ service: "dataops_integration",
1046
+ command: "+add_datasource",
1047
+ description: "Create a datasource. Required: spaceCode, componentName, dataSourceName, sharedConfig, envJsonList. Optional: dataSourceRemark. envJsonList is a JSON array string whose keys must match requiredFields from +get_datasource_component_template; sharedConfig=true uses one config for DEV/PROD, sharedConfig=false requires two configs (DEV, PROD).",
1048
+ flags: [
1049
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1050
+ { name: "componentName", type: "string", required: true, desc: "Datasource component name from +list_datasource_components, e.g. MySQL or ClickHouse" },
1051
+ { name: "dataSourceName", type: "string", required: true, desc: "Datasource name (1-80 characters)" },
1052
+ { name: "dataSourceRemark", type: "string", required: false, desc: "Datasource remark (max 200 characters)" },
1053
+ { name: "sharedConfig", type: "boolean", required: true, desc: "true: one envJsonList item is copied to DEV/PROD; false: provide two items (DEV, PROD)" },
1054
+ { name: "envJsonList", type: "string", required: true, desc: "JSON array string of component connection fields. Keys must match requiredFields from +get_datasource_component_template" }
1055
+ ],
1056
+ risk: "write",
1057
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName31, buildArgs29(ctx)),
1058
+ execute: async (ctx) => {
1059
+ return callDataopsApi(ctx, toolName31, buildArgs29(ctx));
1060
+ }
1061
+ };
1062
+
1063
+ // src/commands/te-dataops/integration/modify-datasource.ts
1064
+ var toolName32 = "integration_modify_datasource";
1065
+ function optionalBool(ctx, name) {
1066
+ const flagName = `--${name}`;
1067
+ const hasFlag = process.argv.some((arg) => arg === flagName || arg.startsWith(`${flagName}=`));
1068
+ if (!hasFlag) return void 0;
1069
+ const raw = ctx.str(name);
1070
+ return raw === "true" || raw === "1" || raw === "yes";
1071
+ }
1072
+ function buildArgs30(ctx) {
1073
+ return {
1074
+ spaceCode: ctx.str("spaceCode"),
1075
+ dataSourceName: ctx.str("dataSourceName"),
1076
+ dataSourceRemark: ctx.str("dataSourceRemark"),
1077
+ sharedConfig: optionalBool(ctx, "sharedConfig"),
1078
+ envJsonList: ctx.str("envJsonList")
1079
+ };
1080
+ }
1081
+ var modifyDatasource = {
1082
+ service: "dataops_integration",
1083
+ command: "+modify_datasource",
1084
+ description: "Modify datasource configuration. Requires spaceCode and dataSourceName. Optional fields dataSourceRemark, sharedConfig, and envJsonList update only the provided values. envJsonList uses the same JSON array format as +add_datasource. Changing connection parameters may affect running sync solutions.",
1085
+ flags: [
1086
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1087
+ { name: "dataSourceName", type: "string", required: true, desc: "Datasource name" },
1088
+ { name: "dataSourceRemark", type: "string", required: false, desc: "New remark (not passed means not modified)" },
1089
+ { name: "sharedConfig", type: "boolean", required: false, desc: "Whether to share configuration (not passed means not modified)" },
1090
+ { name: "envJsonList", type: "string", required: false, desc: "New environment config JSON array string (not passed means not modified)" }
1091
+ ],
1092
+ risk: "write",
1093
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName32, buildArgs30(ctx)),
1094
+ execute: async (ctx) => {
1095
+ return callDataopsApi(ctx, toolName32, buildArgs30(ctx));
1096
+ }
1097
+ };
1098
+
1099
+ // src/commands/te-dataops/integration/list-sync-solutions.ts
1100
+ var toolName33 = "integration_list_sync_solutions";
1101
+ function buildArgs31(ctx) {
1102
+ return {
1103
+ spaceCode: ctx.str("spaceCode")
1104
+ };
1105
+ }
1106
+ var listSyncSolutions = {
1107
+ service: "dataops_integration",
1108
+ command: "+list_sync_solutions",
1109
+ description: "List sync solutions in a space. Returns syncId, syncName, source/sink component, datasource, database and table fields, lastExecStatus/lastScheduleStatus codes, owner, remark, and timestamps. Use syncId with +get_sync_detail or +exec_sync_solution",
1110
+ flags: [
1111
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" }
1112
+ ],
1113
+ risk: "read",
1114
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName33, buildArgs31(ctx)),
1115
+ execute: async (ctx) => {
1116
+ return callDataopsApi(ctx, toolName33, buildArgs31(ctx));
1117
+ }
1118
+ };
1119
+
1120
+ // src/commands/te-dataops/integration/get-sync-detail.ts
1121
+ var toolName34 = "integration_get_sync_detail";
1122
+ function buildArgs32(ctx) {
1123
+ return {
1124
+ spaceCode: ctx.str("spaceCode"),
1125
+ syncId: ctx.str("syncId"),
1126
+ withParams: ctx.bool("withParams")
1127
+ };
1128
+ }
1129
+ var getSyncDetail = {
1130
+ service: "dataops_integration",
1131
+ command: "+get_sync_detail",
1132
+ description: "Get sync solution detail: source, sink, field mapping, last status, owner, and nextAction. Optional withParams=true also returns usedParams",
1133
+ flags: [
1134
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1135
+ { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1136
+ { name: "withParams", type: "boolean", required: false, desc: "Also return usedParams; defaults to false" }
1137
+ ],
1138
+ risk: "read",
1139
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName34, buildArgs32(ctx)),
1140
+ execute: async (ctx) => callDataopsApi(ctx, toolName34, buildArgs32(ctx))
1141
+ };
1142
+
1143
+ // src/commands/te-dataops/integration/list-sync-runs.ts
1144
+ var toolName35 = "integration_list_sync_runs";
1145
+ function buildArgs33(ctx) {
1146
+ return {
1147
+ spaceCode: ctx.str("spaceCode"),
1148
+ syncId: ctx.str("syncId"),
1149
+ limit: ctx.optionalNum("limit")
1150
+ };
1151
+ }
1152
+ var listSyncRuns = {
1153
+ service: "dataops_integration",
1154
+ command: "+list_sync_runs",
1155
+ description: "List manual sync runs of a sync solution, newest first. Returns runs, returnedCount, limit, and nextAction. Each run includes taskId, execType, status, execTime, channelMode, and submitter",
1156
+ flags: [
1157
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1158
+ { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1159
+ { name: "limit", type: "number", required: false, desc: "Number of results to return, defaults to 20 if not provided" }
1160
+ ],
1161
+ risk: "read",
1162
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName35, buildArgs33(ctx)),
1163
+ execute: async (ctx) => callDataopsApi(ctx, toolName35, buildArgs33(ctx))
1164
+ };
1165
+
1166
+ // src/commands/te-dataops/integration/exec-sync-solution.ts
1167
+ var toolName36 = "integration_exec_sync_solution";
1168
+ var execSyncSolution = {
1169
+ service: "dataops_integration",
1170
+ command: "+exec_sync_solution",
1171
+ description: "Submit one manual sync solution run. Optional baseDate maps to execution parameter bd. Returns syncId, taskId, execType, status, execTime, and nextAction. Use +list_sync_runs to check run status",
1172
+ flags: [
1173
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1174
+ { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1175
+ { name: "baseDate", type: "string", required: false, desc: "Optional data date for this manual run, mapped to execution parameter bd, for example 2026-06-20" },
1176
+ { name: "comment", type: "string", required: false, desc: "Optional execution remark" }
1177
+ ],
1178
+ risk: "write",
1179
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName36, {
1180
+ spaceCode: ctx.str("spaceCode"),
1181
+ syncId: ctx.str("syncId"),
1182
+ baseDate: ctx.str("baseDate"),
1183
+ comment: ctx.str("comment")
1184
+ }),
1185
+ execute: async (ctx) => {
1186
+ return callDataopsApi(ctx, toolName36, {
1187
+ spaceCode: ctx.str("spaceCode"),
1188
+ syncId: ctx.str("syncId"),
1189
+ baseDate: ctx.str("baseDate"),
1190
+ comment: ctx.str("comment")
1191
+ });
1192
+ }
1193
+ };
1194
+
1195
+ // src/commands/te-dataops/integration/add-sync-solution.ts
1196
+ var toolName37 = "integration_add_sync_solution";
1197
+ function buildArgs34(ctx) {
1198
+ return {
1199
+ spaceCode: ctx.str("spaceCode"),
1200
+ syncName: ctx.str("syncName"),
1201
+ srcComponent: ctx.str("srcComponent"),
1202
+ srcDatasourceId: ctx.str("srcDatasourceId"),
1203
+ sinkComponent: ctx.str("sinkComponent"),
1204
+ sinkDatasourceId: ctx.str("sinkDatasourceId"),
1205
+ sourceConfig: ctx.str("sourceConfig"),
1206
+ sinkConfig: ctx.str("sinkConfig"),
1207
+ channelConfig: ctx.str("channelConfig"),
1208
+ fieldsMapping: ctx.str("fieldsMapping"),
1209
+ remark: ctx.str("remark")
1210
+ };
1211
+ }
1212
+ var addSyncSolution = {
1213
+ service: "dataops_integration",
1214
+ command: "+add_sync_solution",
1215
+ description: "Create a sync solution. Required: spaceCode, syncName, srcComponent, srcDatasourceId, sinkComponent, sinkDatasourceId, sourceConfig, sinkConfig. Optional: channelConfig, fieldsMapping, remark. Use +list_sync_datasources to choose datasource IDs. Preset warehouse JSON must follow the templates; task-table sources require tableType.",
1216
+ flags: [
1217
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1218
+ { name: "syncName", type: "string", required: true, desc: "Sync solution name" },
1219
+ { name: "srcComponent", type: "string", required: true, desc: "Source component name from +list_sync_datasources, e.g. te_etl, MySQL, OSS" },
1220
+ { name: "srcDatasourceId", type: "string", required: true, desc: "Source datasource ID" },
1221
+ { name: "sinkComponent", type: "string", required: true, desc: "Sink component name from +list_sync_datasources, e.g. te_etl, ClickHouse, MySQL" },
1222
+ { name: "sinkDatasourceId", type: "string", required: true, desc: "Sink datasource ID" },
1223
+ { name: "sourceConfig", type: "string", required: true, desc: "Source configuration JSON string. Preset warehouse source requires tableType, bizClassify, dbBizType, authedSpace, partitionKeys, and successOnEmpty" },
1224
+ { name: "sinkConfig", type: "string", required: true, desc: "Sink configuration JSON string. Preset warehouse sink requires tableType, bizClassify, dbBizType, authedSpace, and partitionKeys" },
1225
+ { name: "channelConfig", type: "string", required: false, desc: "Channel configuration JSON string. Include gatewayConfig when source or sink uses the preset warehouse" },
1226
+ { name: "fieldsMapping", type: "string", required: false, desc: "Field mapping JSON string" },
1227
+ { name: "remark", type: "string", required: false, desc: "Remark" }
1228
+ ],
1229
+ risk: "write",
1230
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName37, buildArgs34(ctx)),
1231
+ execute: async (ctx) => {
1232
+ return callDataopsApi(ctx, toolName37, buildArgs34(ctx));
1233
+ }
1234
+ };
1235
+
1236
+ // src/commands/te-dataops/integration/save-sync-solution.ts
1237
+ var toolName38 = "integration_save_sync_solution";
1238
+ function buildArgs35(ctx) {
1239
+ return {
1240
+ spaceCode: ctx.str("spaceCode"),
1241
+ syncId: ctx.str("syncId"),
1242
+ syncName: ctx.str("syncName"),
1243
+ sourceConfig: ctx.str("sourceConfig"),
1244
+ sinkConfig: ctx.str("sinkConfig"),
1245
+ channelConfig: ctx.str("channelConfig"),
1246
+ fieldsMapping: ctx.str("fieldsMapping"),
1247
+ remark: ctx.str("remark")
1248
+ };
1249
+ }
1250
+ var saveSyncSolution = {
1251
+ service: "dataops_integration",
1252
+ command: "+save_sync_solution",
1253
+ description: "Update a sync solution. Requires complete sourceConfig and sinkConfig JSON; not a partial patch. Call +get_sync_detail --withParams true first",
1254
+ flags: [
1255
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1256
+ { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1257
+ { name: "syncName", type: "string", required: false, desc: "New sync solution name" },
1258
+ { name: "sourceConfig", type: "string", required: true, desc: "Complete source configuration JSON" },
1259
+ { name: "sinkConfig", type: "string", required: true, desc: "Complete sink configuration JSON" },
1260
+ { name: "channelConfig", type: "string", required: false, desc: "Complete channel configuration JSON; pass it to keep or update custom channel settings" },
1261
+ { name: "fieldsMapping", type: "string", required: false, desc: "Complete field mapping JSON; pass it to keep or update field mappings" },
1262
+ { name: "remark", type: "string", required: false, desc: "Updated remark" }
1263
+ ],
1264
+ risk: "write",
1265
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName38, buildArgs35(ctx)),
1266
+ execute: async (ctx) => callDataopsApi(ctx, toolName38, buildArgs35(ctx))
1267
+ };
1268
+
1269
+ // src/commands/te-dataops/integration/stop-sync-solution.ts
1270
+ var toolName39 = "integration_stop_sync_solution";
1271
+ function buildArgs36(ctx) {
1272
+ return {
1273
+ spaceCode: ctx.str("spaceCode"),
1274
+ syncId: ctx.str("syncId"),
1275
+ taskId: ctx.str("taskId")
1276
+ };
1277
+ }
1278
+ var stopSyncSolution = {
1279
+ service: "dataops_integration",
1280
+ command: "+stop_sync_solution",
1281
+ description: "Stop a running manual sync task. Requires spaceCode, syncId, and taskId. Use taskId from +list_sync_runs for an active run. Returns action, result, and status",
1282
+ flags: [
1283
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1284
+ { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1285
+ { name: "taskId", type: "string", required: true, desc: "Running execution task ID from +list_sync_runs" }
1286
+ ],
1287
+ risk: "write",
1288
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName39, buildArgs36(ctx)),
1289
+ execute: async (ctx) => callDataopsApi(ctx, toolName39, buildArgs36(ctx))
1290
+ };
1291
+
1292
+ // src/commands/te-dataops/integration/index.ts
1293
+ var commands3 = [
1294
+ listDatasourceComponents,
1295
+ getDatasourceComponentTemplate,
1296
+ listSpaceDatasources,
1297
+ getDatasourceDetail,
1298
+ testDatasourceConnect,
1299
+ listDatasourceTables,
1300
+ getTableStructure,
1301
+ listSyncDatasources,
1302
+ listDatasourceDatabases,
1303
+ onlineDatasource,
1304
+ addDatasource,
1305
+ modifyDatasource,
1306
+ listSyncSolutions,
1307
+ getSyncDetail,
1308
+ listSyncRuns,
1309
+ execSyncSolution,
1310
+ addSyncSolution,
1311
+ saveSyncSolution,
1312
+ stopSyncSolution
1313
+ ];
1314
+ var integration_default = commands3;
1315
+
1316
+ // src/commands/te-dataops/operations/get-flow-instance-detail.ts
1317
+ var toolName40 = "operations_get_flow_instance_detail";
1318
+ function buildArgs37(ctx) {
1319
+ return {
1320
+ spaceCode: ctx.str("spaceCode"),
1321
+ flowCode: ctx.num("flowCode"),
1322
+ flowInstanceId: ctx.num("flowInstanceId")
1323
+ };
1324
+ }
1325
+ var getFlowInstanceDetail = {
1326
+ service: "dataops_operations",
1327
+ command: "+get_flow_instance_detail",
1328
+ description: "Get one workflow instance detail from the operations perspective. Use after +search_flow_instances returns flowCode and flowInstanceId. Returns flowInstance, tasks, relations, taskInstances, and summary for troubleshooting.",
1329
+ flags: [
1330
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1331
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code from +search_flow_instances" },
1332
+ { name: "flowInstanceId", type: "number", required: true, desc: "Workflow instance ID from +search_flow_instances" }
1333
+ ],
1334
+ risk: "read",
1335
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName40, buildArgs37(ctx)),
1336
+ execute: async (ctx) => {
1337
+ return callDataopsApi(ctx, toolName40, buildArgs37(ctx));
1338
+ }
1339
+ };
1340
+
1341
+ // src/commands/te-dataops/operations/get-task-instance-detail.ts
1342
+ var toolName41 = "operations_get_task_instance_detail";
1343
+ function optionalBool2(ctx, name) {
1344
+ return ctx.str(name) === "" ? void 0 : ctx.bool(name);
1345
+ }
1346
+ function buildArgs38(ctx) {
1347
+ return {
1348
+ spaceCode: ctx.str("spaceCode"),
1349
+ flowCode: ctx.num("flowCode"),
1350
+ flowInstanceId: ctx.num("flowInstanceId"),
1351
+ taskCode: ctx.optionalNum("taskCode"),
1352
+ taskName: ctx.str("taskName"),
1353
+ includeLog: optionalBool2(ctx, "includeLog")
1354
+ };
1355
+ }
1356
+ var getTaskInstanceDetail = {
1357
+ service: "dataops_operations",
1358
+ command: "+get_task_instance_detail",
1359
+ description: "Get one task instance detail. Requires spaceCode, flowCode, flowInstanceId, and either taskCode or exact taskName. taskCode wins when both are passed. includeLog defaults to false. Returns task, taskInstance, definition, and optional log.",
1360
+ flags: [
1361
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1362
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code from +search_flow_instances" },
1363
+ { name: "flowInstanceId", type: "number", required: true, desc: "Workflow instance ID from +search_flow_instances" },
1364
+ { name: "taskCode", type: "number", required: false, desc: "Task code; preferred selector when known" },
1365
+ { name: "taskName", type: "string", required: false, desc: "Exact task name, case-insensitive; used only when taskCode is omitted" },
1366
+ { name: "includeLog", type: "boolean", required: false, desc: "Whether to include task logs. Default false" }
1367
+ ],
1368
+ risk: "read",
1369
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName41, buildArgs38(ctx)),
1370
+ execute: async (ctx) => {
1371
+ return callDataopsApi(ctx, toolName41, buildArgs38(ctx));
1372
+ }
1373
+ };
1374
+
1375
+ // src/commands/te-dataops/operations/search-flow-instances.ts
1376
+ var toolName42 = "operations_search_flow_instances";
1377
+ function buildArgs39(ctx) {
1378
+ return {
1379
+ spaceCode: ctx.str("spaceCode"),
1380
+ keyword: ctx.str("keyword"),
1381
+ startDate: ctx.str("startDate"),
1382
+ endDate: ctx.str("endDate"),
1383
+ status: ctx.str("status"),
1384
+ pageNum: ctx.optionalNum("pageNum"),
1385
+ pageSize: ctx.optionalNum("pageSize")
1386
+ };
1387
+ }
1388
+ var searchFlowInstances = {
1389
+ service: "dataops_operations",
1390
+ command: "+search_flow_instances",
1391
+ description: "Search workflow instances from the operations perspective. Requires spaceCode; keyword, startDate, endDate, status, pageNum, and pageSize are optional. Returns totalCount, returnedCount, pageNum, pageSize, hasMore, instances, statusCounts, triggerTypeCounts, and ownerCounts. Use flowInstanceId for operations inspection; do not confuse it with executeId.",
1392
+ flags: [
1393
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1394
+ { name: "keyword", type: "string", required: false, desc: "Optional keyword; fuzzy matches instance ID, workflow name, and workflow remark" },
1395
+ { name: "startDate", type: "string", required: false, desc: "Optional execution start date, yyyy-MM-dd" },
1396
+ { name: "endDate", type: "string", required: false, desc: "Optional execution end date, yyyy-MM-dd" },
1397
+ { name: "status", type: "string", required: false, desc: "Optional comma-separated statuses: WAITING,RUNNING,SUCCESS,FAIL,READY_PAUSE,PAUSE,STOP" },
1398
+ { name: "pageNum", type: "number", required: false, desc: "Optional page number; default 1" },
1399
+ { name: "pageSize", type: "number", required: false, desc: "Optional page size; default 20, max 100" }
1400
+ ],
1401
+ risk: "read",
1402
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName42, buildArgs39(ctx)),
1403
+ execute: async (ctx) => {
1404
+ return callDataopsApi(ctx, toolName42, buildArgs39(ctx));
1405
+ }
1406
+ };
1407
+
1408
+ // src/commands/te-dataops/operations/stop-flow-instance.ts
1409
+ var toolName43 = "operations_stop_flow_instance";
1410
+ function buildArgs40(ctx) {
1411
+ const executeId = ctx.optionalNum("executeId");
1412
+ const flowInstanceId = ctx.optionalNum("flowInstanceId");
1413
+ if (executeId == null && flowInstanceId == null || executeId != null && flowInstanceId != null) {
1414
+ throw new Error("Pass exactly one of --executeId or --flowInstanceId");
1415
+ }
1416
+ if (executeId != null && executeId <= 0 || flowInstanceId != null && flowInstanceId <= 0) {
1417
+ throw new Error("--executeId and --flowInstanceId must be positive numbers");
1418
+ }
1419
+ return {
1420
+ spaceCode: ctx.str("spaceCode"),
1421
+ flowCode: ctx.num("flowCode"),
1422
+ executeId,
1423
+ flowInstanceId
1424
+ };
1425
+ }
1426
+ var stopFlowInstance = {
1427
+ service: "dataops_operations",
1428
+ command: "+stop_flow_instance",
1429
+ description: "Stop a running workflow execution. Requires spaceCode, flowCode, and exactly one selector: executeId from dataops_flow +execute_flow or flowInstanceId from dataops_operations +search_flow_instances. Returns success, selector, and selector-specific stop result.",
1430
+ flags: [
1431
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1432
+ { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
1433
+ { name: "executeId", type: "number", required: false, desc: "Execution ID from dataops_flow +execute_flow; use before flowInstanceId is available" },
1434
+ { name: "flowInstanceId", type: "number", required: false, desc: "Workflow instance ID returned by dataops_operations +search_flow_instances" }
1435
+ ],
1436
+ risk: "write",
1437
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName43, buildArgs40(ctx)),
1438
+ execute: async (ctx) => {
1439
+ return callDataopsApi(ctx, toolName43, buildArgs40(ctx));
1440
+ }
1441
+ };
1442
+
1443
+ // src/commands/te-dataops/operations/index.ts
1444
+ var commands4 = [
1445
+ searchFlowInstances,
1446
+ getFlowInstanceDetail,
1447
+ getTaskInstanceDetail,
1448
+ stopFlowInstance
1449
+ ];
1450
+ var operations_default = commands4;
1451
+
1452
+ // src/commands/te-dataops/repo/list-spaces.ts
1453
+ var toolName44 = "repo_list_spaces";
1454
+ var listSpaces = {
1455
+ service: "dataops_repo",
1456
+ command: "+list_spaces",
1457
+ description: "List DataOps spaces accessible to the current user. Use this first when spaceCode is unknown. Returns createTime, spaceCode, and spaceDisplayName. No flags are required.",
1458
+ flags: [],
1459
+ risk: "read",
1460
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName44, {}),
1461
+ execute: async (ctx) => {
1462
+ return callDataopsApi(ctx, toolName44, {});
1463
+ }
1464
+ };
1465
+
1466
+ // src/commands/te-dataops/repo/index.ts
1467
+ var commands5 = [
1468
+ listSpaces
1469
+ ];
1470
+ var repo_default = commands5;
1471
+
1472
+ // src/commands/te-dataops/ide/cancel-sql-query.ts
1473
+ var toolName45 = "ide_cancel_sql_query";
1474
+ function optionalString2(ctx, name) {
1475
+ const value = ctx.str(name);
1476
+ return value === "" ? void 0 : value;
1477
+ }
1478
+ function buildArgs41(ctx) {
1479
+ return {
1480
+ spaceCode: ctx.str("spaceCode"),
1481
+ downloadTaskId: ctx.num("downloadTaskId"),
1482
+ requestId: optionalString2(ctx, "requestId")
1483
+ };
1484
+ }
1485
+ var cancelSqlQuery = {
1486
+ service: "dataops_ide",
1487
+ command: "+cancel_sql_query",
1488
+ description: "Cancel a Gaia download-center task created by +submit_sql_query. Requires spaceCode and downloadTaskId; requestId is optional trace-only. Returns cancellation status metadata.",
1489
+ flags: [
1490
+ { name: "spaceCode", type: "string", required: true, desc: "Space code returned by +submit_sql_query" },
1491
+ { name: "downloadTaskId", type: "number", required: true, desc: "Download task ID returned by +submit_sql_query or +get_sql_query_status" },
1492
+ { name: "requestId", type: "string", required: false, desc: "Optional request ID returned by +submit_sql_query, used only for trace display" }
1493
+ ],
1494
+ risk: "write",
1495
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName45, buildArgs41(ctx)),
1496
+ execute: async (ctx) => callDataopsApi(ctx, toolName45, buildArgs41(ctx))
1497
+ };
1498
+
1499
+ // src/commands/te-dataops/ide/get-sql-query-status.ts
1500
+ import { mkdir, writeFile } from "fs/promises";
1501
+ import path from "path";
1502
+ var toolName46 = "ide_get_sql_query_status";
1503
+ function optionalString3(ctx, name) {
1504
+ const value = ctx.str(name);
1505
+ return value === "" ? void 0 : value;
1506
+ }
1507
+ function buildArgs42(ctx) {
1508
+ return {
1509
+ spaceCode: ctx.str("spaceCode"),
1510
+ downloadTaskId: ctx.num("downloadTaskId"),
1511
+ requestId: optionalString3(ctx, "requestId")
1512
+ };
1513
+ }
1514
+ function isDownloadReady(data) {
1515
+ return data?.downloadStatus === "SUCCESS" || data?.downloadStatus === "async_ok";
1516
+ }
1517
+ async function downloadResult(ctx, data, targetPath) {
1518
+ const token = await ctx.token();
1519
+ const host = resolveHost(ctx.host()).replace(/\/+$/, "");
1520
+ const params = data?.downloadParams ?? {};
1521
+ const url = new URL(`${host}/v1/gaia/task/async/download`);
1522
+ url.searchParams.set("accessToken", token);
1523
+ url.searchParams.set("spaceCode", String(params.spaceCode));
1524
+ url.searchParams.set("taskId", String(params.taskId));
1525
+ const resp = await fetch(url);
1526
+ if (!resp.ok) {
1527
+ throw new Error(`Download failed: HTTP ${resp.status} ${resp.statusText}`);
1528
+ }
1529
+ const absPath = path.resolve(targetPath);
1530
+ await mkdir(path.dirname(absPath), { recursive: true });
1531
+ await writeFile(absPath, Buffer.from(await resp.arrayBuffer()));
1532
+ return absPath;
1533
+ }
1534
+ var getSqlQueryStatus = {
1535
+ service: "dataops_ide",
1536
+ command: "+get_sql_query_status",
1537
+ description: "Poll a Gaia download-center task created by +submit_sql_query. Requires spaceCode and downloadTaskId. requestId is trace-only. Returns status and download metadata; --downloadTo saves the result zip locally after SUCCESS and adds localFile.",
1538
+ flags: [
1539
+ { name: "spaceCode", type: "string", required: true, desc: "Space code returned by +submit_sql_query" },
1540
+ { name: "downloadTaskId", type: "number", required: true, desc: "Download task ID returned by +submit_sql_query" },
1541
+ { name: "requestId", type: "string", required: false, desc: "Optional request ID returned by +submit_sql_query, used only for trace display" },
1542
+ { name: "downloadTo", type: "string", required: false, desc: "Optional local file path. When downloadStatus=SUCCESS, save the result zip to this path; use a .zip suffix, for example ./result.zip." }
1543
+ ],
1544
+ risk: "read",
1545
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName46, buildArgs42(ctx)),
1546
+ execute: async (ctx) => {
1547
+ const data = await callDataopsApi(ctx, toolName46, buildArgs42(ctx));
1548
+ const downloadTo = optionalString3(ctx, "downloadTo");
1549
+ if (downloadTo && isDownloadReady(data)) {
1550
+ return { ...data, localFile: await downloadResult(ctx, data, downloadTo) };
1551
+ }
1552
+ return data;
1553
+ }
1554
+ };
1555
+
1556
+ // src/commands/te-dataops/ide/list-catalogs.ts
1557
+ var toolName47 = "ide_list_catalogs";
1558
+ function optionalString4(ctx, name) {
1559
+ const value = ctx.str(name);
1560
+ return value === "" ? void 0 : value;
1561
+ }
1562
+ function buildArgs43(ctx) {
1563
+ return {
1564
+ spaceCode: ctx.str("spaceCode"),
1565
+ connType: optionalString4(ctx, "connType"),
1566
+ repoCode: optionalString4(ctx, "repoCode")
1567
+ };
1568
+ }
1569
+ var listCatalogs = {
1570
+ service: "dataops_ide",
1571
+ command: "+ide_list_catalogs",
1572
+ description: "List accessible IDE catalogs and schemas. Requires spaceCode; connType and repoCode are optional and default to SPACE and te_etl. Returns catalog, catalogBelongEnum, schemaNum, and schemas.",
1573
+ flags: [
1574
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1575
+ { name: "connType", type: "string", required: false, desc: "Optional connection type: SPACE, ETL, or APP. Default SPACE" },
1576
+ { name: "repoCode", type: "string", required: false, desc: "Optional repository code. Default te_etl" }
1577
+ ],
1578
+ risk: "read",
1579
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName47, buildArgs43(ctx)),
1580
+ execute: async (ctx) => {
1581
+ return callDataopsApi(ctx, toolName47, buildArgs43(ctx));
1582
+ }
1583
+ };
1584
+
1585
+ // src/commands/te-dataops/ide/get-schema-info.ts
1586
+ var toolName48 = "ide_get_schema_info";
1587
+ function optionalString5(ctx, name) {
1588
+ const value = ctx.str(name);
1589
+ return value === "" ? void 0 : value;
1590
+ }
1591
+ function buildArgs44(ctx) {
1592
+ return {
1593
+ spaceCode: ctx.str("spaceCode"),
1594
+ connType: optionalString5(ctx, "connType"),
1595
+ repoCode: optionalString5(ctx, "repoCode"),
1596
+ catalog: ctx.str("catalog"),
1597
+ schema: ctx.str("schema")
1598
+ };
1599
+ }
1600
+ function schemaStats(data) {
1601
+ if (!data || typeof data !== "object" || Array.isArray(data)) {
1602
+ return data;
1603
+ }
1604
+ const value = data;
1605
+ return {
1606
+ schema: value.schema,
1607
+ tableNum: value.tableNum,
1608
+ viewNum: value.viewNum
1609
+ };
1610
+ }
1611
+ var getSchemaInfo = {
1612
+ service: "dataops_ide",
1613
+ command: "+get_schema_info",
1614
+ description: "Get schema-level statistics for one catalog/schema. Requires spaceCode, catalog, and schema. Optional connType/repoCode default to SPACE/te_etl. Returns only schema, tableNum, and viewNum.",
1615
+ flags: [
1616
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1617
+ { name: "connType", type: "string", required: false, desc: "Connection type. Defaults to SPACE. Use SPACE for daily query development, ETL for data processing, APP for external services." },
1618
+ { name: "repoCode", type: "string", required: false, desc: "Repository code. Defaults to te_etl. Use +ide_list_repos to discover other repositories." },
1619
+ { name: "catalog", type: "string", required: true, desc: "Catalog name" },
1620
+ { name: "schema", type: "string", required: true, desc: "Schema name" }
1621
+ ],
1622
+ risk: "read",
1623
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName48, buildArgs44(ctx)),
1624
+ execute: async (ctx) => {
1625
+ return schemaStats(await callDataopsApi(ctx, toolName48, buildArgs44(ctx)));
1626
+ }
1627
+ };
1628
+
1629
+ // src/commands/te-dataops/ide/get-table-detail.ts
1630
+ var toolName49 = "ide_get_table_detail";
1631
+ function optionalString6(ctx, name) {
1632
+ const value = ctx.str(name);
1633
+ return value === "" ? void 0 : value;
1634
+ }
1635
+ function optionalBool3(ctx, name) {
1636
+ const value = ctx.json(name);
1637
+ return value === void 0 ? void 0 : Boolean(value);
1638
+ }
1639
+ function optionalEntityType(ctx) {
1640
+ const value = optionalString6(ctx, "entityType");
1641
+ return value === void 0 ? void 0 : value.toUpperCase();
1642
+ }
1643
+ function buildArgs45(ctx) {
1644
+ return {
1645
+ spaceCode: ctx.str("spaceCode"),
1646
+ connType: optionalString6(ctx, "connType"),
1647
+ repoCode: optionalString6(ctx, "repoCode"),
1648
+ catalog: ctx.str("catalog"),
1649
+ schema: ctx.str("schema"),
1650
+ tableName: ctx.str("tableName"),
1651
+ engineType: optionalString6(ctx, "engineType"),
1652
+ entityType: optionalEntityType(ctx),
1653
+ includeDdl: optionalBool3(ctx, "includeDdl")
1654
+ };
1655
+ }
1656
+ var getTableDetail2 = {
1657
+ service: "dataops_ide",
1658
+ command: "+ide_get_table_detail",
1659
+ description: "Get engine-side table/view detail. Requires spaceCode, catalog, schema, and tableName. Optional connType/repoCode/engineType default to SPACE/te_etl/TASK_ENGINE_TRINO; entityType auto-detects; includeDdl defaults false. Returns identity, storage metadata, columns, partitions, partitionKeys, optional layout fields, and tableDdl only when includeDdl=true.",
1660
+ flags: [
1661
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1662
+ { name: "connType", type: "string", required: false, desc: "Optional connection type: SPACE, ETL, or APP. Default SPACE" },
1663
+ { name: "repoCode", type: "string", required: false, desc: "Optional repository code. Default te_etl" },
1664
+ { name: "catalog", type: "string", required: true, desc: "Catalog name" },
1665
+ { name: "schema", type: "string", required: true, desc: "Schema name" },
1666
+ { name: "tableName", type: "string", required: true, desc: "Table or view name" },
1667
+ { name: "engineType", type: "string", required: false, desc: "Optional engine type. Default TASK_ENGINE_TRINO" },
1668
+ { name: "entityType", type: "string", required: false, desc: "Optional type hint: TABLE or VIEW. Omit to auto-detect" },
1669
+ { name: "includeDdl", type: "boolean", required: false, desc: "Optional include tableDdl. Default false" }
1670
+ ],
1671
+ risk: "read",
1672
+ validate: (ctx) => {
1673
+ const entityType = optionalEntityType(ctx);
1674
+ if (entityType !== void 0 && entityType !== "TABLE" && entityType !== "VIEW") {
1675
+ throw new Error("entityType must be TABLE or VIEW");
1676
+ }
1677
+ },
1678
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName49, buildArgs45(ctx)),
1679
+ execute: async (ctx) => {
1680
+ return callDataopsApi(ctx, toolName49, buildArgs45(ctx));
1681
+ }
1682
+ };
1683
+
1684
+ // src/commands/te-dataops/ide/search-tables.ts
1685
+ var toolName50 = "ide_search_tables";
1686
+ function optionalString7(ctx, name) {
1687
+ const value = ctx.str(name);
1688
+ return value === "" ? void 0 : value;
1689
+ }
1690
+ function buildArgs46(ctx) {
1691
+ return {
1692
+ spaceCode: ctx.str("spaceCode"),
1693
+ connType: optionalString7(ctx, "connType"),
1694
+ repoCode: optionalString7(ctx, "repoCode"),
1695
+ searchKey: ctx.str("searchKey"),
1696
+ size: ctx.optionalNum("size")
1697
+ };
1698
+ }
1699
+ var searchTables = {
1700
+ service: "dataops_ide",
1701
+ command: "+search_tables",
1702
+ description: "Search engine-side warehouse tables/views by keyword. Requires spaceCode and searchKey. Optional connType/repoCode/size default to SPACE/te_etl/20. Returns items, searchKey, size, total/table/view/returned counts, hasMore, and nextAction. Unlike +dict_search_tables, this returns raw engine metadata without DataOps lifecycle/status/owner enrichment.",
1703
+ flags: [
1704
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1705
+ { name: "connType", type: "string", required: false, desc: "Optional connection type: SPACE, ETL, or APP. Default SPACE" },
1706
+ { name: "repoCode", type: "string", required: false, desc: "Optional repository code. Default te_etl" },
1707
+ { name: "searchKey", type: "string", required: true, desc: "Precise table or view keyword to search in engine-side metadata" },
1708
+ { name: "size", type: "number", required: false, desc: "Optional maximum results. Default 20" }
1709
+ ],
1710
+ risk: "read",
1711
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName50, buildArgs46(ctx)),
1712
+ execute: async (ctx) => {
1713
+ return callDataopsApi(ctx, toolName50, buildArgs46(ctx));
1714
+ }
1715
+ };
1716
+
1717
+ // src/commands/te-dataops/ide/list-repos.ts
1718
+ var toolName51 = "ide_list_repos";
1719
+ function buildArgs47(ctx) {
1720
+ return {
1721
+ spaceCode: ctx.str("spaceCode")
1722
+ };
1723
+ }
1724
+ var listRepos = {
1725
+ service: "dataops_ide",
1726
+ command: "+ide_list_repos",
1727
+ description: "List available IDE warehouse repositories for one space. Requires spaceCode. Returns an array grouped by connType: [{ connType, repos: [{ repoCode, repoDesc, engineTypes }] }].",
1728
+ flags: [
1729
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" }
1730
+ ],
1731
+ risk: "read",
1732
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName51, buildArgs47(ctx)),
1733
+ execute: async (ctx) => {
1734
+ return callDataopsApi(ctx, toolName51, buildArgs47(ctx));
1735
+ }
1736
+ };
1737
+
1738
+ // src/commands/te-dataops/ide/list-tables.ts
1739
+ var toolName52 = "ide_list_tables";
1740
+ function optionalString8(ctx, name) {
1741
+ const value = ctx.str(name);
1742
+ return value === "" ? void 0 : value;
1743
+ }
1744
+ function optionalEntityType2(ctx) {
1745
+ const value = optionalString8(ctx, "entityType");
1746
+ return value === void 0 ? void 0 : value.toUpperCase();
1747
+ }
1748
+ function buildArgs48(ctx) {
1749
+ return {
1750
+ spaceCode: ctx.str("spaceCode"),
1751
+ connType: optionalString8(ctx, "connType"),
1752
+ repoCode: optionalString8(ctx, "repoCode"),
1753
+ catalog: ctx.str("catalog"),
1754
+ schema: ctx.str("schema"),
1755
+ entityType: optionalEntityType2(ctx),
1756
+ pageNum: ctx.optionalNum("pageNum"),
1757
+ pageSize: ctx.optionalNum("pageSize")
1758
+ };
1759
+ }
1760
+ var listTables = {
1761
+ service: "dataops_ide",
1762
+ command: "+ide_list_tables",
1763
+ description: "List tables or views in one catalog/schema. Requires spaceCode, catalog, and schema. Optional connType/repoCode default to SPACE/te_etl; entityType defaults to TABLE; pageNum/pageSize default to 1/20. Returns items, page fields, hasMoreMaybe, and nextAction. No keyword filter; use +search_tables for search.",
1764
+ flags: [
1765
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1766
+ { name: "connType", type: "string", required: false, desc: "Optional connection type: SPACE, ETL, or APP. Default SPACE" },
1767
+ { name: "repoCode", type: "string", required: false, desc: "Optional repository code. Default te_etl" },
1768
+ { name: "catalog", type: "string", required: true, desc: "Catalog name" },
1769
+ { name: "schema", type: "string", required: true, desc: "Schema name" },
1770
+ { name: "entityType", type: "string", required: false, desc: "Optional entity type: TABLE or VIEW. Default TABLE" },
1771
+ { name: "pageNum", type: "number", required: false, desc: "Optional page number. Default 1" },
1772
+ { name: "pageSize", type: "number", required: false, desc: "Optional page size. Default 20" }
1773
+ ],
1774
+ risk: "read",
1775
+ validate: (ctx) => {
1776
+ const entityType = optionalEntityType2(ctx);
1777
+ if (entityType !== void 0 && entityType !== "TABLE" && entityType !== "VIEW") {
1778
+ throw new Error("entityType must be TABLE or VIEW");
1779
+ }
1780
+ },
1781
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName52, buildArgs48(ctx)),
1782
+ execute: async (ctx) => {
1783
+ return callDataopsApi(ctx, toolName52, buildArgs48(ctx));
1784
+ }
1785
+ };
1786
+
1787
+ // src/commands/te-dataops/ide/submit-sql-query.ts
1788
+ var toolName53 = "ide_submit_sql_query";
1789
+ function optionalString9(ctx, name) {
1790
+ const value = ctx.str(name);
1791
+ return value === "" ? void 0 : value;
1792
+ }
1793
+ function buildArgs49(ctx) {
1794
+ return {
1795
+ spaceCode: ctx.str("spaceCode"),
1796
+ repoCode: optionalString9(ctx, "repoCode"),
1797
+ sql: ctx.str("sql"),
1798
+ engineType: optionalString9(ctx, "engineType")
1799
+ };
1800
+ }
1801
+ var submitSqlQuery = {
1802
+ service: "dataops_ide",
1803
+ command: "+submit_sql_query",
1804
+ description: "Submit an IDE SQL query and create a Gaia download-center task. Requires spaceCode and sql. Optional repoCode/engineType default to te_etl/TASK_ENGINE_TRINO. Returns download task metadata; result rows are never returned by MCP/CLI.",
1805
+ flags: [
1806
+ { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1807
+ { name: "sql", type: "string", required: true, desc: "SQL statement to execute" },
1808
+ { name: "repoCode", type: "string", required: false, desc: "Repository code. Defaults to te_etl." },
1809
+ { name: "engineType", type: "string", required: false, desc: "SQL execution engine. Defaults to TASK_ENGINE_TRINO. Optional: TASK_ENGINE_STARROCKS." }
1810
+ ],
1811
+ risk: "read",
1812
+ dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName53, buildArgs49(ctx)),
1813
+ execute: async (ctx) => callDataopsApi(ctx, toolName53, buildArgs49(ctx))
1814
+ };
1815
+
1816
+ // src/commands/te-dataops/ide/index.ts
1817
+ var commands6 = [
1818
+ cancelSqlQuery,
1819
+ getSqlQueryStatus,
1820
+ submitSqlQuery,
1821
+ listCatalogs,
1822
+ getSchemaInfo,
1823
+ getTableDetail2,
1824
+ searchTables,
1825
+ listRepos,
1826
+ listTables
1827
+ ];
1828
+ var ide_default = commands6;
1829
+
1830
+ // src/commands/te-dataops/index.ts
1831
+ var commands7 = [
1832
+ ...datatable_default,
1833
+ ...flow_default,
1834
+ ...integration_default,
1835
+ ...operations_default,
1836
+ ...repo_default,
1837
+ ...ide_default
1838
+ ];
1839
+ var te_dataops_default = commands7;
1840
+ export {
1841
+ te_dataops_default as default
1842
+ };