@thinkingai/ae-cli 1.0.15 → 1.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.
- package/README.md +23 -24
- package/README.zh.md +21 -22
- package/dist/auth-A4NV2VHD.js +153 -0
- package/dist/{auth-4GAHTBVH.js → auth-T3ILGJKW.js} +6 -4
- package/dist/{chunk-TJIMDNAU.js → chunk-5CCFSPAF.js} +79 -3
- package/dist/{chunk-UK6HO5O5.js → chunk-OVMQFFC2.js} +13 -1
- package/dist/{chunk-EBFUVWIZ.js → chunk-TMMUBSKW.js} +52 -0
- package/dist/{chunk-OQ4XEG77.js → chunk-TOXRLDUP.js} +2 -2
- package/dist/{client-HU63573O.js → client-FPA76DGY.js} +3 -3
- package/dist/{config-OLF7RBPM.js → config-QZIEYXQZ.js} +20 -5
- package/dist/index.js +18 -13
- package/dist/{raw-GDO4IWNW.js → raw-MZIKHQH4.js} +3 -3
- package/dist/{te-analysis-ZDJXMWZY.js → te-analysis-CFQBXUCO.js} +93 -7
- package/dist/{te-audience-T5B52EEB.js → te-audience-WPBBWADL.js} +3 -3
- package/dist/{te-common-BPTXXTHQ.js → te-common-GL3KBZPD.js} +3 -3
- package/dist/{te-community-FPB5LH56.js → te-community-3XEJNSQL.js} +3 -3
- package/dist/{te-dataops-2NUJVG47.js → te-dataops-H4WSMCG5.js} +3 -3
- package/dist/{te-engage-K3EANZ5P.js → te-engage-2VFM37ZM.js} +3 -3
- package/dist/te-kb-U6SQUJVC.js +41 -0
- package/dist/{te-meta-JJMV75KB.js → te-meta-BO45GW32.js} +10 -8
- package/package.json +2 -1
- package/skills/ae-analysis/SKILL.md +119 -29
- package/skills/ae-analysis/references/build_event_analysis_qp.md +132 -0
- package/skills/ae-analysis/references/build_funnel_analysis_qp.md +143 -0
- package/skills/ae-analysis/references/build_prop_analysis_qp.md +122 -0
- package/skills/ae-analysis/references/build_retention_analysis_qp.md +141 -0
- package/skills/ae-analysis/references/generate_track_program.md +8 -8
- package/skills/ae-analysis/references/get_analysis_query_schema.md +22 -11
- package/skills/ae-analysis/references/get_metric.md +7 -1
- package/skills/ae-analysis/references/get_report_definition.md +4 -0
- package/skills/ae-analysis/references/list_alerts.md +4 -0
- package/skills/ae-analysis/references/list_clusters.md +4 -0
- package/skills/ae-analysis/references/list_dashboards.md +6 -0
- package/skills/ae-analysis/references/list_events.md +8 -1
- package/skills/ae-analysis/references/list_metrics.md +9 -0
- package/skills/ae-analysis/references/list_properties.md +6 -1
- package/skills/ae-analysis/references/list_reports.md +6 -0
- package/skills/ae-analysis/references/list_tags.md +4 -0
- package/skills/ae-analysis/references/query_adhoc.md +80 -30
- package/skills/ae-community/SKILL.md +14 -101
- package/skills/ae-dataops/SKILL.md +13 -58
- package/skills/ae-engage/SKILL.md +15 -98
- package/dist/auth-U2GHFMFY.js +0 -81
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
getActiveHost,
|
|
7
7
|
safeJsonParse
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TMMUBSKW.js";
|
|
9
9
|
|
|
10
10
|
// src/index.ts
|
|
11
11
|
import { Command as CommanderCommand } from "commander";
|
|
@@ -62,7 +62,7 @@ function createRuntimeContext(cmd, opts, globalOpts) {
|
|
|
62
62
|
let _clientModule = null;
|
|
63
63
|
async function getClient() {
|
|
64
64
|
if (!_clientModule) {
|
|
65
|
-
_clientModule = await import("./client-
|
|
65
|
+
_clientModule = await import("./client-FPA76DGY.js");
|
|
66
66
|
}
|
|
67
67
|
return _clientModule;
|
|
68
68
|
}
|
|
@@ -105,7 +105,7 @@ function createRuntimeContext(cmd, opts, globalOpts) {
|
|
|
105
105
|
return client.queryReportData(projectId, reportId, qp, eventModel, options, ctx.host());
|
|
106
106
|
},
|
|
107
107
|
async token() {
|
|
108
|
-
const { getToken } = await import("./auth-
|
|
108
|
+
const { getToken } = await import("./auth-T3ILGJKW.js");
|
|
109
109
|
return getToken(ctx.host());
|
|
110
110
|
},
|
|
111
111
|
host() {
|
|
@@ -210,59 +210,64 @@ program.name("ae-cli").version(version).description("CLI tool for ThinkingAI (AE
|
|
|
210
210
|
async function loadCommands() {
|
|
211
211
|
const commands = [];
|
|
212
212
|
try {
|
|
213
|
-
const teAnalysis = await import("./te-analysis-
|
|
213
|
+
const teAnalysis = await import("./te-analysis-CFQBXUCO.js");
|
|
214
214
|
commands.push(...teAnalysis.default);
|
|
215
215
|
} catch {
|
|
216
216
|
}
|
|
217
217
|
try {
|
|
218
|
-
const teAudience = await import("./te-audience-
|
|
218
|
+
const teAudience = await import("./te-audience-WPBBWADL.js");
|
|
219
219
|
commands.push(...teAudience.default);
|
|
220
220
|
} catch {
|
|
221
221
|
}
|
|
222
222
|
try {
|
|
223
|
-
const teMeta = await import("./te-meta-
|
|
223
|
+
const teMeta = await import("./te-meta-BO45GW32.js");
|
|
224
224
|
commands.push(...teMeta.default);
|
|
225
225
|
} catch {
|
|
226
226
|
}
|
|
227
227
|
try {
|
|
228
|
-
const teCommon = await import("./te-common-
|
|
228
|
+
const teCommon = await import("./te-common-GL3KBZPD.js");
|
|
229
229
|
commands.push(...teCommon.default);
|
|
230
230
|
} catch {
|
|
231
231
|
}
|
|
232
232
|
try {
|
|
233
|
-
const engage = await import("./te-engage-
|
|
233
|
+
const engage = await import("./te-engage-2VFM37ZM.js");
|
|
234
234
|
commands.push(...engage.default);
|
|
235
235
|
} catch {
|
|
236
236
|
}
|
|
237
237
|
try {
|
|
238
|
-
const community = await import("./te-community-
|
|
238
|
+
const community = await import("./te-community-3XEJNSQL.js");
|
|
239
239
|
commands.push(...community.default);
|
|
240
240
|
} catch {
|
|
241
241
|
}
|
|
242
242
|
try {
|
|
243
|
-
const dataops = await import("./te-dataops-
|
|
243
|
+
const dataops = await import("./te-dataops-H4WSMCG5.js");
|
|
244
244
|
commands.push(...dataops.default);
|
|
245
245
|
} catch {
|
|
246
246
|
}
|
|
247
|
+
try {
|
|
248
|
+
const teKb = await import("./te-kb-U6SQUJVC.js");
|
|
249
|
+
commands.push(...teKb.default);
|
|
250
|
+
} catch {
|
|
251
|
+
}
|
|
247
252
|
return commands;
|
|
248
253
|
}
|
|
249
254
|
async function registerAuthCommands() {
|
|
250
255
|
try {
|
|
251
|
-
const { registerAuth } = await import("./auth-
|
|
256
|
+
const { registerAuth } = await import("./auth-A4NV2VHD.js");
|
|
252
257
|
registerAuth(program);
|
|
253
258
|
} catch {
|
|
254
259
|
}
|
|
255
260
|
}
|
|
256
261
|
async function registerConfigCommands() {
|
|
257
262
|
try {
|
|
258
|
-
const { registerConfig } = await import("./config-
|
|
263
|
+
const { registerConfig } = await import("./config-QZIEYXQZ.js");
|
|
259
264
|
registerConfig(program);
|
|
260
265
|
} catch {
|
|
261
266
|
}
|
|
262
267
|
}
|
|
263
268
|
async function registerApiCommand() {
|
|
264
269
|
try {
|
|
265
|
-
const { registerApi } = await import("./raw-
|
|
270
|
+
const { registerApi } = await import("./raw-MZIKHQH4.js");
|
|
266
271
|
registerApi(program);
|
|
267
272
|
} catch {
|
|
268
273
|
}
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
httpGet,
|
|
7
7
|
httpPost
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TOXRLDUP.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveHost
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OVMQFFC2.js";
|
|
12
12
|
import {
|
|
13
13
|
safeJsonParse
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TMMUBSKW.js";
|
|
15
15
|
|
|
16
16
|
// src/api/raw.ts
|
|
17
17
|
function registerApi(program) {
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
callMcpTool,
|
|
3
3
|
parseMcpResult,
|
|
4
4
|
resolveMcpUrl
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-5CCFSPAF.js";
|
|
6
|
+
import "./chunk-OVMQFFC2.js";
|
|
7
|
+
import "./chunk-TMMUBSKW.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/te-analysis/shared.ts
|
|
10
10
|
function createMcpCommand(config) {
|
|
@@ -476,16 +476,16 @@ var dashboard_default = commands3;
|
|
|
476
476
|
// src/commands/te-analysis/model/query-adhoc.ts
|
|
477
477
|
var queryAdhoc = createMcpCommand({
|
|
478
478
|
command: "+query_adhoc",
|
|
479
|
-
description: "Run ad hoc analysis
|
|
479
|
+
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.",
|
|
480
480
|
flags: [
|
|
481
481
|
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
482
482
|
{ 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." },
|
|
483
|
-
{ name: "qp", type: "json", required: true, desc: "Query parameter JSON.
|
|
483
|
+
{ 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." },
|
|
484
484
|
{ name: "request_id", type: "string", required: false, desc: "Optional unique request ID used for tracking and deduplication. Generated automatically if omitted." },
|
|
485
485
|
{ name: "use_cache", type: "boolean", required: false, desc: "Whether to use result cache. Default: true" },
|
|
486
486
|
{ name: "zone_offset", type: "number", required: false, desc: "Time zone offset in hours. For example, UTC+8 is 8 and UTC-5 is -5" },
|
|
487
487
|
{ name: "is_sort_by_columns", type: "boolean", required: false, desc: "Whether to sort query results by columns. Default: false" },
|
|
488
|
-
{ name: "resolve_recent_day", type: "boolean", required: false, desc: "Whether to resolve relative time expressions such as last 7 days.
|
|
488
|
+
{ 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." },
|
|
489
489
|
{ name: "fields", type: "json", required: false, desc: "Optional fields to return. Must match column names in result." },
|
|
490
490
|
{ name: "limit", type: "number", required: false, desc: "Optional limit. Default: 20, maximum: 50." },
|
|
491
491
|
{ name: "offset", type: "number", required: false, desc: "Optional offset. Default: 0." },
|
|
@@ -508,6 +508,88 @@ var queryAdhoc = createMcpCommand({
|
|
|
508
508
|
})
|
|
509
509
|
});
|
|
510
510
|
|
|
511
|
+
// src/commands/te-analysis/model/build-event-analysis-qp.ts
|
|
512
|
+
var buildEventAnalysisQp = createMcpCommand({
|
|
513
|
+
command: "+build_event_analysis_qp",
|
|
514
|
+
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.",
|
|
515
|
+
flags: [
|
|
516
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
517
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for event analysis." },
|
|
518
|
+
{ name: "metrics", type: "json", required: true, desc: "Required event metrics JSON array." },
|
|
519
|
+
{ name: "time_particle_size", type: "string", required: false, desc: "Optional time granularity. Default: total." },
|
|
520
|
+
{ name: "groups", type: "json", required: false, desc: "Optional group-by dimensions JSON array." },
|
|
521
|
+
{ name: "filters", type: "json", required: false, desc: "Optional global filters JSON array." },
|
|
522
|
+
{ name: "relation", type: "string", required: false, desc: "Optional filter relation. Supported values: and, or. Default: and." }
|
|
523
|
+
],
|
|
524
|
+
risk: "read",
|
|
525
|
+
buildArgs: (ctx) => ({
|
|
526
|
+
projectId: ctx.num("project_id"),
|
|
527
|
+
timeRange: ctx.json("time_range"),
|
|
528
|
+
metrics: ctx.json("metrics"),
|
|
529
|
+
timeParticleSize: ctx.str("time_particle_size") || void 0,
|
|
530
|
+
groups: optionalJson(ctx, "groups"),
|
|
531
|
+
filters: optionalJson(ctx, "filters"),
|
|
532
|
+
relation: ctx.str("relation") || void 0
|
|
533
|
+
})
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
// src/commands/te-analysis/model/build-retention-analysis-qp.ts
|
|
537
|
+
var buildRetentionAnalysisQp = createMcpCommand({
|
|
538
|
+
command: "+build_retention_analysis_qp",
|
|
539
|
+
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.",
|
|
540
|
+
flags: [
|
|
541
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
542
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for retention analysis." },
|
|
543
|
+
{ name: "retention", type: "json", required: true, desc: "Required retention intent JSON." },
|
|
544
|
+
{ name: "relation", type: "string", required: false, desc: "Optional top-level retention filter relation. Supported values: and, or. Default: and." },
|
|
545
|
+
{ name: "time_particle_size", type: "string", required: false, desc: "Optional time granularity. Supported values: day, week, month." }
|
|
546
|
+
],
|
|
547
|
+
risk: "read",
|
|
548
|
+
buildArgs: (ctx) => ({
|
|
549
|
+
projectId: ctx.num("project_id"),
|
|
550
|
+
timeRange: ctx.json("time_range"),
|
|
551
|
+
retention: ctx.json("retention"),
|
|
552
|
+
relation: ctx.str("relation") || void 0,
|
|
553
|
+
timeParticleSize: ctx.str("time_particle_size") || void 0
|
|
554
|
+
})
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
// src/commands/te-analysis/model/build-funnel-analysis-qp.ts
|
|
558
|
+
var buildFunnelAnalysisQp = createMcpCommand({
|
|
559
|
+
command: "+build_funnel_analysis_qp",
|
|
560
|
+
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.",
|
|
561
|
+
flags: [
|
|
562
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
563
|
+
{ name: "time_range", type: "json", required: true, desc: "Required time range JSON for funnel analysis." },
|
|
564
|
+
{ name: "funnel", type: "json", required: true, desc: "Required funnel intent JSON." },
|
|
565
|
+
{ name: "relation", type: "string", required: false, desc: "Optional top-level funnel filter relation. Supported values: and, or. Default: and." },
|
|
566
|
+
{ name: "time_particle_size", type: "string", required: false, desc: "Optional time granularity. Supported values: day, week, month." }
|
|
567
|
+
],
|
|
568
|
+
risk: "read",
|
|
569
|
+
buildArgs: (ctx) => ({
|
|
570
|
+
projectId: ctx.num("project_id"),
|
|
571
|
+
timeRange: ctx.json("time_range"),
|
|
572
|
+
funnel: ctx.json("funnel"),
|
|
573
|
+
relation: ctx.str("relation") || void 0,
|
|
574
|
+
timeParticleSize: ctx.str("time_particle_size") || void 0
|
|
575
|
+
})
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
// src/commands/te-analysis/model/build-prop-analysis-qp.ts
|
|
579
|
+
var buildPropAnalysisQp = createMcpCommand({
|
|
580
|
+
command: "+build_prop_analysis_qp",
|
|
581
|
+
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.",
|
|
582
|
+
flags: [
|
|
583
|
+
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
584
|
+
{ name: "prop_analysis", type: "json", required: true, desc: "Required user property analysis intent JSON." }
|
|
585
|
+
],
|
|
586
|
+
risk: "read",
|
|
587
|
+
buildArgs: (ctx) => ({
|
|
588
|
+
projectId: ctx.num("project_id"),
|
|
589
|
+
propAnalysis: ctx.json("prop_analysis")
|
|
590
|
+
})
|
|
591
|
+
});
|
|
592
|
+
|
|
511
593
|
// src/commands/te-analysis/model/drilldown-users.ts
|
|
512
594
|
var drilldownUsers = createMcpCommand({
|
|
513
595
|
command: "+drilldown_users",
|
|
@@ -709,6 +791,10 @@ var getTableColumns = createMcpCommand({
|
|
|
709
791
|
|
|
710
792
|
// src/commands/te-analysis/model/index.ts
|
|
711
793
|
var commands4 = [
|
|
794
|
+
buildEventAnalysisQp,
|
|
795
|
+
buildRetentionAnalysisQp,
|
|
796
|
+
buildFunnelAnalysisQp,
|
|
797
|
+
buildPropAnalysisQp,
|
|
712
798
|
queryAdhoc,
|
|
713
799
|
drilldownUsers,
|
|
714
800
|
drilldownUserEvents,
|
|
@@ -854,7 +940,7 @@ var entity_default = commands5;
|
|
|
854
940
|
// src/commands/te-analysis/schema/get-analysis-query-schema.ts
|
|
855
941
|
var getAnalysisQuerySchema = createMcpCommand({
|
|
856
942
|
command: "+get_analysis_query_schema",
|
|
857
|
-
description: "Get the analysis query schema for
|
|
943
|
+
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.",
|
|
858
944
|
flags: [
|
|
859
945
|
{ 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" },
|
|
860
946
|
{ 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)." },
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
callMcpTool,
|
|
3
3
|
parseMcpResult,
|
|
4
4
|
resolveMcpUrl
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-5CCFSPAF.js";
|
|
6
|
+
import "./chunk-OVMQFFC2.js";
|
|
7
|
+
import "./chunk-TMMUBSKW.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/te-audience/shared.ts
|
|
10
10
|
function createMcpCommand(config) {
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
callMcpTool,
|
|
3
3
|
parseMcpResult,
|
|
4
4
|
resolveMcpUrl
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-5CCFSPAF.js";
|
|
6
|
+
import "./chunk-OVMQFFC2.js";
|
|
7
|
+
import "./chunk-TMMUBSKW.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/te-common/shared.ts
|
|
10
10
|
function createMcpCommand(config) {
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
parseMcpResult,
|
|
4
4
|
registerMcpMappings,
|
|
5
5
|
resolveMcpUrl
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-5CCFSPAF.js";
|
|
7
|
+
import "./chunk-OVMQFFC2.js";
|
|
8
|
+
import "./chunk-TMMUBSKW.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/te-community/get_channel_info.ts
|
|
11
11
|
var getChannelInfo = {
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
parseMcpResult,
|
|
4
4
|
registerMcpMappings,
|
|
5
5
|
resolveMcpUrl
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-5CCFSPAF.js";
|
|
7
|
+
import "./chunk-OVMQFFC2.js";
|
|
8
|
+
import "./chunk-TMMUBSKW.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/te-dataops/datatable/list-tables-by-page.ts
|
|
11
11
|
var listTablesByPage = {
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
parseMcpResult,
|
|
4
4
|
registerMcpMappings,
|
|
5
5
|
resolveMcpUrl
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-5CCFSPAF.js";
|
|
7
|
+
import "./chunk-OVMQFFC2.js";
|
|
8
|
+
import "./chunk-TMMUBSKW.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/te-engage/utils.ts
|
|
11
11
|
function buildMcpDryRun(ctx, serviceName44, toolName44, args) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/commands/te-kb/query.ts
|
|
2
|
+
var API_PATH = "/api/external/knowledge-bases/query";
|
|
3
|
+
function buildBody(ctx) {
|
|
4
|
+
const body = {
|
|
5
|
+
query: ctx.str("query"),
|
|
6
|
+
sources: ctx.json("sources")
|
|
7
|
+
};
|
|
8
|
+
const modelId = ctx.str("model-id");
|
|
9
|
+
if (modelId) body.modelId = modelId;
|
|
10
|
+
const maxTurnsRaw = ctx.str("max-turns");
|
|
11
|
+
if (maxTurnsRaw !== "") body.maxTurns = ctx.num("max-turns");
|
|
12
|
+
return body;
|
|
13
|
+
}
|
|
14
|
+
var query = {
|
|
15
|
+
service: "kb",
|
|
16
|
+
command: "+query",
|
|
17
|
+
description: "Query knowledge bases via /api/external/knowledge-bases/query.",
|
|
18
|
+
flags: [
|
|
19
|
+
{ name: "query", type: "string", required: true, alias: "q", desc: "Natural language question to query against the knowledge bases" },
|
|
20
|
+
{ name: "sources", type: "json", required: true, desc: 'JSON array of knowledge base refs, e.g. [{"scope":"company","name":"engineering-handbook"}]' },
|
|
21
|
+
{ name: "model-id", type: "string", required: false, default: "AE-Auto", desc: "Model identifier (default: AE-Auto)" },
|
|
22
|
+
{ name: "max-turns", type: "number", required: false, default: 6, desc: "Maximum reasoning turns (default: 6)" }
|
|
23
|
+
],
|
|
24
|
+
risk: "read",
|
|
25
|
+
dryRun: (ctx) => ({
|
|
26
|
+
method: "POST",
|
|
27
|
+
url: `${ctx.host().replace(/\/$/, "")}${API_PATH}`,
|
|
28
|
+
body: buildBody(ctx)
|
|
29
|
+
}),
|
|
30
|
+
execute: async (ctx) => ctx.api("POST", API_PATH, {}, buildBody(ctx))
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/commands/te-kb/index.ts
|
|
34
|
+
var commands = [
|
|
35
|
+
query
|
|
36
|
+
];
|
|
37
|
+
var te_kb_default = commands;
|
|
38
|
+
export {
|
|
39
|
+
te_kb_default as default,
|
|
40
|
+
query
|
|
41
|
+
};
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
callMcpTool,
|
|
3
3
|
parseMcpResult,
|
|
4
4
|
resolveMcpUrl
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-5CCFSPAF.js";
|
|
6
|
+
import "./chunk-OVMQFFC2.js";
|
|
7
|
+
import "./chunk-TMMUBSKW.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/te-meta/shared.ts
|
|
10
10
|
function createMcpCommand(config) {
|
|
@@ -58,7 +58,7 @@ function requiredJsonString(ctx, name) {
|
|
|
58
58
|
// src/commands/te-meta/meta/list-events.ts
|
|
59
59
|
var listEvents = createMcpCommand({
|
|
60
60
|
command: "+list_events",
|
|
61
|
-
description: "List events in the project. Query performs fuzzy matching on eventName, eventDesc and aiRemark. Supports fields/limit/offset payload governance.",
|
|
61
|
+
description: "List events in the project. Use for explicit metadata inspection, not as a pre-step for event/retention/funnel/prop_analysis ad-hoc builders; the builders resolve event names internally. Query performs fuzzy matching on eventName, eventDesc and aiRemark. Supports fields/limit/offset payload governance.",
|
|
62
62
|
flags: [
|
|
63
63
|
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
64
64
|
{ name: "query", type: "string", required: false, desc: "Optional keyword filter. Fuzzy match is applied to eventName, eventDesc, and aiRemark; if omitted, all events are returned.", alias: "q" },
|
|
@@ -79,7 +79,7 @@ var listEvents = createMcpCommand({
|
|
|
79
79
|
// src/commands/te-meta/meta/list-properties.ts
|
|
80
80
|
var listProperties = createMcpCommand({
|
|
81
81
|
command: "+list_properties",
|
|
82
|
-
description: "List properties in the project. Query performs fuzzy matching on propName, propDesc and aiRemark. Supports fields/limit/offset payload governance.",
|
|
82
|
+
description: "List properties in the project. Use for explicit metadata inspection, not as a pre-step for event/retention/funnel/prop_analysis ad-hoc builders; the builders resolve property names internally. Query performs fuzzy matching on propName, propDesc and aiRemark. Supports fields/limit/offset payload governance.",
|
|
83
83
|
flags: [
|
|
84
84
|
{ name: "project_id", type: "number", required: true, desc: "Project ID", alias: "p" },
|
|
85
85
|
{ name: "scope", type: "string", required: false, desc: "Property scope: event or user" },
|
|
@@ -198,7 +198,7 @@ var createVirtualProperty = createMcpCommand({
|
|
|
198
198
|
// src/commands/te-meta/meta/list-metrics.ts
|
|
199
199
|
var listMetrics = createMcpCommand({
|
|
200
200
|
command: "+list_metrics",
|
|
201
|
-
description: "List metric metadata in the project. Query performs fuzzy matching on metricName, metricDesc, and metricRemark. Supports fields/limit/offset pagination.",
|
|
201
|
+
description: "List metric metadata in the project. Use for metric metadata inspection/management, not as a pre-step for event/retention/funnel/prop_analysis ad-hoc builders. For event saved metric queries, pass the metric name directly to +build_event_analysis_qp in metrics[].event. Query performs fuzzy matching on metricName, metricDesc, and metricRemark. Supports fields/limit/offset pagination.",
|
|
202
202
|
flags: [
|
|
203
203
|
{ name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
|
|
204
204
|
{ name: "query", type: "string", required: false, alias: "q", desc: "Optional keyword filter. Fuzzy match on metricName, metricDesc, metricRemark." },
|
|
@@ -220,7 +220,7 @@ var listMetrics = createMcpCommand({
|
|
|
220
220
|
// src/commands/te-meta/meta/get-metric.ts
|
|
221
221
|
var getMetric = createMcpCommand({
|
|
222
222
|
command: "+get_metric",
|
|
223
|
-
description: "Get the definition details of a single metric",
|
|
223
|
+
description: "Get the definition details of a single metric. Use for metric metadata inspection/management, not as a pre-step for event ad-hoc builder; pass saved metric names directly to +build_event_analysis_qp in metrics[].event.",
|
|
224
224
|
flags: [
|
|
225
225
|
{ name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
|
|
226
226
|
{ name: "metric_id", type: "number", required: true, alias: "m", desc: "Metric ID" }
|
|
@@ -380,12 +380,14 @@ var generateTrackProgram = createMcpCommand({
|
|
|
380
380
|
description: "Generate a tracking plan from structured business context (async)",
|
|
381
381
|
flags: [
|
|
382
382
|
{ name: "project_id", type: "number", required: true, alias: "p", desc: "Project ID" },
|
|
383
|
-
{ name: "
|
|
383
|
+
{ name: "language", type: "string", required: true, alias: "l", desc: "Language code (zh-CN, en-US, ja-JP, ko-KR)" },
|
|
384
|
+
{ name: "form_data", type: "json", required: true, desc: "Structured business context JSON object, optional fields for example: account_system, revenue_model, core_gameplay, currency_system, main_entries, predefinedEvent, developmentCarrier" }
|
|
384
385
|
],
|
|
385
386
|
risk: "write",
|
|
386
387
|
mcpService: "te_analysis_extend",
|
|
387
388
|
buildArgs: (ctx) => ({
|
|
388
389
|
projectId: ctx.num("project_id"),
|
|
390
|
+
language: ctx.str("language"),
|
|
389
391
|
formData: ctx.json("form_data")
|
|
390
392
|
})
|
|
391
393
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thinkingai/ae-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "CLI tool for ThinkingAI (AE) analytics platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"dev": "tsx src/index.ts",
|
|
18
18
|
"build": "tsup src/index.ts --format esm --outDir dist",
|
|
19
19
|
"verify:analysis-tools": "node scripts/verify-te-analysis-tools.mjs",
|
|
20
|
+
"verify:analysis-builder-dry-run": "node scripts/verify-te-analysis-builder-dry-run.mjs",
|
|
20
21
|
"verify:analysis-audience-tools": "node scripts/verify-te-audience-tools.mjs",
|
|
21
22
|
"verify:analysis-meta-tools": "node scripts/verify-te-meta-tools.mjs",
|
|
22
23
|
"verify:analysis-common-tools": "node scripts/verify-te-common-tools.mjs",
|