veryfront 0.1.1112 → 0.1.1113
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/esm/deno.js +1 -1
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +2 -2
- package/esm/src/agent/runtime/mcp-server-tool-sources.d.ts +11 -0
- package/esm/src/agent/runtime/mcp-server-tool-sources.d.ts.map +1 -1
- package/esm/src/agent/runtime/mcp-server-tool-sources.js +29 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +5 -5
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,6BAA6B,EAClC,KAAK,aAAa,EAGlB,KAAK,OAAO,EAIZ,KAAK,QAAQ,EAGd,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAqB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,6BAA6B,EAClC,KAAK,aAAa,EAGlB,KAAK,OAAO,EAIZ,KAAK,QAAQ,EAGd,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAqB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAoEpE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,q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ACG,cAAc,IAAI,OAAO,CAAC;QAC9B,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAIF;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAGnC"}
|
|
@@ -20,7 +20,7 @@ import { addSpanEvent, setActiveSpanErrorStatus as setOtelActiveSpanErrorStatus,
|
|
|
20
20
|
import { setActiveSpanAttributes as setOtelActiveSpanAttributes } from "../../observability/index.js";
|
|
21
21
|
import { convertToTextGenerationRuntimeRequestMessages } from "./text-generation-runtime-message-converter.js";
|
|
22
22
|
import { convertToolsToRuntimeTools } from "./model-tool-converter.js";
|
|
23
|
-
import { constrainRuntimeRemoteToolSources, getRuntimeRemoteToolSources, } from "./mcp-server-tool-sources.js";
|
|
23
|
+
import { bindRuntimeRemoteToolSourcesToCredentialOwner, constrainRuntimeRemoteToolSources, getRuntimeRemoteToolSources, } from "./mcp-server-tool-sources.js";
|
|
24
24
|
import { runWithRuntimeRemoteToolSources } from "./remote-tool-source-context.js";
|
|
25
25
|
import { createStreamState, processStream, } from "./chat-stream-handler.js";
|
|
26
26
|
import { repairToolCall } from "./repair-tool-call.js";
|
|
@@ -210,7 +210,7 @@ async function traceConfiguredToolExecution(input) {
|
|
|
210
210
|
inputSizeBytes,
|
|
211
211
|
}));
|
|
212
212
|
try {
|
|
213
|
-
const inheritedRemoteToolSources = constrainRuntimeRemoteToolSources(input.remoteToolSources, input.allowedRemoteToolNames);
|
|
213
|
+
const inheritedRemoteToolSources = bindRuntimeRemoteToolSourcesToCredentialOwner(constrainRuntimeRemoteToolSources(input.remoteToolSources, input.allowedRemoteToolNames), input.context);
|
|
214
214
|
const result = await runWithRuntimeRemoteToolSources(inheritedRemoteToolSources, () => executeConfiguredTool(input.toolName, input.args, input.toolsConfig, input.context, input.allowedRemoteToolNames, input.remoteToolSources, input.sourceIntegrationPolicy, { strictConfiguredToolsOnly: input.strictConfiguredToolsOnly }));
|
|
215
215
|
const resultError = getToolResultError(result);
|
|
216
216
|
if (resultError !== undefined) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RemoteMCPToolSourceConfig, type RemoteToolSource } from "../../tool/index.js";
|
|
2
2
|
import type { AgentConfig } from "../types.js";
|
|
3
|
+
import type { ToolExecutionContext } from "../../tool/index.js";
|
|
3
4
|
import type { SourceIntegrationPolicyManifest } from "../../integrations/source-policy.js";
|
|
4
5
|
import { type VeryfrontCloudBootstrap } from "../../platform/cloud/resolver.js";
|
|
5
6
|
export type RuntimeRemoteToolConfig = {
|
|
@@ -19,6 +20,16 @@ export declare function getRequestedUnresolvedBooleanToolNames(input: {
|
|
|
19
20
|
}): string[];
|
|
20
21
|
/** Carry an explicit remote-tool ceiling into nested execution. */
|
|
21
22
|
export declare function constrainRuntimeRemoteToolSources(sources: RemoteToolSource[] | undefined, allowedToolNames: string[] | undefined): RemoteToolSource[] | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Keep inherited remote sources attached to the credential owner that
|
|
25
|
+
* introduced them while preserving nested call-local context.
|
|
26
|
+
*
|
|
27
|
+
* Remote authorization and nested runtime telemetry are intentionally
|
|
28
|
+
* separate: the remote call is attributed to the run-scoped credential
|
|
29
|
+
* owner, while the delegate continues to emit its own child-run lifecycle
|
|
30
|
+
* and tool-call events.
|
|
31
|
+
*/
|
|
32
|
+
export declare function bindRuntimeRemoteToolSourcesToCredentialOwner(sources: RemoteToolSource[] | undefined, context: ToolExecutionContext): RemoteToolSource[] | undefined;
|
|
22
33
|
export type RuntimeMcpServerToolSourceDependencies = {
|
|
23
34
|
createRemoteToolSource?: (config: RemoteMCPToolSourceConfig) => RemoteToolSource;
|
|
24
35
|
getVeryfrontBootstrap?: () => VeryfrontCloudBootstrap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server-tool-sources.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/mcp-server-tool-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-server-tool-sources.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/mcp-server-tool-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,kCAAkC,CAAC;AAI1C,MAAM,MAAM,uBAAuB,GAAG;IACpC,qBAAqB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3C,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,2BAA2B,CAAC,EAAE,+BAA+B,CAAC;CAC/D,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AACpE,+DAA+D;AAC/D,eAAO,MAAM,8BAA8B,eAAe,CAAC;AAgB3D,kFAAkF;AAClF,wBAAgB,sCAAsC,CAAC,KAAK,EAAE;IAC5D,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC,GAAG,MAAM,EAAE,CAeX;AAkGD,mEAAmE;AACnE,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,gBAAgB,EAAE,GAAG,SAAS,EACvC,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,GACrC,gBAAgB,EAAE,GAAG,SAAS,CAQhC;AAkBD;;;;;;;;GAQG;AACH,wBAAgB,6CAA6C,CAC3D,OAAO,EAAE,gBAAgB,EAAE,GAAG,SAAS,EACvC,OAAO,EAAE,oBAAoB,GAC5B,gBAAgB,EAAE,GAAG,SAAS,CAoBhC;AAED,MAAM,MAAM,sCAAsC,GAAG;IACnD,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,yBAAyB,KAAK,gBAAgB,CAAC;IACjF,qBAAqB,CAAC,EAAE,MAAM,uBAAuB,CAAC;CACvD,CAAC;AAoBF,yEAAyE;AACzE,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,MAAM,GAChB,gBAAgB,CAsBlB;AAmED,kEAAkE;AAClE,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,WAAW,EACnB,YAAY,GAAE,sCAA2C,EACzD,OAAO,qBAAY,GAClB,gBAAgB,EAAE,GAAG,SAAS,CAiEhC"}
|
|
@@ -112,6 +112,35 @@ export function constrainRuntimeRemoteToolSources(sources, allowedToolNames) {
|
|
|
112
112
|
const sourcesToConstrain = sources ?? getActiveRuntimeRemoteToolSources() ?? [];
|
|
113
113
|
return sourcesToConstrain.map((source) => createMcpToolPolicySource(source, policy));
|
|
114
114
|
}
|
|
115
|
+
const REMOTE_TOOL_CREDENTIAL_CONTEXT_KEYS = ["authToken", "runId", "agentId"];
|
|
116
|
+
function withBoundRemoteToolContext(context, boundContext, keys) {
|
|
117
|
+
const mergedContext = { ...(context ?? {}) };
|
|
118
|
+
for (const key of keys) {
|
|
119
|
+
if (boundContext[key] !== undefined) {
|
|
120
|
+
mergedContext[key] = boundContext[key];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return mergedContext;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Keep inherited remote sources attached to the credential owner that
|
|
127
|
+
* introduced them while preserving nested call-local context.
|
|
128
|
+
*
|
|
129
|
+
* Remote authorization and nested runtime telemetry are intentionally
|
|
130
|
+
* separate: the remote call is attributed to the run-scoped credential
|
|
131
|
+
* owner, while the delegate continues to emit its own child-run lifecycle
|
|
132
|
+
* and tool-call events.
|
|
133
|
+
*/
|
|
134
|
+
export function bindRuntimeRemoteToolSourcesToCredentialOwner(sources, context) {
|
|
135
|
+
if (sources === undefined) {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
return sources.map((source) => ({
|
|
139
|
+
id: source.id,
|
|
140
|
+
listTools: (nestedContext) => source.listTools(withBoundRemoteToolContext(nestedContext, context, ["authToken"])),
|
|
141
|
+
executeTool: (toolName, args, nestedContext) => source.executeTool(toolName, args, withBoundRemoteToolContext(nestedContext, context, REMOTE_TOOL_CREDENTIAL_CONTEXT_KEYS)),
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
115
144
|
function withServerProject(context, projectId) {
|
|
116
145
|
return { ...(context ?? {}), projectId };
|
|
117
146
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1113",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -332,10 +332,10 @@
|
|
|
332
332
|
"@types/react": "19.2.14",
|
|
333
333
|
"@types/react-dom": "19.2.3",
|
|
334
334
|
"ws": "8.21.0",
|
|
335
|
-
"@veryfront/ext-bundler-esbuild": "0.1.
|
|
336
|
-
"@veryfront/ext-content-mdx": "0.1.
|
|
337
|
-
"@veryfront/ext-css-tailwind": "0.1.
|
|
338
|
-
"@veryfront/ext-parser-babel": "0.1.
|
|
335
|
+
"@veryfront/ext-bundler-esbuild": "0.1.1113",
|
|
336
|
+
"@veryfront/ext-content-mdx": "0.1.1113",
|
|
337
|
+
"@veryfront/ext-css-tailwind": "0.1.1113",
|
|
338
|
+
"@veryfront/ext-parser-babel": "0.1.1113"
|
|
339
339
|
},
|
|
340
340
|
"devDependencies": {
|
|
341
341
|
"@types/node": "20.9.0"
|