@thinkingai/ae-cli 6.0.22 → 6.0.24
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.
- package/dist/{auth-RDN6D5HU.js → auth-A2XXG5K4.js} +7 -11
- package/dist/auth-IDPKDFSY.js +13 -0
- package/dist/{chunk-4EUZRJPO.js → chunk-2OW2RENH.js} +40 -10
- package/dist/{chunk-H52CSLJW.js → chunk-4FQ36OGO.js} +4 -4
- package/dist/chunk-AKORWVHJ.js +59 -0
- package/dist/{chunk-E34XH4GW.js → chunk-F3ZDMC2W.js} +8 -8
- package/dist/chunk-FIT4CFIN.js +59 -0
- package/dist/{chunk-2W7HULUD.js → chunk-IDXW6MEJ.js} +2 -2
- package/dist/{chunk-5FBLRSMU.js → chunk-NGJDCOYA.js} +3 -3
- package/dist/chunk-NXJP4CES.js +209 -0
- package/dist/{chunk-FPE5LGVU.js → chunk-OCQPQYHZ.js} +2 -2
- package/dist/{chunk-YACCPUNQ.js → chunk-ONOA6DYB.js} +1 -1
- package/dist/{chunk-U6QPKCN3.js → chunk-PFJFZVCK.js} +8 -115
- package/dist/chunk-V5R5UIRM.js +195 -0
- package/dist/{chunk-XE2PI5DS.js → chunk-WXBCP6SD.js} +1 -1
- package/dist/{cli-token-6AGEDJF4.js → cli-token-OZXHC3U2.js} +3 -3
- package/dist/{client-VTJMUZ4O.js → client-7L735LVY.js} +3 -3
- package/dist/{config-2SDTLGOC.js → config-SXD2JKSL.js} +3 -3
- package/dist/index.js +27 -24
- package/dist/{metadata-JZ2OTWBK.js → metadata-QWUAX625.js} +56 -65
- package/dist/metadata-XWTEGEN2.js +411 -0
- package/dist/{model-ZYMRN4VS.js → model-3OVX42DA.js} +2 -2
- package/dist/{raw-NGYHAL3F.js → raw-IANB4AV5.js} +4 -4
- package/dist/{sync-JVLX6TGW.js → sync-4HQ3CXSK.js} +3 -3
- package/dist/{te-agent-QPZTLHPH.js → te-agent-OYNNTJDU.js} +2 -2
- package/dist/{te-analysis-WWX3Z6RP.js → te-analysis-CRPFK3LX.js} +1074 -340
- package/dist/te-analysis-JX3V76OI.js +2281 -0
- package/dist/{te-audience-UXGHUVBB.js → te-audience-77FGNG5E.js} +5 -5
- package/dist/te-audience-RO2IZOUC.js +599 -0
- package/dist/{te-common-7XXH73MF.js → te-common-4TRJPRC5.js} +5 -5
- package/dist/te-common-PUXBUPOL.js +130 -0
- package/dist/{te-community-QKE67HR2.js → te-community-NPDZQKMY.js} +5 -5
- package/dist/te-community-XKE526DS.js +687 -0
- package/dist/{te-dataops-6W7NNYST.js → te-dataops-6KWLFNV4.js} +5 -5
- package/dist/te-dataops-PW74WP76.js +1842 -0
- package/dist/{te-engage-NCFAQFX3.js → te-engage-HTLMUN7G.js} +5 -5
- package/dist/te-engage-YPQIVF5H.js +1510 -0
- package/dist/{te-kb-K5BQYUCM.js → te-kb-DOGDQIU4.js} +4 -4
- package/dist/{te-meta-LJZBOSMO.js → te-meta-5ESSQ5B3.js} +5 -5
- package/dist/te-meta-Z47X4VT3.js +595 -0
- package/dist/{te-team-DHK5R7MV.js → te-team-SOVKZIDD.js} +5 -5
- package/package.json +1 -1
- package/skills/ae-analysis/SKILL.md +51 -25
- package/skills/ae-analysis/references/analysis_gateway_assets.md +114 -0
- package/skills/ae-analysis/references/bi_panel_copy.md +15 -0
- package/skills/ae-analysis/references/bi_panel_create.md +15 -0
- package/skills/ae-analysis/references/bi_panel_delete.md +15 -0
- package/skills/ae-analysis/references/bi_panel_get.md +18 -0
- package/skills/ae-analysis/references/bi_panel_list.md +15 -0
- package/skills/ae-analysis/references/bi_panel_page_data_export.md +15 -0
- package/skills/ae-analysis/references/bi_panel_page_data_run.md +15 -0
- package/skills/ae-analysis/references/bi_panel_share.md +15 -0
- package/skills/ae-analysis/references/bi_panel_update.md +15 -0
- package/skills/ae-analysis/references/dashboard_abnormal_get.md +15 -0
- package/skills/ae-analysis/references/dashboard_copy.md +15 -0
- package/skills/ae-analysis/references/dashboard_create.md +15 -0
- package/skills/ae-analysis/references/dashboard_daily_report_send.md +15 -0
- package/skills/ae-analysis/references/dashboard_daily_report_update.md +15 -0
- package/skills/ae-analysis/references/dashboard_definition_export.md +15 -0
- package/skills/ae-analysis/references/dashboard_definition_import.md +15 -0
- package/skills/ae-analysis/references/dashboard_delete.md +15 -0
- package/skills/ae-analysis/references/dashboard_freeze.md +15 -0
- package/skills/ae-analysis/references/dashboard_get.md +15 -0
- package/skills/ae-analysis/references/dashboard_handover.md +15 -0
- package/skills/ae-analysis/references/dashboard_list.md +15 -0
- package/skills/ae-analysis/references/dashboard_report_data_export.md +15 -0
- package/skills/ae-analysis/references/dashboard_report_data_run.md +15 -0
- package/skills/ae-analysis/references/dashboard_share.md +15 -0
- package/skills/ae-analysis/references/dashboard_share_info.md +15 -0
- package/skills/ae-analysis/references/dashboard_task_status.md +15 -0
- package/skills/ae-analysis/references/dashboard_update.md +16 -0
- package/skills/ae-analysis/references/favorite_add.md +15 -0
- package/skills/ae-analysis/references/favorite_remove.md +15 -0
- package/skills/ae-analysis/references/folder_create.md +15 -0
- package/skills/ae-analysis/references/folder_delete.md +15 -0
- package/skills/ae-analysis/references/folder_members.md +15 -0
- package/skills/ae-analysis/references/folder_share.md +15 -0
- package/skills/ae-analysis/references/project_space_create.md +15 -0
- package/skills/ae-analysis/references/project_space_delete.md +15 -0
- package/skills/ae-analysis/references/project_space_get.md +18 -0
- package/skills/ae-analysis/references/project_space_list.md +15 -0
- package/skills/ae-analysis/references/project_space_members.md +15 -0
- package/skills/ae-analysis/references/project_space_share.md +15 -0
- package/skills/ae-analysis/references/public_link_create.md +15 -0
- package/skills/ae-analysis/references/public_link_delete.md +15 -0
- package/skills/ae-analysis/references/public_link_list.md +15 -0
- package/skills/ae-analysis/references/public_link_offline.md +15 -0
- package/skills/ae-analysis/references/public_link_update.md +15 -0
- package/skills/ae-analysis/references/query_cancel.md +15 -0
- package/skills/ae-metadata/references/metadata_data_table_csv_write.md +5 -3
- package/skills/ae-metadata/references/metadata_data_table_sql_write.md +5 -4
- package/skills/ae-metadata/references/metadata_property_dimension_table_create_and_bind_csv.md +5 -3
- package/dist/auth-I2G7OAU2.js +0 -19
- package/dist/{chunk-WPXHCP4A.js → chunk-65DKFJZB.js} +3 -3
|
@@ -0,0 +1,2281 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createCapabilityCommand,
|
|
3
|
+
registerCapabilityGatewayRoute
|
|
4
|
+
} from "./chunk-AKORWVHJ.js";
|
|
5
|
+
import "./chunk-V5R5UIRM.js";
|
|
6
|
+
import {
|
|
7
|
+
callMcpTool,
|
|
8
|
+
parseMcpResult,
|
|
9
|
+
resolveMcpUrl
|
|
10
|
+
} from "./chunk-NXJP4CES.js";
|
|
11
|
+
import {
|
|
12
|
+
isGlobalQueryModeEnabled
|
|
13
|
+
} from "./chunk-WXBCP6SD.js";
|
|
14
|
+
import "./chunk-NOO24N7W.js";
|
|
15
|
+
import "./chunk-OCQPQYHZ.js";
|
|
16
|
+
import "./chunk-PFJFZVCK.js";
|
|
17
|
+
import "./chunk-65DKFJZB.js";
|
|
18
|
+
|
|
19
|
+
// src/commands/te-analysis/shared.ts
|
|
20
|
+
function createMcpCommand(config) {
|
|
21
|
+
const toolName = config.command.slice(1);
|
|
22
|
+
const mcpService = config.mcpService || "analysis";
|
|
23
|
+
return {
|
|
24
|
+
service: "analysis",
|
|
25
|
+
command: config.command,
|
|
26
|
+
description: config.description,
|
|
27
|
+
flags: config.flags,
|
|
28
|
+
risk: config.risk,
|
|
29
|
+
validate: config.validate,
|
|
30
|
+
dryRun: (ctx) => ({
|
|
31
|
+
method: "tools/call",
|
|
32
|
+
url: resolveMcpUrl(ctx.mcpUrl(), ctx.host(), mcpService),
|
|
33
|
+
body: {
|
|
34
|
+
name: toolName,
|
|
35
|
+
arguments: config.buildArgs(ctx)
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
execute: async (ctx) => {
|
|
39
|
+
const url = resolveMcpUrl(ctx.mcpUrl(), ctx.host(), mcpService);
|
|
40
|
+
const result = await callMcpTool(url, toolName, config.buildArgs(ctx), ctx.host());
|
|
41
|
+
return parseMcpResult(result);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function optionalString(ctx, name) {
|
|
46
|
+
const value = ctx.str(name);
|
|
47
|
+
return value === "" ? void 0 : value;
|
|
48
|
+
}
|
|
49
|
+
function optionalNumber(ctx, name) {
|
|
50
|
+
const value = ctx.str(name);
|
|
51
|
+
return value === "" ? void 0 : Number(value);
|
|
52
|
+
}
|
|
53
|
+
function optionalBoolean(ctx, name) {
|
|
54
|
+
const value = ctx.str(name);
|
|
55
|
+
return value === "" ? void 0 : ctx.bool(name);
|
|
56
|
+
}
|
|
57
|
+
function optionalJson(ctx, name) {
|
|
58
|
+
const value = ctx.str(name);
|
|
59
|
+
return value === "" ? void 0 : ctx.json(name);
|
|
60
|
+
}
|
|
61
|
+
function optionalJsonString(ctx, name) {
|
|
62
|
+
const value = optionalJson(ctx, name);
|
|
63
|
+
return value === void 0 ? void 0 : JSON.stringify(value);
|
|
64
|
+
}
|
|
65
|
+
function requiredJsonString(ctx, name) {
|
|
66
|
+
return JSON.stringify(ctx.json(name));
|
|
67
|
+
}
|
|
68
|
+
function clusterQueryFlags(scopeDesc) {
|
|
69
|
+
if (!isGlobalQueryModeEnabled()) {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
return [
|
|
73
|
+
{ name: "cluster_query_scope", type: "string", required: false, desc: scopeDesc },
|
|
74
|
+
{ name: "slave_cluster_id", type: "string", required: false, desc: "Slave cluster ID. Required when cluster_query_scope=SLAVE. Use +list_query_clusters first to choose this value." }
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
function optionalClusterQueryArgs(ctx) {
|
|
78
|
+
if (!isGlobalQueryModeEnabled()) {
|
|
79
|
+
return {};
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
clusterQueryScope: optionalString(ctx, "cluster_query_scope"),
|
|
83
|
+
slaveClusterId: optionalString(ctx, "slave_cluster_id")
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
var DEFAULT_QUERY_LIMIT = 1e3;
|
|
87
|
+
var MAX_QUERY_LIMIT = 1e4;
|
|
88
|
+
function assertLimitWithinCap(value, flagName) {
|
|
89
|
+
if (value === void 0) return;
|
|
90
|
+
if (!Number.isInteger(value) || value < 1 || value > MAX_QUERY_LIMIT) {
|
|
91
|
+
throw new Error(`--${flagName} must be an integer between 1 and ${MAX_QUERY_LIMIT} (got: ${value}).`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function extractTrailingSqlLimit(sql) {
|
|
95
|
+
const m = sql.match(/\blimit\s+(\d+)(?:\s*,\s*(\d+))?(?:\s+offset\s+\d+)?\s*;?\s*$/i);
|
|
96
|
+
if (!m) return void 0;
|
|
97
|
+
return m[2] !== void 0 ? Number(m[2]) : Number(m[1]);
|
|
98
|
+
}
|
|
99
|
+
function findSqlInQp(qp) {
|
|
100
|
+
let found;
|
|
101
|
+
const visit = (v) => {
|
|
102
|
+
if (found !== void 0) return;
|
|
103
|
+
if (typeof v === "string") {
|
|
104
|
+
if (/\bselect\b/i.test(v) && /\bfrom\b/i.test(v)) found = v;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (Array.isArray(v)) {
|
|
108
|
+
v.forEach(visit);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (v && typeof v === "object") {
|
|
112
|
+
Object.values(v).forEach(visit);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
visit(qp);
|
|
116
|
+
return found;
|
|
117
|
+
}
|
|
118
|
+
function assertSqlLimitConsistent(qp, providedLimit) {
|
|
119
|
+
if (providedLimit === void 0) return;
|
|
120
|
+
const sql = findSqlInQp(qp);
|
|
121
|
+
if (sql === void 0) return;
|
|
122
|
+
const sqlLimit = extractTrailingSqlLimit(sql);
|
|
123
|
+
if (sqlLimit === void 0) return;
|
|
124
|
+
if (sqlLimit !== providedLimit) {
|
|
125
|
+
throw new Error(
|
|
126
|
+
`Conflicting row limits: SQL "LIMIT ${sqlLimit}" != --limit ${providedLimit}. For model_type=sql, omit LIMIT from the SQL and use --limit, or keep the two equal.`
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function resolveSqlAwareLimit(providedLimit, modelType, qp) {
|
|
131
|
+
if (providedLimit !== void 0) return providedLimit;
|
|
132
|
+
if (modelType === "sql") {
|
|
133
|
+
const sql = findSqlInQp(qp);
|
|
134
|
+
if (sql !== void 0 && extractTrailingSqlLimit(sql) !== void 0) return void 0;
|
|
135
|
+
}
|
|
136
|
+
return DEFAULT_QUERY_LIMIT;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// src/commands/te-analysis/meta/get-alert-definition-schema.ts
|
|
140
|
+
var getAlertDefinitionSchema = createMcpCommand({
|
|
141
|
+
command: "+get_alert_definition_schema",
|
|
142
|
+
description: "Get the alert definition schema. Returns field definitions, enum descriptions, and examples for creating or updating alerts.",
|
|
143
|
+
flags: [],
|
|
144
|
+
risk: "read",
|
|
145
|
+
mcpService: "te_analysis_extend",
|
|
146
|
+
buildArgs: () => ({})
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// src/commands/te-analysis/meta/list-alerts.ts
|
|
150
|
+
var listAlerts = createMcpCommand({
|
|
151
|
+
command: "+list_alerts",
|
|
152
|
+
description: "List all alerts in the project. Supports keyword filtering by alert name and returns a paginated alert list with total count.",
|
|
153
|
+
flags: [
|
|
154
|
+
{ name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
|
|
155
|
+
{ name: "query", type: "string", required: false, alias: "q", desc: "Optional keyword filter. Performs fuzzy matching against alert names; if omitted, all alerts are returned." },
|
|
156
|
+
{ name: "limit", type: "number", required: false, alias: "l", desc: "Optional page size. Default: 20, maximum: 10000." },
|
|
157
|
+
{ name: "offset", type: "number", required: false, alias: "o", desc: "Optional page offset. Default: 0." }
|
|
158
|
+
],
|
|
159
|
+
risk: "read",
|
|
160
|
+
mcpService: "te_analysis_extend",
|
|
161
|
+
buildArgs: (ctx) => ({
|
|
162
|
+
projectId: ctx.num("project_id"),
|
|
163
|
+
query: optionalString(ctx, "query"),
|
|
164
|
+
limit: optionalNumber(ctx, "limit"),
|
|
165
|
+
offset: optionalNumber(ctx, "offset")
|
|
166
|
+
})
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// src/commands/te-analysis/meta/get-alert.ts
|
|
170
|
+
var getAlert = createMcpCommand({
|
|
171
|
+
command: "+get_alert",
|
|
172
|
+
description: "Get detailed information about a specific alert by alertId.",
|
|
173
|
+
flags: [
|
|
174
|
+
{ name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
|
|
175
|
+
{ name: "alert_id", type: "number", required: true, alias: "a", desc: "Alert ID" }
|
|
176
|
+
],
|
|
177
|
+
risk: "read",
|
|
178
|
+
mcpService: "te_analysis_extend",
|
|
179
|
+
buildArgs: (ctx) => ({
|
|
180
|
+
projectId: ctx.num("project_id"),
|
|
181
|
+
alertId: ctx.num("alert_id")
|
|
182
|
+
})
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// src/commands/te-analysis/meta/create-alert.ts
|
|
186
|
+
var createAlert = createMcpCommand({
|
|
187
|
+
command: "+create_alert",
|
|
188
|
+
description: "Create a new alert. After creation, use list_alerts or get_alert to retrieve the created alert.",
|
|
189
|
+
flags: [
|
|
190
|
+
{ name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
|
|
191
|
+
{ name: "definition", type: "json", required: true, desc: "Alert definition JSON. See +get_alert_definition_schema for the complete structure." }
|
|
192
|
+
],
|
|
193
|
+
risk: "write",
|
|
194
|
+
mcpService: "te_analysis_extend",
|
|
195
|
+
buildArgs: (ctx) => ({
|
|
196
|
+
projectId: ctx.num("project_id"),
|
|
197
|
+
definition: requiredJsonString(ctx, "definition")
|
|
198
|
+
})
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// src/commands/te-analysis/meta/update-alert.ts
|
|
202
|
+
var updateAlert = createMcpCommand({
|
|
203
|
+
command: "+update_alert",
|
|
204
|
+
description: "Update an existing alert. All fields in the definition will replace existing values.",
|
|
205
|
+
flags: [
|
|
206
|
+
{ name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
|
|
207
|
+
{ name: "alert_id", type: "number", required: true, alias: "a", desc: "Alert ID" },
|
|
208
|
+
{ name: "definition", type: "json", required: true, desc: "Alert definition JSON with updated fields. See +get_alert_definition_schema for the complete structure." }
|
|
209
|
+
],
|
|
210
|
+
risk: "write",
|
|
211
|
+
mcpService: "te_analysis_extend",
|
|
212
|
+
buildArgs: (ctx) => ({
|
|
213
|
+
projectId: ctx.num("project_id"),
|
|
214
|
+
alertId: ctx.num("alert_id"),
|
|
215
|
+
definition: requiredJsonString(ctx, "definition")
|
|
216
|
+
})
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// src/commands/te-analysis/meta/delete-alert.ts
|
|
220
|
+
var deleteAlert = createMcpCommand({
|
|
221
|
+
command: "+delete_alert",
|
|
222
|
+
description: "Delete an alert by alertId",
|
|
223
|
+
flags: [
|
|
224
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
225
|
+
{ name: "alert_id", type: "number", required: true, desc: "Alert ID to delete" }
|
|
226
|
+
],
|
|
227
|
+
risk: "write",
|
|
228
|
+
mcpService: "te_analysis_extend",
|
|
229
|
+
buildArgs: (ctx) => ({
|
|
230
|
+
projectId: ctx.num("project_id"),
|
|
231
|
+
alertId: ctx.num("alert_id")
|
|
232
|
+
})
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// src/commands/te-analysis/meta/index.ts
|
|
236
|
+
var commands = [
|
|
237
|
+
getAlertDefinitionSchema,
|
|
238
|
+
listAlerts,
|
|
239
|
+
getAlert,
|
|
240
|
+
createAlert,
|
|
241
|
+
updateAlert,
|
|
242
|
+
deleteAlert
|
|
243
|
+
];
|
|
244
|
+
var meta_default = commands;
|
|
245
|
+
|
|
246
|
+
// src/commands/te-analysis/report/list-reports.ts
|
|
247
|
+
var listReports = createMcpCommand({
|
|
248
|
+
command: "+list_reports",
|
|
249
|
+
description: "List report metadata accessible to the current user in the project. Supports keyword filtering and returns paginated report summaries with selectable fields.",
|
|
250
|
+
flags: [
|
|
251
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
252
|
+
{ name: "query", type: "string", required: false, desc: "Optional keyword filter. Performs fuzzy matching against reportName, reportDesc, and remark; if omitted, all accessible reports are returned.", alias: "q" },
|
|
253
|
+
{ name: "fields", type: "json", required: false, desc: "Optional fields to return. Supported fields: reportId, reportName, reportDesc, remark, reportModel. Default fields when omitted: reportId, reportName, reportDesc, remark, reportModel.", alias: "f" },
|
|
254
|
+
{ name: "limit", type: "number", required: false, desc: "Optional page size. Default: 20, maximum: 10000.", alias: "l" },
|
|
255
|
+
{ name: "offset", type: "number", required: false, desc: "Optional page offset. Default: 0.", alias: "o" }
|
|
256
|
+
],
|
|
257
|
+
risk: "read",
|
|
258
|
+
buildArgs: (ctx) => ({
|
|
259
|
+
projectId: ctx.num("project_id"),
|
|
260
|
+
query: optionalString(ctx, "query"),
|
|
261
|
+
fields: optionalJson(ctx, "fields"),
|
|
262
|
+
limit: optionalNumber(ctx, "limit"),
|
|
263
|
+
offset: optionalNumber(ctx, "offset")
|
|
264
|
+
})
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
// src/commands/te-analysis/report/get-report-definition.ts
|
|
268
|
+
var getReportDefinition = createMcpCommand({
|
|
269
|
+
command: "+get_report_definition",
|
|
270
|
+
description: "Get the definition details of a single report. Returns model type, event configuration, display configuration, and other definition data without executing a data query.",
|
|
271
|
+
flags: [
|
|
272
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
273
|
+
{ name: "report_id", type: "number", required: true, desc: "Report ID", alias: "r" }
|
|
274
|
+
],
|
|
275
|
+
risk: "read",
|
|
276
|
+
buildArgs: (ctx) => ({
|
|
277
|
+
projectId: ctx.num("project_id"),
|
|
278
|
+
reportId: ctx.num("report_id")
|
|
279
|
+
})
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// src/commands/te-analysis/report/query-report-data.ts
|
|
283
|
+
var queryReportData = createMcpCommand({
|
|
284
|
+
command: "+query_report_data",
|
|
285
|
+
description: "Query analysis data for one or more reports. Supports extra filters, group-by settings, and time range overrides. For long-running or cancelable queries, requestId is required and must be provided before starting. For any query that may exceed the CLI or MCP HTTP timeout, generate requestId first so you can call +cancel_query --request_id <same value> if you stop waiting or the request returns fetch failed. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Submitted queries return metadata.requestId; pass that value to cancel_query(requestId) when the query is no longer needed. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If requestId is omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID.",
|
|
286
|
+
flags: [
|
|
287
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
288
|
+
{ name: "report_ids", type: "json", required: true, desc: "List of report IDs" },
|
|
289
|
+
{ name: "filters", type: "json", required: false, desc: "Optional filter JSON. See +get_filter_schema for the structure." },
|
|
290
|
+
{ name: "group_by", type: "json", required: false, desc: "Optional group-by JSON array. See +get_groupby_schema for the structure." },
|
|
291
|
+
{ name: "request_id", type: "string", required: true, desc: "Required unique request ID used for tracking and cancellation. Generate it before starting the query. It must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Provide this before starting the query so it can be cancelled later with +cancel_query --request_id <same value>, even if the caller stops waiting before the tool returns. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID. The response metadata.requestId echoes the supplied requestId and can also be passed to cancel_query(requestId) when the query is no longer needed." },
|
|
292
|
+
{ name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
|
|
293
|
+
{ name: "start_date", type: "string", required: false, desc: "Optional start date in yyyy-MM-dd format" },
|
|
294
|
+
{ name: "end_date", type: "string", required: false, desc: "Optional end date in yyyy-MM-dd format" },
|
|
295
|
+
{ name: "time_granularity", type: "string", required: false, desc: "Optional time granularity used to override the report default. Supported values: minute, minute5, minute10, hour, day, week, month, quarter, year, total." },
|
|
296
|
+
{ name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." },
|
|
297
|
+
{ name: "sql_params", type: "json", required: false, desc: `Optional override for a SQL-model report's dynamic parameters (the \${...} placeholders; get each param's paramName/paramType/current shape via +get_report_definition). JSON array matched by paramName. Value fields by paramType: Selector/Variable use paramExpress, e.g. [{"paramName":"selector1","paramExpress":"<value>"}]; Text needs a quota operator + paramExpress (all 13 quota codes, e.g. [{"paramName":"text1","quota":"C00","paramExpress":["<value>"]}]); Number needs quota + paramExpress (numeric ops only); 13 codes incl. C00=IN, C06=BETWEEN/range, C060=BETWEEN by date, C300=CONTAIN, C04=no filter, C05=IS NULL (see the ae-analysis query_report_data reference for the full table); Time needs a quota operator + startTime/endTime (C020 <=, C030 >=, C06/C060 between, C04/C05 has/no value), NOT recentDay; PartDate is a date range (startTime+endTime). Variable has no quota; override paramExpress (custom-type values include their own quotes). Only listed params are overridden; omitted params keep the report's saved defaults. Ignored for non-SQL reports.` },
|
|
298
|
+
...clusterQueryFlags("Optional cluster query scope. Supported values: GLOBAL, SLAVE. Omit to query the current self cluster.")
|
|
299
|
+
],
|
|
300
|
+
risk: "read",
|
|
301
|
+
buildArgs: (ctx) => ({
|
|
302
|
+
projectId: ctx.num("project_id"),
|
|
303
|
+
reportIds: ctx.json("report_ids"),
|
|
304
|
+
filters: optionalJsonString(ctx, "filters"),
|
|
305
|
+
groupBy: optionalJsonString(ctx, "group_by"),
|
|
306
|
+
requestId: ctx.str("request_id"),
|
|
307
|
+
useCache: optionalBoolean(ctx, "use_cache"),
|
|
308
|
+
startDate: optionalString(ctx, "start_date"),
|
|
309
|
+
endDate: optionalString(ctx, "end_date"),
|
|
310
|
+
timeGranularity: optionalString(ctx, "time_granularity"),
|
|
311
|
+
timeoutMinutes: optionalNumber(ctx, "timeout_minutes"),
|
|
312
|
+
sqlParams: optionalJsonString(ctx, "sql_params"),
|
|
313
|
+
...optionalClusterQueryArgs(ctx)
|
|
314
|
+
})
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// src/commands/te-analysis/report/create-report.ts
|
|
318
|
+
var createReport = createMcpCommand({
|
|
319
|
+
command: "+create_report",
|
|
320
|
+
description: "Create and persist a new report definition. Supports event, retention, funnel, prop_analysis, path, distribution, sql, interval, and attribution models.",
|
|
321
|
+
flags: [
|
|
322
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
323
|
+
{ name: "report_name", type: "string", required: true, desc: "Report name. Length: 1-80 characters" },
|
|
324
|
+
{ name: "model_type", type: "string", required: true, desc: "Report model type. Supported values: event, retention, funnel, prop_analysis, path, distribution, sql, interval, attribution" },
|
|
325
|
+
{ name: "analysis_query", type: "json", required: true, desc: "Report analysis query JSON. Usually includes fields such as events and eventView. See +get_analysis_query_schema for the structure." },
|
|
326
|
+
{ name: "description", type: "string", required: false, desc: "Optional report description" },
|
|
327
|
+
{ name: "cache_seconds", type: "number", required: false, desc: "Optional cache duration in seconds" },
|
|
328
|
+
{ name: "query_duration_ms", type: "number", required: false, desc: "Optional query duration in milliseconds" },
|
|
329
|
+
{ name: "dashboard_ids", type: "json", required: false, desc: "Optional list of dashboard IDs to associate" }
|
|
330
|
+
],
|
|
331
|
+
risk: "write",
|
|
332
|
+
buildArgs: (ctx) => ({
|
|
333
|
+
projectId: ctx.num("project_id"),
|
|
334
|
+
reportName: ctx.str("report_name"),
|
|
335
|
+
modelType: ctx.str("model_type"),
|
|
336
|
+
analysisQuery: requiredJsonString(ctx, "analysis_query"),
|
|
337
|
+
description: optionalString(ctx, "description"),
|
|
338
|
+
cacheSeconds: optionalNumber(ctx, "cache_seconds"),
|
|
339
|
+
queryDurationMs: optionalNumber(ctx, "query_duration_ms"),
|
|
340
|
+
dashboardIds: optionalJson(ctx, "dashboard_ids")
|
|
341
|
+
})
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
// src/commands/te-analysis/report/delete-report.ts
|
|
345
|
+
var deleteReport = createMcpCommand({
|
|
346
|
+
command: "+delete_report",
|
|
347
|
+
description: "Delete a report by reportId",
|
|
348
|
+
flags: [
|
|
349
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
350
|
+
{ name: "report_id", type: "number", required: true, desc: "Report ID to delete" }
|
|
351
|
+
],
|
|
352
|
+
risk: "write",
|
|
353
|
+
buildArgs: (ctx) => ({
|
|
354
|
+
projectId: ctx.num("project_id"),
|
|
355
|
+
reportId: ctx.num("report_id")
|
|
356
|
+
})
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
// src/commands/te-analysis/report/update-report.ts
|
|
360
|
+
var updateReport = createMcpCommand({
|
|
361
|
+
command: "+update_report",
|
|
362
|
+
description: "Update an existing report. Supports updating name, description, and QP. At least one of report_name, report_desc, or qp must be provided. When updating qp, also provide report_model. First call +get_report_definition to retrieve the current version number.",
|
|
363
|
+
flags: [
|
|
364
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
365
|
+
{ name: "report_id", type: "number", required: true, desc: "Report ID to update" },
|
|
366
|
+
{ name: "version", type: "number", required: true, desc: "Current report version number. Retrieve via +get_report_definition." },
|
|
367
|
+
{ name: "report_name", type: "string", required: false, desc: "New report name. Omit to keep existing." },
|
|
368
|
+
{ name: "report_desc", type: "string", required: false, desc: "New report description. Omit to keep existing." },
|
|
369
|
+
{ name: "qp", type: "string", required: false, desc: "New QP JSON string. Omit to keep existing. When provided, also supply report_model." },
|
|
370
|
+
{ name: "report_model", type: "number", required: false, desc: "Analysis model type integer (e.g. 1=event, 2=retention). Required when qp is provided." }
|
|
371
|
+
],
|
|
372
|
+
risk: "write",
|
|
373
|
+
mcpService: "te_analysis_extend",
|
|
374
|
+
buildArgs: (ctx) => ({
|
|
375
|
+
projectId: ctx.num("project_id"),
|
|
376
|
+
reportId: ctx.num("report_id"),
|
|
377
|
+
version: ctx.num("version"),
|
|
378
|
+
reportName: optionalString(ctx, "report_name"),
|
|
379
|
+
reportDesc: optionalString(ctx, "report_desc"),
|
|
380
|
+
qp: optionalString(ctx, "qp"),
|
|
381
|
+
reportModel: optionalNumber(ctx, "report_model")
|
|
382
|
+
})
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
// src/commands/te-analysis/report/index.ts
|
|
386
|
+
var commands2 = [
|
|
387
|
+
listReports,
|
|
388
|
+
getReportDefinition,
|
|
389
|
+
queryReportData,
|
|
390
|
+
createReport,
|
|
391
|
+
deleteReport,
|
|
392
|
+
updateReport
|
|
393
|
+
];
|
|
394
|
+
var report_default = commands2;
|
|
395
|
+
|
|
396
|
+
// src/commands/te-analysis/capability-shared.ts
|
|
397
|
+
function createAnalysisCapabilityCommand(config) {
|
|
398
|
+
return createCapabilityCommand({
|
|
399
|
+
...config,
|
|
400
|
+
cliService: "analysis"
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
var projectIdFlag = {
|
|
404
|
+
name: "project-id",
|
|
405
|
+
type: "number",
|
|
406
|
+
required: true,
|
|
407
|
+
desc: "Numeric project ID.",
|
|
408
|
+
alias: "p"
|
|
409
|
+
};
|
|
410
|
+
var queryFlag = {
|
|
411
|
+
name: "query",
|
|
412
|
+
type: "string",
|
|
413
|
+
required: false,
|
|
414
|
+
desc: "Optional keyword filter.",
|
|
415
|
+
alias: "q"
|
|
416
|
+
};
|
|
417
|
+
var fieldsFlag = {
|
|
418
|
+
name: "fields",
|
|
419
|
+
type: "json",
|
|
420
|
+
required: false,
|
|
421
|
+
desc: "Optional result field projection JSON array.",
|
|
422
|
+
alias: "f"
|
|
423
|
+
};
|
|
424
|
+
var limitFlag = {
|
|
425
|
+
name: "limit",
|
|
426
|
+
type: "number",
|
|
427
|
+
required: false,
|
|
428
|
+
desc: "Optional inline result limit.",
|
|
429
|
+
alias: "l"
|
|
430
|
+
};
|
|
431
|
+
var offsetFlag = {
|
|
432
|
+
name: "offset",
|
|
433
|
+
type: "number",
|
|
434
|
+
required: false,
|
|
435
|
+
desc: "Optional zero-based result offset.",
|
|
436
|
+
alias: "o"
|
|
437
|
+
};
|
|
438
|
+
var payloadFlag = {
|
|
439
|
+
name: "payload",
|
|
440
|
+
type: "json",
|
|
441
|
+
required: false,
|
|
442
|
+
desc: "Optional snake_case object for complex capability payload fields."
|
|
443
|
+
};
|
|
444
|
+
function projectInput(ctx) {
|
|
445
|
+
return { project_id: ctx.num("project-id") };
|
|
446
|
+
}
|
|
447
|
+
function listInput(ctx) {
|
|
448
|
+
return compactInput({
|
|
449
|
+
...projectInput(ctx),
|
|
450
|
+
query: optionalString3(ctx, "query"),
|
|
451
|
+
fields: optionalJson4(ctx, "fields"),
|
|
452
|
+
limit: optionalNumber3(ctx, "limit"),
|
|
453
|
+
offset: optionalNumber3(ctx, "offset")
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
function dashboardReportDataInput(ctx) {
|
|
457
|
+
return compactInput({
|
|
458
|
+
...projectInput(ctx),
|
|
459
|
+
dashboard_id: ctx.num("dashboard-id"),
|
|
460
|
+
report_ids: optionalJsonArray(ctx, "report-ids"),
|
|
461
|
+
filters: optionalJson4(ctx, "filters"),
|
|
462
|
+
start_time: optionalString3(ctx, "start-time"),
|
|
463
|
+
end_time: optionalString3(ctx, "end-time"),
|
|
464
|
+
use_cache: optionalBoolean5(ctx, "use-cache"),
|
|
465
|
+
request_id: optionalString3(ctx, "request-id"),
|
|
466
|
+
timeout_seconds: optionalNumber3(ctx, "timeout-seconds"),
|
|
467
|
+
limit: optionalNumber3(ctx, "limit"),
|
|
468
|
+
format: optionalString3(ctx, "artifact-format")
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
function biPanelPageDataInput(ctx) {
|
|
472
|
+
return compactInput({
|
|
473
|
+
...projectInput(ctx),
|
|
474
|
+
panel_id: ctx.num("panel-id"),
|
|
475
|
+
page_key: ctx.str("page-key"),
|
|
476
|
+
result_type: ctx.str("result-type"),
|
|
477
|
+
chart_ids: optionalJsonArray(ctx, "chart-ids"),
|
|
478
|
+
parameter_controls: optionalJson4(ctx, "parameter-controls"),
|
|
479
|
+
permission_controls: optionalJson4(ctx, "permission-controls"),
|
|
480
|
+
chart_filter_controls: optionalJson4(ctx, "chart-filter-controls"),
|
|
481
|
+
columns: optionalJson4(ctx, "columns"),
|
|
482
|
+
row_limit: optionalNumber3(ctx, "row-limit"),
|
|
483
|
+
row_offset: optionalNumber3(ctx, "row-offset"),
|
|
484
|
+
block_limit: optionalNumber3(ctx, "block-limit"),
|
|
485
|
+
block_offset: optionalNumber3(ctx, "block-offset"),
|
|
486
|
+
use_cache: optionalBoolean5(ctx, "use-cache"),
|
|
487
|
+
request_id: optionalString3(ctx, "request-id"),
|
|
488
|
+
timeout_seconds: optionalNumber3(ctx, "timeout-seconds"),
|
|
489
|
+
limit: optionalNumber3(ctx, "limit"),
|
|
490
|
+
format: optionalString3(ctx, "artifact-format")
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
function optionalString3(ctx, name) {
|
|
494
|
+
const value = ctx.str(name);
|
|
495
|
+
return value === "" ? void 0 : value;
|
|
496
|
+
}
|
|
497
|
+
function optionalNumber3(ctx, name) {
|
|
498
|
+
const value = ctx.str(name);
|
|
499
|
+
return value === "" ? void 0 : Number(value);
|
|
500
|
+
}
|
|
501
|
+
function optionalBoolean5(ctx, name) {
|
|
502
|
+
const value = ctx.str(name);
|
|
503
|
+
return value === "" ? void 0 : ctx.bool(name);
|
|
504
|
+
}
|
|
505
|
+
function optionalJson4(ctx, name) {
|
|
506
|
+
const value = ctx.str(name);
|
|
507
|
+
return value === "" ? void 0 : ctx.json(name);
|
|
508
|
+
}
|
|
509
|
+
function jsonArray(ctx, name) {
|
|
510
|
+
const value = ctx.json(name);
|
|
511
|
+
return Array.isArray(value) ? value : [value];
|
|
512
|
+
}
|
|
513
|
+
function optionalJsonArray(ctx, name) {
|
|
514
|
+
const value = ctx.str(name);
|
|
515
|
+
if (value === "") {
|
|
516
|
+
return void 0;
|
|
517
|
+
}
|
|
518
|
+
const parsed = ctx.json(name);
|
|
519
|
+
return Array.isArray(parsed) ? parsed : [parsed];
|
|
520
|
+
}
|
|
521
|
+
function compactInput(input) {
|
|
522
|
+
const result = {};
|
|
523
|
+
for (const [key, value] of Object.entries(input)) {
|
|
524
|
+
if (value !== void 0) {
|
|
525
|
+
result[key] = value;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
return result;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// src/commands/te-analysis/dashboard/list.ts
|
|
532
|
+
var dashboardList = createAnalysisCapabilityCommand({
|
|
533
|
+
resource: "dashboard",
|
|
534
|
+
command: "list",
|
|
535
|
+
capabilityId: "analysis.dashboard.list",
|
|
536
|
+
description: "List dashboards visible to the current user through the capability gateway.",
|
|
537
|
+
flags: [projectIdFlag, queryFlag, fieldsFlag, limitFlag, offsetFlag],
|
|
538
|
+
risk: "read",
|
|
539
|
+
buildInput: listInput
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
// src/commands/te-analysis/dashboard/create.ts
|
|
543
|
+
var dashboardCreate = createAnalysisCapabilityCommand({
|
|
544
|
+
resource: "dashboard",
|
|
545
|
+
command: "create",
|
|
546
|
+
capabilityId: "analysis.dashboard.create",
|
|
547
|
+
description: "Create a dashboard in personal space, project space, or a folder.",
|
|
548
|
+
flags: [
|
|
549
|
+
projectIdFlag,
|
|
550
|
+
{ name: "dashboard-name", type: "string", required: true, desc: "Dashboard name." },
|
|
551
|
+
{ name: "space-id", type: "number", required: false, desc: "Target project space ID. Omit for personal space." },
|
|
552
|
+
{ name: "folder-id", type: "number", required: false, desc: "Target folder ID." },
|
|
553
|
+
{ name: "initial-report-id", type: "number", required: false, desc: "Optional report ID to add when creating the dashboard." },
|
|
554
|
+
payloadFlag
|
|
555
|
+
],
|
|
556
|
+
risk: "write",
|
|
557
|
+
buildInput: (ctx) => compactInput({
|
|
558
|
+
...projectInput(ctx),
|
|
559
|
+
dashboard_name: ctx.str("dashboard-name"),
|
|
560
|
+
space_id: optionalNumber3(ctx, "space-id"),
|
|
561
|
+
folder_id: optionalNumber3(ctx, "folder-id"),
|
|
562
|
+
initial_report_id: optionalNumber3(ctx, "initial-report-id"),
|
|
563
|
+
payload: optionalJson4(ctx, "payload")
|
|
564
|
+
})
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
// src/commands/te-analysis/dashboard/get.ts
|
|
568
|
+
var dashboardGet = createAnalysisCapabilityCommand({
|
|
569
|
+
resource: "dashboard",
|
|
570
|
+
command: "get",
|
|
571
|
+
capabilityId: "analysis.dashboard.get",
|
|
572
|
+
description: "Get one dashboard detail, including creator, create/update time, settings, reports, notes, and share information.",
|
|
573
|
+
flags: [
|
|
574
|
+
projectIdFlag,
|
|
575
|
+
{ name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." },
|
|
576
|
+
{ name: "use-cache", type: "boolean", required: false, desc: "Whether to use cached dashboard detail. Default: true." }
|
|
577
|
+
],
|
|
578
|
+
risk: "read",
|
|
579
|
+
buildInput: (ctx) => compactInput({
|
|
580
|
+
...projectInput(ctx),
|
|
581
|
+
dashboard_id: ctx.num("dashboard-id"),
|
|
582
|
+
use_cache: optionalBoolean5(ctx, "use-cache")
|
|
583
|
+
})
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
// src/commands/te-analysis/dashboard/update.ts
|
|
587
|
+
var dashboardUpdate = createAnalysisCapabilityCommand({
|
|
588
|
+
resource: "dashboard",
|
|
589
|
+
command: "update",
|
|
590
|
+
capabilityId: "analysis.dashboard.update",
|
|
591
|
+
description: "Update dashboard settings or create/update a dashboard note. Use --operation settings or note-upsert.",
|
|
592
|
+
flags: [
|
|
593
|
+
projectIdFlag,
|
|
594
|
+
{ name: "operation", type: "string", required: true, desc: "Update operation: settings or note-upsert." },
|
|
595
|
+
{ name: "dashboard-id", type: "number", required: false, desc: "Dashboard ID for a single-dashboard update." },
|
|
596
|
+
{ name: "dashboard-ids", type: "json", required: false, desc: "Dashboard ID array for batch settings updates." },
|
|
597
|
+
{ name: "dashboard-name", type: "string", required: false, desc: "Dashboard name for single rename." },
|
|
598
|
+
{ name: "zone-offset", type: "number", required: false, desc: "Fixed dashboard time zone offset in hours. For example, UTC+8 is 8 and UTC-5 is -5. Valid range: -12 to 14." },
|
|
599
|
+
{ name: "refresh-type", type: "number", required: false, desc: "Dashboard refresh type." },
|
|
600
|
+
{ name: "dashboard-status", type: "number", required: false, desc: "Dashboard status code." },
|
|
601
|
+
{ name: "note-id", type: "number", required: false, desc: "Dashboard note ID. Omit to create a new note." },
|
|
602
|
+
{ name: "note-title", type: "string", required: false, desc: "Dashboard note title." },
|
|
603
|
+
{ name: "description", type: "string", required: false, desc: "Dashboard note description." },
|
|
604
|
+
{ name: "ui-config", type: "string", required: false, desc: "Dashboard or note UI config string." },
|
|
605
|
+
payloadFlag
|
|
606
|
+
],
|
|
607
|
+
risk: "write",
|
|
608
|
+
buildInput: (ctx) => compactInput({
|
|
609
|
+
...projectInput(ctx),
|
|
610
|
+
operation: ctx.str("operation"),
|
|
611
|
+
dashboard_id: optionalNumber3(ctx, "dashboard-id"),
|
|
612
|
+
dashboard_ids: optionalJsonArray(ctx, "dashboard-ids"),
|
|
613
|
+
dashboard_name: optionalString3(ctx, "dashboard-name"),
|
|
614
|
+
zone_offset: optionalNumber3(ctx, "zone-offset"),
|
|
615
|
+
refresh_type: optionalNumber3(ctx, "refresh-type"),
|
|
616
|
+
dashboard_status: optionalNumber3(ctx, "dashboard-status"),
|
|
617
|
+
note_id: optionalNumber3(ctx, "note-id"),
|
|
618
|
+
note_title: optionalString3(ctx, "note-title"),
|
|
619
|
+
description: optionalString3(ctx, "description"),
|
|
620
|
+
ui_config: optionalString3(ctx, "ui-config"),
|
|
621
|
+
payload: optionalJson4(ctx, "payload")
|
|
622
|
+
})
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
// src/commands/te-analysis/dashboard/share-info.ts
|
|
626
|
+
var dashboardShareInfo = createAnalysisCapabilityCommand({
|
|
627
|
+
resource: "dashboard",
|
|
628
|
+
command: "share-info",
|
|
629
|
+
capabilityId: "analysis.dashboard.share_info",
|
|
630
|
+
description: "Get dashboard sharing information.",
|
|
631
|
+
flags: [projectIdFlag, { name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." }],
|
|
632
|
+
risk: "read",
|
|
633
|
+
buildInput: (ctx) => ({
|
|
634
|
+
...projectInput(ctx),
|
|
635
|
+
dashboard_id: ctx.num("dashboard-id")
|
|
636
|
+
})
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
// src/commands/te-analysis/dashboard/share.ts
|
|
640
|
+
var dashboardShare = createAnalysisCapabilityCommand({
|
|
641
|
+
resource: "dashboard",
|
|
642
|
+
command: "share",
|
|
643
|
+
capabilityId: "analysis.dashboard.share",
|
|
644
|
+
description: "Modify dashboard sharing members through the capability gateway.",
|
|
645
|
+
flags: [
|
|
646
|
+
projectIdFlag,
|
|
647
|
+
{ name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." },
|
|
648
|
+
{ name: "member-authorities", type: "json", required: false, desc: "Optional member authority map." },
|
|
649
|
+
payloadFlag
|
|
650
|
+
],
|
|
651
|
+
risk: "write",
|
|
652
|
+
buildInput: (ctx) => compactInput({
|
|
653
|
+
...projectInput(ctx),
|
|
654
|
+
dashboard_id: ctx.num("dashboard-id"),
|
|
655
|
+
member_authorities: optionalJson4(ctx, "member-authorities"),
|
|
656
|
+
payload: optionalJson4(ctx, "payload")
|
|
657
|
+
})
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
// src/commands/te-analysis/dashboard/delete.ts
|
|
661
|
+
var dashboardDelete = createAnalysisCapabilityCommand({
|
|
662
|
+
resource: "dashboard",
|
|
663
|
+
command: "delete",
|
|
664
|
+
capabilityId: "analysis.dashboard.delete",
|
|
665
|
+
description: "Delete one or more dashboards.",
|
|
666
|
+
flags: [projectIdFlag, { name: "dashboard-ids", type: "json", required: true, desc: "Dashboard ID array." }],
|
|
667
|
+
risk: "write",
|
|
668
|
+
buildInput: (ctx) => ({
|
|
669
|
+
...projectInput(ctx),
|
|
670
|
+
dashboard_ids: jsonArray(ctx, "dashboard-ids")
|
|
671
|
+
})
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
// src/commands/te-analysis/dashboard/handover.ts
|
|
675
|
+
var dashboardHandover = createAnalysisCapabilityCommand({
|
|
676
|
+
resource: "dashboard",
|
|
677
|
+
command: "handover",
|
|
678
|
+
capabilityId: "analysis.dashboard.handover",
|
|
679
|
+
description: "Handover one or more dashboards to another project user.",
|
|
680
|
+
flags: [
|
|
681
|
+
projectIdFlag,
|
|
682
|
+
{ name: "dashboard-ids", type: "json", required: true, desc: "Dashboard ID array." },
|
|
683
|
+
{ name: "to-user-id", type: "number", required: true, desc: "Target user ID." }
|
|
684
|
+
],
|
|
685
|
+
risk: "write",
|
|
686
|
+
buildInput: (ctx) => ({
|
|
687
|
+
...projectInput(ctx),
|
|
688
|
+
dashboard_ids: jsonArray(ctx, "dashboard-ids"),
|
|
689
|
+
to_user_id: ctx.num("to-user-id")
|
|
690
|
+
})
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
// src/commands/te-analysis/dashboard/copy.ts
|
|
694
|
+
var dashboardCopy = createAnalysisCapabilityCommand({
|
|
695
|
+
resource: "dashboard",
|
|
696
|
+
command: "copy",
|
|
697
|
+
capabilityId: "analysis.dashboard.copy",
|
|
698
|
+
description: "Copy a dashboard, optionally copying reports and targeting a project space or folder.",
|
|
699
|
+
flags: [
|
|
700
|
+
projectIdFlag,
|
|
701
|
+
{ name: "dashboard-id", type: "number", required: true, desc: "Source dashboard ID." },
|
|
702
|
+
{ name: "dashboard-name", type: "string", required: true, desc: "New dashboard name." },
|
|
703
|
+
{ name: "report-copy", type: "boolean", required: false, desc: "Whether to copy reports. Default: false." },
|
|
704
|
+
{ name: "to-space-id", type: "number", required: false, desc: "Target project space ID." },
|
|
705
|
+
{ name: "to-folder-id", type: "number", required: false, desc: "Target folder ID." }
|
|
706
|
+
],
|
|
707
|
+
risk: "write",
|
|
708
|
+
buildInput: (ctx) => compactInput({
|
|
709
|
+
...projectInput(ctx),
|
|
710
|
+
dashboard_id: ctx.num("dashboard-id"),
|
|
711
|
+
dashboard_name: ctx.str("dashboard-name"),
|
|
712
|
+
report_copy: optionalBoolean5(ctx, "report-copy"),
|
|
713
|
+
to_space_id: optionalNumber3(ctx, "to-space-id"),
|
|
714
|
+
to_folder_id: optionalNumber3(ctx, "to-folder-id")
|
|
715
|
+
})
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
// src/commands/te-analysis/dashboard/freeze.ts
|
|
719
|
+
var dashboardFreeze = createAnalysisCapabilityCommand({
|
|
720
|
+
resource: "dashboard",
|
|
721
|
+
command: "freeze",
|
|
722
|
+
capabilityId: "analysis.dashboard.freeze",
|
|
723
|
+
description: "Freeze or unfreeze one or more dashboards.",
|
|
724
|
+
flags: [
|
|
725
|
+
projectIdFlag,
|
|
726
|
+
{ name: "dashboard-ids", type: "json", required: true, desc: "Dashboard ID array." },
|
|
727
|
+
{ name: "freeze", type: "boolean", required: false, desc: "true to freeze, false to unfreeze. Default: true." }
|
|
728
|
+
],
|
|
729
|
+
risk: "write",
|
|
730
|
+
buildInput: (ctx) => compactInput({
|
|
731
|
+
...projectInput(ctx),
|
|
732
|
+
dashboard_ids: jsonArray(ctx, "dashboard-ids"),
|
|
733
|
+
freeze: optionalBoolean5(ctx, "freeze")
|
|
734
|
+
})
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
// src/commands/te-analysis/dashboard/abnormal-get.ts
|
|
738
|
+
var dashboardAbnormalGet = createAnalysisCapabilityCommand({
|
|
739
|
+
resource: "dashboard",
|
|
740
|
+
command: "abnormal-get",
|
|
741
|
+
capabilityId: "analysis.dashboard.abnormal_get",
|
|
742
|
+
description: "Get abnormal dependency information for a dashboard.",
|
|
743
|
+
flags: [projectIdFlag, { name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." }],
|
|
744
|
+
risk: "read",
|
|
745
|
+
buildInput: (ctx) => ({
|
|
746
|
+
...projectInput(ctx),
|
|
747
|
+
dashboard_id: ctx.num("dashboard-id")
|
|
748
|
+
})
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
// src/commands/te-analysis/dashboard/task-status.ts
|
|
752
|
+
var dashboardTaskStatus = createAnalysisCapabilityCommand({
|
|
753
|
+
resource: "dashboard",
|
|
754
|
+
command: "task-status",
|
|
755
|
+
capabilityId: "analysis.dashboard.task_status",
|
|
756
|
+
description: "Get dashboard scheduled task status.",
|
|
757
|
+
flags: [projectIdFlag, { name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." }],
|
|
758
|
+
risk: "read",
|
|
759
|
+
buildInput: (ctx) => ({
|
|
760
|
+
...projectInput(ctx),
|
|
761
|
+
dashboard_id: ctx.num("dashboard-id")
|
|
762
|
+
})
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
// src/commands/te-analysis/dashboard/index.ts
|
|
766
|
+
var commands3 = [
|
|
767
|
+
dashboardList,
|
|
768
|
+
dashboardCreate,
|
|
769
|
+
dashboardGet,
|
|
770
|
+
dashboardUpdate,
|
|
771
|
+
dashboardShareInfo,
|
|
772
|
+
dashboardShare,
|
|
773
|
+
dashboardDelete,
|
|
774
|
+
dashboardHandover,
|
|
775
|
+
dashboardCopy,
|
|
776
|
+
dashboardFreeze,
|
|
777
|
+
dashboardAbnormalGet,
|
|
778
|
+
dashboardTaskStatus
|
|
779
|
+
];
|
|
780
|
+
var dashboard_default = commands3;
|
|
781
|
+
|
|
782
|
+
// src/commands/te-analysis/dashboard-report-data/run.ts
|
|
783
|
+
var dashboardReportDataRun = createAnalysisCapabilityCommand({
|
|
784
|
+
resource: "dashboard-report-data",
|
|
785
|
+
command: "run",
|
|
786
|
+
capabilityId: "analysis.dashboard_report_data.run",
|
|
787
|
+
description: "Run a bounded dashboard report data query and return inline JSON.",
|
|
788
|
+
flags: [
|
|
789
|
+
projectIdFlag,
|
|
790
|
+
{ name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." },
|
|
791
|
+
{ name: "report-ids", type: "json", required: false, desc: "Optional report ID array. Omit to query all dashboard reports." },
|
|
792
|
+
{ name: "filters", type: "json", required: false, desc: "Optional dashboard filter JSON." },
|
|
793
|
+
{ name: "start-time", type: "string", required: false, desc: "Optional start date/time." },
|
|
794
|
+
{ name: "end-time", type: "string", required: false, desc: "Optional end date/time." },
|
|
795
|
+
{ name: "use-cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true." },
|
|
796
|
+
{ name: "request-id", type: "string", required: false, desc: "Optional cli_<32 lowercase hex> request ID. Generated when omitted." },
|
|
797
|
+
{ name: "timeout-seconds", type: "number", required: false, desc: "Sync timeout seconds. Default: 60, max: 180." },
|
|
798
|
+
limitFlag
|
|
799
|
+
],
|
|
800
|
+
risk: "read",
|
|
801
|
+
buildInput: dashboardReportDataInput
|
|
802
|
+
});
|
|
803
|
+
|
|
804
|
+
// src/commands/te-analysis/dashboard-report-data/export.ts
|
|
805
|
+
var dashboardReportDataExport = createAnalysisCapabilityCommand({
|
|
806
|
+
resource: "dashboard-report-data",
|
|
807
|
+
command: "export",
|
|
808
|
+
capabilityId: "analysis.dashboard_report_data.export",
|
|
809
|
+
description: "Submit a dashboard report data query as an asynchronous gzip JSONL artifact.",
|
|
810
|
+
flags: [
|
|
811
|
+
projectIdFlag,
|
|
812
|
+
{ name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." },
|
|
813
|
+
{ name: "report-ids", type: "json", required: false, desc: "Optional report ID array. Omit to query all dashboard reports." },
|
|
814
|
+
{ name: "filters", type: "json", required: false, desc: "Optional dashboard filter JSON." },
|
|
815
|
+
{ name: "start-time", type: "string", required: false, desc: "Optional start date/time." },
|
|
816
|
+
{ name: "end-time", type: "string", required: false, desc: "Optional end date/time." },
|
|
817
|
+
{ name: "use-cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true." },
|
|
818
|
+
{ name: "request-id", type: "string", required: false, desc: "Optional cli_<32 lowercase hex> request ID. Generated when omitted." },
|
|
819
|
+
{ name: "timeout-seconds", type: "number", required: false, desc: "Export timeout seconds. Default: 3600, max: 7200." },
|
|
820
|
+
{ name: "artifact-format", type: "string", required: false, desc: "Artifact format. Only jsonl is supported." }
|
|
821
|
+
],
|
|
822
|
+
risk: "read",
|
|
823
|
+
buildInput: dashboardReportDataInput
|
|
824
|
+
});
|
|
825
|
+
|
|
826
|
+
// src/commands/te-analysis/dashboard-report-data/index.ts
|
|
827
|
+
var commands4 = [
|
|
828
|
+
dashboardReportDataRun,
|
|
829
|
+
dashboardReportDataExport
|
|
830
|
+
];
|
|
831
|
+
var dashboard_report_data_default = commands4;
|
|
832
|
+
|
|
833
|
+
// src/commands/te-analysis/query/cancel.ts
|
|
834
|
+
var queryCancel = createAnalysisCapabilityCommand({
|
|
835
|
+
resource: "query",
|
|
836
|
+
command: "cancel",
|
|
837
|
+
capabilityId: "analysis.query.cancel",
|
|
838
|
+
description: "Cancel an analysis capability-gateway query/export by run_id.",
|
|
839
|
+
flags: [
|
|
840
|
+
{ name: "run-id", type: "string", required: true, desc: "Async run ID returned by an export capability." },
|
|
841
|
+
{ name: "reason", type: "string", required: false, desc: "Optional cancellation reason." }
|
|
842
|
+
],
|
|
843
|
+
risk: "write",
|
|
844
|
+
buildInput: (ctx) => compactInput({
|
|
845
|
+
run_id: ctx.str("run-id"),
|
|
846
|
+
reason: optionalString3(ctx, "reason")
|
|
847
|
+
})
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
// src/commands/te-analysis/query/index.ts
|
|
851
|
+
var commands5 = [
|
|
852
|
+
queryCancel
|
|
853
|
+
];
|
|
854
|
+
var query_default = commands5;
|
|
855
|
+
|
|
856
|
+
// src/commands/te-analysis/dashboard-definition/export.ts
|
|
857
|
+
var dashboardDefinitionExport = createAnalysisCapabilityCommand({
|
|
858
|
+
resource: "dashboard-definition",
|
|
859
|
+
command: "export",
|
|
860
|
+
capabilityId: "analysis.dashboard_definition.export",
|
|
861
|
+
description: "Export dashboard definition JSON.",
|
|
862
|
+
flags: [
|
|
863
|
+
projectIdFlag,
|
|
864
|
+
{ name: "dashboard-folder-ids", type: "json", required: false, desc: "Dashboard folder IDs to export." },
|
|
865
|
+
{ name: "shared-spaces", type: "json", required: false, desc: "Shared space export descriptor array." },
|
|
866
|
+
{ name: "export-file-name", type: "string", required: false, desc: "Optional export file name." },
|
|
867
|
+
payloadFlag
|
|
868
|
+
],
|
|
869
|
+
risk: "read",
|
|
870
|
+
buildInput: (ctx) => compactInput({
|
|
871
|
+
...projectInput(ctx),
|
|
872
|
+
dashboard_folder_ids: optionalJsonArray(ctx, "dashboard-folder-ids"),
|
|
873
|
+
shared_spaces: optionalJson4(ctx, "shared-spaces"),
|
|
874
|
+
export_file_name: optionalString3(ctx, "export-file-name"),
|
|
875
|
+
payload: optionalJson4(ctx, "payload")
|
|
876
|
+
})
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
// src/commands/te-analysis/dashboard-definition/import.ts
|
|
880
|
+
var dashboardDefinitionImport = createAnalysisCapabilityCommand({
|
|
881
|
+
resource: "dashboard-definition",
|
|
882
|
+
command: "import",
|
|
883
|
+
capabilityId: "analysis.dashboard_definition.import",
|
|
884
|
+
description: "Validate or import dashboard definition JSON. Use --validate-only for import pre-check.",
|
|
885
|
+
flags: [
|
|
886
|
+
projectIdFlag,
|
|
887
|
+
{ name: "definition", type: "json", required: true, desc: "Dashboard definition JSON object." },
|
|
888
|
+
{ name: "validate-only", type: "boolean", required: false, desc: "Only validate import conflicts and importable state." },
|
|
889
|
+
{ name: "dashboard-name-conflict-policy", type: "string", required: false, desc: "Optional dashboard name conflict policy." },
|
|
890
|
+
{ name: "space-dashboard-policy", type: "string", required: false, desc: "Optional space/dashboard import policy." },
|
|
891
|
+
payloadFlag
|
|
892
|
+
],
|
|
893
|
+
risk: "write",
|
|
894
|
+
buildInput: (ctx) => compactInput({
|
|
895
|
+
...projectInput(ctx),
|
|
896
|
+
definition: ctx.json("definition"),
|
|
897
|
+
validate_only: optionalBoolean5(ctx, "validate-only"),
|
|
898
|
+
dashboard_name_conflict_policy: optionalString3(ctx, "dashboard-name-conflict-policy"),
|
|
899
|
+
space_dashboard_policy: optionalString3(ctx, "space-dashboard-policy"),
|
|
900
|
+
payload: optionalJson4(ctx, "payload")
|
|
901
|
+
})
|
|
902
|
+
});
|
|
903
|
+
|
|
904
|
+
// src/commands/te-analysis/dashboard-definition/index.ts
|
|
905
|
+
var commands6 = [
|
|
906
|
+
dashboardDefinitionExport,
|
|
907
|
+
dashboardDefinitionImport
|
|
908
|
+
];
|
|
909
|
+
var dashboard_definition_default = commands6;
|
|
910
|
+
|
|
911
|
+
// src/commands/te-analysis/dashboard-daily-report/update.ts
|
|
912
|
+
var dashboardDailyReportUpdate = createAnalysisCapabilityCommand({
|
|
913
|
+
resource: "dashboard-daily-report",
|
|
914
|
+
command: "update",
|
|
915
|
+
capabilityId: "analysis.dashboard_daily_report.update",
|
|
916
|
+
description: "Update dashboard daily report configuration.",
|
|
917
|
+
flags: [
|
|
918
|
+
projectIdFlag,
|
|
919
|
+
{ name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." },
|
|
920
|
+
{ name: "enable-send", type: "number", required: false, desc: "Enable send flag." },
|
|
921
|
+
{ name: "send-time", type: "string", required: false, desc: "Daily report send time." },
|
|
922
|
+
{ name: "send-title", type: "string", required: false, desc: "Daily report title." },
|
|
923
|
+
{ name: "send-content", type: "string", required: false, desc: "Daily report content." },
|
|
924
|
+
payloadFlag
|
|
925
|
+
],
|
|
926
|
+
risk: "write",
|
|
927
|
+
buildInput: (ctx) => compactInput({
|
|
928
|
+
...projectInput(ctx),
|
|
929
|
+
dashboard_id: ctx.num("dashboard-id"),
|
|
930
|
+
enable_send: optionalNumber3(ctx, "enable-send"),
|
|
931
|
+
send_time: optionalString3(ctx, "send-time"),
|
|
932
|
+
send_title: optionalString3(ctx, "send-title"),
|
|
933
|
+
send_content: optionalString3(ctx, "send-content"),
|
|
934
|
+
payload: optionalJson4(ctx, "payload")
|
|
935
|
+
})
|
|
936
|
+
});
|
|
937
|
+
|
|
938
|
+
// src/commands/te-analysis/dashboard-daily-report/send.ts
|
|
939
|
+
var dashboardDailyReportSend = createAnalysisCapabilityCommand({
|
|
940
|
+
resource: "dashboard-daily-report",
|
|
941
|
+
command: "send",
|
|
942
|
+
capabilityId: "analysis.dashboard_daily_report.send",
|
|
943
|
+
description: "Send dashboard daily report immediately.",
|
|
944
|
+
flags: [
|
|
945
|
+
projectIdFlag,
|
|
946
|
+
{ name: "dashboard-id", type: "number", required: true, desc: "Dashboard ID." },
|
|
947
|
+
{ name: "need-csv", type: "number", required: false, desc: "Whether CSV attachment is needed." },
|
|
948
|
+
{ name: "host-url", type: "string", required: false, desc: "Host URL used in report links." },
|
|
949
|
+
payloadFlag
|
|
950
|
+
],
|
|
951
|
+
risk: "write",
|
|
952
|
+
buildInput: (ctx) => compactInput({
|
|
953
|
+
...projectInput(ctx),
|
|
954
|
+
dashboard_id: ctx.num("dashboard-id"),
|
|
955
|
+
need_csv: optionalNumber3(ctx, "need-csv"),
|
|
956
|
+
host_url: optionalString3(ctx, "host-url"),
|
|
957
|
+
payload: optionalJson4(ctx, "payload")
|
|
958
|
+
})
|
|
959
|
+
});
|
|
960
|
+
|
|
961
|
+
// src/commands/te-analysis/dashboard-daily-report/index.ts
|
|
962
|
+
var commands7 = [
|
|
963
|
+
dashboardDailyReportUpdate,
|
|
964
|
+
dashboardDailyReportSend
|
|
965
|
+
];
|
|
966
|
+
var dashboard_daily_report_default = commands7;
|
|
967
|
+
|
|
968
|
+
// src/commands/te-analysis/bi-panel/list.ts
|
|
969
|
+
var biPanelList = createAnalysisCapabilityCommand({
|
|
970
|
+
resource: "bi-panel",
|
|
971
|
+
command: "list",
|
|
972
|
+
capabilityId: "analysis.bi_panel.list",
|
|
973
|
+
description: "List BI panels visible to the current user through the capability gateway.",
|
|
974
|
+
flags: [projectIdFlag, queryFlag, fieldsFlag, limitFlag, offsetFlag],
|
|
975
|
+
risk: "read",
|
|
976
|
+
buildInput: listInput
|
|
977
|
+
});
|
|
978
|
+
|
|
979
|
+
// src/commands/te-analysis/bi-panel/get.ts
|
|
980
|
+
var biPanelGet = createAnalysisCapabilityCommand({
|
|
981
|
+
resource: "bi-panel",
|
|
982
|
+
command: "get",
|
|
983
|
+
capabilityId: "analysis.bi_panel.get",
|
|
984
|
+
description: "Get a BI panel released page structure.",
|
|
985
|
+
flags: [
|
|
986
|
+
projectIdFlag,
|
|
987
|
+
{ name: "panel-id", type: "number", required: true, desc: "BI panel ID." },
|
|
988
|
+
fieldsFlag
|
|
989
|
+
],
|
|
990
|
+
risk: "read",
|
|
991
|
+
buildInput: (ctx) => compactInput({
|
|
992
|
+
...projectInput(ctx),
|
|
993
|
+
panel_id: ctx.num("panel-id"),
|
|
994
|
+
fields: optionalJson4(ctx, "fields")
|
|
995
|
+
})
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
// src/commands/te-analysis/bi-panel/create.ts
|
|
999
|
+
var biPanelCreate = createAnalysisCapabilityCommand({
|
|
1000
|
+
resource: "bi-panel",
|
|
1001
|
+
command: "create",
|
|
1002
|
+
capabilityId: "analysis.bi_panel.create",
|
|
1003
|
+
description: "Create a BI panel.",
|
|
1004
|
+
flags: [
|
|
1005
|
+
projectIdFlag,
|
|
1006
|
+
{ name: "panel-name", type: "string", required: false, desc: "BI panel name." },
|
|
1007
|
+
{ name: "panel-uuid", type: "string", required: false, desc: "BI panel UUID." },
|
|
1008
|
+
{ name: "space-id", type: "number", required: false, desc: "Target project space ID." },
|
|
1009
|
+
{ name: "folder-id", type: "number", required: false, desc: "Target folder ID." },
|
|
1010
|
+
payloadFlag
|
|
1011
|
+
],
|
|
1012
|
+
risk: "write",
|
|
1013
|
+
buildInput: (ctx) => compactInput({
|
|
1014
|
+
...projectInput(ctx),
|
|
1015
|
+
panel_name: optionalString3(ctx, "panel-name"),
|
|
1016
|
+
panel_uuid: optionalString3(ctx, "panel-uuid"),
|
|
1017
|
+
space_id: optionalNumber3(ctx, "space-id"),
|
|
1018
|
+
folder_id: optionalNumber3(ctx, "folder-id"),
|
|
1019
|
+
payload: optionalJson4(ctx, "payload")
|
|
1020
|
+
})
|
|
1021
|
+
});
|
|
1022
|
+
|
|
1023
|
+
// src/commands/te-analysis/bi-panel/update.ts
|
|
1024
|
+
var biPanelUpdate = createAnalysisCapabilityCommand({
|
|
1025
|
+
resource: "bi-panel",
|
|
1026
|
+
command: "update",
|
|
1027
|
+
capabilityId: "analysis.bi_panel.update",
|
|
1028
|
+
description: "Update BI panel content or metadata.",
|
|
1029
|
+
flags: [
|
|
1030
|
+
projectIdFlag,
|
|
1031
|
+
{ name: "panel-name", type: "string", required: false, desc: "BI panel name." },
|
|
1032
|
+
{ name: "panel-uuid", type: "string", required: false, desc: "BI panel UUID." },
|
|
1033
|
+
payloadFlag
|
|
1034
|
+
],
|
|
1035
|
+
risk: "write",
|
|
1036
|
+
buildInput: (ctx) => compactInput({
|
|
1037
|
+
...projectInput(ctx),
|
|
1038
|
+
panel_name: optionalString3(ctx, "panel-name"),
|
|
1039
|
+
panel_uuid: optionalString3(ctx, "panel-uuid"),
|
|
1040
|
+
payload: optionalJson4(ctx, "payload")
|
|
1041
|
+
})
|
|
1042
|
+
});
|
|
1043
|
+
|
|
1044
|
+
// src/commands/te-analysis/bi-panel/delete.ts
|
|
1045
|
+
var biPanelDelete = createAnalysisCapabilityCommand({
|
|
1046
|
+
resource: "bi-panel",
|
|
1047
|
+
command: "delete",
|
|
1048
|
+
capabilityId: "analysis.bi_panel.delete",
|
|
1049
|
+
description: "Delete one or more BI panels.",
|
|
1050
|
+
flags: [projectIdFlag, { name: "panel-ids", type: "json", required: true, desc: "BI panel ID array." }],
|
|
1051
|
+
risk: "write",
|
|
1052
|
+
buildInput: (ctx) => ({
|
|
1053
|
+
...projectInput(ctx),
|
|
1054
|
+
panel_ids: jsonArray(ctx, "panel-ids")
|
|
1055
|
+
})
|
|
1056
|
+
});
|
|
1057
|
+
|
|
1058
|
+
// src/commands/te-analysis/bi-panel/share.ts
|
|
1059
|
+
var biPanelShare = createAnalysisCapabilityCommand({
|
|
1060
|
+
resource: "bi-panel",
|
|
1061
|
+
command: "share",
|
|
1062
|
+
capabilityId: "analysis.bi_panel.share",
|
|
1063
|
+
description: "Modify BI panel sharing members.",
|
|
1064
|
+
flags: [projectIdFlag, { name: "panel-id", type: "number", required: true, desc: "BI panel ID." }, payloadFlag],
|
|
1065
|
+
risk: "write",
|
|
1066
|
+
buildInput: (ctx) => compactInput({
|
|
1067
|
+
...projectInput(ctx),
|
|
1068
|
+
panel_id: ctx.num("panel-id"),
|
|
1069
|
+
payload: optionalJson4(ctx, "payload")
|
|
1070
|
+
})
|
|
1071
|
+
});
|
|
1072
|
+
|
|
1073
|
+
// src/commands/te-analysis/bi-panel/copy.ts
|
|
1074
|
+
var biPanelCopy = createAnalysisCapabilityCommand({
|
|
1075
|
+
resource: "bi-panel",
|
|
1076
|
+
command: "copy",
|
|
1077
|
+
capabilityId: "analysis.bi_panel.copy",
|
|
1078
|
+
description: "Copy a BI panel.",
|
|
1079
|
+
flags: [
|
|
1080
|
+
projectIdFlag,
|
|
1081
|
+
{ name: "panel-name", type: "string", required: false, desc: "New BI panel name." },
|
|
1082
|
+
{ name: "panel-uuid", type: "string", required: false, desc: "Source BI panel UUID." },
|
|
1083
|
+
{ name: "space-id", type: "number", required: false, desc: "Target project space ID." },
|
|
1084
|
+
{ name: "folder-id", type: "number", required: false, desc: "Target folder ID." },
|
|
1085
|
+
payloadFlag
|
|
1086
|
+
],
|
|
1087
|
+
risk: "write",
|
|
1088
|
+
buildInput: (ctx) => compactInput({
|
|
1089
|
+
...projectInput(ctx),
|
|
1090
|
+
panel_name: optionalString3(ctx, "panel-name"),
|
|
1091
|
+
panel_uuid: optionalString3(ctx, "panel-uuid"),
|
|
1092
|
+
space_id: optionalNumber3(ctx, "space-id"),
|
|
1093
|
+
folder_id: optionalNumber3(ctx, "folder-id"),
|
|
1094
|
+
payload: optionalJson4(ctx, "payload")
|
|
1095
|
+
})
|
|
1096
|
+
});
|
|
1097
|
+
|
|
1098
|
+
// src/commands/te-analysis/bi-panel/index.ts
|
|
1099
|
+
var commands8 = [
|
|
1100
|
+
biPanelList,
|
|
1101
|
+
biPanelGet,
|
|
1102
|
+
biPanelCreate,
|
|
1103
|
+
biPanelUpdate,
|
|
1104
|
+
biPanelDelete,
|
|
1105
|
+
biPanelShare,
|
|
1106
|
+
biPanelCopy
|
|
1107
|
+
];
|
|
1108
|
+
var bi_panel_default = commands8;
|
|
1109
|
+
|
|
1110
|
+
// src/commands/te-analysis/bi-panel-page-data/run.ts
|
|
1111
|
+
var biPanelPageDataRun = createAnalysisCapabilityCommand({
|
|
1112
|
+
resource: "bi-panel-page-data",
|
|
1113
|
+
command: "run",
|
|
1114
|
+
capabilityId: "analysis.bi_panel_page_data.run",
|
|
1115
|
+
description: "Run a bounded BI panel page data query and return inline JSON.",
|
|
1116
|
+
flags: [
|
|
1117
|
+
projectIdFlag,
|
|
1118
|
+
{ name: "panel-id", type: "number", required: true, desc: "BI panel ID." },
|
|
1119
|
+
{ name: "page-key", type: "string", required: true, desc: "Page key returned by bi-panel get." },
|
|
1120
|
+
{ name: "result-type", type: "string", required: true, desc: "Result type: charts or summary." },
|
|
1121
|
+
{ name: "chart-ids", type: "json", required: false, desc: "Optional chart ID array." },
|
|
1122
|
+
{ name: "parameter-controls", type: "json", required: false, desc: "Optional parameter control override array." },
|
|
1123
|
+
{ name: "permission-controls", type: "json", required: false, desc: "Optional permission control array." },
|
|
1124
|
+
{ name: "chart-filter-controls", type: "json", required: false, desc: "Optional chart filter control array." },
|
|
1125
|
+
{ name: "columns", type: "json", required: false, desc: "Optional returned column array." },
|
|
1126
|
+
{ name: "row-limit", type: "number", required: false, desc: "Chart row limit." },
|
|
1127
|
+
{ name: "row-offset", type: "number", required: false, desc: "Chart row offset." },
|
|
1128
|
+
{ name: "block-limit", type: "number", required: false, desc: "Summary block limit." },
|
|
1129
|
+
{ name: "block-offset", type: "number", required: false, desc: "Summary block offset." },
|
|
1130
|
+
{ name: "use-cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true." },
|
|
1131
|
+
{ name: "request-id", type: "string", required: false, desc: "Optional cli_<32 lowercase hex> request ID. Generated when omitted." },
|
|
1132
|
+
{ name: "timeout-seconds", type: "number", required: false, desc: "Sync timeout seconds. Default: 60, max: 180." },
|
|
1133
|
+
limitFlag
|
|
1134
|
+
],
|
|
1135
|
+
risk: "read",
|
|
1136
|
+
buildInput: biPanelPageDataInput
|
|
1137
|
+
});
|
|
1138
|
+
|
|
1139
|
+
// src/commands/te-analysis/bi-panel-page-data/export.ts
|
|
1140
|
+
var biPanelPageDataExport = createAnalysisCapabilityCommand({
|
|
1141
|
+
resource: "bi-panel-page-data",
|
|
1142
|
+
command: "export",
|
|
1143
|
+
capabilityId: "analysis.bi_panel_page_data.export",
|
|
1144
|
+
description: "Submit a BI panel page data query as an asynchronous gzip JSONL artifact.",
|
|
1145
|
+
flags: [
|
|
1146
|
+
projectIdFlag,
|
|
1147
|
+
{ name: "panel-id", type: "number", required: true, desc: "BI panel ID." },
|
|
1148
|
+
{ name: "page-key", type: "string", required: true, desc: "Page key returned by bi-panel get." },
|
|
1149
|
+
{ name: "result-type", type: "string", required: true, desc: "Result type: charts or summary." },
|
|
1150
|
+
{ name: "chart-ids", type: "json", required: false, desc: "Optional chart ID array." },
|
|
1151
|
+
{ name: "parameter-controls", type: "json", required: false, desc: "Optional parameter control override array." },
|
|
1152
|
+
{ name: "permission-controls", type: "json", required: false, desc: "Optional permission control array." },
|
|
1153
|
+
{ name: "chart-filter-controls", type: "json", required: false, desc: "Optional chart filter control array." },
|
|
1154
|
+
{ name: "columns", type: "json", required: false, desc: "Optional returned column array." },
|
|
1155
|
+
{ name: "row-limit", type: "number", required: false, desc: "Chart row limit." },
|
|
1156
|
+
{ name: "row-offset", type: "number", required: false, desc: "Chart row offset." },
|
|
1157
|
+
{ name: "block-limit", type: "number", required: false, desc: "Summary block limit." },
|
|
1158
|
+
{ name: "block-offset", type: "number", required: false, desc: "Summary block offset." },
|
|
1159
|
+
{ name: "use-cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true." },
|
|
1160
|
+
{ name: "request-id", type: "string", required: false, desc: "Optional cli_<32 lowercase hex> request ID. Generated when omitted." },
|
|
1161
|
+
{ name: "timeout-seconds", type: "number", required: false, desc: "Export timeout seconds. Default: 600, max: 600." },
|
|
1162
|
+
{ name: "artifact-format", type: "string", required: false, desc: "Artifact format. Only jsonl is supported." }
|
|
1163
|
+
],
|
|
1164
|
+
risk: "read",
|
|
1165
|
+
buildInput: biPanelPageDataInput
|
|
1166
|
+
});
|
|
1167
|
+
|
|
1168
|
+
// src/commands/te-analysis/bi-panel-page-data/index.ts
|
|
1169
|
+
var commands9 = [
|
|
1170
|
+
biPanelPageDataRun,
|
|
1171
|
+
biPanelPageDataExport
|
|
1172
|
+
];
|
|
1173
|
+
var bi_panel_page_data_default = commands9;
|
|
1174
|
+
|
|
1175
|
+
// src/commands/te-analysis/project-space/list.ts
|
|
1176
|
+
var projectSpaceList = createAnalysisCapabilityCommand({
|
|
1177
|
+
resource: "project-space",
|
|
1178
|
+
command: "list",
|
|
1179
|
+
capabilityId: "analysis.project_space.list",
|
|
1180
|
+
description: "List project spaces visible to the current user.",
|
|
1181
|
+
flags: [projectIdFlag, queryFlag, fieldsFlag, limitFlag, offsetFlag],
|
|
1182
|
+
risk: "read",
|
|
1183
|
+
buildInput: listInput
|
|
1184
|
+
});
|
|
1185
|
+
|
|
1186
|
+
// src/commands/te-analysis/project-space/get.ts
|
|
1187
|
+
var projectSpaceGet = createAnalysisCapabilityCommand({
|
|
1188
|
+
resource: "project-space",
|
|
1189
|
+
command: "get",
|
|
1190
|
+
capabilityId: "analysis.project_space.get",
|
|
1191
|
+
description: "Get one project space detail.",
|
|
1192
|
+
flags: [projectIdFlag, { name: "space-id", type: "number", required: true, desc: "Project space ID." }, fieldsFlag],
|
|
1193
|
+
risk: "read",
|
|
1194
|
+
buildInput: (ctx) => compactInput({
|
|
1195
|
+
...projectInput(ctx),
|
|
1196
|
+
space_id: ctx.num("space-id"),
|
|
1197
|
+
fields: optionalJson4(ctx, "fields")
|
|
1198
|
+
})
|
|
1199
|
+
});
|
|
1200
|
+
|
|
1201
|
+
// src/commands/te-analysis/project-space/create.ts
|
|
1202
|
+
var projectSpaceCreate = createAnalysisCapabilityCommand({
|
|
1203
|
+
resource: "project-space",
|
|
1204
|
+
command: "create",
|
|
1205
|
+
capabilityId: "analysis.project_space.create",
|
|
1206
|
+
description: "Create a project space.",
|
|
1207
|
+
flags: [
|
|
1208
|
+
projectIdFlag,
|
|
1209
|
+
{ name: "space-name", type: "string", required: false, desc: "Project space name." },
|
|
1210
|
+
{ name: "space-desc", type: "string", required: false, desc: "Project space description." },
|
|
1211
|
+
{ name: "avatar-type", type: "number", required: false, desc: "Avatar type." },
|
|
1212
|
+
{ name: "color-key", type: "string", required: false, desc: "Avatar color key." },
|
|
1213
|
+
{ name: "avatar", type: "string", required: false, desc: "Avatar value." },
|
|
1214
|
+
payloadFlag
|
|
1215
|
+
],
|
|
1216
|
+
risk: "write",
|
|
1217
|
+
buildInput: (ctx) => compactInput({
|
|
1218
|
+
...projectInput(ctx),
|
|
1219
|
+
space_name: optionalString3(ctx, "space-name"),
|
|
1220
|
+
space_desc: optionalString3(ctx, "space-desc"),
|
|
1221
|
+
avatar_type: optionalNumber3(ctx, "avatar-type"),
|
|
1222
|
+
color_key: optionalString3(ctx, "color-key"),
|
|
1223
|
+
avatar: optionalString3(ctx, "avatar"),
|
|
1224
|
+
payload: optionalJson4(ctx, "payload")
|
|
1225
|
+
})
|
|
1226
|
+
});
|
|
1227
|
+
|
|
1228
|
+
// src/commands/te-analysis/project-space/delete.ts
|
|
1229
|
+
var projectSpaceDelete = createAnalysisCapabilityCommand({
|
|
1230
|
+
resource: "project-space",
|
|
1231
|
+
command: "delete",
|
|
1232
|
+
capabilityId: "analysis.project_space.delete",
|
|
1233
|
+
description: "Delete one or more project spaces.",
|
|
1234
|
+
flags: [
|
|
1235
|
+
projectIdFlag,
|
|
1236
|
+
{ name: "space-id", type: "number", required: false, desc: "Project space ID." },
|
|
1237
|
+
{ name: "space-ids", type: "json", required: false, desc: "Project space ID array." }
|
|
1238
|
+
],
|
|
1239
|
+
risk: "write",
|
|
1240
|
+
buildInput: (ctx) => compactInput({
|
|
1241
|
+
...projectInput(ctx),
|
|
1242
|
+
space_id: optionalNumber3(ctx, "space-id"),
|
|
1243
|
+
space_ids: optionalJsonArray(ctx, "space-ids")
|
|
1244
|
+
})
|
|
1245
|
+
});
|
|
1246
|
+
|
|
1247
|
+
// src/commands/te-analysis/project-space/share.ts
|
|
1248
|
+
var projectSpaceShare = createAnalysisCapabilityCommand({
|
|
1249
|
+
resource: "project-space",
|
|
1250
|
+
command: "share",
|
|
1251
|
+
capabilityId: "analysis.project_space.share",
|
|
1252
|
+
description: "Modify project space sharing members.",
|
|
1253
|
+
flags: [projectIdFlag, { name: "space-id", type: "number", required: true, desc: "Project space ID." }, payloadFlag],
|
|
1254
|
+
risk: "write",
|
|
1255
|
+
buildInput: (ctx) => compactInput({
|
|
1256
|
+
...projectInput(ctx),
|
|
1257
|
+
space_id: ctx.num("space-id"),
|
|
1258
|
+
payload: optionalJson4(ctx, "payload")
|
|
1259
|
+
})
|
|
1260
|
+
});
|
|
1261
|
+
|
|
1262
|
+
// src/commands/te-analysis/project-space/members.ts
|
|
1263
|
+
var projectSpaceMembers = createAnalysisCapabilityCommand({
|
|
1264
|
+
resource: "project-space",
|
|
1265
|
+
command: "members",
|
|
1266
|
+
capabilityId: "analysis.project_space.members",
|
|
1267
|
+
description: "Get project space members.",
|
|
1268
|
+
flags: [projectIdFlag, { name: "space-id", type: "number", required: true, desc: "Project space ID." }],
|
|
1269
|
+
risk: "read",
|
|
1270
|
+
buildInput: (ctx) => ({
|
|
1271
|
+
...projectInput(ctx),
|
|
1272
|
+
space_id: ctx.num("space-id")
|
|
1273
|
+
})
|
|
1274
|
+
});
|
|
1275
|
+
|
|
1276
|
+
// src/commands/te-analysis/project-space/index.ts
|
|
1277
|
+
var commands10 = [
|
|
1278
|
+
projectSpaceList,
|
|
1279
|
+
projectSpaceGet,
|
|
1280
|
+
projectSpaceCreate,
|
|
1281
|
+
projectSpaceDelete,
|
|
1282
|
+
projectSpaceShare,
|
|
1283
|
+
projectSpaceMembers
|
|
1284
|
+
];
|
|
1285
|
+
var project_space_default = commands10;
|
|
1286
|
+
|
|
1287
|
+
// src/commands/te-analysis/folder/create.ts
|
|
1288
|
+
var folderCreate = createAnalysisCapabilityCommand({
|
|
1289
|
+
resource: "folder",
|
|
1290
|
+
command: "create",
|
|
1291
|
+
capabilityId: "analysis.folder.create",
|
|
1292
|
+
description: "Create a folder in personal space or project space.",
|
|
1293
|
+
flags: [
|
|
1294
|
+
projectIdFlag,
|
|
1295
|
+
{ name: "folder-name", type: "string", required: true, desc: "Folder name." },
|
|
1296
|
+
{ name: "space-id", type: "number", required: false, desc: "Project space ID. Omit for personal space." },
|
|
1297
|
+
{ name: "parent-folder-id", type: "number", required: false, desc: "Parent project-space folder ID." },
|
|
1298
|
+
payloadFlag
|
|
1299
|
+
],
|
|
1300
|
+
risk: "write",
|
|
1301
|
+
buildInput: (ctx) => compactInput({
|
|
1302
|
+
...projectInput(ctx),
|
|
1303
|
+
folder_name: ctx.str("folder-name"),
|
|
1304
|
+
space_id: optionalNumber3(ctx, "space-id"),
|
|
1305
|
+
parent_folder_id: optionalNumber3(ctx, "parent-folder-id"),
|
|
1306
|
+
payload: optionalJson4(ctx, "payload")
|
|
1307
|
+
})
|
|
1308
|
+
});
|
|
1309
|
+
|
|
1310
|
+
// src/commands/te-analysis/folder/delete.ts
|
|
1311
|
+
var folderDelete = createAnalysisCapabilityCommand({
|
|
1312
|
+
resource: "folder",
|
|
1313
|
+
command: "delete",
|
|
1314
|
+
capabilityId: "analysis.folder.delete",
|
|
1315
|
+
description: "Delete one or more folders.",
|
|
1316
|
+
flags: [
|
|
1317
|
+
projectIdFlag,
|
|
1318
|
+
{ name: "folder-id", type: "number", required: false, desc: "Folder ID." },
|
|
1319
|
+
{ name: "folder-ids", type: "json", required: false, desc: "Folder ID array." },
|
|
1320
|
+
{ name: "space-id", type: "number", required: false, desc: "Project space ID for project-space folders. Omit for personal folders." }
|
|
1321
|
+
],
|
|
1322
|
+
risk: "write",
|
|
1323
|
+
buildInput: (ctx) => compactInput({
|
|
1324
|
+
...projectInput(ctx),
|
|
1325
|
+
folder_id: optionalNumber3(ctx, "folder-id"),
|
|
1326
|
+
folder_ids: optionalJsonArray(ctx, "folder-ids"),
|
|
1327
|
+
space_id: optionalNumber3(ctx, "space-id")
|
|
1328
|
+
})
|
|
1329
|
+
});
|
|
1330
|
+
|
|
1331
|
+
// src/commands/te-analysis/folder/share.ts
|
|
1332
|
+
var folderShare = createAnalysisCapabilityCommand({
|
|
1333
|
+
resource: "folder",
|
|
1334
|
+
command: "share",
|
|
1335
|
+
capabilityId: "analysis.folder.share",
|
|
1336
|
+
description: "Modify folder sharing members.",
|
|
1337
|
+
flags: [projectIdFlag, { name: "folder-id", type: "number", required: true, desc: "Folder ID." }, payloadFlag],
|
|
1338
|
+
risk: "write",
|
|
1339
|
+
buildInput: (ctx) => compactInput({
|
|
1340
|
+
...projectInput(ctx),
|
|
1341
|
+
folder_id: ctx.num("folder-id"),
|
|
1342
|
+
payload: optionalJson4(ctx, "payload")
|
|
1343
|
+
})
|
|
1344
|
+
});
|
|
1345
|
+
|
|
1346
|
+
// src/commands/te-analysis/folder/members.ts
|
|
1347
|
+
var folderMembers = createAnalysisCapabilityCommand({
|
|
1348
|
+
resource: "folder",
|
|
1349
|
+
command: "members",
|
|
1350
|
+
capabilityId: "analysis.folder.members",
|
|
1351
|
+
description: "Get folder members.",
|
|
1352
|
+
flags: [projectIdFlag, { name: "folder-id", type: "number", required: true, desc: "Folder ID." }],
|
|
1353
|
+
risk: "read",
|
|
1354
|
+
buildInput: (ctx) => ({
|
|
1355
|
+
...projectInput(ctx),
|
|
1356
|
+
folder_id: ctx.num("folder-id")
|
|
1357
|
+
})
|
|
1358
|
+
});
|
|
1359
|
+
|
|
1360
|
+
// src/commands/te-analysis/folder/index.ts
|
|
1361
|
+
var commands11 = [
|
|
1362
|
+
folderCreate,
|
|
1363
|
+
folderDelete,
|
|
1364
|
+
folderShare,
|
|
1365
|
+
folderMembers
|
|
1366
|
+
];
|
|
1367
|
+
var folder_default = commands11;
|
|
1368
|
+
|
|
1369
|
+
// src/commands/te-analysis/favorite/add.ts
|
|
1370
|
+
var favoriteAdd = createAnalysisCapabilityCommand({
|
|
1371
|
+
resource: "favorite",
|
|
1372
|
+
command: "add",
|
|
1373
|
+
capabilityId: "analysis.favorite.add",
|
|
1374
|
+
description: "Favorite one dashboard, BI panel, or folder.",
|
|
1375
|
+
flags: [
|
|
1376
|
+
projectIdFlag,
|
|
1377
|
+
{ name: "asset-id", type: "number", required: false, desc: "Asset ID." },
|
|
1378
|
+
{ name: "asset-type", type: "string", required: false, desc: "Asset type, for example dashboard, bi_panel, or folder." },
|
|
1379
|
+
{ name: "space-id", type: "number", required: false, desc: "Project space ID when relevant." },
|
|
1380
|
+
{ name: "id", type: "number", required: false, desc: "Backend DTO ID field when required." },
|
|
1381
|
+
payloadFlag
|
|
1382
|
+
],
|
|
1383
|
+
risk: "write",
|
|
1384
|
+
buildInput: (ctx) => compactInput({
|
|
1385
|
+
...projectInput(ctx),
|
|
1386
|
+
asset_id: optionalNumber3(ctx, "asset-id"),
|
|
1387
|
+
asset_type: optionalString3(ctx, "asset-type"),
|
|
1388
|
+
space_id: optionalNumber3(ctx, "space-id"),
|
|
1389
|
+
id: optionalNumber3(ctx, "id"),
|
|
1390
|
+
payload: optionalJson4(ctx, "payload")
|
|
1391
|
+
})
|
|
1392
|
+
});
|
|
1393
|
+
|
|
1394
|
+
// src/commands/te-analysis/favorite/remove.ts
|
|
1395
|
+
var favoriteRemove = createAnalysisCapabilityCommand({
|
|
1396
|
+
resource: "favorite",
|
|
1397
|
+
command: "remove",
|
|
1398
|
+
capabilityId: "analysis.favorite.remove",
|
|
1399
|
+
description: "Remove favorite from one dashboard, BI panel, or folder.",
|
|
1400
|
+
flags: [
|
|
1401
|
+
projectIdFlag,
|
|
1402
|
+
{ name: "asset-id", type: "number", required: false, desc: "Asset ID." },
|
|
1403
|
+
{ name: "asset-type", type: "string", required: false, desc: "Asset type, for example dashboard, bi_panel, or folder." },
|
|
1404
|
+
{ name: "space-id", type: "number", required: false, desc: "Project space ID when relevant." },
|
|
1405
|
+
{ name: "id", type: "number", required: false, desc: "Backend DTO ID field when required." },
|
|
1406
|
+
payloadFlag
|
|
1407
|
+
],
|
|
1408
|
+
risk: "write",
|
|
1409
|
+
buildInput: (ctx) => compactInput({
|
|
1410
|
+
...projectInput(ctx),
|
|
1411
|
+
asset_id: optionalNumber3(ctx, "asset-id"),
|
|
1412
|
+
asset_type: optionalString3(ctx, "asset-type"),
|
|
1413
|
+
space_id: optionalNumber3(ctx, "space-id"),
|
|
1414
|
+
id: optionalNumber3(ctx, "id"),
|
|
1415
|
+
payload: optionalJson4(ctx, "payload")
|
|
1416
|
+
})
|
|
1417
|
+
});
|
|
1418
|
+
|
|
1419
|
+
// src/commands/te-analysis/favorite/index.ts
|
|
1420
|
+
var commands12 = [
|
|
1421
|
+
favoriteAdd,
|
|
1422
|
+
favoriteRemove
|
|
1423
|
+
];
|
|
1424
|
+
var favorite_default = commands12;
|
|
1425
|
+
|
|
1426
|
+
// src/commands/te-analysis/public-link/create.ts
|
|
1427
|
+
var publicLinkCreate = createAnalysisCapabilityCommand({
|
|
1428
|
+
resource: "public-link",
|
|
1429
|
+
command: "create",
|
|
1430
|
+
capabilityId: "analysis.public_link.create",
|
|
1431
|
+
description: "Create a public link for a dashboard or BI panel.",
|
|
1432
|
+
flags: [
|
|
1433
|
+
projectIdFlag,
|
|
1434
|
+
{ name: "company-id", type: "number", required: false, desc: "Company ID. Derived from project ID when omitted." },
|
|
1435
|
+
{ name: "resource-type", type: "string", required: true, desc: "Resource type: dashboard or bi_panel." },
|
|
1436
|
+
{ name: "resource-id", type: "number", required: true, desc: "Target resource ID." },
|
|
1437
|
+
{ name: "access-controls", type: "json", required: false, desc: "Public link access-control JSON." },
|
|
1438
|
+
{ name: "remark", type: "string", required: false, desc: "Public link remark." },
|
|
1439
|
+
{ name: "effective-at", type: "string", required: true, desc: "Effective time, yyyy-MM-dd HH:mm:ss." },
|
|
1440
|
+
{ name: "expires-at", type: "string", required: true, desc: "Expiration time, yyyy-MM-dd HH:mm:ss." },
|
|
1441
|
+
payloadFlag
|
|
1442
|
+
],
|
|
1443
|
+
risk: "write",
|
|
1444
|
+
buildInput: (ctx) => compactInput({
|
|
1445
|
+
...projectInput(ctx),
|
|
1446
|
+
company_id: optionalNumber3(ctx, "company-id"),
|
|
1447
|
+
resource_type: ctx.str("resource-type"),
|
|
1448
|
+
resource_id: ctx.num("resource-id"),
|
|
1449
|
+
access_controls: optionalJson4(ctx, "access-controls"),
|
|
1450
|
+
remark: optionalString3(ctx, "remark"),
|
|
1451
|
+
effective_at: ctx.str("effective-at"),
|
|
1452
|
+
expires_at: ctx.str("expires-at"),
|
|
1453
|
+
payload: optionalJson4(ctx, "payload")
|
|
1454
|
+
})
|
|
1455
|
+
});
|
|
1456
|
+
|
|
1457
|
+
// src/commands/te-analysis/public-link/list.ts
|
|
1458
|
+
var publicLinkList = createAnalysisCapabilityCommand({
|
|
1459
|
+
resource: "public-link",
|
|
1460
|
+
command: "list",
|
|
1461
|
+
capabilityId: "analysis.public_link.list",
|
|
1462
|
+
description: "List public links in a project.",
|
|
1463
|
+
flags: [projectIdFlag, queryFlag, fieldsFlag, limitFlag, offsetFlag],
|
|
1464
|
+
risk: "read",
|
|
1465
|
+
buildInput: listInput
|
|
1466
|
+
});
|
|
1467
|
+
|
|
1468
|
+
// src/commands/te-analysis/public-link/update.ts
|
|
1469
|
+
var publicLinkUpdate = createAnalysisCapabilityCommand({
|
|
1470
|
+
resource: "public-link",
|
|
1471
|
+
command: "update",
|
|
1472
|
+
capabilityId: "analysis.public_link.update",
|
|
1473
|
+
description: "Update a public link.",
|
|
1474
|
+
flags: [
|
|
1475
|
+
projectIdFlag,
|
|
1476
|
+
{ name: "company-id", type: "number", required: false, desc: "Company ID. Derived from project ID when omitted." },
|
|
1477
|
+
{ name: "link-id", type: "number", required: true, desc: "Public link ID." },
|
|
1478
|
+
{ name: "access-controls", type: "json", required: false, desc: "Public link access-control JSON." },
|
|
1479
|
+
{ name: "remark", type: "string", required: false, desc: "Public link remark." },
|
|
1480
|
+
{ name: "effective-at", type: "string", required: true, desc: "Effective time, yyyy-MM-dd HH:mm:ss." },
|
|
1481
|
+
{ name: "expires-at", type: "string", required: true, desc: "Expiration time, yyyy-MM-dd HH:mm:ss." },
|
|
1482
|
+
payloadFlag
|
|
1483
|
+
],
|
|
1484
|
+
risk: "write",
|
|
1485
|
+
buildInput: (ctx) => compactInput({
|
|
1486
|
+
...projectInput(ctx),
|
|
1487
|
+
company_id: optionalNumber3(ctx, "company-id"),
|
|
1488
|
+
link_id: ctx.num("link-id"),
|
|
1489
|
+
access_controls: optionalJson4(ctx, "access-controls"),
|
|
1490
|
+
remark: optionalString3(ctx, "remark"),
|
|
1491
|
+
effective_at: ctx.str("effective-at"),
|
|
1492
|
+
expires_at: ctx.str("expires-at"),
|
|
1493
|
+
payload: optionalJson4(ctx, "payload")
|
|
1494
|
+
})
|
|
1495
|
+
});
|
|
1496
|
+
|
|
1497
|
+
// src/commands/te-analysis/public-link/offline.ts
|
|
1498
|
+
var publicLinkOffline = createAnalysisCapabilityCommand({
|
|
1499
|
+
resource: "public-link",
|
|
1500
|
+
command: "offline",
|
|
1501
|
+
capabilityId: "analysis.public_link.offline",
|
|
1502
|
+
description: "Offline one or more public links.",
|
|
1503
|
+
flags: [
|
|
1504
|
+
projectIdFlag,
|
|
1505
|
+
{ name: "company-id", type: "number", required: false, desc: "Company ID. Derived from project ID when omitted." },
|
|
1506
|
+
{ name: "link-id", type: "number", required: false, desc: "Public link ID." },
|
|
1507
|
+
{ name: "link-ids", type: "json", required: false, desc: "Public link ID array." }
|
|
1508
|
+
],
|
|
1509
|
+
risk: "write",
|
|
1510
|
+
buildInput: (ctx) => compactInput({
|
|
1511
|
+
...projectInput(ctx),
|
|
1512
|
+
company_id: optionalNumber3(ctx, "company-id"),
|
|
1513
|
+
link_id: optionalNumber3(ctx, "link-id"),
|
|
1514
|
+
link_ids: optionalJsonArray(ctx, "link-ids")
|
|
1515
|
+
})
|
|
1516
|
+
});
|
|
1517
|
+
|
|
1518
|
+
// src/commands/te-analysis/public-link/delete.ts
|
|
1519
|
+
var publicLinkDelete = createAnalysisCapabilityCommand({
|
|
1520
|
+
resource: "public-link",
|
|
1521
|
+
command: "delete",
|
|
1522
|
+
capabilityId: "analysis.public_link.delete",
|
|
1523
|
+
description: "Delete one or more public links.",
|
|
1524
|
+
flags: [
|
|
1525
|
+
projectIdFlag,
|
|
1526
|
+
{ name: "company-id", type: "number", required: false, desc: "Company ID. Derived from project ID when omitted." },
|
|
1527
|
+
{ name: "link-id", type: "number", required: false, desc: "Public link ID." },
|
|
1528
|
+
{ name: "link-ids", type: "json", required: false, desc: "Public link ID array." }
|
|
1529
|
+
],
|
|
1530
|
+
risk: "write",
|
|
1531
|
+
buildInput: (ctx) => compactInput({
|
|
1532
|
+
...projectInput(ctx),
|
|
1533
|
+
company_id: optionalNumber3(ctx, "company-id"),
|
|
1534
|
+
link_id: optionalNumber3(ctx, "link-id"),
|
|
1535
|
+
link_ids: optionalJsonArray(ctx, "link-ids")
|
|
1536
|
+
})
|
|
1537
|
+
});
|
|
1538
|
+
|
|
1539
|
+
// src/commands/te-analysis/public-link/index.ts
|
|
1540
|
+
var commands13 = [
|
|
1541
|
+
publicLinkCreate,
|
|
1542
|
+
publicLinkList,
|
|
1543
|
+
publicLinkUpdate,
|
|
1544
|
+
publicLinkOffline,
|
|
1545
|
+
publicLinkDelete
|
|
1546
|
+
];
|
|
1547
|
+
var public_link_default = commands13;
|
|
1548
|
+
|
|
1549
|
+
// src/commands/te-analysis/model/query-adhoc.ts
|
|
1550
|
+
var queryAdhoc = createMcpCommand({
|
|
1551
|
+
command: "+query_adhoc",
|
|
1552
|
+
description: "Run ad hoc analysis with an already-built qp. For event, retention, funnel, and prop_analysis, call the matching +build_*_analysis_qp command first and pass its qp; do not handcraft qp or call get_analysis_query_schema/list_events/list_properties/list_metrics/get_metric before the builder. For distribution, attribution, heat_map, interval, path, rank_list, and sql, use the legacy schema/metadata path. Supports fields/limit/offset pagination. For long-running or cancelable queries, requestId is required and must be provided before starting. For any query that may exceed the CLI or MCP HTTP timeout, generate requestId first so you can call +cancel_query --request_id <same value> if you stop waiting or the request returns fetch failed. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Submitted queries return metadata.requestId; pass that value to cancel_query(requestId) when the query is no longer needed. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If requestId is omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID.",
|
|
1553
|
+
flags: [
|
|
1554
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1555
|
+
{ name: "model_type", type: "string", required: true, desc: "Model type. Supported values: event, retention, funnel, distribution, attribution, heat_map, interval, path, rank_list, prop_analysis, sql." },
|
|
1556
|
+
{ name: "qp", type: "json", required: true, desc: "Query parameter JSON. For event/retention/funnel/prop_analysis, pass qp returned by the matching +build_*_analysis_qp command. Use +get_analysis_query_schema only for non-builder/manual model types." },
|
|
1557
|
+
{ name: "request_id", type: "string", required: true, desc: "Required unique request ID used for tracking and cancellation. Generate it before starting the query. It must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Provide this before starting the query so it can be cancelled later with +cancel_query --request_id <same value>, even if the caller stops waiting before the tool returns. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID. The response metadata.requestId echoes the supplied requestId and can also be passed to cancel_query(requestId) when the query is no longer needed." },
|
|
1558
|
+
{ name: "use_cache", type: "boolean", required: false, desc: "Whether to use result cache. Default: true" },
|
|
1559
|
+
{ name: "zone_offset", type: "number", required: false, desc: "Time zone offset in hours. For example, UTC+8 is 8 and UTC-5 is -5" },
|
|
1560
|
+
{ name: "is_sort_by_columns", type: "boolean", required: false, desc: "Whether to sort query results by columns. Default: false" },
|
|
1561
|
+
{ name: "resolve_recent_day", type: "boolean", required: false, desc: "Whether to resolve relative time expressions such as last 7 days. If omitted, the service auto-resolves when qp.eventView.recentDay exists and start/end time is incomplete; otherwise it defaults to false." },
|
|
1562
|
+
{ name: "fields", type: "json", required: false, desc: "Optional fields to return. Must match column names in result." },
|
|
1563
|
+
{ name: "limit", type: "number", required: false, desc: "Optional limit. Default: 1000, maximum: 10000. For model_type=sql, either omit LIMIT in the SQL or keep it equal to --limit (the two must not differ)." },
|
|
1564
|
+
{ name: "offset", type: "number", required: false, desc: "Optional offset. Default: 0." },
|
|
1565
|
+
{ name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." },
|
|
1566
|
+
...clusterQueryFlags("Optional cluster query scope. Supported values: GLOBAL, SLAVE. Omit to query the current self cluster. SQL model analysis does not support this parameter.")
|
|
1567
|
+
],
|
|
1568
|
+
risk: "read",
|
|
1569
|
+
validate: (ctx) => {
|
|
1570
|
+
const limit = optionalNumber(ctx, "limit");
|
|
1571
|
+
assertLimitWithinCap(limit, "limit");
|
|
1572
|
+
if (ctx.str("model_type") === "sql") {
|
|
1573
|
+
assertSqlLimitConsistent(ctx.json("qp"), limit);
|
|
1574
|
+
}
|
|
1575
|
+
},
|
|
1576
|
+
buildArgs: (ctx) => ({
|
|
1577
|
+
projectId: ctx.num("project_id"),
|
|
1578
|
+
modelType: ctx.str("model_type"),
|
|
1579
|
+
qp: requiredJsonString(ctx, "qp"),
|
|
1580
|
+
requestId: ctx.str("request_id"),
|
|
1581
|
+
useCache: optionalBoolean(ctx, "use_cache"),
|
|
1582
|
+
zoneOffset: optionalNumber(ctx, "zone_offset"),
|
|
1583
|
+
isSortByColumns: optionalBoolean(ctx, "is_sort_by_columns"),
|
|
1584
|
+
resolveRecentDay: optionalBoolean(ctx, "resolve_recent_day"),
|
|
1585
|
+
fields: optionalJson(ctx, "fields"),
|
|
1586
|
+
limit: resolveSqlAwareLimit(optionalNumber(ctx, "limit"), ctx.str("model_type"), ctx.json("qp")),
|
|
1587
|
+
offset: optionalNumber(ctx, "offset"),
|
|
1588
|
+
timeoutMinutes: optionalNumber(ctx, "timeout_minutes"),
|
|
1589
|
+
...optionalClusterQueryArgs(ctx)
|
|
1590
|
+
})
|
|
1591
|
+
});
|
|
1592
|
+
|
|
1593
|
+
// src/commands/te-analysis/model/cancel-query.ts
|
|
1594
|
+
var cancelQuery = createMcpCommand({
|
|
1595
|
+
command: "+cancel_query",
|
|
1596
|
+
description: "Cancel a running MCP query by request ID. Use this when a previous query is no longer needed, the caller or agent timed out before the query returned, the request returns fetch failed, hits an HTTP timeout, or the user asks to stop waiting. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running; call +cancel_query --request_id <same value> with the requestId supplied before starting the query. For proactive cancellation, generate and pass requestId to the query tool before starting it, then call cancel_query with the same value if you stop waiting.",
|
|
1597
|
+
flags: [
|
|
1598
|
+
{ name: "request_id", type: "string", required: true, desc: "Request ID returned by a query tool in metadata.requestId, or the requestId supplied before starting the query. It must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef." },
|
|
1599
|
+
{ name: "reason", type: "string", required: false, desc: "Optional cancellation reason. Default: MCP_CANCEL_QUERY_TOOL." }
|
|
1600
|
+
],
|
|
1601
|
+
risk: "write",
|
|
1602
|
+
buildArgs: (ctx) => ({
|
|
1603
|
+
requestId: ctx.str("request_id"),
|
|
1604
|
+
reason: optionalString(ctx, "reason")
|
|
1605
|
+
})
|
|
1606
|
+
});
|
|
1607
|
+
|
|
1608
|
+
// src/commands/te-analysis/model/build-event-analysis-qp.ts
|
|
1609
|
+
var buildEventAnalysisQp = createMcpCommand({
|
|
1610
|
+
command: "+build_event_analysis_qp",
|
|
1611
|
+
description: "Build a validated event-analysis QP from structured intent. Call before query_adhoc for event ad-hoc analysis. Do not call get_analysis_query_schema/list_events/list_properties/list_metrics/get_metric first; the builder resolves events, properties, and saved metric names internally. For a saved metric, pass its name in metrics[].event. This command only builds qp and does not execute query_adhoc.",
|
|
1612
|
+
flags: [
|
|
1613
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1614
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for event analysis." },
|
|
1615
|
+
{ name: "metrics", type: "json", required: true, desc: "Required event metrics JSON array." },
|
|
1616
|
+
{ name: "time_particle_size", type: "string", required: false, desc: "Optional time granularity. Default: total." },
|
|
1617
|
+
{ name: "groups", type: "json", required: false, desc: "Optional group-by dimensions JSON array." },
|
|
1618
|
+
{ name: "filters", type: "json", required: false, desc: "Optional global filters JSON array." },
|
|
1619
|
+
{ name: "relation", type: "string", required: false, desc: "Optional filter relation. Supported values: and, or. Default: and." },
|
|
1620
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
1621
|
+
],
|
|
1622
|
+
risk: "read",
|
|
1623
|
+
buildArgs: (ctx) => ({
|
|
1624
|
+
projectId: ctx.num("project_id"),
|
|
1625
|
+
timeRange: ctx.json("time_range"),
|
|
1626
|
+
metrics: ctx.json("metrics"),
|
|
1627
|
+
timeParticleSize: ctx.str("time_particle_size") || void 0,
|
|
1628
|
+
groups: optionalJson(ctx, "groups"),
|
|
1629
|
+
filters: optionalJson(ctx, "filters"),
|
|
1630
|
+
relation: ctx.str("relation") || void 0,
|
|
1631
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
1632
|
+
})
|
|
1633
|
+
});
|
|
1634
|
+
|
|
1635
|
+
// src/commands/te-analysis/model/build-retention-analysis-qp.ts
|
|
1636
|
+
var buildRetentionAnalysisQp = createMcpCommand({
|
|
1637
|
+
command: "+build_retention_analysis_qp",
|
|
1638
|
+
description: "Build a validated retention-analysis QP from structured intent. Call before query_adhoc for retention ad-hoc analysis. Do not call get_analysis_query_schema/list_events/list_properties/list_metrics/get_metric first; the builder resolves events and properties internally. This command only builds qp and does not execute query_adhoc.",
|
|
1639
|
+
flags: [
|
|
1640
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1641
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for retention analysis." },
|
|
1642
|
+
{ name: "retention", type: "json", required: true, desc: "Required retention intent JSON." },
|
|
1643
|
+
{ name: "relation", type: "string", required: false, desc: "Optional top-level retention filter relation. Supported values: and, or. Default: and." },
|
|
1644
|
+
{ name: "time_particle_size", type: "string", required: false, desc: "Optional time granularity. Supported values: day, week, month." },
|
|
1645
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
1646
|
+
],
|
|
1647
|
+
risk: "read",
|
|
1648
|
+
buildArgs: (ctx) => ({
|
|
1649
|
+
projectId: ctx.num("project_id"),
|
|
1650
|
+
timeRange: ctx.json("time_range"),
|
|
1651
|
+
retention: ctx.json("retention"),
|
|
1652
|
+
relation: ctx.str("relation") || void 0,
|
|
1653
|
+
timeParticleSize: ctx.str("time_particle_size") || void 0,
|
|
1654
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
1655
|
+
})
|
|
1656
|
+
});
|
|
1657
|
+
|
|
1658
|
+
// src/commands/te-analysis/model/build-funnel-analysis-qp.ts
|
|
1659
|
+
var buildFunnelAnalysisQp = createMcpCommand({
|
|
1660
|
+
command: "+build_funnel_analysis_qp",
|
|
1661
|
+
description: "Build a validated funnel-analysis QP from structured intent. Call before query_adhoc for funnel ad-hoc analysis. Do not call get_analysis_query_schema/list_events/list_properties/list_metrics/get_metric first; the builder resolves events and properties internally. This command only builds qp and does not execute query_adhoc.",
|
|
1662
|
+
flags: [
|
|
1663
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1664
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for funnel analysis." },
|
|
1665
|
+
{ name: "funnel", type: "json", required: true, desc: "Required funnel intent JSON." },
|
|
1666
|
+
{ name: "relation", type: "string", required: false, desc: "Optional top-level funnel filter relation. Supported values: and, or. Default: and." },
|
|
1667
|
+
{ name: "time_particle_size", type: "string", required: false, desc: "Optional time granularity. Supported values: day, week, month." },
|
|
1668
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
1669
|
+
],
|
|
1670
|
+
risk: "read",
|
|
1671
|
+
buildArgs: (ctx) => ({
|
|
1672
|
+
projectId: ctx.num("project_id"),
|
|
1673
|
+
timeRange: ctx.json("time_range"),
|
|
1674
|
+
funnel: ctx.json("funnel"),
|
|
1675
|
+
relation: ctx.str("relation") || void 0,
|
|
1676
|
+
timeParticleSize: ctx.str("time_particle_size") || void 0,
|
|
1677
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
1678
|
+
})
|
|
1679
|
+
});
|
|
1680
|
+
|
|
1681
|
+
// src/commands/te-analysis/model/build-prop-analysis-qp.ts
|
|
1682
|
+
var buildPropAnalysisQp = createMcpCommand({
|
|
1683
|
+
command: "+build_prop_analysis_qp",
|
|
1684
|
+
description: "Build a validated prop-analysis QP from structured intent. Call before query_adhoc for prop_analysis ad-hoc analysis. Do not call get_analysis_query_schema/list_properties/list_metrics/get_metric first; the builder resolves user properties internally. This command only builds qp and does not execute query_adhoc.",
|
|
1685
|
+
flags: [
|
|
1686
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1687
|
+
{ name: "prop_analysis", type: "json", required: true, desc: "Required user property analysis intent JSON." },
|
|
1688
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
1689
|
+
],
|
|
1690
|
+
risk: "read",
|
|
1691
|
+
buildArgs: (ctx) => ({
|
|
1692
|
+
projectId: ctx.num("project_id"),
|
|
1693
|
+
propAnalysis: ctx.json("prop_analysis"),
|
|
1694
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
1695
|
+
})
|
|
1696
|
+
});
|
|
1697
|
+
|
|
1698
|
+
// src/commands/te-analysis/model/drilldown-users.ts
|
|
1699
|
+
var drilldownUsers = createMcpCommand({
|
|
1700
|
+
command: "+drilldown_users",
|
|
1701
|
+
description: "Drill down to the user list for a specific data point in an existing analysis result. Use only after query_adhoc, query_report_data, or query_dashboard_report_data, and keep qp consistent with the source analysis. Supports pagination with limit/offset. For long-running or cancelable queries, requestId is required and must be provided before starting. For any query that may exceed the CLI or MCP HTTP timeout, generate requestId first so you can call +cancel_query --request_id <same value> if you stop waiting or the request returns fetch failed. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Submitted queries return metadata.requestId; pass that value to cancel_query(requestId) when the query is no longer needed. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If requestId is omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID.",
|
|
1702
|
+
flags: [
|
|
1703
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1704
|
+
{ name: "model_type", type: "string", required: true, desc: "Model type used in the source analysis. Supported values: event, retention, funnel, distribution, attribution, heat_map, interval, path, rank_list, prop_analysis, sql." },
|
|
1705
|
+
{ name: "qp", type: "json", required: true, desc: "Query parameter JSON from the source analysis. Keep it consistent with the original analysis." },
|
|
1706
|
+
{ name: "properties", type: "json", required: false, desc: "Optional user properties JSON array. If omitted, default properties are returned." },
|
|
1707
|
+
{ name: "zone_offset", type: "number", required: false, desc: "Time zone offset in hours. For example, UTC+8 is 8" },
|
|
1708
|
+
{ name: "drilldown_date", type: "string", required: false, desc: "Target drilldown date from the analysis result. Format: yyyy-MM-dd" },
|
|
1709
|
+
{ name: "drilldown_groups", type: "json", required: false, desc: 'Drilldown group values from the analysis result as a JSON array, for example ["ios"]' },
|
|
1710
|
+
{ name: "event_index", type: "number", required: false, desc: "Event index for event-model drilldown. Use the event position from the analysis result starting from 0." },
|
|
1711
|
+
{ name: "is_lost", type: "boolean", required: false, desc: "For retention analysis, true queries lost users and false queries retained users. Default: false" },
|
|
1712
|
+
{ name: "retention_days", type: "number", required: false, desc: "Retention interval in days from the analysis result, for example 7 for day-7 retention" },
|
|
1713
|
+
{ name: "is_churned_user", type: "boolean", required: false, desc: "For funnel analysis, true queries churned users and false queries converted users. Default: false" },
|
|
1714
|
+
{ name: "funnel_step", type: "number", required: false, desc: "Funnel step number from the analysis result starting from 1" },
|
|
1715
|
+
{ name: "interval", type: "string", required: false, desc: "Interval used for interval analysis" },
|
|
1716
|
+
{ name: "distribution_bucket", type: "number", required: false, desc: "Distribution bucket index from the analysis result" },
|
|
1717
|
+
{ name: "compare_index", type: "number", required: false, desc: "Comparison index used in comparison analysis scenarios" },
|
|
1718
|
+
{ name: "include_total", type: "boolean", required: false, desc: "Whether to query users from the total row. Default: false" },
|
|
1719
|
+
{ name: "relation_val", type: "string", required: false, desc: "Relation value used in relation analysis scenarios" },
|
|
1720
|
+
{ name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
|
|
1721
|
+
{ name: "limit", type: "number", required: false, desc: "Optional limit. Default: 1000, maximum: 10000." },
|
|
1722
|
+
{ name: "offset", type: "number", required: false, desc: "Optional offset. Default: 0." },
|
|
1723
|
+
{ name: "request_id", type: "string", required: true, desc: "Required unique request ID used for tracking and cancellation. Generate it before starting the query. It must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Provide this before starting the query so it can be cancelled later with +cancel_query --request_id <same value>, even if the caller stops waiting before the tool returns. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID. The response metadata.requestId echoes the supplied requestId and can also be passed to cancel_query(requestId) when the query is no longer needed." },
|
|
1724
|
+
{ name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
|
|
1725
|
+
],
|
|
1726
|
+
risk: "read",
|
|
1727
|
+
validate: (ctx) => {
|
|
1728
|
+
assertLimitWithinCap(optionalNumber(ctx, "limit"), "limit");
|
|
1729
|
+
},
|
|
1730
|
+
buildArgs: (ctx) => ({
|
|
1731
|
+
projectId: ctx.num("project_id"),
|
|
1732
|
+
modelType: ctx.str("model_type"),
|
|
1733
|
+
qp: requiredJsonString(ctx, "qp"),
|
|
1734
|
+
properties: optionalJsonString(ctx, "properties"),
|
|
1735
|
+
zoneOffset: optionalNumber(ctx, "zone_offset"),
|
|
1736
|
+
drilldownDate: optionalString(ctx, "drilldown_date"),
|
|
1737
|
+
drilldownGroups: optionalJsonString(ctx, "drilldown_groups"),
|
|
1738
|
+
eventIndex: optionalNumber(ctx, "event_index"),
|
|
1739
|
+
isLost: optionalBoolean(ctx, "is_lost"),
|
|
1740
|
+
retentionDays: optionalNumber(ctx, "retention_days"),
|
|
1741
|
+
isChurnedUser: optionalBoolean(ctx, "is_churned_user"),
|
|
1742
|
+
funnelStep: optionalNumber(ctx, "funnel_step"),
|
|
1743
|
+
interval: optionalString(ctx, "interval"),
|
|
1744
|
+
distributionBucket: optionalNumber(ctx, "distribution_bucket"),
|
|
1745
|
+
compareIndex: optionalNumber(ctx, "compare_index"),
|
|
1746
|
+
includeTotal: optionalBoolean(ctx, "include_total"),
|
|
1747
|
+
relationVal: optionalString(ctx, "relation_val"),
|
|
1748
|
+
useCache: optionalBoolean(ctx, "use_cache"),
|
|
1749
|
+
limit: optionalNumber(ctx, "limit") ?? DEFAULT_QUERY_LIMIT,
|
|
1750
|
+
offset: optionalNumber(ctx, "offset"),
|
|
1751
|
+
requestId: ctx.str("request_id"),
|
|
1752
|
+
timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
|
|
1753
|
+
})
|
|
1754
|
+
});
|
|
1755
|
+
|
|
1756
|
+
// src/commands/te-analysis/model/drilldown-user-events.ts
|
|
1757
|
+
var drilldownUserEvents = createMcpCommand({
|
|
1758
|
+
command: "+drilldown_user_events",
|
|
1759
|
+
description: "Drill down to detailed event sequences for a specific user on specific dates. Use the result of drilldown_users and keep event names and dates consistent with the source analysis. For long-running or cancelable queries, requestId is required and must be provided before starting. For any query that may exceed the CLI or MCP HTTP timeout, generate requestId first so you can call +cancel_query --request_id <same value> if you stop waiting or the request returns fetch failed. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Submitted queries return metadata.requestId; pass that value to cancel_query(requestId) when the query is no longer needed. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If requestId is omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID.",
|
|
1760
|
+
flags: [
|
|
1761
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1762
|
+
{ name: "user_id", type: "string", required: true, desc: "User ID from drilldown_users" },
|
|
1763
|
+
{ name: "event_names", type: "json", required: true, desc: "JSON array of event names" },
|
|
1764
|
+
{ name: "target_dates", type: "json", required: true, desc: "JSON array of discrete target dates" },
|
|
1765
|
+
{ name: "zone_offset", type: "number", required: false, desc: "Time zone offset in hours. For example, UTC+8 is 8" },
|
|
1766
|
+
{ name: "properties", type: "json", required: false, desc: "Optional event properties JSON array" },
|
|
1767
|
+
{ name: "time_granularity", type: "string", required: false, desc: "Time granularity. Supported values: T0, T1, T2, T3, T4, T5, T6, T7" },
|
|
1768
|
+
{ name: "first_day_of_week", type: "number", required: false, desc: "First day of week. Supported values: 1-7" },
|
|
1769
|
+
{ name: "sort_order", type: "string", required: false, desc: "Sort order. Supported values: asc and desc" },
|
|
1770
|
+
{ name: "event_name_filter", type: "string", required: false, desc: "Optional event name filter" },
|
|
1771
|
+
{ name: "time_filter", type: "string", required: false, desc: "Optional time filter condition" },
|
|
1772
|
+
{ name: "time_filter_before_nums", type: "number", required: false, desc: "Number of records before the time filter point" },
|
|
1773
|
+
{ name: "time_filter_after_nums", type: "number", required: false, desc: "Number of records after the time filter point" },
|
|
1774
|
+
{ name: "entity_id", type: "number", required: false, desc: "Optional entity ID for multi-entity scenarios" },
|
|
1775
|
+
{ name: "entity_value", type: "string", required: false, desc: "Optional entity value for multi-entity scenarios" },
|
|
1776
|
+
{ name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
|
|
1777
|
+
{ name: "page_num", type: "number", required: false, desc: "Start page number. Default: 1" },
|
|
1778
|
+
{ name: "page_size", type: "number", required: false, desc: "Page size. Default: 1000, maximum: 10000." },
|
|
1779
|
+
{ name: "request_id", type: "string", required: true, desc: "Required unique request ID used for tracking and cancellation. Generate it before starting the query. It must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Provide this before starting the query so it can be cancelled later with +cancel_query --request_id <same value>, even if the caller stops waiting before the tool returns. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID. The response metadata.requestId echoes the supplied requestId and can also be passed to cancel_query(requestId) when the query is no longer needed." },
|
|
1780
|
+
{ name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
|
|
1781
|
+
],
|
|
1782
|
+
risk: "read",
|
|
1783
|
+
validate: (ctx) => {
|
|
1784
|
+
assertLimitWithinCap(optionalNumber(ctx, "page_size"), "page_size");
|
|
1785
|
+
},
|
|
1786
|
+
buildArgs: (ctx) => ({
|
|
1787
|
+
projectId: ctx.num("project_id"),
|
|
1788
|
+
userId: ctx.str("user_id"),
|
|
1789
|
+
eventNames: requiredJsonString(ctx, "event_names"),
|
|
1790
|
+
targetDates: requiredJsonString(ctx, "target_dates"),
|
|
1791
|
+
zoneOffset: optionalNumber(ctx, "zone_offset"),
|
|
1792
|
+
properties: optionalJsonString(ctx, "properties"),
|
|
1793
|
+
timeGranularity: optionalString(ctx, "time_granularity"),
|
|
1794
|
+
firstDayOfWeek: optionalNumber(ctx, "first_day_of_week"),
|
|
1795
|
+
sortOrder: optionalString(ctx, "sort_order"),
|
|
1796
|
+
eventNameFilter: optionalString(ctx, "event_name_filter"),
|
|
1797
|
+
timeFilter: optionalString(ctx, "time_filter"),
|
|
1798
|
+
timeFilterBeforeNums: optionalNumber(ctx, "time_filter_before_nums"),
|
|
1799
|
+
timeFilterAfterNums: optionalNumber(ctx, "time_filter_after_nums"),
|
|
1800
|
+
entityId: optionalNumber(ctx, "entity_id"),
|
|
1801
|
+
entityValue: optionalString(ctx, "entity_value"),
|
|
1802
|
+
useCache: optionalBoolean(ctx, "use_cache"),
|
|
1803
|
+
pageNum: optionalNumber(ctx, "page_num"),
|
|
1804
|
+
pageSize: optionalNumber(ctx, "page_size") ?? DEFAULT_QUERY_LIMIT,
|
|
1805
|
+
requestId: ctx.str("request_id"),
|
|
1806
|
+
timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
|
|
1807
|
+
})
|
|
1808
|
+
});
|
|
1809
|
+
|
|
1810
|
+
// src/commands/te-analysis/model/create-result-cluster.ts
|
|
1811
|
+
var createResultCluster = createMcpCommand({
|
|
1812
|
+
command: "+create_result_cluster",
|
|
1813
|
+
description: "Create a reusable result cluster from users matched by a drilldown condition in an existing analysis result. Use only after query_adhoc, query_report_data, or query_dashboard_report_data.",
|
|
1814
|
+
flags: [
|
|
1815
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1816
|
+
{ name: "cluster_name", type: "string", required: true, desc: "Cluster name. Must start with a letter and contain only letters, digits, and underscores. It must be unique within the project." },
|
|
1817
|
+
{ name: "model_type", type: "string", required: true, desc: "Model type used in the source analysis. Supported values: event, retention, funnel, distribution, attribution, heat_map, interval, path, rank_list, prop_analysis, sql." },
|
|
1818
|
+
{ name: "qp", type: "json", required: true, desc: "Query parameter JSON from the source analysis. Keep it consistent with the source analysis." },
|
|
1819
|
+
{ name: "display_name", type: "string", required: false, desc: "Optional cluster display name. If omitted, cluster_name is used." },
|
|
1820
|
+
{ name: "zone_offset", type: "number", required: false, desc: "Optional time zone offset. If omitted, the project default time zone is used." },
|
|
1821
|
+
{ name: "drilldown_date", type: "string", required: false, desc: "Target drilldown date from the analysis result. Format: yyyy-MM-dd" },
|
|
1822
|
+
{ name: "drilldown_groups", type: "json", required: false, desc: 'Drilldown group values from the analysis result as a JSON array, for example ["ios"]. Defaults to the overall group when omitted.' },
|
|
1823
|
+
{ name: "event_index", type: "number", required: false, desc: "Event index for event-model drilldown. Use the event position from the analysis result starting from 0." },
|
|
1824
|
+
{ name: "is_lost", type: "boolean", required: false, desc: "For retention analysis, true saves lost users and false saves retained users. Default: false" },
|
|
1825
|
+
{ name: "retention_days", type: "number", required: false, desc: "Retention interval in days from the analysis result, for example 7 for day-7 retention" },
|
|
1826
|
+
{ name: "is_churned_user", type: "boolean", required: false, desc: "For funnel analysis, true saves churned users and false saves converted users. Default: false" },
|
|
1827
|
+
{ name: "funnel_step", type: "number", required: false, desc: "Funnel step number from the analysis result starting from 1" },
|
|
1828
|
+
{ name: "interval", type: "string", required: false, desc: "Interval used for interval analysis" },
|
|
1829
|
+
{ name: "distribution_bucket", type: "number", required: false, desc: "Distribution bucket index from the analysis result" },
|
|
1830
|
+
{ name: "compare_index", type: "number", required: false, desc: "Comparison index used in comparison analysis scenarios" },
|
|
1831
|
+
{ name: "include_total", type: "boolean", required: false, desc: "Whether to save users from the total row. Default: false" },
|
|
1832
|
+
{ name: "relation_val", type: "string", required: false, desc: "Relation value used in relation analysis scenarios" }
|
|
1833
|
+
],
|
|
1834
|
+
risk: "write",
|
|
1835
|
+
buildArgs: (ctx) => ({
|
|
1836
|
+
projectId: ctx.num("project_id"),
|
|
1837
|
+
clusterName: ctx.str("cluster_name"),
|
|
1838
|
+
modelType: ctx.str("model_type"),
|
|
1839
|
+
qp: requiredJsonString(ctx, "qp"),
|
|
1840
|
+
displayName: optionalString(ctx, "display_name"),
|
|
1841
|
+
zoneOffset: optionalNumber(ctx, "zone_offset"),
|
|
1842
|
+
drilldownDate: optionalString(ctx, "drilldown_date"),
|
|
1843
|
+
drilldownGroups: optionalJsonString(ctx, "drilldown_groups"),
|
|
1844
|
+
eventIndex: optionalNumber(ctx, "event_index"),
|
|
1845
|
+
isLost: optionalBoolean(ctx, "is_lost"),
|
|
1846
|
+
retentionDays: optionalNumber(ctx, "retention_days"),
|
|
1847
|
+
isChurnedUser: optionalBoolean(ctx, "is_churned_user"),
|
|
1848
|
+
funnelStep: optionalNumber(ctx, "funnel_step"),
|
|
1849
|
+
interval: optionalString(ctx, "interval"),
|
|
1850
|
+
distributionBucket: optionalNumber(ctx, "distribution_bucket"),
|
|
1851
|
+
compareIndex: optionalNumber(ctx, "compare_index"),
|
|
1852
|
+
includeTotal: optionalBoolean(ctx, "include_total"),
|
|
1853
|
+
relationVal: optionalString(ctx, "relation_val")
|
|
1854
|
+
})
|
|
1855
|
+
});
|
|
1856
|
+
|
|
1857
|
+
// src/commands/te-analysis/model/load-filters.ts
|
|
1858
|
+
var loadFilters = createMcpCommand({
|
|
1859
|
+
command: "+load_filters",
|
|
1860
|
+
description: "Load candidate values for a property from event or user tables. Use quot to specify the property field whose enum values should be loaded.",
|
|
1861
|
+
flags: [
|
|
1862
|
+
{ name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
|
|
1863
|
+
{ name: "quot", type: "string", required: true, desc: "Property identifier (field name). This is the property whose candidate values will be loaded." },
|
|
1864
|
+
{ name: "table_type", type: "string", required: true, desc: "Table type. Supported values: event and user." },
|
|
1865
|
+
{ name: "event_name", type: "string", required: false, desc: "Optional event name. Effective when table_type=event." },
|
|
1866
|
+
{ name: "inputdata", type: "string", required: false, desc: "Optional input prefix used for fuzzy filtering of candidate values." },
|
|
1867
|
+
{ name: "zone_offset", type: "number", required: false, desc: "Time zone offset in hours. For example, UTC+8 is 8" },
|
|
1868
|
+
{ name: "cluster_date_policy", type: "string", required: false, desc: "Cluster date policy. Supported values: LATEST, AUTO, SPECIFIED." },
|
|
1869
|
+
{ name: "specified_cluster_date", type: "string", required: false, desc: "Specified cluster date in yyyy-MM-dd format. Effective only when cluster_date_policy=SPECIFIED." },
|
|
1870
|
+
{ name: "is_report", type: "boolean", required: false, desc: "Whether this is report mode. Default: false" }
|
|
1871
|
+
],
|
|
1872
|
+
risk: "read",
|
|
1873
|
+
mcpService: "te_analysis_extend",
|
|
1874
|
+
buildArgs: (ctx) => ({
|
|
1875
|
+
projectId: ctx.num("project_id"),
|
|
1876
|
+
quot: ctx.str("quot"),
|
|
1877
|
+
tableType: ctx.str("table_type"),
|
|
1878
|
+
eventName: optionalString(ctx, "event_name"),
|
|
1879
|
+
inputdata: optionalString(ctx, "inputdata"),
|
|
1880
|
+
zoneOffset: optionalNumber(ctx, "zone_offset"),
|
|
1881
|
+
clusterDatePolicy: optionalString(ctx, "cluster_date_policy"),
|
|
1882
|
+
specifiedClusterDate: optionalString(ctx, "specified_cluster_date"),
|
|
1883
|
+
isReport: optionalBoolean(ctx, "is_report")
|
|
1884
|
+
})
|
|
1885
|
+
});
|
|
1886
|
+
|
|
1887
|
+
// src/commands/te-analysis/model/get-table-columns.ts
|
|
1888
|
+
var getTableColumns = createMcpCommand({
|
|
1889
|
+
command: "+get_table_columns",
|
|
1890
|
+
description: "Query the field list of a project table. Returns column names and types for a tableRef so the table structure can be understood before SQL analysis.",
|
|
1891
|
+
flags: [
|
|
1892
|
+
{ name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
|
|
1893
|
+
{ name: "table_ref", type: "string", required: true, desc: "Table reference. Supports hive.schema.table, schema.table, or table. If only table is provided, the backend resolves it against project available tables and fails on ambiguity." }
|
|
1894
|
+
],
|
|
1895
|
+
risk: "read",
|
|
1896
|
+
mcpService: "te_analysis_extend",
|
|
1897
|
+
buildArgs: (ctx) => ({
|
|
1898
|
+
projectId: ctx.num("project_id"),
|
|
1899
|
+
tableRef: ctx.str("table_ref")
|
|
1900
|
+
})
|
|
1901
|
+
});
|
|
1902
|
+
|
|
1903
|
+
// src/commands/te-analysis/model/build-interval-analysis-qp.ts
|
|
1904
|
+
var buildIntervalAnalysisQp = createMcpCommand({
|
|
1905
|
+
command: "+build_interval_analysis_qp",
|
|
1906
|
+
description: "Build a validated interval-analysis QP from structured interval intent. Interval analysis measures the time elapsed between an initial event and a return event per user. Call before query_adhoc. This command only builds qp and does not execute query_adhoc.",
|
|
1907
|
+
flags: [
|
|
1908
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1909
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for interval analysis." },
|
|
1910
|
+
{ name: "interval", type: "json", required: true, desc: "Interval analysis intent JSON. Required fields: initialEvent, returnEvent, window (value+unit). Optional: relationEventPropertyName, groups, filters, initialFilters, returnFilters, initialFilterRelation, returnFilterRelation." },
|
|
1911
|
+
{ name: "relation", type: "string", required: false, desc: "Filter relation for top-level interval filters. Supported values: and, or. Default: and." },
|
|
1912
|
+
{ name: "time_particle_size", type: "string", required: false, desc: "Time granularity. Allowed values: day, week, month. Defaults to day when omitted." },
|
|
1913
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
1914
|
+
],
|
|
1915
|
+
risk: "read",
|
|
1916
|
+
buildArgs: (ctx) => ({
|
|
1917
|
+
projectId: ctx.num("project_id"),
|
|
1918
|
+
timeRange: ctx.json("time_range"),
|
|
1919
|
+
interval: ctx.json("interval"),
|
|
1920
|
+
relation: optionalString(ctx, "relation"),
|
|
1921
|
+
timeParticleSize: optionalString(ctx, "time_particle_size"),
|
|
1922
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
1923
|
+
})
|
|
1924
|
+
});
|
|
1925
|
+
|
|
1926
|
+
// src/commands/te-analysis/model/build-path-analysis-qp.ts
|
|
1927
|
+
var buildPathAnalysisQp = createMcpCommand({
|
|
1928
|
+
command: "+build_path_analysis_qp",
|
|
1929
|
+
description: "Build a validated path-analysis QP from structured path intent. Path analysis visualizes user navigation flows between events within a session. Call before query_adhoc. This command only builds qp and does not execute query_adhoc.",
|
|
1930
|
+
flags: [
|
|
1931
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1932
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for path analysis." },
|
|
1933
|
+
{ name: "path", type: "json", required: true, desc: "Path analysis intent JSON. Required fields: sourceEvent, eventNames (array), sessionInterval, sessionUnit. Optional: sourceType (0=forward, 1=backward, default 0)." },
|
|
1934
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
1935
|
+
],
|
|
1936
|
+
risk: "read",
|
|
1937
|
+
buildArgs: (ctx) => ({
|
|
1938
|
+
projectId: ctx.num("project_id"),
|
|
1939
|
+
timeRange: ctx.json("time_range"),
|
|
1940
|
+
path: ctx.json("path"),
|
|
1941
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
1942
|
+
})
|
|
1943
|
+
});
|
|
1944
|
+
|
|
1945
|
+
// src/commands/te-analysis/model/build-attribution-analysis-qp.ts
|
|
1946
|
+
var buildAttributionAnalysisQp = createMcpCommand({
|
|
1947
|
+
command: "+build_attribution_analysis_qp",
|
|
1948
|
+
description: "Build a validated attribution-analysis QP from structured attribution intent. Attribution analysis assigns conversion credit to touchpoint events that preceded a target conversion event. Call before query_adhoc. This command only builds qp and does not execute query_adhoc.",
|
|
1949
|
+
flags: [
|
|
1950
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1951
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for attribution analysis." },
|
|
1952
|
+
{ name: "attribution", type: "json", required: true, desc: "Attribution intent JSON. Required fields: targetEvent, targetAggregation, attributionEvents (array), attributionModel (first/last/linear), window (value+unit). Optional: targetProperty, directConversion, filters, relation." },
|
|
1953
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
1954
|
+
],
|
|
1955
|
+
risk: "read",
|
|
1956
|
+
buildArgs: (ctx) => ({
|
|
1957
|
+
projectId: ctx.num("project_id"),
|
|
1958
|
+
timeRange: ctx.json("time_range"),
|
|
1959
|
+
attribution: ctx.json("attribution"),
|
|
1960
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
1961
|
+
})
|
|
1962
|
+
});
|
|
1963
|
+
|
|
1964
|
+
// src/commands/te-analysis/model/build-heat-map-analysis-qp.ts
|
|
1965
|
+
var buildHeatMapAnalysisQp = createMcpCommand({
|
|
1966
|
+
command: "+build_heat_map_analysis_qp",
|
|
1967
|
+
description: "Build a validated heatmap-analysis QP from structured heatmap intent. Heatmap analysis visualizes user interaction intensity on a 2D coordinate plane (e.g. screen position). Call before query_adhoc. This command only builds qp and does not execute query_adhoc.",
|
|
1968
|
+
flags: [
|
|
1969
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1970
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for heatmap analysis." },
|
|
1971
|
+
{ name: "heat_map", type: "json", required: true, desc: "Heatmap intent JSON. Required fields: hotEvent, hotAggregation, xProp, yProp. Optional: hotProperty, filters, relation." },
|
|
1972
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
1973
|
+
],
|
|
1974
|
+
risk: "read",
|
|
1975
|
+
buildArgs: (ctx) => ({
|
|
1976
|
+
projectId: ctx.num("project_id"),
|
|
1977
|
+
timeRange: ctx.json("time_range"),
|
|
1978
|
+
heatMap: ctx.json("heat_map"),
|
|
1979
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
1980
|
+
})
|
|
1981
|
+
});
|
|
1982
|
+
|
|
1983
|
+
// src/commands/te-analysis/model/build-rank-list-analysis-qp.ts
|
|
1984
|
+
var buildRankListAnalysisQp = createMcpCommand({
|
|
1985
|
+
command: "+build_rank_list_analysis_qp",
|
|
1986
|
+
description: "Build a validated rank-list-analysis QP from structured rank list intent. Rank list analysis ranks entities (users, items, etc.) by a metric value. Call before query_adhoc. This command only builds qp and does not execute query_adhoc.",
|
|
1987
|
+
flags: [
|
|
1988
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
1989
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for rank list analysis." },
|
|
1990
|
+
{ name: "rank_list", type: "json", required: true, desc: "Rank list intent JSON. Required fields: rankDimension (field), rankEvent, rankAggregation. Optional: rankProperty, rankType (rank/dense_rank/row_rank), orderBy (DESC/ASC), filters, relation." },
|
|
1991
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
1992
|
+
],
|
|
1993
|
+
risk: "read",
|
|
1994
|
+
buildArgs: (ctx) => ({
|
|
1995
|
+
projectId: ctx.num("project_id"),
|
|
1996
|
+
timeRange: ctx.json("time_range"),
|
|
1997
|
+
rankList: ctx.json("rank_list"),
|
|
1998
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
1999
|
+
})
|
|
2000
|
+
});
|
|
2001
|
+
|
|
2002
|
+
// src/commands/te-analysis/model/build-distribution-analysis-qp.ts
|
|
2003
|
+
var buildDistributionAnalysisQp = createMcpCommand({
|
|
2004
|
+
command: "+build_distribution_analysis_qp",
|
|
2005
|
+
description: "Build a validated distribution-analysis QP from structured distribution metrics. Distribution analysis shows how a metric value is distributed across users or events. Call before query_adhoc. This command only builds qp and does not execute query_adhoc.",
|
|
2006
|
+
flags: [
|
|
2007
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
2008
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for distribution analysis." },
|
|
2009
|
+
{ name: "distribution_metrics", type: "json", required: true, desc: "Distribution metrics JSON array. Each item: event, aggregation (A200=count/A201=active-days/A202=active-hours/A103=sum etc.). Optional per item: property, percentile, intervalType, quotaIntervalArr, filters, relation." },
|
|
2010
|
+
{ name: "time_particle_size", type: "string", required: false, desc: "Time granularity. Allowed values: day, week, month, total. Defaults to day when omitted." },
|
|
2011
|
+
{ name: "groups", type: "json", required: false, desc: "Optional group-by dimensions JSON array." },
|
|
2012
|
+
{ name: "filters", type: "json", required: false, desc: "Optional global filters JSON array." },
|
|
2013
|
+
{ name: "relation", type: "string", required: false, desc: "Optional filter relation. Supported values: and, or. Default: and." },
|
|
2014
|
+
{ name: "authenticated_only", type: "boolean", required: false, desc: "When true, resolve only authenticated assets while building the QP." }
|
|
2015
|
+
],
|
|
2016
|
+
risk: "read",
|
|
2017
|
+
buildArgs: (ctx) => ({
|
|
2018
|
+
projectId: ctx.num("project_id"),
|
|
2019
|
+
timeRange: ctx.json("time_range"),
|
|
2020
|
+
distributionMetrics: ctx.json("distribution_metrics"),
|
|
2021
|
+
timeParticleSize: optionalString(ctx, "time_particle_size"),
|
|
2022
|
+
groups: optionalJson(ctx, "groups"),
|
|
2023
|
+
filters: optionalJson(ctx, "filters"),
|
|
2024
|
+
relation: optionalString(ctx, "relation"),
|
|
2025
|
+
authenticatedOnly: optionalBoolean(ctx, "authenticated_only")
|
|
2026
|
+
})
|
|
2027
|
+
});
|
|
2028
|
+
|
|
2029
|
+
// src/commands/te-analysis/model/index.ts
|
|
2030
|
+
var commands14 = [
|
|
2031
|
+
buildEventAnalysisQp,
|
|
2032
|
+
buildRetentionAnalysisQp,
|
|
2033
|
+
buildFunnelAnalysisQp,
|
|
2034
|
+
buildPropAnalysisQp,
|
|
2035
|
+
buildIntervalAnalysisQp,
|
|
2036
|
+
buildPathAnalysisQp,
|
|
2037
|
+
buildAttributionAnalysisQp,
|
|
2038
|
+
buildHeatMapAnalysisQp,
|
|
2039
|
+
buildRankListAnalysisQp,
|
|
2040
|
+
buildDistributionAnalysisQp,
|
|
2041
|
+
queryAdhoc,
|
|
2042
|
+
cancelQuery,
|
|
2043
|
+
drilldownUsers,
|
|
2044
|
+
drilldownUserEvents,
|
|
2045
|
+
createResultCluster,
|
|
2046
|
+
loadFilters,
|
|
2047
|
+
getTableColumns
|
|
2048
|
+
];
|
|
2049
|
+
var model_default = commands14;
|
|
2050
|
+
|
|
2051
|
+
// src/commands/te-analysis/entity/query-entity-details.ts
|
|
2052
|
+
var queryEntityDetails = createMcpCommand({
|
|
2053
|
+
command: "+query_entity_details",
|
|
2054
|
+
description: "Query entity detail data based on an entity ID and cluster definition. Supports display properties, sorting, and result limits. For long-running or cancelable queries, requestId is required and must be provided before starting. For any query that may exceed the CLI or MCP HTTP timeout, generate requestId first so you can call +cancel_query --request_id <same value> if you stop waiting or the request returns fetch failed. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Submitted queries return metadata.requestId; pass that value to cancel_query(requestId) when the query is no longer needed. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If requestId is omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID.",
|
|
2055
|
+
flags: [
|
|
2056
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
2057
|
+
{ name: "entity_id", type: "number", required: false, desc: "Optional entity ID used in multi-entity scenarios. If omitted, the default user entity is used." },
|
|
2058
|
+
{ name: "definition", type: "json", required: true, desc: "Cluster definition JSON. See +get_cluster_definition_schema for the structure." },
|
|
2059
|
+
{ name: "properties", type: "json", required: false, desc: "Optional display properties JSON" },
|
|
2060
|
+
{ name: "sort_by", type: "string", required: false, desc: "Optional sort field" },
|
|
2061
|
+
{ name: "sort_order", type: "string", required: false, desc: "Optional sort order. Supported values: asc and desc" },
|
|
2062
|
+
{ name: "limit", type: "number", required: false, desc: "Optional result limit. Default: 1000, maximum: 10000" },
|
|
2063
|
+
{ name: "zone_offset", type: "number", required: false, desc: "Time zone offset. For example, UTC+8 is 8" },
|
|
2064
|
+
{ name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
|
|
2065
|
+
{ name: "request_id", type: "string", required: true, desc: "Required unique request ID used for tracking and cancellation. Generate it before starting the query. It must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Provide this before starting the query so it can be cancelled later with +cancel_query --request_id <same value>, even if the caller stops waiting before the tool returns. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID. The response metadata.requestId echoes the supplied requestId and can also be passed to cancel_query(requestId) when the query is no longer needed." },
|
|
2066
|
+
{ name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
|
|
2067
|
+
],
|
|
2068
|
+
risk: "read",
|
|
2069
|
+
validate: (ctx) => {
|
|
2070
|
+
assertLimitWithinCap(optionalNumber(ctx, "limit"), "limit");
|
|
2071
|
+
},
|
|
2072
|
+
buildArgs: (ctx) => ({
|
|
2073
|
+
projectId: ctx.num("project_id"),
|
|
2074
|
+
entityId: optionalNumber(ctx, "entity_id"),
|
|
2075
|
+
definition: requiredJsonString(ctx, "definition"),
|
|
2076
|
+
properties: optionalJsonString(ctx, "properties"),
|
|
2077
|
+
sortBy: optionalString(ctx, "sort_by"),
|
|
2078
|
+
sortOrder: optionalString(ctx, "sort_order"),
|
|
2079
|
+
limit: optionalNumber(ctx, "limit") ?? DEFAULT_QUERY_LIMIT,
|
|
2080
|
+
zoneOffset: optionalNumber(ctx, "zone_offset"),
|
|
2081
|
+
useCache: optionalBoolean(ctx, "use_cache"),
|
|
2082
|
+
requestId: ctx.str("request_id"),
|
|
2083
|
+
timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
|
|
2084
|
+
})
|
|
2085
|
+
});
|
|
2086
|
+
|
|
2087
|
+
// src/commands/te-analysis/entity/query-event-details.ts
|
|
2088
|
+
var queryEventDetails = createMcpCommand({
|
|
2089
|
+
command: "+query_event_details",
|
|
2090
|
+
description: "Query event detail data. Supports time range, filters, display properties, sorting, and result limits. Time can be specified via --relative_date_range OR (--start_time AND --end_time). For long-running or cancelable queries, requestId is required and must be provided before starting. For any query that may exceed the CLI or MCP HTTP timeout, generate requestId first so you can call +cancel_query --request_id <same value> if you stop waiting or the request returns fetch failed. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Submitted queries return metadata.requestId; pass that value to cancel_query(requestId) when the query is no longer needed. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If requestId is omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID.",
|
|
2091
|
+
flags: [
|
|
2092
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
2093
|
+
{ name: "event_name", type: "string", required: true, desc: "Event name" },
|
|
2094
|
+
{ name: "start_time", type: "string", required: false, desc: "Start time. Format: yyyy-MM-dd HH:mm:ss. Required if not using relative_date_range." },
|
|
2095
|
+
{ name: "end_time", type: "string", required: false, desc: "End time. Format: yyyy-MM-dd HH:mm:ss. Required if not using relative_date_range." },
|
|
2096
|
+
{ name: "relative_date_range", type: "string", required: false, desc: "Optional relative date range in m-n format. For example, 0-7 means the most recent 7 days including today. Use either this field or start_time/end_time." },
|
|
2097
|
+
{ name: "filters", type: "json", required: false, desc: "Optional filter JSON. See +get_filter_schema for the structure." },
|
|
2098
|
+
{ name: "properties", type: "json", required: false, desc: "Optional display properties JSON" },
|
|
2099
|
+
{ name: "sort_by", type: "string", required: false, desc: "Optional sort field" },
|
|
2100
|
+
{ name: "sort_order", type: "string", required: false, desc: "Optional sort order. Supported values: asc and desc" },
|
|
2101
|
+
{ name: "limit", type: "number", required: false, desc: "Optional result limit. Default: 1000, maximum: 10000" },
|
|
2102
|
+
{ name: "zone_offset", type: "number", required: false, desc: "Time zone offset. For example, UTC+8 is 8" },
|
|
2103
|
+
{ name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
|
|
2104
|
+
{ name: "request_id", type: "string", required: true, desc: "Required unique request ID used for tracking and cancellation. Generate it before starting the query. It must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. Provide this before starting the query so it can be cancelled later with +cancel_query --request_id <same value>, even if the caller stops waiting before the tool returns. If fetch failed, HTTP timeout, or caller timeout happens, the backend query may still be running. requestId is not auto-generated for MCP query tools because the caller must know it before the response for proactive cleanup. If omitted or blank, the backend returns REQUEST_ID_REQUIRED; invalid format returns INVALID_REQUEST_ID. The response metadata.requestId echoes the supplied requestId and can also be passed to cancel_query(requestId) when the query is no longer needed." },
|
|
2105
|
+
{ name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
|
|
2106
|
+
],
|
|
2107
|
+
risk: "read",
|
|
2108
|
+
buildArgs: (ctx) => ({
|
|
2109
|
+
projectId: ctx.num("project_id"),
|
|
2110
|
+
eventName: ctx.str("event_name"),
|
|
2111
|
+
startTime: optionalString(ctx, "start_time"),
|
|
2112
|
+
endTime: optionalString(ctx, "end_time"),
|
|
2113
|
+
relativeDateRange: optionalString(ctx, "relative_date_range"),
|
|
2114
|
+
filters: optionalJsonString(ctx, "filters"),
|
|
2115
|
+
properties: optionalJsonString(ctx, "properties"),
|
|
2116
|
+
sortBy: optionalString(ctx, "sort_by"),
|
|
2117
|
+
sortOrder: optionalString(ctx, "sort_order"),
|
|
2118
|
+
limit: optionalNumber(ctx, "limit"),
|
|
2119
|
+
zoneOffset: optionalNumber(ctx, "zone_offset"),
|
|
2120
|
+
useCache: optionalBoolean(ctx, "use_cache"),
|
|
2121
|
+
requestId: ctx.str("request_id"),
|
|
2122
|
+
timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
|
|
2123
|
+
})
|
|
2124
|
+
});
|
|
2125
|
+
|
|
2126
|
+
// src/commands/te-analysis/entity/build-entity-details-sql.ts
|
|
2127
|
+
var buildEntityDetailsSql = createMcpCommand({
|
|
2128
|
+
command: "+build_entity_details_sql",
|
|
2129
|
+
description: "Build the SQL for an entity details query. The parameters are the same as query_entity_details, but this tool returns SQL instead of query results.",
|
|
2130
|
+
flags: [
|
|
2131
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
2132
|
+
{ name: "entity_id", type: "number", required: false, desc: "Optional entity ID used in multi-entity scenarios. If omitted, the default user entity is used." },
|
|
2133
|
+
{ name: "definition", type: "json", required: true, desc: "Cluster definition JSON. See +get_cluster_definition_schema for the structure." },
|
|
2134
|
+
{ name: "properties", type: "json", required: false, desc: "Optional display properties JSON" },
|
|
2135
|
+
{ name: "sort_by", type: "string", required: false, desc: "Optional sort field" },
|
|
2136
|
+
{ name: "sort_order", type: "string", required: false, desc: "Optional sort order. Supported values: asc and desc" },
|
|
2137
|
+
{ name: "limit", type: "number", required: false, desc: "Optional result limit. Default: 1000, maximum: 10000" },
|
|
2138
|
+
{ name: "zone_offset", type: "number", required: false, desc: "Time zone offset. For example, UTC+8 is 8" }
|
|
2139
|
+
],
|
|
2140
|
+
risk: "read",
|
|
2141
|
+
buildArgs: (ctx) => ({
|
|
2142
|
+
projectId: ctx.num("project_id"),
|
|
2143
|
+
entityId: optionalNumber(ctx, "entity_id"),
|
|
2144
|
+
definition: requiredJsonString(ctx, "definition"),
|
|
2145
|
+
properties: optionalJsonString(ctx, "properties"),
|
|
2146
|
+
sortBy: optionalString(ctx, "sort_by"),
|
|
2147
|
+
sortOrder: optionalString(ctx, "sort_order"),
|
|
2148
|
+
limit: optionalNumber(ctx, "limit"),
|
|
2149
|
+
zoneOffset: optionalNumber(ctx, "zone_offset")
|
|
2150
|
+
})
|
|
2151
|
+
});
|
|
2152
|
+
|
|
2153
|
+
// src/commands/te-analysis/entity/build-event-details-sql.ts
|
|
2154
|
+
var buildEventDetailsSql = createMcpCommand({
|
|
2155
|
+
command: "+build_event_details_sql",
|
|
2156
|
+
description: "Build the SQL for an event details query. The parameters are the same as query_event_details, but this tool returns SQL instead of query results.",
|
|
2157
|
+
flags: [
|
|
2158
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
2159
|
+
{ name: "event_name", type: "string", required: true, desc: "Event name" },
|
|
2160
|
+
{ name: "start_time", type: "string", required: false, desc: "Start time. Format: yyyy-MM-dd HH:mm:ss" },
|
|
2161
|
+
{ name: "end_time", type: "string", required: false, desc: "End time. Format: yyyy-MM-dd HH:mm:ss" },
|
|
2162
|
+
{ name: "relative_date_range", type: "string", required: false, desc: "Optional relative date range in m-n format. For example, 0-7 means the most recent 7 days including today. Use either this field or start_time/end_time." },
|
|
2163
|
+
{ name: "filters", type: "json", required: false, desc: "Optional filter JSON. See +get_filter_schema for the structure." },
|
|
2164
|
+
{ name: "properties", type: "json", required: false, desc: "Optional display properties JSON" },
|
|
2165
|
+
{ name: "sort_by", type: "string", required: false, desc: "Optional sort field" },
|
|
2166
|
+
{ name: "sort_order", type: "string", required: false, desc: "Optional sort order. Supported values: asc and desc" },
|
|
2167
|
+
{ name: "limit", type: "number", required: false, desc: "Optional result limit. Default: 100, maximum: 10000" },
|
|
2168
|
+
{ name: "zone_offset", type: "number", required: false, desc: "Time zone offset. For example, UTC+8 is 8" }
|
|
2169
|
+
],
|
|
2170
|
+
risk: "read",
|
|
2171
|
+
buildArgs: (ctx) => ({
|
|
2172
|
+
projectId: ctx.num("project_id"),
|
|
2173
|
+
eventName: ctx.str("event_name"),
|
|
2174
|
+
startTime: optionalString(ctx, "start_time"),
|
|
2175
|
+
endTime: optionalString(ctx, "end_time"),
|
|
2176
|
+
relativeDateRange: optionalString(ctx, "relative_date_range"),
|
|
2177
|
+
filters: optionalJsonString(ctx, "filters"),
|
|
2178
|
+
properties: optionalJsonString(ctx, "properties"),
|
|
2179
|
+
sortBy: optionalString(ctx, "sort_by"),
|
|
2180
|
+
sortOrder: optionalString(ctx, "sort_order"),
|
|
2181
|
+
limit: optionalNumber(ctx, "limit"),
|
|
2182
|
+
zoneOffset: optionalNumber(ctx, "zone_offset")
|
|
2183
|
+
})
|
|
2184
|
+
});
|
|
2185
|
+
|
|
2186
|
+
// src/commands/te-analysis/entity/index.ts
|
|
2187
|
+
var commands15 = [
|
|
2188
|
+
queryEntityDetails,
|
|
2189
|
+
queryEventDetails,
|
|
2190
|
+
buildEntityDetailsSql,
|
|
2191
|
+
buildEventDetailsSql
|
|
2192
|
+
];
|
|
2193
|
+
var entity_default = commands15;
|
|
2194
|
+
|
|
2195
|
+
// src/commands/te-analysis/schema/get-analysis-query-schema.ts
|
|
2196
|
+
var getAnalysisQuerySchema = createMcpCommand({
|
|
2197
|
+
command: "+get_analysis_query_schema",
|
|
2198
|
+
description: "Get the analysis query schema for non-builder/manual model paths. Do not use this tool for natural-language event, retention, funnel, or prop_analysis ad-hoc analysis; use the matching +build_*_analysis_qp command then +query_adhoc. Returns field definitions and usage examples for low-level/manual QP construction.",
|
|
2199
|
+
flags: [
|
|
2200
|
+
{ name: "model_type", type: "string", required: true, desc: "Model type. Supported values: event, retention, funnel, distribution, sql, interval, path, attribution, prop_analysis, rank_list, heat_map" },
|
|
2201
|
+
{ name: "segments", type: "string", required: false, desc: "Schema segments to include (comma-separated). Options: core, filter_group, calctype, aggregatetype, examples, full. Empty/null \u2192 core only (recommended)." },
|
|
2202
|
+
{ name: "include_core", type: "boolean", required: false, desc: "Whether to automatically include core segment. Default: true. Set false for follow-up requests to prevent duplicate core returns." }
|
|
2203
|
+
],
|
|
2204
|
+
risk: "read",
|
|
2205
|
+
buildArgs: (ctx) => ({
|
|
2206
|
+
modelType: ctx.str("model_type"),
|
|
2207
|
+
segments: optionalString(ctx, "segments"),
|
|
2208
|
+
includeCore: optionalBoolean(ctx, "include_core")
|
|
2209
|
+
})
|
|
2210
|
+
});
|
|
2211
|
+
|
|
2212
|
+
// src/commands/te-analysis/schema/get-filter-schema.ts
|
|
2213
|
+
var getFilterSchema = createMcpCommand({
|
|
2214
|
+
command: "+get_filter_schema",
|
|
2215
|
+
description: "Get the filter schema. Returns field definitions, operator enums, data type descriptions, and examples.",
|
|
2216
|
+
flags: [],
|
|
2217
|
+
risk: "read",
|
|
2218
|
+
buildArgs: (ctx) => ({})
|
|
2219
|
+
});
|
|
2220
|
+
|
|
2221
|
+
// src/commands/te-analysis/schema/get-groupby-schema.ts
|
|
2222
|
+
var getGroupbySchema = createMcpCommand({
|
|
2223
|
+
command: "+get_groupby_schema",
|
|
2224
|
+
description: "Get the group-by schema. Returns field definitions and examples for group-by configuration.",
|
|
2225
|
+
flags: [],
|
|
2226
|
+
risk: "read",
|
|
2227
|
+
buildArgs: (ctx) => ({})
|
|
2228
|
+
});
|
|
2229
|
+
|
|
2230
|
+
// src/commands/te-analysis/schema/index.ts
|
|
2231
|
+
var commands16 = [
|
|
2232
|
+
getAnalysisQuerySchema,
|
|
2233
|
+
getFilterSchema,
|
|
2234
|
+
getGroupbySchema
|
|
2235
|
+
];
|
|
2236
|
+
var schema_default = commands16;
|
|
2237
|
+
|
|
2238
|
+
// src/commands/te-analysis/global/list-query-clusters.ts
|
|
2239
|
+
var listQueryClusters = createMcpCommand({
|
|
2240
|
+
command: "+list_query_clusters",
|
|
2241
|
+
description: "List query cluster options accessible to the current account in the project. Use this to decide whether to query the current self cluster, global aggregated data, or one specific slave cluster.",
|
|
2242
|
+
flags: [
|
|
2243
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID used to resolve cluster query permissions", alias: "p" }
|
|
2244
|
+
],
|
|
2245
|
+
risk: "read",
|
|
2246
|
+
buildArgs: (ctx) => ({
|
|
2247
|
+
projectId: ctx.num("project_id")
|
|
2248
|
+
})
|
|
2249
|
+
});
|
|
2250
|
+
|
|
2251
|
+
// src/commands/te-analysis/global/index.ts
|
|
2252
|
+
var commands17 = [
|
|
2253
|
+
listQueryClusters
|
|
2254
|
+
];
|
|
2255
|
+
var global_default = commands17;
|
|
2256
|
+
|
|
2257
|
+
// src/commands/te-analysis/index.ts
|
|
2258
|
+
registerCapabilityGatewayRoute("analysis", { gatewayDomain: "analysis" });
|
|
2259
|
+
var commands18 = [
|
|
2260
|
+
...meta_default,
|
|
2261
|
+
...report_default,
|
|
2262
|
+
...dashboard_default,
|
|
2263
|
+
...dashboard_report_data_default,
|
|
2264
|
+
...query_default,
|
|
2265
|
+
...dashboard_definition_default,
|
|
2266
|
+
...dashboard_daily_report_default,
|
|
2267
|
+
...bi_panel_default,
|
|
2268
|
+
...bi_panel_page_data_default,
|
|
2269
|
+
...project_space_default,
|
|
2270
|
+
...folder_default,
|
|
2271
|
+
...favorite_default,
|
|
2272
|
+
...public_link_default,
|
|
2273
|
+
...model_default,
|
|
2274
|
+
...entity_default,
|
|
2275
|
+
...schema_default,
|
|
2276
|
+
...isGlobalQueryModeEnabled() ? global_default : []
|
|
2277
|
+
];
|
|
2278
|
+
var te_analysis_default = commands18;
|
|
2279
|
+
export {
|
|
2280
|
+
te_analysis_default as default
|
|
2281
|
+
};
|