@thinkingai/ae-cli 6.1.18 → 6.1.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 (127) hide show
  1. package/README.md +97 -38
  2. package/README.zh.md +101 -38
  3. package/dist/{auth-ROB2EDYV.js → auth-FUM37MHF.js} +241 -126
  4. package/dist/{capability-DKMYUTLC.js → capability-AXFQW5WM.js} +49 -35
  5. package/dist/{chunk-JHENBQ5B.js → chunk-4P355ZWB.js} +70 -1
  6. package/dist/chunk-6ZIQV5GW.js +26 -0
  7. package/dist/{chunk-TUKQZTMI.js → chunk-7K24F7T2.js} +2 -0
  8. package/dist/{chunk-OO6XR6LK.js → chunk-AMBFK2K3.js} +2 -0
  9. package/dist/chunk-ATSM5XAW.js +623 -0
  10. package/dist/{chunk-4XXOWOTA.js → chunk-BBEFP4SB.js} +31 -38
  11. package/dist/{chunk-BYYS3ANB.js → chunk-CZU3V3DQ.js} +5 -15
  12. package/dist/{chunk-VTWMIC5L.js → chunk-E2JKXMVO.js} +2 -0
  13. package/dist/chunk-ECBLHAZO.js +15 -0
  14. package/dist/{sync-HKIOZXQE.js → chunk-I4WQAEYB.js} +31 -540
  15. package/dist/{chunk-DWO43OIB.js → chunk-JQ3ENZZH.js} +2 -0
  16. package/dist/chunk-LNZBEQXW.js +25216 -0
  17. package/dist/{chunk-ZQ47LWTI.js → chunk-QJQZH5GQ.js} +49 -79
  18. package/dist/{chunk-QZ3AS4KK.js → chunk-RSG4ONOI.js} +9 -8
  19. package/dist/{chunk-4NN5IWVN.js → chunk-T6OSFQZD.js} +2 -0
  20. package/dist/{chunk-Y3LOALAV.js → chunk-TAL6CZH6.js} +8 -7
  21. package/dist/{chunk-3KWQYGYI.js → chunk-TKHSULJT.js} +2 -0
  22. package/dist/chunk-VXNMYUXU.js +202 -0
  23. package/dist/{chunk-3FY3RJ26.js → chunk-WZ6YVQSF.js} +15 -14
  24. package/dist/{chunk-6EIJSNBD.js → chunk-Y74WTIKJ.js} +2 -0
  25. package/dist/{community-report-client-C7WDGET3.js → community-report-client-XXWGSBSD.js} +3 -4
  26. package/dist/{config-BMYZX2UE.js → config-EXUGQN5T.js} +10 -10
  27. package/dist/{data-integration-QEKDWQDY.js → data-integration-4NZ53OMT.js} +920 -97
  28. package/dist/index.js +56 -81
  29. package/dist/{local-data-upload-client-4YYHSYD6.js → local-data-upload-client-KYOKVYZV.js} +3 -4
  30. package/dist/{memory-I2WXDTV2.js → memory-ATNKZNW5.js} +6 -7
  31. package/dist/{metadata-I4C2EWUN.js → metadata-VZVC7YMH.js} +10 -11
  32. package/dist/{model-HLHIEFMU.js → model-E4JMQ4V2.js} +8 -9
  33. package/dist/{personal-semantic-preference-LIPACBDX.js → personal-semantic-preference-7S2SQ3UV.js} +9 -10
  34. package/dist/{project-semantic-RT3R2VQD.js → project-semantic-2SZP2OPO.js} +13 -14
  35. package/dist/sync-YV3E66IF.js +520 -0
  36. package/dist/{te-agent-BR6VDBNX.js → te-agent-JB5T3PO7.js} +396 -92
  37. package/dist/{te-analysis-7VUNUYWZ.js → te-analysis-3YJAAT2D.js} +196 -43
  38. package/dist/{te-community-5DMNKJWY.js → te-community-UDBI672N.js} +12 -34
  39. package/dist/{te-dataops-6P5IKWNJ.js → te-dataops-ZLYOCXZ4.js} +480 -81
  40. package/dist/{te-engage-KZPR5R22.js → te-engage-4XG6OJML.js} +88 -16
  41. package/dist/{te-experiment-6BITX4RD.js → te-experiment-VXUWPINJ.js} +83 -12
  42. package/dist/te-kb-WYQWHFSC.js +1732 -0
  43. package/dist/{te-system-FXITO2JG.js → te-system-7G6F2LJA.js} +569 -35
  44. package/dist/{te-team-ADOC2ROP.js → te-team-E7FBBXMQ.js} +8 -7
  45. package/dist/{update-YCYCKJOO.js → update-D47BUG25.js} +8 -8
  46. package/package.json +22 -10
  47. package/skills/ae-agent/SKILL.md +30 -13
  48. package/skills/ae-agent/references/agent-distribution.md +94 -0
  49. package/skills/ae-agent/references/approval-request.md +4 -0
  50. package/skills/ae-agent/references/command_index.md +9 -2
  51. package/skills/ae-agent/references/create-automation.md +20 -2
  52. package/skills/ae-agent/references/get-agent-context.md +70 -0
  53. package/skills/ae-agent/references/list-automations.md +18 -3
  54. package/skills/ae-agent/references/list-mcp-credentials.md +1 -1
  55. package/skills/ae-agent/references/mcp-token.md +3 -3
  56. package/skills/ae-agent/references/set-mcp-credential.md +0 -1
  57. package/skills/ae-agent/references/update-automation.md +18 -0
  58. package/skills/ae-analysis/SKILL.md +11 -2
  59. package/skills/ae-analysis/references/adhoc_run.md +2 -0
  60. package/skills/ae-analysis/references/ai_models.md +23 -3
  61. package/skills/ae-analysis/references/analysis_gateway_assets.md +3 -3
  62. package/skills/ae-analysis/references/audience_models.md +18 -0
  63. package/skills/ae-analysis/references/command_index.md +9 -9
  64. package/skills/ae-analysis/references/cross_source_config.md +84 -0
  65. package/skills/ae-analysis/references/dashboard_update.md +1 -1
  66. package/skills/ae-analysis/references/project_timezone_update.md +13 -4
  67. package/skills/ae-analysis/references/property_create.md +2 -0
  68. package/skills/ae-analysis/references/super_metadata_batch_create.md +2 -0
  69. package/skills/ae-analysis/references/user_cluster_models.md +2 -0
  70. package/skills/ae-analysis/references/user_cluster_update.md +8 -4
  71. package/skills/ae-analysis/references/user_tag_create.md +30 -2
  72. package/skills/ae-analysis/references/user_tag_models.md +17 -3
  73. package/skills/ae-analysis/references/user_tag_update.md +14 -2
  74. package/skills/ae-data-integration/SKILL.md +3 -1
  75. package/skills/ae-data-integration/references/dimension-routing.md +36 -0
  76. package/skills/ae-data-integration/references/error-handling.md +54 -1
  77. package/skills/ae-data-integration/references/local-analysis.md +2 -0
  78. package/skills/ae-data-integration/references/source-inspect.md +18 -2
  79. package/skills/ae-data-integration/references/tracking-plan.md +1 -1
  80. package/skills/ae-data-integration/references/transform.md +4 -2
  81. package/skills/ae-data-integration/references/ue-mapping.md +5 -2
  82. package/skills/ae-data-integration/references/ue-routing.md +40 -1
  83. package/skills/ae-dataops/SKILL.md +11 -1
  84. package/skills/ae-dataops/references/dataops-backfill.md +135 -0
  85. package/skills/ae-engage/SKILL.md +5 -0
  86. package/skills/ae-engage/references/build-task-save-guide.md +5 -1
  87. package/skills/ae-engage/references/save-flow.md +37 -1
  88. package/skills/ae-engage/references/save-task.md +6 -0
  89. package/skills/ae-experiment/SKILL.md +6 -2
  90. package/skills/ae-experiment/references/save_metric.md +20 -8
  91. package/skills/ae-generate-tracking-plan/SKILL.md +25 -13
  92. package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +1 -1
  93. package/skills/ae-kb/SKILL.md +218 -36
  94. package/skills/ae-kb/references/query-workflow.md +59 -29
  95. package/skills/ae-kb/references/versions.md +46 -0
  96. package/skills/ae-system/SKILL.md +29 -31
  97. package/skills/ae-system/references/channel-management.md +303 -0
  98. package/skills/ae-use-agent/SKILL.md +42 -0
  99. package/skills/ae-use-agent/references/local-agent.md +114 -0
  100. package/dist/auth-GBMV6TEJ.js +0 -14
  101. package/dist/capability-HYVVPG25.js +0 -352
  102. package/dist/chunk-EFH4XWYC.js +0 -556
  103. package/dist/chunk-J2DEBMRF.js +0 -313
  104. package/dist/chunk-JRJY5DMJ.js +0 -71
  105. package/dist/chunk-OMPRXM3V.js +0 -349
  106. package/dist/chunk-QNOLN2LJ.js +0 -509
  107. package/dist/chunk-RJDU7NYP.js +0 -1198
  108. package/dist/chunk-RNAALWJK.js +0 -98
  109. package/dist/chunk-SERWF6G5.js +0 -13
  110. package/dist/chunk-UW5UN47B.js +0 -70
  111. package/dist/chunk-ZQKDZXDO.js +0 -317
  112. package/dist/client-L2YDMHQ6.js +0 -203
  113. package/dist/memory-3ORCR7JH.js +0 -893
  114. package/dist/metadata-VUOQJE26.js +0 -339
  115. package/dist/model-UGRDX4MW.js +0 -139
  116. package/dist/personal-semantic-preference-OEISBRHM.js +0 -239
  117. package/dist/project-semantic-FFPWFPIW.js +0 -1114
  118. package/dist/sync-TFHU2UTG.js +0 -10261
  119. package/dist/te-agent-VLYOV7S4.js +0 -3894
  120. package/dist/te-analysis-4YGQL5RC.js +0 -9357
  121. package/dist/te-community-ISDQWJU7.js +0 -1859
  122. package/dist/te-dataops-CVULXNVB.js +0 -2209
  123. package/dist/te-engage-N5WI32H6.js +0 -4898
  124. package/dist/te-experiment-UVR4HLND.js +0 -988
  125. package/dist/te-kb-RCLSSH2Q.js +0 -935
  126. package/dist/te-system-K2GYMCTB.js +0 -2213
  127. package/skills/ae-agent/references/auto-provision-mcp-credentials.md +0 -57
@@ -1,2209 +0,0 @@
1
- import {
2
- printError
3
- } from "./chunk-BYYS3ANB.js";
4
- import {
5
- internalCallSourceHeaders
6
- } from "./chunk-6EIJSNBD.js";
7
- import {
8
- clearCliToken,
9
- getCliToken
10
- } from "./chunk-J2DEBMRF.js";
11
- import {
12
- resolveHost
13
- } from "./chunk-ZQKDZXDO.js";
14
- import {
15
- safeJsonParse
16
- } from "./chunk-3FY3RJ26.js";
17
- import {
18
- CliValidationError,
19
- PermissionError
20
- } from "./chunk-UW5UN47B.js";
21
- import {
22
- logger
23
- } from "./chunk-JHENBQ5B.js";
24
-
25
- // src/commands/te-dataops/shared.ts
26
- import { randomBytes } from "crypto";
27
- import { createWriteStream } from "fs";
28
- import { mkdir, rename, unlink } from "fs/promises";
29
- import { basename, dirname, join, resolve } from "path";
30
- import { Readable } from "stream";
31
- import { pipeline } from "stream/promises";
32
- var TOOL_API_MAP = {
33
- repo_list_spaces: { method: "GET", path: "/api/cli/dataops/v1/gaia/repo/spaces" },
34
- datatable_get_table_detail: { method: "GET", path: "/api/cli/dataops/v1/gaia/datatable/table-detail" },
35
- datatable_dict_search_tables: { method: "GET", path: "/api/cli/dataops/v1/gaia/datatable/dict-tables" },
36
- datatable_create_table: { method: "POST", path: "/api/cli/dataops/v1/gaia/datatable/tables" },
37
- datatable_create_view: { method: "POST", path: "/api/cli/dataops/v1/gaia/datatable/views" },
38
- datatable_publish_entity: { method: "POST", path: "/api/cli/dataops/v1/gaia/datatable/publish" },
39
- flow_list_flows: { method: "GET", path: "/api/cli/dataops/v1/gaia/workflow/flows" },
40
- flow_get_flow_overview: { method: "GET", path: "/api/cli/dataops/v1/gaia/workflow/flow-overview" },
41
- flow_list_high_frequency_release_flows: { method: "GET", path: "/api/cli/dataops/v1/gaia/workflow/flow-release/high-frequency" },
42
- flow_create_flow: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/flows" },
43
- flow_update_flow: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/flow-basic" },
44
- flow_save_schedule_config: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/schedule-config" },
45
- flow_execute_flow: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/flow-execution" },
46
- flow_preview_release_flow: { method: "GET", path: "/api/cli/dataops/v1/gaia/workflow/flow-release/preview" },
47
- flow_release_flow: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/flow-release" },
48
- flow_create_sql_task: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/tasks" },
49
- flow_update_sql_task: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/sql-task-definition" },
50
- flow_create_integration_task: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/integration-tasks" },
51
- flow_update_integration_task: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/integration-task-definition" },
52
- flow_create_workflow_instance_check_task: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/workflow-instance-check-tasks" },
53
- flow_update_workflow_instance_check_task: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/workflow-instance-check-task-definition" },
54
- flow_create_task_instance_check_task: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/task-instance-check-tasks" },
55
- flow_update_task_instance_check_task: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/task-instance-check-task-definition" },
56
- flow_delete_task: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/task-deletion" },
57
- flow_add_task_relation: { method: "POST", path: "/api/cli/dataops/v1/gaia/workflow/task-relation" },
58
- flow_get_task_params: { method: "GET", path: "/api/cli/dataops/v1/gaia/workflow/task-params" },
59
- operations_search_flow_instances: { method: "POST", path: "/api/cli/dataops/v1/gaia/operations/flow-instances/search" },
60
- operations_get_flow_instance_detail: { method: "GET", path: "/api/cli/dataops/v1/gaia/operations/flow-instances/detail" },
61
- operations_get_task_instance_detail: { method: "GET", path: "/api/cli/dataops/v1/gaia/operations/task-instances/detail" },
62
- operations_stop_flow_instance: { method: "POST", path: "/api/cli/dataops/v1/gaia/operations/flow-instances/stop" },
63
- integration_list_datasource_components: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/datasource-components" },
64
- integration_get_datasource_component_template: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/datasource-component-template" },
65
- integration_list_space_datasources: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/datasources" },
66
- integration_get_datasource_detail: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/datasource-detail" },
67
- integration_test_datasource_connect: { method: "POST", path: "/api/cli/dataops/v1/gaia/integration/datasource-connect-test" },
68
- integration_list_datasource_databases: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/datasource-databases" },
69
- integration_list_datasource_tables: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/datasource-tables" },
70
- integration_get_table_structure: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/table-structure" },
71
- integration_list_sync_datasources: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/sync-datasources" },
72
- integration_add_datasource: { method: "POST", path: "/api/cli/dataops/v1/gaia/integration/datasources" },
73
- integration_modify_datasource: { method: "POST", path: "/api/cli/dataops/v1/gaia/integration/datasource-modification" },
74
- integration_online_datasource: { method: "POST", path: "/api/cli/dataops/v1/gaia/integration/datasource-online" },
75
- integration_list_sync_solutions: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/sync-solutions" },
76
- integration_get_sync_detail: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/sync-detail" },
77
- integration_list_sync_runs: { method: "GET", path: "/api/cli/dataops/v1/gaia/integration/sync-runs" },
78
- integration_add_sync_solution: { method: "POST", path: "/api/cli/dataops/v1/gaia/integration/sync-solutions" },
79
- integration_save_sync_solution: { method: "POST", path: "/api/cli/dataops/v1/gaia/integration/sync-solution-save" },
80
- integration_exec_sync_solution: { method: "POST", path: "/api/cli/dataops/v1/gaia/integration/sync-execution" },
81
- integration_stop_sync_solution: { method: "POST", path: "/api/cli/dataops/v1/gaia/integration/sync-stop" },
82
- ide_list_repos: { method: "GET", path: "/api/cli/dataops/v1/gaia/ide/repos" },
83
- ide_list_catalogs: { method: "GET", path: "/api/cli/dataops/v1/gaia/ide/catalogs" },
84
- ide_list_tables: { method: "GET", path: "/api/cli/dataops/v1/gaia/ide/tables" },
85
- ide_search_tables: { method: "GET", path: "/api/cli/dataops/v1/gaia/ide/table-search" },
86
- ide_get_table_detail: { method: "GET", path: "/api/cli/dataops/v1/gaia/ide/table-detail" },
87
- ide_get_schema_info: { method: "GET", path: "/api/cli/dataops/v1/gaia/ide/schema-info" },
88
- ide_submit_sql_query: { method: "POST", path: "/api/cli/dataops/v1/gaia/ide/sql-query-submit" },
89
- ide_get_sql_query_status: { method: "GET", path: "/api/cli/dataops/v1/gaia/ide/sql-query-status" },
90
- ide_cancel_sql_query: { method: "POST", path: "/api/cli/dataops/v1/gaia/ide/sql-query-cancel" }
91
- };
92
- async function callDataopsApi(ctx, toolName59, args = {}) {
93
- const spec = TOOL_API_MAP[toolName59];
94
- if (!spec) {
95
- throw new Error(`DataOps API mapping not found for tool: ${toolName59}`);
96
- }
97
- const params = compactArgs(args);
98
- if (spec.method === "GET") {
99
- return dataopsRequest(ctx, spec.method, spec.path, params);
100
- }
101
- return dataopsRequest(ctx, spec.method, spec.path, {}, params);
102
- }
103
- function buildDataopsApiDryRun(ctx, toolName59, args = {}) {
104
- const spec = TOOL_API_MAP[toolName59];
105
- if (!spec) {
106
- throw new Error(`DataOps API mapping not found for tool: ${toolName59}`);
107
- }
108
- const params = compactArgs(args);
109
- if (spec.method === "GET") {
110
- return {
111
- method: spec.method,
112
- url: buildUrl(resolveHost(ctx.host()), spec.path, params),
113
- params
114
- };
115
- }
116
- return {
117
- method: spec.method,
118
- url: buildUrl(resolveHost(ctx.host()), spec.path),
119
- body: params
120
- };
121
- }
122
- async function downloadDataopsApi(ctx, path, params, targetPath, retry = true) {
123
- const host = resolveHost(ctx.host());
124
- const token = await getCliToken(host);
125
- const url = buildUrl(host, path, compactArgs(params));
126
- const resp = await fetch(url, {
127
- method: "GET",
128
- headers: {
129
- "cli-token": token,
130
- "Accept": "*/*",
131
- ...internalCallSourceHeaders()
132
- }
133
- });
134
- if (resp.status === 403) {
135
- const data = parseResponseBody(await resp.text(), url, resp.status, true);
136
- throw new PermissionError(permissionMessage(data));
137
- }
138
- if (resp.status === 401 && retry) {
139
- clearCliToken(host);
140
- return downloadDataopsApi(ctx, path, params, targetPath, false);
141
- }
142
- if (!resp.ok) {
143
- const data = parseResponseBody(await resp.text(), url, resp.status, true);
144
- throw new Error(formatHttpError(resp.status, resp.statusText, data));
145
- }
146
- if (!resp.body) {
147
- throw new Error("DataOps download response has no body.");
148
- }
149
- const outputPath = resolve(targetPath);
150
- await mkdir(dirname(outputPath), { recursive: true });
151
- const tempPath = join(
152
- dirname(outputPath),
153
- `.${basename(outputPath)}.part-${process.pid}-${randomBytes(6).toString("hex")}`
154
- );
155
- let tempPresent = false;
156
- try {
157
- tempPresent = true;
158
- await pipeline(
159
- Readable.fromWeb(resp.body),
160
- createWriteStream(tempPath, { flags: "wx" })
161
- );
162
- await rename(tempPath, outputPath);
163
- tempPresent = false;
164
- return outputPath;
165
- } finally {
166
- if (tempPresent) await unlink(tempPath).catch(() => void 0);
167
- }
168
- }
169
- async function dataopsRequest(ctx, method, path, params = {}, body, retry = true) {
170
- const host = resolveHost(ctx.host());
171
- const token = await getCliToken(host);
172
- const url = buildUrl(host, path, params);
173
- const headers = {
174
- "cli-token": token,
175
- "Accept": "application/json",
176
- "Content-Type": "application/json",
177
- ...internalCallSourceHeaders()
178
- };
179
- const options = { method, headers };
180
- if (method !== "GET") {
181
- options.body = JSON.stringify(body ?? {});
182
- }
183
- const resp = await fetch(url, options);
184
- const text = await resp.text();
185
- const data = parseResponseBody(text, url, resp.status, !resp.ok);
186
- logger.api(method, url, resp.status, body, data);
187
- if (resp.status === 403) {
188
- throw new PermissionError(permissionMessage(data));
189
- }
190
- if (resp.status === 401 && retry) {
191
- logger.warn(`DataOps request failed (HTTP 401) for ${host}, refreshing CLI token`);
192
- clearCliToken(host);
193
- return dataopsRequest(ctx, method, path, params, body, false);
194
- }
195
- if (!resp.ok) {
196
- throw new Error(formatHttpError(resp.status, resp.statusText, data));
197
- }
198
- return unwrapDataResponse(data);
199
- }
200
- function buildUrl(host, path, params = {}) {
201
- const base = host.replace(/\/+$/, "");
202
- const normalizedPath = path.startsWith("/") ? path : `/${path}`;
203
- const url = new URL(`${base}${normalizedPath}`);
204
- for (const [key, value] of Object.entries(params)) {
205
- if (value !== void 0 && value !== null) {
206
- url.searchParams.set(key, String(value));
207
- }
208
- }
209
- return url.toString();
210
- }
211
- function compactArgs(args) {
212
- const result = {};
213
- for (const [key, value] of Object.entries(args)) {
214
- if (value === void 0 || value === null || value === "") {
215
- continue;
216
- }
217
- result[key] = value;
218
- }
219
- return result;
220
- }
221
- function unwrapDataResponse(data) {
222
- const returnCode = data?.returnCode ?? data?.return_code;
223
- const returnMessage = data?.returnMessage ?? data?.return_message;
224
- if (returnCode !== void 0 && returnCode !== 0) {
225
- throw new Error(`AE API error: ${returnMessage || "unknown"} (code: ${returnCode})`);
226
- }
227
- if (data?.data !== void 0) {
228
- return data.data;
229
- }
230
- return data;
231
- }
232
- function parseResponseBody(text, url, status, allowPlainText = false) {
233
- try {
234
- return safeJsonParse(text);
235
- } catch {
236
- if (allowPlainText) {
237
- return text;
238
- }
239
- const preview = text.trim().slice(0, 120);
240
- throw new Error(`AE API error: non-JSON response from ${url} (HTTP ${status}): ${preview || "<empty>"}`);
241
- }
242
- }
243
- function permissionMessage(data) {
244
- const detail = data?.error?.message || data?.message || data?.error || data?.return_message || data?.returnMessage;
245
- if (detail && typeof detail === "string") {
246
- return detail;
247
- }
248
- return "Permission denied for this resource (HTTP 403)";
249
- }
250
- function formatHttpError(status, statusText, data) {
251
- const detail = typeof data === "string" ? data : data?.message || data?.error || data?.return_message || data?.returnMessage;
252
- const path = data?.path ? ` path: ${data.path}` : "";
253
- return `AE API error: HTTP ${status} ${statusText}${detail ? ` - ${detail}` : ""}${path}`;
254
- }
255
-
256
- // src/commands/te-dataops/datatable/get-table-detail.ts
257
- var toolName = "datatable_get_table_detail";
258
- function optionalString(ctx, name) {
259
- const value = ctx.str(name);
260
- return value === "" ? void 0 : value;
261
- }
262
- function buildArgs(ctx) {
263
- return {
264
- spaceCode: ctx.str("spaceCode"),
265
- tableName: ctx.str("tableName"),
266
- manageMode: ctx.str("manageMode"),
267
- env: ctx.str("env"),
268
- entityType: optionalString(ctx, "entityType")
269
- };
270
- }
271
- var getTableDetail = {
272
- service: "dataops_datatable",
273
- command: "+get_table_detail",
274
- 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.",
275
- flags: [
276
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
277
- { name: "tableName", type: "string", required: true, desc: "Table name keyword; exact name recommended" },
278
- { name: "manageMode", type: "string", required: false, desc: "Optional mode filter: TASK_ENV, IDE, SYSTEM, or AUTHED_SPACE. Omit to auto-match across modes" },
279
- { name: "env", type: "string", required: false, desc: "Optional environment: DEV or PRODUCT. If omitted, TASK_ENV returns both environments" },
280
- { name: "entityType", type: "string", required: false, desc: "Optional type hint: TABLE or VIEW. Omit unless the table name is ambiguous" }
281
- ],
282
- validate: (ctx) => {
283
- const entityType = optionalString(ctx, "entityType");
284
- if (entityType !== void 0 && entityType.toUpperCase() !== "TABLE" && entityType.toUpperCase() !== "VIEW") {
285
- throw new Error("entityType must be TABLE or VIEW");
286
- }
287
- },
288
- risk: "read",
289
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName, buildArgs(ctx)),
290
- execute: async (ctx) => {
291
- return callDataopsApi(ctx, toolName, buildArgs(ctx));
292
- }
293
- };
294
-
295
- // src/commands/te-dataops/datatable/dict-search-tables.ts
296
- var toolName2 = "datatable_dict_search_tables";
297
- function buildArgs2(ctx) {
298
- return {
299
- spaceCode: ctx.str("spaceCode"),
300
- search: ctx.str("search"),
301
- maxResults: ctx.optionalNum("maxResults")
302
- };
303
- }
304
- var dictSearchTables = {
305
- service: "dataops_datatable",
306
- command: "+dict_search_tables",
307
- 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.",
308
- flags: [
309
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
310
- { name: "search", type: "string", required: false, desc: "Keyword matching table name/catalog/schema/comment/remark where available" },
311
- { name: "maxResults", type: "number", required: false, desc: "Max return count, default 50, max 200" }
312
- ],
313
- risk: "read",
314
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName2, buildArgs2(ctx)),
315
- execute: async (ctx) => {
316
- return callDataopsApi(ctx, toolName2, buildArgs2(ctx));
317
- }
318
- };
319
-
320
- // src/commands/te-dataops/datatable/create-table.ts
321
- var toolName3 = "datatable_create_table";
322
- function buildArgs3(ctx) {
323
- return {
324
- spaceCode: ctx.str("spaceCode"),
325
- ddl: ctx.str("ddl")
326
- };
327
- }
328
- var createTable = {
329
- service: "dataops_datatable",
330
- command: "+create_table",
331
- 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.",
332
- flags: [
333
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
334
- { name: "ddl", type: "string", required: true, desc: "Complete Trino-compatible CREATE TABLE DDL statement" }
335
- ],
336
- risk: "write",
337
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName3, buildArgs3(ctx)),
338
- execute: async (ctx) => {
339
- return callDataopsApi(ctx, toolName3, buildArgs3(ctx));
340
- }
341
- };
342
-
343
- // src/commands/te-dataops/datatable/create-view.ts
344
- var toolName4 = "datatable_create_view";
345
- function buildArgs4(ctx) {
346
- return {
347
- spaceCode: ctx.str("spaceCode"),
348
- ddl: ctx.str("ddl")
349
- };
350
- }
351
- function escapeRegExp(value) {
352
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
353
- }
354
- function validateEnvPlaceholder(ctx) {
355
- const spaceCode = ctx.str("spaceCode");
356
- const ddl = ctx.str("ddl");
357
- const schemaPattern = new RegExp(`\\bws_${escapeRegExp(spaceCode)}_(?:dev|product)?(?=\\.)`, "i");
358
- const match = ddl.match(schemaPattern);
359
- if (!match) return;
360
- 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}.`;
361
- printError("validation", message);
362
- process.exit(1);
363
- }
364
- var createView = {
365
- service: "dataops_datatable",
366
- command: "+create_view",
367
- 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.",
368
- flags: [
369
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
370
- { name: "ddl", type: "string", required: true, desc: "Complete Trino-compatible CREATE VIEW DDL statement; keep ${env} literal when referencing current-space task tables" }
371
- ],
372
- risk: "write",
373
- validate: validateEnvPlaceholder,
374
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName4, buildArgs4(ctx)),
375
- execute: async (ctx) => {
376
- return callDataopsApi(ctx, toolName4, buildArgs4(ctx));
377
- }
378
- };
379
-
380
- // src/commands/te-dataops/datatable/publish-entity.ts
381
- var toolName5 = "datatable_publish_entity";
382
- function buildArgs5(ctx) {
383
- return {
384
- spaceCode: ctx.str("spaceCode"),
385
- entityType: ctx.str("entityType"),
386
- entityId: ctx.str("entityId"),
387
- name: ctx.str("name")
388
- };
389
- }
390
- var publishEntity = {
391
- service: "dataops_datatable",
392
- command: "+publish_entity",
393
- 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.",
394
- flags: [
395
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
396
- { name: "name", type: "string", required: true, desc: "Existing table or view name to publish" },
397
- { name: "entityId", type: "string", required: false, desc: "Optional DataOps entity ID for disambiguating same-name matches" },
398
- { name: "entityType", type: "string", required: false, desc: "Optional validation constraint: TABLE or VIEW" }
399
- ],
400
- risk: "write",
401
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName5, buildArgs5(ctx)),
402
- execute: async (ctx) => {
403
- return callDataopsApi(ctx, toolName5, buildArgs5(ctx));
404
- }
405
- };
406
-
407
- // src/commands/te-dataops/datatable/index.ts
408
- var commands = [
409
- getTableDetail,
410
- dictSearchTables,
411
- createTable,
412
- createView,
413
- publishEntity
414
- ];
415
- var datatable_default = commands;
416
-
417
- // src/commands/te-dataops/flow/get-flow-overview.ts
418
- var toolName6 = "flow_get_flow_overview";
419
- function requireFlowTarget(ctx) {
420
- if (ctx.optionalNum("flowCode") == null && !ctx.str("flowName").trim()) {
421
- throw new Error("Pass --flowCode or --flowName");
422
- }
423
- }
424
- function buildArgs6(ctx) {
425
- requireFlowTarget(ctx);
426
- return {
427
- spaceCode: ctx.str("spaceCode"),
428
- flowCode: ctx.optionalNum("flowCode"),
429
- flowName: ctx.str("flowName"),
430
- env: ctx.str("env")
431
- };
432
- }
433
- var getFlowOverview = {
434
- service: "dataops_flow",
435
- command: "+get_flow_overview",
436
- 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.",
437
- flags: [
438
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
439
- { name: "flowCode", type: "number", required: false, desc: "Optional task flow code; takes precedence over flowName" },
440
- { name: "flowName", type: "string", required: false, desc: "Optional exact task flow name; required when flowCode is omitted" },
441
- { name: "env", type: "string", required: false, desc: "Optional environment: DEV (default) or PROD" }
442
- ],
443
- risk: "read",
444
- validate: requireFlowTarget,
445
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName6, buildArgs6(ctx)),
446
- execute: async (ctx) => {
447
- return callDataopsApi(ctx, toolName6, buildArgs6(ctx));
448
- }
449
- };
450
-
451
- // src/commands/te-dataops/flow/list-flows.ts
452
- var toolName7 = "flow_list_flows";
453
- function buildArgs7(ctx) {
454
- return {
455
- spaceCode: ctx.str("spaceCode"),
456
- keyword: ctx.str("keyword"),
457
- pageNum: ctx.optionalNum("pageNum"),
458
- pageSize: ctx.optionalNum("pageSize")
459
- };
460
- }
461
- var listFlows = {
462
- service: "dataops_flow",
463
- command: "+list_flows",
464
- 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.",
465
- flags: [
466
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
467
- { name: "keyword", type: "string", required: false, desc: "Optional search keyword: flowName contains it; remark matches it as a comma-delimited token" },
468
- { name: "pageNum", type: "number", required: false, desc: "Optional page number; default 1" },
469
- { name: "pageSize", type: "number", required: false, desc: "Optional page size; default 20, max 100" }
470
- ],
471
- risk: "read",
472
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName7, buildArgs7(ctx)),
473
- execute: async (ctx) => {
474
- return callDataopsApi(ctx, toolName7, buildArgs7(ctx));
475
- }
476
- };
477
-
478
- // src/commands/te-dataops/flow/save-schedule-config.ts
479
- var toolName8 = "flow_save_schedule_config";
480
- function buildArgs8(ctx) {
481
- return {
482
- spaceCode: ctx.str("spaceCode"),
483
- flowCode: ctx.num("flowCode"),
484
- enabled: ctx.bool("enabled"),
485
- cron: ctx.str("cron")
486
- };
487
- }
488
- var saveScheduleConfig = {
489
- service: "dataops_flow",
490
- command: "+save_schedule_config",
491
- 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",
492
- flags: [
493
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
494
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
495
- { name: "enabled", type: "boolean", required: true, desc: "Whether scheduling is enabled: true or false" },
496
- { name: "cron", type: "string", required: false, desc: "Quartz CRON expression. Required only when enabled=true, e.g., '0 0 2 * * ?'" }
497
- ],
498
- risk: "write",
499
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName8, buildArgs8(ctx)),
500
- execute: async (ctx) => {
501
- return callDataopsApi(ctx, toolName8, buildArgs8(ctx));
502
- }
503
- };
504
-
505
- // src/commands/te-dataops/flow/execute-flow.ts
506
- var toolName9 = "flow_execute_flow";
507
- function buildArgs9(ctx) {
508
- return {
509
- spaceCode: ctx.str("spaceCode"),
510
- flowCode: ctx.num("flowCode"),
511
- baseDate: ctx.str("baseDate")
512
- };
513
- }
514
- var executeFlow = {
515
- service: "dataops_flow",
516
- command: "+execute_flow",
517
- 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.",
518
- flags: [
519
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
520
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
521
- { name: "baseDate", type: "string", required: false, desc: "Optional data date, format yyyy-MM-dd. Maps to runtime parameter bd" }
522
- ],
523
- risk: "write",
524
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName9, buildArgs9(ctx)),
525
- execute: async (ctx) => {
526
- return callDataopsApi(ctx, toolName9, buildArgs9(ctx));
527
- }
528
- };
529
-
530
- // src/commands/te-dataops/flow/release-flow.ts
531
- var toolName10 = "flow_release_flow";
532
- function buildArgs10(ctx) {
533
- return {
534
- spaceCode: ctx.str("spaceCode"),
535
- flowCode: ctx.num("flowCode")
536
- };
537
- }
538
- var releaseFlow = {
539
- service: "dataops_flow",
540
- command: "+release_flow",
541
- 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.",
542
- flags: [
543
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
544
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" }
545
- ],
546
- risk: "write",
547
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName10, buildArgs10(ctx)),
548
- execute: async (ctx) => {
549
- return callDataopsApi(ctx, toolName10, buildArgs10(ctx));
550
- }
551
- };
552
-
553
- // src/commands/te-dataops/flow/preview-release-flow.ts
554
- var toolName11 = "flow_preview_release_flow";
555
- function buildArgs11(ctx) {
556
- return {
557
- spaceCode: ctx.str("spaceCode"),
558
- flowCode: ctx.num("flowCode")
559
- };
560
- }
561
- var previewReleaseFlow = {
562
- service: "dataops_flow",
563
- command: "+preview_release_flow",
564
- 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.",
565
- flags: [
566
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
567
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" }
568
- ],
569
- risk: "read",
570
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName11, buildArgs11(ctx)),
571
- execute: async (ctx) => {
572
- return callDataopsApi(ctx, toolName11, buildArgs11(ctx));
573
- }
574
- };
575
-
576
- // src/commands/te-dataops/flow/update-flow.ts
577
- var toolName12 = "flow_update_flow";
578
- function requireUpdateField(ctx) {
579
- if (!ctx.str("flowName").trim() && !ctx.str("remark").trim()) {
580
- throw new Error("Pass at least one of --flowName or --remark");
581
- }
582
- }
583
- function buildArgs12(ctx) {
584
- requireUpdateField(ctx);
585
- return {
586
- spaceCode: ctx.str("spaceCode"),
587
- flowCode: ctx.num("flowCode"),
588
- flowName: ctx.str("flowName"),
589
- remark: ctx.str("remark")
590
- };
591
- }
592
- var updateFlow = {
593
- service: "dataops_flow",
594
- command: "+update_flow",
595
- 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.",
596
- flags: [
597
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
598
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
599
- { name: "flowName", type: "string", required: false, desc: "Optional new workflow name" },
600
- { name: "remark", type: "string", required: false, desc: "Optional new workflow remark" }
601
- ],
602
- risk: "write",
603
- validate: requireUpdateField,
604
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName12, buildArgs12(ctx)),
605
- execute: async (ctx) => {
606
- return callDataopsApi(ctx, toolName12, buildArgs12(ctx));
607
- }
608
- };
609
-
610
- // src/commands/te-dataops/flow/create-flow.ts
611
- var toolName13 = "flow_create_flow";
612
- function buildArgs13(ctx) {
613
- return {
614
- spaceCode: ctx.str("spaceCode"),
615
- flowName: ctx.str("flowName"),
616
- remark: ctx.str("remark")
617
- };
618
- }
619
- var createFlow = {
620
- service: "dataops_flow",
621
- command: "+create_flow",
622
- 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.",
623
- flags: [
624
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
625
- { name: "flowName", type: "string", required: true, desc: "Task flow name" },
626
- { name: "remark", type: "string", required: false, desc: "Optional flow description" }
627
- ],
628
- risk: "write",
629
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName13, buildArgs13(ctx)),
630
- execute: async (ctx) => {
631
- return callDataopsApi(ctx, toolName13, buildArgs13(ctx));
632
- }
633
- };
634
-
635
- // src/commands/te-dataops/flow/get-task-params.ts
636
- var toolName14 = "flow_get_task_params";
637
- function buildArgs14(ctx) {
638
- return {
639
- spaceCode: ctx.str("spaceCode"),
640
- flowCode: ctx.num("flowCode"),
641
- taskCode: ctx.num("taskCode")
642
- };
643
- }
644
- var getTaskParams = {
645
- service: "dataops_flow",
646
- command: "+get_task_params",
647
- 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",
648
- flags: [
649
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
650
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
651
- { name: "taskCode", type: "number", required: true, desc: "Task code" }
652
- ],
653
- risk: "read",
654
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName14, buildArgs14(ctx)),
655
- execute: async (ctx) => {
656
- return callDataopsApi(ctx, toolName14, buildArgs14(ctx));
657
- }
658
- };
659
-
660
- // src/commands/te-dataops/flow/add-task-relation.ts
661
- var toolName15 = "flow_add_task_relation";
662
- function buildArgs15(ctx) {
663
- return {
664
- spaceCode: ctx.str("spaceCode"),
665
- flowCode: ctx.num("flowCode"),
666
- preTaskCode: ctx.num("preTaskCode"),
667
- taskCode: ctx.num("taskCode")
668
- };
669
- }
670
- var addTaskRelation = {
671
- service: "dataops_flow",
672
- command: "+add_task_relation",
673
- 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",
674
- flags: [
675
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
676
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
677
- { name: "preTaskCode", type: "number", required: true, desc: "Pre-task code (upstream)" },
678
- { name: "taskCode", type: "number", required: true, desc: "Current task code (downstream)" }
679
- ],
680
- risk: "write",
681
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName15, buildArgs15(ctx)),
682
- execute: async (ctx) => {
683
- return callDataopsApi(ctx, toolName15, buildArgs15(ctx));
684
- }
685
- };
686
-
687
- // src/commands/te-dataops/flow/task-write-options.ts
688
- var createTaskWriteFlags = [
689
- { name: "preTasks", type: "json", required: false, desc: "Upstream task codes as a JSON array. Omit for no dependencies" },
690
- { name: "failRetryTimes", type: "number", required: false, default: 3, min: 0, max: 24, desc: "Failure retry count. Default 3; use 0 to disable retries" },
691
- { name: "failRetryInterval", type: "number", required: false, default: 5, min: 1, max: 60, desc: "Failure retry interval in minutes. Default 5" },
692
- { name: "failRetryUnit", type: "string", required: false, default: "MINUTE", desc: "Failure retry unit. Only MINUTE is supported" }
693
- ];
694
- var updateTaskWriteFlags = [
695
- { name: "preTasks", type: "json", required: false, desc: "Upstream task codes as a JSON array. Omit to keep existing dependencies; [] clears them; a non-empty array replaces them" },
696
- { name: "failRetryTimes", type: "number", required: false, min: 0, max: 24, desc: "Failure retry count. Omit to keep the existing value; use 0 to disable retries" },
697
- { name: "failRetryInterval", type: "number", required: false, min: 1, max: 60, desc: "Failure retry interval in minutes. Omit to keep the existing value" },
698
- { name: "failRetryUnit", type: "string", required: false, desc: "Failure retry unit. Only MINUTE is supported; omit to keep the existing value" }
699
- ];
700
- function buildTaskWriteArgs(ctx) {
701
- return {
702
- preTasks: ctx.json("preTasks"),
703
- failRetryTimes: ctx.optionalNum("failRetryTimes"),
704
- failRetryInterval: ctx.optionalNum("failRetryInterval"),
705
- failRetryUnit: optionalString2(ctx, "failRetryUnit")
706
- };
707
- }
708
- function validateTaskWriteArgs(ctx) {
709
- const preTasks = ctx.json("preTasks");
710
- if (preTasks !== void 0 && (!Array.isArray(preTasks) || preTasks.some((taskCode) => !Number.isSafeInteger(taskCode) || taskCode <= 0))) {
711
- throw new Error("preTasks must be a JSON array of positive integer task codes");
712
- }
713
- if (preTasks !== void 0 && new Set(preTasks).size !== preTasks.length) {
714
- throw new Error("preTasks must not contain duplicate task codes");
715
- }
716
- for (const name of ["failRetryTimes", "failRetryInterval"]) {
717
- const value = ctx.optionalNum(name);
718
- if (value !== void 0 && !Number.isInteger(value)) {
719
- throw new Error(`${name} must be an integer`);
720
- }
721
- }
722
- const failRetryUnit = optionalString2(ctx, "failRetryUnit");
723
- if (failRetryUnit !== void 0 && failRetryUnit !== "MINUTE") {
724
- throw new Error("failRetryUnit must be MINUTE");
725
- }
726
- }
727
- function optionalString2(ctx, name) {
728
- const value = ctx.str(name);
729
- return value === "" ? void 0 : value;
730
- }
731
-
732
- // src/commands/te-dataops/flow/create-sql-task.ts
733
- var toolName16 = "flow_create_sql_task";
734
- function buildArgs16(ctx) {
735
- return {
736
- spaceCode: ctx.str("spaceCode"),
737
- flowCode: ctx.num("flowCode"),
738
- taskName: ctx.str("taskName"),
739
- sql: ctx.str("sql"),
740
- preSql: ctx.str("preSql"),
741
- postSql: ctx.str("postSql"),
742
- remark: ctx.str("remark"),
743
- ...buildTaskWriteArgs(ctx)
744
- };
745
- }
746
- var createSqlTask = {
747
- service: "dataops_flow",
748
- command: "+create_sql_task",
749
- description: "Create a DEV Trino SQL task and save its SQL. Requires spaceCode, flowCode, taskName, and sql; SQL hooks, dependencies, retry policy, and remark are optional. Returns action/result/status; result includes flowCode, taskCode, taskName, taskType=TRINO_SQL, and sqlSaved=true",
750
- flags: [
751
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
752
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
753
- { name: "taskName", type: "string", required: true, desc: "Task name" },
754
- { name: "sql", type: "string", required: true, desc: "Trino SQL content for the task" },
755
- { name: "preSql", type: "string", required: false, desc: "Optional SQL to run before the main SQL" },
756
- { name: "postSql", type: "string", required: false, desc: "Optional SQL to run after the main SQL" },
757
- { name: "remark", type: "string", required: false, desc: "Description" },
758
- ...createTaskWriteFlags
759
- ],
760
- risk: "write",
761
- validate: validateTaskWriteArgs,
762
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName16, buildArgs16(ctx)),
763
- execute: async (ctx) => {
764
- return callDataopsApi(ctx, toolName16, buildArgs16(ctx));
765
- }
766
- };
767
-
768
- // src/commands/te-dataops/flow/update-sql-task.ts
769
- var toolName17 = "flow_update_sql_task";
770
- function buildArgs17(ctx) {
771
- return {
772
- spaceCode: ctx.str("spaceCode"),
773
- flowCode: ctx.num("flowCode"),
774
- taskCode: ctx.num("taskCode"),
775
- sql: ctx.str("sql"),
776
- preSql: ctx.str("preSql"),
777
- postSql: ctx.str("postSql"),
778
- ...buildTaskWriteArgs(ctx)
779
- };
780
- }
781
- var updateSqlTask = {
782
- service: "dataops_flow",
783
- command: "+update_sql_task",
784
- description: "Update an existing DEV Trino SQL task. Requires spaceCode, flowCode, taskCode, and sql; omitted SQL hooks, dependencies, and retry fields keep existing values. Returns action/result/status; result includes sqlSaved, flowCode, taskCode, taskType=TRINO_SQL, and task",
785
- flags: [
786
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
787
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
788
- { name: "taskCode", type: "number", required: true, desc: "Trino SQL task code" },
789
- { name: "sql", type: "string", required: true, desc: "Main Trino SQL content" },
790
- { name: "preSql", type: "string", required: false, desc: "Optional SQL to run before the main SQL. Omit to keep existing preSql" },
791
- { name: "postSql", type: "string", required: false, desc: "Optional SQL to run after the main SQL. Omit to keep existing postSql" },
792
- ...updateTaskWriteFlags
793
- ],
794
- risk: "write",
795
- validate: validateTaskWriteArgs,
796
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName17, buildArgs17(ctx)),
797
- execute: async (ctx) => {
798
- return callDataopsApi(ctx, toolName17, buildArgs17(ctx));
799
- }
800
- };
801
-
802
- // src/commands/te-dataops/flow/create-integration-task.ts
803
- var toolName18 = "flow_create_integration_task";
804
- function validateInteger(ctx, name) {
805
- const value = ctx.str(name).trim();
806
- if (!/^\d+$/.test(value)) {
807
- throw new Error(`Invalid --${name}: expected an integer, got "${value}"`);
808
- }
809
- }
810
- function buildArgs18(ctx) {
811
- return {
812
- spaceCode: ctx.str("spaceCode"),
813
- flowCode: ctx.num("flowCode"),
814
- taskName: ctx.str("taskName"),
815
- syncId: ctx.str("syncId"),
816
- remark: ctx.str("remark"),
817
- ...buildTaskWriteArgs(ctx)
818
- };
819
- }
820
- var createIntegrationTask = {
821
- service: "dataops_flow",
822
- command: "+create_integration_task",
823
- 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",
824
- flags: [
825
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
826
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
827
- { name: "taskName", type: "string", required: true, desc: "Task name" },
828
- { name: "syncId", type: "string", required: true, desc: "DataOps sync solution ID to bind" },
829
- { name: "remark", type: "string", required: false, desc: "Description" },
830
- ...createTaskWriteFlags
831
- ],
832
- risk: "write",
833
- validate: (ctx) => {
834
- validateInteger(ctx, "flowCode");
835
- validateTaskWriteArgs(ctx);
836
- },
837
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName18, buildArgs18(ctx)),
838
- execute: async (ctx) => callDataopsApi(ctx, toolName18, buildArgs18(ctx))
839
- };
840
-
841
- // src/commands/te-dataops/flow/update-integration-task.ts
842
- var toolName19 = "flow_update_integration_task";
843
- function validateInteger2(ctx, name) {
844
- const value = ctx.str(name).trim();
845
- if (!/^\d+$/.test(value)) {
846
- throw new Error(`Invalid --${name}: expected an integer, got "${value}"`);
847
- }
848
- }
849
- function buildArgs19(ctx) {
850
- return {
851
- spaceCode: ctx.str("spaceCode"),
852
- flowCode: ctx.num("flowCode"),
853
- taskCode: ctx.num("taskCode"),
854
- syncId: ctx.str("syncId"),
855
- ...buildTaskWriteArgs(ctx)
856
- };
857
- }
858
- var updateIntegrationTask = {
859
- service: "dataops_flow",
860
- command: "+update_integration_task",
861
- description: "Update an existing DEV integration sync task to bind a DataOps sync solution. The task must be taskType=OFFLINE_SYNC. Omitted dependencies and retry fields keep existing values",
862
- flags: [
863
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
864
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
865
- { name: "taskCode", type: "number", required: true, desc: "Integration task code" },
866
- { name: "syncId", type: "string", required: true, desc: "DataOps sync solution ID to bind" },
867
- ...updateTaskWriteFlags
868
- ],
869
- risk: "write",
870
- validate: (ctx) => {
871
- validateInteger2(ctx, "flowCode");
872
- validateInteger2(ctx, "taskCode");
873
- validateTaskWriteArgs(ctx);
874
- },
875
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName19, buildArgs19(ctx)),
876
- execute: async (ctx) => callDataopsApi(ctx, toolName19, buildArgs19(ctx))
877
- };
878
-
879
- // src/commands/te-dataops/flow/workflow-instance-check-task-options.ts
880
- var ITEM_FIELDS = /* @__PURE__ */ new Set(["flowCode", "left", "right", "checkTimeUnit"]);
881
- var TASK_ITEM_FIELDS = /* @__PURE__ */ new Set([...ITEM_FIELDS, "taskCode"]);
882
- var TIME_UNITS = /* @__PURE__ */ new Set(["DAY", "HOUR", "MINUTE"]);
883
- function buildCheckArgs(ctx) {
884
- return {
885
- checkItems: ctx.json("checkItems"),
886
- relation: optionalString3(ctx, "relation"),
887
- checkInterval: ctx.optionalNum("checkInterval"),
888
- checkTime: ctx.optionalNum("checkTime")
889
- };
890
- }
891
- function validateCheckArgs(ctx, requireTaskCode = false) {
892
- const items = ctx.json("checkItems");
893
- const currentFlowCode = ctx.num("flowCode");
894
- const itemFields = requireTaskCode ? TASK_ITEM_FIELDS : ITEM_FIELDS;
895
- if (!Array.isArray(items) || items.length < 1 || items.length > 20) {
896
- throw new Error("checkItems must be a JSON array with between 1 and 20 items");
897
- }
898
- items.forEach((item, index) => {
899
- if (item === null || typeof item !== "object" || Array.isArray(item)) {
900
- throw new Error(`checkItems[${index}] must be an object`);
901
- }
902
- for (const field of Object.keys(item)) {
903
- if (!itemFields.has(field)) {
904
- throw new Error(`checkItems[${index}] contains unsupported field "${field}"`);
905
- }
906
- }
907
- if (!Number.isSafeInteger(item.flowCode) || item.flowCode <= 0) {
908
- throw new Error(`checkItems[${index}].flowCode must be a positive integer`);
909
- }
910
- if (requireTaskCode && (!Number.isSafeInteger(item.taskCode) || item.taskCode <= 0)) {
911
- throw new Error(`checkItems[${index}].taskCode must be a positive integer`);
912
- }
913
- const minimum = item.flowCode === currentFlowCode ? 1 : 0;
914
- if (!Number.isInteger(item.left) || item.left < minimum) {
915
- throw new Error(`checkItems[${index}].left must be an integer greater than or equal to ${minimum}`);
916
- }
917
- if (!Number.isInteger(item.right) || item.right < minimum || item.right > item.left) {
918
- throw new Error(`checkItems[${index}].right must be an integer between ${minimum} and left`);
919
- }
920
- if (!TIME_UNITS.has(item.checkTimeUnit)) {
921
- throw new Error(`checkItems[${index}].checkTimeUnit must be DAY, HOUR, or MINUTE`);
922
- }
923
- });
924
- const relation = optionalString3(ctx, "relation");
925
- if (relation !== void 0 && relation !== "AND" && relation !== "OR") {
926
- throw new Error("relation must be AND or OR");
927
- }
928
- for (const name of ["checkInterval", "checkTime"]) {
929
- const value = ctx.optionalNum(name);
930
- if (value !== void 0 && !Number.isInteger(value)) {
931
- throw new Error(`${name} must be an integer`);
932
- }
933
- }
934
- }
935
- function optionalString3(ctx, name) {
936
- const value = ctx.str(name);
937
- return value === "" ? void 0 : value;
938
- }
939
-
940
- // src/commands/te-dataops/flow/create-workflow-instance-check-task.ts
941
- var toolName20 = "flow_create_workflow_instance_check_task";
942
- function buildArgs20(ctx) {
943
- return {
944
- spaceCode: ctx.str("spaceCode"),
945
- flowCode: ctx.num("flowCode"),
946
- taskName: ctx.str("taskName"),
947
- remark: ctx.str("remark"),
948
- ...buildCheckArgs(ctx),
949
- ...buildTaskWriteArgs(ctx)
950
- };
951
- }
952
- var createWorkflowInstanceCheckTask = {
953
- service: "dataops_flow",
954
- command: "+create_workflow_instance_check_task",
955
- description: "Create a DEV workflow instance check task. It waits for one or more target workflows using one flat AND/OR relation",
956
- flags: [
957
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
958
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
959
- { name: "taskName", type: "string", required: true, desc: "Task name" },
960
- { name: "checkItems", type: "json", required: true, desc: "JSON array of 1-20 objects with only flowCode, left, right, and checkTimeUnit (DAY, HOUR, or MINUTE)" },
961
- { name: "relation", type: "string", required: false, default: "AND", desc: "Flat relation across all check items: AND or OR. Default AND" },
962
- { name: "checkInterval", type: "number", required: false, default: 5, min: 1, max: 180, desc: "Check interval in minutes. Default 5" },
963
- { name: "checkTime", type: "number", required: false, default: 3, min: 1, max: 20, desc: "Number of checks. Default 3" },
964
- { name: "remark", type: "string", required: false, desc: "Description" },
965
- ...createTaskWriteFlags
966
- ],
967
- risk: "write",
968
- validate: (ctx) => {
969
- validateCheckArgs(ctx);
970
- validateTaskWriteArgs(ctx);
971
- },
972
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName20, buildArgs20(ctx)),
973
- execute: async (ctx) => callDataopsApi(ctx, toolName20, buildArgs20(ctx))
974
- };
975
-
976
- // src/commands/te-dataops/flow/update-workflow-instance-check-task.ts
977
- var toolName21 = "flow_update_workflow_instance_check_task";
978
- function buildArgs21(ctx) {
979
- return {
980
- spaceCode: ctx.str("spaceCode"),
981
- flowCode: ctx.num("flowCode"),
982
- taskCode: ctx.num("taskCode"),
983
- ...buildCheckArgs(ctx),
984
- ...buildTaskWriteArgs(ctx)
985
- };
986
- }
987
- var updateWorkflowInstanceCheckTask = {
988
- service: "dataops_flow",
989
- command: "+update_workflow_instance_check_task",
990
- description: "Replace the check configuration of an existing DEV workflow instance check task. Omitted dependencies and retry fields keep existing values",
991
- flags: [
992
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
993
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
994
- { name: "taskCode", type: "number", required: true, desc: "Workflow instance check task code" },
995
- { name: "checkItems", type: "json", required: true, desc: "JSON array of 1-20 objects with only flowCode, left, right, and checkTimeUnit (DAY, HOUR, or MINUTE)" },
996
- { name: "relation", type: "string", required: false, desc: "Flat relation across all check items: AND or OR. Omit to keep the existing relation" },
997
- { name: "checkInterval", type: "number", required: false, min: 1, max: 180, desc: "Check interval in minutes. Omit to keep the existing value" },
998
- { name: "checkTime", type: "number", required: false, min: 1, max: 20, desc: "Number of checks. Omit to keep the existing value" },
999
- ...updateTaskWriteFlags
1000
- ],
1001
- risk: "write",
1002
- validate: (ctx) => {
1003
- validateCheckArgs(ctx);
1004
- validateTaskWriteArgs(ctx);
1005
- },
1006
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName21, buildArgs21(ctx)),
1007
- execute: async (ctx) => callDataopsApi(ctx, toolName21, buildArgs21(ctx))
1008
- };
1009
-
1010
- // src/commands/te-dataops/flow/create-task-instance-check-task.ts
1011
- var toolName22 = "flow_create_task_instance_check_task";
1012
- function buildArgs22(ctx) {
1013
- return {
1014
- spaceCode: ctx.str("spaceCode"),
1015
- flowCode: ctx.num("flowCode"),
1016
- taskName: ctx.str("taskName"),
1017
- remark: ctx.str("remark"),
1018
- ...buildCheckArgs(ctx),
1019
- ...buildTaskWriteArgs(ctx)
1020
- };
1021
- }
1022
- var createTaskInstanceCheckTask = {
1023
- service: "dataops_flow",
1024
- command: "+create_task_instance_check_task",
1025
- description: "Create a DEV task instance check task. It waits for one or more target tasks using one flat AND/OR relation",
1026
- flags: [
1027
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1028
- { name: "flowCode", type: "number", required: true, desc: "Flow code where the new TASK_CHECK node is created" },
1029
- { name: "taskName", type: "string", required: true, desc: "Task name" },
1030
- { name: "checkItems", type: "json", required: true, desc: "JSON array of 1-20 target tasks. Each object allows only flowCode, taskCode, left, right, and checkTimeUnit (DAY, HOUR, or MINUTE); nested taskCode identifies the target task" },
1031
- { name: "relation", type: "string", required: false, default: "AND", desc: "Flat relation across all check items: AND or OR. Default AND" },
1032
- { name: "checkInterval", type: "number", required: false, default: 10, min: 1, max: 180, desc: "Check interval in minutes. Default 10" },
1033
- { name: "checkTime", type: "number", required: false, default: 3, min: 1, max: 20, desc: "Number of checks. Default 3" },
1034
- { name: "remark", type: "string", required: false, desc: "Description" },
1035
- ...createTaskWriteFlags
1036
- ],
1037
- risk: "write",
1038
- validate: (ctx) => {
1039
- validateCheckArgs(ctx, true);
1040
- validateTaskWriteArgs(ctx);
1041
- },
1042
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName22, buildArgs22(ctx)),
1043
- execute: async (ctx) => callDataopsApi(ctx, toolName22, buildArgs22(ctx))
1044
- };
1045
-
1046
- // src/commands/te-dataops/flow/update-task-instance-check-task.ts
1047
- var toolName23 = "flow_update_task_instance_check_task";
1048
- function buildArgs23(ctx) {
1049
- return {
1050
- spaceCode: ctx.str("spaceCode"),
1051
- flowCode: ctx.num("flowCode"),
1052
- taskCode: ctx.num("taskCode"),
1053
- ...buildCheckArgs(ctx),
1054
- ...buildTaskWriteArgs(ctx)
1055
- };
1056
- }
1057
- var updateTaskInstanceCheckTask = {
1058
- service: "dataops_flow",
1059
- command: "+update_task_instance_check_task",
1060
- description: "Replace the check configuration of an existing DEV task instance check node. Omitted dependencies, check scalars, and retry fields keep existing values",
1061
- flags: [
1062
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1063
- { name: "flowCode", type: "number", required: true, desc: "Flow code containing the TASK_CHECK node to update" },
1064
- { name: "taskCode", type: "number", required: true, desc: "TASK_CHECK node code to update; this is not a target task code from checkItems" },
1065
- { name: "checkItems", type: "json", required: true, desc: "Replacement JSON array of 1-20 target tasks. Each object allows only flowCode, taskCode, left, right, and checkTimeUnit (DAY, HOUR, or MINUTE); nested taskCode identifies the target task" },
1066
- { name: "relation", type: "string", required: false, desc: "Flat relation across all check items: AND or OR. Omit to keep the existing relation" },
1067
- { name: "checkInterval", type: "number", required: false, min: 1, max: 180, desc: "Check interval in minutes. Omit to keep the existing value" },
1068
- { name: "checkTime", type: "number", required: false, min: 1, max: 20, desc: "Number of checks. Omit to keep the existing value" },
1069
- ...updateTaskWriteFlags
1070
- ],
1071
- risk: "write",
1072
- validate: (ctx) => {
1073
- validateCheckArgs(ctx, true);
1074
- validateTaskWriteArgs(ctx);
1075
- },
1076
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName23, buildArgs23(ctx)),
1077
- execute: async (ctx) => callDataopsApi(ctx, toolName23, buildArgs23(ctx))
1078
- };
1079
-
1080
- // src/commands/te-dataops/flow/delete-task.ts
1081
- var toolName24 = "flow_delete_task";
1082
- function validateIdentifier(ctx, name) {
1083
- const raw = ctx.str(name).trim();
1084
- if (!/^[1-9]\d*$/.test(raw) || !Number.isSafeInteger(Number(raw))) {
1085
- throw new CliValidationError(`--${name} must be a positive safe integer`, {
1086
- location: { field: name }
1087
- });
1088
- }
1089
- }
1090
- function buildArgs24(ctx) {
1091
- return {
1092
- spaceCode: ctx.str("spaceCode"),
1093
- flowCode: ctx.num("flowCode"),
1094
- taskCode: ctx.num("taskCode")
1095
- };
1096
- }
1097
- var deleteTask = {
1098
- service: "dataops_flow",
1099
- command: "+delete_task",
1100
- description: "Delete one task node from a DEV flow. This disconnects its dependencies, may stop running DEV debug executions, does not repair cross-flow task-check references, and requires a later flow release to remove an already published PROD node.",
1101
- flags: [
1102
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1103
- { name: "flowCode", type: "number", required: true, desc: "Task flow code containing the node" },
1104
- { name: "taskCode", type: "number", required: true, desc: "Task node code to delete" }
1105
- ],
1106
- risk: "high-risk-write",
1107
- validate: (ctx) => {
1108
- validateIdentifier(ctx, "flowCode");
1109
- validateIdentifier(ctx, "taskCode");
1110
- },
1111
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName24, buildArgs24(ctx)),
1112
- execute: async (ctx) => callDataopsApi(ctx, toolName24, buildArgs24(ctx))
1113
- };
1114
-
1115
- // src/commands/te-dataops/flow/list-high-frequency-release-flows.ts
1116
- var toolName25 = "flow_list_high_frequency_release_flows";
1117
- function buildArgs25(ctx) {
1118
- return {
1119
- spaceCode: ctx.str("spaceCode"),
1120
- days: ctx.optionalNum("days"),
1121
- topN: ctx.optionalNum("topN"),
1122
- minCount: ctx.optionalNum("minCount"),
1123
- status: ctx.str("status")
1124
- };
1125
- }
1126
- var listHighFrequencyReleaseFlows = {
1127
- service: "dataops_flow",
1128
- command: "+list_high_frequency_release_flows",
1129
- 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.",
1130
- flags: [
1131
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1132
- { name: "days", type: "number", required: false, desc: "Optional lookback days; default 30, max 365" },
1133
- { name: "topN", type: "number", required: false, desc: "Optional top N flows; default 10, max 100" },
1134
- { name: "minCount", type: "number", required: false, desc: "Optional minimum release count" },
1135
- { name: "status", type: "string", required: false, desc: "Optional release status: SUCCESS, FAIL, PART_SUCCESS, or ALL; default SUCCESS" }
1136
- ],
1137
- risk: "read",
1138
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName25, buildArgs25(ctx)),
1139
- execute: async (ctx) => {
1140
- return callDataopsApi(ctx, toolName25, buildArgs25(ctx));
1141
- }
1142
- };
1143
-
1144
- // src/commands/te-dataops/flow/index.ts
1145
- var commands2 = [
1146
- getFlowOverview,
1147
- listFlows,
1148
- listHighFrequencyReleaseFlows,
1149
- saveScheduleConfig,
1150
- executeFlow,
1151
- previewReleaseFlow,
1152
- releaseFlow,
1153
- updateFlow,
1154
- createFlow,
1155
- getTaskParams,
1156
- updateSqlTask,
1157
- updateIntegrationTask,
1158
- updateWorkflowInstanceCheckTask,
1159
- updateTaskInstanceCheckTask,
1160
- addTaskRelation,
1161
- createSqlTask,
1162
- createIntegrationTask,
1163
- createWorkflowInstanceCheckTask,
1164
- createTaskInstanceCheckTask,
1165
- deleteTask
1166
- ];
1167
- var flow_default = commands2;
1168
-
1169
- // src/commands/te-dataops/integration/list-datasource-components.ts
1170
- var toolName26 = "integration_list_datasource_components";
1171
- var listDatasourceComponents = {
1172
- service: "dataops_integration",
1173
- command: "+list_datasource_components",
1174
- description: "List supported datasource components. Requires no arguments. Returns componentName, componentType, and description. Use +get_datasource_component_template before creating a datasource.",
1175
- flags: [],
1176
- risk: "read",
1177
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName26, {}),
1178
- execute: async (ctx) => {
1179
- return callDataopsApi(ctx, toolName26, {});
1180
- }
1181
- };
1182
-
1183
- // src/commands/te-dataops/integration/get-datasource-component-template.ts
1184
- var toolName27 = "integration_get_datasource_component_template";
1185
- function buildArgs26(ctx) {
1186
- return {
1187
- componentName: ctx.str("componentName")
1188
- };
1189
- }
1190
- var getDatasourceComponentTemplate = {
1191
- service: "dataops_integration",
1192
- command: "+get_datasource_component_template",
1193
- description: "Get the envJsonList template for one datasource component. Requires componentName. Returns component metadata, requiredFields, optionalFields, envJsonExampleObject, and importantNotes.",
1194
- flags: [
1195
- { name: "componentName", type: "string", required: true, desc: "Exact componentName returned by +list_datasource_components, e.g. MySQL, ClickHouse, DatabricksJdbc, LarkBitable, OSS, S3, HDFS" }
1196
- ],
1197
- risk: "read",
1198
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName27, buildArgs26(ctx)),
1199
- execute: async (ctx) => {
1200
- return callDataopsApi(ctx, toolName27, buildArgs26(ctx));
1201
- }
1202
- };
1203
-
1204
- // src/commands/te-dataops/integration/list-space-datasources.ts
1205
- var toolName28 = "integration_list_space_datasources";
1206
- function buildArgs27(ctx) {
1207
- return {
1208
- spaceCode: ctx.str("spaceCode"),
1209
- dataSourceName: ctx.str("datasourceName"),
1210
- componentName: ctx.str("componentName")
1211
- };
1212
- }
1213
- var listSpaceDatasources = {
1214
- service: "dataops_integration",
1215
- command: "+list_space_datasources",
1216
- 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.",
1217
- flags: [
1218
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1219
- { name: "datasourceName", type: "string", required: false, desc: "Optional exact datasource name filter" },
1220
- { name: "componentName", type: "string", required: false, desc: "Optional component type filter, e.g. MySQL or ClickHouse" }
1221
- ],
1222
- risk: "read",
1223
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName28, buildArgs27(ctx)),
1224
- execute: async (ctx) => {
1225
- return callDataopsApi(ctx, toolName28, buildArgs27(ctx));
1226
- }
1227
- };
1228
-
1229
- // src/commands/te-dataops/integration/get-datasource-detail.ts
1230
- var toolName29 = "integration_get_datasource_detail";
1231
- function buildArgs28(ctx) {
1232
- return {
1233
- spaceCode: ctx.str("spaceCode"),
1234
- dataSourceName: ctx.str("datasourceName")
1235
- };
1236
- }
1237
- var getDatasourceDetail = {
1238
- service: "dataops_integration",
1239
- command: "+get_datasource_detail",
1240
- 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.",
1241
- flags: [
1242
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1243
- { name: "datasourceName", type: "string", required: true, desc: "Exact datasource name within the space" }
1244
- ],
1245
- risk: "read",
1246
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName29, buildArgs28(ctx)),
1247
- execute: async (ctx) => {
1248
- return callDataopsApi(ctx, toolName29, buildArgs28(ctx));
1249
- }
1250
- };
1251
-
1252
- // src/commands/te-dataops/integration/test-datasource-connect.ts
1253
- var toolName30 = "integration_test_datasource_connect";
1254
- var testDatasourceConnect = {
1255
- service: "dataops_integration",
1256
- command: "+test_datasource_connect",
1257
- description: "Test a saved datasource connection by name. Returns datasourceName, connectStatus, connectFails, lastConnectTime, and nextAction. May take longer for slow external systems.",
1258
- flags: [
1259
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1260
- { name: "datasourceName", type: "string", required: true, desc: "Existing datasource name, exact match within the space" }
1261
- ],
1262
- risk: "read",
1263
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName30, {
1264
- spaceCode: ctx.str("spaceCode"),
1265
- datasourceName: ctx.str("datasourceName")
1266
- }),
1267
- execute: async (ctx) => {
1268
- return callDataopsApi(ctx, toolName30, {
1269
- spaceCode: ctx.str("spaceCode"),
1270
- datasourceName: ctx.str("datasourceName")
1271
- });
1272
- }
1273
- };
1274
-
1275
- // src/commands/te-dataops/integration/list-datasource-tables.ts
1276
- var toolName31 = "integration_list_datasource_tables";
1277
- function buildArgs29(ctx) {
1278
- return {
1279
- spaceCode: ctx.str("spaceCode"),
1280
- datasourceId: ctx.str("datasourceId"),
1281
- catalog: ctx.str("catalog"),
1282
- database: ctx.str("database"),
1283
- env: ctx.str("env")
1284
- };
1285
- }
1286
- var listDatasourceTables = {
1287
- service: "dataops_integration",
1288
- command: "+list_datasource_tables",
1289
- 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.",
1290
- flags: [
1291
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1292
- { name: "datasourceId", type: "string", required: true, desc: "Datasource ID" },
1293
- { name: "catalog", type: "string", required: false, desc: "Catalog name for catalog-based datasources such as Databricks" },
1294
- { name: "database", type: "string", required: true, desc: "Database/schema name" },
1295
- { name: "env", type: "string", required: false, desc: "Environment: DEV (default) or PROD" }
1296
- ],
1297
- risk: "read",
1298
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName31, buildArgs29(ctx)),
1299
- execute: async (ctx) => {
1300
- return callDataopsApi(ctx, toolName31, buildArgs29(ctx));
1301
- }
1302
- };
1303
-
1304
- // src/commands/te-dataops/integration/get-table-structure.ts
1305
- var toolName32 = "integration_get_table_structure";
1306
- function buildArgs30(ctx) {
1307
- return {
1308
- spaceCode: ctx.str("spaceCode"),
1309
- datasourceId: ctx.str("datasourceId"),
1310
- catalog: ctx.str("catalog"),
1311
- database: ctx.str("database"),
1312
- tablePath: ctx.str("tablePath"),
1313
- env: ctx.str("env")
1314
- };
1315
- }
1316
- var getTableStructure = {
1317
- service: "dataops_integration",
1318
- command: "+get_table_structure",
1319
- description: "Get structure for a datasource table. Required: spaceCode, datasourceId, database, tablePath. Optional: catalog, env (DEV default or PROD). Returns columns and partitionColumns.",
1320
- flags: [
1321
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1322
- { name: "datasourceId", type: "string", required: true, desc: "Datasource ID" },
1323
- { name: "catalog", type: "string", required: false, desc: "Catalog name for catalog-based datasources such as Databricks" },
1324
- { name: "database", type: "string", required: true, desc: "Database name" },
1325
- { name: "tablePath", type: "string", required: true, desc: "Table name or path" },
1326
- { name: "env", type: "string", required: false, desc: "Environment: DEV (default) or PROD" }
1327
- ],
1328
- risk: "read",
1329
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName32, buildArgs30(ctx)),
1330
- execute: async (ctx) => {
1331
- return callDataopsApi(ctx, toolName32, buildArgs30(ctx));
1332
- }
1333
- };
1334
-
1335
- // src/commands/te-dataops/integration/list-sync-datasources.ts
1336
- var toolName33 = "integration_list_sync_datasources";
1337
- function buildArgs31(ctx) {
1338
- return {
1339
- spaceCode: ctx.str("spaceCode"),
1340
- env: ctx.str("env")
1341
- };
1342
- }
1343
- var listSyncDatasources = {
1344
- service: "dataops_integration",
1345
- command: "+list_sync_datasources",
1346
- 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.",
1347
- flags: [
1348
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1349
- { name: "env", type: "string", required: false, desc: "Environment: DEV (default) or PROD" }
1350
- ],
1351
- risk: "read",
1352
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName33, buildArgs31(ctx)),
1353
- execute: async (ctx) => {
1354
- return callDataopsApi(ctx, toolName33, buildArgs31(ctx));
1355
- }
1356
- };
1357
-
1358
- // src/commands/te-dataops/integration/list-datasource-databases.ts
1359
- var toolName34 = "integration_list_datasource_databases";
1360
- function buildArgs32(ctx) {
1361
- return {
1362
- spaceCode: ctx.str("spaceCode"),
1363
- datasourceId: ctx.str("datasourceId"),
1364
- catalog: ctx.str("catalog"),
1365
- env: ctx.str("env")
1366
- };
1367
- }
1368
- var listDatasourceDatabases = {
1369
- service: "dataops_integration",
1370
- command: "+list_datasource_databases",
1371
- description: "List databases/schemas under a datasource. Required: spaceCode, datasourceId. Optional: catalog, env (DEV default or PROD). Returns an array of objects with databaseName.",
1372
- flags: [
1373
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1374
- { name: "datasourceId", type: "string", required: true, desc: "Datasource ID" },
1375
- { name: "catalog", type: "string", required: false, desc: "Catalog name for catalog-based datasources such as Databricks" },
1376
- { name: "env", type: "string", required: false, desc: "Environment: DEV (default) or PROD" }
1377
- ],
1378
- risk: "read",
1379
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName34, buildArgs32(ctx)),
1380
- execute: async (ctx) => {
1381
- return callDataopsApi(ctx, toolName34, buildArgs32(ctx));
1382
- }
1383
- };
1384
-
1385
- // src/commands/te-dataops/integration/online-datasource.ts
1386
- var toolName35 = "integration_online_datasource";
1387
- function buildArgs33(ctx) {
1388
- return {
1389
- spaceCode: ctx.str("spaceCode"),
1390
- dataSourceNames: ctx.str("dataSourceNames")
1391
- };
1392
- }
1393
- var onlineDatasource = {
1394
- service: "dataops_integration",
1395
- command: "+online_datasource",
1396
- description: "Online one or more datasources. Requires spaceCode and comma-separated dataSourceNames.",
1397
- flags: [
1398
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1399
- { name: "dataSourceNames", type: "string", required: true, desc: "Datasource name list (comma-separated)" }
1400
- ],
1401
- risk: "write",
1402
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName35, buildArgs33(ctx)),
1403
- execute: async (ctx) => {
1404
- return callDataopsApi(ctx, toolName35, buildArgs33(ctx));
1405
- }
1406
- };
1407
-
1408
- // src/commands/te-dataops/integration/add-datasource.ts
1409
- var toolName36 = "integration_add_datasource";
1410
- function buildArgs34(ctx) {
1411
- return {
1412
- spaceCode: ctx.str("spaceCode"),
1413
- componentName: ctx.str("componentName"),
1414
- dataSourceName: ctx.str("dataSourceName"),
1415
- dataSourceRemark: ctx.str("dataSourceRemark"),
1416
- sharedConfig: ctx.bool("sharedConfig"),
1417
- envJsonList: ctx.str("envJsonList")
1418
- };
1419
- }
1420
- var addDatasource = {
1421
- service: "dataops_integration",
1422
- command: "+add_datasource",
1423
- 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).",
1424
- flags: [
1425
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1426
- { name: "componentName", type: "string", required: true, desc: "Datasource component name from +list_datasource_components, e.g. MySQL or ClickHouse" },
1427
- { name: "dataSourceName", type: "string", required: true, desc: "Datasource name (1-80 characters)" },
1428
- { name: "dataSourceRemark", type: "string", required: false, desc: "Datasource remark (max 200 characters)" },
1429
- { name: "sharedConfig", type: "boolean", required: true, desc: "true: one envJsonList item is copied to DEV/PROD; false: provide two items (DEV, PROD)" },
1430
- { name: "envJsonList", type: "string", required: true, desc: "JSON array string of component connection fields. Keys must match requiredFields from +get_datasource_component_template" }
1431
- ],
1432
- risk: "write",
1433
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName36, buildArgs34(ctx)),
1434
- execute: async (ctx) => {
1435
- return callDataopsApi(ctx, toolName36, buildArgs34(ctx));
1436
- }
1437
- };
1438
-
1439
- // src/commands/te-dataops/integration/modify-datasource.ts
1440
- var toolName37 = "integration_modify_datasource";
1441
- function optionalBool(ctx, name) {
1442
- const flagName = `--${name}`;
1443
- const hasFlag = process.argv.some((arg) => arg === flagName || arg.startsWith(`${flagName}=`));
1444
- if (!hasFlag) return void 0;
1445
- const raw = ctx.str(name);
1446
- return raw === "true" || raw === "1" || raw === "yes";
1447
- }
1448
- function buildArgs35(ctx) {
1449
- return {
1450
- spaceCode: ctx.str("spaceCode"),
1451
- dataSourceName: ctx.str("dataSourceName"),
1452
- dataSourceRemark: ctx.str("dataSourceRemark"),
1453
- sharedConfig: optionalBool(ctx, "sharedConfig"),
1454
- envJsonList: ctx.str("envJsonList")
1455
- };
1456
- }
1457
- var modifyDatasource = {
1458
- service: "dataops_integration",
1459
- command: "+modify_datasource",
1460
- 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.",
1461
- flags: [
1462
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1463
- { name: "dataSourceName", type: "string", required: true, desc: "Datasource name" },
1464
- { name: "dataSourceRemark", type: "string", required: false, desc: "New remark (not passed means not modified)" },
1465
- { name: "sharedConfig", type: "boolean", required: false, desc: "Whether to share configuration (not passed means not modified)" },
1466
- { name: "envJsonList", type: "string", required: false, desc: "New environment config JSON array string (not passed means not modified)" }
1467
- ],
1468
- risk: "write",
1469
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName37, buildArgs35(ctx)),
1470
- execute: async (ctx) => {
1471
- return callDataopsApi(ctx, toolName37, buildArgs35(ctx));
1472
- }
1473
- };
1474
-
1475
- // src/commands/te-dataops/integration/list-sync-solutions.ts
1476
- var toolName38 = "integration_list_sync_solutions";
1477
- function buildArgs36(ctx) {
1478
- return {
1479
- spaceCode: ctx.str("spaceCode")
1480
- };
1481
- }
1482
- var listSyncSolutions = {
1483
- service: "dataops_integration",
1484
- command: "+list_sync_solutions",
1485
- 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",
1486
- flags: [
1487
- { name: "spaceCode", type: "string", required: true, desc: "Space code" }
1488
- ],
1489
- risk: "read",
1490
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName38, buildArgs36(ctx)),
1491
- execute: async (ctx) => {
1492
- return callDataopsApi(ctx, toolName38, buildArgs36(ctx));
1493
- }
1494
- };
1495
-
1496
- // src/commands/te-dataops/integration/get-sync-detail.ts
1497
- var toolName39 = "integration_get_sync_detail";
1498
- function buildArgs37(ctx) {
1499
- return {
1500
- spaceCode: ctx.str("spaceCode"),
1501
- syncId: ctx.str("syncId"),
1502
- withParams: ctx.bool("withParams")
1503
- };
1504
- }
1505
- var getSyncDetail = {
1506
- service: "dataops_integration",
1507
- command: "+get_sync_detail",
1508
- description: "Get sync solution detail: source, sink, field mapping, last status, owner, and nextAction. Optional withParams=true also returns usedParams",
1509
- flags: [
1510
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1511
- { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1512
- { name: "withParams", type: "boolean", required: false, desc: "Also return usedParams; defaults to false" }
1513
- ],
1514
- risk: "read",
1515
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName39, buildArgs37(ctx)),
1516
- execute: async (ctx) => callDataopsApi(ctx, toolName39, buildArgs37(ctx))
1517
- };
1518
-
1519
- // src/commands/te-dataops/integration/list-sync-runs.ts
1520
- var toolName40 = "integration_list_sync_runs";
1521
- function buildArgs38(ctx) {
1522
- return {
1523
- spaceCode: ctx.str("spaceCode"),
1524
- syncId: ctx.str("syncId"),
1525
- limit: ctx.optionalNum("limit")
1526
- };
1527
- }
1528
- var listSyncRuns = {
1529
- service: "dataops_integration",
1530
- command: "+list_sync_runs",
1531
- 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",
1532
- flags: [
1533
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1534
- { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1535
- { name: "limit", type: "number", required: false, desc: "Number of results to return, defaults to 20 if not provided" }
1536
- ],
1537
- risk: "read",
1538
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName40, buildArgs38(ctx)),
1539
- execute: async (ctx) => callDataopsApi(ctx, toolName40, buildArgs38(ctx))
1540
- };
1541
-
1542
- // src/commands/te-dataops/integration/exec-sync-solution.ts
1543
- var toolName41 = "integration_exec_sync_solution";
1544
- var execSyncSolution = {
1545
- service: "dataops_integration",
1546
- command: "+exec_sync_solution",
1547
- 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",
1548
- flags: [
1549
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1550
- { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1551
- { name: "baseDate", type: "string", required: false, desc: "Optional data date for this manual run, mapped to execution parameter bd, for example 2026-06-20" },
1552
- { name: "comment", type: "string", required: false, desc: "Optional execution remark" }
1553
- ],
1554
- risk: "write",
1555
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName41, {
1556
- spaceCode: ctx.str("spaceCode"),
1557
- syncId: ctx.str("syncId"),
1558
- baseDate: ctx.str("baseDate"),
1559
- comment: ctx.str("comment")
1560
- }),
1561
- execute: async (ctx) => {
1562
- return callDataopsApi(ctx, toolName41, {
1563
- spaceCode: ctx.str("spaceCode"),
1564
- syncId: ctx.str("syncId"),
1565
- baseDate: ctx.str("baseDate"),
1566
- comment: ctx.str("comment")
1567
- });
1568
- }
1569
- };
1570
-
1571
- // src/commands/te-dataops/integration/add-sync-solution.ts
1572
- var toolName42 = "integration_add_sync_solution";
1573
- function buildArgs39(ctx) {
1574
- return {
1575
- spaceCode: ctx.str("spaceCode"),
1576
- syncName: ctx.str("syncName"),
1577
- srcComponent: ctx.str("srcComponent"),
1578
- srcDatasourceId: ctx.str("srcDatasourceId"),
1579
- sinkComponent: ctx.str("sinkComponent"),
1580
- sinkDatasourceId: ctx.str("sinkDatasourceId"),
1581
- sourceConfig: ctx.str("sourceConfig"),
1582
- sinkConfig: ctx.str("sinkConfig"),
1583
- channelConfig: ctx.str("channelConfig"),
1584
- fieldsMapping: ctx.str("fieldsMapping"),
1585
- remark: ctx.str("remark")
1586
- };
1587
- }
1588
- var addSyncSolution = {
1589
- service: "dataops_integration",
1590
- command: "+add_sync_solution",
1591
- 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.",
1592
- flags: [
1593
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1594
- { name: "syncName", type: "string", required: true, desc: "Sync solution name" },
1595
- { name: "srcComponent", type: "string", required: true, desc: "Source component name from +list_sync_datasources, e.g. te_etl, MySQL, OSS" },
1596
- { name: "srcDatasourceId", type: "string", required: true, desc: "Source datasource ID" },
1597
- { name: "sinkComponent", type: "string", required: true, desc: "Sink component name from +list_sync_datasources, e.g. te_etl, ClickHouse, MySQL" },
1598
- { name: "sinkDatasourceId", type: "string", required: true, desc: "Sink datasource ID" },
1599
- { name: "sourceConfig", type: "string", required: true, desc: "Source configuration JSON. Include component and follow the source-specific template in the ae-dataops integration skill" },
1600
- { name: "sinkConfig", type: "string", required: true, desc: "Sink configuration JSON. Include component and follow the sink-specific template in the ae-dataops integration skill" },
1601
- { name: "channelConfig", type: "string", required: false, desc: "Channel configuration JSON string. Include gatewayConfig when source or sink uses the preset warehouse" },
1602
- { name: "fieldsMapping", type: "string", required: false, desc: "Field mapping JSON string" },
1603
- { name: "remark", type: "string", required: false, desc: "Remark" }
1604
- ],
1605
- risk: "write",
1606
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName42, buildArgs39(ctx)),
1607
- execute: async (ctx) => {
1608
- return callDataopsApi(ctx, toolName42, buildArgs39(ctx));
1609
- }
1610
- };
1611
-
1612
- // src/commands/te-dataops/integration/save-sync-solution.ts
1613
- var toolName43 = "integration_save_sync_solution";
1614
- function buildArgs40(ctx) {
1615
- return {
1616
- spaceCode: ctx.str("spaceCode"),
1617
- syncId: ctx.str("syncId"),
1618
- syncName: ctx.str("syncName"),
1619
- sourceConfig: ctx.str("sourceConfig"),
1620
- sinkConfig: ctx.str("sinkConfig"),
1621
- channelConfig: ctx.str("channelConfig"),
1622
- fieldsMapping: ctx.str("fieldsMapping"),
1623
- remark: ctx.str("remark")
1624
- };
1625
- }
1626
- var saveSyncSolution = {
1627
- service: "dataops_integration",
1628
- command: "+save_sync_solution",
1629
- description: "Update a sync solution. Requires complete sourceConfig and sinkConfig JSON; not a partial patch. Call +get_sync_detail --withParams true first. syncName is accepted for compatibility but ignored",
1630
- flags: [
1631
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1632
- { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1633
- { name: "syncName", type: "string", required: false, desc: "Ignored on update; the current name is preserved" },
1634
- { name: "sourceConfig", type: "string", required: true, desc: "Complete source configuration JSON. Include component and follow the source-specific template in the ae-dataops integration skill" },
1635
- { name: "sinkConfig", type: "string", required: true, desc: "Complete sink configuration JSON. Include component and follow the sink-specific template in the ae-dataops integration skill" },
1636
- { name: "channelConfig", type: "string", required: false, desc: "Complete channel configuration JSON; pass it to keep or update custom channel settings" },
1637
- { name: "fieldsMapping", type: "string", required: false, desc: "Complete field mapping JSON; pass it to keep or update field mappings" },
1638
- { name: "remark", type: "string", required: false, desc: "Updated remark" }
1639
- ],
1640
- risk: "write",
1641
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName43, buildArgs40(ctx)),
1642
- execute: async (ctx) => callDataopsApi(ctx, toolName43, buildArgs40(ctx))
1643
- };
1644
-
1645
- // src/commands/te-dataops/integration/stop-sync-solution.ts
1646
- var toolName44 = "integration_stop_sync_solution";
1647
- function buildArgs41(ctx) {
1648
- return {
1649
- spaceCode: ctx.str("spaceCode"),
1650
- syncId: ctx.str("syncId"),
1651
- taskId: ctx.str("taskId")
1652
- };
1653
- }
1654
- var stopSyncSolution = {
1655
- service: "dataops_integration",
1656
- command: "+stop_sync_solution",
1657
- 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",
1658
- flags: [
1659
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1660
- { name: "syncId", type: "string", required: true, desc: "Sync solution ID" },
1661
- { name: "taskId", type: "string", required: true, desc: "Running execution task ID from +list_sync_runs" }
1662
- ],
1663
- risk: "write",
1664
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName44, buildArgs41(ctx)),
1665
- execute: async (ctx) => callDataopsApi(ctx, toolName44, buildArgs41(ctx))
1666
- };
1667
-
1668
- // src/commands/te-dataops/integration/index.ts
1669
- var commands3 = [
1670
- listDatasourceComponents,
1671
- getDatasourceComponentTemplate,
1672
- listSpaceDatasources,
1673
- getDatasourceDetail,
1674
- testDatasourceConnect,
1675
- listDatasourceTables,
1676
- getTableStructure,
1677
- listSyncDatasources,
1678
- listDatasourceDatabases,
1679
- onlineDatasource,
1680
- addDatasource,
1681
- modifyDatasource,
1682
- listSyncSolutions,
1683
- getSyncDetail,
1684
- listSyncRuns,
1685
- execSyncSolution,
1686
- addSyncSolution,
1687
- saveSyncSolution,
1688
- stopSyncSolution
1689
- ];
1690
- var integration_default = commands3;
1691
-
1692
- // src/commands/te-dataops/operations/get-flow-instance-detail.ts
1693
- var toolName45 = "operations_get_flow_instance_detail";
1694
- function buildArgs42(ctx) {
1695
- return {
1696
- spaceCode: ctx.str("spaceCode"),
1697
- flowCode: ctx.num("flowCode"),
1698
- flowInstanceId: ctx.num("flowInstanceId")
1699
- };
1700
- }
1701
- var getFlowInstanceDetail = {
1702
- service: "dataops_operations",
1703
- command: "+get_flow_instance_detail",
1704
- 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.",
1705
- flags: [
1706
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1707
- { name: "flowCode", type: "number", required: true, desc: "Task flow code from +search_flow_instances" },
1708
- { name: "flowInstanceId", type: "number", required: true, desc: "Workflow instance ID from +search_flow_instances" }
1709
- ],
1710
- risk: "read",
1711
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName45, buildArgs42(ctx)),
1712
- execute: async (ctx) => {
1713
- return callDataopsApi(ctx, toolName45, buildArgs42(ctx));
1714
- }
1715
- };
1716
-
1717
- // src/commands/te-dataops/operations/get-task-instance-detail.ts
1718
- var toolName46 = "operations_get_task_instance_detail";
1719
- function optionalBool2(ctx, name) {
1720
- return ctx.str(name) === "" ? void 0 : ctx.bool(name);
1721
- }
1722
- function buildArgs43(ctx) {
1723
- return {
1724
- spaceCode: ctx.str("spaceCode"),
1725
- flowCode: ctx.num("flowCode"),
1726
- flowInstanceId: ctx.num("flowInstanceId"),
1727
- taskInstanceId: ctx.optionalNum("taskInstanceId"),
1728
- taskCode: ctx.optionalNum("taskCode"),
1729
- taskName: ctx.str("taskName"),
1730
- includeLog: optionalBool2(ctx, "includeLog")
1731
- };
1732
- }
1733
- var getTaskInstanceDetail = {
1734
- service: "dataops_operations",
1735
- command: "+get_task_instance_detail",
1736
- description: "Get one task instance detail. Requires spaceCode, flowCode, flowInstanceId, and one selector: taskInstanceId, taskCode, or exact taskName. taskInstanceId is the precise selector for retried tasks and wins when passed. includeLog defaults to false.",
1737
- flags: [
1738
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1739
- { name: "flowCode", type: "number", required: true, desc: "Task flow code from +search_flow_instances" },
1740
- { name: "flowInstanceId", type: "number", required: true, desc: "Workflow instance ID from +search_flow_instances" },
1741
- { name: "taskInstanceId", type: "number", required: false, desc: "Task instance ID; preferred selector for retried tasks" },
1742
- { name: "taskCode", type: "number", required: false, desc: "Task code; used when taskInstanceId is omitted" },
1743
- { name: "taskName", type: "string", required: false, desc: "Exact task name, case-insensitive; used only when taskInstanceId and taskCode are omitted" },
1744
- { name: "includeLog", type: "boolean", required: false, desc: "Whether to include task logs. Default false" }
1745
- ],
1746
- risk: "read",
1747
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName46, buildArgs43(ctx)),
1748
- execute: async (ctx) => {
1749
- return callDataopsApi(ctx, toolName46, buildArgs43(ctx));
1750
- }
1751
- };
1752
-
1753
- // src/commands/te-dataops/operations/search-flow-instances.ts
1754
- var toolName47 = "operations_search_flow_instances";
1755
- function buildArgs44(ctx) {
1756
- return {
1757
- spaceCode: ctx.str("spaceCode"),
1758
- keyword: ctx.str("keyword"),
1759
- startDate: ctx.str("startDate"),
1760
- endDate: ctx.str("endDate"),
1761
- status: ctx.str("status"),
1762
- pageNum: ctx.optionalNum("pageNum"),
1763
- pageSize: ctx.optionalNum("pageSize")
1764
- };
1765
- }
1766
- var searchFlowInstances = {
1767
- service: "dataops_operations",
1768
- command: "+search_flow_instances",
1769
- 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.",
1770
- flags: [
1771
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1772
- { name: "keyword", type: "string", required: false, desc: "Optional keyword; fuzzy matches instance ID, workflow name, and workflow remark" },
1773
- { name: "startDate", type: "string", required: false, desc: "Optional execution start date, yyyy-MM-dd" },
1774
- { name: "endDate", type: "string", required: false, desc: "Optional execution end date, yyyy-MM-dd" },
1775
- { name: "status", type: "string", required: false, desc: "Optional comma-separated statuses: WAITING,RUNNING,SUCCESS,FAIL,READY_PAUSE,PAUSE,STOP" },
1776
- { name: "pageNum", type: "number", required: false, desc: "Optional page number; default 1" },
1777
- { name: "pageSize", type: "number", required: false, desc: "Optional page size; default 20, max 100" }
1778
- ],
1779
- risk: "read",
1780
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName47, buildArgs44(ctx)),
1781
- execute: async (ctx) => {
1782
- return callDataopsApi(ctx, toolName47, buildArgs44(ctx));
1783
- }
1784
- };
1785
-
1786
- // src/commands/te-dataops/operations/stop-flow-instance.ts
1787
- var toolName48 = "operations_stop_flow_instance";
1788
- function buildArgs45(ctx) {
1789
- const executeId = ctx.optionalNum("executeId");
1790
- const flowInstanceId = ctx.optionalNum("flowInstanceId");
1791
- if (executeId == null && flowInstanceId == null || executeId != null && flowInstanceId != null) {
1792
- throw new Error("Pass exactly one of --executeId or --flowInstanceId");
1793
- }
1794
- if (executeId != null && executeId <= 0 || flowInstanceId != null && flowInstanceId <= 0) {
1795
- throw new Error("--executeId and --flowInstanceId must be positive numbers");
1796
- }
1797
- return {
1798
- spaceCode: ctx.str("spaceCode"),
1799
- flowCode: ctx.num("flowCode"),
1800
- executeId,
1801
- flowInstanceId
1802
- };
1803
- }
1804
- var stopFlowInstance = {
1805
- service: "dataops_operations",
1806
- command: "+stop_flow_instance",
1807
- 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.",
1808
- flags: [
1809
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1810
- { name: "flowCode", type: "number", required: true, desc: "Task flow code" },
1811
- { name: "executeId", type: "number", required: false, desc: "Execution ID from dataops_flow +execute_flow; use before flowInstanceId is available" },
1812
- { name: "flowInstanceId", type: "number", required: false, desc: "Workflow instance ID returned by dataops_operations +search_flow_instances" }
1813
- ],
1814
- risk: "write",
1815
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName48, buildArgs45(ctx)),
1816
- execute: async (ctx) => {
1817
- return callDataopsApi(ctx, toolName48, buildArgs45(ctx));
1818
- }
1819
- };
1820
-
1821
- // src/commands/te-dataops/operations/index.ts
1822
- var commands4 = [
1823
- searchFlowInstances,
1824
- getFlowInstanceDetail,
1825
- getTaskInstanceDetail,
1826
- stopFlowInstance
1827
- ];
1828
- var operations_default = commands4;
1829
-
1830
- // src/commands/te-dataops/repo/list-spaces.ts
1831
- var toolName49 = "repo_list_spaces";
1832
- var listSpaces = {
1833
- service: "dataops_repo",
1834
- command: "+list_spaces",
1835
- 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.",
1836
- flags: [],
1837
- risk: "read",
1838
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName49, {}),
1839
- execute: async (ctx) => {
1840
- return callDataopsApi(ctx, toolName49, {});
1841
- }
1842
- };
1843
-
1844
- // src/commands/te-dataops/repo/index.ts
1845
- var commands5 = [
1846
- listSpaces
1847
- ];
1848
- var repo_default = commands5;
1849
-
1850
- // src/commands/te-dataops/ide/cancel-sql-query.ts
1851
- var toolName50 = "ide_cancel_sql_query";
1852
- function optionalString4(ctx, name) {
1853
- const value = ctx.str(name);
1854
- return value === "" ? void 0 : value;
1855
- }
1856
- function buildArgs46(ctx) {
1857
- return {
1858
- spaceCode: ctx.str("spaceCode"),
1859
- downloadTaskId: ctx.num("downloadTaskId"),
1860
- requestId: optionalString4(ctx, "requestId")
1861
- };
1862
- }
1863
- var cancelSqlQuery = {
1864
- service: "dataops_ide",
1865
- command: "+cancel_sql_query",
1866
- 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.",
1867
- flags: [
1868
- { name: "spaceCode", type: "string", required: true, desc: "Space code returned by +submit_sql_query" },
1869
- { name: "downloadTaskId", type: "number", required: true, desc: "Download task ID returned by +submit_sql_query or +get_sql_query_status" },
1870
- { name: "requestId", type: "string", required: false, desc: "Optional request ID returned by +submit_sql_query, used only for trace display" }
1871
- ],
1872
- risk: "write",
1873
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName50, buildArgs46(ctx)),
1874
- execute: async (ctx) => callDataopsApi(ctx, toolName50, buildArgs46(ctx))
1875
- };
1876
-
1877
- // src/commands/te-dataops/ide/get-sql-query-status.ts
1878
- var toolName51 = "ide_get_sql_query_status";
1879
- var downloadPath = "/api/cli/dataops/v1/gaia/ide/sql-query-download";
1880
- function optionalString5(ctx, name) {
1881
- const value = ctx.str(name);
1882
- return value === "" ? void 0 : value;
1883
- }
1884
- function buildArgs47(ctx) {
1885
- return {
1886
- spaceCode: ctx.str("spaceCode"),
1887
- downloadTaskId: ctx.num("downloadTaskId"),
1888
- requestId: optionalString5(ctx, "requestId")
1889
- };
1890
- }
1891
- function isDownloadReady(data) {
1892
- return data?.downloadStatus === "SUCCESS" || data?.downloadStatus === "async_ok";
1893
- }
1894
- async function downloadResult(ctx, data, targetPath) {
1895
- const params = data?.downloadParams ?? {};
1896
- return downloadDataopsApi(ctx, downloadPath, {
1897
- spaceCode: params.spaceCode,
1898
- taskId: params.taskId
1899
- }, targetPath);
1900
- }
1901
- var getSqlQueryStatus = {
1902
- service: "dataops_ide",
1903
- command: "+get_sql_query_status",
1904
- 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 streams the result zip to a local file after SUCCESS and adds localFile.",
1905
- flags: [
1906
- { name: "spaceCode", type: "string", required: true, desc: "Space code returned by +submit_sql_query" },
1907
- { name: "downloadTaskId", type: "number", required: true, desc: "Download task ID returned by +submit_sql_query" },
1908
- { name: "requestId", type: "string", required: false, desc: "Optional request ID returned by +submit_sql_query, used only for trace display" },
1909
- { name: "downloadTo", type: "string", required: false, desc: "Optional local file path. After SUCCESS, stream the result zip and replace this path only when the download completes; use a .zip suffix, for example ./result.zip." }
1910
- ],
1911
- risk: "read",
1912
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName51, buildArgs47(ctx)),
1913
- execute: async (ctx) => {
1914
- const data = await callDataopsApi(ctx, toolName51, buildArgs47(ctx));
1915
- const downloadTo = optionalString5(ctx, "downloadTo");
1916
- if (downloadTo && isDownloadReady(data)) {
1917
- return { ...data, localFile: await downloadResult(ctx, data, downloadTo) };
1918
- }
1919
- return data;
1920
- }
1921
- };
1922
-
1923
- // src/commands/te-dataops/ide/list-catalogs.ts
1924
- var toolName52 = "ide_list_catalogs";
1925
- function optionalString6(ctx, name) {
1926
- const value = ctx.str(name);
1927
- return value === "" ? void 0 : value;
1928
- }
1929
- function buildArgs48(ctx) {
1930
- return {
1931
- spaceCode: ctx.str("spaceCode"),
1932
- connType: optionalString6(ctx, "connType"),
1933
- repoCode: optionalString6(ctx, "repoCode")
1934
- };
1935
- }
1936
- var listCatalogs = {
1937
- service: "dataops_ide",
1938
- command: "+ide_list_catalogs",
1939
- 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.",
1940
- flags: [
1941
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1942
- { name: "connType", type: "string", required: false, desc: "Optional connection type: SPACE, ETL, or APP. Default SPACE" },
1943
- { name: "repoCode", type: "string", required: false, desc: "Optional repository code. Default te_etl" }
1944
- ],
1945
- risk: "read",
1946
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName52, buildArgs48(ctx)),
1947
- execute: async (ctx) => {
1948
- return callDataopsApi(ctx, toolName52, buildArgs48(ctx));
1949
- }
1950
- };
1951
-
1952
- // src/commands/te-dataops/ide/get-schema-info.ts
1953
- var toolName53 = "ide_get_schema_info";
1954
- function optionalString7(ctx, name) {
1955
- const value = ctx.str(name);
1956
- return value === "" ? void 0 : value;
1957
- }
1958
- function buildArgs49(ctx) {
1959
- return {
1960
- spaceCode: ctx.str("spaceCode"),
1961
- connType: optionalString7(ctx, "connType"),
1962
- repoCode: optionalString7(ctx, "repoCode"),
1963
- catalog: ctx.str("catalog"),
1964
- schema: ctx.str("schema")
1965
- };
1966
- }
1967
- function schemaStats(data) {
1968
- if (!data || typeof data !== "object" || Array.isArray(data)) {
1969
- return data;
1970
- }
1971
- const value = data;
1972
- return {
1973
- schema: value.schema,
1974
- tableNum: value.tableNum,
1975
- viewNum: value.viewNum
1976
- };
1977
- }
1978
- var getSchemaInfo = {
1979
- service: "dataops_ide",
1980
- command: "+get_schema_info",
1981
- 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.",
1982
- flags: [
1983
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
1984
- { 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." },
1985
- { name: "repoCode", type: "string", required: false, desc: "Repository code. Defaults to te_etl. Use +ide_list_repos to discover other repositories." },
1986
- { name: "catalog", type: "string", required: true, desc: "Catalog name" },
1987
- { name: "schema", type: "string", required: true, desc: "Schema name" }
1988
- ],
1989
- risk: "read",
1990
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName53, buildArgs49(ctx)),
1991
- execute: async (ctx) => {
1992
- return schemaStats(await callDataopsApi(ctx, toolName53, buildArgs49(ctx)));
1993
- }
1994
- };
1995
-
1996
- // src/commands/te-dataops/ide/get-table-detail.ts
1997
- var toolName54 = "ide_get_table_detail";
1998
- function optionalString8(ctx, name) {
1999
- const value = ctx.str(name);
2000
- return value === "" ? void 0 : value;
2001
- }
2002
- function optionalBool3(ctx, name) {
2003
- const value = ctx.json(name);
2004
- return value === void 0 ? void 0 : Boolean(value);
2005
- }
2006
- function optionalEntityType(ctx) {
2007
- const value = optionalString8(ctx, "entityType");
2008
- return value === void 0 ? void 0 : value.toUpperCase();
2009
- }
2010
- function buildArgs50(ctx) {
2011
- return {
2012
- spaceCode: ctx.str("spaceCode"),
2013
- connType: optionalString8(ctx, "connType"),
2014
- repoCode: optionalString8(ctx, "repoCode"),
2015
- catalog: ctx.str("catalog"),
2016
- schema: ctx.str("schema"),
2017
- tableName: ctx.str("tableName"),
2018
- engineType: optionalString8(ctx, "engineType"),
2019
- entityType: optionalEntityType(ctx),
2020
- includeDdl: optionalBool3(ctx, "includeDdl")
2021
- };
2022
- }
2023
- var getTableDetail2 = {
2024
- service: "dataops_ide",
2025
- command: "+ide_get_table_detail",
2026
- 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.",
2027
- flags: [
2028
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
2029
- { name: "connType", type: "string", required: false, desc: "Optional connection type: SPACE, ETL, or APP. Default SPACE" },
2030
- { name: "repoCode", type: "string", required: false, desc: "Optional repository code. Default te_etl" },
2031
- { name: "catalog", type: "string", required: true, desc: "Catalog name" },
2032
- { name: "schema", type: "string", required: true, desc: "Schema name" },
2033
- { name: "tableName", type: "string", required: true, desc: "Table or view name" },
2034
- { name: "engineType", type: "string", required: false, desc: "Optional engine type. Default TASK_ENGINE_TRINO" },
2035
- { name: "entityType", type: "string", required: false, desc: "Optional type hint: TABLE or VIEW. Omit to auto-detect" },
2036
- { name: "includeDdl", type: "boolean", required: false, desc: "Optional include tableDdl. Default false" }
2037
- ],
2038
- risk: "read",
2039
- validate: (ctx) => {
2040
- const entityType = optionalEntityType(ctx);
2041
- if (entityType !== void 0 && entityType !== "TABLE" && entityType !== "VIEW") {
2042
- throw new Error("entityType must be TABLE or VIEW");
2043
- }
2044
- },
2045
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName54, buildArgs50(ctx)),
2046
- execute: async (ctx) => {
2047
- return callDataopsApi(ctx, toolName54, buildArgs50(ctx));
2048
- }
2049
- };
2050
-
2051
- // src/commands/te-dataops/ide/search-tables.ts
2052
- var toolName55 = "ide_search_tables";
2053
- function optionalString9(ctx, name) {
2054
- const value = ctx.str(name);
2055
- return value === "" ? void 0 : value;
2056
- }
2057
- function buildArgs51(ctx) {
2058
- return {
2059
- spaceCode: ctx.str("spaceCode"),
2060
- connType: optionalString9(ctx, "connType"),
2061
- repoCode: optionalString9(ctx, "repoCode"),
2062
- searchKey: ctx.str("searchKey"),
2063
- size: ctx.optionalNum("size")
2064
- };
2065
- }
2066
- var searchTables = {
2067
- service: "dataops_ide",
2068
- command: "+search_tables",
2069
- 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.",
2070
- flags: [
2071
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
2072
- { name: "connType", type: "string", required: false, desc: "Optional connection type: SPACE, ETL, or APP. Default SPACE" },
2073
- { name: "repoCode", type: "string", required: false, desc: "Optional repository code. Default te_etl" },
2074
- { name: "searchKey", type: "string", required: true, desc: "Precise table or view keyword to search in engine-side metadata" },
2075
- { name: "size", type: "number", required: false, desc: "Optional maximum results. Default 20" }
2076
- ],
2077
- risk: "read",
2078
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName55, buildArgs51(ctx)),
2079
- execute: async (ctx) => {
2080
- return callDataopsApi(ctx, toolName55, buildArgs51(ctx));
2081
- }
2082
- };
2083
-
2084
- // src/commands/te-dataops/ide/list-repos.ts
2085
- var toolName56 = "ide_list_repos";
2086
- function buildArgs52(ctx) {
2087
- return {
2088
- spaceCode: ctx.str("spaceCode")
2089
- };
2090
- }
2091
- var listRepos = {
2092
- service: "dataops_ide",
2093
- command: "+ide_list_repos",
2094
- description: "List available IDE warehouse repositories for one space. Requires spaceCode. Returns an array grouped by connType: [{ connType, repos: [{ repoCode, repoDesc, engineTypes }] }].",
2095
- flags: [
2096
- { name: "spaceCode", type: "string", required: true, desc: "Space code" }
2097
- ],
2098
- risk: "read",
2099
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName56, buildArgs52(ctx)),
2100
- execute: async (ctx) => {
2101
- return callDataopsApi(ctx, toolName56, buildArgs52(ctx));
2102
- }
2103
- };
2104
-
2105
- // src/commands/te-dataops/ide/list-tables.ts
2106
- var toolName57 = "ide_list_tables";
2107
- function optionalString10(ctx, name) {
2108
- const value = ctx.str(name);
2109
- return value === "" ? void 0 : value;
2110
- }
2111
- function optionalEntityType2(ctx) {
2112
- const value = optionalString10(ctx, "entityType");
2113
- return value === void 0 ? void 0 : value.toUpperCase();
2114
- }
2115
- function buildArgs53(ctx) {
2116
- return {
2117
- spaceCode: ctx.str("spaceCode"),
2118
- connType: optionalString10(ctx, "connType"),
2119
- repoCode: optionalString10(ctx, "repoCode"),
2120
- catalog: ctx.str("catalog"),
2121
- schema: ctx.str("schema"),
2122
- entityType: optionalEntityType2(ctx),
2123
- pageNum: ctx.optionalNum("pageNum"),
2124
- pageSize: ctx.optionalNum("pageSize")
2125
- };
2126
- }
2127
- var listTables = {
2128
- service: "dataops_ide",
2129
- command: "+ide_list_tables",
2130
- 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.",
2131
- flags: [
2132
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
2133
- { name: "connType", type: "string", required: false, desc: "Optional connection type: SPACE, ETL, or APP. Default SPACE" },
2134
- { name: "repoCode", type: "string", required: false, desc: "Optional repository code. Default te_etl" },
2135
- { name: "catalog", type: "string", required: true, desc: "Catalog name" },
2136
- { name: "schema", type: "string", required: true, desc: "Schema name" },
2137
- { name: "entityType", type: "string", required: false, desc: "Optional entity type: TABLE or VIEW. Default TABLE" },
2138
- { name: "pageNum", type: "number", required: false, desc: "Optional page number. Default 1" },
2139
- { name: "pageSize", type: "number", required: false, desc: "Optional page size. Default 20" }
2140
- ],
2141
- risk: "read",
2142
- validate: (ctx) => {
2143
- const entityType = optionalEntityType2(ctx);
2144
- if (entityType !== void 0 && entityType !== "TABLE" && entityType !== "VIEW") {
2145
- throw new Error("entityType must be TABLE or VIEW");
2146
- }
2147
- },
2148
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName57, buildArgs53(ctx)),
2149
- execute: async (ctx) => {
2150
- return callDataopsApi(ctx, toolName57, buildArgs53(ctx));
2151
- }
2152
- };
2153
-
2154
- // src/commands/te-dataops/ide/submit-sql-query.ts
2155
- var toolName58 = "ide_submit_sql_query";
2156
- function optionalString11(ctx, name) {
2157
- const value = ctx.str(name);
2158
- return value === "" ? void 0 : value;
2159
- }
2160
- function buildArgs54(ctx) {
2161
- return {
2162
- spaceCode: ctx.str("spaceCode"),
2163
- repoCode: optionalString11(ctx, "repoCode"),
2164
- sql: ctx.str("sql"),
2165
- engineType: optionalString11(ctx, "engineType")
2166
- };
2167
- }
2168
- var submitSqlQuery = {
2169
- service: "dataops_ide",
2170
- command: "+submit_sql_query",
2171
- description: "Submit exactly one read-only IDE SQL query and create a Gaia download-center task. Optional repoCode/engineType default to te_etl/TASK_ENGINE_TRINO. Results are platform-bounded; Gaia returns downloadRowLimit when supported, and rows are never returned by MCP/CLI.",
2172
- flags: [
2173
- { name: "spaceCode", type: "string", required: true, desc: "Space code" },
2174
- { name: "sql", type: "string", required: true, desc: "Exactly one read-only SQL query" },
2175
- { name: "repoCode", type: "string", required: false, desc: "Repository code. Defaults to te_etl." },
2176
- { name: "engineType", type: "string", required: false, desc: "SQL execution engine. Defaults to TASK_ENGINE_TRINO. Optional: TASK_ENGINE_STARROCKS." }
2177
- ],
2178
- risk: "read",
2179
- dryRun: (ctx) => buildDataopsApiDryRun(ctx, toolName58, buildArgs54(ctx)),
2180
- execute: async (ctx) => callDataopsApi(ctx, toolName58, buildArgs54(ctx))
2181
- };
2182
-
2183
- // src/commands/te-dataops/ide/index.ts
2184
- var commands6 = [
2185
- cancelSqlQuery,
2186
- getSqlQueryStatus,
2187
- submitSqlQuery,
2188
- listCatalogs,
2189
- getSchemaInfo,
2190
- getTableDetail2,
2191
- searchTables,
2192
- listRepos,
2193
- listTables
2194
- ];
2195
- var ide_default = commands6;
2196
-
2197
- // src/commands/te-dataops/index.ts
2198
- var commands7 = [
2199
- ...datatable_default,
2200
- ...flow_default,
2201
- ...integration_default,
2202
- ...operations_default,
2203
- ...repo_default,
2204
- ...ide_default
2205
- ];
2206
- var te_dataops_default = commands7;
2207
- export {
2208
- te_dataops_default as default
2209
- };