@thinkingai/ae-cli 6.0.63 → 6.0.64
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 +8 -3
- package/README.zh.md +8 -3
- package/dist/{ai-monitor-X5GL44JT.js → ai-monitor-ABPXAOYL.js} +5 -5
- package/dist/ai-monitor.js +6 -6
- package/dist/{auth-SPQ46XQ3.js → auth-EV4FSIFI.js} +3 -3
- package/dist/{capability-JZP4KXZC.js → capability-B35ZQSSB.js} +3 -3
- package/dist/{chunk-E457FREE.js → chunk-434DSEOC.js} +6 -5
- package/dist/{chunk-F7TCQPQX.js → chunk-4COJB2CS.js} +1 -1
- package/dist/{chunk-YJYC5PLL.js → chunk-4CRZ2YUC.js} +2 -1
- package/dist/{chunk-RYY5NJK3.js → chunk-66F7SOGR.js} +2 -2
- package/dist/{chunk-PRCHMOWT.js → chunk-7AQ5Y6F2.js} +1 -1
- package/dist/{chunk-FGGEF7MI.js → chunk-7TENODN4.js} +2 -2
- package/dist/{chunk-VR2D54AA.js → chunk-7XTWP3NB.js} +1 -1
- package/dist/{chunk-6HOM2FOJ.js → chunk-A3PREN6Q.js} +4 -14
- package/dist/{chunk-2VKMHNUU.js → chunk-KVTFUP5T.js} +3 -3
- package/dist/{compat-check-JD5D77ET.js → compat-check-V3NGDQA5.js} +1 -1
- package/dist/{config-IIMRATTP.js → config-7OPBS5RW.js} +3 -3
- package/dist/context-WAR22IGB.js +349 -0
- package/dist/index.js +22 -22
- package/dist/{metadata-ZVPG2MIA.js → metadata-OROUBOO5.js} +5 -5
- package/dist/{personal-semantic-preference-YNCV4QG3.js → personal-semantic-preference-UQXUQJO3.js} +40 -15
- package/dist/{project-semantic-E7ZAQL5S.js → project-semantic-LEU2SN6J.js} +262 -14
- package/dist/{sync-Y4OZRQAY.js → sync-JXJUSBN3.js} +2 -2
- package/dist/{te-agent-RKAUTYJZ.js → te-agent-W67K6QTR.js} +1 -1
- package/dist/{te-analysis-7N5VC4JB.js → te-analysis-TJ7XHW6J.js} +306 -49
- package/dist/{te-community-SIA2UHTS.js → te-community-YNFYG42J.js} +4 -4
- package/dist/{te-dataops-5MJQCODU.js → te-dataops-GASA7SEG.js} +721 -217
- package/dist/{te-engage-ZTLOMKO3.js → te-engage-4CGFYLP6.js} +4 -4
- package/dist/{te-kb-LDL3MF2Y.js → te-kb-2ZYZKMDW.js} +27 -7
- package/dist/{te-team-JOWHCMZA.js → te-team-ZFQANIPN.js} +4 -4
- package/dist/{things-DOQ2L3O2.js → things-AYKSVWGZ.js} +1 -1
- package/dist/{update-KUS6TCPB.js → update-EDWNZQ6B.js} +2 -2
- package/package.json +4 -3
- package/skills/ae-analysis/SKILL.md +41 -16
- package/skills/ae-analysis/references/adhoc_export.md +1 -1
- package/skills/ae-analysis/references/adhoc_run.md +8 -2
- package/skills/ae-analysis/references/analysis_drilldown_contract.md +1 -1
- package/skills/ae-analysis/references/audience_scheduling.md +30 -0
- package/skills/ae-analysis/references/business_semantics_workspace.md +57 -0
- package/skills/ae-analysis/references/command_index.md +18 -13
- package/skills/ae-analysis/references/context_prepare.md +49 -0
- package/skills/ae-analysis/references/drilldown_entities_export.md +1 -1
- package/skills/ae-analysis/references/drilldown_entities_run.md +1 -1
- package/skills/ae-analysis/references/drilldown_user_events_export.md +3 -1
- package/skills/ae-analysis/references/drilldown_user_events_run.md +2 -1
- package/skills/ae-analysis/references/governance_recommendation_export.md +1 -1
- package/skills/ae-analysis/references/personal_semantic_preference_add.md +5 -1
- package/skills/ae-analysis/references/personal_semantic_preference_get.md +4 -2
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +7 -6
- package/skills/ae-analysis/references/personal_semantic_preference_submit.md +1 -1
- package/skills/ae-analysis/references/personal_semantic_preference_update.md +5 -1
- package/skills/ae-analysis/references/project_info_get.md +4 -0
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +1 -1
- package/skills/ae-analysis/references/project_semantic_setup.md +60 -0
- package/skills/ae-analysis/references/report_get.md +2 -0
- package/skills/ae-analysis/references/report_presentation.md +55 -0
- package/skills/ae-analysis/references/report_update.md +4 -2
- package/skills/ae-analysis/references/system_openapi_token_batch_generate.md +20 -0
- package/skills/ae-analysis/references/system_openapi_token_get.md +14 -0
- package/skills/ae-analysis/references/user_cluster_create.md +3 -1
- package/skills/ae-analysis/references/user_cluster_models.md +2 -0
- package/skills/ae-analysis/references/user_cluster_update.md +5 -3
- package/skills/ae-analysis/references/user_tag_create.md +4 -22
- package/skills/ae-analysis/references/user_tag_models.md +8 -0
- package/skills/ae-analysis/references/user_tag_update.md +6 -14
- package/skills/ae-analysis/scripts/read-semantic-catalog.mjs +40 -0
- package/skills/ae-dataops/SKILL.md +9 -6
- package/skills/ae-dataops/references/dataops-flow-create.md +64 -47
- package/skills/ae-dataops/references/dataops-flow-monitor.md +4 -2
- package/skills/ae-dataops/references/dataops-flow-python.md +109 -0
- package/skills/ae-kb/SKILL.md +10 -5
- package/skills/ae-kb/references/analysis-workflow.md +19 -10
- package/skills/ae-kb/references/query-workflow.md +34 -17
- package/skills/ae-kb-discovery/SKILL.md +4 -3
- package/dist/context-BXHIPIIX.js +0 -138
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
TeAgentApiError,
|
|
4
|
+
getFromMainApp
|
|
5
|
+
} from "./chunk-ETQXIZFP.js";
|
|
6
|
+
import {
|
|
7
|
+
executeCapabilityWithEnvelope,
|
|
8
|
+
readCliAgentContext
|
|
9
|
+
} from "./chunk-A3PREN6Q.js";
|
|
10
|
+
import "./chunk-NNK3JBH4.js";
|
|
11
|
+
import "./chunk-PUSFEC6B.js";
|
|
12
|
+
import {
|
|
13
|
+
getCliToken,
|
|
14
|
+
internalCallSourceHeaders
|
|
15
|
+
} from "./chunk-PLNS5J33.js";
|
|
16
|
+
import {
|
|
17
|
+
getConfigDir,
|
|
18
|
+
safeJsonParse
|
|
19
|
+
} from "./chunk-AMURHMS3.js";
|
|
20
|
+
import {
|
|
21
|
+
CliValidationError,
|
|
22
|
+
normalizeUrl
|
|
23
|
+
} from "./chunk-R2SVAO4G.js";
|
|
24
|
+
|
|
25
|
+
// src/core/current-page-context-client.ts
|
|
26
|
+
async function readCurrentPageContext(path) {
|
|
27
|
+
const url = process.env.TE_AGENT_PAGE_CONTEXT_MCP_URL;
|
|
28
|
+
const grant = process.env.TE_AGENT_PAGE_CONTEXT_TOKEN;
|
|
29
|
+
if (url === void 0 && grant === void 0) return getFromMainApp(path);
|
|
30
|
+
let endpoint;
|
|
31
|
+
try {
|
|
32
|
+
endpoint = new URL(url ?? "");
|
|
33
|
+
if (!grant || !["http:", "https:"].includes(endpoint.protocol) || endpoint.username || endpoint.password || endpoint.search || endpoint.hash || !endpoint.pathname.endsWith("/api/internal/dashboard-context/mcp")) throw new Error();
|
|
34
|
+
} catch {
|
|
35
|
+
throw new TeAgentApiError("Current page context Run binding is invalid.", 0, "CURRENT_PAGE_CONTEXT_BINDING_INVALID");
|
|
36
|
+
}
|
|
37
|
+
let response;
|
|
38
|
+
try {
|
|
39
|
+
response = await fetch(endpoint.toString(), {
|
|
40
|
+
method: "POST",
|
|
41
|
+
redirect: "error",
|
|
42
|
+
signal: AbortSignal.timeout(3e4),
|
|
43
|
+
headers: {
|
|
44
|
+
"Content-Type": "application/json",
|
|
45
|
+
Accept: "application/json, text/event-stream",
|
|
46
|
+
"MCP-Protocol-Version": "2025-03-26",
|
|
47
|
+
"X-TE-Page-Context-Token": grant,
|
|
48
|
+
...internalCallSourceHeaders()
|
|
49
|
+
},
|
|
50
|
+
body: JSON.stringify({
|
|
51
|
+
jsonrpc: "2.0",
|
|
52
|
+
id: 1,
|
|
53
|
+
method: "tools/call",
|
|
54
|
+
params: { name: "read_current_page_context", arguments: {} }
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
} catch {
|
|
58
|
+
throw new TeAgentApiError("Current page context MCP request failed.", 0, "CURRENT_PAGE_CONTEXT_NETWORK_ERROR");
|
|
59
|
+
}
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
await response.body?.cancel();
|
|
62
|
+
throw new TeAgentApiError(
|
|
63
|
+
`Current page context authorization/request failed (HTTP ${response.status}).`,
|
|
64
|
+
response.status,
|
|
65
|
+
"CURRENT_PAGE_CONTEXT_UNAVAILABLE",
|
|
66
|
+
void 0,
|
|
67
|
+
response.status === 403 ? "permission" : response.status === 401 ? "auth" : "api"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
const reader = response.body?.getReader();
|
|
71
|
+
if (!reader) throw invalidResponse();
|
|
72
|
+
const chunks = [];
|
|
73
|
+
let size = 0;
|
|
74
|
+
try {
|
|
75
|
+
while (true) {
|
|
76
|
+
const { value, done } = await reader.read();
|
|
77
|
+
if (done) break;
|
|
78
|
+
size += value.byteLength;
|
|
79
|
+
if (size > 4 * 1024 * 1024) throw invalidResponse();
|
|
80
|
+
chunks.push(value);
|
|
81
|
+
}
|
|
82
|
+
} catch {
|
|
83
|
+
await reader.cancel().catch(() => void 0);
|
|
84
|
+
throw invalidResponse();
|
|
85
|
+
} finally {
|
|
86
|
+
reader.releaseLock();
|
|
87
|
+
}
|
|
88
|
+
let envelope;
|
|
89
|
+
try {
|
|
90
|
+
envelope = safeJsonParse(Buffer.concat(chunks).toString("utf8"));
|
|
91
|
+
} catch {
|
|
92
|
+
throw invalidResponse();
|
|
93
|
+
}
|
|
94
|
+
if (envelope?.error || envelope?.result?.isError) {
|
|
95
|
+
throw new TeAgentApiError(
|
|
96
|
+
"Current page context is unavailable for this Run; authorization may have expired or been revoked.",
|
|
97
|
+
403,
|
|
98
|
+
"CURRENT_PAGE_CONTEXT_UNAVAILABLE"
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
const content = envelope?.result?.content;
|
|
102
|
+
if (envelope?.jsonrpc !== "2.0" || envelope.id !== 1 || !Array.isArray(content) || content.length !== 1 || content[0]?.type !== "text") throw invalidResponse();
|
|
103
|
+
try {
|
|
104
|
+
return safeJsonParse(content[0].text);
|
|
105
|
+
} catch {
|
|
106
|
+
throw invalidResponse();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function invalidResponse() {
|
|
110
|
+
return new TeAgentApiError("Invalid current page context MCP response.", 0, "CURRENT_PAGE_CONTEXT_RESPONSE_INVALID");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// src/commands/context/current.ts
|
|
114
|
+
var CURRENT_PAGE_CONTEXT_PATH = "/api/sandbox/agent/context/current";
|
|
115
|
+
function createCurrentPageContextCommand(read = readCurrentPageContext, readConversationId = () => process.env.TE_AGENT_CONVERSATION_ID) {
|
|
116
|
+
return {
|
|
117
|
+
service: "context",
|
|
118
|
+
command: "+current",
|
|
119
|
+
description: "Read the current page context bound to the active Agent Run",
|
|
120
|
+
flags: [],
|
|
121
|
+
risk: "read",
|
|
122
|
+
usesAeHost: false,
|
|
123
|
+
execute: async () => {
|
|
124
|
+
const conversationId = readConversationId()?.trim();
|
|
125
|
+
if (!conversationId) {
|
|
126
|
+
throw new CliValidationError(
|
|
127
|
+
"Current page context is available only inside an active Agent Run.",
|
|
128
|
+
{
|
|
129
|
+
code: "CURRENT_PAGE_CONTEXT_RUN_REQUIRED",
|
|
130
|
+
hint: "Open AE Agent from a supported product page and ask about the current page."
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
const query = new URLSearchParams({ conversationId });
|
|
135
|
+
return read(`${CURRENT_PAGE_CONTEXT_PATH}?${query.toString()}`);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
var currentPageContext = createCurrentPageContextCommand();
|
|
140
|
+
|
|
141
|
+
// src/commands/context/prepare.ts
|
|
142
|
+
import { createHash, randomUUID } from "crypto";
|
|
143
|
+
import { mkdir, readFile, rename, writeFile, unlink } from "fs/promises";
|
|
144
|
+
import { join } from "path";
|
|
145
|
+
var defaults = {
|
|
146
|
+
call: async (host, capability, input) => (await executeCapabilityWithEnvelope(host, "analysis", capability, input)).data,
|
|
147
|
+
// A credential is bound to its company and account. Persist only its digest; a
|
|
148
|
+
// credential change conservatively starts another scope, including token rotation.
|
|
149
|
+
identity: async (host) => digest(await getCliToken(host)),
|
|
150
|
+
session: () => readCliAgentContext().agent_session_id,
|
|
151
|
+
cacheRoot: () => join(getConfigDir(), "analysis-context")
|
|
152
|
+
};
|
|
153
|
+
var PAGE_CHARACTERS = 16e3;
|
|
154
|
+
var digest = (value) => createHash("sha256").update(value).digest("hex");
|
|
155
|
+
function invalid(message) {
|
|
156
|
+
throw new CliValidationError(message, { code: "ANALYSIS_CONTEXT_INVALID" });
|
|
157
|
+
}
|
|
158
|
+
function catalog(value) {
|
|
159
|
+
const data = value;
|
|
160
|
+
if (!data || data.complete !== true || data.truncated === true || !Array.isArray(data.items) || data.total !== data.items.length) invalid("A complete semantic catalog is required.");
|
|
161
|
+
const seen = /* @__PURE__ */ new Set();
|
|
162
|
+
for (const row of data.items) {
|
|
163
|
+
if (!row || typeof row.id !== "string" || !row.id || seen.has(row.id) || typeof row.title !== "string" || typeof row.summary !== "string" || !Number.isSafeInteger(row.revision) || row.revision < 1 || typeof row.expired !== "boolean" || row.keywords !== void 0 && (!Array.isArray(row.keywords) || row.keywords.some((keyword) => typeof keyword !== "string"))) {
|
|
164
|
+
invalid("A semantic catalog contains invalid or duplicate entries.");
|
|
165
|
+
}
|
|
166
|
+
seen.add(row.id);
|
|
167
|
+
}
|
|
168
|
+
return data;
|
|
169
|
+
}
|
|
170
|
+
function background(value) {
|
|
171
|
+
if (!value || typeof value !== "object" || Array.isArray(value) || typeof value.configured !== "boolean") {
|
|
172
|
+
invalid("Published background response must explicitly report configured.");
|
|
173
|
+
}
|
|
174
|
+
return value;
|
|
175
|
+
}
|
|
176
|
+
function options(ctx, deps) {
|
|
177
|
+
const session = ctx.str("session-id") || deps.session();
|
|
178
|
+
if (!session?.trim() || session.length > 191 || /[\x00-\x1f\x7f]/.test(session)) {
|
|
179
|
+
throw new CliValidationError("A stable Agent session ID is required for context preparation.", {
|
|
180
|
+
code: "ANALYSIS_CONTEXT_SESSION_REQUIRED",
|
|
181
|
+
hint: "Set agent_session_id in the effective CLI Agent context file, or pass --session-id. Use a new ID for each conversation."
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
const projectId = ctx.optionalNum("project-id");
|
|
185
|
+
if (projectId !== void 0 && (!Number.isSafeInteger(projectId) || projectId <= 0)) {
|
|
186
|
+
invalid("project-id must be a positive integer when supplied.");
|
|
187
|
+
}
|
|
188
|
+
const page = ctx.optionalNum("page") ?? 1;
|
|
189
|
+
if (!Number.isSafeInteger(page) || page < 1) invalid("page must be a positive integer.");
|
|
190
|
+
return { session, projectId, page };
|
|
191
|
+
}
|
|
192
|
+
async function save(path, value) {
|
|
193
|
+
const temp = `${path}.${randomUUID()}.tmp`;
|
|
194
|
+
try {
|
|
195
|
+
await writeFile(temp, JSON.stringify(value), { mode: 384, flag: "wx" });
|
|
196
|
+
await rename(temp, path);
|
|
197
|
+
} finally {
|
|
198
|
+
await unlink(temp).catch((error) => {
|
|
199
|
+
if (error.code !== "ENOENT") throw error;
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
async function load(path, binding, project = false) {
|
|
204
|
+
let value;
|
|
205
|
+
try {
|
|
206
|
+
value = JSON.parse(await readFile(path, "utf8"));
|
|
207
|
+
} catch (error) {
|
|
208
|
+
if (error.code === "ENOENT") return void 0;
|
|
209
|
+
throw new CliValidationError("Context cache is unreadable. Use --refresh to prepare it again.", {
|
|
210
|
+
code: "ANALYSIS_CONTEXT_CACHE_INVALID"
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
if (value.version === 1) return void 0;
|
|
214
|
+
if (value.version !== 2 || value.binding !== binding) invalid("Context cache scope does not match this request.");
|
|
215
|
+
background(value.background);
|
|
216
|
+
catalog(value.personal);
|
|
217
|
+
if (project && !value.public) invalid("Project context cache is missing its public catalog.");
|
|
218
|
+
if (value.public) catalog(value.public);
|
|
219
|
+
return value;
|
|
220
|
+
}
|
|
221
|
+
function directoryItems(catalog2, scope) {
|
|
222
|
+
return catalog2.items.map((row) => ({ kind: "semantic", scope, ...row }));
|
|
223
|
+
}
|
|
224
|
+
function pages(items) {
|
|
225
|
+
const result = [[]];
|
|
226
|
+
let size = 0;
|
|
227
|
+
for (const item of items) {
|
|
228
|
+
const length = JSON.stringify(item).length;
|
|
229
|
+
if (length > PAGE_CHARACTERS) invalid("A context item exceeds the bounded output size; it was not truncated.");
|
|
230
|
+
if (size + length > PAGE_CHARACTERS && result.at(-1).length) {
|
|
231
|
+
result.push([]);
|
|
232
|
+
size = 0;
|
|
233
|
+
}
|
|
234
|
+
result.at(-1).push(item);
|
|
235
|
+
size += length;
|
|
236
|
+
}
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
function createContextPrepareCommand(overrides = {}) {
|
|
240
|
+
const deps = { ...defaults, ...overrides };
|
|
241
|
+
return {
|
|
242
|
+
service: "context",
|
|
243
|
+
command: "prepare",
|
|
244
|
+
description: "Prepare company/global personal context, then optional project background and full personal/public catalogs. Reuse a private session snapshot.",
|
|
245
|
+
helpText: "Before every business workflow, use prepare without a project, consume all pages, select the project, then prepare --project-id. Existing business commands do not initialize context automatically.",
|
|
246
|
+
flags: [
|
|
247
|
+
{ name: "project-id", type: "number", desc: "Optional selected project. Omit until project selection; global preparation always precedes a new project scope." },
|
|
248
|
+
{ name: "session-id", type: "string", desc: "Stable conversation ID. Defaults to agent_session_id from the effective CLI Agent context." },
|
|
249
|
+
{ name: "page", type: "number", desc: "One-based bounded output page. Consume every page from the same cached snapshot. Default: 1." },
|
|
250
|
+
{ name: "refresh", type: "boolean", desc: "Explicitly replace this scope and its global snapshot after context changes. Not needed for ordinary follow-up actions." }
|
|
251
|
+
],
|
|
252
|
+
risk: "read",
|
|
253
|
+
sensitiveOutput: true,
|
|
254
|
+
validate: (ctx) => {
|
|
255
|
+
options(ctx, deps);
|
|
256
|
+
},
|
|
257
|
+
dryRun: async (ctx) => ({ workflow: "analysis_context_prepare", ...options(ctx, deps), remote_writes: false }),
|
|
258
|
+
execute: async (ctx) => {
|
|
259
|
+
const { session, projectId, page } = options(ctx, deps);
|
|
260
|
+
const host = normalizeUrl(ctx.host());
|
|
261
|
+
const identity = await deps.identity(host);
|
|
262
|
+
const binding = digest(JSON.stringify([host, identity, session]));
|
|
263
|
+
const root = join(deps.cacheRoot(), binding);
|
|
264
|
+
const globalPath = join(root, "global.json");
|
|
265
|
+
const projectPath = projectId === void 0 ? void 0 : join(root, `project-${projectId}.json`);
|
|
266
|
+
const refresh = ctx.bool("refresh");
|
|
267
|
+
if (refresh && page !== 1) invalid("Refresh must start at page 1.");
|
|
268
|
+
if (refresh) {
|
|
269
|
+
for (const path of [globalPath, projectPath]) {
|
|
270
|
+
if (path) await unlink(path).catch((error) => {
|
|
271
|
+
if (error.code !== "ENOENT") throw error;
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
let global = refresh ? void 0 : await load(globalPath, binding);
|
|
276
|
+
let project = projectPath && !refresh ? await load(projectPath, `${binding}:${projectId}`, true) : void 0;
|
|
277
|
+
const globalCached = !!global;
|
|
278
|
+
const projectCached = !!project;
|
|
279
|
+
if (page > 1 && (!global || projectPath && !project)) {
|
|
280
|
+
invalid("Prepare page 1 before requesting another page.");
|
|
281
|
+
}
|
|
282
|
+
const call = (operation, id, extra = {}) => deps.call(host, `business_semantics.${operation}`, { project_id: id, ...extra });
|
|
283
|
+
if (!global) {
|
|
284
|
+
const company = background(await call("background.get", 0));
|
|
285
|
+
const personal = catalog(await call("global_personal_context.list", -1));
|
|
286
|
+
global = { version: 2, binding, prepared_at: (/* @__PURE__ */ new Date()).toISOString(), background: company, personal };
|
|
287
|
+
await mkdir(root, { recursive: true, mode: 448 });
|
|
288
|
+
await save(globalPath, global);
|
|
289
|
+
}
|
|
290
|
+
if (projectId !== void 0 && !project) {
|
|
291
|
+
const published = background(await call("background.get", projectId));
|
|
292
|
+
const personal = catalog(await call("personal_context.list", projectId, { for_analysis_context: true }));
|
|
293
|
+
if (personal.selection_policy !== "ANALYSIS_CONTEXT") {
|
|
294
|
+
invalid("The server must support analysis-context personal semantic filtering. Deploy the matching Common service.");
|
|
295
|
+
}
|
|
296
|
+
const projectPublic = catalog(await call("project_context.list", projectId));
|
|
297
|
+
project = {
|
|
298
|
+
version: 2,
|
|
299
|
+
binding: `${binding}:${projectId}`,
|
|
300
|
+
prepared_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
301
|
+
background: published,
|
|
302
|
+
personal,
|
|
303
|
+
public: projectPublic
|
|
304
|
+
};
|
|
305
|
+
await save(projectPath, project);
|
|
306
|
+
}
|
|
307
|
+
const items = [
|
|
308
|
+
{ kind: "background", scope: "company", ...global.background },
|
|
309
|
+
...directoryItems(global.personal, "global_personal"),
|
|
310
|
+
...project ? [
|
|
311
|
+
{ kind: "background", scope: "project", ...project.background },
|
|
312
|
+
...directoryItems(project.personal, "project_personal"),
|
|
313
|
+
...directoryItems(project.public, "project_public")
|
|
314
|
+
] : []
|
|
315
|
+
];
|
|
316
|
+
const outputPages = pages(items);
|
|
317
|
+
if (page > outputPages.length) invalid("Requested context page does not exist.");
|
|
318
|
+
return {
|
|
319
|
+
workflow: "analysis_context_prepare",
|
|
320
|
+
phase: project ? "project" : "global",
|
|
321
|
+
session_id: session,
|
|
322
|
+
...projectId === void 0 ? {} : { project_id: projectId },
|
|
323
|
+
cache_hit: globalCached && (!project || projectCached),
|
|
324
|
+
global_cache_hit: globalCached,
|
|
325
|
+
...project ? { project_cache_hit: projectCached } : {},
|
|
326
|
+
prepared_at: project?.prepared_at ?? global.prepared_at,
|
|
327
|
+
complete: true,
|
|
328
|
+
page,
|
|
329
|
+
total_pages: outputPages.length,
|
|
330
|
+
remaining_pages: outputPages.length - page,
|
|
331
|
+
total_source_entries: global.personal.total + (project?.personal.total ?? 0) + (project?.public?.total ?? 0),
|
|
332
|
+
total_presented_entries: items.filter((item) => item.kind === "semantic").length,
|
|
333
|
+
items: outputPages[page - 1],
|
|
334
|
+
remote_writes: false,
|
|
335
|
+
next_action: page < outputPages.length ? `Read context prepare --page ${page + 1}${projectId === void 0 ? "" : ` --project-id ${projectId}`} with the same host/session.` : "Retain this complete context. Read relevant current details and dependencies by original ID; mark only actually adopted entries. Preparation is not semantic use."
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
var contextPrepare = createContextPrepareCommand();
|
|
341
|
+
|
|
342
|
+
// src/commands/context/index.ts
|
|
343
|
+
var commands = [currentPageContext, contextPrepare];
|
|
344
|
+
var context_default = commands;
|
|
345
|
+
export {
|
|
346
|
+
contextPrepare,
|
|
347
|
+
currentPageContext,
|
|
348
|
+
context_default as default
|
|
349
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -27,18 +27,18 @@ import {
|
|
|
27
27
|
configureBusinessCommands,
|
|
28
28
|
parseProgram,
|
|
29
29
|
runCommand
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-KVTFUP5T.js";
|
|
31
31
|
import "./chunk-EFGUBGA6.js";
|
|
32
32
|
import "./chunk-ETQXIZFP.js";
|
|
33
33
|
import "./chunk-LFJ7N36I.js";
|
|
34
34
|
import {
|
|
35
35
|
printError,
|
|
36
36
|
printOutput
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-7XTWP3NB.js";
|
|
38
38
|
import {
|
|
39
39
|
executeCapability,
|
|
40
40
|
uploadInputFileBytes
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-A3PREN6Q.js";
|
|
42
42
|
import "./chunk-NNK3JBH4.js";
|
|
43
43
|
import {
|
|
44
44
|
beginBusinessSkillRefresh,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
runHostCompatCheck,
|
|
53
53
|
shouldSkipAutoSync,
|
|
54
54
|
syncRefreshedBusinessSkills
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-4CRZ2YUC.js";
|
|
56
56
|
import {
|
|
57
57
|
getLocalCliPackageInfo
|
|
58
58
|
} from "./chunk-PUSFEC6B.js";
|
|
@@ -2145,43 +2145,43 @@ function warnLoadFailure(label, err) {
|
|
|
2145
2145
|
async function loadCommands() {
|
|
2146
2146
|
const commands = [];
|
|
2147
2147
|
try {
|
|
2148
|
-
const teAnalysis = await import("./te-analysis-
|
|
2148
|
+
const teAnalysis = await import("./te-analysis-TJ7XHW6J.js");
|
|
2149
2149
|
commands.push(...teAnalysis.default);
|
|
2150
2150
|
} catch (err) {
|
|
2151
2151
|
warnLoadFailure("domain te-analysis", err);
|
|
2152
2152
|
}
|
|
2153
2153
|
try {
|
|
2154
|
-
const engage = await import("./te-engage-
|
|
2154
|
+
const engage = await import("./te-engage-4CGFYLP6.js");
|
|
2155
2155
|
commands.push(...engage.default);
|
|
2156
2156
|
} catch (err) {
|
|
2157
2157
|
warnLoadFailure("domain te-engage", err);
|
|
2158
2158
|
}
|
|
2159
2159
|
try {
|
|
2160
|
-
const community = await import("./te-community-
|
|
2160
|
+
const community = await import("./te-community-YNFYG42J.js");
|
|
2161
2161
|
commands.push(...community.default);
|
|
2162
2162
|
} catch (err) {
|
|
2163
2163
|
warnLoadFailure("domain te-community", err);
|
|
2164
2164
|
}
|
|
2165
2165
|
try {
|
|
2166
|
-
const dataops = await import("./te-dataops-
|
|
2166
|
+
const dataops = await import("./te-dataops-GASA7SEG.js");
|
|
2167
2167
|
commands.push(...dataops.default);
|
|
2168
2168
|
} catch (err) {
|
|
2169
2169
|
warnLoadFailure("domain te-dataops", err);
|
|
2170
2170
|
}
|
|
2171
2171
|
try {
|
|
2172
|
-
const teKb = await import("./te-kb-
|
|
2172
|
+
const teKb = await import("./te-kb-2ZYZKMDW.js");
|
|
2173
2173
|
commands.push(...teKb.default);
|
|
2174
2174
|
} catch (err) {
|
|
2175
2175
|
warnLoadFailure("domain te-kb", err);
|
|
2176
2176
|
}
|
|
2177
2177
|
try {
|
|
2178
|
-
const teTeam = await import("./te-team-
|
|
2178
|
+
const teTeam = await import("./te-team-ZFQANIPN.js");
|
|
2179
2179
|
commands.push(...teTeam.default);
|
|
2180
2180
|
} catch (err) {
|
|
2181
2181
|
warnLoadFailure("domain te-team", err);
|
|
2182
2182
|
}
|
|
2183
2183
|
try {
|
|
2184
|
-
const teAgent = await import("./te-agent-
|
|
2184
|
+
const teAgent = await import("./te-agent-W67K6QTR.js");
|
|
2185
2185
|
commands.push(...teAgent.default);
|
|
2186
2186
|
} catch (err) {
|
|
2187
2187
|
warnLoadFailure("domain te-agent", err);
|
|
@@ -2195,7 +2195,7 @@ async function loadCommands() {
|
|
|
2195
2195
|
const automation = await import("./automation-7XC3VBZI.js");
|
|
2196
2196
|
commands.push(...automation.default);
|
|
2197
2197
|
try {
|
|
2198
|
-
const things = await import("./things-
|
|
2198
|
+
const things = await import("./things-AYKSVWGZ.js");
|
|
2199
2199
|
commands.push(...things.default);
|
|
2200
2200
|
} catch (err) {
|
|
2201
2201
|
warnLoadFailure("domain things", err);
|
|
@@ -2213,19 +2213,19 @@ async function loadCommands() {
|
|
|
2213
2213
|
warnLoadFailure("domain te-system", err);
|
|
2214
2214
|
}
|
|
2215
2215
|
try {
|
|
2216
|
-
const metadata = await import("./metadata-
|
|
2216
|
+
const metadata = await import("./metadata-OROUBOO5.js");
|
|
2217
2217
|
commands.push(...metadata.default);
|
|
2218
2218
|
} catch (err) {
|
|
2219
2219
|
warnLoadFailure("domain metadata", err);
|
|
2220
2220
|
}
|
|
2221
2221
|
try {
|
|
2222
|
-
const personalSemanticPreference = await import("./personal-semantic-preference-
|
|
2222
|
+
const personalSemanticPreference = await import("./personal-semantic-preference-UQXUQJO3.js");
|
|
2223
2223
|
commands.push(...personalSemanticPreference.default);
|
|
2224
2224
|
} catch (err) {
|
|
2225
2225
|
warnLoadFailure("domain personal-semantic-preference", err);
|
|
2226
2226
|
}
|
|
2227
2227
|
try {
|
|
2228
|
-
const projectSemantic = await import("./project-semantic-
|
|
2228
|
+
const projectSemantic = await import("./project-semantic-LEU2SN6J.js");
|
|
2229
2229
|
commands.push(...projectSemantic.default);
|
|
2230
2230
|
} catch (err) {
|
|
2231
2231
|
warnLoadFailure("domain project-semantic", err);
|
|
@@ -2237,13 +2237,13 @@ async function loadCommands() {
|
|
|
2237
2237
|
warnLoadFailure("domain data-integration", err);
|
|
2238
2238
|
}
|
|
2239
2239
|
try {
|
|
2240
|
-
const context = await import("./context-
|
|
2240
|
+
const context = await import("./context-WAR22IGB.js");
|
|
2241
2241
|
commands.push(...context.default);
|
|
2242
2242
|
} catch (err) {
|
|
2243
2243
|
warnLoadFailure("domain context", err);
|
|
2244
2244
|
}
|
|
2245
2245
|
try {
|
|
2246
|
-
const aiMonitor = await import("./ai-monitor-
|
|
2246
|
+
const aiMonitor = await import("./ai-monitor-ABPXAOYL.js");
|
|
2247
2247
|
commands.push(...aiMonitor.default);
|
|
2248
2248
|
} catch (err) {
|
|
2249
2249
|
warnLoadFailure("domain ai-monitor", err);
|
|
@@ -2258,7 +2258,7 @@ async function loadCommands() {
|
|
|
2258
2258
|
}
|
|
2259
2259
|
async function registerAuthCommands() {
|
|
2260
2260
|
try {
|
|
2261
|
-
const { registerAuth } = await import("./auth-
|
|
2261
|
+
const { registerAuth } = await import("./auth-EV4FSIFI.js");
|
|
2262
2262
|
registerAuth(program);
|
|
2263
2263
|
} catch (err) {
|
|
2264
2264
|
warnLoadFailure("auth commands", err);
|
|
@@ -2266,7 +2266,7 @@ async function registerAuthCommands() {
|
|
|
2266
2266
|
}
|
|
2267
2267
|
async function registerConfigCommands() {
|
|
2268
2268
|
try {
|
|
2269
|
-
const { registerConfig } = await import("./config-
|
|
2269
|
+
const { registerConfig } = await import("./config-7OPBS5RW.js");
|
|
2270
2270
|
registerConfig(program);
|
|
2271
2271
|
} catch (err) {
|
|
2272
2272
|
warnLoadFailure("config commands", err);
|
|
@@ -2274,7 +2274,7 @@ async function registerConfigCommands() {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
async function registerCapabilityCommands() {
|
|
2276
2276
|
try {
|
|
2277
|
-
const { registerCapability } = await import("./capability-
|
|
2277
|
+
const { registerCapability } = await import("./capability-B35ZQSSB.js");
|
|
2278
2278
|
registerCapability(program);
|
|
2279
2279
|
} catch (err) {
|
|
2280
2280
|
warnLoadFailure("capability commands", err);
|
|
@@ -2282,7 +2282,7 @@ async function registerCapabilityCommands() {
|
|
|
2282
2282
|
}
|
|
2283
2283
|
async function registerSyncCommand() {
|
|
2284
2284
|
try {
|
|
2285
|
-
const { registerSync } = await import("./sync-
|
|
2285
|
+
const { registerSync } = await import("./sync-JXJUSBN3.js");
|
|
2286
2286
|
registerSync(program);
|
|
2287
2287
|
} catch (err) {
|
|
2288
2288
|
warnLoadFailure("sync commands", err);
|
|
@@ -2298,7 +2298,7 @@ async function registerModelCommand() {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
async function registerUpdateCommand() {
|
|
2300
2300
|
try {
|
|
2301
|
-
const { registerUpdate } = await import("./update-
|
|
2301
|
+
const { registerUpdate } = await import("./update-EDWNZQ6B.js");
|
|
2302
2302
|
registerUpdate(program);
|
|
2303
2303
|
} catch (err) {
|
|
2304
2304
|
warnLoadFailure("update commands", err);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
withAsyncArtifactLifecycle
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-66F7SOGR.js";
|
|
5
5
|
import {
|
|
6
6
|
createCapabilityCommand
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-434DSEOC.js";
|
|
8
8
|
import {
|
|
9
9
|
registerCapabilityGatewayRoute
|
|
10
10
|
} from "./chunk-AWW2T2WL.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-7XTWP3NB.js";
|
|
12
|
+
import "./chunk-A3PREN6Q.js";
|
|
13
13
|
import "./chunk-NNK3JBH4.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-4CRZ2YUC.js";
|
|
15
15
|
import "./chunk-PUSFEC6B.js";
|
|
16
16
|
import "./chunk-PLNS5J33.js";
|
|
17
17
|
import "./chunk-AMURHMS3.js";
|