mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-20 12:04:43 +00:00
chore: include remaining workspace changes
This commit is contained in:
parent
ea7c36a8e7
commit
f0f2576289
17 changed files with 693 additions and 192 deletions
|
|
@ -32,8 +32,6 @@ services:
|
|||
- "8750:8750"
|
||||
volumes:
|
||||
- "..:/app"
|
||||
# Override HF_RIVET_CHECKOUT_PATH when the linked Rivet workspace lives outside the default sibling checkout.
|
||||
- "${HF_RIVET_CHECKOUT_PATH:-../../../handoff/rivet-checkout}:/handoff/rivet-checkout:ro"
|
||||
# Reuse the host Codex auth profile for local sandbox-agent Codex sessions in dev.
|
||||
- "${HOME}/.codex:/root/.codex"
|
||||
# Keep backend dependency installs Linux-native instead of using host node_modules.
|
||||
|
|
@ -64,7 +62,6 @@ services:
|
|||
- "..:/app"
|
||||
# Ensure logs in .sandbox-agent-factory/ persist on the host even if we change source mounts later.
|
||||
- "./.sandbox-agent-factory:/app/factory/.sandbox-agent-factory"
|
||||
- "${HF_RIVET_CHECKOUT_PATH:-../../../handoff/rivet-checkout}:/handoff/rivet-checkout:ro"
|
||||
# Use Linux-native workspace dependencies inside the container instead of host node_modules.
|
||||
- "sandbox-agent-factory_node_modules:/app/node_modules"
|
||||
- "sandbox-agent-factory_client_node_modules:/app/factory/packages/client/node_modules"
|
||||
|
|
|
|||
31
factory/compose.mock.yaml
Normal file
31
factory/compose.mock.yaml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
name: sandbox-agent-factory-mock
|
||||
|
||||
services:
|
||||
frontend:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: factory/docker/frontend.dev.Dockerfile
|
||||
working_dir: /app
|
||||
environment:
|
||||
HOME: "/tmp"
|
||||
FACTORY_FRONTEND_CLIENT_MODE: "mock"
|
||||
ports:
|
||||
- "4174:4173"
|
||||
volumes:
|
||||
- "..:/app"
|
||||
- "./.sandbox-agent-factory:/app/factory/.sandbox-agent-factory"
|
||||
# Use Linux-native workspace dependencies inside the container instead of host node_modules.
|
||||
- "sandbox-agent-factory-mock_node_modules:/app/node_modules"
|
||||
- "sandbox-agent-factory-mock_client_node_modules:/app/factory/packages/client/node_modules"
|
||||
- "sandbox-agent-factory-mock_frontend_errors_node_modules:/app/factory/packages/frontend-errors/node_modules"
|
||||
- "sandbox-agent-factory-mock_frontend_node_modules:/app/factory/packages/frontend/node_modules"
|
||||
- "sandbox-agent-factory-mock_shared_node_modules:/app/factory/packages/shared/node_modules"
|
||||
- "sandbox-agent-factory-mock_pnpm_store:/tmp/.local/share/pnpm/store"
|
||||
|
||||
volumes:
|
||||
sandbox-agent-factory-mock_node_modules: {}
|
||||
sandbox-agent-factory-mock_client_node_modules: {}
|
||||
sandbox-agent-factory-mock_frontend_errors_node_modules: {}
|
||||
sandbox-agent-factory-mock_frontend_node_modules: {}
|
||||
sandbox-agent-factory-mock_shared_node_modules: {}
|
||||
sandbox-agent-factory-mock_pnpm_store: {}
|
||||
|
|
@ -39,7 +39,6 @@ ENV SANDBOX_AGENT_BIN="/root/.local/bin/sandbox-agent"
|
|||
WORKDIR /workspace/quebec
|
||||
|
||||
COPY quebec /workspace/quebec
|
||||
COPY rivet-checkout /workspace/rivet-checkout
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm --filter @sandbox-agent/factory-shared build
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ RUN npm install -g pnpm@10.28.2
|
|||
WORKDIR /workspace/quebec
|
||||
|
||||
COPY quebec /workspace/quebec
|
||||
COPY rivet-checkout /workspace/rivet-checkout
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm --filter @sandbox-agent/factory-shared build
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
"drizzle-orm": "^0.44.5",
|
||||
"hono": "^4.11.9",
|
||||
"pino": "^10.3.1",
|
||||
"rivetkit": "link:../../../../../handoff/rivet-checkout/rivetkit-typescript/packages/rivetkit",
|
||||
"rivetkit": "^2.1.6",
|
||||
"sandbox-agent": "workspace:*",
|
||||
"uuid": "^13.0.0",
|
||||
"zod": "^4.1.5"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { dirname, resolve } from "node:path";
|
||||
|
||||
const DEVELOPMENT_ENV_FILES = [".env.development.local", ".env.development"] as const;
|
||||
const LOCAL_DEV_BETTER_AUTH_SECRET = "sandbox-agent-factory-development-only-change-me";
|
||||
const LOCAL_DEV_APP_URL = "http://localhost:4173";
|
||||
|
||||
function decodeQuotedEnvValue(value: string): string {
|
||||
return value.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, "\t");
|
||||
}
|
||||
|
||||
function loadEnvFile(path: string): void {
|
||||
const source = readFileSync(path, "utf8");
|
||||
for (const line of source.split(/\r?\n/)) {
|
||||
|
|
@ -29,7 +33,7 @@ function loadEnvFile(path: string): void {
|
|||
(value.startsWith('"') && value.endsWith('"')) ||
|
||||
(value.startsWith("'") && value.endsWith("'"))
|
||||
) {
|
||||
value = value.slice(1, -1);
|
||||
value = decodeQuotedEnvValue(value.slice(1, -1));
|
||||
}
|
||||
process.env[key] = value;
|
||||
}
|
||||
|
|
@ -44,14 +48,27 @@ export function loadDevelopmentEnvFiles(cwd = process.cwd()): string[] {
|
|||
return [];
|
||||
}
|
||||
|
||||
const loaded: string[] = [];
|
||||
for (const fileName of DEVELOPMENT_ENV_FILES) {
|
||||
const path = resolve(cwd, fileName);
|
||||
if (!existsSync(path)) {
|
||||
continue;
|
||||
const searchDirs: string[] = [];
|
||||
let current = resolve(cwd);
|
||||
for (;;) {
|
||||
searchDirs.push(current);
|
||||
const parent = dirname(current);
|
||||
if (parent === current) {
|
||||
break;
|
||||
}
|
||||
current = parent;
|
||||
}
|
||||
|
||||
const loaded: string[] = [];
|
||||
for (const dir of searchDirs) {
|
||||
for (const fileName of DEVELOPMENT_ENV_FILES) {
|
||||
const path = resolve(dir, fileName);
|
||||
if (!existsSync(path) || loaded.includes(path)) {
|
||||
continue;
|
||||
}
|
||||
loadEnvFile(path);
|
||||
loaded.push(path);
|
||||
}
|
||||
loadEnvFile(path);
|
||||
loaded.push(path);
|
||||
}
|
||||
return loaded;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@sandbox-agent/factory-shared": "workspace:*",
|
||||
"rivetkit": "link:../../../../../handoff/rivet-checkout/rivetkit-typescript/packages/rivetkit"
|
||||
"rivetkit": "^2.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tsup": "^8.5.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue