@thinkingai/ae-cli 6.1.4 → 6.1.5
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-MEJ642P4.js → auth-ENM3FE6L.js} +3 -2
- package/dist/{auth-7H3HAAJ3.js → auth-UPGUOKTW.js} +13 -6
- package/dist/{capability-QW4AVJHI.js → capability-AJC5CBRT.js} +49 -17
- package/dist/{capability-SCRFGODD.js → capability-TQ5KU5Q6.js} +49 -17
- package/dist/chunk-24BAVOX3.js +51 -0
- package/dist/{chunk-MDJGDI6K.js → chunk-3KI3RRXX.js} +5 -5
- package/dist/{chunk-PKRD2IEM.js → chunk-3P3562ZX.js} +9 -7
- package/dist/{chunk-R77JT7XD.js → chunk-4Q5TNP4Q.js} +4 -4
- package/dist/{chunk-7OLGDQQ2.js → chunk-6CHYBI64.js} +2 -2
- package/dist/{chunk-6LEYLOV3.js → chunk-CPVTECJ3.js} +9 -7
- package/dist/{chunk-KCA6BA5D.js → chunk-DB4Q3ANU.js} +5 -3
- package/dist/{chunk-2NDGFQHW.js → chunk-E7UXXHO3.js} +11 -3
- package/dist/{chunk-I4A62X3N.js → chunk-HQ2A7ITL.js} +23 -14
- package/dist/chunk-IMMGMU54.js +674 -0
- package/dist/{chunk-AJTH7LT3.js → chunk-IR4ZLVPW.js} +4 -2
- package/dist/{chunk-TBHBYKXZ.js → chunk-ISY6HMHM.js} +2 -2
- package/dist/{chunk-KGJQCYVC.js → chunk-LCXU3AAT.js} +4 -2
- package/dist/chunk-LYVNONC4.js +86 -0
- package/dist/{chunk-DYOS6YY7.js → chunk-RGXCNC4N.js} +23 -14
- package/dist/{chunk-YCLVYFK7.js → chunk-V6FR6WTW.js} +45 -87
- package/dist/chunk-VTWMIC5L.js +27 -0
- package/dist/{cli-token-TVQRSE46.js → cli-token-4SBMXAUK.js} +6 -3
- package/dist/{client-2643Z5AG.js → client-PP5FETMW.js} +4 -3
- package/dist/community-report-client-KK2QBANO.js +145 -0
- package/dist/{config-7UZWDE74.js → config-RCCGHHYA.js} +6 -3
- package/dist/index.js +506 -221
- package/dist/{metadata-BFDL6RUK.js → metadata-3M5F2AED.js} +14 -13
- package/dist/{metadata-FCLDBXX2.js → metadata-W2MEOI4Z.js} +14 -13
- package/dist/{model-T3KZJWLW.js → model-OYQLXCQY.js} +3 -2
- package/dist/{raw-CN542NGT.js → raw-TPB7KSZO.js} +6 -4
- package/dist/{sync-ERNHDPB5.js → sync-EFJKFZK2.js} +6 -3
- package/dist/{te-agent-FCCWUDTJ.js → te-agent-K2OWMZXT.js} +3 -2
- package/dist/{te-analysis-PUVF5IF4.js → te-analysis-I73ZS4NK.js} +903 -33
- package/dist/{te-analysis-UJDOKPAN.js → te-analysis-Q7AZCDU4.js} +903 -33
- package/dist/{te-common-XLAGWNIV.js → te-common-ST3QPSXJ.js} +7 -6
- package/dist/{te-common-VUX3VOXZ.js → te-common-WSLIKKPC.js} +7 -6
- package/dist/te-community-WXGB6IOX.js +1659 -0
- package/dist/te-community-X2AHXGCA.js +1659 -0
- package/dist/{te-dataops-ZNJBQ6VT.js → te-dataops-MJV54MNY.js} +10 -8
- package/dist/{te-dataops-F36T656A.js → te-dataops-OA7I6HBG.js} +10 -8
- package/dist/{te-engage-K4AEUPK5.js → te-engage-GJRVQMK3.js} +10 -9
- package/dist/{te-engage-QBCCME22.js → te-engage-JIXX3WBI.js} +10 -9
- package/dist/{te-experiment-JINSMHMW.js → te-experiment-JKX4FH6D.js} +7 -6
- package/dist/{te-experiment-NWNQHJS5.js → te-experiment-UMSHBBKI.js} +7 -6
- package/dist/{te-kb-AYCODNU6.js → te-kb-CIZXRWMO.js} +49 -6
- package/dist/{te-meta-ARDIW3YI.js → te-meta-Q4L6EE3Q.js} +7 -6
- package/dist/{te-meta-UUROEODR.js → te-meta-VHCN4Q62.js} +7 -6
- package/dist/{te-team-OKCOX7OE.js → te-team-PDKKW7Q5.js} +7 -6
- package/dist/tracking/i18n/resources/cli/en.json +4 -3
- package/dist/tracking/i18n/resources/cli/ja.json +4 -3
- package/dist/tracking/i18n/resources/cli/ko.json +4 -3
- package/dist/tracking/i18n/resources/cli/zh.json +4 -3
- package/package.json +6 -2
- package/skills/ae-agent/SKILL.md +2 -1
- package/skills/ae-analysis/SKILL.md +12 -1
- package/skills/ae-analysis/references/adhoc_export.md +2 -0
- package/skills/ae-analysis/references/adhoc_run.md +2 -0
- package/skills/ae-analysis/references/alert_create.md +25 -0
- package/skills/ae-analysis/references/alert_definition_schema_get.md +24 -0
- package/skills/ae-analysis/references/alert_delete.md +26 -0
- package/skills/ae-analysis/references/alert_detail_list.md +27 -0
- package/skills/ae-analysis/references/alert_get.md +25 -0
- package/skills/ae-analysis/references/alert_job_list.md +24 -0
- package/skills/ae-analysis/references/alert_list.md +27 -0
- package/skills/ae-analysis/references/alert_notice_config_list.md +24 -0
- package/skills/ae-analysis/references/alert_start.md +25 -0
- package/skills/ae-analysis/references/alert_stop.md +25 -0
- package/skills/ae-analysis/references/alert_update.md +26 -0
- package/skills/ae-analysis/references/bi_panel_create.md +3 -3
- package/skills/ae-analysis/references/check_delete.md +27 -0
- package/skills/ae-analysis/references/check_export.md +27 -0
- package/skills/ae-analysis/references/check_get.md +27 -0
- package/skills/ae-analysis/references/check_list.md +24 -0
- package/skills/ae-analysis/references/check_retry.md +27 -0
- package/skills/ae-analysis/references/check_run.md +25 -0
- package/skills/ae-analysis/references/command_index.md +61 -27
- package/skills/ae-analysis/references/dashboard_create.md +3 -3
- package/skills/ae-analysis/references/dashboard_daily_report_send.md +1 -0
- package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
- package/skills/ae-analysis/references/dashboard_report_data_export.md +3 -3
- package/skills/ae-analysis/references/dashboard_report_data_run.md +3 -3
- package/skills/ae-analysis/references/event_blacklist_add.md +25 -0
- package/skills/ae-analysis/references/event_blacklist_list.md +24 -0
- package/skills/ae-analysis/references/event_blacklist_update.md +26 -0
- package/skills/ae-analysis/references/ingest_error_list.md +27 -0
- package/skills/ae-analysis/references/ingest_summary.md +26 -0
- package/skills/ae-analysis/references/live_data_export.md +27 -0
- package/skills/ae-analysis/references/live_data_list.md +27 -0
- package/skills/ae-analysis/references/plan_change_log_export.md +27 -0
- package/skills/ae-analysis/references/plan_change_log_list.md +24 -0
- package/skills/ae-analysis/references/plan_delete_items.md +30 -0
- package/skills/ae-analysis/references/plan_export.md +26 -0
- package/skills/ae-analysis/references/plan_generate.md +27 -0
- package/skills/ae-analysis/references/plan_get.md +24 -0
- package/skills/ae-analysis/references/plan_import_excel.md +26 -0
- package/skills/ae-analysis/references/plan_save_items.md +27 -0
- package/skills/ae-analysis/references/plan_sync_from_meta.md +24 -0
- package/skills/ae-analysis/references/project_role_delete.md +4 -3
- package/skills/ae-analysis/references/project_role_get.md +4 -3
- package/skills/ae-analysis/references/project_role_user_list.md +4 -3
- package/skills/ae-analysis/references/query_create_result_cluster.md +2 -1
- package/skills/ae-analysis/references/report_data_export.md +3 -1
- package/skills/ae-analysis/references/report_data_run.md +12 -2
- package/skills/ae-analysis/references/sdk_sample_generate.md +24 -0
- package/skills/ae-analysis/references/user_cluster_create.md +2 -0
- package/skills/ae-analysis/references/user_cluster_create_id.md +2 -0
- package/skills/ae-analysis/references/user_cluster_update.md +2 -0
- package/skills/ae-analysis/references/user_cluster_update_id.md +2 -0
- package/skills/ae-analysis/references/user_tag_create.md +2 -0
- package/skills/ae-analysis/references/user_tag_create_id.md +2 -0
- package/skills/ae-analysis/references/user_tag_update.md +2 -0
- package/skills/ae-analysis/references/user_tag_update_id.md +2 -0
- package/skills/ae-analysis-global/SKILL.md +2 -0
- package/skills/ae-capability/SKILL.md +7 -5
- package/skills/ae-community/SKILL.md +72 -8
- package/skills/ae-community/references/community-chat-analysis.md +341 -0
- package/skills/ae-community/references/community-data-report.md +301 -0
- package/skills/ae-dataops/SKILL.md +2 -1
- package/skills/ae-engage/SKILL.md +2 -1
- package/skills/ae-generate-tracking-code/SKILL.md +4 -4
- package/skills/ae-generate-tracking-plan/SKILL.md +132 -11
- package/skills/ae-generate-tracking-plan/references/business-dimension-mapping.md +98 -33
- package/skills/ae-generate-tracking-plan/references/xlsx-schema.md +16 -14
- package/skills/ae-kb/SKILL.md +2 -1
- package/skills/ae-metadata/SKILL.md +2 -1
- package/skills/ae-team/SKILL.md +2 -1
- package/dist/chunk-NOO24N7W.js +0 -11
- package/dist/chunk-TNW2CI4W.js +0 -129
- package/dist/te-community-PEZ2VEF7.js +0 -687
- package/dist/te-community-TSKJ652U.js +0 -687
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
invalidateAccessTokenForRetry,
|
|
4
4
|
resolveHost,
|
|
5
5
|
validateToken
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-IR4ZLVPW.js";
|
|
7
|
+
import "./chunk-V6FR6WTW.js";
|
|
8
|
+
import "./chunk-LYVNONC4.js";
|
|
8
9
|
export {
|
|
9
10
|
getToken,
|
|
10
11
|
invalidateAccessTokenForRetry,
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getLocalCliPackageInfo
|
|
3
|
+
} from "./chunk-VTWMIC5L.js";
|
|
1
4
|
import {
|
|
2
5
|
printError,
|
|
3
|
-
printOutput
|
|
4
|
-
|
|
6
|
+
printOutput,
|
|
7
|
+
runHostCompatCheck
|
|
8
|
+
} from "./chunk-IMMGMU54.js";
|
|
5
9
|
import {
|
|
6
10
|
clearCliToken,
|
|
7
11
|
mintCliToken
|
|
8
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-E7UXXHO3.js";
|
|
9
13
|
import {
|
|
10
14
|
clear,
|
|
11
15
|
load,
|
|
12
16
|
resolveHost,
|
|
13
17
|
save
|
|
14
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IR4ZLVPW.js";
|
|
15
19
|
import {
|
|
16
20
|
getFallbackCliToken,
|
|
17
21
|
loadConfig,
|
|
18
|
-
logger,
|
|
19
22
|
normalizeUrl,
|
|
20
23
|
removeHost,
|
|
21
24
|
saveConfig
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-V6FR6WTW.js";
|
|
26
|
+
import {
|
|
27
|
+
logger
|
|
28
|
+
} from "./chunk-LYVNONC4.js";
|
|
23
29
|
|
|
24
30
|
// src/core/device-auth.ts
|
|
25
31
|
import { execFileSync } from "child_process";
|
|
@@ -257,6 +263,7 @@ async function persistDeviceTokens(host, tokens) {
|
|
|
257
263
|
accessExpiresAt: expiresAt
|
|
258
264
|
});
|
|
259
265
|
await mintCliToken(host);
|
|
266
|
+
await runHostCompatCheck(getLocalCliPackageInfo(), host);
|
|
260
267
|
}
|
|
261
268
|
function loginSummary(host, tokens) {
|
|
262
269
|
return {
|
|
@@ -12,22 +12,23 @@ import {
|
|
|
12
12
|
inspectCapability,
|
|
13
13
|
listCapabilities,
|
|
14
14
|
validateCapability
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HQ2A7ITL.js";
|
|
16
16
|
import {
|
|
17
17
|
printError,
|
|
18
18
|
printOutput
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import
|
|
21
|
-
PermissionError
|
|
22
|
-
} from "./chunk-NOO24N7W.js";
|
|
23
|
-
import "./chunk-2NDGFQHW.js";
|
|
19
|
+
} from "./chunk-IMMGMU54.js";
|
|
20
|
+
import "./chunk-E7UXXHO3.js";
|
|
24
21
|
import {
|
|
25
22
|
SecureStoreAuthError,
|
|
26
23
|
resolveHost
|
|
27
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IR4ZLVPW.js";
|
|
28
25
|
import {
|
|
29
26
|
safeJsonParse
|
|
30
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-V6FR6WTW.js";
|
|
28
|
+
import {
|
|
29
|
+
PermissionError
|
|
30
|
+
} from "./chunk-24BAVOX3.js";
|
|
31
|
+
import "./chunk-LYVNONC4.js";
|
|
31
32
|
|
|
32
33
|
// src/commands/capability/index.ts
|
|
33
34
|
import * as readline from "readline";
|
|
@@ -55,6 +56,26 @@ function resolveCapabilityGatewayDomain(capabilityId, domainOverride) {
|
|
|
55
56
|
}
|
|
56
57
|
return findGatewayDomain(cliDomain) ?? cliDomain;
|
|
57
58
|
}
|
|
59
|
+
function parseOptionalProjectId(raw) {
|
|
60
|
+
if (raw === void 0) {
|
|
61
|
+
return void 0;
|
|
62
|
+
}
|
|
63
|
+
const value = raw.trim();
|
|
64
|
+
if (!/^[1-9]\d*$/.test(value)) {
|
|
65
|
+
throw new CapabilityCommandValidationError(
|
|
66
|
+
"--project-id must be a positive integer.",
|
|
67
|
+
"Example: --project-id 1"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
const projectId = Number(value);
|
|
71
|
+
if (!Number.isSafeInteger(projectId)) {
|
|
72
|
+
throw new CapabilityCommandValidationError(
|
|
73
|
+
"--project-id is outside the supported integer range.",
|
|
74
|
+
"Pass a positive safe integer."
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return projectId;
|
|
78
|
+
}
|
|
58
79
|
function normalizeCapabilityList(value) {
|
|
59
80
|
if (!Array.isArray(value)) {
|
|
60
81
|
throw new Error("Capability gateway returned an invalid catalog: expected an array.");
|
|
@@ -114,28 +135,39 @@ function registerCapability(program) {
|
|
|
114
135
|
printError("validation", "Missing subcommand.", "Run: ae-cli capability --help");
|
|
115
136
|
process.exitCode = 1;
|
|
116
137
|
});
|
|
117
|
-
capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").action(async (opts) => {
|
|
138
|
+
capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (opts) => {
|
|
118
139
|
await executeAndPrint(program, async (host) => {
|
|
119
140
|
const gatewayDomain = findGatewayDomain(opts.domain) ?? opts.domain;
|
|
120
|
-
const
|
|
141
|
+
const projectId = parseOptionalProjectId(opts.projectId);
|
|
142
|
+
const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain, projectId));
|
|
121
143
|
const capabilities = filterCapabilities(catalog, opts.domain);
|
|
122
144
|
return { domain: opts.domain, count: capabilities.length, capabilities };
|
|
123
145
|
});
|
|
124
|
-
}).addHelpText(
|
|
125
|
-
|
|
146
|
+
}).addHelpText(
|
|
147
|
+
"after",
|
|
148
|
+
"\nExamples:\n ae-cli capability list --domain analysis\n ae-cli capability list --domain analysis --project-id 1"
|
|
149
|
+
);
|
|
150
|
+
capability.command("search").description("Search capability IDs and descriptions in a domain").argument("<query>", "Case-insensitive search terms").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (query, opts) => {
|
|
126
151
|
await executeAndPrint(program, async (host) => {
|
|
127
152
|
const gatewayDomain = findGatewayDomain(opts.domain) ?? opts.domain;
|
|
128
|
-
const
|
|
153
|
+
const projectId = parseOptionalProjectId(opts.projectId);
|
|
154
|
+
const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain, projectId));
|
|
129
155
|
const capabilities = filterCapabilities(catalog, opts.domain, query);
|
|
130
156
|
return { domain: opts.domain, query, count: capabilities.length, capabilities };
|
|
131
157
|
});
|
|
132
|
-
}).addHelpText(
|
|
133
|
-
|
|
158
|
+
}).addHelpText(
|
|
159
|
+
"after",
|
|
160
|
+
'\nExamples:\n ae-cli capability search "dashboard list" --domain analysis\n ae-cli capability search "dashboard list" --domain analysis --project-id 1'
|
|
161
|
+
);
|
|
162
|
+
capability.command("inspect").description("Inspect one capability schema, risk, auth, and output metadata").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--project-id <project-id>", "Check availability in a project before returning metadata").action(async (capabilityId, opts) => {
|
|
134
163
|
await executeAndPrint(program, async (host) => {
|
|
135
164
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
136
|
-
return inspectCapability(host, gatewayDomain, capabilityId);
|
|
165
|
+
return inspectCapability(host, gatewayDomain, capabilityId, parseOptionalProjectId(opts.projectId));
|
|
137
166
|
});
|
|
138
|
-
}).addHelpText(
|
|
167
|
+
}).addHelpText(
|
|
168
|
+
"after",
|
|
169
|
+
"\nExamples:\n ae-cli capability inspect analysis.dashboard.list\n ae-cli capability inspect analysis.dashboard.list --project-id 1"
|
|
170
|
+
);
|
|
139
171
|
capability.command("validate").description(
|
|
140
172
|
"Validate and normalize capability input only (schema/params). Does not execute business logic. Use when crafting complex payloads (nested objects, qp, share/member payloads) before dry-run/run. Success data: valid, capability_id, normalized_input. Unlike dry-run, does not return risk/output_mode/supports_cancel preview."
|
|
141
173
|
).argument("<capability-id>", "Capability ID, such as metadata.data_table.sql_write").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
|
|
@@ -12,22 +12,23 @@ import {
|
|
|
12
12
|
inspectCapability,
|
|
13
13
|
listCapabilities,
|
|
14
14
|
validateCapability
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-RGXCNC4N.js";
|
|
16
16
|
import {
|
|
17
17
|
printError,
|
|
18
18
|
printOutput
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import
|
|
21
|
-
PermissionError
|
|
22
|
-
} from "./chunk-NOO24N7W.js";
|
|
23
|
-
import "./chunk-2NDGFQHW.js";
|
|
19
|
+
} from "./chunk-IMMGMU54.js";
|
|
20
|
+
import "./chunk-E7UXXHO3.js";
|
|
24
21
|
import {
|
|
25
22
|
SecureStoreAuthError,
|
|
26
23
|
resolveHost
|
|
27
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IR4ZLVPW.js";
|
|
28
25
|
import {
|
|
29
26
|
safeJsonParse
|
|
30
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-V6FR6WTW.js";
|
|
28
|
+
import {
|
|
29
|
+
PermissionError
|
|
30
|
+
} from "./chunk-24BAVOX3.js";
|
|
31
|
+
import "./chunk-LYVNONC4.js";
|
|
31
32
|
|
|
32
33
|
// src/commands/capability/index.ts
|
|
33
34
|
import * as readline from "readline";
|
|
@@ -55,6 +56,26 @@ function resolveCapabilityGatewayDomain(capabilityId, domainOverride) {
|
|
|
55
56
|
}
|
|
56
57
|
return findGatewayDomain(cliDomain) ?? cliDomain;
|
|
57
58
|
}
|
|
59
|
+
function parseOptionalProjectId(raw) {
|
|
60
|
+
if (raw === void 0) {
|
|
61
|
+
return void 0;
|
|
62
|
+
}
|
|
63
|
+
const value = raw.trim();
|
|
64
|
+
if (!/^[1-9]\d*$/.test(value)) {
|
|
65
|
+
throw new CapabilityCommandValidationError(
|
|
66
|
+
"--project-id must be a positive integer.",
|
|
67
|
+
"Example: --project-id 1"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
const projectId = Number(value);
|
|
71
|
+
if (!Number.isSafeInteger(projectId)) {
|
|
72
|
+
throw new CapabilityCommandValidationError(
|
|
73
|
+
"--project-id is outside the supported integer range.",
|
|
74
|
+
"Pass a positive safe integer."
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return projectId;
|
|
78
|
+
}
|
|
58
79
|
function normalizeCapabilityList(value) {
|
|
59
80
|
if (!Array.isArray(value)) {
|
|
60
81
|
throw new Error("Capability gateway returned an invalid catalog: expected an array.");
|
|
@@ -114,28 +135,39 @@ function registerCapability(program) {
|
|
|
114
135
|
printError("validation", "Missing subcommand.", "Run: ae-cli capability --help");
|
|
115
136
|
process.exitCode = 1;
|
|
116
137
|
});
|
|
117
|
-
capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").action(async (opts) => {
|
|
138
|
+
capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (opts) => {
|
|
118
139
|
await executeAndPrint(program, async (host) => {
|
|
119
140
|
const gatewayDomain = findGatewayDomain(opts.domain) ?? opts.domain;
|
|
120
|
-
const
|
|
141
|
+
const projectId = parseOptionalProjectId(opts.projectId);
|
|
142
|
+
const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain, projectId));
|
|
121
143
|
const capabilities = filterCapabilities(catalog, opts.domain);
|
|
122
144
|
return { domain: opts.domain, count: capabilities.length, capabilities };
|
|
123
145
|
});
|
|
124
|
-
}).addHelpText(
|
|
125
|
-
|
|
146
|
+
}).addHelpText(
|
|
147
|
+
"after",
|
|
148
|
+
"\nExamples:\n ae-cli capability list --domain analysis\n ae-cli capability list --domain analysis --project-id 1"
|
|
149
|
+
);
|
|
150
|
+
capability.command("search").description("Search capability IDs and descriptions in a domain").argument("<query>", "Case-insensitive search terms").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (query, opts) => {
|
|
126
151
|
await executeAndPrint(program, async (host) => {
|
|
127
152
|
const gatewayDomain = findGatewayDomain(opts.domain) ?? opts.domain;
|
|
128
|
-
const
|
|
153
|
+
const projectId = parseOptionalProjectId(opts.projectId);
|
|
154
|
+
const catalog = normalizeCapabilityList(await listCapabilities(host, gatewayDomain, projectId));
|
|
129
155
|
const capabilities = filterCapabilities(catalog, opts.domain, query);
|
|
130
156
|
return { domain: opts.domain, query, count: capabilities.length, capabilities };
|
|
131
157
|
});
|
|
132
|
-
}).addHelpText(
|
|
133
|
-
|
|
158
|
+
}).addHelpText(
|
|
159
|
+
"after",
|
|
160
|
+
'\nExamples:\n ae-cli capability search "dashboard list" --domain analysis\n ae-cli capability search "dashboard list" --domain analysis --project-id 1'
|
|
161
|
+
);
|
|
162
|
+
capability.command("inspect").description("Inspect one capability schema, risk, auth, and output metadata").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--project-id <project-id>", "Check availability in a project before returning metadata").action(async (capabilityId, opts) => {
|
|
134
163
|
await executeAndPrint(program, async (host) => {
|
|
135
164
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
136
|
-
return inspectCapability(host, gatewayDomain, capabilityId);
|
|
165
|
+
return inspectCapability(host, gatewayDomain, capabilityId, parseOptionalProjectId(opts.projectId));
|
|
137
166
|
});
|
|
138
|
-
}).addHelpText(
|
|
167
|
+
}).addHelpText(
|
|
168
|
+
"after",
|
|
169
|
+
"\nExamples:\n ae-cli capability inspect analysis.dashboard.list\n ae-cli capability inspect analysis.dashboard.list --project-id 1"
|
|
170
|
+
);
|
|
139
171
|
capability.command("validate").description(
|
|
140
172
|
"Validate and normalize capability input only (schema/params). Does not execute business logic. Use when crafting complex payloads (nested objects, qp, share/member payloads) before dry-run/run. Success data: valid, capability_id, normalized_input. Unlike dry-run, does not return risk/output_mode/supports_cancel preview."
|
|
141
173
|
).argument("<capability-id>", "Capability ID, such as metadata.data_table.sql_write").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// src/core/errors.ts
|
|
2
|
+
var PermissionError = class extends Error {
|
|
3
|
+
constructor(message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = "PermissionError";
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
var CliValidationError = class extends Error {
|
|
9
|
+
code;
|
|
10
|
+
hint;
|
|
11
|
+
location;
|
|
12
|
+
constructor(message, options = {}) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = "CliValidationError";
|
|
15
|
+
this.code = options.code;
|
|
16
|
+
this.hint = options.hint;
|
|
17
|
+
if (options.location) {
|
|
18
|
+
const location = {};
|
|
19
|
+
if (typeof options.location.segment === "number" && Number.isFinite(options.location.segment)) {
|
|
20
|
+
location.segment = options.location.segment;
|
|
21
|
+
}
|
|
22
|
+
if (typeof options.location.record === "number" && Number.isFinite(options.location.record)) {
|
|
23
|
+
location.record = options.location.record;
|
|
24
|
+
}
|
|
25
|
+
if (typeof options.location.field === "string" && options.location.field.length > 0) {
|
|
26
|
+
location.field = options.location.field;
|
|
27
|
+
}
|
|
28
|
+
if (Object.keys(location).length > 0) this.location = location;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var CommunityReportError = class extends Error {
|
|
33
|
+
code;
|
|
34
|
+
httpStatus;
|
|
35
|
+
hint;
|
|
36
|
+
meta;
|
|
37
|
+
constructor(message, options = {}) {
|
|
38
|
+
super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
|
|
39
|
+
this.name = "CommunityReportError";
|
|
40
|
+
this.code = options.code;
|
|
41
|
+
this.httpStatus = options.httpStatus;
|
|
42
|
+
this.hint = options.hint;
|
|
43
|
+
this.meta = options.meta;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
PermissionError,
|
|
49
|
+
CliValidationError,
|
|
50
|
+
CommunityReportError
|
|
51
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PermissionError
|
|
3
|
-
} from "./chunk-NOO24N7W.js";
|
|
4
1
|
import {
|
|
5
2
|
getCliToken
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E7UXXHO3.js";
|
|
7
4
|
import {
|
|
8
5
|
safeJsonParse
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-V6FR6WTW.js";
|
|
7
|
+
import {
|
|
8
|
+
PermissionError
|
|
9
|
+
} from "./chunk-24BAVOX3.js";
|
|
10
10
|
|
|
11
11
|
// src/core/mcp-access.ts
|
|
12
12
|
function buildUrl(host, path, params = {}) {
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAnalysisMappingPathForClusterMode
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
PermissionError
|
|
6
|
-
} from "./chunk-NOO24N7W.js";
|
|
3
|
+
} from "./chunk-LCXU3AAT.js";
|
|
7
4
|
import {
|
|
8
5
|
clearCliToken,
|
|
9
6
|
getCliToken
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-E7UXXHO3.js";
|
|
11
8
|
import {
|
|
12
9
|
getActiveHost,
|
|
13
|
-
logger,
|
|
14
10
|
safeJsonParse
|
|
15
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-V6FR6WTW.js";
|
|
12
|
+
import {
|
|
13
|
+
PermissionError
|
|
14
|
+
} from "./chunk-24BAVOX3.js";
|
|
15
|
+
import {
|
|
16
|
+
logger
|
|
17
|
+
} from "./chunk-LYVNONC4.js";
|
|
16
18
|
|
|
17
19
|
// src/core/mcp.ts
|
|
18
20
|
async function permissionMessage(resp) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getActiveHost,
|
|
3
3
|
getSandboxRuntimeRoot
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-V6FR6WTW.js";
|
|
5
5
|
|
|
6
6
|
// src/core/te-agent-credentials.ts
|
|
7
7
|
import { readFileSync } from "fs";
|
|
@@ -147,8 +147,8 @@ async function signRequest(method, path, rawBody) {
|
|
|
147
147
|
rawBody
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
const { getToken } = await import("./auth-
|
|
151
|
-
const { getCliToken } = await import("./cli-token-
|
|
150
|
+
const { getToken } = await import("./auth-ENM3FE6L.js");
|
|
151
|
+
const { getCliToken } = await import("./cli-token-4SBMXAUK.js");
|
|
152
152
|
const baseUrl = sandboxCred?.url || teClaudeBaseFromActiveHost();
|
|
153
153
|
const hostForToken = getActiveHost() || baseUrl;
|
|
154
154
|
if (!baseUrl) {
|
|
@@ -338,7 +338,7 @@ async function uploadToMainApp(path, formData) {
|
|
|
338
338
|
"X-Sandbox-Secret-Key": sandboxCred.sandboxSecretKey
|
|
339
339
|
};
|
|
340
340
|
} else {
|
|
341
|
-
const { getToken } = await import("./auth-
|
|
341
|
+
const { getToken } = await import("./auth-ENM3FE6L.js");
|
|
342
342
|
baseUrl = (sandboxCred?.url || teClaudeBaseFromActiveHost() || "").replace(/\/$/, "");
|
|
343
343
|
if (!baseUrl) {
|
|
344
344
|
throw new TeAgentCredentialsError(
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
dryRunCapability,
|
|
6
6
|
executeCapabilityWithEnvelope,
|
|
7
7
|
validateCapability
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RGXCNC4N.js";
|
|
9
9
|
import {
|
|
10
10
|
withOutputMetadata
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IMMGMU54.js";
|
|
12
12
|
|
|
13
13
|
// src/core/capability-command.ts
|
|
14
14
|
import { randomBytes } from "crypto";
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAnalysisMappingPathForClusterMode
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
PermissionError
|
|
6
|
-
} from "./chunk-NOO24N7W.js";
|
|
3
|
+
} from "./chunk-LCXU3AAT.js";
|
|
7
4
|
import {
|
|
8
5
|
clearCliToken,
|
|
9
6
|
getCliToken
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-E7UXXHO3.js";
|
|
11
8
|
import {
|
|
12
9
|
getActiveHost,
|
|
13
|
-
logger,
|
|
14
10
|
safeJsonParse
|
|
15
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-V6FR6WTW.js";
|
|
12
|
+
import {
|
|
13
|
+
PermissionError
|
|
14
|
+
} from "./chunk-24BAVOX3.js";
|
|
15
|
+
import {
|
|
16
|
+
logger
|
|
17
|
+
} from "./chunk-LYVNONC4.js";
|
|
16
18
|
|
|
17
19
|
// src/core/mcp.ts
|
|
18
20
|
async function permissionMessage(resp) {
|
|
@@ -3,11 +3,13 @@ import {
|
|
|
3
3
|
getToken,
|
|
4
4
|
invalidateAccessTokenForRetry,
|
|
5
5
|
resolveHost
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IR4ZLVPW.js";
|
|
7
7
|
import {
|
|
8
|
-
logger,
|
|
9
8
|
safeJsonParse
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-V6FR6WTW.js";
|
|
10
|
+
import {
|
|
11
|
+
logger
|
|
12
|
+
} from "./chunk-LYVNONC4.js";
|
|
11
13
|
|
|
12
14
|
// src/core/client.ts
|
|
13
15
|
import WebSocket from "ws";
|
|
@@ -3,17 +3,19 @@ import {
|
|
|
3
3
|
load,
|
|
4
4
|
loadCliToken,
|
|
5
5
|
save
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IR4ZLVPW.js";
|
|
7
7
|
import {
|
|
8
8
|
getActiveHost,
|
|
9
9
|
getConfigDir,
|
|
10
10
|
getFallbackCliToken,
|
|
11
11
|
listHosts,
|
|
12
|
-
logger,
|
|
13
12
|
normalizeUrl,
|
|
14
13
|
safeJsonParse,
|
|
15
14
|
safeReadJsonFile
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-V6FR6WTW.js";
|
|
16
|
+
import {
|
|
17
|
+
logger
|
|
18
|
+
} from "./chunk-LYVNONC4.js";
|
|
17
19
|
|
|
18
20
|
// src/core/cli-token.ts
|
|
19
21
|
import fs from "fs";
|
|
@@ -125,6 +127,11 @@ function clearPersistedCliToken(hostUrl) {
|
|
|
125
127
|
save(hostUrl, { ...existing, cliToken: void 0 });
|
|
126
128
|
}
|
|
127
129
|
}
|
|
130
|
+
function peekCliToken(hostOverride) {
|
|
131
|
+
const hostUrl = hostOverride || getActiveHost();
|
|
132
|
+
if (!hostUrl) return void 0;
|
|
133
|
+
return _cliTokenCache.get(hostUrl) || loadCliToken(hostUrl) || getFallbackCliToken(hostUrl) || void 0;
|
|
134
|
+
}
|
|
128
135
|
async function getCliToken(hostOverride) {
|
|
129
136
|
const hostUrl = hostOverride || getActiveHost();
|
|
130
137
|
let token = _cliTokenCache.get(hostUrl);
|
|
@@ -182,6 +189,7 @@ function _resetRenewMemoryForTest() {
|
|
|
182
189
|
|
|
183
190
|
export {
|
|
184
191
|
localRenewDate,
|
|
192
|
+
peekCliToken,
|
|
185
193
|
getCliToken,
|
|
186
194
|
mintCliToken,
|
|
187
195
|
clearCliToken,
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PermissionError
|
|
3
|
-
} from "./chunk-NOO24N7W.js";
|
|
4
1
|
import {
|
|
5
2
|
clearCliToken,
|
|
6
3
|
getCliToken
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-E7UXXHO3.js";
|
|
8
5
|
import {
|
|
9
|
-
logger,
|
|
10
6
|
safeJsonParse
|
|
11
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-V6FR6WTW.js";
|
|
8
|
+
import {
|
|
9
|
+
PermissionError
|
|
10
|
+
} from "./chunk-24BAVOX3.js";
|
|
11
|
+
import {
|
|
12
|
+
logger
|
|
13
|
+
} from "./chunk-LYVNONC4.js";
|
|
12
14
|
|
|
13
15
|
// src/core/capability-api.ts
|
|
14
16
|
import { readFile } from "fs/promises";
|
|
@@ -145,11 +147,11 @@ async function requestMultipartOnce(url, token, form) {
|
|
|
145
147
|
body: form
|
|
146
148
|
});
|
|
147
149
|
}
|
|
148
|
-
async function callGateway(host, domain, pathAfterV1, method, body) {
|
|
149
|
-
return (await callGatewayWithEnvelope(host, domain, pathAfterV1, method, body)).data;
|
|
150
|
+
async function callGateway(host, domain, pathAfterV1, method, body, queryParams = {}) {
|
|
151
|
+
return (await callGatewayWithEnvelope(host, domain, pathAfterV1, method, body, queryParams)).data;
|
|
150
152
|
}
|
|
151
|
-
async function callGatewayWithEnvelope(host, domain, pathAfterV1, method, body) {
|
|
152
|
-
const url = buildCapabilityGatewayUrl(host, domain, pathAfterV1);
|
|
153
|
+
async function callGatewayWithEnvelope(host, domain, pathAfterV1, method, body, queryParams = {}) {
|
|
154
|
+
const url = buildCapabilityGatewayUrl(host, domain, pathAfterV1, queryParams);
|
|
153
155
|
const token = await getCliToken(host);
|
|
154
156
|
let resp = await requestOnce(url, method, token, body);
|
|
155
157
|
let permissionMsg;
|
|
@@ -210,11 +212,18 @@ async function requestCapabilityGatewayWithEnvelope(host, domain, pathAfterV1, m
|
|
|
210
212
|
const resp = await fetchCapabilityGateway(host, domain, pathAfterV1, method, body);
|
|
211
213
|
return parseCapabilityEnvelope(parseCapabilityResponse(await resp.text()));
|
|
212
214
|
}
|
|
213
|
-
async function listCapabilities(host, domain) {
|
|
214
|
-
return callGateway(host, domain, "capabilities", "GET");
|
|
215
|
+
async function listCapabilities(host, domain, projectId) {
|
|
216
|
+
return callGateway(host, domain, "capabilities", "GET", void 0, { project_id: projectId });
|
|
215
217
|
}
|
|
216
|
-
async function inspectCapability(host, domain, capabilityId) {
|
|
217
|
-
return callGateway(
|
|
218
|
+
async function inspectCapability(host, domain, capabilityId, projectId) {
|
|
219
|
+
return callGateway(
|
|
220
|
+
host,
|
|
221
|
+
domain,
|
|
222
|
+
`capabilities/${capabilityId}`,
|
|
223
|
+
"GET",
|
|
224
|
+
void 0,
|
|
225
|
+
{ project_id: projectId }
|
|
226
|
+
);
|
|
218
227
|
}
|
|
219
228
|
async function executeCapability(host, domain, capabilityId, input = {}) {
|
|
220
229
|
return callGateway(host, domain, `capabilities/${capabilityId}/execute`, "POST", { input });
|