veryfront 0.1.351 → 0.1.353

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.351",
3
+ "version": "0.1.353",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -38,7 +38,7 @@ export async function runAgentRuntimeForkStep(input) {
38
38
  ...(input.providerOptions
39
39
  ? { resolveModelTransport: () => ({ providerOptions: input.providerOptions }) }
40
40
  : {}),
41
- __vfAllowedRemoteTools: input.forkToolNames,
41
+ allowedRemoteTools: input.forkToolNames,
42
42
  };
43
43
  const runtime = new AgentRuntime("invoke-agent-child-runtime", runtimeConfig);
44
44
  const stream = await runWithVeryfrontCloudContextAsync({
@@ -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,aAAa,EAGlB,KAAK,OAAO,EACZ,KAAK,WAAW,EAEhB,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAU/D,OAAO,EACL,KAAK,eAAe,EAGpB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAUlC,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,qBAAqB,CAAC;AAC7B,YAAY,EACV,8BAA8B,EAC9B,gBAAgB,EAChB,wBAAwB,GACzB,M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,MAAM,EACtB,uBAAuB,CAAC,EAAE,MAAM,EAChC,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAuHtC;;OAEG;YACW,gBAAgB;IA6Q9B;;;;OAIG;YACW,yBAAyB;IA6VvC;;OAEG;YACW,eAAe;IA6B7B;;OAEG;YACW,mBAAmB;IAOjC;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,sBAAsB;IAc9B;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC;IAI5B;;OAEG;IACG,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"}
@@ -239,6 +239,13 @@ export function enforceSkillPolicy(toolName, activeSkillPolicy, mustLoadSkillFir
239
239
  return { allowed: true };
240
240
  }
241
241
  function getRuntimeAllowedRemoteTools(config) {
242
+ if (Object.hasOwn(config, "allowedRemoteTools")) {
243
+ const raw = config.allowedRemoteTools;
244
+ if (!Array.isArray(raw)) {
245
+ return [];
246
+ }
247
+ return raw.every((toolName) => typeof toolName === "string") ? raw : [];
248
+ }
242
249
  const configWithRuntimeFilters = config;
243
250
  if (!Object.hasOwn(configWithRuntimeFilters, "__vfAllowedRemoteTools")) {
244
251
  return undefined;
@@ -43,6 +43,11 @@ export interface AgentConfig {
43
43
  system: string | (() => string) | (() => Promise<string>);
44
44
  tools?: true | Record<string, Tool | boolean>;
45
45
  remoteTools?: RemoteToolSource[];
46
+ /**
47
+ * Optional remote tool name allowlist. When set, only matching tools from
48
+ * `remoteTools` are exposed to the model and executable at runtime.
49
+ */
50
+ allowedRemoteTools?: string[];
46
51
  maxSteps?: number;
47
52
  streaming?: boolean;
48
53
  memory?: MemoryConfig;
@@ -1 +1 @@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AAC,KAClC;QACH,MAAM,EAAE,CACN,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,SAAS,CAAC,EAAE;YACV,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;SAC9C,EACD,aAAa,CAAC,EAAE,MAAM,EACtB,uBAAuB,CAAC,EAAE,MAAM,EAChC,WAAW,CAAC,EAAE,WAAW,KACtB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;KAC1C,CAAC;CACH;AAyHD,wBAAsB,gCAAgC,CACpD,KAAK,EAAE,oBAAoB,EAC3B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,QAAQ,CAAC,CAkPnB"}
@@ -108,7 +108,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
108
108
  ...agent.config,
109
109
  tools: mergedTools,
110
110
  ...(allowedRemoteToolNames !== undefined
111
- ? { __vfAllowedRemoteTools: allowedRemoteToolNames }
111
+ ? { allowedRemoteTools: allowedRemoteToolNames }
112
112
  : {}),
113
113
  ...(forwardedIntegrationToolDefs !== undefined
114
114
  ? { __vfForwardedIntegrationToolDefs: forwardedIntegrationToolDefs }
@@ -0,0 +1,31 @@
1
+ import type { CommandJob, CommandJobOutput, ExecOptions } from "./sandbox.js";
2
+ import { type LazySandboxOptions } from "./lazy-sandbox.js";
3
+ import { type BashToolSandboxLike, type CreateSandboxBashTool, type SandboxShellToolSet } from "./shell-tools.js";
4
+ export interface HostedSandboxJobClient {
5
+ startCommandJob(command: string): Promise<CommandJob>;
6
+ getCommandJob(jobId: string): Promise<CommandJob>;
7
+ getCommandJobOutput(jobId: string): Promise<CommandJobOutput>;
8
+ cancelCommandJob(jobId: string): Promise<CommandJob>;
9
+ }
10
+ export interface HostedSandboxClient extends BashToolSandboxLike, HostedSandboxJobClient {
11
+ ensure(): Promise<void>;
12
+ close(): Promise<void>;
13
+ readonly isActive: boolean;
14
+ readonly id: string | null;
15
+ readonly url: string | null;
16
+ }
17
+ export interface HostedSandboxClientOptions extends LazySandboxOptions {
18
+ }
19
+ export interface HostedSandboxToolsOptions extends HostedSandboxClientOptions {
20
+ createBashTool: CreateSandboxBashTool;
21
+ }
22
+ export interface HostedSandboxToolsResult {
23
+ tools: SandboxShellToolSet;
24
+ sandbox: HostedSandboxClient;
25
+ closeSandbox: () => Promise<void>;
26
+ }
27
+ export declare function unwrapSandboxWorkingDirectoryCommand(command: string): string;
28
+ export declare function createProjectScopedExecOptions(projectReference: string | null | undefined): ExecOptions;
29
+ export declare function createHostedSandboxClient(input?: HostedSandboxClientOptions): HostedSandboxClient;
30
+ export declare function createHostedSandboxTools(input: HostedSandboxToolsOptions): Promise<HostedSandboxToolsResult>;
31
+ //# sourceMappingURL=hosted-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-tools.d.ts","sourceRoot":"","sources":["../../../src/src/sandbox/hosted-tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAE1B,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAM1B,MAAM,WAAW,sBAAsB;IACrC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAClD,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9D,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB,EAAE,sBAAsB;IACtF,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;CAAG;AAEzE,MAAM,WAAW,yBAA0B,SAAQ,0BAA0B;IAC3E,cAAc,EAAE,qBAAqB,CAAC;CACvC;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED,wBAAgB,oCAAoC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO5E;AAED,wBAAgB,8BAA8B,CAC5C,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,WAAW,CAEb;AA2BD,wBAAgB,yBAAyB,CACvC,KAAK,GAAE,0BAA+B,GACrC,mBAAmB,CAoCrB;AAED,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,wBAAwB,CAAC,CA4CnC"}
@@ -0,0 +1,108 @@
1
+ import { z } from "zod";
2
+ import { tool } from "../tool/index.js";
3
+ import { LazySandbox } from "./lazy-sandbox.js";
4
+ import { createSandboxShellTools, } from "./shell-tools.js";
5
+ const SANDBOX_WORKING_DIRECTORY = "/workspace";
6
+ const SANDBOX_WORKING_DIRECTORY_PREFIX_PATTERN = /^\s*(?:mkdir -p \/tmp\/bash-tool\s*&&\s*)?cd\s+"\/workspace"\s*&&\s*/i;
7
+ export function unwrapSandboxWorkingDirectoryCommand(command) {
8
+ const trimmedCommand = command.trim();
9
+ if (!SANDBOX_WORKING_DIRECTORY_PREFIX_PATTERN.test(trimmedCommand)) {
10
+ return trimmedCommand;
11
+ }
12
+ return trimmedCommand.replace(SANDBOX_WORKING_DIRECTORY_PREFIX_PATTERN, "").trim();
13
+ }
14
+ export function createProjectScopedExecOptions(projectReference) {
15
+ return projectReference ? { projectReference } : {};
16
+ }
17
+ function isRecord(value) {
18
+ return typeof value === "object" && value !== null && !Array.isArray(value);
19
+ }
20
+ function toSandboxFileContent(content) {
21
+ if (typeof content === "string") {
22
+ return content;
23
+ }
24
+ if (content instanceof Uint8Array) {
25
+ return new TextDecoder().decode(content);
26
+ }
27
+ return String(content ?? "");
28
+ }
29
+ function normalizeSandboxWriteFile(file) {
30
+ if (!isRecord(file) || typeof file.path !== "string") {
31
+ throw new Error("Sandbox writeFiles entries must include a string path");
32
+ }
33
+ return {
34
+ path: file.path,
35
+ content: toSandboxFileContent(file.content),
36
+ };
37
+ }
38
+ export function createHostedSandboxClient(input = {}) {
39
+ const getProjectId = input.getProjectId ?? (() => input.projectId);
40
+ const sandbox = new LazySandbox({ ...input, getProjectId });
41
+ const getExecOptions = () => createProjectScopedExecOptions(getProjectId());
42
+ const getCommandJobExecOptions = () => ({
43
+ ...getExecOptions(),
44
+ cwd: SANDBOX_WORKING_DIRECTORY,
45
+ });
46
+ return {
47
+ ensure: () => sandbox.ensure(),
48
+ async executeCommand(command) {
49
+ return await sandbox.executeCommand(command, getExecOptions());
50
+ },
51
+ readFile: (path) => sandbox.readFile(path),
52
+ writeFiles: (files) => sandbox.writeFiles(files.map((file) => normalizeSandboxWriteFile(file))),
53
+ startCommandJob: (command) => sandbox.startCommandJob(unwrapSandboxWorkingDirectoryCommand(command), getCommandJobExecOptions()),
54
+ getCommandJob: (jobId) => sandbox.getCommandJob(jobId),
55
+ getCommandJobOutput: (jobId) => sandbox.getCommandJobOutput(jobId),
56
+ cancelCommandJob: (jobId) => sandbox.cancelCommandJob(jobId),
57
+ close: () => sandbox.close(),
58
+ get isActive() {
59
+ return sandbox.isActive;
60
+ },
61
+ get id() {
62
+ return sandbox.id;
63
+ },
64
+ get url() {
65
+ return sandbox.url;
66
+ },
67
+ };
68
+ }
69
+ export async function createHostedSandboxTools(input) {
70
+ const sandbox = createHostedSandboxClient(input);
71
+ const shellTools = await createSandboxShellTools(sandbox, input.createBashTool);
72
+ const tools = {
73
+ ...shellTools,
74
+ start_command_job: tool({
75
+ description: "Start a long-running sandbox command as an async job. Use this instead of bash for durable shell operations.",
76
+ inputSchema: z.object({
77
+ command: z.string().describe("Single shell command to run asynchronously in the sandbox"),
78
+ }),
79
+ execute: async ({ command }) => await sandbox.startCommandJob(command),
80
+ }),
81
+ get_command_job: tool({
82
+ description: "Get the current status for an async sandbox command job. Use this for polling while a long-running job is still running.",
83
+ inputSchema: z.object({
84
+ jobId: z.string().describe("Sandbox command job ID"),
85
+ }),
86
+ execute: async ({ jobId }) => await sandbox.getCommandJob(jobId),
87
+ }),
88
+ get_command_job_output: tool({
89
+ description: "Get the captured stdout/stderr and terminal metadata for an async sandbox command job. Prefer calling this after the job reaches a terminal state.",
90
+ inputSchema: z.object({
91
+ jobId: z.string().describe("Sandbox command job ID"),
92
+ }),
93
+ execute: async ({ jobId }) => await sandbox.getCommandJobOutput(jobId),
94
+ }),
95
+ cancel_command_job: tool({
96
+ description: "Cancel a running async sandbox command job.",
97
+ inputSchema: z.object({
98
+ jobId: z.string().describe("Sandbox command job ID"),
99
+ }),
100
+ execute: async ({ jobId }) => await sandbox.cancelCommandJob(jobId),
101
+ }),
102
+ };
103
+ return {
104
+ tools,
105
+ sandbox,
106
+ closeSandbox: () => sandbox.close(),
107
+ };
108
+ }
@@ -20,4 +20,5 @@ import "../../_dnt.polyfills.js";
20
20
  export { type CommandJob, type CommandJobHeartbeatStatus, type CommandJobOutput, type CommandJobStatus, type ExecOptions, type ExecResult, type ExecStreamEvent, Sandbox, type SandboxAttachment, type SandboxListOptions, type SandboxListResult, type SandboxOptions, type SandboxSession, } from "./sandbox.js";
21
21
  export { LazySandbox, type LazySandboxOptions, resolveDefaultSandboxRuntimeEndpoint, } from "./lazy-sandbox.js";
22
22
  export { type BashToolSandboxLike, type CreateSandboxBashTool, createSandboxShellTools, normalizeBashToolSet, renameSandboxFileTools, type SandboxShellToolDefinition, type SandboxShellToolSet, } from "./shell-tools.js";
23
+ export { createHostedSandboxClient, createHostedSandboxTools, createProjectScopedExecOptions, type HostedSandboxClient, type HostedSandboxClientOptions, type HostedSandboxJobClient, type HostedSandboxToolsOptions, type HostedSandboxToolsResult, unwrapSandboxWorkingDirectoryCommand, } from "./hosted-tools.js";
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/sandbox/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,OAAO,EACP,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,KAAK,kBAAkB,EACvB,oCAAoC,GACrC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/sandbox/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,OAAO,EACP,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,KAAK,kBAAkB,EACvB,oCAAoC,GACrC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,8BAA8B,EAC9B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,oCAAoC,GACrC,MAAM,mBAAmB,CAAC"}
@@ -20,3 +20,4 @@ import "../../_dnt.polyfills.js";
20
20
  export { Sandbox, } from "./sandbox.js";
21
21
  export { LazySandbox, resolveDefaultSandboxRuntimeEndpoint, } from "./lazy-sandbox.js";
22
22
  export { createSandboxShellTools, normalizeBashToolSet, renameSandboxFileTools, } from "./shell-tools.js";
23
+ export { createHostedSandboxClient, createHostedSandboxTools, createProjectScopedExecOptions, unwrapSandboxWorkingDirectoryCommand, } from "./hosted-tools.js";
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.351";
1
+ export declare const VERSION = "0.1.353";
2
2
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.351";
3
+ export const VERSION = "0.1.353";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.351",
3
+ "version": "0.1.353",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.351",
3
+ "version": "0.1.353",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -4,7 +4,7 @@
4
4
 
5
5
  // See https://github.com/facebook/react/blob/main/packages/react-dom/client.js to see how the exports are declared,
6
6
 
7
- import React = require("https://esm.sh/@types/react@19.2.3/index.d.ts");
7
+ import React = require("https://esm.sh/@types/react@19.2.14/index.d.ts");
8
8
 
9
9
  export {};
10
10
 
@@ -18,6 +18,7 @@ interface KeyboardEvent extends Event {}
18
18
  interface MouseEvent extends Event {}
19
19
  interface TouchEvent extends Event {}
20
20
  interface PointerEvent extends Event {}
21
+ interface SubmitEvent extends Event {}
21
22
  interface ToggleEvent extends Event {}
22
23
  interface TransitionEvent extends Event {}
23
24
  interface UIEvent extends Event {}
@@ -16,6 +16,7 @@ type NativeKeyboardEvent = KeyboardEvent;
16
16
  type NativeMouseEvent = MouseEvent;
17
17
  type NativeTouchEvent = TouchEvent;
18
18
  type NativePointerEvent = PointerEvent;
19
+ type NativeSubmitEvent = SubmitEvent;
19
20
  type NativeToggleEvent = ToggleEvent;
20
21
  type NativeTransitionEvent = TransitionEvent;
21
22
  type NativeUIEvent = UIEvent;
@@ -225,12 +226,20 @@ declare namespace React {
225
226
 
226
227
  type ComponentState = any;
227
228
 
229
+ interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_KEY_TYPES {}
230
+
228
231
  /**
229
232
  * A value which uniquely identifies a node among items in an array.
230
233
  *
231
234
  * @see {@link https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key React Docs}
232
235
  */
233
- type Key = string | number | bigint;
236
+ type Key =
237
+ | string
238
+ | number
239
+ | bigint
240
+ | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_KEY_TYPES[
241
+ keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_KEY_TYPES
242
+ ];
234
243
 
235
244
  /**
236
245
  * @internal The props any component can receive.
@@ -1884,7 +1893,7 @@ declare namespace React {
1884
1893
  *
1885
1894
  * @param callback A synchronous, void callback that will execute as a single, complete React commit.
1886
1895
  *
1887
- * @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
1896
+ * @see {@link https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks}
1888
1897
  */
1889
1898
  // NOTES
1890
1899
  // - the order of these signatures matters - typescript will check the signatures in source order.
@@ -1926,7 +1935,31 @@ declare namespace React {
1926
1935
  reducer: (state: State, action: Action) => State,
1927
1936
  ): [State, (action: Action) => void];
1928
1937
 
1929
- export type Usable<T> = PromiseLike<T> | Context<T>;
1938
+ interface UntrackedReactPromise<T> extends PromiseLike<T> {
1939
+ status?: void;
1940
+ }
1941
+
1942
+ export interface PendingReactPromise<T> extends PromiseLike<T> {
1943
+ status: "pending";
1944
+ }
1945
+
1946
+ export interface FulfilledReactPromise<T> extends PromiseLike<T> {
1947
+ status: "fulfilled";
1948
+ value: T;
1949
+ }
1950
+
1951
+ export interface RejectedReactPromise<T> extends PromiseLike<T> {
1952
+ status: "rejected";
1953
+ reason: unknown;
1954
+ }
1955
+
1956
+ export type ReactPromise<T> =
1957
+ | UntrackedReactPromise<T>
1958
+ | PendingReactPromise<T>
1959
+ | FulfilledReactPromise<T>
1960
+ | RejectedReactPromise<T>;
1961
+
1962
+ export type Usable<T> = ReactPromise<T> | Context<T>;
1930
1963
 
1931
1964
  export function use<T>(usable: Usable<T>): T;
1932
1965
 
@@ -2041,15 +2074,28 @@ declare namespace React {
2041
2074
  target: EventTarget & Target;
2042
2075
  }
2043
2076
 
2077
+ /**
2078
+ * @deprecated FormEvent doesn't actually exist.
2079
+ * You probably meant to use {@link ChangeEvent}, {@link InputEvent}, {@link SubmitEvent}, or just {@link SyntheticEvent} instead
2080
+ * depending on the event type.
2081
+ */
2044
2082
  interface FormEvent<T = Element> extends SyntheticEvent<T> {
2045
2083
  }
2046
2084
 
2047
2085
  interface InvalidEvent<T = Element> extends SyntheticEvent<T> {
2048
- target: EventTarget & T;
2049
2086
  }
2050
2087
 
2051
- interface ChangeEvent<T = Element> extends SyntheticEvent<T> {
2052
- target: EventTarget & T;
2088
+ /**
2089
+ * change events bubble in React so their target is generally unknown.
2090
+ * Only for form elements we know their target type because form events can't
2091
+ * be nested.
2092
+ * This type exists purely to narrow `target` for form elements. It doesn't
2093
+ * reflect a DOM event. Change events are just fired as standard {@link SyntheticEvent}.
2094
+ */
2095
+ interface ChangeEvent<CurrentTarget = Element, Target = Element> extends SyntheticEvent<CurrentTarget> {
2096
+ // TODO: This is wrong for change event handlers on arbitrary. Should
2097
+ // be EventTarget & Target, but kept for backward compatibility until React 20.
2098
+ target: EventTarget & CurrentTarget;
2053
2099
  }
2054
2100
 
2055
2101
  interface InputEvent<T = Element> extends SyntheticEvent<T, NativeInputEvent> {
@@ -2119,6 +2165,13 @@ declare namespace React {
2119
2165
  shiftKey: boolean;
2120
2166
  }
2121
2167
 
2168
+ interface SubmitEvent<T = Element> extends SyntheticEvent<T, NativeSubmitEvent> {
2169
+ // `submitter` is available in react@canary
2170
+ // submitter: HTMLElement | null;
2171
+ // SubmitEvents are always targetted at HTMLFormElements.
2172
+ target: EventTarget & HTMLFormElement;
2173
+ }
2174
+
2122
2175
  interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> {
2123
2176
  altKey: boolean;
2124
2177
  changedTouches: TouchList;
@@ -2174,11 +2227,19 @@ declare namespace React {
2174
2227
  type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
2175
2228
  type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
2176
2229
  type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
2230
+ /**
2231
+ * @deprecated FormEventHandler doesn't actually exist.
2232
+ * You probably meant to use {@link ChangeEventHandler}, {@link InputEventHandler}, {@link SubmitEventHandler}, or just {@link EventHandler} instead
2233
+ * depending on the event type.
2234
+ */
2177
2235
  type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
2178
- type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
2236
+ type ChangeEventHandler<CurrentTarget = Element, Target = Element> = EventHandler<
2237
+ ChangeEvent<CurrentTarget, Target>
2238
+ >;
2179
2239
  type InputEventHandler<T = Element> = EventHandler<InputEvent<T>>;
2180
2240
  type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
2181
2241
  type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
2242
+ type SubmitEventHandler<T = Element> = EventHandler<SubmitEvent<T>>;
2182
2243
  type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
2183
2244
  type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
2184
2245
  type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
@@ -2232,19 +2293,19 @@ declare namespace React {
2232
2293
  onBlur?: FocusEventHandler<T> | undefined;
2233
2294
  onBlurCapture?: FocusEventHandler<T> | undefined;
2234
2295
 
2235
- // Form Events
2236
- onChange?: FormEventHandler<T> | undefined;
2237
- onChangeCapture?: FormEventHandler<T> | undefined;
2296
+ // form related Events
2297
+ onChange?: ChangeEventHandler<T> | undefined;
2298
+ onChangeCapture?: ChangeEventHandler<T> | undefined;
2238
2299
  onBeforeInput?: InputEventHandler<T> | undefined;
2239
- onBeforeInputCapture?: FormEventHandler<T> | undefined;
2240
- onInput?: FormEventHandler<T> | undefined;
2241
- onInputCapture?: FormEventHandler<T> | undefined;
2242
- onReset?: FormEventHandler<T> | undefined;
2243
- onResetCapture?: FormEventHandler<T> | undefined;
2244
- onSubmit?: FormEventHandler<T> | undefined;
2245
- onSubmitCapture?: FormEventHandler<T> | undefined;
2246
- onInvalid?: FormEventHandler<T> | undefined;
2247
- onInvalidCapture?: FormEventHandler<T> | undefined;
2300
+ onBeforeInputCapture?: InputEventHandler<T> | undefined;
2301
+ onInput?: InputEventHandler<T> | undefined;
2302
+ onInputCapture?: InputEventHandler<T> | undefined;
2303
+ onReset?: ReactEventHandler<T> | undefined;
2304
+ onResetCapture?: ReactEventHandler<T> | undefined;
2305
+ onSubmit?: SubmitEventHandler<T> | undefined;
2306
+ onSubmitCapture?: SubmitEventHandler<T> | undefined;
2307
+ onInvalid?: ReactEventHandler<T> | undefined;
2308
+ onInvalidCapture?: ReactEventHandler<T> | undefined;
2248
2309
 
2249
2310
  // Image Events
2250
2311
  onLoad?: ReactEventHandler<T> | undefined;
@@ -2788,7 +2849,7 @@ declare namespace React {
2788
2849
 
2789
2850
  // Living Standard
2790
2851
  /**
2791
- * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
2852
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert}
2792
2853
  */
2793
2854
  inert?: boolean | undefined;
2794
2855
  /**
@@ -3251,7 +3312,9 @@ declare namespace React {
3251
3312
  value?: string | readonly string[] | number | undefined;
3252
3313
  width?: number | string | undefined;
3253
3314
 
3254
- onChange?: ChangeEventHandler<T> | undefined;
3315
+ // No other element dispatching change events can be nested in a <input>
3316
+ // so we know the target will be a HTMLInputElement.
3317
+ onChange?: ChangeEventHandler<T, HTMLInputElement> | undefined;
3255
3318
  }
3256
3319
 
3257
3320
  interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -3416,7 +3479,9 @@ declare namespace React {
3416
3479
  required?: boolean | undefined;
3417
3480
  size?: number | undefined;
3418
3481
  value?: string | readonly string[] | number | undefined;
3419
- onChange?: ChangeEventHandler<T> | undefined;
3482
+ // No other element dispatching change events can be nested in a <select>
3483
+ // so we know the target will be a HTMLSelectElement.
3484
+ onChange?: ChangeEventHandler<T, HTMLSelectElement> | undefined;
3420
3485
  }
3421
3486
 
3422
3487
  interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -3468,7 +3533,9 @@ declare namespace React {
3468
3533
  value?: string | readonly string[] | number | undefined;
3469
3534
  wrap?: string | undefined;
3470
3535
 
3471
- onChange?: ChangeEventHandler<T> | undefined;
3536
+ // No other element dispatching change events can be nested in a <textarea>
3537
+ // so we know the target will be a HTMLTextAreaElement.
3538
+ onChange?: ChangeEventHandler<T, HTMLTextAreaElement> | undefined;
3472
3539
  }
3473
3540
 
3474
3541
  interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -3540,6 +3607,9 @@ declare namespace React {
3540
3607
  method?: string | undefined;
3541
3608
  min?: number | string | undefined;
3542
3609
  name?: string | undefined;
3610
+ nonce?: string | undefined;
3611
+ part?: string | undefined;
3612
+ slot?: string | undefined;
3543
3613
  style?: CSSProperties | undefined;
3544
3614
  target?: string | undefined;
3545
3615
  type?: string | undefined;
@@ -4057,7 +4127,6 @@ declare namespace React {
4057
4127
  * Captures which component contained the exception, and its ancestors.
4058
4128
  */
4059
4129
  componentStack?: string | null;
4060
- digest?: string | null;
4061
4130
  }
4062
4131
 
4063
4132
  // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts
@@ -4,7 +4,7 @@
4
4
 
5
5
  // See https://github.com/facebook/react/blob/main/packages/react-dom/client.js to see how the exports are declared,
6
6
 
7
- import React = require("https://esm.sh/@types/react@19.2.3/index.d.ts");
7
+ import React = require("https://esm.sh/@types/react@19.2.14/index.d.ts");
8
8
 
9
9
  export {};
10
10
 
@@ -212,7 +212,7 @@ export async function runAgentRuntimeForkStep(input: RunAgentRuntimeForkStepInpu
212
212
  ...(input.providerOptions
213
213
  ? { resolveModelTransport: () => ({ providerOptions: input.providerOptions }) }
214
214
  : {}),
215
- __vfAllowedRemoteTools: input.forkToolNames,
215
+ allowedRemoteTools: input.forkToolNames,
216
216
  };
217
217
  const runtime = new AgentRuntime("invoke-agent-child-runtime", runtimeConfig);
218
218
 
@@ -410,6 +410,14 @@ export function enforceSkillPolicy(
410
410
  }
411
411
 
412
412
  function getRuntimeAllowedRemoteTools(config: AgentConfig): string[] | undefined {
413
+ if (Object.hasOwn(config, "allowedRemoteTools")) {
414
+ const raw = config.allowedRemoteTools;
415
+ if (!Array.isArray(raw)) {
416
+ return [];
417
+ }
418
+ return raw.every((toolName) => typeof toolName === "string") ? raw : [];
419
+ }
420
+
413
421
  const configWithRuntimeFilters = config as RuntimeToolFilterConfig;
414
422
  if (!Object.hasOwn(configWithRuntimeFilters, "__vfAllowedRemoteTools")) {
415
423
  return undefined;
@@ -79,6 +79,11 @@ export interface AgentConfig {
79
79
  system: string | (() => string) | (() => Promise<string>);
80
80
  tools?: true | Record<string, Tool | boolean>;
81
81
  remoteTools?: RemoteToolSource[];
82
+ /**
83
+ * Optional remote tool name allowlist. When set, only matching tools from
84
+ * `remoteTools` are exposed to the model and executable at runtime.
85
+ */
86
+ allowedRemoteTools?: string[];
82
87
  maxSteps?: number;
83
88
  streaming?: boolean;
84
89
  memory?: MemoryConfig;
@@ -24,7 +24,6 @@ const logger = serverLogger.component("internal-agent-run-stream");
24
24
 
25
25
  type RuntimeFilteredAgent = Agent & {
26
26
  config: Agent["config"] & {
27
- __vfAllowedRemoteTools?: string[];
28
27
  __vfForwardedIntegrationToolDefs?: ForwardedToolDef[];
29
28
  };
30
29
  };
@@ -194,7 +193,7 @@ export async function createRuntimeAgentStreamResponse(
194
193
  ...agent.config,
195
194
  tools: mergedTools,
196
195
  ...(allowedRemoteToolNames !== undefined
197
- ? { __vfAllowedRemoteTools: allowedRemoteToolNames }
196
+ ? { allowedRemoteTools: allowedRemoteToolNames }
198
197
  : {}),
199
198
  ...(forwardedIntegrationToolDefs !== undefined
200
199
  ? { __vfForwardedIntegrationToolDefs: forwardedIntegrationToolDefs }
@@ -0,0 +1,169 @@
1
+ import { z } from "zod";
2
+ import { tool } from "../tool/index.js";
3
+ import type { CommandJob, CommandJobOutput, ExecOptions } from "./sandbox.js";
4
+ import { LazySandbox, type LazySandboxOptions } from "./lazy-sandbox.js";
5
+ import {
6
+ type BashToolSandboxLike,
7
+ type CreateSandboxBashTool,
8
+ createSandboxShellTools,
9
+ type SandboxShellToolSet,
10
+ } from "./shell-tools.js";
11
+
12
+ const SANDBOX_WORKING_DIRECTORY = "/workspace";
13
+ const SANDBOX_WORKING_DIRECTORY_PREFIX_PATTERN =
14
+ /^\s*(?:mkdir -p \/tmp\/bash-tool\s*&&\s*)?cd\s+"\/workspace"\s*&&\s*/i;
15
+
16
+ export interface HostedSandboxJobClient {
17
+ startCommandJob(command: string): Promise<CommandJob>;
18
+ getCommandJob(jobId: string): Promise<CommandJob>;
19
+ getCommandJobOutput(jobId: string): Promise<CommandJobOutput>;
20
+ cancelCommandJob(jobId: string): Promise<CommandJob>;
21
+ }
22
+
23
+ export interface HostedSandboxClient extends BashToolSandboxLike, HostedSandboxJobClient {
24
+ ensure(): Promise<void>;
25
+ close(): Promise<void>;
26
+ readonly isActive: boolean;
27
+ readonly id: string | null;
28
+ readonly url: string | null;
29
+ }
30
+
31
+ export interface HostedSandboxClientOptions extends LazySandboxOptions {}
32
+
33
+ export interface HostedSandboxToolsOptions extends HostedSandboxClientOptions {
34
+ createBashTool: CreateSandboxBashTool;
35
+ }
36
+
37
+ export interface HostedSandboxToolsResult {
38
+ tools: SandboxShellToolSet;
39
+ sandbox: HostedSandboxClient;
40
+ closeSandbox: () => Promise<void>;
41
+ }
42
+
43
+ export function unwrapSandboxWorkingDirectoryCommand(command: string): string {
44
+ const trimmedCommand = command.trim();
45
+ if (!SANDBOX_WORKING_DIRECTORY_PREFIX_PATTERN.test(trimmedCommand)) {
46
+ return trimmedCommand;
47
+ }
48
+
49
+ return trimmedCommand.replace(SANDBOX_WORKING_DIRECTORY_PREFIX_PATTERN, "").trim();
50
+ }
51
+
52
+ export function createProjectScopedExecOptions(
53
+ projectReference: string | null | undefined,
54
+ ): ExecOptions {
55
+ return projectReference ? { projectReference } : {};
56
+ }
57
+
58
+ function isRecord(value: unknown): value is Record<string, unknown> {
59
+ return typeof value === "object" && value !== null && !Array.isArray(value);
60
+ }
61
+
62
+ function toSandboxFileContent(content: unknown): string {
63
+ if (typeof content === "string") {
64
+ return content;
65
+ }
66
+ if (content instanceof Uint8Array) {
67
+ return new TextDecoder().decode(content);
68
+ }
69
+ return String(content ?? "");
70
+ }
71
+
72
+ function normalizeSandboxWriteFile(file: unknown): { path: string; content: string } {
73
+ if (!isRecord(file) || typeof file.path !== "string") {
74
+ throw new Error("Sandbox writeFiles entries must include a string path");
75
+ }
76
+
77
+ return {
78
+ path: file.path,
79
+ content: toSandboxFileContent(file.content),
80
+ };
81
+ }
82
+
83
+ export function createHostedSandboxClient(
84
+ input: HostedSandboxClientOptions = {},
85
+ ): HostedSandboxClient {
86
+ const getProjectId = input.getProjectId ?? (() => input.projectId);
87
+ const sandbox = new LazySandbox({ ...input, getProjectId });
88
+
89
+ const getExecOptions = () => createProjectScopedExecOptions(getProjectId());
90
+ const getCommandJobExecOptions = () => ({
91
+ ...getExecOptions(),
92
+ cwd: SANDBOX_WORKING_DIRECTORY,
93
+ });
94
+
95
+ return {
96
+ ensure: () => sandbox.ensure(),
97
+ async executeCommand(command) {
98
+ return await sandbox.executeCommand(command, getExecOptions());
99
+ },
100
+ readFile: (path) => sandbox.readFile(path),
101
+ writeFiles: (files) => sandbox.writeFiles(files.map((file) => normalizeSandboxWriteFile(file))),
102
+ startCommandJob: (command) =>
103
+ sandbox.startCommandJob(
104
+ unwrapSandboxWorkingDirectoryCommand(command),
105
+ getCommandJobExecOptions(),
106
+ ),
107
+ getCommandJob: (jobId) => sandbox.getCommandJob(jobId),
108
+ getCommandJobOutput: (jobId) => sandbox.getCommandJobOutput(jobId),
109
+ cancelCommandJob: (jobId) => sandbox.cancelCommandJob(jobId),
110
+ close: () => sandbox.close(),
111
+ get isActive() {
112
+ return sandbox.isActive;
113
+ },
114
+ get id() {
115
+ return sandbox.id;
116
+ },
117
+ get url() {
118
+ return sandbox.url;
119
+ },
120
+ };
121
+ }
122
+
123
+ export async function createHostedSandboxTools(
124
+ input: HostedSandboxToolsOptions,
125
+ ): Promise<HostedSandboxToolsResult> {
126
+ const sandbox = createHostedSandboxClient(input);
127
+ const shellTools = await createSandboxShellTools(sandbox, input.createBashTool);
128
+
129
+ const tools: SandboxShellToolSet = {
130
+ ...shellTools,
131
+ start_command_job: tool({
132
+ description:
133
+ "Start a long-running sandbox command as an async job. Use this instead of bash for durable shell operations.",
134
+ inputSchema: z.object({
135
+ command: z.string().describe("Single shell command to run asynchronously in the sandbox"),
136
+ }),
137
+ execute: async ({ command }) => await sandbox.startCommandJob(command),
138
+ }),
139
+ get_command_job: tool({
140
+ description:
141
+ "Get the current status for an async sandbox command job. Use this for polling while a long-running job is still running.",
142
+ inputSchema: z.object({
143
+ jobId: z.string().describe("Sandbox command job ID"),
144
+ }),
145
+ execute: async ({ jobId }) => await sandbox.getCommandJob(jobId),
146
+ }),
147
+ get_command_job_output: tool({
148
+ description:
149
+ "Get the captured stdout/stderr and terminal metadata for an async sandbox command job. Prefer calling this after the job reaches a terminal state.",
150
+ inputSchema: z.object({
151
+ jobId: z.string().describe("Sandbox command job ID"),
152
+ }),
153
+ execute: async ({ jobId }) => await sandbox.getCommandJobOutput(jobId),
154
+ }),
155
+ cancel_command_job: tool({
156
+ description: "Cancel a running async sandbox command job.",
157
+ inputSchema: z.object({
158
+ jobId: z.string().describe("Sandbox command job ID"),
159
+ }),
160
+ execute: async ({ jobId }) => await sandbox.cancelCommandJob(jobId),
161
+ }),
162
+ };
163
+
164
+ return {
165
+ tools,
166
+ sandbox,
167
+ closeSandbox: () => sandbox.close(),
168
+ };
169
+ }
@@ -48,3 +48,14 @@ export {
48
48
  type SandboxShellToolDefinition,
49
49
  type SandboxShellToolSet,
50
50
  } from "./shell-tools.js";
51
+ export {
52
+ createHostedSandboxClient,
53
+ createHostedSandboxTools,
54
+ createProjectScopedExecOptions,
55
+ type HostedSandboxClient,
56
+ type HostedSandboxClientOptions,
57
+ type HostedSandboxJobClient,
58
+ type HostedSandboxToolsOptions,
59
+ type HostedSandboxToolsResult,
60
+ unwrapSandboxWorkingDirectoryCommand,
61
+ } from "./hosted-tools.js";
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.351";
3
+ export const VERSION = "0.1.353";