lastlight 0.16.0 → 0.16.1
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/README.md +71 -692
- package/dist/cli-config.js.map +1 -0
- package/dist/cli-format.js.map +1 -0
- package/dist/{cli/cli-server.d.ts → cli-server.d.ts} +26 -1
- package/dist/{cli/cli-server.js → cli-server.js} +40 -5
- package/dist/cli-server.js.map +1 -0
- package/dist/cli-timeline.js.map +1 -0
- package/dist/{cli/cli.js → cli.js} +4 -3
- package/dist/cli.js.map +1 -0
- package/dist/{cli/fork-cli.d.ts → fork-cli.d.ts} +3 -3
- package/dist/{cli/fork-cli.js → fork-cli.js} +28 -27
- package/dist/fork-cli.js.map +1 -0
- package/dist/{cli/oauth-cli.js → oauth-cli.js} +1 -1
- package/dist/oauth-cli.js.map +1 -0
- package/dist/{cli/setup.js → setup.js} +10 -4
- package/dist/setup.js.map +1 -0
- package/dist/{cli/skills-install.d.ts → skills-install.d.ts} +6 -0
- package/dist/{cli/skills-install.js → skills-install.js} +6 -2
- package/dist/skills-install.js.map +1 -0
- package/package.json +20 -65
- package/plugins/lastlight/.claude-plugin/plugin.json +1 -1
- package/agent-context/rules.md +0 -80
- package/agent-context/security.md +0 -69
- package/agent-context/soul.md +0 -21
- package/config/default.yaml +0 -119
- package/deploy/.env.production.example +0 -100
- package/deploy/entrypoint.sh +0 -82
- package/deploy/native/README.md +0 -160
- package/deploy/native/install.sh +0 -110
- package/deploy/native/lastlight.env.example +0 -95
- package/deploy/native/lastlight.service +0 -50
- package/deploy/sandbox-entrypoint.sh +0 -93
- package/dist/admin/auth.d.ts +0 -51
- package/dist/admin/auth.js +0 -121
- package/dist/admin/auth.js.map +0 -1
- package/dist/admin/chat-session-reader.d.ts +0 -39
- package/dist/admin/chat-session-reader.js +0 -84
- package/dist/admin/chat-session-reader.js.map +0 -1
- package/dist/admin/docker.d.ts +0 -61
- package/dist/admin/docker.js +0 -187
- package/dist/admin/docker.js.map +0 -1
- package/dist/admin/index.d.ts +0 -9
- package/dist/admin/index.js +0 -59
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/routes.d.ts +0 -81
- package/dist/admin/routes.js +0 -1381
- package/dist/admin/routes.js.map +0 -1
- package/dist/admin/sessions.d.ts +0 -89
- package/dist/admin/sessions.js +0 -204
- package/dist/admin/sessions.js.map +0 -1
- package/dist/admin/tail.d.ts +0 -12
- package/dist/admin/tail.js +0 -145
- package/dist/admin/tail.js.map +0 -1
- package/dist/admin/version.d.ts +0 -22
- package/dist/admin/version.js +0 -92
- package/dist/admin/version.js.map +0 -1
- package/dist/cli/cli-config.js.map +0 -1
- package/dist/cli/cli-format.js.map +0 -1
- package/dist/cli/cli-server.js.map +0 -1
- package/dist/cli/cli-timeline.js.map +0 -1
- package/dist/cli/cli.js.map +0 -1
- package/dist/cli/fork-cli.js.map +0 -1
- package/dist/cli/oauth-cli.js.map +0 -1
- package/dist/cli/setup.js.map +0 -1
- package/dist/cli/skills-install.js.map +0 -1
- package/dist/config/config-resolve.d.ts +0 -28
- package/dist/config/config-resolve.js +0 -47
- package/dist/config/config-resolve.js.map +0 -1
- package/dist/config/config.d.ts +0 -157
- package/dist/config/config.js +0 -581
- package/dist/config/config.js.map +0 -1
- package/dist/config/core-pin.d.ts +0 -16
- package/dist/config/core-pin.js +0 -85
- package/dist/config/core-pin.js.map +0 -1
- package/dist/config/overlay-assets.d.ts +0 -20
- package/dist/config/overlay-assets.js +0 -114
- package/dist/config/overlay-assets.js.map +0 -1
- package/dist/config/overlay-bootstrap.d.ts +0 -44
- package/dist/config/overlay-bootstrap.js +0 -304
- package/dist/config/overlay-bootstrap.js.map +0 -1
- package/dist/connectors/github-webhook.d.ts +0 -45
- package/dist/connectors/github-webhook.js +0 -321
- package/dist/connectors/github-webhook.js.map +0 -1
- package/dist/connectors/index.d.ts +0 -18
- package/dist/connectors/index.js +0 -41
- package/dist/connectors/index.js.map +0 -1
- package/dist/connectors/messaging/base.d.ts +0 -42
- package/dist/connectors/messaging/base.js +0 -139
- package/dist/connectors/messaging/base.js.map +0 -1
- package/dist/connectors/messaging/delivery.d.ts +0 -14
- package/dist/connectors/messaging/delivery.js +0 -38
- package/dist/connectors/messaging/delivery.js.map +0 -1
- package/dist/connectors/messaging/index.d.ts +0 -4
- package/dist/connectors/messaging/index.js +0 -4
- package/dist/connectors/messaging/index.js.map +0 -1
- package/dist/connectors/messaging/session-manager.d.ts +0 -53
- package/dist/connectors/messaging/session-manager.js +0 -255
- package/dist/connectors/messaging/session-manager.js.map +0 -1
- package/dist/connectors/messaging/types.d.ts +0 -58
- package/dist/connectors/messaging/types.js +0 -7
- package/dist/connectors/messaging/types.js.map +0 -1
- package/dist/connectors/slack/connector.d.ts +0 -142
- package/dist/connectors/slack/connector.js +0 -494
- package/dist/connectors/slack/connector.js.map +0 -1
- package/dist/connectors/slack/index.d.ts +0 -2
- package/dist/connectors/slack/index.js +0 -3
- package/dist/connectors/slack/index.js.map +0 -1
- package/dist/connectors/slack/mrkdwn.d.ts +0 -19
- package/dist/connectors/slack/mrkdwn.js +0 -240
- package/dist/connectors/slack/mrkdwn.js.map +0 -1
- package/dist/connectors/types.d.ts +0 -61
- package/dist/connectors/types.js +0 -2
- package/dist/connectors/types.js.map +0 -1
- package/dist/cron/fanout.d.ts +0 -33
- package/dist/cron/fanout.js +0 -55
- package/dist/cron/fanout.js.map +0 -1
- package/dist/cron/jobs.d.ts +0 -18
- package/dist/cron/jobs.js +0 -37
- package/dist/cron/jobs.js.map +0 -1
- package/dist/cron/scheduler.d.ts +0 -45
- package/dist/cron/scheduler.js +0 -105
- package/dist/cron/scheduler.js.map +0 -1
- package/dist/engine/agent-executor.d.ts +0 -34
- package/dist/engine/agent-executor.js +0 -246
- package/dist/engine/agent-executor.js.map +0 -1
- package/dist/engine/chat/chat-runner.d.ts +0 -132
- package/dist/engine/chat/chat-runner.js +0 -424
- package/dist/engine/chat/chat-runner.js.map +0 -1
- package/dist/engine/chat/chat-skills.d.ts +0 -45
- package/dist/engine/chat/chat-skills.js +0 -184
- package/dist/engine/chat/chat-skills.js.map +0 -1
- package/dist/engine/chat/chat.d.ts +0 -54
- package/dist/engine/chat/chat.js +0 -316
- package/dist/engine/chat/chat.js.map +0 -1
- package/dist/engine/chat/message-batcher.d.ts +0 -32
- package/dist/engine/chat/message-batcher.js +0 -109
- package/dist/engine/chat/message-batcher.js.map +0 -1
- package/dist/engine/dispatcher.d.ts +0 -73
- package/dist/engine/dispatcher.js +0 -663
- package/dist/engine/dispatcher.js.map +0 -1
- package/dist/engine/event-shim.d.ts +0 -117
- package/dist/engine/event-shim.js +0 -435
- package/dist/engine/event-shim.js.map +0 -1
- package/dist/engine/executors/orchestrator.d.ts +0 -81
- package/dist/engine/executors/orchestrator.js +0 -365
- package/dist/engine/executors/orchestrator.js.map +0 -1
- package/dist/engine/executors/shared.d.ts +0 -189
- package/dist/engine/executors/shared.js +0 -616
- package/dist/engine/executors/shared.js.map +0 -1
- package/dist/engine/github/git-auth.d.ts +0 -62
- package/dist/engine/github/git-auth.js +0 -161
- package/dist/engine/github/git-auth.js.map +0 -1
- package/dist/engine/github/github-app-client.d.ts +0 -23
- package/dist/engine/github/github-app-client.js +0 -33
- package/dist/engine/github/github-app-client.js.map +0 -1
- package/dist/engine/github/github-tools.d.ts +0 -18
- package/dist/engine/github/github-tools.js +0 -263
- package/dist/engine/github/github-tools.js.map +0 -1
- package/dist/engine/github/github.d.ts +0 -1193
- package/dist/engine/github/github.js +0 -357
- package/dist/engine/github/github.js.map +0 -1
- package/dist/engine/github/profiles.d.ts +0 -279
- package/dist/engine/github/profiles.js +0 -42
- package/dist/engine/github/profiles.js.map +0 -1
- package/dist/engine/github/review-poster.d.ts +0 -98
- package/dist/engine/github/review-poster.js +0 -177
- package/dist/engine/github/review-poster.js.map +0 -1
- package/dist/engine/llm.d.ts +0 -79
- package/dist/engine/llm.js +0 -269
- package/dist/engine/llm.js.map +0 -1
- package/dist/engine/oauth.d.ts +0 -43
- package/dist/engine/oauth.js +0 -103
- package/dist/engine/oauth.js.map +0 -1
- package/dist/engine/router.d.ts +0 -29
- package/dist/engine/router.js +0 -680
- package/dist/engine/router.js.map +0 -1
- package/dist/engine/screen/classifier.d.ts +0 -93
- package/dist/engine/screen/classifier.js +0 -215
- package/dist/engine/screen/classifier.js.map +0 -1
- package/dist/engine/screen/screen.d.ts +0 -41
- package/dist/engine/screen/screen.js +0 -93
- package/dist/engine/screen/screen.js.map +0 -1
- package/dist/evals-api.d.ts +0 -24
- package/dist/evals-api.js +0 -22
- package/dist/evals-api.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -940
- package/dist/index.js.map +0 -1
- package/dist/managed-repos.d.ts +0 -30
- package/dist/managed-repos.js +0 -72
- package/dist/managed-repos.js.map +0 -1
- package/dist/notify/blocks.d.ts +0 -23
- package/dist/notify/blocks.js +0 -118
- package/dist/notify/blocks.js.map +0 -1
- package/dist/notify/index.d.ts +0 -17
- package/dist/notify/index.js +0 -7
- package/dist/notify/index.js.map +0 -1
- package/dist/notify/model.d.ts +0 -57
- package/dist/notify/model.js +0 -89
- package/dist/notify/model.js.map +0 -1
- package/dist/notify/notifier.d.ts +0 -18
- package/dist/notify/notifier.js +0 -100
- package/dist/notify/notifier.js.map +0 -1
- package/dist/notify/render.d.ts +0 -21
- package/dist/notify/render.js +0 -59
- package/dist/notify/render.js.map +0 -1
- package/dist/notify/transports/github.d.ts +0 -26
- package/dist/notify/transports/github.js +0 -27
- package/dist/notify/transports/github.js.map +0 -1
- package/dist/notify/transports/slack.d.ts +0 -27
- package/dist/notify/transports/slack.js +0 -37
- package/dist/notify/transports/slack.js.map +0 -1
- package/dist/notify/types.d.ts +0 -119
- package/dist/notify/types.js +0 -16
- package/dist/notify/types.js.map +0 -1
- package/dist/providers.d.ts +0 -125
- package/dist/providers.js +0 -279
- package/dist/providers.js.map +0 -1
- package/dist/sandbox/docker.d.ts +0 -180
- package/dist/sandbox/docker.js +0 -517
- package/dist/sandbox/docker.js.map +0 -1
- package/dist/sandbox/egress-allowlist.d.ts +0 -74
- package/dist/sandbox/egress-allowlist.js +0 -164
- package/dist/sandbox/egress-allowlist.js.map +0 -1
- package/dist/sandbox/egress-firewall-config.d.ts +0 -127
- package/dist/sandbox/egress-firewall-config.js +0 -434
- package/dist/sandbox/egress-firewall-config.js.map +0 -1
- package/dist/sandbox/images.d.ts +0 -23
- package/dist/sandbox/images.js +0 -55
- package/dist/sandbox/images.js.map +0 -1
- package/dist/sandbox/index.d.ts +0 -112
- package/dist/sandbox/index.js +0 -332
- package/dist/sandbox/index.js.map +0 -1
- package/dist/sandbox/sandbox.d.ts +0 -214
- package/dist/sandbox/sandbox.js +0 -453
- package/dist/sandbox/sandbox.js.map +0 -1
- package/dist/sandbox/smol.d.ts +0 -162
- package/dist/sandbox/smol.js +0 -485
- package/dist/sandbox/smol.js.map +0 -1
- package/dist/session-log.d.ts +0 -63
- package/dist/session-log.js +0 -290
- package/dist/session-log.js.map +0 -1
- package/dist/state/approval-store.d.ts +0 -88
- package/dist/state/approval-store.js +0 -149
- package/dist/state/approval-store.js.map +0 -1
- package/dist/state/build-assets.d.ts +0 -50
- package/dist/state/build-assets.js +0 -154
- package/dist/state/build-assets.js.map +0 -1
- package/dist/state/db.d.ts +0 -81
- package/dist/state/db.js +0 -155
- package/dist/state/db.js.map +0 -1
- package/dist/state/execution-store.d.ts +0 -257
- package/dist/state/execution-store.js +0 -527
- package/dist/state/execution-store.js.map +0 -1
- package/dist/state/migrate.d.ts +0 -15
- package/dist/state/migrate.js +0 -175
- package/dist/state/migrate.js.map +0 -1
- package/dist/state/workflow-run-store.d.ts +0 -216
- package/dist/state/workflow-run-store.js +0 -403
- package/dist/state/workflow-run-store.js.map +0 -1
- package/dist/telemetry/index.d.ts +0 -38
- package/dist/telemetry/index.js +0 -253
- package/dist/telemetry/index.js.map +0 -1
- package/dist/telemetry/pi-events.d.ts +0 -12
- package/dist/telemetry/pi-events.js +0 -134
- package/dist/telemetry/pi-events.js.map +0 -1
- package/dist/workflows/dag.d.ts +0 -37
- package/dist/workflows/dag.js +0 -118
- package/dist/workflows/dag.js.map +0 -1
- package/dist/workflows/loader.d.ts +0 -53
- package/dist/workflows/loader.js +0 -421
- package/dist/workflows/loader.js.map +0 -1
- package/dist/workflows/loop-eval.d.ts +0 -28
- package/dist/workflows/loop-eval.js +0 -74
- package/dist/workflows/loop-eval.js.map +0 -1
- package/dist/workflows/phase-executor.d.ts +0 -222
- package/dist/workflows/phase-executor.js +0 -1153
- package/dist/workflows/phase-executor.js.map +0 -1
- package/dist/workflows/phase-ref.d.ts +0 -50
- package/dist/workflows/phase-ref.js +0 -91
- package/dist/workflows/phase-ref.js.map +0 -1
- package/dist/workflows/resume.d.ts +0 -58
- package/dist/workflows/resume.js +0 -313
- package/dist/workflows/resume.js.map +0 -1
- package/dist/workflows/runner.d.ts +0 -63
- package/dist/workflows/runner.js +0 -381
- package/dist/workflows/runner.js.map +0 -1
- package/dist/workflows/schema.d.ts +0 -344
- package/dist/workflows/schema.js +0 -460
- package/dist/workflows/schema.js.map +0 -1
- package/dist/workflows/simple.d.ts +0 -90
- package/dist/workflows/simple.js +0 -393
- package/dist/workflows/simple.js.map +0 -1
- package/dist/workflows/target-policy.d.ts +0 -74
- package/dist/workflows/target-policy.js +0 -80
- package/dist/workflows/target-policy.js.map +0 -1
- package/dist/workflows/templates.d.ts +0 -88
- package/dist/workflows/templates.js +0 -127
- package/dist/workflows/templates.js.map +0 -1
- package/dist/workflows/triggers.d.ts +0 -21
- package/dist/workflows/triggers.js +0 -45
- package/dist/workflows/triggers.js.map +0 -1
- package/dist/workflows/verdict.d.ts +0 -19
- package/dist/workflows/verdict.js +0 -30
- package/dist/workflows/verdict.js.map +0 -1
- package/dist/worktree/manager.d.ts +0 -43
- package/dist/worktree/manager.js +0 -127
- package/dist/worktree/manager.js.map +0 -1
- package/docker-compose.yml +0 -274
- package/sandbox.Dockerfile +0 -68
- package/skills/README.md +0 -42
- package/skills/browser-qa/SKILL.md +0 -208
- package/skills/browser-qa/scripts/agent-browser.mjs +0 -531
- package/skills/building/SKILL.md +0 -95
- package/skills/chat/SKILL.md +0 -36
- package/skills/code-review/SKILL.md +0 -82
- package/skills/debug-production/SKILL.md +0 -108
- package/skills/demo/SKILL.md +0 -228
- package/skills/demo/scripts/compose-demo.sh +0 -243
- package/skills/issue-answer/SKILL.md +0 -91
- package/skills/issue-comment/SKILL.md +0 -49
- package/skills/issue-triage/SKILL.md +0 -149
- package/skills/issue-triage/references/AGENT-BRIEF.md +0 -65
- package/skills/pr-comment/SKILL.md +0 -64
- package/skills/pr-review/SKILL.md +0 -148
- package/skills/pr-review/references/findings-schema.md +0 -89
- package/skills/qa-test/SKILL.md +0 -97
- package/skills/repo-health/SKILL.md +0 -67
- package/skills/security-feedback/SKILL.md +0 -173
- package/skills/security-feedback/references/templates.md +0 -77
- package/skills/security-review/SKILL.md +0 -215
- package/skills/security-review/references/issue-format.md +0 -302
- package/skills/verify/SKILL.md +0 -118
- package/workflows/answer.yaml +0 -44
- package/workflows/build.yaml +0 -129
- package/workflows/cron-health.yaml +0 -6
- package/workflows/cron-review.yaml +0 -8
- package/workflows/cron-security.yaml +0 -6
- package/workflows/cron-triage.yaml +0 -8
- package/workflows/demo.yaml +0 -62
- package/workflows/examples/bash-smoke.yaml +0 -41
- package/workflows/examples/parallel-review.yaml +0 -36
- package/workflows/examples/tdd-loop.yaml +0 -17
- package/workflows/explore.yaml +0 -80
- package/workflows/issue-comment.yaml +0 -15
- package/workflows/issue-triage.yaml +0 -22
- package/workflows/pr-comment.yaml +0 -16
- package/workflows/pr-fix.yaml +0 -17
- package/workflows/pr-review.yaml +0 -50
- package/workflows/prompts/answer.md +0 -68
- package/workflows/prompts/architect.md +0 -44
- package/workflows/prompts/classifier.md +0 -60
- package/workflows/prompts/classify-adds-info.md +0 -17
- package/workflows/prompts/demo.md +0 -125
- package/workflows/prompts/executor.md +0 -42
- package/workflows/prompts/explore-ask.md +0 -99
- package/workflows/prompts/explore-publish.md +0 -31
- package/workflows/prompts/explore-read.md +0 -120
- package/workflows/prompts/explore-synthesize.md +0 -88
- package/workflows/prompts/fix.md +0 -18
- package/workflows/prompts/guardrails.md +0 -96
- package/workflows/prompts/pr-fix.md +0 -26
- package/workflows/prompts/pr.md +0 -39
- package/workflows/prompts/qa-browser.md +0 -95
- package/workflows/prompts/qa-synth.md +0 -44
- package/workflows/prompts/qa-test.md +0 -60
- package/workflows/prompts/re-reviewer.md +0 -33
- package/workflows/prompts/reviewer.md +0 -60
- package/workflows/prompts/verify-browser.md +0 -93
- package/workflows/prompts/verify-synth.md +0 -44
- package/workflows/prompts/verify.md +0 -63
- package/workflows/qa-test.yaml +0 -94
- package/workflows/repo-health.yaml +0 -15
- package/workflows/security-feedback.yaml +0 -25
- package/workflows/security-review.yaml +0 -37
- package/workflows/verify.yaml +0 -93
- /package/dist/{cli/cli-config.d.ts → cli-config.d.ts} +0 -0
- /package/dist/{cli/cli-config.js → cli-config.js} +0 -0
- /package/dist/{cli/cli-format.d.ts → cli-format.d.ts} +0 -0
- /package/dist/{cli/cli-format.js → cli-format.js} +0 -0
- /package/dist/{cli/cli-timeline.d.ts → cli-timeline.d.ts} +0 -0
- /package/dist/{cli/cli-timeline.js → cli-timeline.js} +0 -0
- /package/dist/{cli/cli.d.ts → cli.d.ts} +0 -0
- /package/dist/{cli/oauth-cli.d.ts → oauth-cli.d.ts} +0 -0
- /package/dist/{cli/setup.d.ts → setup.d.ts} +0 -0
package/dist/sandbox/docker.js
DELETED
|
@@ -1,517 +0,0 @@
|
|
|
1
|
-
import { execFileSync, execFile as execFileCb, spawn } from "child_process";
|
|
2
|
-
import { promisify } from "util";
|
|
3
|
-
import { existsSync, readFileSync } from "fs";
|
|
4
|
-
import { dirname, isAbsolute, join, relative, resolve } from "path";
|
|
5
|
-
import { randomUUID } from "crypto";
|
|
6
|
-
const execFileAsync = promisify(execFileCb);
|
|
7
|
-
const WORKSPACE_DIR = "/home/agent/workspace";
|
|
8
|
-
/** Shared package-manager download cache mount (issue #107). */
|
|
9
|
-
const PKG_CACHE_DIR = "/cache";
|
|
10
|
-
export class DockerSandbox {
|
|
11
|
-
config;
|
|
12
|
-
activeContainers = new Map();
|
|
13
|
-
constructor(config) {
|
|
14
|
-
this.config = config;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Create and start a sandbox container for a task.
|
|
18
|
-
*/
|
|
19
|
-
async create(opts) {
|
|
20
|
-
const containerName = `lastlight-sandbox-${opts.taskId}-${randomUUID().slice(0, 8)}`;
|
|
21
|
-
const worktreePath = resolve(opts.worktreePath);
|
|
22
|
-
// Shared data — mounted at /data inside the sandbox. Contains secrets
|
|
23
|
-
// (app.pem) and the opencode-home session-jsonl tree (see
|
|
24
|
-
// deploy/sandbox-entrypoint.sh for the layout it expects).
|
|
25
|
-
//
|
|
26
|
-
// SANDBOX_DATA_VOLUME accepts either:
|
|
27
|
-
// - a Docker named volume name (e.g. "lastlight_agent-data") — used in
|
|
28
|
-
// production where the harness runs in the same compose stack
|
|
29
|
-
// - a host filesystem path (relative or absolute, starting with `/`,
|
|
30
|
-
// `.`, or `~`) — used in local dev so the host can inspect/edit the
|
|
31
|
-
// same dir without copying things in and out of a named volume
|
|
32
|
-
//
|
|
33
|
-
// Default is the production named volume, so existing behavior is preserved.
|
|
34
|
-
const dataVolumeRaw = process.env.SANDBOX_DATA_VOLUME || "lastlight_agent-data";
|
|
35
|
-
const dataMount = isPathLike(dataVolumeRaw)
|
|
36
|
-
? resolveHostPath(dataVolumeRaw) // bind mount → absolute host path
|
|
37
|
-
: dataVolumeRaw; // named volume → pass through
|
|
38
|
-
// /data is the same volume the workspace is carved out of (or the same
|
|
39
|
-
// host path), so the same -v form covers both — bind for path mode,
|
|
40
|
-
// named volume for volume mode. The workspace itself needs the more
|
|
41
|
-
// precise `--mount … volume-subpath=…` form in volume mode so the
|
|
42
|
-
// sandbox sees the harness's sandboxes/<taskId>/ dir rather than an
|
|
43
|
-
// empty docker-auto-created bind target on the host filesystem (the
|
|
44
|
-
// bug that made staged skills invisible — the two paths look identical
|
|
45
|
-
// but live in different physical locations).
|
|
46
|
-
const dockerArgs = ["-v", `${dataMount}:/data`];
|
|
47
|
-
if (opts.workspaceMount.type === "bind") {
|
|
48
|
-
dockerArgs.push("-v", `${opts.workspaceMount.hostPath}:${WORKSPACE_DIR}`);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
const { volume, subpath } = opts.workspaceMount;
|
|
52
|
-
dockerArgs.push("--mount", `type=volume,source=${volume},target=${WORKSPACE_DIR},volume-subpath=${subpath}`);
|
|
53
|
-
}
|
|
54
|
-
// Shared package-manager cache, mounted at /cache and shared across every
|
|
55
|
-
// sandbox (issue #107). Each ecosystem's download cache is content-
|
|
56
|
-
// addressed, so sharing across repos is safe and avoids re-fetching the
|
|
57
|
-
// same tarballs on every run. We point npm / pnpm / yarn at subdirs of it
|
|
58
|
-
// via env below; the entrypoint chowns them to the agent user. This is the
|
|
59
|
-
// *download* cache only — per-workspace `node_modules` stays per-workspace
|
|
60
|
-
// (a shared store can't hardlink across separate container mounts anyway).
|
|
61
|
-
//
|
|
62
|
-
// A Docker named volume (auto-created on first use); override the name with
|
|
63
|
-
// LASTLIGHT_PKG_CACHE_VOLUME. In local path-mode this is still a named
|
|
64
|
-
// volume — it needs no host-path view, so the volume/bind split that the
|
|
65
|
-
// workspace mount needs doesn't apply here.
|
|
66
|
-
const pkgCacheVolume = process.env.LASTLIGHT_PKG_CACHE_VOLUME || "lastlight_pkg-cache";
|
|
67
|
-
dockerArgs.push("-v", `${pkgCacheVolume}:${PKG_CACHE_DIR}`);
|
|
68
|
-
// Point each package manager at its shared subdir. npm reads npm_config_cache;
|
|
69
|
-
// pnpm reads npm-style env config (npm_config_store_dir → store-dir); yarn
|
|
70
|
-
// (classic + berry) reads YARN_CACHE_FOLDER; uv (python `type: script`
|
|
71
|
-
// phases) reads UV_CACHE_DIR. The agent already picks the PM from the repo's
|
|
72
|
-
// lockfile (see skills/pr-review/SKILL.md), so all are wired regardless of
|
|
73
|
-
// which one a given repo uses.
|
|
74
|
-
dockerArgs.push("-e", `npm_config_cache=${PKG_CACHE_DIR}/npm`, "-e", `npm_config_store_dir=${PKG_CACHE_DIR}/pnpm`, "-e", `YARN_CACHE_FOLDER=${PKG_CACHE_DIR}/yarn`, "-e", `UV_CACHE_DIR=${PKG_CACHE_DIR}/uv`,
|
|
75
|
-
// uv resolves PEP 723 deps from PyPI (pypi.org / pythonhosted.org are in
|
|
76
|
-
// the strict egress allowlist). Pin it to the baked-in system python3 so
|
|
77
|
-
// it never tries to fetch a managed interpreter from astral.sh / GitHub
|
|
78
|
-
// (not guaranteed reachable under strict egress).
|
|
79
|
-
"-e", "UV_PYTHON_DOWNLOADS=never");
|
|
80
|
-
// Resolve git mounts for worktrees (if .git is a file pointing elsewhere).
|
|
81
|
-
// In volume-subpath mode these are still emitted as bind mounts; the
|
|
82
|
-
// gitMounts path is only hit for git worktrees that live alongside the
|
|
83
|
-
// sandbox in the same data dir, so for the named-volume case the
|
|
84
|
-
// sources would also be invisible from the daemon's view. The codebase
|
|
85
|
-
// doesn't currently exercise that combination — pre-clones always
|
|
86
|
-
// produce a real .git directory inside worktreePath — so leaving the
|
|
87
|
-
// bind form here keeps the existing path mode working without adding
|
|
88
|
-
// dead complexity to the named-volume path. If we ever wire a real
|
|
89
|
-
// git worktree under volume mode this needs the same translation.
|
|
90
|
-
const gitMounts = this.resolveGitMounts(worktreePath).flatMap((m) => ["-v", m]);
|
|
91
|
-
dockerArgs.push(...gitMounts);
|
|
92
|
-
// Env flags — passed to entrypoint for MCP config template expansion.
|
|
93
|
-
// No proxy env (HTTPS_PROXY etc.) is injected: the sandbox-egress
|
|
94
|
-
// network has no route to the public internet, and the coredns
|
|
95
|
-
// sidecar referenced by --dns below sinkholes allowlisted hosts to
|
|
96
|
-
// the nginx-egress firewall IP. Clients dial real hostnames; the
|
|
97
|
-
// network routes them transparently. See egress-firewall-config.ts.
|
|
98
|
-
const envFlags = Object.entries(this.config.env).flatMap(([k, v]) => ["-e", `${k}=${v}`]);
|
|
99
|
-
// Per-sandbox memory cap. Without this, a runaway agent (or a hot
|
|
100
|
-
// `npm install` / vite build inside the workspace) can OOM the host
|
|
101
|
-
// and take every other container with it. We set --memory-swap to the
|
|
102
|
-
// same value so swap can't be used to silently exceed the cap.
|
|
103
|
-
const memoryLimit = this.config.memoryLimit || "2g";
|
|
104
|
-
// Network attachment. Default is the `internal: true` sandbox-egress
|
|
105
|
-
// network declared in docker-compose.yml, which has no host route —
|
|
106
|
-
// the only outbound path is through nginx-egress, reached via the
|
|
107
|
-
// DNS sinkhole. Override via LASTLIGHT_SANDBOX_NETWORK for setups
|
|
108
|
-
// (local dev, alt orchestration) where the harness was started
|
|
109
|
-
// outside docker-compose and the network hasn't been created.
|
|
110
|
-
const network = this.config.network ||
|
|
111
|
-
process.env.LASTLIGHT_SANDBOX_NETWORK ||
|
|
112
|
-
"lastlight_sandbox-egress";
|
|
113
|
-
const networkArgs = network === "default" ? [] : ["--network", network];
|
|
114
|
-
// DNS resolver. Points at coredns-strict or coredns-open depending on
|
|
115
|
-
// the phase's egress policy. The whole filtering scheme hinges on
|
|
116
|
-
// this — every name lookup happens against our sinkhole, and
|
|
117
|
-
// allowlisted hosts get answered with the nginx-egress IP rather
|
|
118
|
-
// than the real one.
|
|
119
|
-
const dnsArgs = this.config.dnsIp ? ["--dns", this.config.dnsIp] : [];
|
|
120
|
-
// The entrypoint runs as root to fix permissions, then drops to agent via gosu.
|
|
121
|
-
// No --user flag needed.
|
|
122
|
-
const args = [
|
|
123
|
-
"run", "-d",
|
|
124
|
-
"--name", containerName,
|
|
125
|
-
"--memory", memoryLimit,
|
|
126
|
-
"--memory-swap", memoryLimit,
|
|
127
|
-
...networkArgs,
|
|
128
|
-
...dnsArgs,
|
|
129
|
-
...envFlags,
|
|
130
|
-
...dockerArgs,
|
|
131
|
-
"-w", WORKSPACE_DIR,
|
|
132
|
-
this.config.imageName,
|
|
133
|
-
];
|
|
134
|
-
try {
|
|
135
|
-
// The entrypoint handles all setup: AGENTS.md, opencode.json, app.pem
|
|
136
|
-
// materialization, and git config. No docker exec calls needed.
|
|
137
|
-
const containerId = execCmd("docker", args).trim();
|
|
138
|
-
const info = { containerId, containerName, worktreePath };
|
|
139
|
-
this.activeContainers.set(opts.taskId, info);
|
|
140
|
-
console.log(`[sandbox] Created: ${containerName}`);
|
|
141
|
-
// Wait for entrypoint to finish setting up auth, skills, MCP config.
|
|
142
|
-
// The entrypoint drops to `gosu agent sleep infinity` when done —
|
|
143
|
-
// we detect readiness by checking for the .credentials.json symlink.
|
|
144
|
-
await this.waitForReady(containerName);
|
|
145
|
-
return info;
|
|
146
|
-
}
|
|
147
|
-
catch (err) {
|
|
148
|
-
throw new Error(`Failed to create sandbox: ${err.message}`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Wait for the sandbox entrypoint to finish setup. The entrypoint touches
|
|
153
|
-
* `$WORKSPACE/.ready` as its last step before exec'ing the agent shell.
|
|
154
|
-
*/
|
|
155
|
-
async waitForReady(containerName, timeoutMs = 15000) {
|
|
156
|
-
const start = Date.now();
|
|
157
|
-
const interval = 500;
|
|
158
|
-
while (Date.now() - start < timeoutMs) {
|
|
159
|
-
try {
|
|
160
|
-
await execFileAsync("docker", [
|
|
161
|
-
"exec", "--user", "agent", containerName,
|
|
162
|
-
"test", "-f", `${WORKSPACE_DIR}/.ready`,
|
|
163
|
-
], { timeout: 5000 });
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
catch {
|
|
167
|
-
await new Promise((r) => setTimeout(r, interval));
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
console.warn(`[sandbox] Timed out waiting for ${containerName} to be ready — proceeding anyway`);
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Run the agentic-pi CLI inside the sandbox with a prompt.
|
|
174
|
-
*
|
|
175
|
-
* Streams stdout line-by-line so the caller can react to JSON events
|
|
176
|
-
* (e.g. capture the top-level `session` record's id) before the agent
|
|
177
|
-
* has finished. The full stdout is also buffered and returned for
|
|
178
|
-
* post-run parsing of the usage_snapshot rollup.
|
|
179
|
-
*/
|
|
180
|
-
async runAgent(taskId, prompt, opts) {
|
|
181
|
-
const info = this.activeContainers.get(taskId);
|
|
182
|
-
if (!info)
|
|
183
|
-
throw new Error(`No sandbox for task ${taskId}`);
|
|
184
|
-
const model = opts?.model || "anthropic/claude-sonnet-4-6";
|
|
185
|
-
const timeout = this.config.timeoutSeconds || 1800;
|
|
186
|
-
// `cmd` is interpolated into `sh -c <cmd>` below, so any value we
|
|
187
|
-
// append here is shell-parsed. Assert each opt-supplied flag against
|
|
188
|
-
// a tight allowlist before embedding — defense in depth in case any
|
|
189
|
-
// of these ever gets sourced from user input.
|
|
190
|
-
const THINKING = new Set(["off", "minimal", "low", "medium", "high", "xhigh"]);
|
|
191
|
-
const PROFILES = new Set(["read", "issues-write", "review-write", "repo-write"]);
|
|
192
|
-
const WEB_SEARCH_PROVIDERS = new Set(["tavily", "brave", "exa"]);
|
|
193
|
-
const extraArgs = [];
|
|
194
|
-
if (opts?.thinking) {
|
|
195
|
-
if (!THINKING.has(opts.thinking)) {
|
|
196
|
-
throw new Error(`Refusing to pass thinking "${opts.thinking}" — must be one of ${[...THINKING].join("|")}`);
|
|
197
|
-
}
|
|
198
|
-
extraArgs.push("--thinking", opts.thinking);
|
|
199
|
-
}
|
|
200
|
-
if (opts?.profile) {
|
|
201
|
-
if (!PROFILES.has(opts.profile)) {
|
|
202
|
-
throw new Error(`Refusing to pass profile "${opts.profile}" — must be one of ${[...PROFILES].join("|")}`);
|
|
203
|
-
}
|
|
204
|
-
extraArgs.push("--profile", opts.profile);
|
|
205
|
-
}
|
|
206
|
-
// Web search defaults off — agentic-pi's auto-enable triggers on any
|
|
207
|
-
// provider key env var, so silence it explicitly when the caller didn't
|
|
208
|
-
// opt in. When opted in, omit the flag and let agentic-pi pick up the
|
|
209
|
-
// forwarded TAVILY_API_KEY / BRAVE_SEARCH_API_KEY / EXA_API_KEY.
|
|
210
|
-
if (opts?.webSearch === true) {
|
|
211
|
-
if (opts.webSearchProvider) {
|
|
212
|
-
if (!WEB_SEARCH_PROVIDERS.has(opts.webSearchProvider)) {
|
|
213
|
-
throw new Error(`Refusing to pass web-search-provider "${opts.webSearchProvider}" — must be one of ${[...WEB_SEARCH_PROVIDERS].join("|")}`);
|
|
214
|
-
}
|
|
215
|
-
extraArgs.push("--web-search-provider", opts.webSearchProvider);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
extraArgs.push("--no-web-search");
|
|
220
|
-
}
|
|
221
|
-
// Per-phase skill bundles. Each must be an in-container path under the
|
|
222
|
-
// workspace root; assert the charset + prefix before it's embedded into
|
|
223
|
-
// the `sh -c` command, mirroring the agentCwd guard below.
|
|
224
|
-
for (const dir of opts?.skillDirs ?? []) {
|
|
225
|
-
if (!dir.startsWith(WORKSPACE_DIR) || !/^[A-Za-z0-9/_.-]+$/.test(dir)) {
|
|
226
|
-
throw new Error(`Refusing to pass skill dir "${dir}" — must live under ${WORKSPACE_DIR}`);
|
|
227
|
-
}
|
|
228
|
-
extraArgs.push("--skill", dir);
|
|
229
|
-
}
|
|
230
|
-
if (!/^[A-Za-z0-9/_.-]+$/.test(model)) {
|
|
231
|
-
throw new Error(`Refusing to pass model "${model}" — bad charset`);
|
|
232
|
-
}
|
|
233
|
-
for (const [k, v] of Object.entries(opts?.sandboxEnv ?? {})) {
|
|
234
|
-
if (!/^[A-Z_][A-Z0-9_]*$/.test(k)) {
|
|
235
|
-
throw new Error(`Refusing sandbox-env key "${k}" — must be UPPER_SNAKE`);
|
|
236
|
-
}
|
|
237
|
-
// Values are shell-quoted below. Reject newlines and the closing
|
|
238
|
-
// quote (single-quote) defensively — both would break the `'…'` wrap.
|
|
239
|
-
if (/[\n\r']/.test(v)) {
|
|
240
|
-
throw new Error(`Refusing sandbox-env value for "${k}" — contains newline or quote`);
|
|
241
|
-
}
|
|
242
|
-
extraArgs.push("--sandbox-env", `${k}='${v}'`);
|
|
243
|
-
}
|
|
244
|
-
const cmd = [
|
|
245
|
-
"agentic-pi", "run",
|
|
246
|
-
"--model", model,
|
|
247
|
-
"--sandbox", "none",
|
|
248
|
-
...extraArgs,
|
|
249
|
-
].join(" ");
|
|
250
|
-
// Resolve the agent's cwd. Defaults to the workspace root; callers may
|
|
251
|
-
// pass a `<WORKSPACE_DIR>/<repo>` subdir when the harness pre-cloned the
|
|
252
|
-
// target repo. Asserted against an allowlist before going into
|
|
253
|
-
// `docker exec -w` (which is a separate argv slot, but defensive
|
|
254
|
-
// narrowing keeps surprise paths out).
|
|
255
|
-
const workdir = opts?.agentCwd ?? WORKSPACE_DIR;
|
|
256
|
-
if (!workdir.startsWith(WORKSPACE_DIR) || !/^[A-Za-z0-9/_.-]+$/.test(workdir)) {
|
|
257
|
-
throw new Error(`Refusing to pass agent cwd "${workdir}" — must live under ${WORKSPACE_DIR}`);
|
|
258
|
-
}
|
|
259
|
-
// -i connects stdin so the prompt can be written to the container process.
|
|
260
|
-
// Run as agent user so workspace writes land with the right ownership.
|
|
261
|
-
const args = ["exec", "-i", "--user", "agent", "-w", workdir, info.containerName, "sh", "-c", cmd];
|
|
262
|
-
// The structured event stream is consumed line-by-line via `onLine` and
|
|
263
|
-
// mirrored to the AgenticShim, which writes envelope jsonl to
|
|
264
|
-
// `<sessionsDir>/projects/.../` (read by the admin SessionReader).
|
|
265
|
-
// That is the on-disk log. We deliberately do NOT buffer the full stdout
|
|
266
|
-
// here — for a "read a large repo" run the stream is hundreds of MB and
|
|
267
|
-
// accumulating it in a single string is what OOM'd the harness.
|
|
268
|
-
//
|
|
269
|
-
// We keep only a small bounded tail of stderr so the error-path message
|
|
270
|
-
// is still useful.
|
|
271
|
-
const STDERR_TAIL_BYTES = 8 * 1024;
|
|
272
|
-
return await new Promise((resolvePromise, reject) => {
|
|
273
|
-
const child = spawn("docker", args, { stdio: ["pipe", "pipe", "pipe"] });
|
|
274
|
-
child.stdin.write(prompt);
|
|
275
|
-
child.stdin.end();
|
|
276
|
-
let stderrTail = "";
|
|
277
|
-
let buf = "";
|
|
278
|
-
const timer = setTimeout(() => {
|
|
279
|
-
child.kill("SIGKILL");
|
|
280
|
-
reject(new Error(`Sandbox agent timed out after ${timeout}s`));
|
|
281
|
-
}, timeout * 1000);
|
|
282
|
-
child.stdout.setEncoding("utf-8");
|
|
283
|
-
child.stdout.on("data", (chunk) => {
|
|
284
|
-
if (!opts?.onLine)
|
|
285
|
-
return;
|
|
286
|
-
// Emit complete lines to the caller as they arrive — keeps a partial
|
|
287
|
-
// tail in `buf` for the next chunk.
|
|
288
|
-
buf += chunk;
|
|
289
|
-
let nl;
|
|
290
|
-
while ((nl = buf.indexOf("\n")) >= 0) {
|
|
291
|
-
const line = buf.slice(0, nl);
|
|
292
|
-
buf = buf.slice(nl + 1);
|
|
293
|
-
if (line.length > 0) {
|
|
294
|
-
try {
|
|
295
|
-
opts.onLine(line);
|
|
296
|
-
}
|
|
297
|
-
catch { /* swallow listener errors */ }
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
child.stderr.setEncoding("utf-8");
|
|
302
|
-
child.stderr.on("data", (chunk) => {
|
|
303
|
-
stderrTail += chunk;
|
|
304
|
-
if (stderrTail.length > STDERR_TAIL_BYTES) {
|
|
305
|
-
stderrTail = stderrTail.slice(-STDERR_TAIL_BYTES);
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
child.on("error", (err) => {
|
|
309
|
-
clearTimeout(timer);
|
|
310
|
-
reject(new Error(`Sandbox agent spawn failed: ${err.message}`));
|
|
311
|
-
});
|
|
312
|
-
child.on("close", (code) => {
|
|
313
|
-
clearTimeout(timer);
|
|
314
|
-
// Flush any trailing partial line
|
|
315
|
-
if (buf.length > 0 && opts?.onLine) {
|
|
316
|
-
try {
|
|
317
|
-
opts.onLine(buf);
|
|
318
|
-
}
|
|
319
|
-
catch { /* ignore */ }
|
|
320
|
-
buf = "";
|
|
321
|
-
}
|
|
322
|
-
if (code === 0) {
|
|
323
|
-
resolvePromise();
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
reject(new Error(`Sandbox agent failed (exit ${code}): ${stderrTail || "no output"}`));
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Run a deterministic shell command inside an already-provisioned sandbox
|
|
333
|
-
* container and return its exit code + captured output. This is the
|
|
334
|
-
* non-agent sibling of {@link runAgent}: same `docker exec --user agent -w
|
|
335
|
-
* <workdir> … sh -c <cmd>` machinery, but it captures a bounded stdout tail
|
|
336
|
-
* (runAgent discards stdout) and RESOLVES with the exit code instead of
|
|
337
|
-
* rejecting on non-zero — the caller decides success/failure.
|
|
338
|
-
*
|
|
339
|
-
* Powers `type: bash` / `type: script` workflow phases (and the in-sandbox
|
|
340
|
-
* `generic_loop.until_bash` check). `command` is passed as a single argv slot
|
|
341
|
-
* to `sh -c`, so it is NOT re-parsed by the host shell — it is the script we
|
|
342
|
-
* intend to run. Env is forwarded via `docker exec -e KEY=VALUE` (argv, not
|
|
343
|
-
* shell-interpolated); keys are charset-asserted defensively.
|
|
344
|
-
*/
|
|
345
|
-
async runCommand(taskId, command, opts) {
|
|
346
|
-
const info = this.activeContainers.get(taskId);
|
|
347
|
-
if (!info)
|
|
348
|
-
throw new Error(`No sandbox for task ${taskId}`);
|
|
349
|
-
const timeout = opts?.timeoutSeconds || this.config.timeoutSeconds || 1800;
|
|
350
|
-
const workdir = opts?.cwd ?? WORKSPACE_DIR;
|
|
351
|
-
if (!workdir.startsWith(WORKSPACE_DIR) || !/^[A-Za-z0-9/_.-]+$/.test(workdir)) {
|
|
352
|
-
throw new Error(`Refusing to run command in cwd "${workdir}" — must live under ${WORKSPACE_DIR}`);
|
|
353
|
-
}
|
|
354
|
-
const envFlags = [];
|
|
355
|
-
for (const [k, v] of Object.entries(opts?.sandboxEnv ?? {})) {
|
|
356
|
-
if (!/^[A-Z_][A-Z0-9_]*$/.test(k)) {
|
|
357
|
-
throw new Error(`Refusing sandbox-env key "${k}" — must be UPPER_SNAKE`);
|
|
358
|
-
}
|
|
359
|
-
// Values travel as argv (no shell re-parse), so any value is safe — but a
|
|
360
|
-
// newline would let a value smuggle a second `-e` token in some shells;
|
|
361
|
-
// reject defensively to match runAgent's posture.
|
|
362
|
-
if (/[\n\r]/.test(v)) {
|
|
363
|
-
throw new Error(`Refusing sandbox-env value for "${k}" — contains newline`);
|
|
364
|
-
}
|
|
365
|
-
envFlags.push("-e", `${k}=${v}`);
|
|
366
|
-
}
|
|
367
|
-
const args = ["exec", "--user", "agent", "-w", workdir, ...envFlags, info.containerName, "sh", "-c", command];
|
|
368
|
-
// Bounded tails so a runaway command (e.g. a build dumping MB of logs)
|
|
369
|
-
// can't OOM the harness — keep enough stdout for the downstream
|
|
370
|
-
// `{{phaseOutputs.*}}` reference to be useful.
|
|
371
|
-
const STDOUT_TAIL_BYTES = 256 * 1024;
|
|
372
|
-
const STDERR_TAIL_BYTES = 32 * 1024;
|
|
373
|
-
return await new Promise((resolvePromise, reject) => {
|
|
374
|
-
const child = spawn("docker", args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
375
|
-
let stdoutTail = "";
|
|
376
|
-
let stderrTail = "";
|
|
377
|
-
let buf = "";
|
|
378
|
-
let timedOut = false;
|
|
379
|
-
const timer = setTimeout(() => {
|
|
380
|
-
timedOut = true;
|
|
381
|
-
child.kill("SIGKILL");
|
|
382
|
-
}, timeout * 1000);
|
|
383
|
-
child.stdout.setEncoding("utf-8");
|
|
384
|
-
child.stdout.on("data", (chunk) => {
|
|
385
|
-
stdoutTail += chunk;
|
|
386
|
-
if (stdoutTail.length > STDOUT_TAIL_BYTES)
|
|
387
|
-
stdoutTail = stdoutTail.slice(-STDOUT_TAIL_BYTES);
|
|
388
|
-
if (!opts?.onLine)
|
|
389
|
-
return;
|
|
390
|
-
buf += chunk;
|
|
391
|
-
let nl;
|
|
392
|
-
while ((nl = buf.indexOf("\n")) >= 0) {
|
|
393
|
-
const line = buf.slice(0, nl);
|
|
394
|
-
buf = buf.slice(nl + 1);
|
|
395
|
-
if (line.length > 0) {
|
|
396
|
-
try {
|
|
397
|
-
opts.onLine(line);
|
|
398
|
-
}
|
|
399
|
-
catch { /* swallow listener errors */ }
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
child.stderr.setEncoding("utf-8");
|
|
404
|
-
child.stderr.on("data", (chunk) => {
|
|
405
|
-
stderrTail += chunk;
|
|
406
|
-
if (stderrTail.length > STDERR_TAIL_BYTES)
|
|
407
|
-
stderrTail = stderrTail.slice(-STDERR_TAIL_BYTES);
|
|
408
|
-
});
|
|
409
|
-
child.on("error", (err) => {
|
|
410
|
-
clearTimeout(timer);
|
|
411
|
-
reject(new Error(`Sandbox command spawn failed: ${err.message}`));
|
|
412
|
-
});
|
|
413
|
-
child.on("close", (code) => {
|
|
414
|
-
clearTimeout(timer);
|
|
415
|
-
if (buf.length > 0 && opts?.onLine) {
|
|
416
|
-
try {
|
|
417
|
-
opts.onLine(buf);
|
|
418
|
-
}
|
|
419
|
-
catch { /* ignore */ }
|
|
420
|
-
}
|
|
421
|
-
resolvePromise({
|
|
422
|
-
exitCode: timedOut ? 124 : (code ?? 1),
|
|
423
|
-
stdout: stdoutTail,
|
|
424
|
-
stderr: stderrTail,
|
|
425
|
-
timedOut,
|
|
426
|
-
});
|
|
427
|
-
});
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* Remove a sandbox container.
|
|
432
|
-
*/
|
|
433
|
-
async destroy(taskId) {
|
|
434
|
-
const info = this.activeContainers.get(taskId);
|
|
435
|
-
if (!info)
|
|
436
|
-
return;
|
|
437
|
-
execSafe("docker", ["rm", "-f", info.containerName]);
|
|
438
|
-
this.activeContainers.delete(taskId);
|
|
439
|
-
console.log(`[sandbox] Destroyed: ${info.containerName}`);
|
|
440
|
-
}
|
|
441
|
-
async destroyAll() {
|
|
442
|
-
for (const taskId of this.activeContainers.keys()) {
|
|
443
|
-
await this.destroy(taskId);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
resolveGitMounts(worktreePath) {
|
|
447
|
-
const gitPath = join(worktreePath, ".git");
|
|
448
|
-
if (!existsSync(gitPath))
|
|
449
|
-
return [];
|
|
450
|
-
try {
|
|
451
|
-
const content = readFileSync(gitPath, "utf-8").trim();
|
|
452
|
-
const match = content.match(/^gitdir:\s*(.+)$/);
|
|
453
|
-
if (match) {
|
|
454
|
-
// Resolve relative to the .git file location (not process cwd).
|
|
455
|
-
const gitdirPath = resolve(dirname(gitPath), match[1]);
|
|
456
|
-
const parentGitDir = resolve(gitdirPath, "..", "..");
|
|
457
|
-
const sandboxRoot = resolve(worktreePath, "..");
|
|
458
|
-
if (!isSubpath(sandboxRoot, parentGitDir)) {
|
|
459
|
-
console.warn(`[sandbox] Blocking unsafe gitdir mount outside sandbox root: ${parentGitDir}`);
|
|
460
|
-
return [];
|
|
461
|
-
}
|
|
462
|
-
if (!existsSync(parentGitDir)) {
|
|
463
|
-
console.warn(`[sandbox] Skipping missing gitdir parent mount: ${parentGitDir}`);
|
|
464
|
-
return [];
|
|
465
|
-
}
|
|
466
|
-
return [
|
|
467
|
-
`${gitPath}:${gitPath}`,
|
|
468
|
-
`${parentGitDir}:${parentGitDir}`,
|
|
469
|
-
];
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
catch { /* fall through */ }
|
|
473
|
-
// Normal repo clone with a real .git directory needs no extra mount.
|
|
474
|
-
return [];
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
function execCmd(cmd, args, opts) {
|
|
478
|
-
return execFileSync(cmd, args, {
|
|
479
|
-
encoding: "utf-8",
|
|
480
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
481
|
-
timeout: opts?.timeout,
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
function execSafe(cmd, args) {
|
|
485
|
-
try {
|
|
486
|
-
execFileSync(cmd, args, { stdio: "ignore" });
|
|
487
|
-
}
|
|
488
|
-
catch { /* ignore */ }
|
|
489
|
-
}
|
|
490
|
-
function isSubpath(parent, child) {
|
|
491
|
-
const rel = relative(parent, child);
|
|
492
|
-
return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* A SANDBOX_DATA_VOLUME value is a host filesystem path (rather than a Docker
|
|
496
|
-
* named volume) when it begins with `/`, `./`, `../`, or `~`. Named volumes
|
|
497
|
-
* cannot contain those characters, so this disambiguation is unambiguous.
|
|
498
|
-
*/
|
|
499
|
-
function isPathLike(value) {
|
|
500
|
-
return value.startsWith("/") ||
|
|
501
|
-
value.startsWith("./") ||
|
|
502
|
-
value.startsWith("../") ||
|
|
503
|
-
value.startsWith("~");
|
|
504
|
-
}
|
|
505
|
-
/**
|
|
506
|
-
* Resolve a path-like SANDBOX_DATA_VOLUME value to an absolute host path
|
|
507
|
-
* suitable for `docker run -v <host>:/data`. Expands `~` and resolves
|
|
508
|
-
* relative paths against the harness cwd.
|
|
509
|
-
*/
|
|
510
|
-
function resolveHostPath(value) {
|
|
511
|
-
let p = value;
|
|
512
|
-
if (p.startsWith("~")) {
|
|
513
|
-
p = (process.env.HOME || "") + p.slice(1);
|
|
514
|
-
}
|
|
515
|
-
return resolve(p);
|
|
516
|
-
}
|
|
517
|
-
//# sourceMappingURL=docker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docker.js","sourceRoot":"","sources":["../../src/sandbox/docker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,IAAI,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EA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I,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAC1B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;QACtB,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;QACvB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,KAAa;IACpC,IAAI,CAAC,GAAG,KAAK,CAAC;IACd,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single source of truth for sandbox HTTP egress allowlists.
|
|
3
|
-
*
|
|
4
|
-
* Both sandbox backends consume this list:
|
|
5
|
-
* - gondolin: passed verbatim to `agenticRun({ allowedHttpHosts })` so the
|
|
6
|
-
* QEMU-layer HTTP interceptor 502s anything off-list.
|
|
7
|
-
* - docker: nginx-egress + coredns configs are generated from these hosts
|
|
8
|
-
* at harness boot. Sandbox containers spawn with `--dns <coredns-ip>`;
|
|
9
|
-
* coredns sinkholes allowlisted hostnames to the nginx firewall IP,
|
|
10
|
-
* which peeks SNI and tunnels to the real upstream. See
|
|
11
|
-
* `src/sandbox/egress-firewall-config.ts` for the full architecture.
|
|
12
|
-
*
|
|
13
|
-
* The lists are intentionally split so callers can compose tighter policies
|
|
14
|
-
* (e.g. a read-only profile that doesn't need package registries). The
|
|
15
|
-
* everyday default is `DEFAULT_ALLOWLIST`.
|
|
16
|
-
*
|
|
17
|
-
* ## Convention: every entry matches the apex AND all subdomains
|
|
18
|
-
*
|
|
19
|
-
* `openai.com` → matches openai.com, api.openai.com, platform.openai.com, …
|
|
20
|
-
* `npmjs.org` → matches npmjs.org, registry.npmjs.org, auth.npmjs.org, …
|
|
21
|
-
*
|
|
22
|
-
* Bare hostnames only — no leading dot, no `*.` prefix. The config
|
|
23
|
-
* generator emits the right syntax for each backend (nginx's
|
|
24
|
-
* `.example.com` map form, CoreDNS regex `(^|\.)example\.com\.$`).
|
|
25
|
-
*
|
|
26
|
-
* Exact-only matching isn't currently supported because we haven't
|
|
27
|
-
* needed it — every host in the list is one we want apex+subdomain
|
|
28
|
-
* access to. If we ever do, we'd add an explicit type (e.g. an `exact:`
|
|
29
|
-
* prefix) so the loose-by-default convention stays unambiguous.
|
|
30
|
-
*
|
|
31
|
-
* A workflow phase can declare `unrestricted_egress: true` to bypass the
|
|
32
|
-
* allowlist entirely — see `src/workflows` for the phase schema.
|
|
33
|
-
*/
|
|
34
|
-
/** GitHub HTTPS endpoints used by `git`, `gh`, and agentic-pi's github tools. */
|
|
35
|
-
export declare const GITHUB_HOSTS: readonly string[];
|
|
36
|
-
/**
|
|
37
|
-
* LLM provider hosts.
|
|
38
|
-
*
|
|
39
|
-
* Required for the docker backend because `agentic-pi run` executes inside
|
|
40
|
-
* the sandbox container there (`src/sandbox/docker.ts` runs `agentic-pi run
|
|
41
|
-
* --sandbox none`), so the LLM HTTP call originates from inside the
|
|
42
|
-
* container. The gondolin backend runs agentic-pi in the harness process,
|
|
43
|
-
* so the call originates from the host and these hosts aren't strictly
|
|
44
|
-
* required inside the VM — they're kept here so a single allowlist can
|
|
45
|
-
* cover both paths without surprises.
|
|
46
|
-
*
|
|
47
|
-
* The list is derived from the provider registry (`src/providers.ts`) —
|
|
48
|
-
* every wizard-able provider has a `host` entry there, so adding a new
|
|
49
|
-
* provider automatically seeds this allowlist. Each entry matches the
|
|
50
|
-
* apex AND all subdomains (see `normalizeAllowlistHost`).
|
|
51
|
-
*/
|
|
52
|
-
export declare const PROVIDER_HOSTS: readonly string[];
|
|
53
|
-
/**
|
|
54
|
-
* Public package registries the executor may hit during `npm install`,
|
|
55
|
-
* etc. Apex-plus-subdomain matching covers auth / CDN / mirror
|
|
56
|
-
* subdomains without needing separate entries.
|
|
57
|
-
*/
|
|
58
|
-
export declare const PACKAGE_REGISTRY_HOSTS: readonly string[];
|
|
59
|
-
/**
|
|
60
|
-
* Combined allowlist used by both backends when a phase has not opted into
|
|
61
|
-
* unrestricted egress. Order is preserved across imports so generated
|
|
62
|
-
* configs are stable.
|
|
63
|
-
*/
|
|
64
|
-
export declare const DEFAULT_ALLOWLIST: readonly string[];
|
|
65
|
-
/**
|
|
66
|
-
* Sentinel value recognized by agentic-pi/gondolin (post the `"*"` patch)
|
|
67
|
-
* meaning "allow every host". Used when a phase sets `unrestricted_egress`.
|
|
68
|
-
*
|
|
69
|
-
* On the docker backend, unrestricted egress routes through the open
|
|
70
|
-
* nginx-egress + coredns-open pair — this sentinel is for gondolin only.
|
|
71
|
-
*/
|
|
72
|
-
export declare const ALLOW_ALL_SENTINEL = "*";
|
|
73
|
-
export declare function normalizeAllowlistHost(host: string): string | null;
|
|
74
|
-
export declare function mergeAllowlist(base: readonly string[], extra?: readonly string[]): string[];
|