@axiom-lattice/core 6.3.1 → 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 +78 -1
- package/dist/index.d.ts +78 -1
- package/dist/index.js +182 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +177 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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 {
|
|
@@ -40174,6 +40176,33 @@ function clearEncryptionKeyCache() {
|
|
|
40174
40176
|
cachedKey = null;
|
|
40175
40177
|
keyValidated = false;
|
|
40176
40178
|
}
|
|
40179
|
+
function encryptConfigFields(config, fields) {
|
|
40180
|
+
if (!fields?.length) return config;
|
|
40181
|
+
const out = { ...config };
|
|
40182
|
+
for (const field of fields) {
|
|
40183
|
+
const value = out[field];
|
|
40184
|
+
if (typeof value === "string" && value.length > 0) {
|
|
40185
|
+
out[field] = encrypt(value);
|
|
40186
|
+
}
|
|
40187
|
+
}
|
|
40188
|
+
return out;
|
|
40189
|
+
}
|
|
40190
|
+
function decryptConfigFields(config, fields) {
|
|
40191
|
+
if (!fields?.length) return config;
|
|
40192
|
+
const out = { ...config };
|
|
40193
|
+
for (const field of fields) {
|
|
40194
|
+
const value = out[field];
|
|
40195
|
+
if (typeof value === "string" && value.length > 0) {
|
|
40196
|
+
try {
|
|
40197
|
+
out[field] = decrypt(value);
|
|
40198
|
+
} catch (error) {
|
|
40199
|
+
console.error(`Failed to decrypt connection field "${field}":`, error);
|
|
40200
|
+
throw new Error("Failed to decrypt connection configuration");
|
|
40201
|
+
}
|
|
40202
|
+
}
|
|
40203
|
+
}
|
|
40204
|
+
return out;
|
|
40205
|
+
}
|
|
40177
40206
|
|
|
40178
40207
|
// src/util/safeUpstreamUrl.ts
|
|
40179
40208
|
var UnsafeUpstreamUrlError = class extends Error {
|
|
@@ -43707,7 +43736,7 @@ function createTaskMiddleware(options = {}) {
|
|
|
43707
43736
|
error: "Task changed before activity could be recorded."
|
|
43708
43737
|
});
|
|
43709
43738
|
markMutation();
|
|
43710
|
-
return JSON.stringify({ success: true, data: activity });
|
|
43739
|
+
return JSON.stringify({ success: true, data: activity, task: existing });
|
|
43711
43740
|
}
|
|
43712
43741
|
case "update": {
|
|
43713
43742
|
taskUpdateDebug("update:enter", {
|
|
@@ -46198,6 +46227,12 @@ import { createMiddleware as createMiddleware27, tool as tool67 } from "langchai
|
|
|
46198
46227
|
import { z as z73 } from "zod";
|
|
46199
46228
|
import { AgentType as AgentType10 } from "@axiom-lattice/protocols";
|
|
46200
46229
|
|
|
46230
|
+
// src/connection/connectionSecretFields.ts
|
|
46231
|
+
function connectionSecretFields(plugin) {
|
|
46232
|
+
const fields = plugin?.connection?.fields ?? [];
|
|
46233
|
+
return fields.filter((field) => field.type === "password" || field.widget === "password").map((field) => field.key);
|
|
46234
|
+
}
|
|
46235
|
+
|
|
46201
46236
|
// src/middlewares/sandboxPluginsSkills.ts
|
|
46202
46237
|
var PLUGIN_JSON_TEMPLATE = `{
|
|
46203
46238
|
"schemaVersion": 1,
|
|
@@ -46253,13 +46288,13 @@ var TEST_TEMPLATE = `const data = process.env.PLUGIN_CONNECTION_FILE
|
|
|
46253
46288
|
: {};
|
|
46254
46289
|
const conn = data.connection ?? data.connections?.[0]?.config ?? {};
|
|
46255
46290
|
const message = conn.apiKey ? "ok" : "missing apiKey";
|
|
46256
|
-
process.stdout.write(JSON.stringify({ ok: Boolean(conn.apiKey), message }));
|
|
46291
|
+
process.stdout.write(JSON.stringify({ ok: true, result: { ok: Boolean(conn.apiKey), message } }));
|
|
46257
46292
|
`;
|
|
46258
46293
|
var DISCOVER_TEMPLATE = `const data = process.env.PLUGIN_CONNECTION_FILE
|
|
46259
46294
|
? JSON.parse(require("fs").readFileSync(process.env.PLUGIN_CONNECTION_FILE, "utf8"))
|
|
46260
46295
|
: {};
|
|
46261
46296
|
const conn = data.connection ?? data.connections?.[0]?.config ?? {};
|
|
46262
|
-
process.stdout.write(JSON.stringify([{ id: "sample", name: "Sample resource" }]));
|
|
46297
|
+
process.stdout.write(JSON.stringify({ ok: true, result: [{ id: "sample", name: "Sample resource" }] }));
|
|
46263
46298
|
`;
|
|
46264
46299
|
var UI_TEMPLATE = `<!doctype html>
|
|
46265
46300
|
<html>
|
|
@@ -46812,7 +46847,7 @@ captured).
|
|
|
46812
46847
|
}
|
|
46813
46848
|
},
|
|
46814
46849
|
"sandbox-plugins-connection": {
|
|
46815
|
-
version: "1.
|
|
46850
|
+
version: "1.1.0",
|
|
46816
46851
|
content: `---
|
|
46817
46852
|
name: sandbox-plugins-connection
|
|
46818
46853
|
description: Define connection fields and test/discover handlers for a tenant sandbox plugin. Trigger: plugin needs credentials or resource discovery.
|
|
@@ -46828,17 +46863,20 @@ The resolved connection is injected at execution time as an
|
|
|
46828
46863
|
\`PLUGIN_CONNECTION_FILE\` (never inline; credentials stay out of argv). It is never hardcoded.
|
|
46829
46864
|
|
|
46830
46865
|
## test handler
|
|
46831
|
-
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.
|
|
46832
46870
|
\`\`\`js
|
|
46833
46871
|
const data = JSON.parse(require("fs").readFileSync(process.env.PLUGIN_CONNECTION_FILE, "utf8"));
|
|
46834
46872
|
const conn = data.connection ?? data.connections?.[0]?.config ?? {};
|
|
46835
|
-
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" } }));
|
|
46836
46874
|
\`\`\`
|
|
46837
46875
|
|
|
46838
46876
|
## discover handler
|
|
46839
|
-
Print
|
|
46877
|
+
Print \`{ ok: true, result: [ ...resources ] }\`:
|
|
46840
46878
|
\`\`\`js
|
|
46841
|
-
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" }] }));
|
|
46842
46880
|
\`\`\`
|
|
46843
46881
|
|
|
46844
46882
|
Set \`connection.resourceLabel\` for the selection panel title.
|
|
@@ -46861,11 +46899,25 @@ Use the \`manage_plugin\` tool. The loop:
|
|
|
46861
46899
|
|
|
46862
46900
|
1. \`action: "validate"\` with \`{ type, manifest, handlers }\` \u2014 dry-run, no writes, returns diagnostics.
|
|
46863
46901
|
2. \`action: "create"\` or \`"update"\` \u2014 writes files, bumps version, reloads.
|
|
46864
|
-
3.
|
|
46902
|
+
3. If the plugin has \`connection.fields\` and a tool reads credentials: a **human**
|
|
46903
|
+
must configure a connection of this plugin type. You cannot create credentials.
|
|
46904
|
+
Call \`list_connections { type }\` first \u2014 if none exist, use \`ask_user_to_clarify\`
|
|
46905
|
+
to state explicitly that only the human can configure the connector, ask them to
|
|
46906
|
+
add it (Console \u2192 Connections) and to give you the connection key. Do not claim
|
|
46907
|
+
the tool works until a real \`connectionKey\` test passes.
|
|
46908
|
+
4. \`action: "test"\` to exercise a handler without an LLM:
|
|
46865
46909
|
- Tool: \`{ type, target: { kind: "tool", name, input, connectionKey? } }\`
|
|
46866
46910
|
- Connection: \`{ type, target: { kind: "connection-test" } }\` or \`{ kind: "connection-discover" }\`
|
|
46867
46911
|
Returns \`{ ok, result, exitCode, durationMs, stdout, stderr }\`.
|
|
46868
|
-
|
|
46912
|
+
For credentialed tools, pass the real \`connectionKey\`. Without one, the handler
|
|
46913
|
+
receives an empty connection \u2014 that only checks plumbing, NOT functional success.
|
|
46914
|
+
5. \`action: "reload"\` if you edited files directly.
|
|
46915
|
+
|
|
46916
|
+
## Secrets
|
|
46917
|
+
- \`list_connections\` returns identifiers only (\`key\`/\`name\`/\`description\`), never config or secrets.
|
|
46918
|
+
- \`test\` output is redacted: real connection secret values are replaced with
|
|
46919
|
+
\`[redacted]\`. Never rely on echoing credentials to verify a handler \u2014 assert on
|
|
46920
|
+
functional output instead.
|
|
46869
46921
|
|
|
46870
46922
|
## Common failures
|
|
46871
46923
|
| Symptom | Cause |
|
|
@@ -46875,9 +46927,12 @@ Use the \`manage_plugin\` tool. The loop:
|
|
|
46875
46927
|
| TOOL_SCHEMA | unsupported JSON Schema keyword |
|
|
46876
46928
|
| non-zero exit | handler threw; read stdout/stderr from \`test\` |
|
|
46877
46929
|
| old behaviour after edit | version/hash unchanged \u2014 bump \`version\` or call \`reload\` |
|
|
46930
|
+
| empty connection in handler | no \`connectionKey\` passed, or no connection configured for this type |
|
|
46878
46931
|
|
|
46879
46932
|
Fall back to \`execute_code\`/\`shell\` to run \`node handlers/x.js\` manually with
|
|
46880
|
-
\`PLUGIN_INPUT\`
|
|
46933
|
+
\`PLUGIN_INPUT\` and a synthetic \`PLUGIN_CONNECTION_FILE\` to reproduce logic bugs.
|
|
46934
|
+
A synthetic fixture only verifies plumbing \u2014 a real upstream call requires a real
|
|
46935
|
+
\`connectionKey\` configured by a human.
|
|
46881
46936
|
`,
|
|
46882
46937
|
resources: {}
|
|
46883
46938
|
}
|
|
@@ -46908,8 +46963,13 @@ implemented", "UI added", "validated/tested via manage_plugin"). As you work,
|
|
|
46908
46963
|
update each Task's status to reflect reality. Never use \`write_todos\`.
|
|
46909
46964
|
|
|
46910
46965
|
Author with the \`manage_plugin\` tool: validate, then create/update, then test.
|
|
46911
|
-
|
|
46912
|
-
\`
|
|
46966
|
+
If a tool needs credentials, a human must configure the connection \u2014 use
|
|
46967
|
+
\`list_connections\` to check, and \`ask_user_to_clarify\` to ask the human to add
|
|
46968
|
+
the connector and give you its key. Only after a real \`connectionKey\` test
|
|
46969
|
+
passes may you call the tool verified; without it, report functionality as
|
|
46970
|
+
unverified (missing credentials), not as passing. Use \`shell_exec\` (the tool
|
|
46971
|
+
provided by the \`code_eval\` middleware) to run \`node handlers/x.js\` for manual
|
|
46972
|
+
checks when reproducing a failure.`;
|
|
46913
46973
|
|
|
46914
46974
|
// src/middlewares/sandboxPluginsMiddleware.ts
|
|
46915
46975
|
var PLUGIN_BUILDER_SKILLS = [...Object.keys(SANDBOX_PLUGIN_SKILLS), "task-tracking"];
|
|
@@ -46917,6 +46977,37 @@ function tenantIdFrom(exeConfig) {
|
|
|
46917
46977
|
const c = exeConfig;
|
|
46918
46978
|
return c?.configurable?.runConfig?.tenantId ?? "default";
|
|
46919
46979
|
}
|
|
46980
|
+
function collectSecretValues(connection, fields) {
|
|
46981
|
+
if (!connection) return [];
|
|
46982
|
+
const values = [];
|
|
46983
|
+
for (const field of fields) {
|
|
46984
|
+
const value = connection[field];
|
|
46985
|
+
if (typeof value === "string" && value.length > 0) values.push(value);
|
|
46986
|
+
}
|
|
46987
|
+
return values;
|
|
46988
|
+
}
|
|
46989
|
+
function errorText(err) {
|
|
46990
|
+
return err instanceof Error ? err.message : String(err);
|
|
46991
|
+
}
|
|
46992
|
+
function redactString(value, secrets) {
|
|
46993
|
+
let out = value;
|
|
46994
|
+
for (const secret of secrets) out = out.split(secret).join("[redacted]");
|
|
46995
|
+
return out;
|
|
46996
|
+
}
|
|
46997
|
+
function redactSecretValues(payload, secrets) {
|
|
46998
|
+
if (secrets.length === 0) return payload;
|
|
46999
|
+
const walk = (node) => {
|
|
47000
|
+
if (typeof node === "string") return redactString(node, secrets);
|
|
47001
|
+
if (Array.isArray(node)) return node.map(walk);
|
|
47002
|
+
if (node !== null && typeof node === "object") {
|
|
47003
|
+
const out = {};
|
|
47004
|
+
for (const [key5, value] of Object.entries(node)) out[key5] = walk(value);
|
|
47005
|
+
return out;
|
|
47006
|
+
}
|
|
47007
|
+
return node;
|
|
47008
|
+
};
|
|
47009
|
+
return walk(payload);
|
|
47010
|
+
}
|
|
46920
47011
|
var managePluginSchema = z73.object({
|
|
46921
47012
|
action: z73.enum(["list", "get", "validate", "create", "update", "delete", "reload", "test"]),
|
|
46922
47013
|
type: z73.string().optional(),
|
|
@@ -46948,6 +47039,10 @@ var sandboxPluginsPlugin = {
|
|
|
46948
47039
|
description: "Author and manage tenant plugins in the shared sandbox: clarify goal, inputs/outputs, credentials, and whether a UI is needed; then write the manifest and JS handlers, add an optional HTML MCP App UI, and validate/test with the manage_plugin tool.",
|
|
46949
47040
|
type: AgentType10.DEEP_AGENT,
|
|
46950
47041
|
prompt: PLUGIN_BUILDER_PROMPT,
|
|
47042
|
+
// Read-only discovery of connection identifiers (metadata only — never
|
|
47043
|
+
// config/secrets) so the builder can confirm a human configured a
|
|
47044
|
+
// connector and pass its key to `manage_plugin test`.
|
|
47045
|
+
tools: ["list_connections"],
|
|
46951
47046
|
middleware: [
|
|
46952
47047
|
{
|
|
46953
47048
|
id: "sandbox-plugins",
|
|
@@ -47083,8 +47178,19 @@ var sandboxPluginsPlugin = {
|
|
|
47083
47178
|
input.target.connectionKey ? { connections: [input.target.connectionKey] } : { connectAll: true },
|
|
47084
47179
|
{ tenantId: tenantId2 }
|
|
47085
47180
|
);
|
|
47086
|
-
const
|
|
47087
|
-
|
|
47181
|
+
const secrets2 = collectSecretValues(connection, connectionSecretFields(plugin));
|
|
47182
|
+
try {
|
|
47183
|
+
const result = await plugin.connection?.test?.(connection ?? {});
|
|
47184
|
+
return JSON.stringify(redactSecretValues(
|
|
47185
|
+
result ?? { ok: false, message: "no test handler" },
|
|
47186
|
+
secrets2
|
|
47187
|
+
));
|
|
47188
|
+
} catch (err) {
|
|
47189
|
+
return JSON.stringify(redactSecretValues(
|
|
47190
|
+
{ ok: false, message: errorText(err) },
|
|
47191
|
+
secrets2
|
|
47192
|
+
));
|
|
47193
|
+
}
|
|
47088
47194
|
}
|
|
47089
47195
|
if (input.target.kind === "connection-discover") {
|
|
47090
47196
|
const { connection } = await resolveSandboxPluginConnections(
|
|
@@ -47092,8 +47198,16 @@ var sandboxPluginsPlugin = {
|
|
|
47092
47198
|
input.target.connectionKey ? { connections: [input.target.connectionKey] } : { connectAll: true },
|
|
47093
47199
|
{ tenantId: tenantId2 }
|
|
47094
47200
|
);
|
|
47095
|
-
const
|
|
47096
|
-
|
|
47201
|
+
const secrets2 = collectSecretValues(connection, connectionSecretFields(plugin));
|
|
47202
|
+
try {
|
|
47203
|
+
const result = await plugin.connection?.discover?.(connection ?? {});
|
|
47204
|
+
return JSON.stringify(redactSecretValues(result ?? [], secrets2));
|
|
47205
|
+
} catch (err) {
|
|
47206
|
+
return JSON.stringify(redactSecretValues(
|
|
47207
|
+
{ error: errorText(err) },
|
|
47208
|
+
secrets2
|
|
47209
|
+
));
|
|
47210
|
+
}
|
|
47097
47211
|
}
|
|
47098
47212
|
const executor = catalog2.getExecutor();
|
|
47099
47213
|
const manifestContent = await catalog2.readPluginFile(tenantId2, input.type, "plugin.json");
|
|
@@ -47111,19 +47225,24 @@ var sandboxPluginsPlugin = {
|
|
|
47111
47225
|
{ connections: [input.target.connectionKey] },
|
|
47112
47226
|
{ tenantId: tenantId2 }
|
|
47113
47227
|
) : {};
|
|
47114
|
-
const
|
|
47115
|
-
|
|
47116
|
-
|
|
47117
|
-
|
|
47118
|
-
|
|
47119
|
-
|
|
47120
|
-
|
|
47121
|
-
|
|
47122
|
-
tenantId: tenantId2,
|
|
47123
|
-
|
|
47124
|
-
|
|
47125
|
-
|
|
47126
|
-
|
|
47228
|
+
const secrets = collectSecretValues(resolved.connection, connectionSecretFields(plugin));
|
|
47229
|
+
try {
|
|
47230
|
+
const result = await executor.invoke({
|
|
47231
|
+
manifest: parsedManifest,
|
|
47232
|
+
handler: toolDef.handler,
|
|
47233
|
+
input: input.target.input ?? null,
|
|
47234
|
+
connection: resolved.connection,
|
|
47235
|
+
connections: resolved.connections,
|
|
47236
|
+
context: { tenantId: tenantId2, pluginType: input.type, tool: toolDef.name },
|
|
47237
|
+
runConfig: {
|
|
47238
|
+
tenantId: tenantId2,
|
|
47239
|
+
assistantId: typeof runCfg.assistant_id === "string" ? runCfg.assistant_id : void 0
|
|
47240
|
+
}
|
|
47241
|
+
});
|
|
47242
|
+
return JSON.stringify(redactSecretValues(result, secrets));
|
|
47243
|
+
} catch (err) {
|
|
47244
|
+
return JSON.stringify(redactSecretValues({ ok: false, error: errorText(err) }, secrets));
|
|
47245
|
+
}
|
|
47127
47246
|
}
|
|
47128
47247
|
default:
|
|
47129
47248
|
return `unsupported action: ${input.action}`;
|
|
@@ -47777,6 +47896,7 @@ export {
|
|
|
47777
47896
|
clearEncryptionKeyCache,
|
|
47778
47897
|
clearEvalRunService,
|
|
47779
47898
|
clearSandboxOpenCredentialProviderForTests,
|
|
47899
|
+
collectPluginSources,
|
|
47780
47900
|
collectionLatticeManager,
|
|
47781
47901
|
compileInternal,
|
|
47782
47902
|
compileSandboxPlugin,
|
|
@@ -47786,6 +47906,7 @@ export {
|
|
|
47786
47906
|
configurePluginCatalogSync,
|
|
47787
47907
|
configureStores,
|
|
47788
47908
|
connectAllChannels,
|
|
47909
|
+
connectionSecretFields,
|
|
47789
47910
|
convertToConnection,
|
|
47790
47911
|
createAgentNode,
|
|
47791
47912
|
createAgentTeam,
|
|
@@ -47826,11 +47947,13 @@ export {
|
|
|
47826
47947
|
createUnknownToolHandlerMiddleware,
|
|
47827
47948
|
createWidgetMiddleware,
|
|
47828
47949
|
decrypt,
|
|
47950
|
+
decryptConfigFields,
|
|
47829
47951
|
describeCronExpression,
|
|
47830
47952
|
documentLearningPlugin,
|
|
47831
47953
|
documentParserPlugin,
|
|
47832
47954
|
embeddingsLatticeManager,
|
|
47833
47955
|
encrypt,
|
|
47956
|
+
encryptConfigFields,
|
|
47834
47957
|
ensureBuiltinAgentsForTenant,
|
|
47835
47958
|
ensurePluginSkillInSandbox,
|
|
47836
47959
|
evaluateLatticeCaseWithLogs,
|
|
@@ -47913,6 +48036,7 @@ export {
|
|
|
47913
48036
|
jsonSchemaToZod,
|
|
47914
48037
|
listCollectionEntries,
|
|
47915
48038
|
listSandboxProviderTypes,
|
|
48039
|
+
listTenantPlugins,
|
|
47916
48040
|
loggerLatticeManager,
|
|
47917
48041
|
mcpManager,
|
|
47918
48042
|
mergeCapabilityBundles,
|