@thinkingai/ae-cli 6.0.22 → 6.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auth-RDN6D5HU.js → auth-7TQRGLBC.js} +13 -15
- package/dist/auth-MEJ642P4.js +13 -0
- package/dist/chunk-2NDGFQHW.js +190 -0
- package/dist/{chunk-5FBLRSMU.js → chunk-7QQ4233A.js} +3 -3
- package/dist/{chunk-U6QPKCN3.js → chunk-AJTH7LT3.js} +10 -116
- package/dist/chunk-BXMXMUD7.js +254 -0
- package/dist/chunk-C4DH76LX.js +59 -0
- package/dist/chunk-GWZ5MYWE.js +209 -0
- package/dist/{chunk-E34XH4GW.js → chunk-KCA6BA5D.js} +8 -8
- package/dist/{chunk-XE2PI5DS.js → chunk-KGJQCYVC.js} +1 -1
- package/dist/chunk-LG5YT7P7.js +59 -0
- package/dist/{chunk-2W7HULUD.js → chunk-MDJGDI6K.js} +2 -2
- package/dist/{chunk-H52CSLJW.js → chunk-R77JT7XD.js} +53 -6
- package/dist/{chunk-WPXHCP4A.js → chunk-YCLVYFK7.js} +52 -9
- package/dist/{chunk-4EUZRJPO.js → chunk-YNQFYBDB.js} +102 -14
- package/dist/{chunk-YACCPUNQ.js → chunk-ZAOL36CG.js} +1 -1
- package/dist/cli-token-TVQRSE46.js +18 -0
- package/dist/{client-VTJMUZ4O.js → client-2643Z5AG.js} +3 -3
- package/dist/{config-2SDTLGOC.js → config-ZVPARN4R.js} +4 -9
- package/dist/index.js +27 -24
- package/dist/{metadata-JZ2OTWBK.js → metadata-IPSPQBX3.js} +56 -65
- package/dist/metadata-N5REJ7R7.js +411 -0
- package/dist/{model-ZYMRN4VS.js → model-T3KZJWLW.js} +2 -2
- package/dist/{raw-NGYHAL3F.js → raw-OHSUK42D.js} +4 -4
- package/dist/{sync-JVLX6TGW.js → sync-ULT5SECP.js} +3 -3
- package/dist/{te-agent-QPZTLHPH.js → te-agent-QLIVKRUN.js} +1146 -61
- package/dist/{te-analysis-WWX3Z6RP.js → te-analysis-2U5EPXQC.js} +1213 -341
- package/dist/te-analysis-QMZ2UH7F.js +2419 -0
- package/dist/{te-audience-UXGHUVBB.js → te-audience-PVMKQAFH.js} +5 -5
- package/dist/te-audience-XMRMVD2V.js +599 -0
- package/dist/{te-common-7XXH73MF.js → te-common-CFGQXTFV.js} +5 -5
- package/dist/te-common-SDB3O2QG.js +130 -0
- package/dist/{te-community-QKE67HR2.js → te-community-6A7LKYUH.js} +5 -5
- package/dist/te-community-GMWFGILT.js +687 -0
- package/dist/te-dataops-6LIPYNGH.js +1864 -0
- package/dist/{te-dataops-6W7NNYST.js → te-dataops-Z53CTG2U.js} +90 -68
- package/dist/{te-engage-NCFAQFX3.js → te-engage-AGREUOW7.js} +30 -15
- package/dist/te-engage-MIIUKY6M.js +1525 -0
- package/dist/{te-kb-K5BQYUCM.js → te-kb-KQJ53M3A.js} +4 -4
- package/dist/{te-meta-LJZBOSMO.js → te-meta-QLANJ4B4.js} +5 -5
- package/dist/te-meta-TOA6FWDE.js +595 -0
- package/dist/{te-team-DHK5R7MV.js → te-team-TQGMNHQQ.js} +5 -5
- package/package.json +3 -1
- package/skills/ae-agent/SKILL.md +158 -189
- package/skills/ae-agent/references/accept-skill-share.md +39 -0
- package/skills/ae-agent/references/add-attachment.md +57 -0
- package/skills/ae-agent/references/add-mcp.md +75 -0
- package/skills/ae-agent/references/add-model.md +70 -0
- package/skills/ae-agent/references/add-skill.md +71 -0
- package/skills/ae-agent/references/approve-skill.md +41 -0
- package/skills/ae-agent/references/attachment-stats.md +50 -0
- package/skills/ae-agent/references/auto-provision-mcp-credentials.md +57 -0
- package/skills/ae-agent/references/cancel-skill-submission.md +39 -0
- package/skills/ae-agent/references/copy-skill.md +53 -0
- package/skills/ae-agent/references/create-agent.md +71 -0
- package/skills/ae-agent/references/create-automation.md +99 -0
- package/skills/ae-agent/references/del-agent.md +38 -0
- package/skills/ae-agent/references/del-attachment.md +35 -0
- package/skills/ae-agent/references/del-mcp.md +35 -0
- package/skills/ae-agent/references/del-model.md +37 -0
- package/skills/ae-agent/references/del-skill-asset.md +41 -0
- package/skills/ae-agent/references/del-skill-reference.md +41 -0
- package/skills/ae-agent/references/del-skill-script.md +41 -0
- package/skills/ae-agent/references/del-skill.md +36 -0
- package/skills/ae-agent/references/edit-skill.md +64 -0
- package/skills/ae-agent/references/get-agent.md +37 -0
- package/skills/ae-agent/references/get-skill-content.md +36 -0
- package/skills/ae-agent/references/list-agents.md +40 -0
- package/skills/ae-agent/references/list-attachments.md +42 -0
- package/skills/ae-agent/references/list-automations.md +41 -0
- package/skills/ae-agent/references/list-mcp-credentials.md +65 -0
- package/skills/ae-agent/references/list-mcp-market.md +58 -0
- package/skills/ae-agent/references/list-mcps.md +37 -0
- package/skills/ae-agent/references/list-models.md +38 -0
- package/skills/ae-agent/references/list-skill-assets.md +35 -0
- package/skills/ae-agent/references/list-skill-market.md +59 -0
- package/skills/ae-agent/references/list-skill-references.md +36 -0
- package/skills/ae-agent/references/list-skill-scripts.md +35 -0
- package/skills/ae-agent/references/list-skill-shares.md +49 -0
- package/skills/ae-agent/references/list-skill-submissions.md +45 -0
- package/skills/ae-agent/references/list-skills.md +37 -0
- package/skills/ae-agent/references/mcp-auth-disconnect.md +50 -0
- package/skills/ae-agent/references/mcp-auth-start.md +61 -0
- package/skills/ae-agent/references/mcp-auth-status.md +56 -0
- package/skills/ae-agent/references/mcp-stats.md +68 -0
- package/skills/ae-agent/references/mcp-token.md +63 -0
- package/skills/ae-agent/references/mcp-tools.md +55 -0
- package/skills/ae-agent/references/read-skill-asset.md +51 -0
- package/skills/ae-agent/references/read-skill-reference.md +50 -0
- package/skills/ae-agent/references/read-skill-script.md +51 -0
- package/skills/ae-agent/references/reject-skill-share.md +37 -0
- package/skills/ae-agent/references/reject-skill.md +42 -0
- package/skills/ae-agent/references/rescan-skills.md +44 -0
- package/skills/ae-agent/references/set-mcp-credential.md +67 -0
- package/skills/ae-agent/references/set-mcp-meta.md +52 -0
- package/skills/ae-agent/references/set-skill-meta.md +51 -0
- package/skills/ae-agent/references/share-skill.md +50 -0
- package/skills/ae-agent/references/submit-skill.md +51 -0
- package/skills/ae-agent/references/test-model.md +61 -0
- package/skills/ae-agent/references/toggle-mcp.md +39 -0
- package/skills/ae-agent/references/toggle-model.md +37 -0
- package/skills/ae-agent/references/toggle-skill.md +37 -0
- package/skills/ae-agent/references/update-agent.md +71 -0
- package/skills/ae-agent/references/update-automation.md +83 -0
- package/skills/ae-agent/references/update-mcp.md +79 -0
- package/skills/ae-agent/references/update-model.md +77 -0
- package/skills/ae-agent/references/upload-skill-asset.md +49 -0
- package/skills/ae-agent/references/upload-skill-reference.md +51 -0
- package/skills/ae-agent/references/upload-skill-script.md +49 -0
- package/skills/ae-agent/references/upload-skill.md +89 -0
- package/skills/ae-analysis/SKILL.md +53 -25
- package/skills/ae-analysis/references/analysis_gateway_assets.md +129 -0
- package/skills/ae-analysis/references/artifact_download.md +17 -0
- package/skills/ae-analysis/references/bi_panel_copy.md +15 -0
- package/skills/ae-analysis/references/bi_panel_create.md +15 -0
- package/skills/ae-analysis/references/bi_panel_delete.md +15 -0
- package/skills/ae-analysis/references/bi_panel_get.md +18 -0
- package/skills/ae-analysis/references/bi_panel_list.md +15 -0
- package/skills/ae-analysis/references/bi_panel_page_data_export.md +25 -0
- package/skills/ae-analysis/references/bi_panel_page_data_run.md +15 -0
- package/skills/ae-analysis/references/bi_panel_share.md +15 -0
- package/skills/ae-analysis/references/bi_panel_update.md +15 -0
- package/skills/ae-analysis/references/dashboard_abnormal_get.md +15 -0
- package/skills/ae-analysis/references/dashboard_copy.md +17 -0
- package/skills/ae-analysis/references/dashboard_create.md +15 -0
- package/skills/ae-analysis/references/dashboard_daily_report_send.md +17 -0
- package/skills/ae-analysis/references/dashboard_daily_report_update.md +17 -0
- package/skills/ae-analysis/references/dashboard_definition_export.md +33 -0
- package/skills/ae-analysis/references/dashboard_definition_import.md +15 -0
- package/skills/ae-analysis/references/dashboard_delete.md +15 -0
- package/skills/ae-analysis/references/dashboard_freeze.md +15 -0
- package/skills/ae-analysis/references/dashboard_get.md +15 -0
- package/skills/ae-analysis/references/dashboard_handover.md +15 -0
- package/skills/ae-analysis/references/dashboard_list.md +15 -0
- package/skills/ae-analysis/references/dashboard_report_data_export.md +25 -0
- package/skills/ae-analysis/references/dashboard_report_data_run.md +15 -0
- package/skills/ae-analysis/references/dashboard_share.md +15 -0
- package/skills/ae-analysis/references/dashboard_share_info.md +15 -0
- package/skills/ae-analysis/references/dashboard_task_status.md +15 -0
- package/skills/ae-analysis/references/dashboard_update.md +16 -0
- package/skills/ae-analysis/references/favorite_add.md +15 -0
- package/skills/ae-analysis/references/favorite_remove.md +15 -0
- package/skills/ae-analysis/references/folder_create.md +15 -0
- package/skills/ae-analysis/references/folder_delete.md +15 -0
- package/skills/ae-analysis/references/folder_members.md +15 -0
- package/skills/ae-analysis/references/folder_share.md +15 -0
- package/skills/ae-analysis/references/project_space_create.md +15 -0
- package/skills/ae-analysis/references/project_space_delete.md +15 -0
- package/skills/ae-analysis/references/project_space_get.md +18 -0
- package/skills/ae-analysis/references/project_space_list.md +15 -0
- package/skills/ae-analysis/references/project_space_members.md +15 -0
- package/skills/ae-analysis/references/project_space_share.md +15 -0
- package/skills/ae-analysis/references/public_link_create.md +15 -0
- package/skills/ae-analysis/references/public_link_delete.md +15 -0
- package/skills/ae-analysis/references/public_link_list.md +15 -0
- package/skills/ae-analysis/references/public_link_offline.md +15 -0
- package/skills/ae-analysis/references/public_link_update.md +15 -0
- package/skills/ae-analysis/references/query_cancel.md +15 -0
- package/skills/ae-analysis/references/run_inspect.md +22 -0
- package/skills/ae-dataops/references/dataops-flow-create.md +2 -2
- package/skills/ae-dataops/references/dataops-flow-monitor.md +3 -3
- package/skills/ae-dataops/references/dataops-integration.md +1 -0
- package/skills/ae-engage/references/flow-node-config-schema.md +32 -8
- package/skills/ae-engage/references/save-flow.md +65 -29
- package/skills/ae-engage/references/validate-flow-node-config.md +28 -10
- package/skills/ae-generate-tracking-plan/SKILL.md +9 -7
- package/skills/ae-metadata/references/metadata_data_table_csv_write.md +5 -3
- package/skills/ae-metadata/references/metadata_data_table_sql_write.md +5 -4
- package/skills/ae-metadata/references/metadata_property_dimension_table_create_and_bind_csv.md +5 -3
- package/dist/auth-I2G7OAU2.js +0 -19
- package/dist/chunk-FPE5LGVU.js +0 -105
- package/dist/cli-token-6AGEDJF4.js +0 -14
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PermissionError
|
|
3
|
+
} from "./chunk-NOO24N7W.js";
|
|
4
|
+
import {
|
|
5
|
+
clearCliToken,
|
|
6
|
+
getCliToken
|
|
7
|
+
} from "./chunk-2NDGFQHW.js";
|
|
8
|
+
import {
|
|
9
|
+
logger,
|
|
10
|
+
safeJsonParse
|
|
11
|
+
} from "./chunk-YCLVYFK7.js";
|
|
12
|
+
|
|
13
|
+
// src/core/capability-api.ts
|
|
14
|
+
import { readFile } from "fs/promises";
|
|
15
|
+
import { basename } from "path";
|
|
16
|
+
var CapabilityGatewayError = class extends Error {
|
|
17
|
+
constructor(message, code, httpStatus, hint) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.code = code;
|
|
20
|
+
this.httpStatus = httpStatus;
|
|
21
|
+
this.hint = hint;
|
|
22
|
+
this.name = "CapabilityGatewayError";
|
|
23
|
+
}
|
|
24
|
+
code;
|
|
25
|
+
httpStatus;
|
|
26
|
+
hint;
|
|
27
|
+
};
|
|
28
|
+
function buildCapabilityGatewayUrl(host, domain, pathAfterV1, queryParams = {}) {
|
|
29
|
+
const base = host.replace(/\/+$/, "");
|
|
30
|
+
const cleanDomain = domain.replace(/^\/+|\/+$/g, "");
|
|
31
|
+
const cleanPath = pathAfterV1.replace(/^\/+|\/+$/g, "");
|
|
32
|
+
const gatewayPrefix = cleanDomain === "" ? "/api/cli/v1" : `/api/cli/${cleanDomain}/v1`;
|
|
33
|
+
const url = new URL(`${base}${gatewayPrefix}/${cleanPath}`);
|
|
34
|
+
for (const [key, value] of Object.entries(queryParams)) {
|
|
35
|
+
if (value !== void 0 && value !== null) {
|
|
36
|
+
url.searchParams.set(key, String(value));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return url.toString();
|
|
40
|
+
}
|
|
41
|
+
async function permissionMessage(resp) {
|
|
42
|
+
const text = await resp.text().catch(() => "");
|
|
43
|
+
try {
|
|
44
|
+
const d = safeJsonParse(text);
|
|
45
|
+
const msg = d && (d.error?.message || (typeof d.error === "string" ? d.error : void 0) || d.message);
|
|
46
|
+
if (msg && typeof msg === "string") return msg;
|
|
47
|
+
} catch {
|
|
48
|
+
}
|
|
49
|
+
return "Permission denied for this resource (HTTP 403)";
|
|
50
|
+
}
|
|
51
|
+
function isInvalidCliTokenMessage(message) {
|
|
52
|
+
return /\byour token is invalid\b/i.test(message) || /\bcli[-_\s]?token\b.*\binvalid\b/i.test(message) || /\binvalid\b.*\bcli[-_\s]?token\b/i.test(message);
|
|
53
|
+
}
|
|
54
|
+
function parseCapabilityResponse(text) {
|
|
55
|
+
if (!text) return void 0;
|
|
56
|
+
try {
|
|
57
|
+
return safeJsonParse(text);
|
|
58
|
+
} catch {
|
|
59
|
+
return text;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function unwrapCapabilityEnvelope(body) {
|
|
63
|
+
if (body == null) {
|
|
64
|
+
throw new CapabilityGatewayError("Empty capability gateway response");
|
|
65
|
+
}
|
|
66
|
+
if (typeof body.ok === "boolean") {
|
|
67
|
+
if (body.ok) {
|
|
68
|
+
return body.data;
|
|
69
|
+
}
|
|
70
|
+
const err = body.error ?? {};
|
|
71
|
+
const code = nonEmptyString(err.code);
|
|
72
|
+
const message = nonEmptyString(err.message) ?? code ?? "Capability gateway request failed";
|
|
73
|
+
const hint = nonEmptyString(err.hint);
|
|
74
|
+
throw new CapabilityGatewayError(message, code, err.http_status ?? err.httpStatus, hint);
|
|
75
|
+
}
|
|
76
|
+
return body;
|
|
77
|
+
}
|
|
78
|
+
function nonEmptyString(value) {
|
|
79
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
80
|
+
}
|
|
81
|
+
function buildCapabilityHttpError(resp, body) {
|
|
82
|
+
const fallback = `Capability gateway HTTP error: ${resp.status} ${resp.statusText}`.trim();
|
|
83
|
+
if (body && typeof body === "object") {
|
|
84
|
+
const err = body.error ?? body.data?.error ?? body;
|
|
85
|
+
const code = nonEmptyString(err.code) ?? nonEmptyString(err.errorCode) ?? nonEmptyString(body.code);
|
|
86
|
+
const message = nonEmptyString(err.message) ?? nonEmptyString(body.message);
|
|
87
|
+
const hint = nonEmptyString(err.hint) ?? nonEmptyString(body.hint);
|
|
88
|
+
const details = [code, message, hint ? `Hint: ${hint}` : void 0].filter(Boolean);
|
|
89
|
+
if (details.length > 0) {
|
|
90
|
+
return new CapabilityGatewayError(message ?? fallback, code, resp.status, hint);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (typeof body === "string" && body.trim()) {
|
|
94
|
+
return new CapabilityGatewayError(`${fallback}: ${body.slice(0, 500)}`, void 0, resp.status);
|
|
95
|
+
}
|
|
96
|
+
return new CapabilityGatewayError(fallback, void 0, resp.status);
|
|
97
|
+
}
|
|
98
|
+
async function throwCapabilityHttpError(resp) {
|
|
99
|
+
const body = parseCapabilityResponse(await resp.text());
|
|
100
|
+
throw buildCapabilityHttpError(resp, body);
|
|
101
|
+
}
|
|
102
|
+
async function requestOnce(url, method, token, body) {
|
|
103
|
+
const headers = {
|
|
104
|
+
"cli-token": token,
|
|
105
|
+
"Accept": "application/json",
|
|
106
|
+
"X-Source": "ae-cli"
|
|
107
|
+
};
|
|
108
|
+
const init = { method, headers };
|
|
109
|
+
if (body !== void 0 && method !== "GET") {
|
|
110
|
+
headers["Content-Type"] = "application/json";
|
|
111
|
+
init.body = JSON.stringify(body);
|
|
112
|
+
}
|
|
113
|
+
return fetch(url, init);
|
|
114
|
+
}
|
|
115
|
+
async function requestMultipartOnce(url, token, form) {
|
|
116
|
+
return fetch(url, {
|
|
117
|
+
method: "POST",
|
|
118
|
+
headers: {
|
|
119
|
+
"cli-token": token,
|
|
120
|
+
"Accept": "application/json",
|
|
121
|
+
"X-Source": "ae-cli"
|
|
122
|
+
},
|
|
123
|
+
body: form
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
async function requestDownloadOnce(url, token) {
|
|
127
|
+
return fetch(url, {
|
|
128
|
+
method: "GET",
|
|
129
|
+
headers: {
|
|
130
|
+
"cli-token": token,
|
|
131
|
+
"Accept": "*/*",
|
|
132
|
+
"X-Source": "ae-cli"
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
async function callGateway(host, domain, pathAfterV1, method, body) {
|
|
137
|
+
const url = buildCapabilityGatewayUrl(host, domain, pathAfterV1);
|
|
138
|
+
const token = await getCliToken(host);
|
|
139
|
+
let resp = await requestOnce(url, method, token, body);
|
|
140
|
+
let permissionMsg;
|
|
141
|
+
if (resp.status === 403) {
|
|
142
|
+
permissionMsg = await permissionMessage(resp);
|
|
143
|
+
if (!isInvalidCliTokenMessage(permissionMsg)) {
|
|
144
|
+
throw new PermissionError(permissionMsg);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (resp.status === 401 || resp.status === 403 && permissionMsg) {
|
|
148
|
+
logger.warn(`Capability gateway request failed (${resp.status === 403 ? permissionMsg : "HTTP 401"}) for ${host}, refreshing CLI token`);
|
|
149
|
+
clearCliToken(host);
|
|
150
|
+
const newToken = await getCliToken(host);
|
|
151
|
+
process.stderr.write(`[ae-cli] CLI token refreshed for ${host}
|
|
152
|
+
`);
|
|
153
|
+
resp = await requestOnce(url, method, newToken, body);
|
|
154
|
+
if (resp.status === 403) {
|
|
155
|
+
throw new PermissionError(await permissionMessage(resp));
|
|
156
|
+
}
|
|
157
|
+
if (!resp.ok) {
|
|
158
|
+
await throwCapabilityHttpError(resp);
|
|
159
|
+
}
|
|
160
|
+
} else if (!resp.ok) {
|
|
161
|
+
await throwCapabilityHttpError(resp);
|
|
162
|
+
}
|
|
163
|
+
return unwrapCapabilityEnvelope(parseCapabilityResponse(await resp.text()));
|
|
164
|
+
}
|
|
165
|
+
async function executeCapability(host, domain, capabilityId, input = {}) {
|
|
166
|
+
return callGateway(host, domain, `capabilities/${capabilityId}/execute`, "POST", { input });
|
|
167
|
+
}
|
|
168
|
+
async function uploadInputFile(host, domain, projectId, purpose, filePath) {
|
|
169
|
+
const fileBytes = await readFile(filePath);
|
|
170
|
+
return uploadInputFileBytes(host, domain, projectId, purpose, fileBytes, basename(filePath));
|
|
171
|
+
}
|
|
172
|
+
async function uploadInputFileBytes(host, domain, projectId, purpose, bytes, filename, contentType = "application/octet-stream") {
|
|
173
|
+
const url = buildCapabilityGatewayUrl(host, domain, "input-files");
|
|
174
|
+
const fileBuffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer.slice(
|
|
175
|
+
bytes.byteOffset,
|
|
176
|
+
bytes.byteOffset + bytes.byteLength
|
|
177
|
+
);
|
|
178
|
+
const form = new FormData();
|
|
179
|
+
form.append("project_id", String(projectId));
|
|
180
|
+
form.append("purpose", purpose);
|
|
181
|
+
form.append("file", new Blob([fileBuffer], { type: contentType }), filename);
|
|
182
|
+
const token = await getCliToken(host);
|
|
183
|
+
let resp = await requestMultipartOnce(url, token, form);
|
|
184
|
+
if (resp.status === 403) {
|
|
185
|
+
throw new PermissionError(await permissionMessage(resp));
|
|
186
|
+
}
|
|
187
|
+
if (resp.status === 401) {
|
|
188
|
+
logger.warn(`Capability gateway request failed (HTTP 401) for ${host}, refreshing CLI token`);
|
|
189
|
+
clearCliToken(host);
|
|
190
|
+
const newToken = await getCliToken(host);
|
|
191
|
+
process.stderr.write(`[ae-cli] CLI token refreshed for ${host}
|
|
192
|
+
`);
|
|
193
|
+
resp = await requestMultipartOnce(url, newToken, form);
|
|
194
|
+
if (resp.status === 403) {
|
|
195
|
+
throw new PermissionError(await permissionMessage(resp));
|
|
196
|
+
}
|
|
197
|
+
if (!resp.ok) {
|
|
198
|
+
await throwCapabilityHttpError(resp);
|
|
199
|
+
}
|
|
200
|
+
} else if (!resp.ok) {
|
|
201
|
+
await throwCapabilityHttpError(resp);
|
|
202
|
+
}
|
|
203
|
+
return unwrapCapabilityEnvelope(parseCapabilityResponse(await resp.text()));
|
|
204
|
+
}
|
|
205
|
+
async function downloadCapabilityArtifact(host, domain, runId, artifactId) {
|
|
206
|
+
const url = buildCapabilityGatewayUrl(
|
|
207
|
+
host,
|
|
208
|
+
domain,
|
|
209
|
+
`runs/${encodeURIComponent(runId)}/artifacts/${encodeURIComponent(artifactId)}/download`
|
|
210
|
+
);
|
|
211
|
+
const token = await getCliToken(host);
|
|
212
|
+
let resp = await requestDownloadOnce(url, token);
|
|
213
|
+
if (resp.status === 403) {
|
|
214
|
+
throw new PermissionError(await permissionMessage(resp));
|
|
215
|
+
}
|
|
216
|
+
if (resp.status === 401) {
|
|
217
|
+
logger.warn(`Capability gateway artifact download failed (HTTP 401) for ${host}, refreshing CLI token`);
|
|
218
|
+
clearCliToken(host);
|
|
219
|
+
const newToken = await getCliToken(host);
|
|
220
|
+
process.stderr.write(`[ae-cli] CLI token refreshed for ${host}
|
|
221
|
+
`);
|
|
222
|
+
resp = await requestDownloadOnce(url, newToken);
|
|
223
|
+
if (resp.status === 403) {
|
|
224
|
+
throw new PermissionError(await permissionMessage(resp));
|
|
225
|
+
}
|
|
226
|
+
if (!resp.ok) {
|
|
227
|
+
await throwCapabilityHttpError(resp);
|
|
228
|
+
}
|
|
229
|
+
} else if (!resp.ok) {
|
|
230
|
+
await throwCapabilityHttpError(resp);
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
bytes: Buffer.from(await resp.arrayBuffer()),
|
|
234
|
+
contentType: resp.headers.get("content-type") ?? void 0,
|
|
235
|
+
contentDisposition: resp.headers.get("content-disposition") ?? void 0
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
async function callCapabilityApi(host, domain, action, method = "POST", params = {}) {
|
|
239
|
+
const isGet = method === "GET";
|
|
240
|
+
if (isGet) {
|
|
241
|
+
return callGateway(host, domain, action.replace(/^\/+|\/+$/g, ""), "GET");
|
|
242
|
+
}
|
|
243
|
+
return callGateway(host, domain, action.replace(/^\/+|\/+$/g, ""), method, params);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export {
|
|
247
|
+
CapabilityGatewayError,
|
|
248
|
+
buildCapabilityGatewayUrl,
|
|
249
|
+
executeCapability,
|
|
250
|
+
uploadInputFile,
|
|
251
|
+
uploadInputFileBytes,
|
|
252
|
+
downloadCapabilityArtifact,
|
|
253
|
+
callCapabilityApi
|
|
254
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildCapabilityGatewayUrl,
|
|
3
|
+
executeCapability
|
|
4
|
+
} from "./chunk-BXMXMUD7.js";
|
|
5
|
+
|
|
6
|
+
// src/core/capability-routing.ts
|
|
7
|
+
var cliServiceRoutes = /* @__PURE__ */ new Map();
|
|
8
|
+
function registerCapabilityGatewayRoute(cliService, route) {
|
|
9
|
+
cliServiceRoutes.set(cliService, route);
|
|
10
|
+
}
|
|
11
|
+
function resolveGatewayDomain(cliService, override) {
|
|
12
|
+
if (override !== void 0) {
|
|
13
|
+
return override;
|
|
14
|
+
}
|
|
15
|
+
const route = cliServiceRoutes.get(cliService);
|
|
16
|
+
if (!route) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
`Capability gateway route not registered for CLI service '${cliService}'. Call registerCapabilityGatewayRoute() in commands/${cliService}/index.ts.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return route.gatewayDomain;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/core/capability-command.ts
|
|
25
|
+
function createCapabilityCommand(config) {
|
|
26
|
+
return {
|
|
27
|
+
service: config.cliService,
|
|
28
|
+
resource: config.resource,
|
|
29
|
+
command: config.command,
|
|
30
|
+
description: config.description,
|
|
31
|
+
flags: config.flags,
|
|
32
|
+
risk: config.risk,
|
|
33
|
+
validate: config.validate,
|
|
34
|
+
dryRun: (ctx) => {
|
|
35
|
+
const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
|
|
36
|
+
const input = config.buildInput(ctx);
|
|
37
|
+
return {
|
|
38
|
+
method: "POST",
|
|
39
|
+
url: buildCapabilityGatewayUrl(
|
|
40
|
+
ctx.host(),
|
|
41
|
+
gatewayDomain,
|
|
42
|
+
`capabilities/${config.capabilityId}/dry-run`
|
|
43
|
+
),
|
|
44
|
+
body: { input }
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
execute: async (ctx) => {
|
|
48
|
+
const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
|
|
49
|
+
const input = config.buildInput(ctx);
|
|
50
|
+
return executeCapability(ctx.host(), gatewayDomain, config.capabilityId, input);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
registerCapabilityGatewayRoute,
|
|
57
|
+
resolveGatewayDomain,
|
|
58
|
+
createCapabilityCommand
|
|
59
|
+
};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getAnalysisMappingPathForClusterMode
|
|
3
|
+
} from "./chunk-KGJQCYVC.js";
|
|
4
|
+
import {
|
|
5
|
+
PermissionError
|
|
6
|
+
} from "./chunk-NOO24N7W.js";
|
|
7
|
+
import {
|
|
8
|
+
clearCliToken,
|
|
9
|
+
getCliToken
|
|
10
|
+
} from "./chunk-2NDGFQHW.js";
|
|
11
|
+
import {
|
|
12
|
+
getActiveHost,
|
|
13
|
+
logger,
|
|
14
|
+
safeJsonParse
|
|
15
|
+
} from "./chunk-YCLVYFK7.js";
|
|
16
|
+
|
|
17
|
+
// src/core/mcp.ts
|
|
18
|
+
async function permissionMessage(resp) {
|
|
19
|
+
const text = await resp.text().catch(() => "");
|
|
20
|
+
try {
|
|
21
|
+
const d = safeJsonParse(text);
|
|
22
|
+
const msg = d && (d.error?.message || (typeof d.error === "string" ? d.error : void 0) || d.message);
|
|
23
|
+
if (msg && typeof msg === "string") return msg;
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
return "Permission denied for this resource (HTTP 403)";
|
|
27
|
+
}
|
|
28
|
+
function isInvalidCliTokenMessage(message) {
|
|
29
|
+
return /\b(cli[-_\s]?token|token)\b.*\binvalid\b/i.test(message) || /\binvalid\b.*\b(cli[-_\s]?token|token)\b/i.test(message);
|
|
30
|
+
}
|
|
31
|
+
var MCP_PROTOCOL_VERSION = "2025-11-25";
|
|
32
|
+
var JSONRPC_VERSION = "2.0";
|
|
33
|
+
var serviceMappingMap = /* @__PURE__ */ new Map();
|
|
34
|
+
registerMcpMapping("analysis", {
|
|
35
|
+
componentName: "analysis",
|
|
36
|
+
mappingPath: "analysis"
|
|
37
|
+
});
|
|
38
|
+
registerMcpMapping("te_analysis_extend", {
|
|
39
|
+
componentName: "analysis",
|
|
40
|
+
mappingPath: "analysis-extend"
|
|
41
|
+
});
|
|
42
|
+
function registerMcpMapping(serviceName, mapping) {
|
|
43
|
+
serviceMappingMap.set(serviceName, mapping);
|
|
44
|
+
}
|
|
45
|
+
function registerMcpMappings(mappings) {
|
|
46
|
+
for (const [serviceName, mapping] of Object.entries(mappings)) {
|
|
47
|
+
serviceMappingMap.set(serviceName, mapping);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function getMcpMapping(serviceName) {
|
|
51
|
+
const mapping = serviceMappingMap.get(serviceName);
|
|
52
|
+
if (!mapping) {
|
|
53
|
+
throw new Error(`MCP mapping not found for service: '${serviceName}'. Please register it using registerMcpMapping() first.`);
|
|
54
|
+
}
|
|
55
|
+
if (serviceName === "analysis") {
|
|
56
|
+
return { ...mapping, mappingPath: getAnalysisMappingPathForClusterMode() };
|
|
57
|
+
}
|
|
58
|
+
return mapping;
|
|
59
|
+
}
|
|
60
|
+
function buildMcpUrl(host, serviceName) {
|
|
61
|
+
const mapping = getMcpMapping(serviceName);
|
|
62
|
+
const base = host.replace(/\/+$/, "");
|
|
63
|
+
return `${base}/mcp/${mapping.componentName}/http/${mapping.mappingPath}`;
|
|
64
|
+
}
|
|
65
|
+
function resolveMcpUrl(mcpUrlOverride, host, serviceName) {
|
|
66
|
+
if (mcpUrlOverride) {
|
|
67
|
+
return mcpUrlOverride;
|
|
68
|
+
}
|
|
69
|
+
return buildMcpUrl(host, serviceName);
|
|
70
|
+
}
|
|
71
|
+
var requestIdCounter = 1;
|
|
72
|
+
function genRequestId() {
|
|
73
|
+
return requestIdCounter++;
|
|
74
|
+
}
|
|
75
|
+
function buildAuthHeaders(cliToken) {
|
|
76
|
+
return {
|
|
77
|
+
"cli-token": cliToken
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async function mcpRequest(url, method, params = {}, hostOverride) {
|
|
81
|
+
const hostUrl = hostOverride || getActiveHost();
|
|
82
|
+
const token = await getCliToken(hostUrl);
|
|
83
|
+
const requestId = genRequestId();
|
|
84
|
+
const paramsWithMeta = {
|
|
85
|
+
...params,
|
|
86
|
+
_meta: { progressToken: requestId }
|
|
87
|
+
};
|
|
88
|
+
const body = {
|
|
89
|
+
jsonrpc: JSONRPC_VERSION,
|
|
90
|
+
id: requestId,
|
|
91
|
+
method,
|
|
92
|
+
params: paramsWithMeta
|
|
93
|
+
};
|
|
94
|
+
const headers = {
|
|
95
|
+
"Content-Type": "application/json",
|
|
96
|
+
"Accept": "application/json, text/event-stream",
|
|
97
|
+
"mcp-protocol-version": MCP_PROTOCOL_VERSION,
|
|
98
|
+
"X-Source": "ae-cli",
|
|
99
|
+
...buildAuthHeaders(token)
|
|
100
|
+
};
|
|
101
|
+
const resp = await fetch(url, {
|
|
102
|
+
method: "POST",
|
|
103
|
+
headers,
|
|
104
|
+
body: JSON.stringify(body)
|
|
105
|
+
});
|
|
106
|
+
if (!resp.ok) {
|
|
107
|
+
let permissionMsg;
|
|
108
|
+
if (resp.status === 403) {
|
|
109
|
+
permissionMsg = await permissionMessage(resp);
|
|
110
|
+
if (!isInvalidCliTokenMessage(permissionMsg)) {
|
|
111
|
+
throw new PermissionError(permissionMsg);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (resp.status === 401 || resp.status === 403 && permissionMsg) {
|
|
115
|
+
logger.warn(`MCP request failed (${resp.status === 403 ? permissionMsg : "HTTP 401"}) for ${hostUrl}, refreshing CLI token`);
|
|
116
|
+
clearCliToken(hostUrl);
|
|
117
|
+
const newToken = await getCliToken(hostUrl);
|
|
118
|
+
logger.info(`CLI token refreshed for ${hostUrl}`);
|
|
119
|
+
process.stderr.write(`[ae-cli] CLI token refreshed for ${hostUrl}
|
|
120
|
+
`);
|
|
121
|
+
Object.assign(headers, buildAuthHeaders(newToken));
|
|
122
|
+
const retryResp = await fetch(url, {
|
|
123
|
+
method: "POST",
|
|
124
|
+
headers,
|
|
125
|
+
body: JSON.stringify(body)
|
|
126
|
+
});
|
|
127
|
+
if (retryResp.status === 403) {
|
|
128
|
+
throw new PermissionError(await permissionMessage(retryResp));
|
|
129
|
+
}
|
|
130
|
+
if (!retryResp.ok) {
|
|
131
|
+
throw new Error(`MCP HTTP error: ${retryResp.status} ${retryResp.statusText}`);
|
|
132
|
+
}
|
|
133
|
+
const retryData = safeJsonParse(await retryResp.text());
|
|
134
|
+
if (retryData.error) {
|
|
135
|
+
throw new Error(`MCP error: ${retryData.error.message || JSON.stringify(retryData.error)}`);
|
|
136
|
+
}
|
|
137
|
+
return retryData.result;
|
|
138
|
+
}
|
|
139
|
+
throw new Error(`MCP HTTP error: ${resp.status} ${resp.statusText}`);
|
|
140
|
+
}
|
|
141
|
+
const data = safeJsonParse(await resp.text());
|
|
142
|
+
if (data.error) {
|
|
143
|
+
throw new Error(`MCP error: ${data.error.message || JSON.stringify(data.error)}`);
|
|
144
|
+
}
|
|
145
|
+
return data.result;
|
|
146
|
+
}
|
|
147
|
+
async function callMcpTool(url, toolName, args = {}, hostOverride) {
|
|
148
|
+
const params = {
|
|
149
|
+
name: toolName,
|
|
150
|
+
arguments: args
|
|
151
|
+
};
|
|
152
|
+
logger.info(`MCP tool call: ${toolName}`);
|
|
153
|
+
const result = await mcpRequest(url, "tools/call", params, hostOverride);
|
|
154
|
+
if (result.isError) {
|
|
155
|
+
logger.warn(`MCP tool call failed: ${toolName}`);
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
content: result.content.map((item) => {
|
|
159
|
+
if (item.type === "text") {
|
|
160
|
+
return { type: "text", text: item.text };
|
|
161
|
+
} else if (item.type === "image") {
|
|
162
|
+
return { type: "image", data: item.data, mimeType: item.mimeType };
|
|
163
|
+
} else {
|
|
164
|
+
return { type: "resource", ...item };
|
|
165
|
+
}
|
|
166
|
+
}),
|
|
167
|
+
isError: result.isError
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function parseMcpResult(result) {
|
|
171
|
+
if (result.content.length > 0 && result.content[0].type === "text") {
|
|
172
|
+
const text = result.content[0].text || "";
|
|
173
|
+
let parsed;
|
|
174
|
+
try {
|
|
175
|
+
parsed = safeJsonParse(text);
|
|
176
|
+
} catch {
|
|
177
|
+
return text;
|
|
178
|
+
}
|
|
179
|
+
const errMsg = mcpResultErrorMessage(parsed);
|
|
180
|
+
if (errMsg !== null) {
|
|
181
|
+
if (/no_auth|auth_error|permission|forbidden|unauthor|\u65e0\u6743/i.test(errMsg)) {
|
|
182
|
+
throw new PermissionError(errMsg);
|
|
183
|
+
}
|
|
184
|
+
throw new Error(errMsg);
|
|
185
|
+
}
|
|
186
|
+
return parsed;
|
|
187
|
+
}
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
function mcpResultErrorMessage(parsed) {
|
|
191
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
192
|
+
if (parsed.success === true || parsed.ok === true) return null;
|
|
193
|
+
const e = parsed.error;
|
|
194
|
+
if (typeof e === "string" && e.trim()) return e;
|
|
195
|
+
if (e && typeof e === "object") {
|
|
196
|
+
const msg = typeof e.message === "string" && e.message || void 0;
|
|
197
|
+
const code = typeof e.code === "string" && e.code || void 0;
|
|
198
|
+
if (msg && code) return `${code}: ${msg}`;
|
|
199
|
+
if (msg || code) return msg || code;
|
|
200
|
+
}
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export {
|
|
205
|
+
registerMcpMappings,
|
|
206
|
+
resolveMcpUrl,
|
|
207
|
+
callMcpTool,
|
|
208
|
+
parseMcpResult
|
|
209
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SecureStoreAuthError,
|
|
3
|
-
clearToken,
|
|
4
3
|
getToken,
|
|
4
|
+
invalidateAccessTokenForRetry,
|
|
5
5
|
resolveHost
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AJTH7LT3.js";
|
|
7
7
|
import {
|
|
8
8
|
logger,
|
|
9
9
|
safeJsonParse
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YCLVYFK7.js";
|
|
11
11
|
|
|
12
12
|
// src/core/client.ts
|
|
13
13
|
import WebSocket from "ws";
|
|
@@ -46,7 +46,7 @@ async function request(method, modulePath, params = {}, body = null, retry = tru
|
|
|
46
46
|
logger.api(method, url, resp.status, body, data);
|
|
47
47
|
if (resp.status === 401) {
|
|
48
48
|
if (retry) {
|
|
49
|
-
|
|
49
|
+
invalidateAccessTokenForRetry(resolvedHost);
|
|
50
50
|
return request(method, modulePath, params, body, false, resolvedHost);
|
|
51
51
|
}
|
|
52
52
|
throw new SecureStoreAuthError(`Session expired or unauthorized for ${resolvedHost}. Please run: ae-cli auth login`);
|
|
@@ -56,7 +56,7 @@ async function request(method, modulePath, params = {}, body = null, retry = tru
|
|
|
56
56
|
throw new Error(m);
|
|
57
57
|
}
|
|
58
58
|
if (data.return_code === -1001 && retry) {
|
|
59
|
-
|
|
59
|
+
invalidateAccessTokenForRetry(resolvedHost);
|
|
60
60
|
return request(method, modulePath, params, body, false, resolvedHost);
|
|
61
61
|
}
|
|
62
62
|
if (data.return_code !== 0 && data.return_code !== void 0) {
|
|
@@ -89,7 +89,7 @@ async function uploadRequest(modulePath, form, params = {}, retry = true, hostUr
|
|
|
89
89
|
logger.api("POST", url, resp.status, { upload: true }, data);
|
|
90
90
|
if (resp.status === 401) {
|
|
91
91
|
if (retry) {
|
|
92
|
-
|
|
92
|
+
invalidateAccessTokenForRetry(resolvedHost);
|
|
93
93
|
return uploadRequest(modulePath, form, params, false, resolvedHost);
|
|
94
94
|
}
|
|
95
95
|
throw new SecureStoreAuthError(`Session expired or unauthorized for ${resolvedHost}. Please run: ae-cli auth login`);
|
|
@@ -99,7 +99,7 @@ async function uploadRequest(modulePath, form, params = {}, retry = true, hostUr
|
|
|
99
99
|
throw new Error(m);
|
|
100
100
|
}
|
|
101
101
|
if (data.return_code === -1001 && retry) {
|
|
102
|
-
|
|
102
|
+
invalidateAccessTokenForRetry(resolvedHost);
|
|
103
103
|
return uploadRequest(modulePath, form, params, false, resolvedHost);
|
|
104
104
|
}
|
|
105
105
|
if (data.return_code !== 0 && data.return_code !== void 0) {
|
|
@@ -162,7 +162,7 @@ async function wsQuery(projectId, requestId, qp, eventModel, options = {}, hostU
|
|
|
162
162
|
} catch (err) {
|
|
163
163
|
const msg = err.message || "";
|
|
164
164
|
if (msg.includes("401") || msg.includes("403") || msg.includes("auth")) {
|
|
165
|
-
|
|
165
|
+
invalidateAccessTokenForRetry(resolvedHost);
|
|
166
166
|
const newToken = await getToken(resolvedHost);
|
|
167
167
|
return wsQueryOnce(projectId, requestId, qp, eventModel, options, newToken, resolvedHost);
|
|
168
168
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildCapabilityGatewayUrl,
|
|
3
|
+
executeCapability
|
|
4
|
+
} from "./chunk-YNQFYBDB.js";
|
|
5
|
+
|
|
6
|
+
// src/core/capability-routing.ts
|
|
7
|
+
var cliServiceRoutes = /* @__PURE__ */ new Map();
|
|
8
|
+
function registerCapabilityGatewayRoute(cliService, route) {
|
|
9
|
+
cliServiceRoutes.set(cliService, route);
|
|
10
|
+
}
|
|
11
|
+
function resolveGatewayDomain(cliService, override) {
|
|
12
|
+
if (override !== void 0) {
|
|
13
|
+
return override;
|
|
14
|
+
}
|
|
15
|
+
const route = cliServiceRoutes.get(cliService);
|
|
16
|
+
if (!route) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
`Capability gateway route not registered for CLI service '${cliService}'. Call registerCapabilityGatewayRoute() in commands/${cliService}/index.ts.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return route.gatewayDomain;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/core/capability-command.ts
|
|
25
|
+
function createCapabilityCommand(config) {
|
|
26
|
+
return {
|
|
27
|
+
service: config.cliService,
|
|
28
|
+
resource: config.resource,
|
|
29
|
+
command: config.command,
|
|
30
|
+
description: config.description,
|
|
31
|
+
flags: config.flags,
|
|
32
|
+
risk: config.risk,
|
|
33
|
+
validate: config.validate,
|
|
34
|
+
dryRun: (ctx) => {
|
|
35
|
+
const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
|
|
36
|
+
const input = config.buildInput(ctx);
|
|
37
|
+
return {
|
|
38
|
+
method: "POST",
|
|
39
|
+
url: buildCapabilityGatewayUrl(
|
|
40
|
+
ctx.host(),
|
|
41
|
+
gatewayDomain,
|
|
42
|
+
`capabilities/${config.capabilityId}/dry-run`
|
|
43
|
+
),
|
|
44
|
+
body: { input }
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
execute: async (ctx) => {
|
|
48
|
+
const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
|
|
49
|
+
const input = config.buildInput(ctx);
|
|
50
|
+
return executeCapability(ctx.host(), gatewayDomain, config.capabilityId, input);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
registerCapabilityGatewayRoute,
|
|
57
|
+
resolveGatewayDomain,
|
|
58
|
+
createCapabilityCommand
|
|
59
|
+
};
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-NOO24N7W.js";
|
|
4
4
|
import {
|
|
5
5
|
getCliToken
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2NDGFQHW.js";
|
|
7
7
|
import {
|
|
8
8
|
safeJsonParse
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YCLVYFK7.js";
|
|
10
10
|
|
|
11
11
|
// src/core/mcp-access.ts
|
|
12
12
|
function buildUrl(host, path, params = {}) {
|