@thinkingai/ae-cli 6.0.53 → 6.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -9
- package/README.zh.md +25 -9
- package/bin/ae-cli.js +6 -1
- package/cli-installation-guide.md +91 -0
- package/dist/{auth-LHM7NQPR.js → auth-RQBO6MTY.js} +9 -11
- package/dist/automation-VAAQBM7Y.js +459 -0
- package/dist/{capability-F2RIR5DS.js → capability-JRIFC4AJ.js} +6 -6
- package/dist/{chunk-647BRKZK.js → chunk-374V5R6N.js} +3 -3
- package/dist/{chunk-KJDOTPYU.js → chunk-3YVEAZUN.js} +59 -26
- package/dist/{chunk-KS4DE3MX.js → chunk-5XJYLEVC.js} +4 -4
- package/dist/{chunk-BW7JUDEI.js → chunk-6VNIR4AP.js} +514 -213
- package/dist/{chunk-5XRQ3CZR.js → chunk-7KU2WNQE.js} +43 -8
- package/dist/{chunk-7WZACOAI.js → chunk-AP7YP2NX.js} +2 -2
- package/dist/chunk-CI24BDR2.js +43 -0
- package/dist/{chunk-SO5LKIWP.js → chunk-CT7QDJS6.js} +2 -2
- package/dist/{chunk-DU72X2IO.js → chunk-GHXZK54S.js} +22 -10
- package/dist/{chunk-N4BLPJC7.js → chunk-OP44TT4H.js} +1 -1
- package/dist/chunk-Q5US7JC5.js +133 -0
- package/dist/{chunk-PGCIKZRE.js → chunk-RGYPSEYD.js} +3 -3
- package/dist/chunk-RK6GLDGI.js +27 -0
- package/dist/chunk-RPBOAQQQ.js +56 -0
- package/dist/{chunk-GK7WDY7E.js → chunk-S6M42KND.js} +1 -1
- package/dist/{chunk-QYXDJOLA.js → chunk-VZZNLV3I.js} +19 -11
- package/dist/{chunk-YVGXGTD6.js → chunk-WNGFSIOB.js} +7 -1
- package/dist/{chunk-IG3DYEIR.js → chunk-ZL7SGNIA.js} +5 -3
- package/dist/{community-report-client-6VJDDMJJ.js → community-report-client-PEERQCX2.js} +1 -1
- package/dist/{config-XQWOPDHN.js → config-SICKWZ2A.js} +8 -8
- package/dist/context-NGVFPCBK.js +136 -0
- package/dist/{data-integration-XBTCGXQT.js → data-integration-BCLQFTGU.js} +6 -6
- package/dist/index.js +125 -48
- package/dist/{local-data-upload-client-3P7NIVQ4.js → local-data-upload-client-TWMHFLUA.js} +1 -1
- package/dist/memory-CQKH2JAV.js +580 -0
- package/dist/{metadata-V5ZDTKWZ.js → metadata-EMFGUI2W.js} +7 -7
- package/dist/{model-ZS7HVGKN.js → model-VX5M2CJ6.js} +9 -5
- package/dist/{personal-semantic-preference-2XANU3F6.js → personal-semantic-preference-SLWVVYZ4.js} +117 -11
- package/dist/{project-semantic-LP3LY7QP.js → project-semantic-DPSZBKQD.js} +6 -6
- package/dist/{sync-EQLSTUS7.js → sync-RZIAV37C.js} +12 -8
- package/dist/{te-agent-Z3HCTKR7.js → te-agent-AORRE2FM.js} +90 -454
- package/dist/{te-analysis-3EVYQ3IO.js → te-analysis-ISXKJKRT.js} +297 -20
- package/dist/{te-community-Z7JACGF3.js → te-community-42M7ICDO.js} +3 -3
- package/dist/{te-dataops-F7GQOIS6.js → te-dataops-BNKNZ4F2.js} +5 -5
- package/dist/{te-engage-LFBU6WWH.js → te-engage-BZE3MBKT.js} +6 -6
- package/dist/{te-kb-QJLJEX5K.js → te-kb-ULATOTQ3.js} +494 -214
- package/dist/{te-system-IXC43QHZ.js → te-system-UGHVKBVV.js} +10 -9
- package/dist/{te-team-BIZIKIHZ.js → te-team-YA6SNOJ3.js} +6 -6
- package/dist/things-DTCOQIQB.js +1091 -0
- package/dist/{update-W2SGQNKT.js → update-ESNYKUVR.js} +59 -51
- package/dist/workspace-JEOHKFPX.js +554 -0
- package/package.json +21 -9
- package/skills/ae-agent/SKILL.md +91 -139
- package/skills/ae-agent/references/add-model.md +1 -1
- package/skills/ae-agent/references/create-agent.md +1 -1
- package/skills/ae-agent/references/find-archived-conversations.md +12 -5
- package/skills/ae-agent/references/get-agent.md +1 -1
- package/skills/ae-agent/references/list-agents.md +2 -2
- package/skills/ae-agent/references/list-models.md +2 -2
- package/skills/ae-agent/references/restore-conversation.md +3 -1
- package/skills/ae-analysis/SKILL.md +15 -6
- package/skills/ae-analysis/references/ai_models/funnel.md +5 -3
- package/skills/ae-analysis/references/ai_models.md +27 -0
- package/skills/ae-analysis/references/command_index.md +12 -4
- package/skills/ae-analysis/references/dashboard_move.md +21 -0
- package/skills/ae-analysis/references/dashboard_report_add.md +2 -0
- package/skills/ae-analysis/references/dashboard_report_get.md +19 -0
- package/skills/ae-analysis/references/dashboard_report_update.md +27 -0
- package/skills/ae-analysis/references/dashboard_update.md +1 -1
- package/skills/ae-analysis/references/event_report_presentation.md +76 -0
- package/skills/ae-analysis/references/feedback_submit.md +37 -0
- package/skills/ae-analysis/references/metadata_resolution.md +15 -0
- package/skills/ae-analysis/references/personal_semantic_preference_review.md +9 -0
- package/skills/ae-analysis/references/personal_semantic_preference_review_list.md +7 -0
- package/skills/ae-analysis/references/personal_semantic_preference_submit.md +7 -0
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +90 -31
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +99 -1
- package/skills/ae-analysis/references/report_create.md +13 -3
- package/skills/ae-analysis/references/report_get.md +5 -1
- package/skills/ae-analysis/references/report_update.md +15 -4
- package/skills/ae-analysis/references/system_query_monitor_overview.md +2 -0
- package/skills/ae-analysis/references/system_query_task_cancel.md +2 -0
- package/skills/ae-analysis/references/system_query_task_export.md +6 -2
- package/skills/ae-analysis/references/system_query_task_get.md +2 -0
- package/skills/ae-analysis/references/system_query_task_list.md +7 -3
- package/skills/ae-analysis/references/system_query_task_options.md +2 -2
- package/skills/ae-analysis/references/system_query_task_realtime_list.md +15 -0
- package/skills/ae-analysis/references/user_tag_models.md +2 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-empty-skeleton.mjs +105 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +669 -29
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +21 -8
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +28 -10
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +66 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/generate-build-ir.mjs +285 -24
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/package-wiki-source-zip.mjs +262 -30
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/plan-kb-source-sync.mjs +1 -1
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/precompiled-source.mjs +46 -2
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/prepare-compile-schema.mjs +64 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/refresh-state-parts.mjs +91 -0
- package/skills/ae-automation/SKILL.md +16 -0
- package/skills/ae-automation/references/cli.md +53 -0
- package/skills/ae-automation/references/command_index.md +17 -0
- package/skills/ae-capability/SKILL.md +15 -6
- package/skills/ae-current-context/SKILL.md +3 -2
- package/skills/ae-kb/SKILL.md +62 -12
- package/skills/ae-kb/references/analysis-workflow.md +73 -36
- package/skills/ae-kb/references/query-workflow.md +67 -33
- package/skills/ae-kb/references/schema-import.md +5 -3
- package/skills/ae-kb/references/source-mutations.md +6 -4
- package/skills/ae-kb/references/text-sources.md +53 -0
- package/skills/ae-kb-discovery/SKILL.md +1 -1
- package/skills/ae-team/SKILL.md +23 -17
- package/skills/ae-things/SKILL.md +85 -0
- package/skills/ae-things/references/cli.md +103 -0
- package/skills/ae-things-progress/SKILL.md +43 -0
- package/skills/ae-things-review/SKILL.md +42 -0
- package/skills/ae-workspace/SKILL.md +43 -0
- package/skills/ae-workspace/references/commands.md +51 -0
- package/dist/chunk-E2JKXMVO.js +0 -29
- package/dist/context-M3HDGEIR.js +0 -46
- package/dist/memory-6APEB2JB.js +0 -892
- package/skills/ae-agent/references/create-automation.md +0 -125
- package/skills/ae-agent/references/list-automations.md +0 -56
- package/skills/ae-agent/references/update-automation.md +0 -107
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
CapabilityGatewayError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VZZNLV3I.js";
|
|
5
5
|
import {
|
|
6
6
|
SecureStoreAuthError,
|
|
7
7
|
getCliToken
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GHXZK54S.js";
|
|
9
9
|
import {
|
|
10
10
|
safeJsonParse
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZL7SGNIA.js";
|
|
12
12
|
import {
|
|
13
13
|
PermissionError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WNGFSIOB.js";
|
|
15
15
|
|
|
16
16
|
// src/core/mcp-access.ts
|
|
17
17
|
function buildUrl(host, path, params = {}) {
|
|
@@ -26,6 +26,11 @@ function buildUrl(host, path, params = {}) {
|
|
|
26
26
|
return url.toString();
|
|
27
27
|
}
|
|
28
28
|
var KbUnauthorizedError = class extends Error {
|
|
29
|
+
constructor(message, code) {
|
|
30
|
+
super(message);
|
|
31
|
+
this.code = code;
|
|
32
|
+
}
|
|
33
|
+
code;
|
|
29
34
|
};
|
|
30
35
|
function optionalString(value) {
|
|
31
36
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
@@ -49,6 +54,16 @@ function responseErrorMessage(data) {
|
|
|
49
54
|
const nestedError = data?.error && typeof data.error === "object" ? data.error : void 0;
|
|
50
55
|
return optionalString(typeof data?.error === "string" ? data.error : void 0) ?? optionalString(nestedError?.message) ?? optionalString(data?.message) ?? optionalString(data?.return_message);
|
|
51
56
|
}
|
|
57
|
+
function safeTextErrorCode(data) {
|
|
58
|
+
const rawCode = responseErrorMetadata(data).code;
|
|
59
|
+
return rawCode && /^[a-z0-9][a-z0-9_.:-]{0,127}$/i.test(rawCode) ? rawCode : void 0;
|
|
60
|
+
}
|
|
61
|
+
function safeTextError(resp, data) {
|
|
62
|
+
const code = safeTextErrorCode(data);
|
|
63
|
+
const message = resp.status === 404 && !code ? "This host does not support the KB text API (HTTP 404)." : `KB text request failed (HTTP ${resp.status}${code ? `, ${code}` : ""}).`;
|
|
64
|
+
const hint = code === "SOURCE_CONTENT_REVISION_CONFLICT" ? "The source changed. Keep your local input, read the current revision and explicitly resolve the conflict." : resp.status === 404 ? "Verify the exact source and host support for text APIs; no upload fallback was attempted." : "Inspect the source list and current state before retrying. Source content is omitted from diagnostics.";
|
|
65
|
+
return resp.status === 403 ? new PermissionError(message, code, hint) : new KbHttpError(message, code, resp.status, hint);
|
|
66
|
+
}
|
|
52
67
|
function responseStatus(resp) {
|
|
53
68
|
const statusText = optionalString(resp.statusText);
|
|
54
69
|
return statusText ? `${resp.status} ${statusText}` : String(resp.status);
|
|
@@ -68,6 +83,7 @@ var KbHttpError = class extends CapabilityGatewayError {
|
|
|
68
83
|
}
|
|
69
84
|
};
|
|
70
85
|
function nonOkResponseError(resp, data, options) {
|
|
86
|
+
if (options.redactErrorDetails) return safeTextError(resp, data);
|
|
71
87
|
const metadata = responseErrorMetadata(data);
|
|
72
88
|
const serverMessage = responseErrorMessage(data);
|
|
73
89
|
const fallbackMessage = `KB API HTTP error: ${responseStatus(resp)}`;
|
|
@@ -84,41 +100,59 @@ function parseKbResponse(resp, text, options = {}) {
|
|
|
84
100
|
let metadata = {};
|
|
85
101
|
try {
|
|
86
102
|
const d = safeJsonParse(text);
|
|
103
|
+
if (options.redactErrorDetails) throw safeTextError(resp, d);
|
|
87
104
|
const m = d && (typeof d.error === "string" ? d.error : d.error?.message || d.message);
|
|
88
105
|
if (m && typeof m === "string") msg = m;
|
|
89
106
|
if (options.preserveErrorMetadata) metadata = responseErrorMetadata(d);
|
|
90
|
-
} catch {
|
|
107
|
+
} catch (error) {
|
|
108
|
+
if (error instanceof PermissionError) throw error;
|
|
91
109
|
}
|
|
92
110
|
throw new PermissionError(msg, metadata.code, metadata.hint);
|
|
93
111
|
}
|
|
94
112
|
if (resp.status === 401) {
|
|
113
|
+
let code;
|
|
114
|
+
if (options.redactErrorDetails) {
|
|
115
|
+
try {
|
|
116
|
+
code = safeTextErrorCode(safeJsonParse(text));
|
|
117
|
+
} catch {
|
|
118
|
+
}
|
|
119
|
+
}
|
|
95
120
|
throw new KbUnauthorizedError(
|
|
96
|
-
`KB API token auth failed: HTTP ${resp.status} ${resp.statusText}
|
|
121
|
+
options.redactErrorDetails ? "KB API token auth failed: HTTP 401." : `KB API token auth failed: HTTP ${resp.status} ${resp.statusText}`,
|
|
122
|
+
code
|
|
97
123
|
);
|
|
98
124
|
}
|
|
99
125
|
if (!text.trim()) {
|
|
126
|
+
if (options.redactErrorDetails && !resp.ok) throw safeTextError(resp, void 0);
|
|
100
127
|
throw malformedResponseError(resp, "empty response body");
|
|
101
128
|
}
|
|
102
129
|
let data;
|
|
103
130
|
try {
|
|
104
131
|
data = safeJsonParse(text);
|
|
105
132
|
} catch {
|
|
133
|
+
if (options.redactErrorDetails && !resp.ok) throw safeTextError(resp, void 0);
|
|
106
134
|
throw malformedResponseError(resp, "non-JSON response");
|
|
107
135
|
}
|
|
108
136
|
if (data?.return_code === -1001) {
|
|
109
137
|
throw new KbUnauthorizedError(
|
|
110
|
-
`KB API token auth failed: ${data.return_message || "unauthorized"} (code: ${data.return_code})
|
|
138
|
+
options.redactErrorDetails ? "KB API token auth failed (code: -1001)." : `KB API token auth failed: ${data.return_message || "unauthorized"} (code: ${data.return_code})`,
|
|
139
|
+
options.redactErrorDetails ? safeTextErrorCode(data) : void 0
|
|
111
140
|
);
|
|
112
141
|
}
|
|
113
142
|
if (!resp.ok) {
|
|
114
143
|
throw nonOkResponseError(resp, data, options);
|
|
115
144
|
}
|
|
116
145
|
if (data?.return_code !== 0 && data?.return_code !== void 0) {
|
|
146
|
+
if (options.redactErrorDetails) throw safeTextError(resp, data);
|
|
117
147
|
throw new Error(
|
|
118
148
|
`AE API error: ${data.return_message || "unknown"} (code: ${data.return_code})`
|
|
119
149
|
);
|
|
120
150
|
}
|
|
151
|
+
if (options.redactErrorDetails && data?.error && typeof data.error === "object") {
|
|
152
|
+
throw safeTextError(resp, data);
|
|
153
|
+
}
|
|
121
154
|
if (data && typeof data === "object" && typeof data.error === "string" && data.error.trim() && data.return_code === void 0 && data.success === void 0) {
|
|
155
|
+
if (options.redactErrorDetails) throw safeTextError(resp, data);
|
|
122
156
|
if (options.preserveErrorMetadata) {
|
|
123
157
|
const metadata = responseErrorMetadata(data);
|
|
124
158
|
throw new CapabilityGatewayError(
|
|
@@ -171,7 +205,8 @@ async function requestWithCliToken(host, input, init, options) {
|
|
|
171
205
|
}
|
|
172
206
|
}
|
|
173
207
|
throw new SecureStoreAuthError(
|
|
174
|
-
`The stored CLI token for ${host} is invalid or expired. Run: ae-cli auth login --host ${host}
|
|
208
|
+
`The stored CLI token for ${host} is invalid or expired. Run: ae-cli auth login --host ${host}`,
|
|
209
|
+
options.redactErrorDetails ? error.code : void 0
|
|
175
210
|
);
|
|
176
211
|
}
|
|
177
212
|
throw error;
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
require_node,
|
|
6
6
|
require_process_nextick_args,
|
|
7
7
|
require_util
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-S6M42KND.js";
|
|
9
9
|
import {
|
|
10
10
|
__commonJS,
|
|
11
11
|
__esm,
|
|
12
12
|
__export,
|
|
13
13
|
__require,
|
|
14
14
|
__toCommonJS
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WNGFSIOB.js";
|
|
16
16
|
|
|
17
17
|
// node_modules/readdir-glob/node_modules/minimatch/lib/path.js
|
|
18
18
|
var require_path = __commonJS({
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
deleteFromMainApp,
|
|
4
|
+
getBufferFromMainApp,
|
|
5
|
+
getFromMainApp,
|
|
6
|
+
patchToMainApp,
|
|
7
|
+
postToMainApp,
|
|
8
|
+
putToMainApp,
|
|
9
|
+
uploadToMainApp
|
|
10
|
+
} from "./chunk-3YVEAZUN.js";
|
|
11
|
+
|
|
12
|
+
// src/commands/te-agent/api-client.ts
|
|
13
|
+
function getAgentApi(ctx, path) {
|
|
14
|
+
return getFromMainApp(path, ctx.host());
|
|
15
|
+
}
|
|
16
|
+
function postAgentApi(ctx, path, body) {
|
|
17
|
+
return postToMainApp(path, body, ctx.host());
|
|
18
|
+
}
|
|
19
|
+
function patchAgentApi(ctx, path, body) {
|
|
20
|
+
return patchToMainApp(path, body, ctx.host());
|
|
21
|
+
}
|
|
22
|
+
function putAgentApi(ctx, path, body) {
|
|
23
|
+
return putToMainApp(path, body, ctx.host());
|
|
24
|
+
}
|
|
25
|
+
function deleteAgentApi(ctx, path) {
|
|
26
|
+
return deleteFromMainApp(path, ctx.host());
|
|
27
|
+
}
|
|
28
|
+
function uploadAgentApi(ctx, path, formData) {
|
|
29
|
+
return uploadToMainApp(path, formData, ctx.host());
|
|
30
|
+
}
|
|
31
|
+
function getAgentBuffer(ctx, path) {
|
|
32
|
+
return getBufferFromMainApp(path, ctx.host());
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
getAgentApi,
|
|
37
|
+
postAgentApi,
|
|
38
|
+
patchAgentApi,
|
|
39
|
+
putAgentApi,
|
|
40
|
+
deleteAgentApi,
|
|
41
|
+
uploadAgentApi,
|
|
42
|
+
getAgentBuffer
|
|
43
|
+
};
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
require_node,
|
|
6
6
|
require_process_nextick_args,
|
|
7
7
|
require_util
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-S6M42KND.js";
|
|
9
9
|
import {
|
|
10
10
|
__commonJS,
|
|
11
11
|
__require
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WNGFSIOB.js";
|
|
13
13
|
|
|
14
14
|
// node_modules/jszip/node_modules/readable-stream/lib/internal/streams/stream.js
|
|
15
15
|
var require_stream = __commonJS({
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
normalizeUrl,
|
|
7
7
|
safeJsonParse,
|
|
8
8
|
safeReadJsonFile
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZL7SGNIA.js";
|
|
10
10
|
import {
|
|
11
11
|
PermissionError,
|
|
12
12
|
logger
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WNGFSIOB.js";
|
|
14
14
|
|
|
15
15
|
// src/core/secure-store.ts
|
|
16
16
|
import crypto from "crypto";
|
|
@@ -521,10 +521,12 @@ function loadCliToken(host) {
|
|
|
521
521
|
return getActiveCredential(host)?.cliToken ?? null;
|
|
522
522
|
}
|
|
523
523
|
var SecureStoreAuthError = class extends Error {
|
|
524
|
-
constructor(message) {
|
|
524
|
+
constructor(message, code) {
|
|
525
525
|
super(message);
|
|
526
|
+
this.code = code;
|
|
526
527
|
this.name = "SecureStoreAuthError";
|
|
527
528
|
}
|
|
529
|
+
code;
|
|
528
530
|
};
|
|
529
531
|
var CredentialStoreUnreadableError = class extends Error {
|
|
530
532
|
code = "CREDENTIAL_STORE_UNREADABLE";
|
|
@@ -542,6 +544,9 @@ import path2 from "path";
|
|
|
542
544
|
var CLI_TOKEN_GENERATE_PATH = "/v1/ta/cli/token/generate";
|
|
543
545
|
var CLI_TOKEN_RENEW_PATH = "/v1/ta/cli/token/renew";
|
|
544
546
|
var CLI_TOKEN_VALIDATE_PATH = "/v1/ta/cli/token/validate";
|
|
547
|
+
function safeReturnCode(value) {
|
|
548
|
+
return typeof value === "number" && Number.isFinite(value) ? String(value) : void 0;
|
|
549
|
+
}
|
|
545
550
|
var CliTokenValidationUnavailableError = class extends Error {
|
|
546
551
|
constructor(message) {
|
|
547
552
|
super(message);
|
|
@@ -660,19 +665,26 @@ async function generateCliToken(hostUrl, accessToken) {
|
|
|
660
665
|
body = text ? safeJsonParse(text) : {};
|
|
661
666
|
} catch {
|
|
662
667
|
}
|
|
663
|
-
const
|
|
664
|
-
const code = body.code
|
|
665
|
-
throw new PermissionError(
|
|
668
|
+
const serviceMessage = body.message ?? body.return_message;
|
|
669
|
+
const code = body.code === "CLI_ACCESS_DISABLED" || String(serviceMessage).includes("CLI_ACCESS_DISABLED") ? "CLI_ACCESS_DISABLED" : void 0;
|
|
670
|
+
throw new PermissionError(
|
|
671
|
+
code === "CLI_ACCESS_DISABLED" ? "CLI access is disabled for this account." : "You do not have permission to generate a CLI token.",
|
|
672
|
+
code
|
|
673
|
+
);
|
|
666
674
|
}
|
|
667
675
|
throw new Error(`CLI token generate HTTP error: ${resp.status} ${resp.statusText}`);
|
|
668
676
|
}
|
|
669
677
|
const data = safeJsonParse(await resp.text());
|
|
670
678
|
if (data.return_code !== 0) {
|
|
671
|
-
const
|
|
672
|
-
if (data.code === "CLI_ACCESS_DISABLED" || String(
|
|
673
|
-
throw new PermissionError(
|
|
679
|
+
const serviceMessage = data.return_message || data.message;
|
|
680
|
+
if (data.code === "CLI_ACCESS_DISABLED" || String(serviceMessage).includes("CLI_ACCESS_DISABLED")) {
|
|
681
|
+
throw new PermissionError(
|
|
682
|
+
"CLI access is disabled for this account.",
|
|
683
|
+
"CLI_ACCESS_DISABLED"
|
|
684
|
+
);
|
|
674
685
|
}
|
|
675
|
-
|
|
686
|
+
const code = safeReturnCode(data.return_code);
|
|
687
|
+
throw new Error(`CLI token generation failed${code ? ` (code: ${code})` : ""}`);
|
|
676
688
|
}
|
|
677
689
|
const cliToken = data.data?.userSecret ?? data.data?.user_secret;
|
|
678
690
|
if (!cliToken) throw new Error("CLI token generate error: empty userSecret in response");
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
currentAgentSpaceId
|
|
4
|
+
} from "./chunk-RK6GLDGI.js";
|
|
5
|
+
import {
|
|
6
|
+
deleteAgentApi,
|
|
7
|
+
getAgentApi,
|
|
8
|
+
patchAgentApi,
|
|
9
|
+
postAgentApi,
|
|
10
|
+
putAgentApi,
|
|
11
|
+
uploadAgentApi
|
|
12
|
+
} from "./chunk-CI24BDR2.js";
|
|
13
|
+
import {
|
|
14
|
+
TeAgentApiError,
|
|
15
|
+
createTeAgentApiError
|
|
16
|
+
} from "./chunk-3YVEAZUN.js";
|
|
17
|
+
import {
|
|
18
|
+
CliValidationError,
|
|
19
|
+
isApiErrorType
|
|
20
|
+
} from "./chunk-WNGFSIOB.js";
|
|
21
|
+
|
|
22
|
+
// src/commands/workspace/client.ts
|
|
23
|
+
var DEFAULT_TE_CLAUDE_BASE_PATH = "/agent";
|
|
24
|
+
var WORKSPACE_CLI_BASE_PATH = "/api/cli/workspace/v1";
|
|
25
|
+
function normalizeBasePath(value) {
|
|
26
|
+
const trimmed = value.trim();
|
|
27
|
+
if (!trimmed || trimmed === "/") return "";
|
|
28
|
+
return `/${trimmed.replace(/^\/+|\/+$/g, "")}`;
|
|
29
|
+
}
|
|
30
|
+
function resolveWorkspaceApiBaseUrl(host) {
|
|
31
|
+
const base = host.replace(/\/+$/, "");
|
|
32
|
+
const basePath = normalizeBasePath(
|
|
33
|
+
process.env.TE_CLAUDE_BASE_PATH ?? process.env.AE_API_PREFIX ?? DEFAULT_TE_CLAUDE_BASE_PATH
|
|
34
|
+
);
|
|
35
|
+
return basePath && !base.endsWith(basePath) ? `${base}${basePath}` : base;
|
|
36
|
+
}
|
|
37
|
+
function buildWorkspaceCliUrl(ctx, path) {
|
|
38
|
+
return `${resolveWorkspaceApiBaseUrl(ctx.host())}${path}`;
|
|
39
|
+
}
|
|
40
|
+
function unwrapWorkspaceResponse(response) {
|
|
41
|
+
if (response && typeof response === "object" && !Array.isArray(response)) {
|
|
42
|
+
const envelope = response;
|
|
43
|
+
if (envelope.ok === true) return envelope.data;
|
|
44
|
+
if (envelope.ok === false) {
|
|
45
|
+
const error = envelope.error;
|
|
46
|
+
if (error && isApiErrorType(error.type) && typeof error.code === "string" && error.code.trim() && typeof error.message === "string" && error.message.trim()) {
|
|
47
|
+
throw createTeAgentApiError(response, 200, "Workspace API request failed");
|
|
48
|
+
}
|
|
49
|
+
throw new TeAgentApiError("The Workspace API returned an invalid error response.", 200, "WORKSPACE_INVALID_RESPONSE");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return response;
|
|
53
|
+
}
|
|
54
|
+
async function getWorkspaceApi(ctx, path) {
|
|
55
|
+
return unwrapWorkspaceResponse(await getAgentApi(ctx, path));
|
|
56
|
+
}
|
|
57
|
+
async function postWorkspaceApi(ctx, path, body) {
|
|
58
|
+
return unwrapWorkspaceResponse(await postAgentApi(ctx, path, body));
|
|
59
|
+
}
|
|
60
|
+
async function patchWorkspaceApi(ctx, path, body) {
|
|
61
|
+
return unwrapWorkspaceResponse(await patchAgentApi(ctx, path, body));
|
|
62
|
+
}
|
|
63
|
+
async function putWorkspaceApi(ctx, path, body) {
|
|
64
|
+
return unwrapWorkspaceResponse(await putAgentApi(ctx, path, body));
|
|
65
|
+
}
|
|
66
|
+
async function deleteWorkspaceApi(ctx, path) {
|
|
67
|
+
return unwrapWorkspaceResponse(await deleteAgentApi(ctx, path));
|
|
68
|
+
}
|
|
69
|
+
async function uploadWorkspaceApi(ctx, path, formData) {
|
|
70
|
+
return unwrapWorkspaceResponse(await uploadAgentApi(ctx, path, formData));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/commands/workspace/target.ts
|
|
74
|
+
function optional(value) {
|
|
75
|
+
const trimmed = value?.trim();
|
|
76
|
+
return trimmed || void 0;
|
|
77
|
+
}
|
|
78
|
+
var workspaceTargetFlags = [
|
|
79
|
+
{
|
|
80
|
+
name: "workspace-id",
|
|
81
|
+
type: "string",
|
|
82
|
+
required: false,
|
|
83
|
+
desc: "AgentSpace ID; defaults to the current AgentSpace or resolves from the current conversation"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "conversation-id",
|
|
87
|
+
type: "string",
|
|
88
|
+
required: false,
|
|
89
|
+
desc: "Conversation ID used to verify or resolve the AgentSpace target"
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
function workspaceTargetParams(ctx) {
|
|
93
|
+
const params = new URLSearchParams();
|
|
94
|
+
const workspaceId = optional(ctx.str("workspaceId")) ?? currentAgentSpaceId();
|
|
95
|
+
const conversationId = optional(ctx.str("conversationId")) ?? optional(process.env.TE_AGENT_CONVERSATION_ID);
|
|
96
|
+
if (!workspaceId && !conversationId) {
|
|
97
|
+
throw new CliValidationError(
|
|
98
|
+
"Workspace target is required. Provide --workspace-id or --conversation-id, or run inside an AgentSpace conversation."
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
if (workspaceId) params.set("agentSpaceId", workspaceId);
|
|
102
|
+
if (conversationId) params.set("conversationId", conversationId);
|
|
103
|
+
return params;
|
|
104
|
+
}
|
|
105
|
+
function workspaceTargetPath(ctx) {
|
|
106
|
+
return `${WORKSPACE_CLI_BASE_PATH}/target?${workspaceTargetParams(ctx).toString()}`;
|
|
107
|
+
}
|
|
108
|
+
async function resolveWorkspaceTarget(ctx) {
|
|
109
|
+
return getWorkspaceApi(ctx, workspaceTargetPath(ctx));
|
|
110
|
+
}
|
|
111
|
+
function workspaceResourcePath(agentSpaceId, suffix = "") {
|
|
112
|
+
return `${WORKSPACE_CLI_BASE_PATH}/agent-spaces/${encodeURIComponent(agentSpaceId)}${suffix}`;
|
|
113
|
+
}
|
|
114
|
+
function previewWorkspaceResourcePath(ctx, suffix = "") {
|
|
115
|
+
const id = optional(ctx.str("workspaceId")) ?? currentAgentSpaceId() ?? ":resolved-workspace-id";
|
|
116
|
+
return workspaceResourcePath(id, suffix);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
WORKSPACE_CLI_BASE_PATH,
|
|
121
|
+
buildWorkspaceCliUrl,
|
|
122
|
+
getWorkspaceApi,
|
|
123
|
+
postWorkspaceApi,
|
|
124
|
+
patchWorkspaceApi,
|
|
125
|
+
putWorkspaceApi,
|
|
126
|
+
deleteWorkspaceApi,
|
|
127
|
+
uploadWorkspaceApi,
|
|
128
|
+
workspaceTargetFlags,
|
|
129
|
+
workspaceTargetPath,
|
|
130
|
+
resolveWorkspaceTarget,
|
|
131
|
+
workspaceResourcePath,
|
|
132
|
+
previewWorkspaceResourcePath
|
|
133
|
+
};
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
CapabilityGatewayError,
|
|
7
7
|
fetchCapabilityGateway,
|
|
8
8
|
requestCapabilityGateway
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VZZNLV3I.js";
|
|
10
10
|
import {
|
|
11
11
|
readOutputMetadata,
|
|
12
12
|
unwrapOutputData,
|
|
13
13
|
withOutputMetadata
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6VNIR4AP.js";
|
|
15
15
|
import {
|
|
16
16
|
PermissionError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WNGFSIOB.js";
|
|
18
18
|
|
|
19
19
|
// src/core/analysis-async-artifact.ts
|
|
20
20
|
import { randomBytes } from "crypto";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/core/agent-space-context.ts
|
|
4
|
+
function value(name) {
|
|
5
|
+
const current = process.env[name]?.trim();
|
|
6
|
+
return current || void 0;
|
|
7
|
+
}
|
|
8
|
+
function currentAgentSpaceId() {
|
|
9
|
+
const explicit = value("TE_AGENT_CURRENT_AGENT_SPACE_ID");
|
|
10
|
+
if (explicit) return explicit;
|
|
11
|
+
const match = /(?:^|\/)spaces\/actived\/([^/]+)(?:\/|$)/.exec(process.cwd());
|
|
12
|
+
return match?.[1];
|
|
13
|
+
}
|
|
14
|
+
function isAgentSpaceRuntime() {
|
|
15
|
+
return Boolean(currentAgentSpaceId());
|
|
16
|
+
}
|
|
17
|
+
function assertLegacyWorkspaceCommand(command) {
|
|
18
|
+
if (!isAgentSpaceRuntime()) return;
|
|
19
|
+
throw new Error(
|
|
20
|
+
`ae-cli ${command} manages the legacy sandbox Workspace and is disabled in an AgentSpace runtime. Use ae-cli workspace capability list/set for AgentSpace capabilities.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
currentAgentSpaceId,
|
|
26
|
+
assertLegacyWorkspaceCommand
|
|
27
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
getAgentApi,
|
|
4
|
+
patchAgentApi,
|
|
5
|
+
postAgentApi
|
|
6
|
+
} from "./chunk-CI24BDR2.js";
|
|
7
|
+
|
|
8
|
+
// src/commands/memory/cli-client.ts
|
|
9
|
+
var DEFAULT_TE_CLAUDE_BASE_PATH = "/agent";
|
|
10
|
+
var MEMORY_CLI_BASE_PATH = "/api/cli/memory/v2";
|
|
11
|
+
function normalizeBasePath(value) {
|
|
12
|
+
const trimmed = value.trim();
|
|
13
|
+
if (!trimmed || trimmed === "/") return "";
|
|
14
|
+
return `/${trimmed.replace(/^\/+|\/+$/g, "")}`;
|
|
15
|
+
}
|
|
16
|
+
function resolveMemoryApiBaseUrl(host) {
|
|
17
|
+
const base = host.replace(/\/+$/, "");
|
|
18
|
+
const basePath = normalizeBasePath(
|
|
19
|
+
process.env.TE_CLAUDE_BASE_PATH ?? process.env.AE_API_PREFIX ?? DEFAULT_TE_CLAUDE_BASE_PATH
|
|
20
|
+
);
|
|
21
|
+
return basePath && !base.endsWith(basePath) ? `${base}${basePath}` : base;
|
|
22
|
+
}
|
|
23
|
+
function buildMemoryCliUrl(ctx, path) {
|
|
24
|
+
return `${resolveMemoryApiBaseUrl(ctx.host())}${MEMORY_CLI_BASE_PATH}/${path.replace(/^\/+/, "")}`;
|
|
25
|
+
}
|
|
26
|
+
function unwrapMemoryResponse(response) {
|
|
27
|
+
if (response && typeof response === "object" && !Array.isArray(response)) {
|
|
28
|
+
const envelope = response;
|
|
29
|
+
if (envelope.ok === true) return envelope.data;
|
|
30
|
+
if (envelope.ok === false) throw new Error(envelope.error?.message || "Memory API request failed");
|
|
31
|
+
}
|
|
32
|
+
return response;
|
|
33
|
+
}
|
|
34
|
+
async function getMemoryCli(ctx, path) {
|
|
35
|
+
return unwrapMemoryResponse(
|
|
36
|
+
await getAgentApi(ctx, `${MEMORY_CLI_BASE_PATH}/${path.replace(/^\/+/, "")}`)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
async function postMemoryCli(ctx, path, body) {
|
|
40
|
+
return unwrapMemoryResponse(
|
|
41
|
+
await postAgentApi(ctx, `${MEMORY_CLI_BASE_PATH}/${path.replace(/^\/+/, "")}`, body)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
async function patchMemoryCli(ctx, path, body) {
|
|
45
|
+
return unwrapMemoryResponse(
|
|
46
|
+
await patchAgentApi(ctx, `${MEMORY_CLI_BASE_PATH}/${path.replace(/^\/+/, "")}`, body)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
resolveMemoryApiBaseUrl,
|
|
52
|
+
buildMemoryCliUrl,
|
|
53
|
+
getMemoryCli,
|
|
54
|
+
postMemoryCli,
|
|
55
|
+
patchMemoryCli
|
|
56
|
+
};
|
|
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module'; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
__commonJS,
|
|
4
4
|
__require
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WNGFSIOB.js";
|
|
6
6
|
|
|
7
7
|
// node_modules/process-nextick-args/index.js
|
|
8
8
|
var require_process_nextick_args = __commonJS({
|
|
@@ -6,17 +6,18 @@ import {
|
|
|
6
6
|
SecureStoreAuthError,
|
|
7
7
|
clearCliTokenCache,
|
|
8
8
|
getCliToken
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GHXZK54S.js";
|
|
10
10
|
import {
|
|
11
11
|
safeJsonParse
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZL7SGNIA.js";
|
|
13
13
|
import {
|
|
14
14
|
PermissionError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WNGFSIOB.js";
|
|
16
16
|
|
|
17
17
|
// src/core/cli-agent-context.ts
|
|
18
18
|
import { readFileSync, statSync } from "fs";
|
|
19
19
|
import { dirname, join, parse, resolve } from "path";
|
|
20
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
20
21
|
var MAX_CONTEXT_FILE_BYTES = 64 * 1024;
|
|
21
22
|
var CONTEXT_FILE_ENV = "TA_CLI_CONTEXT_FILE";
|
|
22
23
|
var CONTEXT_ARG = "--agent-context";
|
|
@@ -42,12 +43,17 @@ var FIELDS = [
|
|
|
42
43
|
{ key: "session_goal", env: "TA_CLI_SESSION_GOAL", header: "X-TA-CLI-Session-Goal", maxLength: 2048 },
|
|
43
44
|
{ key: "context_capture_status", env: "TA_CLI_CONTEXT_CAPTURE_STATUS", header: "X-TA-CLI-Context-Capture-Status", maxLength: 32 }
|
|
44
45
|
];
|
|
46
|
+
var scopedContext = new AsyncLocalStorage();
|
|
47
|
+
function runWithCliAgentContext(context, run) {
|
|
48
|
+
return scopedContext.run(context, run);
|
|
49
|
+
}
|
|
45
50
|
function readCliAgentContext() {
|
|
46
51
|
const context = {
|
|
47
52
|
...inferRuntimeContext(),
|
|
48
53
|
...readEnvContext(),
|
|
49
54
|
...readArgumentContext(),
|
|
50
|
-
...readFileContext()
|
|
55
|
+
...readFileContext(),
|
|
56
|
+
...scopedContext.getStore()
|
|
51
57
|
};
|
|
52
58
|
return withCaptureStatus(context);
|
|
53
59
|
}
|
|
@@ -271,11 +277,11 @@ var CapabilityGatewayError = class extends Error {
|
|
|
271
277
|
meta;
|
|
272
278
|
type;
|
|
273
279
|
};
|
|
274
|
-
function buildCapabilityGatewayUrl(host, domain, pathAfterV1, queryParams = {}) {
|
|
280
|
+
function buildCapabilityGatewayUrl(host, domain, pathAfterV1, queryParams = {}, apiVersion = "v1") {
|
|
275
281
|
const base = host.replace(/\/+$/, "");
|
|
276
282
|
const cleanDomain = domain.replace(/^\/+|\/+$/g, "");
|
|
277
283
|
const cleanPath = pathAfterV1.replace(/^\/+|\/+$/g, "");
|
|
278
|
-
const gatewayPrefix = cleanDomain === "" ?
|
|
284
|
+
const gatewayPrefix = cleanDomain === "" ? `/api/cli/${apiVersion}` : `/api/cli/${cleanDomain}/${apiVersion}`;
|
|
279
285
|
const url = new URL(`${base}${gatewayPrefix}/${cleanPath}`);
|
|
280
286
|
for (const [key, value] of Object.entries(queryParams)) {
|
|
281
287
|
if (value !== void 0 && value !== null) {
|
|
@@ -383,7 +389,7 @@ async function throwCapabilityHttpError(resp) {
|
|
|
383
389
|
}
|
|
384
390
|
throw error;
|
|
385
391
|
}
|
|
386
|
-
async function requestOnce(url, method, token, body, accept = "application/json") {
|
|
392
|
+
async function requestOnce(url, method, token, body, accept = "application/json", includeClientContextInBody = true) {
|
|
387
393
|
const agentContext = readCliAgentContext();
|
|
388
394
|
const headers = {
|
|
389
395
|
"cli-token": token,
|
|
@@ -394,7 +400,7 @@ async function requestOnce(url, method, token, body, accept = "application/json"
|
|
|
394
400
|
const init = { method, headers };
|
|
395
401
|
if (body !== void 0 && method !== "GET") {
|
|
396
402
|
headers["Content-Type"] = "application/json";
|
|
397
|
-
init.body = JSON.stringify(withCliAgentContextBody(body, agentContext));
|
|
403
|
+
init.body = JSON.stringify(includeClientContextInBody ? withCliAgentContextBody(body, agentContext) : body);
|
|
398
404
|
}
|
|
399
405
|
return fetch(url, init);
|
|
400
406
|
}
|
|
@@ -413,13 +419,13 @@ async function callGateway(host, domain, pathAfterV1, method, body, queryParams
|
|
|
413
419
|
return (await callGatewayWithEnvelope(host, domain, pathAfterV1, method, body, queryParams, options)).data;
|
|
414
420
|
}
|
|
415
421
|
async function callGatewayWithEnvelope(host, domain, pathAfterV1, method, body, queryParams = {}, options = {}) {
|
|
416
|
-
const url = buildCapabilityGatewayUrl(options.apiBaseUrl ?? host, domain, pathAfterV1, queryParams);
|
|
422
|
+
const url = buildCapabilityGatewayUrl(options.apiBaseUrl ?? host, domain, pathAfterV1, queryParams, options.apiVersion);
|
|
417
423
|
const token = await getCliToken(host);
|
|
418
|
-
let resp = await requestOnce(url, method, token, body);
|
|
424
|
+
let resp = await requestOnce(url, method, token, body, "application/json", options.includeClientContextInBody);
|
|
419
425
|
if (resp.status === 401 && options.retryOnUnauthorized === true) {
|
|
420
426
|
await resp.body?.cancel();
|
|
421
427
|
clearCliTokenCache(host);
|
|
422
|
-
resp = await requestOnce(url, method, await getCliToken(host), body);
|
|
428
|
+
resp = await requestOnce(url, method, await getCliToken(host), body, "application/json", options.includeClientContextInBody);
|
|
423
429
|
}
|
|
424
430
|
if (resp.status === 403) {
|
|
425
431
|
const error = await permissionError(resp);
|
|
@@ -549,6 +555,8 @@ async function callCapabilityApi(host, domain, action, method = "POST", params =
|
|
|
549
555
|
}
|
|
550
556
|
|
|
551
557
|
export {
|
|
558
|
+
runWithCliAgentContext,
|
|
559
|
+
readCliAgentContext,
|
|
552
560
|
CapabilityGatewayError,
|
|
553
561
|
buildCapabilityGatewayUrl,
|
|
554
562
|
fetchCapabilityGateway,
|
|
@@ -133,15 +133,20 @@ var logger = new Logger();
|
|
|
133
133
|
|
|
134
134
|
// src/core/errors.ts
|
|
135
135
|
var PermissionError = class extends Error {
|
|
136
|
-
constructor(message, code, hint) {
|
|
136
|
+
constructor(message, code, hint, details) {
|
|
137
137
|
super(message);
|
|
138
138
|
this.code = code;
|
|
139
139
|
this.hint = hint;
|
|
140
|
+
this.details = details;
|
|
140
141
|
this.name = "PermissionError";
|
|
141
142
|
}
|
|
142
143
|
code;
|
|
143
144
|
hint;
|
|
145
|
+
details;
|
|
144
146
|
};
|
|
147
|
+
function isApiErrorType(value) {
|
|
148
|
+
return value === "auth" || value === "permission" || value === "validation" || value === "not_found" || value === "api";
|
|
149
|
+
}
|
|
145
150
|
var CliValidationError = class extends Error {
|
|
146
151
|
code;
|
|
147
152
|
hint;
|
|
@@ -216,6 +221,7 @@ export {
|
|
|
216
221
|
__toCommonJS,
|
|
217
222
|
logger,
|
|
218
223
|
PermissionError,
|
|
224
|
+
isApiErrorType,
|
|
219
225
|
CliValidationError,
|
|
220
226
|
CliApiError,
|
|
221
227
|
CommunityReportError,
|