Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/agent/coreBackend.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { FilesystemBackend } from "deepagents";

/**
* Create a FilesystemBackend rooted at the filesystem root.
* Create a FilesystemBackend sandboxed to the current working directory.
* @returns {FilesystemBackend}
*/
export function createCoreBackend() {
const baseDir = '/';
return new FilesystemBackend({
rootDir: baseDir,
virtualMode: false,
rootDir: process.cwd(),
virtualMode: true,
});
}
4 changes: 3 additions & 1 deletion src/agent/deepAgents.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { createChatModel } from "../provider/openai.js";
import { buildToolConfig } from "../tools/index.js";
import { createCoreBackend } from "./coreBackend.js";
import { createContextBackend } from "./contextBackend.js";
import { createDmzBackend } from "./dmzBackend.js";
// Skill classification map — classifies each skill by agent type.
// Skills are discovered dynamically; this map provides the classification
// for filtering. Initially, all skills are classified as "subagent" since
Expand Down Expand Up @@ -96,8 +97,8 @@ export async function createDeepAgentsOrchestrator(checkpointer = null) {
});

const coreBackend = createCoreBackend();
const dmzBackend = createDmzBackend();
const contextBackend = createContextBackend();

const contextRoute = "/" + config.memory.contextDir.replace(/^\.?\//, "");

// Filter skill paths by agent type
Expand All @@ -111,6 +112,7 @@ export async function createDeepAgentsOrchestrator(checkpointer = null) {
store: new InMemoryStore(),
backend: new CompositeBackend(coreBackend, {
[contextRoute]: contextBackend,
"/": dmzBackend,
}),
subagents: [
{
Expand Down
13 changes: 13 additions & 0 deletions src/agent/dmzBackend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { FilesystemBackend } from "deepagents";

/**
* Create a FilesystemBackend sandboxed to /tmp.
* Used as a fallback backend for operations that don't fit other routes.
* @returns {FilesystemBackend}
*/
export function createDmzBackend() {
return new FilesystemBackend({
rootDir: '/tmp',
virtualMode: false,
});
}