@axiom-lattice/core 6.3.2 → 6.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +39 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -14246,6 +14246,22 @@ function setSandboxPluginCatalog(instance) {
|
|
|
14246
14246
|
catalog = instance;
|
|
14247
14247
|
}
|
|
14248
14248
|
|
|
14249
|
+
// src/plugin/listTenantPlugins.ts
|
|
14250
|
+
async function collectPluginSources(tenantId2) {
|
|
14251
|
+
const globalPlugins = PluginRegistry.list().map((type) => PluginRegistry.get(type)).filter((plugin) => Boolean(plugin));
|
|
14252
|
+
let tenantPlugins = [];
|
|
14253
|
+
try {
|
|
14254
|
+
tenantPlugins = (await getSandboxPluginCatalog().ensureLoaded(tenantId2)).plugins;
|
|
14255
|
+
} catch {
|
|
14256
|
+
tenantPlugins = [];
|
|
14257
|
+
}
|
|
14258
|
+
return { globalPlugins, tenantPlugins };
|
|
14259
|
+
}
|
|
14260
|
+
async function listTenantPlugins(tenantId2) {
|
|
14261
|
+
const { globalPlugins, tenantPlugins } = await collectPluginSources(tenantId2);
|
|
14262
|
+
return mergePluginSources(globalPlugins, tenantPlugins);
|
|
14263
|
+
}
|
|
14264
|
+
|
|
14249
14265
|
// src/agent_lattice/builders/taskMiddlewareValidation.ts
|
|
14250
14266
|
var REQUIRED_TASK_TOOLS = ["manage_task", "task"];
|
|
14251
14267
|
function validateTaskReviewMode(reviewMode) {
|
|
@@ -14810,13 +14826,7 @@ async function createCommonMiddlewares(middlewareConfigs, filesystemBackend, fsI
|
|
|
14810
14826
|
));
|
|
14811
14827
|
}
|
|
14812
14828
|
}
|
|
14813
|
-
|
|
14814
|
-
try {
|
|
14815
|
-
tenantPlugins = (await getSandboxPluginCatalog().ensureLoaded(tenantId2 ?? "default")).plugins;
|
|
14816
|
-
} catch {
|
|
14817
|
-
tenantPlugins = [];
|
|
14818
|
-
}
|
|
14819
|
-
const globalPlugins = PluginRegistry.list().map((type) => PluginRegistry.get(type)).filter((p) => Boolean(p));
|
|
14829
|
+
const { globalPlugins, tenantPlugins } = await collectPluginSources(tenantId2 ?? "default");
|
|
14820
14830
|
const mergedPlugins = mergePluginSources(globalPlugins, tenantPlugins);
|
|
14821
14831
|
const mergedByType = new Map(mergedPlugins.map((p) => [p.meta.type, p]));
|
|
14822
14832
|
const enabledPluginTypes = new Set(
|
|
@@ -29324,10 +29334,8 @@ function getAvailableTools(tenantId2) {
|
|
|
29324
29334
|
function getAvailableModels() {
|
|
29325
29335
|
return modelLatticeManager.getAllByTenant("default");
|
|
29326
29336
|
}
|
|
29327
|
-
function getAvailableMiddlewareTypes() {
|
|
29328
|
-
return
|
|
29329
|
-
(type) => typeof PluginRegistry.get(type)?.middleware === "function"
|
|
29330
|
-
);
|
|
29337
|
+
async function getAvailableMiddlewareTypes(tenantId2) {
|
|
29338
|
+
return (await listTenantPlugins(tenantId2)).filter((plugin) => typeof plugin.middleware === "function").map((plugin) => plugin.meta.type);
|
|
29331
29339
|
}
|
|
29332
29340
|
function normalizeProjectScope(projectId) {
|
|
29333
29341
|
return !projectId || projectId === "default" ? "default" : projectId;
|
|
@@ -29366,7 +29374,7 @@ function requireSkillDeclaration(skillLoaded) {
|
|
|
29366
29374
|
}
|
|
29367
29375
|
async function validateAgentReferences(input, tenantId2) {
|
|
29368
29376
|
const availableTools = getAvailableTools(tenantId2).map((tool68) => tool68.key);
|
|
29369
|
-
const availableMiddlewareTypes = getAvailableMiddlewareTypes();
|
|
29377
|
+
const availableMiddlewareTypes = await getAvailableMiddlewareTypes(tenantId2);
|
|
29370
29378
|
const availableCustomMiddlewareKeys = CustomMiddlewareRegistry.list().filter(
|
|
29371
29379
|
(key5) => CustomMiddlewareRegistry.get(key5) !== void 0
|
|
29372
29380
|
);
|
|
@@ -30046,9 +30054,10 @@ registerToolLattice(
|
|
|
30046
30054
|
description: "\u5217\u51FA\u5F53\u524D\u7CFB\u7EDF\u4E2D\u6240\u6709\u53EF\u7528\u7684\u4E2D\u95F4\u4EF6\u7C7B\u578B\uFF08Middlewares\uFF09\uFF0C\u5305\u62EC\u5185\u7F6E\u548C\u81EA\u5B9A\u4E49\u63D2\u4EF6\u3002\u8FD4\u56DE\u6BCF\u4E2A\u4E2D\u95F4\u4EF6\u7684 type\u3001name\u3001description\u3001tools \u6E05\u5355\uFF08\u652F\u6301 allowedTools \u8FC7\u6EE4\uFF09\u3001configSchema\uFF08\u914D\u7F6E\u9762\u677F\u9700\u8981\u54EA\u4E9B\u5B57\u6BB5\uFF09\u548C connectionSchema\uFF08\u662F\u5426\u652F\u6301\u8FDE\u63A5\u6D4B\u8BD5\u548C\u8D44\u6E90\u53D1\u73B0\uFF09\u3002\n\n\u4F7F\u7528\u573A\u666F\uFF1A\n1. \u5728\u521B\u5EFA agent \u524D\uFF0C\u5148\u8C03\u6B64\u5DE5\u5177\u4E86\u89E3\u6709\u54EA\u4E9B\u4E2D\u95F4\u4EF6\u53EF\u914D\u7F6E\n2. \u6839\u636E configSchema \u51B3\u5B9A\u9700\u8981\u63D0\u4F9B\u54EA\u4E9B\u914D\u7F6E\u5B57\u6BB5\uFF1B\u65B0\u8FDE\u63A5\u578B\u63D2\u4EF6\u4F7F\u7528 connections \u548C connectAll\uFF0C\u5185\u7F6E\u65E7\u63D2\u4EF6\u7684 selector \u5B57\u6BB5\u7531 core \u7684 legacy compatibility map \u5B9A\u4E49\n3. \u5982\u679C\u67D0\u4E2A\u4E2D\u95F4\u4EF6\u7684 connectionSchema \u5B58\u5728\uFF0C\u8BF4\u660E\u5B83\u662F\u8FDE\u63A5\u578B\u4E2D\u95F4\u4EF6\uFF0C\u9700\u8981\u518D\u8C03 list_connections \u83B7\u53D6\u53EF\u7528\u8FDE\u63A5\n4. \u7528\u8FD4\u56DE\u7684 type \u5B57\u6BB5\u6784\u5EFA middleware \u6570\u7EC4\u4F20\u7ED9 create_agent / update_agent",
|
|
30047
30055
|
schema: z52.object({})
|
|
30048
30056
|
},
|
|
30049
|
-
async () => {
|
|
30050
|
-
const
|
|
30051
|
-
const
|
|
30057
|
+
async (_input, exeConfig) => {
|
|
30058
|
+
const tenantId2 = getTenantId2(exeConfig);
|
|
30059
|
+
const plugins = await listTenantPlugins(tenantId2);
|
|
30060
|
+
const metas = plugins.filter((plugin) => typeof plugin.middleware === "function").map(serializePluginMeta);
|
|
30052
30061
|
return JSON.stringify(metas);
|
|
30053
30062
|
}
|
|
30054
30063
|
);
|
|
@@ -30359,14 +30368,7 @@ function ensureBuiltinAgentsForTenant(tenantId2) {
|
|
|
30359
30368
|
|
|
30360
30369
|
// src/agent_lattice/pluginAgents.ts
|
|
30361
30370
|
async function ensurePluginAgentsForTenant(tenantId2) {
|
|
30362
|
-
const
|
|
30363
|
-
let tenantPlugins = [];
|
|
30364
|
-
try {
|
|
30365
|
-
tenantPlugins = (await getSandboxPluginCatalog().ensureLoaded(tenantId2)).plugins;
|
|
30366
|
-
} catch {
|
|
30367
|
-
tenantPlugins = [];
|
|
30368
|
-
}
|
|
30369
|
-
for (const plugin of mergePluginSources(globalPlugins, tenantPlugins)) {
|
|
30371
|
+
for (const plugin of await listTenantPlugins(tenantId2)) {
|
|
30370
30372
|
if (!plugin.agents) continue;
|
|
30371
30373
|
for (const [key5, config] of Object.entries(plugin.agents)) {
|
|
30372
30374
|
try {
|
|
@@ -46286,13 +46288,13 @@ var TEST_TEMPLATE = `const data = process.env.PLUGIN_CONNECTION_FILE
|
|
|
46286
46288
|
: {};
|
|
46287
46289
|
const conn = data.connection ?? data.connections?.[0]?.config ?? {};
|
|
46288
46290
|
const message = conn.apiKey ? "ok" : "missing apiKey";
|
|
46289
|
-
process.stdout.write(JSON.stringify({ ok: Boolean(conn.apiKey), message }));
|
|
46291
|
+
process.stdout.write(JSON.stringify({ ok: true, result: { ok: Boolean(conn.apiKey), message } }));
|
|
46290
46292
|
`;
|
|
46291
46293
|
var DISCOVER_TEMPLATE = `const data = process.env.PLUGIN_CONNECTION_FILE
|
|
46292
46294
|
? JSON.parse(require("fs").readFileSync(process.env.PLUGIN_CONNECTION_FILE, "utf8"))
|
|
46293
46295
|
: {};
|
|
46294
46296
|
const conn = data.connection ?? data.connections?.[0]?.config ?? {};
|
|
46295
|
-
process.stdout.write(JSON.stringify([{ id: "sample", name: "Sample resource" }]));
|
|
46297
|
+
process.stdout.write(JSON.stringify({ ok: true, result: [{ id: "sample", name: "Sample resource" }] }));
|
|
46296
46298
|
`;
|
|
46297
46299
|
var UI_TEMPLATE = `<!doctype html>
|
|
46298
46300
|
<html>
|
|
@@ -46845,7 +46847,7 @@ captured).
|
|
|
46845
46847
|
}
|
|
46846
46848
|
},
|
|
46847
46849
|
"sandbox-plugins-connection": {
|
|
46848
|
-
version: "1.
|
|
46850
|
+
version: "1.1.0",
|
|
46849
46851
|
content: `---
|
|
46850
46852
|
name: sandbox-plugins-connection
|
|
46851
46853
|
description: Define connection fields and test/discover handlers for a tenant sandbox plugin. Trigger: plugin needs credentials or resource discovery.
|
|
@@ -46861,17 +46863,20 @@ The resolved connection is injected at execution time as an
|
|
|
46861
46863
|
\`PLUGIN_CONNECTION_FILE\` (never inline; credentials stay out of argv). It is never hardcoded.
|
|
46862
46864
|
|
|
46863
46865
|
## test handler
|
|
46864
|
-
Print \`{ ok, message }\`:
|
|
46866
|
+
Print the two-level result envelope \`{ ok, result: { ok, message } }\`: the outer
|
|
46867
|
+
\`ok\` means the handler ran, the inner \`ok\`/\`message\` is the connection verdict.
|
|
46868
|
+
Put extra diagnostics under \`result.details\`. A single-level \`{ ok, message }\`
|
|
46869
|
+
is rejected as an invalid result.
|
|
46865
46870
|
\`\`\`js
|
|
46866
46871
|
const data = JSON.parse(require("fs").readFileSync(process.env.PLUGIN_CONNECTION_FILE, "utf8"));
|
|
46867
46872
|
const conn = data.connection ?? data.connections?.[0]?.config ?? {};
|
|
46868
|
-
process.stdout.write(JSON.stringify({ ok: Boolean(conn.apiKey), message: conn.apiKey ? "ok" : "missing apiKey" }));
|
|
46873
|
+
process.stdout.write(JSON.stringify({ ok: true, result: { ok: Boolean(conn.apiKey), message: conn.apiKey ? "ok" : "missing apiKey" } }));
|
|
46869
46874
|
\`\`\`
|
|
46870
46875
|
|
|
46871
46876
|
## discover handler
|
|
46872
|
-
Print
|
|
46877
|
+
Print \`{ ok: true, result: [ ...resources ] }\`:
|
|
46873
46878
|
\`\`\`js
|
|
46874
|
-
process.stdout.write(JSON.stringify([{ id: "a", name: "A", group: "G" }]));
|
|
46879
|
+
process.stdout.write(JSON.stringify({ ok: true, result: [{ id: "a", name: "A", group: "G" }] }));
|
|
46875
46880
|
\`\`\`
|
|
46876
46881
|
|
|
46877
46882
|
Set \`connection.resourceLabel\` for the selection panel title.
|
|
@@ -47891,6 +47896,7 @@ export {
|
|
|
47891
47896
|
clearEncryptionKeyCache,
|
|
47892
47897
|
clearEvalRunService,
|
|
47893
47898
|
clearSandboxOpenCredentialProviderForTests,
|
|
47899
|
+
collectPluginSources,
|
|
47894
47900
|
collectionLatticeManager,
|
|
47895
47901
|
compileInternal,
|
|
47896
47902
|
compileSandboxPlugin,
|
|
@@ -48030,6 +48036,7 @@ export {
|
|
|
48030
48036
|
jsonSchemaToZod,
|
|
48031
48037
|
listCollectionEntries,
|
|
48032
48038
|
listSandboxProviderTypes,
|
|
48039
|
+
listTenantPlugins,
|
|
48033
48040
|
loggerLatticeManager,
|
|
48034
48041
|
mcpManager,
|
|
48035
48042
|
mergeCapabilityBundles,
|