Give agents a world / 07

Working environments

Mount a durable virtual filesystem and a request-scoped REPL when an agent needs to research, compute, write code, make documents, generate media, inspect its output, and pass real artifacts to another agent.

Mount the VFS

agents/maker/workbench.tstypescript
export const makerWorkspace = defineWorkingEnvironment({
  options: ({ assembly }) => ({
    limits: {
      maxVfsBytes: 64 * 1024 * 1024,
      maxFileBytes: 12 * 1024 * 1024,
    },
    execution: {
      onProgress: (event) => assembly.controls.emit({
        type: "maker.workspace.progress",
        data: event,
      }),
    },
    onVerb: (event) => assembly.controls.emit({
      type: "maker.workspace.verb",
      data: event,
    }),
  }),
});

glove-working-environment owns the sandbox, VFS, script runner, limits, and model-facing verbs. Foundry owns instance- and message-aware mounting, correlation, persistence boundaries, and inspection.

Build the REPL for this request

agents/maker/workbench.tstypescript
export function makerRepl(actor: string, brief: Brief) {
  const session = JsSession.create({ actor });
  session.register(defineFn({
    name: "brief__current",
    description: "Read the current campaign brief",
    input: z.object({}),
    readOnlyHint: true,
    handler: () => brief,
  }));
  return defineRepl({
    language: "javascript",
    session,
    mount: { frame: "repl", discovery: "auto" },
  });
}

The next message may expose different functions. This is intentional: the REPL becomes a small task-specific computer, not a permanent catalog of every API.

Add artifact capabilities

PackageCapability
glove-env-documentsRead and create PDFs and Word documents, extract DOCX images, and handle scanned documents through render and OCR.
glove-env-spreadsheetsBuild and inspect workbooks with paged, structured access.
glove-env-slidesCreate and read presentation decks.
glove-env-images + glove-imageInspect, generate, edit, assemble, and review images with recorded lineage.
glove-env-media + glove-env-motionInspect and transform audio/video or render deterministic motion scenes.
glove-env-render + glove-env-ocrRender artifacts to images, look at the result, and recover text from scans.

Load skills into the environment

A skill can install instructions, scripts, templates, and adapter requirements into the mounted environment. Resolve skills from the current instance and message just like tools. Keep third-party skill code reviewable and pin the source revision used by a production instance.

Choose persistence deliberately

The in-memory adapter is for development. Production workbenches need durable backing, size limits, read-only zones, egress policy, and an artifact export strategy. Mount shared paths read-only when several agents consume the same source material; write new work into agent- or conversation-owned paths.