@thinkingai/ae-cli 6.0.18-1 → 6.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +7 -6
  2. package/README.zh.md +8 -7
  3. package/dist/index.js +11 -6
  4. package/dist/{te-agent-KZRIEN4N.js → te-agent-CYZUC4US.js} +543 -19
  5. package/dist/{te-analysis-VAR4KUOK.js → te-analysis-HJ22TUAA.js} +318 -40
  6. package/dist/te-audience-MYDE5WEH.js +590 -0
  7. package/dist/te-dataops-ZTS7XMXM.js +1842 -0
  8. package/dist/{te-kb-B62KFP2A.js → te-kb-OWM3RQRH.js} +46 -21
  9. package/dist/{te-meta-EPZGQN56.js → te-meta-JVO4QJBH.js} +28 -11
  10. package/package.json +1 -1
  11. package/skills/ae-agent/SKILL.md +103 -4
  12. package/skills/ae-analysis/SKILL.md +66 -19
  13. package/skills/ae-analysis/references/build_attribution_analysis_qp.md +60 -0
  14. package/skills/ae-analysis/references/build_cluster_definition.md +60 -0
  15. package/skills/ae-analysis/references/build_distribution_analysis_qp.md +65 -0
  16. package/skills/ae-analysis/references/build_heat_map_analysis_qp.md +52 -0
  17. package/skills/ae-analysis/references/build_interval_analysis_qp.md +58 -0
  18. package/skills/ae-analysis/references/build_path_analysis_qp.md +51 -0
  19. package/skills/ae-analysis/references/build_rank_list_analysis_qp.md +61 -0
  20. package/skills/ae-analysis/references/build_tag_definition.md +63 -0
  21. package/skills/ae-analysis/references/cancel_query.md +2 -3
  22. package/skills/ae-analysis/references/copy_dashboard.md +33 -0
  23. package/skills/ae-analysis/references/create_id_cluster.md +40 -0
  24. package/skills/ae-analysis/references/create_id_tag.md +39 -0
  25. package/skills/ae-analysis/references/delete_alert.md +27 -0
  26. package/skills/ae-analysis/references/delete_cluster.md +27 -0
  27. package/skills/ae-analysis/references/delete_dashboard.md +30 -0
  28. package/skills/ae-analysis/references/delete_metric.md +27 -0
  29. package/skills/ae-analysis/references/delete_report.md +27 -0
  30. package/skills/ae-analysis/references/delete_tag.md +27 -0
  31. package/skills/ae-analysis/references/drilldown_user_events.md +4 -4
  32. package/skills/ae-analysis/references/drilldown_users.md +3 -3
  33. package/skills/ae-analysis/references/freeze_dashboards.md +29 -0
  34. package/skills/ae-analysis/references/get_table_columns.md +11 -12
  35. package/skills/ae-analysis/references/list_cluster_members.md +4 -4
  36. package/skills/ae-analysis/references/list_clusters.md +3 -3
  37. package/skills/ae-analysis/references/list_dashboards.md +3 -3
  38. package/skills/ae-analysis/references/list_entities.md +1 -1
  39. package/skills/ae-analysis/references/list_events.md +3 -3
  40. package/skills/ae-analysis/references/list_metrics.md +2 -2
  41. package/skills/ae-analysis/references/list_properties.md +3 -3
  42. package/skills/ae-analysis/references/list_reports.md +3 -3
  43. package/skills/ae-analysis/references/list_spaces.md +27 -0
  44. package/skills/ae-analysis/references/list_tag_members.md +4 -4
  45. package/skills/ae-analysis/references/list_tags.md +2 -2
  46. package/skills/ae-analysis/references/move_dashboard.md +33 -0
  47. package/skills/ae-analysis/references/query_adhoc.md +2 -2
  48. package/skills/ae-analysis/references/query_bi_panel_data.md +2 -2
  49. package/skills/ae-analysis/references/query_dashboard_report_data.md +4 -4
  50. package/skills/ae-analysis/references/query_entity_details.md +4 -4
  51. package/skills/ae-analysis/references/query_event_details.md +3 -3
  52. package/skills/ae-analysis/references/query_report_data.md +37 -3
  53. package/skills/ae-analysis/references/update_id_cluster.md +36 -0
  54. package/skills/ae-analysis/references/update_id_tag.md +37 -0
  55. package/skills/ae-analysis/references/update_report.md +35 -0
  56. package/skills/ae-analysis-intent/SKILL.md +1 -1
  57. package/skills/ae-dataops/SKILL.md +54 -522
  58. package/skills/ae-dataops/references/dataops-flow-create.md +78 -75
  59. package/skills/ae-dataops/references/dataops-flow-monitor.md +58 -51
  60. package/skills/ae-dataops/references/dataops-integration.md +80 -41
  61. package/skills/ae-dataops/references/dataops-query.md +54 -53
  62. package/skills/ae-dataops/references/dataops-table.md +28 -59
  63. package/dist/te-audience-KMKYI2YJ.js +0 -400
  64. package/dist/te-dataops-GD3XBYCS.js +0 -1830
@@ -210,13 +210,30 @@ var updateAlert = createMcpCommand({
210
210
  })
211
211
  });
212
212
 
213
+ // src/commands/te-analysis/meta/delete-alert.ts
214
+ var deleteAlert = createMcpCommand({
215
+ command: "+delete_alert",
216
+ description: "Delete an alert by alertId",
217
+ flags: [
218
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
219
+ { name: "alert_id", type: "number", required: true, desc: "Alert ID to delete" }
220
+ ],
221
+ risk: "write",
222
+ mcpService: "te_analysis_extend",
223
+ buildArgs: (ctx) => ({
224
+ projectId: ctx.num("project_id"),
225
+ alertId: ctx.num("alert_id")
226
+ })
227
+ });
228
+
213
229
  // src/commands/te-analysis/meta/index.ts
214
230
  var commands = [
215
231
  getAlertDefinitionSchema,
216
232
  listAlerts,
217
233
  getAlert,
218
234
  createAlert,
219
- updateAlert
235
+ updateAlert,
236
+ deleteAlert
220
237
  ];
221
238
  var meta_default = commands;
222
239
 
@@ -226,8 +243,8 @@ var listReports = createMcpCommand({
226
243
  description: "List report metadata accessible to the current user in the project. Supports keyword filtering and returns paginated report summaries with selectable fields.",
227
244
  flags: [
228
245
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
229
- { name: "query", type: "string", required: false, desc: "Optional keyword filter. Performs fuzzy matching against report names, descriptions, and AI remarks; if omitted, all accessible reports are returned.", alias: "q" },
230
- { name: "fields", type: "json", required: false, desc: "Optional fields to return. Supported fields: reportId, reportName, reportDesc, reportModel, aiRemark.", alias: "f" },
246
+ { 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" },
247
+ { 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" },
231
248
  { name: "limit", type: "number", required: false, desc: "Optional page size. Default: 20, maximum: 10000.", alias: "l" },
232
249
  { name: "offset", type: "number", required: false, desc: "Optional page offset. Default: 0.", alias: "o" }
233
250
  ],
@@ -259,18 +276,19 @@ var getReportDefinition = createMcpCommand({
259
276
  // src/commands/te-analysis/report/query-report-data.ts
260
277
  var queryReportData = createMcpCommand({
261
278
  command: "+query_report_data",
262
- 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, provide requestId before starting. For any query that may exceed the CLI or MCP HTTP timeout, preset requestId 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. If provided, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup.",
279
+ 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.",
263
280
  flags: [
264
281
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
265
282
  { name: "report_ids", type: "json", required: true, desc: "List of report IDs" },
266
283
  { name: "filters", type: "json", required: false, desc: "Optional filter JSON. See +get_filter_schema for the structure." },
267
284
  { name: "group_by", type: "json", required: false, desc: "Optional group-by JSON array. See +get_groupby_schema for the structure." },
268
- { name: "request_id", type: "string", required: false, desc: "Optional unique request ID used for tracking and cancellation. If provided, it must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. For long-running or cancelable queries, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup. Generated automatically if omitted. The response metadata.requestId can also be passed to cancel_query when the query is no longer needed." },
285
+ { 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." },
269
286
  { name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
270
287
  { name: "start_date", type: "string", required: false, desc: "Optional start date in yyyy-MM-dd format" },
271
288
  { name: "end_date", type: "string", required: false, desc: "Optional end date in yyyy-MM-dd format" },
272
289
  { 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." },
273
290
  { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." },
291
+ { 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.` },
274
292
  ...clusterQueryFlags("Optional cluster query scope. Supported values: GLOBAL, SLAVE. Omit to query the current self cluster.")
275
293
  ],
276
294
  risk: "read",
@@ -279,12 +297,13 @@ var queryReportData = createMcpCommand({
279
297
  reportIds: ctx.json("report_ids"),
280
298
  filters: optionalJsonString(ctx, "filters"),
281
299
  groupBy: optionalJsonString(ctx, "group_by"),
282
- requestId: optionalString(ctx, "request_id"),
300
+ requestId: ctx.str("request_id"),
283
301
  useCache: optionalBoolean(ctx, "use_cache"),
284
302
  startDate: optionalString(ctx, "start_date"),
285
303
  endDate: optionalString(ctx, "end_date"),
286
304
  timeGranularity: optionalString(ctx, "time_granularity"),
287
305
  timeoutMinutes: optionalNumber(ctx, "timeout_minutes"),
306
+ sqlParams: optionalJsonString(ctx, "sql_params"),
288
307
  ...optionalClusterQueryArgs(ctx)
289
308
  })
290
309
  });
@@ -316,23 +335,66 @@ var createReport = createMcpCommand({
316
335
  })
317
336
  });
318
337
 
338
+ // src/commands/te-analysis/report/delete-report.ts
339
+ var deleteReport = createMcpCommand({
340
+ command: "+delete_report",
341
+ description: "Delete a report by reportId",
342
+ flags: [
343
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
344
+ { name: "report_id", type: "number", required: true, desc: "Report ID to delete" }
345
+ ],
346
+ risk: "write",
347
+ buildArgs: (ctx) => ({
348
+ projectId: ctx.num("project_id"),
349
+ reportId: ctx.num("report_id")
350
+ })
351
+ });
352
+
353
+ // src/commands/te-analysis/report/update-report.ts
354
+ var updateReport = createMcpCommand({
355
+ command: "+update_report",
356
+ 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.",
357
+ flags: [
358
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
359
+ { name: "report_id", type: "number", required: true, desc: "Report ID to update" },
360
+ { name: "version", type: "number", required: true, desc: "Current report version number. Retrieve via +get_report_definition." },
361
+ { name: "report_name", type: "string", required: false, desc: "New report name. Omit to keep existing." },
362
+ { name: "report_desc", type: "string", required: false, desc: "New report description. Omit to keep existing." },
363
+ { name: "qp", type: "string", required: false, desc: "New QP JSON string. Omit to keep existing. When provided, also supply report_model." },
364
+ { name: "report_model", type: "number", required: false, desc: "Analysis model type integer (e.g. 1=event, 2=retention). Required when qp is provided." }
365
+ ],
366
+ risk: "write",
367
+ mcpService: "te_analysis_extend",
368
+ buildArgs: (ctx) => ({
369
+ projectId: ctx.num("project_id"),
370
+ reportId: ctx.num("report_id"),
371
+ version: ctx.num("version"),
372
+ reportName: optionalString(ctx, "report_name"),
373
+ reportDesc: optionalString(ctx, "report_desc"),
374
+ qp: optionalString(ctx, "qp"),
375
+ reportModel: optionalNumber(ctx, "report_model")
376
+ })
377
+ });
378
+
319
379
  // src/commands/te-analysis/report/index.ts
320
380
  var commands2 = [
321
381
  listReports,
322
382
  getReportDefinition,
323
383
  queryReportData,
324
- createReport
384
+ createReport,
385
+ deleteReport,
386
+ updateReport
325
387
  ];
326
388
  var report_default = commands2;
327
389
 
328
390
  // src/commands/te-analysis/dashboard/list-dashboards.ts
329
391
  var listDashboards = createMcpCommand({
330
392
  command: "+list_dashboards",
331
- description: "List dashboard metadata accessible to the current user in the project. Supports keyword filtering and returns paginated dashboard summaries with selectable fields.",
393
+ description: "List dashboard metadata accessible to the current user in the project. Supports keyword filtering and returns paginated dashboard summaries. Default returned fields: dashboardId, dashboardName, remark. Dashboard metadata exposes remark but no separate desc field.",
332
394
  flags: [
333
395
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
334
- { name: "query", type: "string", required: false, desc: "Optional keyword filter. Performs fuzzy matching against dashboard names and AI remarks; if omitted, all accessible dashboards are returned.", alias: "q" },
335
- { name: "fields", type: "json", required: false, desc: "Optional fields to return. Supported fields: dashboardId, dashboardName, aiRemark.", alias: "f" },
396
+ { name: "query", type: "string", required: false, desc: "Optional keyword filter. Performs fuzzy matching against dashboard names and remarks; if omitted, all accessible dashboards are returned.", alias: "q" },
397
+ { name: "fields", type: "json", required: false, desc: "Optional fields to return. Supported fields: dashboardId, dashboardName, remark. Default fields when omitted: dashboardId, dashboardName, remark.", alias: "f" },
336
398
  { name: "limit", type: "number", required: false, desc: "Optional page size. Default: 20, maximum: 10000.", alias: "l" },
337
399
  { name: "offset", type: "number", required: false, desc: "Optional page offset. Default: 0.", alias: "o" }
338
400
  ],
@@ -387,13 +449,13 @@ var getBiPanelDetail = createMcpCommand({
387
449
  // src/commands/te-analysis/dashboard/query-bi-panel-data.ts
388
450
  var queryBiPanelData = createMcpCommand({
389
451
  command: "+query_bi_panel_data",
390
- description: "Query released BI panel data. Use result_type=charts for page chart data as columns and rows, or result_type=summary for summary markdown and blocks. Call get_bi_panel_detail first to obtain pageKey, chartIds, columns, and control schemas. For long-running or cancelable queries, provide requestId before starting. For any query that may exceed the CLI or MCP HTTP timeout, preset requestId 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. If provided, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup.",
452
+ description: "Query released BI panel data. Use result_type=charts for page chart data as columns and rows, or result_type=summary for summary markdown and blocks. Call get_bi_panel_detail first to obtain pageKey, chartIds, columns, and control schemas. 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.",
391
453
  flags: [
392
454
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
393
455
  { name: "panel_id", type: "number", required: true, desc: "BI panel ID returned by +list_bi_panels" },
394
456
  { name: "page_key", type: "string", required: true, desc: "Page key returned by +get_bi_panel_detail" },
395
457
  { name: "result_type", type: "string", required: true, desc: "Result type. Supported values: charts, summary." },
396
- { name: "request_id", type: "string", required: false, desc: "Optional unique request ID used for tracking and cancellation. If provided, it must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. For long-running or cancelable queries, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup. Generated automatically if omitted. The response metadata.requestId can also be passed to cancel_query when the query is no longer needed." },
458
+ { 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." },
397
459
  { name: "chart_ids", type: "json", required: false, desc: "Optional chart IDs when result_type=charts. If omitted, all queryable charts on the page are queried." },
398
460
  { name: "parameter_controls", type: "json", required: false, desc: "Optional dashboard-level parameter control overrides. Each item must have controlId and one scalar value." },
399
461
  { name: "permission_controls", type: "json", required: false, desc: "Optional dashboard-level permission control values. Each item must have controlId and value. value may be one scalar or an array; allowedValues are hints, not an MCP-side whitelist." },
@@ -412,7 +474,7 @@ var queryBiPanelData = createMcpCommand({
412
474
  panelId: ctx.num("panel_id"),
413
475
  pageKey: ctx.str("page_key"),
414
476
  resultType: ctx.str("result_type"),
415
- requestId: optionalString(ctx, "request_id"),
477
+ requestId: ctx.str("request_id"),
416
478
  chartIds: optionalJson(ctx, "chart_ids"),
417
479
  parameterControls: optionalJson(ctx, "parameter_controls"),
418
480
  permissionControls: optionalJson(ctx, "permission_controls"),
@@ -445,7 +507,7 @@ var queryDashboardDetail = createMcpCommand({
445
507
  // src/commands/te-analysis/dashboard/query-dashboard-report-data.ts
446
508
  var queryDashboardReportData = createMcpCommand({
447
509
  command: "+query_dashboard_report_data",
448
- description: "Query analysis data for one or more reports in a dashboard. Supports additional filters and time range overrides. For long-running or cancelable queries, provide requestId before starting. For any query that may exceed the CLI or MCP HTTP timeout, preset requestId 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. If provided, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup.",
510
+ description: "Query analysis data for one or more reports in a dashboard. Supports additional filters 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.",
449
511
  flags: [
450
512
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
451
513
  { name: "dashboard_id", type: "number", required: true, desc: "Dashboard ID", alias: "d" },
@@ -455,7 +517,7 @@ var queryDashboardReportData = createMcpCommand({
455
517
  { 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." },
456
518
  { name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
457
519
  { name: "report_ids", type: "json", required: false, desc: "Optional report IDs JSON array" },
458
- { name: "request_id", type: "string", required: false, desc: "Optional unique request ID used for tracking and cancellation. If provided, it must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. For long-running or cancelable queries, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup. Generated automatically if omitted. The response metadata.requestId can also be passed to cancel_query when the query is no longer needed." },
520
+ { 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." },
459
521
  { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." },
460
522
  ...clusterQueryFlags("Optional cluster query scope. Supported values: GLOBAL, SLAVE. Omit to follow dashboard configuration.")
461
523
  ],
@@ -469,7 +531,7 @@ var queryDashboardReportData = createMcpCommand({
469
531
  timeGranularity: optionalString(ctx, "time_granularity"),
470
532
  useCache: optionalBoolean(ctx, "use_cache"),
471
533
  reportIds: optionalJson(ctx, "report_ids"),
472
- requestId: optionalString(ctx, "request_id"),
534
+ requestId: ctx.str("request_id"),
473
535
  timeoutMinutes: optionalNumber(ctx, "timeout_minutes"),
474
536
  ...optionalClusterQueryArgs(ctx)
475
537
  })
@@ -641,6 +703,101 @@ var createSpace = createMcpCommand({
641
703
  })
642
704
  });
643
705
 
706
+ // src/commands/te-analysis/dashboard/delete-dashboard.ts
707
+ var deleteDashboard = createMcpCommand({
708
+ command: "+delete_dashboard",
709
+ description: "Delete a dashboard by dashboardId",
710
+ flags: [
711
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
712
+ { name: "dashboard_id", type: "number", required: true, desc: "Dashboard ID to delete" }
713
+ ],
714
+ risk: "write",
715
+ buildArgs: (ctx) => ({
716
+ projectId: ctx.num("project_id"),
717
+ dashboardId: ctx.num("dashboard_id")
718
+ })
719
+ });
720
+
721
+ // src/commands/te-analysis/dashboard/copy-dashboard.ts
722
+ var copyDashboard = createMcpCommand({
723
+ command: "+copy_dashboard",
724
+ description: "Copy a dashboard to a new dashboard. Optionally copies its associated reports. To place the copy in a space or folder, provide to_space_id or to_folder_id.",
725
+ flags: [
726
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
727
+ { name: "dashboard_id", type: "number", required: true, desc: "Source dashboard ID to copy" },
728
+ { name: "dashboard_name", type: "string", required: true, desc: "Name for the new copied dashboard" },
729
+ { name: "report_copy", type: "boolean", required: false, desc: "Whether to also copy the associated reports. Defaults to false." },
730
+ { name: "to_space_id", type: "number", required: false, desc: "Target space ID for the copied dashboard. Omit to use the default location." },
731
+ { name: "to_folder_id", type: "number", required: false, desc: "Target folder ID inside the target space. Omit to place directly in the space root." }
732
+ ],
733
+ risk: "write",
734
+ mcpService: "te_analysis_extend",
735
+ buildArgs: (ctx) => ({
736
+ projectId: ctx.num("project_id"),
737
+ dashboardId: ctx.num("dashboard_id"),
738
+ dashboardName: ctx.str("dashboard_name"),
739
+ reportCopy: optionalBoolean(ctx, "report_copy"),
740
+ toSpaceId: optionalNumber(ctx, "to_space_id"),
741
+ toFolderId: optionalNumber(ctx, "to_folder_id")
742
+ })
743
+ });
744
+
745
+ // src/commands/te-analysis/dashboard/move-dashboard.ts
746
+ var moveDashboard = createMcpCommand({
747
+ command: "+move_dashboard",
748
+ description: "Move a dashboard to a different space or folder. Provide to_space_id to move to a space root, or both to_space_id and to_folder_id to move into a folder within that space.",
749
+ flags: [
750
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
751
+ { name: "dashboard_id", type: "number", required: true, desc: "Dashboard ID to move" },
752
+ { name: "to_space_id", type: "number", required: true, desc: "Target space ID to move the dashboard into" },
753
+ { name: "to_folder_id", type: "number", required: false, desc: "Target folder ID within the target space. Omit to place at the space root." },
754
+ { name: "from_space_id", type: "number", required: false, desc: "Source space ID the dashboard is currently in. Omit if unknown." },
755
+ { name: "from_folder_id", type: "number", required: false, desc: "Source folder ID the dashboard is currently in. Omit if unknown." }
756
+ ],
757
+ risk: "write",
758
+ mcpService: "te_analysis_extend",
759
+ buildArgs: (ctx) => ({
760
+ projectId: ctx.num("project_id"),
761
+ dashboardId: ctx.num("dashboard_id"),
762
+ toSpaceId: ctx.num("to_space_id"),
763
+ toFolderId: optionalNumber(ctx, "to_folder_id"),
764
+ fromSpaceId: optionalNumber(ctx, "from_space_id"),
765
+ fromFolderId: optionalNumber(ctx, "from_folder_id")
766
+ })
767
+ });
768
+
769
+ // src/commands/te-analysis/dashboard/list-spaces.ts
770
+ var listSpaces = createMcpCommand({
771
+ command: "+list_spaces",
772
+ description: "List spaces and folders accessible to the current user in the project as a recursive tree. Use to resolve spaceId for create_dashboard / copy_dashboard, and toSpaceId / toFolderId / fromSpaceId / fromFolderId for move_dashboard and copy_dashboard.",
773
+ flags: [
774
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" }
775
+ ],
776
+ risk: "read",
777
+ mcpService: "te_analysis_extend",
778
+ buildArgs: (ctx) => ({
779
+ projectId: ctx.num("project_id")
780
+ })
781
+ });
782
+
783
+ // src/commands/te-analysis/dashboard/freeze-dashboards.ts
784
+ var freezeDashboards = createMcpCommand({
785
+ command: "+freeze_dashboards",
786
+ description: "Freeze or unfreeze one or more dashboards. freeze=true freezes and takes scheduled jobs offline; freeze=false unfreezes and brings scheduled jobs back online.",
787
+ flags: [
788
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
789
+ { name: "dashboard_ids", type: "json", required: true, desc: "List of dashboard IDs to freeze or unfreeze" },
790
+ { name: "freeze", type: "boolean", required: true, desc: "true to freeze, false to unfreeze" }
791
+ ],
792
+ risk: "write",
793
+ mcpService: "te_analysis_extend",
794
+ buildArgs: (ctx) => ({
795
+ projectId: ctx.num("project_id"),
796
+ dashboardIds: ctx.json("dashboard_ids"),
797
+ freeze: ctx.bool("freeze")
798
+ })
799
+ });
800
+
644
801
  // src/commands/te-analysis/dashboard/index.ts
645
802
  var commands3 = [
646
803
  listDashboards,
@@ -651,23 +808,28 @@ var commands3 = [
651
808
  queryDashboardReportData,
652
809
  createDashboard,
653
810
  updateDashboard,
811
+ deleteDashboard,
812
+ copyDashboard,
813
+ moveDashboard,
654
814
  createOrUpdateDashboardNote,
655
815
  listPublicAccessLinks,
656
816
  createPublicAccessLink,
657
817
  updatePublicAccessLink,
658
- createSpace
818
+ createSpace,
819
+ listSpaces,
820
+ freezeDashboards
659
821
  ];
660
822
  var dashboard_default = commands3;
661
823
 
662
824
  // src/commands/te-analysis/model/query-adhoc.ts
663
825
  var queryAdhoc = createMcpCommand({
664
826
  command: "+query_adhoc",
665
- 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, provide requestId before starting. For any query that may exceed the CLI or MCP HTTP timeout, preset requestId 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. If provided, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup.",
827
+ 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.",
666
828
  flags: [
667
829
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
668
830
  { 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." },
669
831
  { 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." },
670
- { name: "request_id", type: "string", required: false, desc: "Optional unique request ID used for tracking and cancellation. If provided, it must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. For long-running or cancelable queries, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup. Generated automatically if omitted. The response metadata.requestId can also be passed to cancel_query when the query is no longer needed." },
832
+ { 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." },
671
833
  { name: "use_cache", type: "boolean", required: false, desc: "Whether to use result cache. Default: true" },
672
834
  { name: "zone_offset", type: "number", required: false, desc: "Time zone offset in hours. For example, UTC+8 is 8 and UTC-5 is -5" },
673
835
  { name: "is_sort_by_columns", type: "boolean", required: false, desc: "Whether to sort query results by columns. Default: false" },
@@ -690,7 +852,7 @@ var queryAdhoc = createMcpCommand({
690
852
  projectId: ctx.num("project_id"),
691
853
  modelType: ctx.str("model_type"),
692
854
  qp: requiredJsonString(ctx, "qp"),
693
- requestId: optionalString(ctx, "request_id"),
855
+ requestId: ctx.str("request_id"),
694
856
  useCache: optionalBoolean(ctx, "use_cache"),
695
857
  zoneOffset: optionalNumber(ctx, "zone_offset"),
696
858
  isSortByColumns: optionalBoolean(ctx, "is_sort_by_columns"),
@@ -706,7 +868,7 @@ var queryAdhoc = createMcpCommand({
706
868
  // src/commands/te-analysis/model/cancel-query.ts
707
869
  var cancelQuery = createMcpCommand({
708
870
  command: "+cancel_query",
709
- 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 preset requestId to release it. For proactive cancellation, pass requestId to the query tool before starting it, then call cancel_query with the same value if you stop waiting. The auto-generated requestId is not available when the HTTP request fails before a response.",
871
+ 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.",
710
872
  flags: [
711
873
  { 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." },
712
874
  { name: "reason", type: "string", required: false, desc: "Optional cancellation reason. Default: MCP_CANCEL_QUERY_TOOL." }
@@ -803,7 +965,7 @@ var buildPropAnalysisQp = createMcpCommand({
803
965
  // src/commands/te-analysis/model/drilldown-users.ts
804
966
  var drilldownUsers = createMcpCommand({
805
967
  command: "+drilldown_users",
806
- 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, provide requestId before starting. For any query that may exceed the CLI or MCP HTTP timeout, preset requestId 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. If provided, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup.",
968
+ 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.",
807
969
  flags: [
808
970
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
809
971
  { 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." },
@@ -825,7 +987,7 @@ var drilldownUsers = createMcpCommand({
825
987
  { name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
826
988
  { name: "limit", type: "number", required: false, desc: "Optional limit. Default: 1000, maximum: 10000." },
827
989
  { name: "offset", type: "number", required: false, desc: "Optional offset. Default: 0." },
828
- { name: "request_id", type: "string", required: false, desc: "Optional unique request ID used for tracking and cancellation. If provided, it must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. For long-running or cancelable queries, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup. Generated automatically if omitted. The response metadata.requestId can also be passed to cancel_query when the query is no longer needed." },
990
+ { 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." },
829
991
  { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
830
992
  ],
831
993
  risk: "read",
@@ -853,7 +1015,7 @@ var drilldownUsers = createMcpCommand({
853
1015
  useCache: optionalBoolean(ctx, "use_cache"),
854
1016
  limit: optionalNumber(ctx, "limit") ?? DEFAULT_QUERY_LIMIT,
855
1017
  offset: optionalNumber(ctx, "offset"),
856
- requestId: optionalString(ctx, "request_id"),
1018
+ requestId: ctx.str("request_id"),
857
1019
  timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
858
1020
  })
859
1021
  });
@@ -861,7 +1023,7 @@ var drilldownUsers = createMcpCommand({
861
1023
  // src/commands/te-analysis/model/drilldown-user-events.ts
862
1024
  var drilldownUserEvents = createMcpCommand({
863
1025
  command: "+drilldown_user_events",
864
- 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, provide requestId before starting. For any query that may exceed the CLI or MCP HTTP timeout, preset requestId 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. If provided, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup.",
1026
+ 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.",
865
1027
  flags: [
866
1028
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
867
1029
  { name: "user_id", type: "string", required: true, desc: "User ID from drilldown_users" },
@@ -881,7 +1043,7 @@ var drilldownUserEvents = createMcpCommand({
881
1043
  { name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
882
1044
  { name: "page_num", type: "number", required: false, desc: "Start page number. Default: 1" },
883
1045
  { name: "page_size", type: "number", required: false, desc: "Page size. Default: 1000, maximum: 10000." },
884
- { name: "request_id", type: "string", required: false, desc: "Optional unique request ID used for tracking and cancellation. If provided, it must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. For long-running or cancelable queries, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup. Generated automatically if omitted. The response metadata.requestId can also be passed to cancel_query when the query is no longer needed." },
1046
+ { 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." },
885
1047
  { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
886
1048
  ],
887
1049
  risk: "read",
@@ -907,7 +1069,7 @@ var drilldownUserEvents = createMcpCommand({
907
1069
  useCache: optionalBoolean(ctx, "use_cache"),
908
1070
  pageNum: optionalNumber(ctx, "page_num"),
909
1071
  pageSize: optionalNumber(ctx, "page_size") ?? DEFAULT_QUERY_LIMIT,
910
- requestId: optionalString(ctx, "request_id"),
1072
+ requestId: ctx.str("request_id"),
911
1073
  timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
912
1074
  })
913
1075
  });
@@ -992,20 +1154,130 @@ var loadFilters = createMcpCommand({
992
1154
  // src/commands/te-analysis/model/get-table-columns.ts
993
1155
  var getTableColumns = createMcpCommand({
994
1156
  command: "+get_table_columns",
995
- description: "Query the field list of a project table. Returns column names and types for the specified catalog, schema, and table so the table structure can be understood before SQL analysis.",
1157
+ 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.",
996
1158
  flags: [
997
1159
  { name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
998
- { name: "catalog", type: "string", required: true, desc: "Catalog name. Default: hive" },
999
- { name: "schema", type: "string", required: true, desc: "Schema name. Default: ta" },
1000
- { name: "table", type: "string", required: true, desc: "Table name" }
1160
+ { 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." }
1001
1161
  ],
1002
1162
  risk: "read",
1003
1163
  mcpService: "te_analysis_extend",
1004
1164
  buildArgs: (ctx) => ({
1005
1165
  projectId: ctx.num("project_id"),
1006
- catalog: ctx.str("catalog"),
1007
- schema: ctx.str("schema"),
1008
- table: ctx.str("table")
1166
+ tableRef: ctx.str("table_ref")
1167
+ })
1168
+ });
1169
+
1170
+ // src/commands/te-analysis/model/build-interval-analysis-qp.ts
1171
+ var buildIntervalAnalysisQp = createMcpCommand({
1172
+ command: "+build_interval_analysis_qp",
1173
+ 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.",
1174
+ flags: [
1175
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
1176
+ { name: "time_range", type: "json", required: true, desc: "Required time range JSON for interval analysis." },
1177
+ { 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." },
1178
+ { name: "relation", type: "string", required: false, desc: "Filter relation for top-level interval filters. Supported values: and, or. Default: and." },
1179
+ { name: "time_particle_size", type: "string", required: false, desc: "Time granularity. Allowed values: day, week, month. Defaults to day when omitted." }
1180
+ ],
1181
+ risk: "read",
1182
+ buildArgs: (ctx) => ({
1183
+ projectId: ctx.num("project_id"),
1184
+ timeRange: ctx.json("time_range"),
1185
+ interval: ctx.json("interval"),
1186
+ relation: optionalString(ctx, "relation"),
1187
+ timeParticleSize: optionalString(ctx, "time_particle_size")
1188
+ })
1189
+ });
1190
+
1191
+ // src/commands/te-analysis/model/build-path-analysis-qp.ts
1192
+ var buildPathAnalysisQp = createMcpCommand({
1193
+ command: "+build_path_analysis_qp",
1194
+ 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.",
1195
+ flags: [
1196
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
1197
+ { name: "time_range", type: "json", required: true, desc: "Required time range JSON for path analysis." },
1198
+ { 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)." }
1199
+ ],
1200
+ risk: "read",
1201
+ buildArgs: (ctx) => ({
1202
+ projectId: ctx.num("project_id"),
1203
+ timeRange: ctx.json("time_range"),
1204
+ path: ctx.json("path")
1205
+ })
1206
+ });
1207
+
1208
+ // src/commands/te-analysis/model/build-attribution-analysis-qp.ts
1209
+ var buildAttributionAnalysisQp = createMcpCommand({
1210
+ command: "+build_attribution_analysis_qp",
1211
+ 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.",
1212
+ flags: [
1213
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
1214
+ { name: "time_range", type: "json", required: true, desc: "Required time range JSON for attribution analysis." },
1215
+ { 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." }
1216
+ ],
1217
+ risk: "read",
1218
+ buildArgs: (ctx) => ({
1219
+ projectId: ctx.num("project_id"),
1220
+ timeRange: ctx.json("time_range"),
1221
+ attribution: ctx.json("attribution")
1222
+ })
1223
+ });
1224
+
1225
+ // src/commands/te-analysis/model/build-heat-map-analysis-qp.ts
1226
+ var buildHeatMapAnalysisQp = createMcpCommand({
1227
+ command: "+build_heat_map_analysis_qp",
1228
+ 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.",
1229
+ flags: [
1230
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
1231
+ { name: "time_range", type: "json", required: true, desc: "Required time range JSON for heatmap analysis." },
1232
+ { name: "heat_map", type: "json", required: true, desc: "Heatmap intent JSON. Required fields: hotEvent, hotAggregation, xProp, yProp. Optional: hotProperty, filters, relation." }
1233
+ ],
1234
+ risk: "read",
1235
+ buildArgs: (ctx) => ({
1236
+ projectId: ctx.num("project_id"),
1237
+ timeRange: ctx.json("time_range"),
1238
+ heatMap: ctx.json("heat_map")
1239
+ })
1240
+ });
1241
+
1242
+ // src/commands/te-analysis/model/build-rank-list-analysis-qp.ts
1243
+ var buildRankListAnalysisQp = createMcpCommand({
1244
+ command: "+build_rank_list_analysis_qp",
1245
+ 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.",
1246
+ flags: [
1247
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
1248
+ { name: "time_range", type: "json", required: true, desc: "Required time range JSON for rank list analysis." },
1249
+ { 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." }
1250
+ ],
1251
+ risk: "read",
1252
+ buildArgs: (ctx) => ({
1253
+ projectId: ctx.num("project_id"),
1254
+ timeRange: ctx.json("time_range"),
1255
+ rankList: ctx.json("rank_list")
1256
+ })
1257
+ });
1258
+
1259
+ // src/commands/te-analysis/model/build-distribution-analysis-qp.ts
1260
+ var buildDistributionAnalysisQp = createMcpCommand({
1261
+ command: "+build_distribution_analysis_qp",
1262
+ 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.",
1263
+ flags: [
1264
+ { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
1265
+ { name: "time_range", type: "json", required: true, desc: "Required time range JSON for distribution analysis." },
1266
+ { 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." },
1267
+ { name: "time_particle_size", type: "string", required: false, desc: "Time granularity. Allowed values: day, week, month, total. Defaults to day when omitted." },
1268
+ { name: "groups", type: "json", required: false, desc: "Optional group-by dimensions JSON array." },
1269
+ { name: "filters", type: "json", required: false, desc: "Optional global filters JSON array." },
1270
+ { name: "relation", type: "string", required: false, desc: "Optional filter relation. Supported values: and, or. Default: and." }
1271
+ ],
1272
+ risk: "read",
1273
+ buildArgs: (ctx) => ({
1274
+ projectId: ctx.num("project_id"),
1275
+ timeRange: ctx.json("time_range"),
1276
+ distributionMetrics: ctx.json("distribution_metrics"),
1277
+ timeParticleSize: optionalString(ctx, "time_particle_size"),
1278
+ groups: optionalJson(ctx, "groups"),
1279
+ filters: optionalJson(ctx, "filters"),
1280
+ relation: optionalString(ctx, "relation")
1009
1281
  })
1010
1282
  });
1011
1283
 
@@ -1015,6 +1287,12 @@ var commands4 = [
1015
1287
  buildRetentionAnalysisQp,
1016
1288
  buildFunnelAnalysisQp,
1017
1289
  buildPropAnalysisQp,
1290
+ buildIntervalAnalysisQp,
1291
+ buildPathAnalysisQp,
1292
+ buildAttributionAnalysisQp,
1293
+ buildHeatMapAnalysisQp,
1294
+ buildRankListAnalysisQp,
1295
+ buildDistributionAnalysisQp,
1018
1296
  queryAdhoc,
1019
1297
  cancelQuery,
1020
1298
  drilldownUsers,
@@ -1028,7 +1306,7 @@ var model_default = commands4;
1028
1306
  // src/commands/te-analysis/entity/query-entity-details.ts
1029
1307
  var queryEntityDetails = createMcpCommand({
1030
1308
  command: "+query_entity_details",
1031
- 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, provide requestId before starting. For any query that may exceed the CLI or MCP HTTP timeout, preset requestId 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. If provided, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup.",
1309
+ 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.",
1032
1310
  flags: [
1033
1311
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
1034
1312
  { name: "entity_id", type: "number", required: false, desc: "Optional entity ID used in multi-entity scenarios. If omitted, the default user entity is used." },
@@ -1039,7 +1317,7 @@ var queryEntityDetails = createMcpCommand({
1039
1317
  { name: "limit", type: "number", required: false, desc: "Optional result limit. Default: 1000, maximum: 10000" },
1040
1318
  { name: "zone_offset", type: "number", required: false, desc: "Time zone offset. For example, UTC+8 is 8" },
1041
1319
  { name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
1042
- { name: "request_id", type: "string", required: false, desc: "Optional unique request ID used for tracking and cancellation. If provided, it must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. For long-running or cancelable queries, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup. Generated automatically if omitted. The response metadata.requestId can also be passed to cancel_query when the query is no longer needed." },
1320
+ { 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." },
1043
1321
  { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
1044
1322
  ],
1045
1323
  risk: "read",
@@ -1056,7 +1334,7 @@ var queryEntityDetails = createMcpCommand({
1056
1334
  limit: optionalNumber(ctx, "limit") ?? DEFAULT_QUERY_LIMIT,
1057
1335
  zoneOffset: optionalNumber(ctx, "zone_offset"),
1058
1336
  useCache: optionalBoolean(ctx, "use_cache"),
1059
- requestId: optionalString(ctx, "request_id"),
1337
+ requestId: ctx.str("request_id"),
1060
1338
  timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
1061
1339
  })
1062
1340
  });
@@ -1064,7 +1342,7 @@ var queryEntityDetails = createMcpCommand({
1064
1342
  // src/commands/te-analysis/entity/query-event-details.ts
1065
1343
  var queryEventDetails = createMcpCommand({
1066
1344
  command: "+query_event_details",
1067
- 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, provide requestId before starting. For any query that may exceed the CLI or MCP HTTP timeout, preset requestId 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. If provided, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup.",
1345
+ 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.",
1068
1346
  flags: [
1069
1347
  { name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
1070
1348
  { name: "event_name", type: "string", required: true, desc: "Event name" },
@@ -1078,7 +1356,7 @@ var queryEventDetails = createMcpCommand({
1078
1356
  { name: "limit", type: "number", required: false, desc: "Optional result limit. Default: 1000, maximum: 10000" },
1079
1357
  { name: "zone_offset", type: "number", required: false, desc: "Time zone offset. For example, UTC+8 is 8" },
1080
1358
  { name: "use_cache", type: "boolean", required: false, desc: "Whether to use cache. Default: true" },
1081
- { name: "request_id", type: "string", required: false, desc: "Optional unique request ID used for tracking and cancellation. If provided, it must use mcp_<32 lowercase hex UUID>, for example mcp_0123456789abcdef0123456789abcdef. For long-running or cancelable queries, 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. The auto-generated requestId is not available when the HTTP request fails before a response, so preset requestId is required for proactive cleanup. Generated automatically if omitted. The response metadata.requestId can also be passed to cancel_query when the query is no longer needed." },
1359
+ { 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." },
1082
1360
  { name: "timeout_minutes", type: "number", required: false, desc: "Query timeout in minutes. If omitted, 30 minutes is used." }
1083
1361
  ],
1084
1362
  risk: "read",
@@ -1095,7 +1373,7 @@ var queryEventDetails = createMcpCommand({
1095
1373
  limit: optionalNumber(ctx, "limit"),
1096
1374
  zoneOffset: optionalNumber(ctx, "zone_offset"),
1097
1375
  useCache: optionalBoolean(ctx, "use_cache"),
1098
- requestId: optionalString(ctx, "request_id"),
1376
+ requestId: ctx.str("request_id"),
1099
1377
  timeoutMinutes: optionalNumber(ctx, "timeout_minutes")
1100
1378
  })
1101
1379
  });