@thinkingai/ae-cli 6.1.6 → 6.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auth-UPGUOKTW.js → auth-B2BRSYMS.js} +1 -1
- package/dist/{capability-TQ5KU5Q6.js → capability-6KPXYNO7.js} +1 -1
- package/dist/{capability-AJC5CBRT.js → capability-ROKYESAP.js} +1 -1
- package/dist/{chunk-6CHYBI64.js → chunk-EBPXT3TN.js} +1 -1
- package/dist/{chunk-4Q5TNP4Q.js → chunk-J7MZHDHQ.js} +48 -24
- package/dist/{chunk-IMMGMU54.js → chunk-JTKMDN4A.js} +64 -166
- package/dist/{chunk-ISY6HMHM.js → chunk-RRFK2W7I.js} +1 -1
- package/dist/{config-RCCGHHYA.js → config-DDYJPJX3.js} +4 -4
- package/dist/index.js +63 -28
- package/dist/{metadata-3M5F2AED.js → metadata-2ZFRMVOL.js} +2 -55
- package/dist/{metadata-W2MEOI4Z.js → metadata-ABQCKU5P.js} +2 -55
- package/dist/{model-OYQLXCQY.js → model-JASQVOFD.js} +1 -1
- package/dist/{raw-TPB7KSZO.js → raw-6HXFFHLV.js} +1 -1
- package/dist/{sync-EFJKFZK2.js → sync-BF3IWYFC.js} +2 -2
- package/dist/{te-agent-K2OWMZXT.js → te-agent-3GJ5H2XF.js} +195 -2
- package/dist/{te-analysis-I73ZS4NK.js → te-analysis-DJ6KELTU.js} +636 -668
- package/dist/{te-analysis-Q7AZCDU4.js → te-analysis-PCGESPLW.js} +636 -668
- package/dist/{te-dataops-OA7I6HBG.js → te-dataops-LXL5YULV.js} +7 -7
- package/dist/{te-dataops-MJV54MNY.js → te-dataops-ROHUJOX5.js} +7 -7
- package/dist/{te-engage-2FSDUOIZ.js → te-engage-2YDCA552.js} +87 -4
- package/dist/{te-engage-BMJ6UOUU.js → te-engage-VW6NJZ5V.js} +87 -4
- package/dist/{te-experiment-4JC7WUKW.js → te-experiment-7JGJNDXO.js} +2 -2
- package/dist/{te-experiment-KYRWAUZY.js → te-experiment-OYK54B72.js} +2 -2
- package/dist/te-meta-GBDTMPEL.js +95 -0
- package/dist/te-meta-ZTLTSHXC.js +95 -0
- package/dist/te-system-AH7DMCAQ.js +1706 -0
- package/dist/{te-team-PDKKW7Q5.js → te-team-RRZI4WRI.js} +1 -1
- package/dist/update-ER7VFU55.js +101 -0
- package/package.json +9 -4
- package/skills/ae-agent/SKILL.md +5 -1
- package/skills/ae-agent/references/create-automation.md +1 -0
- package/skills/ae-agent/references/list-sandbox-tools.md +79 -0
- package/skills/ae-analysis/SKILL.md +8 -9
- package/skills/ae-analysis/references/adhoc_export.md +8 -0
- package/skills/ae-analysis/references/adhoc_run.md +9 -0
- package/skills/ae-analysis/references/ai_models.md +3 -1
- package/skills/ae-analysis/references/alert_create.md +2 -3
- package/skills/ae-analysis/references/alert_update.md +2 -3
- package/skills/ae-analysis/references/analysis_data_retrieval.md +2 -0
- package/skills/ae-analysis/references/analysis_drilldown_contract.md +2 -0
- package/skills/ae-analysis/references/analysis_gateway_assets.md +15 -11
- package/skills/ae-analysis/references/bi_panel_create.md +12 -4
- package/skills/ae-analysis/references/bi_panel_update.md +11 -8
- package/skills/ae-analysis/references/bi_panel_version_publish.md +3 -1
- package/skills/ae-analysis/references/command_index.md +28 -47
- package/skills/ae-analysis/references/dashboard_daily_report_get.md +18 -0
- package/skills/ae-analysis/references/dashboard_daily_report_send.md +12 -9
- package/skills/ae-analysis/references/dashboard_daily_report_send_status.md +22 -0
- package/skills/ae-analysis/references/dashboard_daily_report_update.md +13 -6
- package/skills/ae-analysis/references/dashboard_report_data_export.md +4 -2
- package/skills/ae-analysis/references/dashboard_report_data_run.md +5 -3
- package/skills/ae-analysis/references/drilldown_entities_export.md +3 -0
- package/skills/ae-analysis/references/drilldown_entities_run.md +2 -1
- package/skills/ae-analysis/references/drilldown_events_export.md +3 -0
- package/skills/ae-analysis/references/drilldown_events_run.md +2 -1
- package/skills/ae-analysis/references/drilldown_user_events_export.md +8 -0
- package/skills/ae-analysis/references/drilldown_user_events_run.md +8 -0
- package/skills/ae-analysis/references/entity_id_import_options.md +1 -1
- package/skills/ae-analysis/references/filter_value_list.md +47 -0
- package/skills/ae-analysis/references/project_space_get.md +3 -3
- package/skills/ae-analysis/references/project_space_list.md +6 -2
- package/skills/ae-analysis/references/query_cancel.md +3 -1
- package/skills/ae-analysis/references/query_cluster_list.md +34 -0
- package/skills/ae-analysis/references/query_create_result_cluster.md +2 -0
- package/skills/ae-analysis/references/report_create.md +5 -1
- package/skills/ae-analysis/references/report_data_export.md +9 -2
- package/skills/ae-analysis/references/report_data_run.md +8 -3
- package/skills/ae-analysis/references/report_get.md +3 -1
- package/skills/ae-analysis/references/report_update.md +4 -0
- package/skills/ae-analysis/references/super_metadata_batch_create.md +29 -0
- package/skills/ae-analysis/references/super_metadata_batch_edit.md +24 -0
- package/skills/ae-analysis/references/virtual_event_create.md +7 -6
- package/skills/ae-analysis-global/SKILL.md +15 -32
- package/skills/ae-community/SKILL.md +1 -1
- package/skills/ae-data-integration-helper/SKILL.md +3 -2
- package/skills/ae-data-integration-helper/references/sdk_usage_notes.md +1 -1
- package/skills/ae-dataops/SKILL.md +2 -1
- package/skills/ae-dataops/references/dataops-integration.md +75 -6
- package/skills/ae-engage/SKILL.md +32 -5
- package/skills/ae-engage/references/activity-topic.md +34 -1
- package/skills/ae-engage/references/add-channel.md +2 -3
- package/skills/ae-engage/references/build-task-save-guide.md +17 -3
- package/skills/ae-engage/references/channel-detail.md +2 -3
- package/skills/ae-engage/references/channel-list.md +2 -5
- package/skills/ae-engage/references/channel-mgmt.md +17 -2
- package/skills/ae-engage/references/channel-test-send.md +1 -1
- package/skills/ae-engage/references/channel-update-config.md +1 -1
- package/skills/ae-engage/references/delete-channel.md +2 -3
- package/skills/ae-engage/references/save-flow.md +6 -3
- package/skills/ae-engage/references/save-task.md +12 -15
- package/skills/ae-engage/references/scene-config-channel.md +28 -4
- package/skills/ae-engage/references/scene-config-group.md +1 -1
- package/skills/ae-engage/references/scene-config-item.md +1 -1
- package/skills/ae-engage/references/scene-config-metric.md +1 -1
- package/skills/ae-engage/references/scene-config-param.md +1 -1
- package/skills/ae-engage/references/scene-preset-metric.md +1 -1
- package/skills/ae-engage/references/scene-strategy-audience.md +680 -0
- package/skills/ae-engage/references/scene-strategy.md +16 -1
- package/skills/ae-engage/references/scene-template.md +1 -1
- package/skills/ae-engage/references/update-channel-status.md +2 -3
- package/skills/ae-generate-tracking-code/SKILL.md +4 -3
- package/skills/ae-generate-tracking-code/references/client-sdk-insert.md +1 -1
- package/skills/ae-generate-tracking-code/references/server-sdk-insert.md +1 -1
- package/skills/ae-generate-tracking-code/references/snippet-delivery.md +1 -1
- package/skills/ae-generate-tracking-plan/SKILL.md +6 -2
- package/skills/ae-metadata/SKILL.md +8 -15
- package/skills/ae-metadata/references/metadata_property_dimension_table_bind_existing.md +1 -1
- package/skills/ae-system/SKILL.md +357 -0
- package/dist/te-common-ST3QPSXJ.js +0 -61
- package/dist/te-common-WSLIKKPC.js +0 -61
- package/dist/te-meta-Q4L6EE3Q.js +0 -363
- package/dist/te-meta-VHCN4Q62.js +0 -363
- package/skills/ae-analysis/references/alert_definition_schema_get.md +0 -24
- package/skills/ae-analysis/references/batch_create_metadata.md +0 -41
- package/skills/ae-analysis/references/batch_edit_metadata.md +0 -39
- package/skills/ae-analysis/references/cancel_query.md +0 -38
- package/skills/ae-analysis/references/create_alert.md +0 -47
- package/skills/ae-analysis/references/create_entity.md +0 -39
- package/skills/ae-analysis/references/create_project_mark_time.md +0 -39
- package/skills/ae-analysis/references/delete_alert.md +0 -32
- package/skills/ae-analysis/references/delete_project_mark_times.md +0 -36
- package/skills/ae-analysis/references/delete_track_items.md +0 -36
- package/skills/ae-analysis/references/generate_track_program.md +0 -52
- package/skills/ae-analysis/references/generate_track_sdk_sample.md +0 -44
- package/skills/ae-analysis/references/get_alert.md +0 -35
- package/skills/ae-analysis/references/get_alert_definition_schema.md +0 -33
- package/skills/ae-analysis/references/get_project_config.md +0 -33
- package/skills/ae-analysis/references/get_track_program.md +0 -34
- package/skills/ae-analysis/references/list_alerts.md +0 -41
- package/skills/ae-analysis/references/list_entities.md +0 -42
- package/skills/ae-analysis/references/list_project_mark_times.md +0 -43
- package/skills/ae-analysis/references/list_project_users.md +0 -33
- package/skills/ae-analysis/references/list_projects.md +0 -39
- package/skills/ae-analysis/references/load_filters.md +0 -47
- package/skills/ae-analysis/references/save_track_items.md +0 -37
- package/skills/ae-analysis/references/update_alert.md +0 -49
- package/skills/ae-analysis/references/update_project_mark_time.md +0 -40
- package/skills/ae-analysis-global/references/list_query_clusters.md +0 -68
- package/skills/ae-metadata/references/metadata_event_get.md +0 -52
- package/skills/ae-metadata/references/metadata_property_get.md +0 -54
- package/dist/{te-community-WXGB6IOX.js → te-community-QOYIYEJI.js} +3 -3
- package/dist/{te-community-X2AHXGCA.js → te-community-UFKI6ONP.js} +3 -3
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
TeAgentApiError,
|
|
9
9
|
TeAgentCredentialsError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-J7MZHDHQ.js";
|
|
11
11
|
import {
|
|
12
12
|
CapabilityGatewayError,
|
|
13
13
|
executeCapability,
|
|
@@ -15,11 +15,10 @@ import {
|
|
|
15
15
|
} from "./chunk-HQ2A7ITL.js";
|
|
16
16
|
import {
|
|
17
17
|
formatCapabilityMissCompatHint,
|
|
18
|
-
notifyIfUpdateAvailable,
|
|
19
18
|
printError,
|
|
20
19
|
printOutput,
|
|
21
20
|
runHostCompatCheck
|
|
22
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JTKMDN4A.js";
|
|
23
22
|
import {
|
|
24
23
|
clearCliToken,
|
|
25
24
|
getCliToken
|
|
@@ -1689,6 +1688,7 @@ var AUTOTRACK_I18N = {
|
|
|
1689
1688
|
desc: { zh: "\u6E38\u620F\u573A\u666F\uFF08Scene\uFF09\u5378\u8F7D\u65F6\u89E6\u53D1", en: "Triggered when a game scene is unloaded", ja: "\u30B2\u30FC\u30E0\u30B7\u30FC\u30F3\uFF08Scene\uFF09\u306E\u30A2\u30F3\u30ED\u30FC\u30C9\u6642\u306B\u767A\u751F", ko: "\uAC8C\uC784 \uC52C(Scene)\uC774 \uC5B8\uB85C\uB4DC\uB420 \uB54C \uBC1C\uC0DD\uD569\uB2C8\uB2E4" }
|
|
1690
1689
|
}
|
|
1691
1690
|
};
|
|
1691
|
+
var ALL_AUTOTRACK_EVENT_NAMES = new Set(Object.keys(AUTOTRACK_I18N));
|
|
1692
1692
|
function makeAutotrackEvent(eventName, locale) {
|
|
1693
1693
|
const i18n = AUTOTRACK_I18N[eventName];
|
|
1694
1694
|
return {
|
|
@@ -1775,6 +1775,13 @@ function injectAutotrackEvents(draft, locale = "zh") {
|
|
|
1775
1775
|
} else {
|
|
1776
1776
|
autotrackEvents = getAutotrackEvents(sdkTypeOrPlatforms, locale);
|
|
1777
1777
|
}
|
|
1778
|
+
const validNames = new Set(autotrackEvents.map((e) => e.event_name));
|
|
1779
|
+
draft.events = draft.events.filter((e) => {
|
|
1780
|
+
if (ALL_AUTOTRACK_EVENT_NAMES.has(e.event_name)) {
|
|
1781
|
+
return validNames.has(e.event_name);
|
|
1782
|
+
}
|
|
1783
|
+
return true;
|
|
1784
|
+
});
|
|
1778
1785
|
const existingNames = new Set(draft.events.map((e) => e.event_name));
|
|
1779
1786
|
const newEvents = autotrackEvents.filter((e) => !existingNames.has(e.event_name));
|
|
1780
1787
|
const eventsWithPlatform = newEvents.map((e) => ({
|
|
@@ -3359,6 +3366,11 @@ function getOrCreateCommand(parent, name, description) {
|
|
|
3359
3366
|
return parent.command(name).description(description);
|
|
3360
3367
|
}
|
|
3361
3368
|
|
|
3369
|
+
// src/framework/program-lifecycle.ts
|
|
3370
|
+
async function parseProgram(program2, argv = process.argv) {
|
|
3371
|
+
await program2.parseAsync(argv);
|
|
3372
|
+
}
|
|
3373
|
+
|
|
3362
3374
|
// src/index.ts
|
|
3363
3375
|
var require2 = createRequire(import.meta.url);
|
|
3364
3376
|
var pkg = require2("../package.json");
|
|
@@ -3372,41 +3384,36 @@ program.name("ae-cli").version(version).description("CLI tool for ThinkingAI (AE
|
|
|
3372
3384
|
"--dry-run",
|
|
3373
3385
|
"Optional: pre-execution preview without business logic (gateway /dry-run; other transports preview). Use alone to confirm a run; do not stack with --validate",
|
|
3374
3386
|
false
|
|
3375
|
-
).option("--yes", "Skip confirmation for high-risk write operations", false).option("--no-update-check", "Skip
|
|
3387
|
+
).option("--yes", "Skip confirmation for high-risk write operations", false).option("--no-update-check", "Skip host compatibility checks", false);
|
|
3376
3388
|
async function loadCommands() {
|
|
3377
3389
|
const commands = [];
|
|
3378
3390
|
try {
|
|
3379
|
-
const teAnalysis = await import("./te-analysis-
|
|
3391
|
+
const teAnalysis = await import("./te-analysis-PCGESPLW.js");
|
|
3380
3392
|
commands.push(...teAnalysis.default);
|
|
3381
3393
|
} catch {
|
|
3382
3394
|
}
|
|
3383
3395
|
try {
|
|
3384
|
-
const teMeta = await import("./te-meta-
|
|
3396
|
+
const teMeta = await import("./te-meta-ZTLTSHXC.js");
|
|
3385
3397
|
commands.push(...teMeta.default);
|
|
3386
3398
|
} catch {
|
|
3387
3399
|
}
|
|
3388
3400
|
try {
|
|
3389
|
-
const
|
|
3390
|
-
commands.push(...teCommon.default);
|
|
3391
|
-
} catch {
|
|
3392
|
-
}
|
|
3393
|
-
try {
|
|
3394
|
-
const engage = await import("./te-engage-BMJ6UOUU.js");
|
|
3401
|
+
const engage = await import("./te-engage-VW6NJZ5V.js");
|
|
3395
3402
|
commands.push(...engage.default);
|
|
3396
3403
|
} catch {
|
|
3397
3404
|
}
|
|
3398
3405
|
try {
|
|
3399
|
-
const experiment = await import("./te-experiment-
|
|
3406
|
+
const experiment = await import("./te-experiment-7JGJNDXO.js");
|
|
3400
3407
|
commands.push(...experiment.default);
|
|
3401
3408
|
} catch {
|
|
3402
3409
|
}
|
|
3403
3410
|
try {
|
|
3404
|
-
const community = await import("./te-community-
|
|
3411
|
+
const community = await import("./te-community-UFKI6ONP.js");
|
|
3405
3412
|
commands.push(...community.default);
|
|
3406
3413
|
} catch {
|
|
3407
3414
|
}
|
|
3408
3415
|
try {
|
|
3409
|
-
const dataops = await import("./te-dataops-
|
|
3416
|
+
const dataops = await import("./te-dataops-LXL5YULV.js");
|
|
3410
3417
|
commands.push(...dataops.default);
|
|
3411
3418
|
} catch {
|
|
3412
3419
|
}
|
|
@@ -3416,17 +3423,22 @@ async function loadCommands() {
|
|
|
3416
3423
|
} catch {
|
|
3417
3424
|
}
|
|
3418
3425
|
try {
|
|
3419
|
-
const teTeam = await import("./te-team-
|
|
3426
|
+
const teTeam = await import("./te-team-RRZI4WRI.js");
|
|
3420
3427
|
commands.push(...teTeam.default);
|
|
3421
3428
|
} catch {
|
|
3422
3429
|
}
|
|
3423
3430
|
try {
|
|
3424
|
-
const teAgent = await import("./te-agent-
|
|
3431
|
+
const teAgent = await import("./te-agent-3GJ5H2XF.js");
|
|
3425
3432
|
commands.push(...teAgent.default);
|
|
3426
3433
|
} catch {
|
|
3427
3434
|
}
|
|
3428
3435
|
try {
|
|
3429
|
-
const
|
|
3436
|
+
const teSystem = await import("./te-system-AH7DMCAQ.js");
|
|
3437
|
+
commands.push(...teSystem.default);
|
|
3438
|
+
} catch {
|
|
3439
|
+
}
|
|
3440
|
+
try {
|
|
3441
|
+
const metadata = await import("./metadata-2ZFRMVOL.js");
|
|
3430
3442
|
commands.push(...metadata.default);
|
|
3431
3443
|
} catch {
|
|
3432
3444
|
}
|
|
@@ -3434,50 +3446,58 @@ async function loadCommands() {
|
|
|
3434
3446
|
}
|
|
3435
3447
|
async function registerAuthCommands() {
|
|
3436
3448
|
try {
|
|
3437
|
-
const { registerAuth } = await import("./auth-
|
|
3449
|
+
const { registerAuth } = await import("./auth-B2BRSYMS.js");
|
|
3438
3450
|
registerAuth(program);
|
|
3439
3451
|
} catch {
|
|
3440
3452
|
}
|
|
3441
3453
|
}
|
|
3442
3454
|
async function registerConfigCommands() {
|
|
3443
3455
|
try {
|
|
3444
|
-
const { registerConfig } = await import("./config-
|
|
3456
|
+
const { registerConfig } = await import("./config-DDYJPJX3.js");
|
|
3445
3457
|
registerConfig(program);
|
|
3446
3458
|
} catch {
|
|
3447
3459
|
}
|
|
3448
3460
|
}
|
|
3449
3461
|
async function registerApiCommand() {
|
|
3450
3462
|
try {
|
|
3451
|
-
const { registerApi } = await import("./raw-
|
|
3463
|
+
const { registerApi } = await import("./raw-6HXFFHLV.js");
|
|
3452
3464
|
registerApi(program);
|
|
3453
3465
|
} catch {
|
|
3454
3466
|
}
|
|
3455
3467
|
}
|
|
3456
3468
|
async function registerCapabilityCommands() {
|
|
3457
3469
|
try {
|
|
3458
|
-
const { registerCapability } = await import("./capability-
|
|
3470
|
+
const { registerCapability } = await import("./capability-ROKYESAP.js");
|
|
3459
3471
|
registerCapability(program);
|
|
3460
3472
|
} catch {
|
|
3461
3473
|
}
|
|
3462
3474
|
}
|
|
3463
3475
|
async function registerSyncCommand() {
|
|
3464
3476
|
try {
|
|
3465
|
-
const { registerSync } = await import("./sync-
|
|
3477
|
+
const { registerSync } = await import("./sync-BF3IWYFC.js");
|
|
3466
3478
|
registerSync(program);
|
|
3467
3479
|
} catch {
|
|
3468
3480
|
}
|
|
3469
3481
|
}
|
|
3470
3482
|
async function registerModelCommand() {
|
|
3471
3483
|
try {
|
|
3472
|
-
const { registerModel } = await import("./model-
|
|
3484
|
+
const { registerModel } = await import("./model-JASQVOFD.js");
|
|
3473
3485
|
registerModel(program);
|
|
3474
3486
|
} catch {
|
|
3475
3487
|
}
|
|
3476
3488
|
}
|
|
3489
|
+
async function registerUpdateCommand() {
|
|
3490
|
+
try {
|
|
3491
|
+
const { registerUpdate } = await import("./update-ER7VFU55.js");
|
|
3492
|
+
registerUpdate(program);
|
|
3493
|
+
} catch {
|
|
3494
|
+
}
|
|
3495
|
+
}
|
|
3477
3496
|
async function main() {
|
|
3478
3497
|
const pkgInfo = getLocalCliPackageInfo();
|
|
3479
|
-
|
|
3480
|
-
|
|
3498
|
+
if (!isRootUpdateCommand(process.argv.slice(2))) {
|
|
3499
|
+
await runHostCompatCheck(pkgInfo);
|
|
3500
|
+
}
|
|
3481
3501
|
const commands = await loadCommands();
|
|
3482
3502
|
registerCommands(program, commands);
|
|
3483
3503
|
await registerAuthCommands();
|
|
@@ -3486,11 +3506,12 @@ async function main() {
|
|
|
3486
3506
|
await registerCapabilityCommands();
|
|
3487
3507
|
await registerSyncCommand();
|
|
3488
3508
|
await registerModelCommand();
|
|
3509
|
+
await registerUpdateCommand();
|
|
3489
3510
|
registerTracking(program);
|
|
3490
3511
|
rejectUnknownHelpCommandPath(program, process.argv.slice(2));
|
|
3491
|
-
program
|
|
3512
|
+
await parseProgram(program);
|
|
3492
3513
|
}
|
|
3493
|
-
main();
|
|
3514
|
+
await main();
|
|
3494
3515
|
function rejectUnknownHelpCommandPath(root, args) {
|
|
3495
3516
|
if (!args.includes("--help") && !args.includes("-h")) {
|
|
3496
3517
|
return;
|
|
@@ -3525,3 +3546,17 @@ function optionConsumesValue(token) {
|
|
|
3525
3546
|
}
|
|
3526
3547
|
return token === "--host" || token === "--mcp-url" || token === "--format" || token === "--jq";
|
|
3527
3548
|
}
|
|
3549
|
+
function isRootUpdateCommand(args) {
|
|
3550
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
3551
|
+
const token = args[i];
|
|
3552
|
+
if (token === "--") return false;
|
|
3553
|
+
if (token.startsWith("-")) {
|
|
3554
|
+
if (optionConsumesValue(token)) {
|
|
3555
|
+
i += 1;
|
|
3556
|
+
}
|
|
3557
|
+
continue;
|
|
3558
|
+
}
|
|
3559
|
+
return token === "update";
|
|
3560
|
+
}
|
|
3561
|
+
return false;
|
|
3562
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCapabilityCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RRFK2W7I.js";
|
|
4
4
|
import {
|
|
5
5
|
registerCapabilityGatewayRoute
|
|
6
6
|
} from "./chunk-PTE56QPL.js";
|
|
7
7
|
import "./chunk-HQ2A7ITL.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-JTKMDN4A.js";
|
|
9
9
|
import "./chunk-E7UXXHO3.js";
|
|
10
10
|
import "./chunk-IR4ZLVPW.js";
|
|
11
11
|
import "./chunk-V6FR6WTW.js";
|
|
@@ -72,57 +72,6 @@ function normalizeDataTableColumns(value, kind) {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
// src/commands/metadata/event/get.ts
|
|
76
|
-
var eventGet = createCapabilityCommand2({
|
|
77
|
-
resource: "event",
|
|
78
|
-
command: "get",
|
|
79
|
-
capabilityId: "metadata.event.get",
|
|
80
|
-
description: "Get one super-event metadata detail, including virtual event definitions. Requires metadata view permission in the target project.",
|
|
81
|
-
flags: [
|
|
82
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
83
|
-
{
|
|
84
|
-
name: "event-name",
|
|
85
|
-
type: "string",
|
|
86
|
-
required: true,
|
|
87
|
-
desc: "Super-event technical name. Virtual events use the same field."
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
risk: "read",
|
|
91
|
-
buildInput: (ctx) => ({
|
|
92
|
-
project_id: ctx.num("project-id"),
|
|
93
|
-
event_name: ctx.str("event-name")
|
|
94
|
-
})
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
// src/commands/metadata/property/get.ts
|
|
98
|
-
var propertyGet = createCapabilityCommand2({
|
|
99
|
-
resource: "property",
|
|
100
|
-
command: "get",
|
|
101
|
-
capabilityId: "metadata.property.get",
|
|
102
|
-
description: "Get one super-property metadata detail, including virtual property definitions. Requires metadata view permission in the target project.",
|
|
103
|
-
flags: [
|
|
104
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
105
|
-
{
|
|
106
|
-
name: "prop-name",
|
|
107
|
-
type: "string",
|
|
108
|
-
required: true,
|
|
109
|
-
desc: "Property column name."
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: "table-type",
|
|
113
|
-
type: "string",
|
|
114
|
-
required: true,
|
|
115
|
-
desc: "Property table type: event or user."
|
|
116
|
-
}
|
|
117
|
-
],
|
|
118
|
-
risk: "read",
|
|
119
|
-
buildInput: (ctx) => ({
|
|
120
|
-
project_id: ctx.num("project-id"),
|
|
121
|
-
table_type: ctx.str("table-type"),
|
|
122
|
-
prop_name: ctx.str("prop-name")
|
|
123
|
-
})
|
|
124
|
-
});
|
|
125
|
-
|
|
126
75
|
// src/commands/metadata/data-table/csv-delete.ts
|
|
127
76
|
var dataTableCsvDelete = createCapabilityCommand2({
|
|
128
77
|
resource: "data-table",
|
|
@@ -359,8 +308,6 @@ var propertyDimensionTableCreateAndBindCsv = createCapabilityCommand2({
|
|
|
359
308
|
// src/commands/metadata/index.ts
|
|
360
309
|
registerCapabilityGatewayRoute("metadata", { gatewayDomain: "analysis" });
|
|
361
310
|
var commands = [
|
|
362
|
-
eventGet,
|
|
363
|
-
propertyGet,
|
|
364
311
|
dataTableList,
|
|
365
312
|
dataTableGet,
|
|
366
313
|
dataTableCsvWrite,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCapabilityCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EBPXT3TN.js";
|
|
4
4
|
import {
|
|
5
5
|
registerCapabilityGatewayRoute
|
|
6
6
|
} from "./chunk-PTE56QPL.js";
|
|
7
7
|
import "./chunk-RGXCNC4N.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-JTKMDN4A.js";
|
|
9
9
|
import "./chunk-E7UXXHO3.js";
|
|
10
10
|
import "./chunk-IR4ZLVPW.js";
|
|
11
11
|
import "./chunk-V6FR6WTW.js";
|
|
@@ -72,57 +72,6 @@ function normalizeDataTableColumns(value, kind) {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
// src/commands/metadata/event/get.ts
|
|
76
|
-
var eventGet = createCapabilityCommand2({
|
|
77
|
-
resource: "event",
|
|
78
|
-
command: "get",
|
|
79
|
-
capabilityId: "metadata.event.get",
|
|
80
|
-
description: "Get one super-event metadata detail, including virtual event definitions. Requires metadata view permission in the target project.",
|
|
81
|
-
flags: [
|
|
82
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
83
|
-
{
|
|
84
|
-
name: "event-name",
|
|
85
|
-
type: "string",
|
|
86
|
-
required: true,
|
|
87
|
-
desc: "Super-event technical name. Virtual events use the same field."
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
risk: "read",
|
|
91
|
-
buildInput: (ctx) => ({
|
|
92
|
-
project_id: ctx.num("project-id"),
|
|
93
|
-
event_name: ctx.str("event-name")
|
|
94
|
-
})
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
// src/commands/metadata/property/get.ts
|
|
98
|
-
var propertyGet = createCapabilityCommand2({
|
|
99
|
-
resource: "property",
|
|
100
|
-
command: "get",
|
|
101
|
-
capabilityId: "metadata.property.get",
|
|
102
|
-
description: "Get one super-property metadata detail, including virtual property definitions. Requires metadata view permission in the target project.",
|
|
103
|
-
flags: [
|
|
104
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
105
|
-
{
|
|
106
|
-
name: "prop-name",
|
|
107
|
-
type: "string",
|
|
108
|
-
required: true,
|
|
109
|
-
desc: "Property column name."
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: "table-type",
|
|
113
|
-
type: "string",
|
|
114
|
-
required: true,
|
|
115
|
-
desc: "Property table type: event or user."
|
|
116
|
-
}
|
|
117
|
-
],
|
|
118
|
-
risk: "read",
|
|
119
|
-
buildInput: (ctx) => ({
|
|
120
|
-
project_id: ctx.num("project-id"),
|
|
121
|
-
table_type: ctx.str("table-type"),
|
|
122
|
-
prop_name: ctx.str("prop-name")
|
|
123
|
-
})
|
|
124
|
-
});
|
|
125
|
-
|
|
126
75
|
// src/commands/metadata/data-table/csv-delete.ts
|
|
127
76
|
var dataTableCsvDelete = createCapabilityCommand2({
|
|
128
77
|
resource: "data-table",
|
|
@@ -359,8 +308,6 @@ var propertyDimensionTableCreateAndBindCsv = createCapabilityCommand2({
|
|
|
359
308
|
// src/commands/metadata/index.ts
|
|
360
309
|
registerCapabilityGatewayRoute("metadata", { gatewayDomain: "analysis" });
|
|
361
310
|
var commands = [
|
|
362
|
-
eventGet,
|
|
363
|
-
propertyGet,
|
|
364
311
|
dataTableList,
|
|
365
312
|
dataTableGet,
|
|
366
313
|
dataTableCsvWrite,
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
getSandboxSyncPullCandidates,
|
|
20
20
|
postSandboxSyncPull,
|
|
21
21
|
postToMainApp
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-J7MZHDHQ.js";
|
|
23
23
|
import {
|
|
24
24
|
printError
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-JTKMDN4A.js";
|
|
26
26
|
import "./chunk-E7UXXHO3.js";
|
|
27
27
|
import "./chunk-IR4ZLVPW.js";
|
|
28
28
|
import "./chunk-V6FR6WTW.js";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
postToMainApp,
|
|
7
7
|
putToMainApp,
|
|
8
8
|
uploadToMainApp
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-J7MZHDHQ.js";
|
|
10
10
|
import "./chunk-V6FR6WTW.js";
|
|
11
11
|
import "./chunk-LYVNONC4.js";
|
|
12
12
|
|
|
@@ -2471,6 +2471,197 @@ var updateAutomation = {
|
|
|
2471
2471
|
)
|
|
2472
2472
|
};
|
|
2473
2473
|
|
|
2474
|
+
// src/commands/te-agent/sandbox-tools.ts
|
|
2475
|
+
import {
|
|
2476
|
+
accessSync,
|
|
2477
|
+
closeSync,
|
|
2478
|
+
constants,
|
|
2479
|
+
existsSync as existsSync3,
|
|
2480
|
+
lstatSync,
|
|
2481
|
+
openSync,
|
|
2482
|
+
readSync,
|
|
2483
|
+
readdirSync,
|
|
2484
|
+
realpathSync
|
|
2485
|
+
} from "fs";
|
|
2486
|
+
import { isAbsolute, join, relative, resolve as resolve3 } from "path";
|
|
2487
|
+
var SANDBOX_BIN_DIR = "/home/ta/.local/bin";
|
|
2488
|
+
var SANDBOX_SHARE_ROOT = process.env.SANDBOX_SYSTEM_SHARE_ROOT ?? "/data/app/te_agent_ta/share";
|
|
2489
|
+
var SHIM_MARKER = "managed-by: te-agent-sandbox-tools";
|
|
2490
|
+
var MAX_SHIM_BYTES = 16 * 1024;
|
|
2491
|
+
var NAME_RE = /^[a-z][a-z0-9._-]{0,63}$/;
|
|
2492
|
+
function hasControlCharacters(value) {
|
|
2493
|
+
return /[\x00-\x1f\x7f]/.test(value);
|
|
2494
|
+
}
|
|
2495
|
+
function readShimHeader(filePath, size) {
|
|
2496
|
+
const buffer = Buffer.alloc(Math.min(size, MAX_SHIM_BYTES));
|
|
2497
|
+
const fd = openSync(filePath, "r");
|
|
2498
|
+
try {
|
|
2499
|
+
const bytesRead = readSync(fd, buffer, 0, buffer.length, 0);
|
|
2500
|
+
return buffer.toString("utf8", 0, bytesRead);
|
|
2501
|
+
} finally {
|
|
2502
|
+
closeSync(fd);
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
function parseShim(filePath) {
|
|
2506
|
+
const fallback = {
|
|
2507
|
+
managed: false,
|
|
2508
|
+
tool: "",
|
|
2509
|
+
version: "unknown",
|
|
2510
|
+
command: "",
|
|
2511
|
+
target: ""
|
|
2512
|
+
};
|
|
2513
|
+
try {
|
|
2514
|
+
const stat = lstatSync(filePath);
|
|
2515
|
+
if (!stat.isFile() || stat.isSymbolicLink()) return fallback;
|
|
2516
|
+
const lines = readShimHeader(filePath, stat.size).split("\n").slice(0, 10);
|
|
2517
|
+
const managed = lines.includes(`# ${SHIM_MARKER}`);
|
|
2518
|
+
if (!managed) return fallback;
|
|
2519
|
+
if (stat.size > MAX_SHIM_BYTES) {
|
|
2520
|
+
return { ...fallback, managed: true, reason: "shim exceeds size limit" };
|
|
2521
|
+
}
|
|
2522
|
+
const values = /* @__PURE__ */ new Map();
|
|
2523
|
+
for (const line of lines) {
|
|
2524
|
+
if (line === `# ${SHIM_MARKER}`) continue;
|
|
2525
|
+
const match = /^# (tool|version|command|target|runtime): (.*)$/.exec(
|
|
2526
|
+
line
|
|
2527
|
+
);
|
|
2528
|
+
if (!match) continue;
|
|
2529
|
+
if (values.has(match[1])) {
|
|
2530
|
+
return { ...fallback, managed, reason: `duplicate ${match[1]} marker` };
|
|
2531
|
+
}
|
|
2532
|
+
values.set(match[1], match[2].trim());
|
|
2533
|
+
}
|
|
2534
|
+
const tool = values.get("tool") ?? "";
|
|
2535
|
+
const version = values.get("version") || "unknown";
|
|
2536
|
+
const command = values.get("command") ?? "";
|
|
2537
|
+
const target = values.get("target") ?? "";
|
|
2538
|
+
const runtimeValue = values.get("runtime");
|
|
2539
|
+
const runtime = runtimeValue === "node" || runtimeValue === "native" ? runtimeValue : void 0;
|
|
2540
|
+
if (!NAME_RE.test(tool) || !NAME_RE.test(command)) {
|
|
2541
|
+
return {
|
|
2542
|
+
...fallback,
|
|
2543
|
+
managed: true,
|
|
2544
|
+
reason: "invalid tool or command marker"
|
|
2545
|
+
};
|
|
2546
|
+
}
|
|
2547
|
+
if (version.length > 64 || hasControlCharacters(version) || hasControlCharacters(target) || !isAbsolute(target)) {
|
|
2548
|
+
return {
|
|
2549
|
+
...fallback,
|
|
2550
|
+
managed: true,
|
|
2551
|
+
tool,
|
|
2552
|
+
command,
|
|
2553
|
+
reason: "invalid version or target marker"
|
|
2554
|
+
};
|
|
2555
|
+
}
|
|
2556
|
+
if (runtimeValue && !runtime) {
|
|
2557
|
+
return {
|
|
2558
|
+
...fallback,
|
|
2559
|
+
managed: true,
|
|
2560
|
+
tool,
|
|
2561
|
+
version,
|
|
2562
|
+
command,
|
|
2563
|
+
target,
|
|
2564
|
+
reason: "invalid runtime marker"
|
|
2565
|
+
};
|
|
2566
|
+
}
|
|
2567
|
+
return { managed: true, tool, version, command, target, runtime };
|
|
2568
|
+
} catch {
|
|
2569
|
+
return fallback;
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
function isInsideOrEqual(candidate, root) {
|
|
2573
|
+
const rel = relative(root, candidate);
|
|
2574
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
|
|
2575
|
+
}
|
|
2576
|
+
function classifyShim(parsed, toolsRoot) {
|
|
2577
|
+
if (parsed.reason) return { status: "broken", reason: parsed.reason };
|
|
2578
|
+
if (!parsed.target)
|
|
2579
|
+
return { status: "broken", reason: "shim missing target marker" };
|
|
2580
|
+
let realRoot;
|
|
2581
|
+
try {
|
|
2582
|
+
realRoot = realpathSync(resolve3(toolsRoot));
|
|
2583
|
+
} catch {
|
|
2584
|
+
return { status: "broken", reason: "tools root missing" };
|
|
2585
|
+
}
|
|
2586
|
+
let realTarget;
|
|
2587
|
+
try {
|
|
2588
|
+
realTarget = realpathSync(parsed.target);
|
|
2589
|
+
} catch {
|
|
2590
|
+
return { status: "broken", reason: "target missing" };
|
|
2591
|
+
}
|
|
2592
|
+
if (!isInsideOrEqual(realTarget, realRoot)) {
|
|
2593
|
+
return { status: "broken", reason: "target outside tools root" };
|
|
2594
|
+
}
|
|
2595
|
+
try {
|
|
2596
|
+
if (!lstatSync(realTarget).isFile()) {
|
|
2597
|
+
return { status: "broken", reason: "target not a file" };
|
|
2598
|
+
}
|
|
2599
|
+
accessSync(
|
|
2600
|
+
realTarget,
|
|
2601
|
+
parsed.runtime === "native" ? constants.X_OK : constants.R_OK
|
|
2602
|
+
);
|
|
2603
|
+
} catch {
|
|
2604
|
+
return {
|
|
2605
|
+
status: "broken",
|
|
2606
|
+
reason: parsed.runtime === "native" ? "target not executable" : "target not readable"
|
|
2607
|
+
};
|
|
2608
|
+
}
|
|
2609
|
+
return { status: "active" };
|
|
2610
|
+
}
|
|
2611
|
+
function scanSandboxTools(options = {}) {
|
|
2612
|
+
const binDir = options.binDir ?? SANDBOX_BIN_DIR;
|
|
2613
|
+
const toolsRoot = options.toolsRoot ?? join(SANDBOX_SHARE_ROOT, "tools");
|
|
2614
|
+
if (!existsSync3(binDir)) {
|
|
2615
|
+
return { tools: [], summary: { total: 0, active: 0, broken: 0 } };
|
|
2616
|
+
}
|
|
2617
|
+
const all = [];
|
|
2618
|
+
for (const name of readdirSync(binDir).sort()) {
|
|
2619
|
+
const filePath = join(binDir, name);
|
|
2620
|
+
const parsed = parseShim(filePath);
|
|
2621
|
+
if (!parsed.managed) continue;
|
|
2622
|
+
const { status, reason } = classifyShim(parsed, toolsRoot);
|
|
2623
|
+
all.push({
|
|
2624
|
+
tool: parsed.tool || "unknown",
|
|
2625
|
+
version: parsed.version || "unknown",
|
|
2626
|
+
command: parsed.command || name,
|
|
2627
|
+
runtime: parsed.runtime ?? "unknown",
|
|
2628
|
+
target: parsed.target,
|
|
2629
|
+
status,
|
|
2630
|
+
reason
|
|
2631
|
+
});
|
|
2632
|
+
}
|
|
2633
|
+
const active = all.filter((entry) => entry.status === "active").length;
|
|
2634
|
+
const broken = all.filter((entry) => entry.status === "broken").length;
|
|
2635
|
+
const tools = options.status ? all.filter((entry) => entry.status === options.status) : all;
|
|
2636
|
+
return { tools, summary: { total: all.length, active, broken } };
|
|
2637
|
+
}
|
|
2638
|
+
var listSandboxTools = {
|
|
2639
|
+
service: "agent",
|
|
2640
|
+
command: "+list-sandbox-tools",
|
|
2641
|
+
description: "List managed tools in the current sandbox and verify their targets and permissions",
|
|
2642
|
+
flags: [
|
|
2643
|
+
{
|
|
2644
|
+
name: "status",
|
|
2645
|
+
type: "string",
|
|
2646
|
+
required: false,
|
|
2647
|
+
desc: "Filter by status: active | broken"
|
|
2648
|
+
}
|
|
2649
|
+
],
|
|
2650
|
+
risk: "read",
|
|
2651
|
+
validate: (ctx) => {
|
|
2652
|
+
const status = ctx.str("status");
|
|
2653
|
+
if (status && !["active", "broken"].includes(status)) {
|
|
2654
|
+
throw new Error("--status must be active or broken");
|
|
2655
|
+
}
|
|
2656
|
+
},
|
|
2657
|
+
dryRun: () => ({
|
|
2658
|
+
method: "LOCAL_SCAN",
|
|
2659
|
+
url: SANDBOX_BIN_DIR,
|
|
2660
|
+
body: { marker: SHIM_MARKER, toolsRoot: join(SANDBOX_SHARE_ROOT, "tools") }
|
|
2661
|
+
}),
|
|
2662
|
+
execute: async (ctx) => scanSandboxTools({ status: ctx.str("status") })
|
|
2663
|
+
};
|
|
2664
|
+
|
|
2474
2665
|
// src/commands/te-agent/index.ts
|
|
2475
2666
|
var commands = [
|
|
2476
2667
|
// Agent CRUD
|
|
@@ -2547,7 +2738,9 @@ var commands = [
|
|
|
2547
2738
|
// Automate tasks
|
|
2548
2739
|
listAutomations,
|
|
2549
2740
|
createAutomation,
|
|
2550
|
-
updateAutomation
|
|
2741
|
+
updateAutomation,
|
|
2742
|
+
// Sandbox tools (local scan of /home/ta/.local/bin managed shims)
|
|
2743
|
+
listSandboxTools
|
|
2551
2744
|
];
|
|
2552
2745
|
var te_agent_default = commands;
|
|
2553
2746
|
export {
|