@thinkingai/ae-cli 6.1.28 → 6.1.30
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 +24 -4
- package/README.zh.md +24 -4
- package/bin/ae-cli.js +5 -0
- package/bin/runtime-capabilities.json +5 -0
- package/cli-installation-guide.md +24 -3
- package/dist/{auth-NKD5Z5BQ.js → auth-ADZHUIJR.js} +30 -12
- package/dist/{automation-K32V2NKP.js → automation-FD2QZUP6.js} +6 -6
- package/dist/{capability-4CGSL7PK.js → capability-QXFRJYZD.js} +54 -26
- package/dist/{chunk-P6VFCH3P.js → chunk-2F64AZYH.js} +2 -2
- package/dist/{chunk-LMCYSVVA.js → chunk-4PSTYEG5.js} +50 -41
- package/dist/{chunk-KHS64JZQ.js → chunk-72NJKS7O.js} +4 -4
- package/dist/chunk-AVXDJAFC.js +132 -0
- package/dist/{chunk-GI5BMEZO.js → chunk-AWVZTN2B.js} +1 -1
- package/dist/chunk-CG773QXN.js +2289 -0
- package/dist/{chunk-UUD5RB36.js → chunk-E25OSZLJ.js} +3 -3
- package/dist/{chunk-UF244C5C.js → chunk-EUFP4M2A.js} +7 -7
- package/dist/{chunk-QW3R6O7L.js → chunk-HRUOV6EQ.js} +57 -15
- package/dist/{chunk-T44M3PLZ.js → chunk-JEUXDY3B.js} +1 -1
- package/dist/{chunk-2UWS5CUP.js → chunk-JSBLCLFE.js} +3 -3
- package/dist/{chunk-QSAR3GHY.js → chunk-OAWPT7VP.js} +2 -2
- package/dist/{chunk-2IYIYSUO.js → chunk-QVRIDN42.js} +2 -2
- package/dist/{chunk-P7KL7IOH.js → chunk-SOSFRU3O.js} +2 -2
- package/dist/{chunk-GTPWDLTE.js → chunk-TFORY6WY.js} +35 -14
- package/dist/{chunk-JJJIP2XQ.js → chunk-VDICGXCY.js} +2 -2
- package/dist/{chunk-UJ7UPRXK.js → chunk-Y3AM6LIO.js} +10 -8
- package/dist/chunk-YULUBP3R.js +222 -0
- package/dist/{chunk-X7DRLE62.js → chunk-YVG6QD3V.js} +1 -1
- package/dist/{chunk-ZW4VMY5H.js → chunk-Z3Q2AEIN.js} +152 -98
- package/dist/{community-report-client-S2K3A3Q6.js → community-report-client-TJVCLZ3K.js} +1 -1
- package/dist/compat-check-HERBTQZN.js +32 -0
- package/dist/{config-ASSAAIOI.js → config-E3KANXMK.js} +38 -6
- package/dist/{context-6RWLVOM5.js → context-CDB5H5PD.js} +4 -4
- package/dist/{data-integration-EXSUPUDZ.js → data-integration-QE37EQ3A.js} +207 -24
- package/dist/{evaluation-5YT4QLCL.js → evaluation-LR4YDYWL.js} +4 -4
- package/dist/index.js +297 -70
- package/dist/{local-data-upload-client-7HCPGIS3.js → local-data-upload-client-KCMG6J62.js} +1 -1
- package/dist/{memory-VCYLVPMI.js → memory-SNFR5M23.js} +6 -6
- package/dist/{metadata-YGI5M6OF.js → metadata-EXQYDZTH.js} +16 -8
- package/dist/{model-DPJHSD73.js → model-KEVCEXWD.js} +4 -4
- package/dist/{personal-semantic-preference-76TBKAPY.js → personal-semantic-preference-ETY3KU2O.js} +7 -6
- package/dist/{project-semantic-XOEBO2Q5.js → project-semantic-UHRMVOJF.js} +11 -10
- package/dist/{sync-7PP6KQ75.js → sync-XKEBXESC.js} +8 -7
- package/dist/{te-agent-PJVAPKBD.js → te-agent-S6UQR4IE.js} +11 -7
- package/dist/{te-analysis-OX62G5VD.js → te-analysis-WOFFCIBC.js} +185 -33
- package/dist/{te-community-QN3WMPNT.js → te-community-R7B6QYOO.js} +720 -228
- package/dist/{te-dataops-UKD2XN3E.js → te-dataops-KPILYVHA.js} +6 -5
- package/dist/{te-engage-X3DIXPRA.js → te-engage-IAUM6ONX.js} +13 -12
- package/dist/{te-experiment-MEIIK3DP.js → te-experiment-TMLRA7B3.js} +55 -21
- package/dist/{te-kb-73EWDFDF.js → te-kb-GKWPSLSY.js} +409 -85
- package/dist/{te-system-IE7NCKC3.js → te-system-CYWSK3UN.js} +6 -6
- package/dist/{te-team-MGQ5CNRW.js → te-team-ISN52YNG.js} +7 -6
- package/dist/{things-4JIBCA55.js → things-DDQ52Z3Q.js} +7 -7
- package/dist/{update-AX66IFMJ.js → update-CTLNTX35.js} +11 -7
- package/dist/{workspace-Q5NMEKEN.js → workspace-2CKQX2XL.js} +6 -6
- package/package.json +17 -7
- package/skills/ae-agent/references/resource-package.md +4 -0
- package/skills/ae-analysis/SKILL.md +14 -10
- package/skills/ae-analysis/references/agent_review_preflight.md +52 -11
- package/skills/ae-analysis/references/agent_review_priorities_comparisons.md +5 -3
- package/skills/ae-analysis/references/agent_review_submit_to_page.md +57 -25
- package/skills/ae-analysis/references/command_index.md +7 -3
- package/skills/ae-analysis/references/governance_recommendation_export.md +31 -17
- package/skills/ae-analysis/references/governance_recommendation_run_update.md +13 -0
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +9 -1
- package/skills/ae-analysis/references/scenario_append.md +6 -0
- package/skills/ae-analysis/references/scenario_begin.md +11 -0
- package/skills/ae-analysis/references/scenario_collect.md +10 -2
- package/skills/ae-analysis/references/scenario_evaluation.md +6 -18
- package/skills/ae-analysis/references/scenario_get.md +15 -0
- package/skills/ae-analysis/references/scenario_list.md +64 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +14 -1
- package/skills/ae-community/SKILL.md +77 -27
- package/skills/ae-community/references/community-analyzing-theme-comment.md +10 -8
- package/skills/ae-community/references/community-data-quality.md +68 -0
- package/skills/ae-community/references/community-query-evidence.md +85 -0
- package/skills/ae-community/references/community-scenario-capabilities.md +137 -0
- package/skills/ae-community/references/community-weekly-report.md +6 -3
- package/skills/ae-community/references/get_channel_info.md +7 -4
- package/skills/ae-community/references/get_comment_tag_analysis.md +3 -3
- package/skills/ae-community/references/get_comments_summary.md +4 -4
- package/skills/ae-community/references/get_corpus_tags.md +3 -3
- package/skills/ae-community/references/get_daily_summary.md +3 -3
- package/skills/ae-community/references/get_hot_topics.md +3 -3
- package/skills/ae-community/references/get_livestream_analysis.md +3 -3
- package/skills/ae-community/references/get_livestream_detail.md +4 -4
- package/skills/ae-community/references/get_livestream_list.md +3 -3
- package/skills/ae-community/references/get_livestream_overview.md +3 -3
- package/skills/ae-community/references/get_livestream_room_metrics.md +3 -3
- package/skills/ae-community/references/get_livestream_rooms.md +3 -3
- package/skills/ae-community/references/get_overview_metrics.md +3 -3
- package/skills/ae-community/references/get_post_detail.md +4 -4
- package/skills/ae-community/references/get_risk_content.md +5 -5
- package/skills/ae-community/references/get_sentiment_overview.md +4 -4
- package/skills/ae-community/references/get_tag_trends.md +3 -3
- package/skills/ae-community/references/get_topic_detail.md +3 -3
- package/skills/ae-community/references/list_sources.md +28 -0
- package/skills/ae-community/references/list_spaces.md +39 -0
- package/skills/ae-community/references/search_posts.md +21 -7
- package/skills/ae-data-integration/SKILL.md +6 -4
- package/skills/ae-data-integration/references/error-handling.md +1 -0
- package/skills/ae-data-integration/references/handoff.md +1 -1
- package/skills/ae-data-integration/references/sink-upload.md +11 -0
- package/skills/ae-data-integration/references/source-inspect.md +2 -1
- package/skills/ae-data-integration/references/transform.md +1 -1
- package/skills/ae-data-integration/references/ue-mapping.md +1 -1
- package/skills/ae-experiment/SKILL.md +7 -1
- package/skills/ae-experiment/references/manage_experiment.md +18 -1
- package/skills/ae-experiment/references/query_experiment_detail.md +7 -0
- package/skills/ae-experiment/references/save_experiment.md +76 -2
- package/skills/ae-experiment/references/save_submit_experiment.md +7 -0
- package/skills/ae-kb/SKILL.md +37 -8
- package/skills/ae-kb/references/publication.md +81 -0
- package/skills/ae-kb/references/query-workflow.md +20 -6
- package/skills/ae-kb-discovery/SKILL.md +15 -6
- package/skills/ae-metadata/SKILL.md +2 -2
- package/skills/ae-metadata/references/metadata_data_table_get.md +35 -0
- package/dist/chunk-ELCR235M.js +0 -1429
|
@@ -48,6 +48,139 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
48
48
|
));
|
|
49
49
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
50
50
|
|
|
51
|
+
// src/core/errors.ts
|
|
52
|
+
var PermissionError = class extends Error {
|
|
53
|
+
constructor(message, code, hint, details, meta) {
|
|
54
|
+
super(message);
|
|
55
|
+
this.code = code;
|
|
56
|
+
this.hint = hint;
|
|
57
|
+
this.details = details;
|
|
58
|
+
this.meta = meta;
|
|
59
|
+
this.name = "PermissionError";
|
|
60
|
+
}
|
|
61
|
+
code;
|
|
62
|
+
hint;
|
|
63
|
+
details;
|
|
64
|
+
meta;
|
|
65
|
+
};
|
|
66
|
+
function isApiErrorType(value) {
|
|
67
|
+
return value === "auth" || value === "permission" || value === "validation" || value === "not_found" || value === "api";
|
|
68
|
+
}
|
|
69
|
+
var CliValidationError = class extends Error {
|
|
70
|
+
code;
|
|
71
|
+
hint;
|
|
72
|
+
location;
|
|
73
|
+
constructor(message, options = {}) {
|
|
74
|
+
super(message);
|
|
75
|
+
this.name = "CliValidationError";
|
|
76
|
+
this.code = options.code;
|
|
77
|
+
this.hint = options.hint;
|
|
78
|
+
if (options.location) {
|
|
79
|
+
const location = {};
|
|
80
|
+
if (typeof options.location.segment === "number" && Number.isFinite(options.location.segment)) {
|
|
81
|
+
location.segment = options.location.segment;
|
|
82
|
+
}
|
|
83
|
+
if (typeof options.location.record === "number" && Number.isFinite(options.location.record)) {
|
|
84
|
+
location.record = options.location.record;
|
|
85
|
+
}
|
|
86
|
+
if (typeof options.location.field === "string" && options.location.field.length > 0) {
|
|
87
|
+
location.field = options.location.field;
|
|
88
|
+
}
|
|
89
|
+
if (Object.keys(location).length > 0) this.location = location;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var CliApiError = class extends Error {
|
|
94
|
+
code;
|
|
95
|
+
hint;
|
|
96
|
+
meta;
|
|
97
|
+
constructor(message, options = {}) {
|
|
98
|
+
super(message);
|
|
99
|
+
this.name = "CliApiError";
|
|
100
|
+
this.code = options.code;
|
|
101
|
+
this.hint = options.hint;
|
|
102
|
+
this.meta = options.meta;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var CommunityReportError = class extends Error {
|
|
106
|
+
code;
|
|
107
|
+
httpStatus;
|
|
108
|
+
hint;
|
|
109
|
+
meta;
|
|
110
|
+
constructor(message, options = {}) {
|
|
111
|
+
super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
|
|
112
|
+
this.name = "CommunityReportError";
|
|
113
|
+
this.code = options.code;
|
|
114
|
+
this.httpStatus = options.httpStatus;
|
|
115
|
+
this.hint = options.hint;
|
|
116
|
+
this.meta = options.meta;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var LocalDataUploadError = class extends Error {
|
|
120
|
+
code;
|
|
121
|
+
httpStatus;
|
|
122
|
+
hint;
|
|
123
|
+
meta;
|
|
124
|
+
constructor(message, options = {}) {
|
|
125
|
+
super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
|
|
126
|
+
this.name = "LocalDataUploadError";
|
|
127
|
+
this.code = options.code;
|
|
128
|
+
this.httpStatus = options.httpStatus;
|
|
129
|
+
this.hint = options.hint;
|
|
130
|
+
this.meta = options.meta;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// src/core/kb-read-context.ts
|
|
135
|
+
import fs from "fs";
|
|
136
|
+
var secrets = /* @__PURE__ */ new Set();
|
|
137
|
+
function fail(code) {
|
|
138
|
+
throw new CliValidationError(code, { code });
|
|
139
|
+
}
|
|
140
|
+
function kbExecutionContextRequired() {
|
|
141
|
+
return process.env.AE_KB_READ_CONTEXT_REQUIRED !== void 0 || process.env.AE_KB_READ_CONTEXT_FILE !== void 0;
|
|
142
|
+
}
|
|
143
|
+
function isKbQueryPath(method, pathname) {
|
|
144
|
+
return method === "POST" && /^\/(?:agent\/)?api\/external\/knowledge-bases\/(list|index|grep|read)$/.test(pathname);
|
|
145
|
+
}
|
|
146
|
+
function readKbExecutionContext() {
|
|
147
|
+
if (!kbExecutionContextRequired()) return void 0;
|
|
148
|
+
const file = process.env.AE_KB_READ_CONTEXT_FILE;
|
|
149
|
+
if (process.env.AE_KB_READ_CONTEXT_REQUIRED !== "1" || !file) fail("KB_READ_CONTEXT_REQUIRED");
|
|
150
|
+
let fd;
|
|
151
|
+
let data;
|
|
152
|
+
try {
|
|
153
|
+
fd = fs.openSync(file, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW);
|
|
154
|
+
const stat = fs.fstatSync(fd);
|
|
155
|
+
if (!stat.isFile() || stat.size > 16384 || (stat.mode & 511) !== 384 || process.getuid && stat.uid !== process.getuid())
|
|
156
|
+
throw new Error();
|
|
157
|
+
data = JSON.parse(fs.readFileSync(fd, "utf8"));
|
|
158
|
+
if (!data || Array.isArray(data) || Object.keys(data).sort().join(",") !== "executionRef,expiresAt,formatVersion,origin,readContextId,required,token" || data.formatVersion !== 1 || data.required !== true || typeof data.executionRef !== "string" || !/^[^\s\0]{1,191}$/.test(data.executionRef) || typeof data.readContextId !== "string" || !/^[^\s\0]{1,191}$/.test(data.readContextId) || typeof data.token !== "string" || !/^cli_kbr_[A-Za-z0-9_-]{43,}$/.test(data.token) || typeof data.expiresAt !== "string" || !Number.isFinite(Date.parse(data.expiresAt)))
|
|
159
|
+
throw new Error();
|
|
160
|
+
const origin = new URL(data.origin);
|
|
161
|
+
if (!["http:", "https:"].includes(origin.protocol) || origin.username || origin.password || origin.origin !== data.origin)
|
|
162
|
+
throw new Error();
|
|
163
|
+
} catch {
|
|
164
|
+
fail("KB_READ_CONTEXT_REQUIRED");
|
|
165
|
+
} finally {
|
|
166
|
+
if (fd !== void 0) fs.closeSync(fd);
|
|
167
|
+
}
|
|
168
|
+
secrets.add(data.token);
|
|
169
|
+
if (Date.parse(data.expiresAt) <= Date.now()) fail("KB_READ_CONTEXT_EXPIRED");
|
|
170
|
+
return data;
|
|
171
|
+
}
|
|
172
|
+
function kbReadHeaders(url, explicitId) {
|
|
173
|
+
const context = readKbExecutionContext();
|
|
174
|
+
if (!context) return explicitId ? { "X-KB-Read-Context": explicitId } : void 0;
|
|
175
|
+
if (new URL(url).origin !== context.origin || explicitId && explicitId !== context.readContextId)
|
|
176
|
+
fail("KB_READ_CONTEXT_MISMATCH");
|
|
177
|
+
return { "cli-token": context.token, "X-KB-Read-Context": context.readContextId };
|
|
178
|
+
}
|
|
179
|
+
function redactKbReadCredential(value) {
|
|
180
|
+
for (const token of secrets) value = value.split(token).join("[REDACTED]");
|
|
181
|
+
return value.replace(/cli_kbr_[A-Za-z0-9_-]+/g, "[REDACTED]");
|
|
182
|
+
}
|
|
183
|
+
|
|
51
184
|
// src/core/url-utils.ts
|
|
52
185
|
function normalizeUrl(url) {
|
|
53
186
|
if (!url) return url;
|
|
@@ -58,7 +191,7 @@ function normalizeUrl(url) {
|
|
|
58
191
|
}
|
|
59
192
|
|
|
60
193
|
// src/core/external-cli-token.ts
|
|
61
|
-
import
|
|
194
|
+
import fs2 from "fs";
|
|
62
195
|
var ExternalCliTokenError = class extends Error {
|
|
63
196
|
constructor(message, code = "EXTERNAL_CLI_TOKEN_INVALID") {
|
|
64
197
|
super(message);
|
|
@@ -98,9 +231,9 @@ function readExternalCliToken(hostOverride) {
|
|
|
98
231
|
if (!file.trim()) throw new ExternalCliTokenError("The external CLI token file path is empty.");
|
|
99
232
|
let data;
|
|
100
233
|
try {
|
|
101
|
-
const stat =
|
|
234
|
+
const stat = fs2.statSync(file);
|
|
102
235
|
if (!stat.isFile() || stat.size > 64 * 1024) throw new Error();
|
|
103
|
-
data = JSON.parse(
|
|
236
|
+
data = JSON.parse(fs2.readFileSync(file, "utf8"));
|
|
104
237
|
} catch {
|
|
105
238
|
throw new ExternalCliTokenError("The external CLI token file must be a readable JSON file no larger than 64 KiB.");
|
|
106
239
|
}
|
|
@@ -134,11 +267,11 @@ function redactExternalCliToken(value) {
|
|
|
134
267
|
}
|
|
135
268
|
const forms = [...diagnosticSecrets].flatMap((token) => [token, JSON.stringify(token).slice(1, -1), encodeURIComponent(token)]);
|
|
136
269
|
for (const form of [...new Set(forms)].sort((a, b) => b.length - a.length)) value = value.split(form).join("[REDACTED]");
|
|
137
|
-
return value;
|
|
270
|
+
return redactKbReadCredential(value);
|
|
138
271
|
}
|
|
139
272
|
|
|
140
273
|
// src/core/logger.ts
|
|
141
|
-
import
|
|
274
|
+
import fs3 from "fs";
|
|
142
275
|
import path from "path";
|
|
143
276
|
var LOG_DIR = path.join(process.env.HOME || "", ".ae-cli", "log");
|
|
144
277
|
var Logger = class {
|
|
@@ -157,8 +290,8 @@ var Logger = class {
|
|
|
157
290
|
return (/* @__PURE__ */ new Date()).toISOString().replace("T", " ").split(".")[0];
|
|
158
291
|
}
|
|
159
292
|
ensureDir() {
|
|
160
|
-
if (!
|
|
161
|
-
|
|
293
|
+
if (!fs3.existsSync(this.logDir)) {
|
|
294
|
+
fs3.mkdirSync(this.logDir, { recursive: true });
|
|
162
295
|
}
|
|
163
296
|
}
|
|
164
297
|
filePath(level) {
|
|
@@ -176,7 +309,7 @@ var Logger = class {
|
|
|
176
309
|
const line = `[${ts}] ${redactExternalCliToken(message)}
|
|
177
310
|
`;
|
|
178
311
|
try {
|
|
179
|
-
|
|
312
|
+
fs3.appendFileSync(this.filePath(level), line);
|
|
180
313
|
} catch {
|
|
181
314
|
}
|
|
182
315
|
}
|
|
@@ -220,89 +353,6 @@ var Logger = class {
|
|
|
220
353
|
};
|
|
221
354
|
var logger = new Logger();
|
|
222
355
|
|
|
223
|
-
// src/core/errors.ts
|
|
224
|
-
var PermissionError = class extends Error {
|
|
225
|
-
constructor(message, code, hint, details, meta) {
|
|
226
|
-
super(message);
|
|
227
|
-
this.code = code;
|
|
228
|
-
this.hint = hint;
|
|
229
|
-
this.details = details;
|
|
230
|
-
this.meta = meta;
|
|
231
|
-
this.name = "PermissionError";
|
|
232
|
-
}
|
|
233
|
-
code;
|
|
234
|
-
hint;
|
|
235
|
-
details;
|
|
236
|
-
meta;
|
|
237
|
-
};
|
|
238
|
-
function isApiErrorType(value) {
|
|
239
|
-
return value === "auth" || value === "permission" || value === "validation" || value === "not_found" || value === "api";
|
|
240
|
-
}
|
|
241
|
-
var CliValidationError = class extends Error {
|
|
242
|
-
code;
|
|
243
|
-
hint;
|
|
244
|
-
location;
|
|
245
|
-
constructor(message, options = {}) {
|
|
246
|
-
super(message);
|
|
247
|
-
this.name = "CliValidationError";
|
|
248
|
-
this.code = options.code;
|
|
249
|
-
this.hint = options.hint;
|
|
250
|
-
if (options.location) {
|
|
251
|
-
const location = {};
|
|
252
|
-
if (typeof options.location.segment === "number" && Number.isFinite(options.location.segment)) {
|
|
253
|
-
location.segment = options.location.segment;
|
|
254
|
-
}
|
|
255
|
-
if (typeof options.location.record === "number" && Number.isFinite(options.location.record)) {
|
|
256
|
-
location.record = options.location.record;
|
|
257
|
-
}
|
|
258
|
-
if (typeof options.location.field === "string" && options.location.field.length > 0) {
|
|
259
|
-
location.field = options.location.field;
|
|
260
|
-
}
|
|
261
|
-
if (Object.keys(location).length > 0) this.location = location;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
var CliApiError = class extends Error {
|
|
266
|
-
code;
|
|
267
|
-
hint;
|
|
268
|
-
meta;
|
|
269
|
-
constructor(message, options = {}) {
|
|
270
|
-
super(message);
|
|
271
|
-
this.name = "CliApiError";
|
|
272
|
-
this.code = options.code;
|
|
273
|
-
this.hint = options.hint;
|
|
274
|
-
this.meta = options.meta;
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
var CommunityReportError = class extends Error {
|
|
278
|
-
code;
|
|
279
|
-
httpStatus;
|
|
280
|
-
hint;
|
|
281
|
-
meta;
|
|
282
|
-
constructor(message, options = {}) {
|
|
283
|
-
super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
|
|
284
|
-
this.name = "CommunityReportError";
|
|
285
|
-
this.code = options.code;
|
|
286
|
-
this.httpStatus = options.httpStatus;
|
|
287
|
-
this.hint = options.hint;
|
|
288
|
-
this.meta = options.meta;
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
var LocalDataUploadError = class extends Error {
|
|
292
|
-
code;
|
|
293
|
-
httpStatus;
|
|
294
|
-
hint;
|
|
295
|
-
meta;
|
|
296
|
-
constructor(message, options = {}) {
|
|
297
|
-
super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
|
|
298
|
-
this.name = "LocalDataUploadError";
|
|
299
|
-
this.code = options.code;
|
|
300
|
-
this.httpStatus = options.httpStatus;
|
|
301
|
-
this.hint = options.hint;
|
|
302
|
-
this.meta = options.meta;
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
|
|
306
356
|
export {
|
|
307
357
|
__require,
|
|
308
358
|
__esm,
|
|
@@ -310,17 +360,21 @@ export {
|
|
|
310
360
|
__export,
|
|
311
361
|
__toESM,
|
|
312
362
|
__toCommonJS,
|
|
363
|
+
PermissionError,
|
|
364
|
+
isApiErrorType,
|
|
365
|
+
CliValidationError,
|
|
366
|
+
CliApiError,
|
|
367
|
+
CommunityReportError,
|
|
368
|
+
LocalDataUploadError,
|
|
369
|
+
kbExecutionContextRequired,
|
|
370
|
+
isKbQueryPath,
|
|
371
|
+
readKbExecutionContext,
|
|
372
|
+
kbReadHeaders,
|
|
313
373
|
normalizeUrl,
|
|
314
374
|
ExternalCliTokenError,
|
|
315
375
|
setExternalCliTokenFile,
|
|
316
376
|
readExternalCliToken,
|
|
317
377
|
externalCliTokenRequestOptions,
|
|
318
378
|
redactExternalCliToken,
|
|
319
|
-
logger
|
|
320
|
-
PermissionError,
|
|
321
|
-
isApiErrorType,
|
|
322
|
-
CliValidationError,
|
|
323
|
-
CliApiError,
|
|
324
|
-
CommunityReportError,
|
|
325
|
-
LocalDataUploadError
|
|
379
|
+
logger
|
|
326
380
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
fetchCliConfig,
|
|
4
|
+
formatCapabilityMissCompatHint,
|
|
5
|
+
getCachedCompatForHost,
|
|
6
|
+
getPendingHostCompatNotice,
|
|
7
|
+
getPendingUpdateNotice,
|
|
8
|
+
isCompatCacheStale,
|
|
9
|
+
isNonInteractiveOutput,
|
|
10
|
+
notifyIfHostCompat,
|
|
11
|
+
runHostCompatCheck,
|
|
12
|
+
shouldNotifyCompat,
|
|
13
|
+
shouldSkipAutoSync,
|
|
14
|
+
shouldSkipCompatCheck
|
|
15
|
+
} from "./chunk-CG773QXN.js";
|
|
16
|
+
import "./chunk-SOSFRU3O.js";
|
|
17
|
+
import "./chunk-4PSTYEG5.js";
|
|
18
|
+
import "./chunk-Z3Q2AEIN.js";
|
|
19
|
+
export {
|
|
20
|
+
fetchCliConfig,
|
|
21
|
+
formatCapabilityMissCompatHint,
|
|
22
|
+
getCachedCompatForHost,
|
|
23
|
+
getPendingHostCompatNotice,
|
|
24
|
+
getPendingUpdateNotice,
|
|
25
|
+
isCompatCacheStale,
|
|
26
|
+
isNonInteractiveOutput,
|
|
27
|
+
notifyIfHostCompat,
|
|
28
|
+
runHostCompatCheck,
|
|
29
|
+
shouldNotifyCompat,
|
|
30
|
+
shouldSkipAutoSync,
|
|
31
|
+
shouldSkipCompatCheck
|
|
32
|
+
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
invalidateBusinessSkillSynchronization,
|
|
4
|
+
refreshEnvironmentAfterLogin,
|
|
5
|
+
refreshEnvironmentConfig
|
|
6
|
+
} from "./chunk-AVXDJAFC.js";
|
|
2
7
|
import {
|
|
3
8
|
MultiselectCancelled,
|
|
4
9
|
promptSingleSelect
|
|
@@ -8,14 +13,17 @@ import {
|
|
|
8
13
|
missingAeHostHint
|
|
9
14
|
} from "./chunk-6ZIQV5GW.js";
|
|
10
15
|
import {
|
|
11
|
-
fetchCliConfig,
|
|
12
16
|
printError,
|
|
13
|
-
printOutput
|
|
17
|
+
printOutput
|
|
18
|
+
} from "./chunk-YULUBP3R.js";
|
|
19
|
+
import {
|
|
20
|
+
fetchCliConfig,
|
|
21
|
+
readCurrentBusinessConfig,
|
|
14
22
|
resolveKbAutoDiscoveryFeature
|
|
15
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CG773QXN.js";
|
|
16
24
|
import {
|
|
17
25
|
peekCliToken
|
|
18
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-SOSFRU3O.js";
|
|
19
27
|
import {
|
|
20
28
|
addHost,
|
|
21
29
|
getActiveHost,
|
|
@@ -25,10 +33,10 @@ import {
|
|
|
25
33
|
resolveHostSelector,
|
|
26
34
|
setActiveHost,
|
|
27
35
|
updateHostLabel
|
|
28
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-4PSTYEG5.js";
|
|
29
37
|
import {
|
|
30
38
|
normalizeUrl
|
|
31
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
32
40
|
|
|
33
41
|
// src/commands/config.ts
|
|
34
42
|
import * as readline2 from "readline";
|
|
@@ -70,7 +78,9 @@ Already active: \x1B[1m${item.host.label}\x1B[0m
|
|
|
70
78
|
`);
|
|
71
79
|
return;
|
|
72
80
|
}
|
|
81
|
+
invalidateBusinessSkillSynchronization();
|
|
73
82
|
setActiveHost(item.host.url);
|
|
83
|
+
await refreshEnvironmentAfterLogin(item.host.url);
|
|
74
84
|
process.stderr.write(`
|
|
75
85
|
\x1B[32m\u2713\x1B[0m Active environment: \x1B[1m${item.host.label}\x1B[0m ${item.host.url}
|
|
76
86
|
`);
|
|
@@ -104,6 +114,7 @@ async function promptAddEnvironment() {
|
|
|
104
114
|
const labelInput = await ask(`Label [${defaultLabel}]: `);
|
|
105
115
|
const label = labelInput || defaultLabel;
|
|
106
116
|
try {
|
|
117
|
+
invalidateBusinessSkillSynchronization();
|
|
107
118
|
addHost(url, label);
|
|
108
119
|
const active = listHosts().find((host) => host.url === url)?.active;
|
|
109
120
|
process.stderr.write(
|
|
@@ -112,6 +123,7 @@ async function promptAddEnvironment() {
|
|
|
112
123
|
`
|
|
113
124
|
);
|
|
114
125
|
if (active) {
|
|
126
|
+
await refreshEnvironmentAfterLogin(url);
|
|
115
127
|
process.stderr.write(` Authenticate if needed: ae-cli auth login --host ${url}
|
|
116
128
|
`);
|
|
117
129
|
}
|
|
@@ -156,11 +168,13 @@ async function promptRemoveEnvironment(host) {
|
|
|
156
168
|
process.stderr.write("Cancelled.\n");
|
|
157
169
|
return;
|
|
158
170
|
}
|
|
171
|
+
invalidateBusinessSkillSynchronization();
|
|
159
172
|
if (replacement) setActiveHost(replacement.url);
|
|
160
173
|
removeHost(host.url);
|
|
161
174
|
process.stderr.write(`\x1B[32m\u2713\x1B[0m Removed: ${host.label}
|
|
162
175
|
`);
|
|
163
176
|
if (replacement) {
|
|
177
|
+
await refreshEnvironmentAfterLogin(replacement.url);
|
|
164
178
|
process.stderr.write(` Active environment: ${replacement.label} ${replacement.url}
|
|
165
179
|
`);
|
|
166
180
|
} else if (listHosts().length === 0) {
|
|
@@ -274,6 +288,16 @@ function registerConfig(program) {
|
|
|
274
288
|
configCmd.command("current").description("Show the active AE environment").action(async () => {
|
|
275
289
|
await printCurrentConfig(program);
|
|
276
290
|
});
|
|
291
|
+
configCmd.command("refresh").description("Refresh business configuration and synchronize managed Skills for the active environment").action(async () => {
|
|
292
|
+
const host = program.opts().host || getActiveHost();
|
|
293
|
+
if (!host) {
|
|
294
|
+
failConfig("No active AE environment configured.", missingAeHostHint());
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const result = await refreshEnvironmentConfig(host, { synchronizeSkills: !program.opts().host });
|
|
298
|
+
await printOutput(result, program.opts().format || "json", program.opts().jq);
|
|
299
|
+
if (result.source === "unavailable" || ["failed", "partial", "busy"].includes(result.skills.status)) process.exitCode = 1;
|
|
300
|
+
});
|
|
277
301
|
configCmd.command("show").description("Show effective configuration for the selected AE host and account").action(async () => {
|
|
278
302
|
const host = program.opts().host || getActiveHost();
|
|
279
303
|
const token = host ? peekCliToken(host) : null;
|
|
@@ -281,6 +305,7 @@ function registerConfig(program) {
|
|
|
281
305
|
await printOutput(
|
|
282
306
|
{
|
|
283
307
|
host: host || null,
|
|
308
|
+
businesses: readCurrentBusinessConfig(host),
|
|
284
309
|
routing: { knowledge_base: feature.enabled ? "auto" : "explicit" },
|
|
285
310
|
source: feature.source
|
|
286
311
|
},
|
|
@@ -304,8 +329,10 @@ function registerConfig(program) {
|
|
|
304
329
|
try {
|
|
305
330
|
const normalized = normalizeUrl(url);
|
|
306
331
|
const label = opts.label || normalized;
|
|
332
|
+
invalidateBusinessSkillSynchronization();
|
|
307
333
|
addHost(normalized, label);
|
|
308
334
|
setActiveHost(normalized);
|
|
335
|
+
await refreshEnvironmentAfterLogin(normalized);
|
|
309
336
|
await printOutput(
|
|
310
337
|
{ activeHost: normalized, label: label.trim() },
|
|
311
338
|
program.opts().format || "json",
|
|
@@ -353,7 +380,9 @@ async function useConfigEnv(program, env) {
|
|
|
353
380
|
failHostResolution(env, target);
|
|
354
381
|
return;
|
|
355
382
|
}
|
|
383
|
+
invalidateBusinessSkillSynchronization();
|
|
356
384
|
setActiveHost(target.host.url);
|
|
385
|
+
await refreshEnvironmentAfterLogin(target.host.url);
|
|
357
386
|
await printOutput({ activeHost: target.host.url, label: target.host.label }, program.opts().format || "json", program.opts().jq);
|
|
358
387
|
}
|
|
359
388
|
async function addConfigEnv(program, url, opts) {
|
|
@@ -367,8 +396,10 @@ async function addConfigEnv(program, url, opts) {
|
|
|
367
396
|
return;
|
|
368
397
|
}
|
|
369
398
|
try {
|
|
399
|
+
invalidateBusinessSkillSynchronization();
|
|
370
400
|
addHost(normalized, opts.label);
|
|
371
401
|
if (opts.use) setActiveHost(normalized);
|
|
402
|
+
if (getActiveHost() === normalized) await refreshEnvironmentAfterLogin(normalized);
|
|
372
403
|
const saved = loadConfig();
|
|
373
404
|
await printOutput(
|
|
374
405
|
{
|
|
@@ -432,6 +463,7 @@ async function removeConfigEnv(program, env, skipConfirmation) {
|
|
|
432
463
|
return;
|
|
433
464
|
}
|
|
434
465
|
}
|
|
466
|
+
invalidateBusinessSkillSynchronization();
|
|
435
467
|
removeHost(target.host.url);
|
|
436
468
|
await printOutput(
|
|
437
469
|
{
|
|
@@ -2,15 +2,15 @@ import { createRequire as __createRequire } from 'node:module'; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
TeAgentApiError,
|
|
4
4
|
getFromMainApp
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JSBLCLFE.js";
|
|
6
6
|
import "./chunk-Y74WTIKJ.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-SOSFRU3O.js";
|
|
8
8
|
import {
|
|
9
9
|
safeJsonParse
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4PSTYEG5.js";
|
|
11
11
|
import {
|
|
12
12
|
CliValidationError
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
14
14
|
|
|
15
15
|
// src/core/current-page-context-client.ts
|
|
16
16
|
async function readCurrentPageContext(path) {
|