lastlight 0.1.15 → 0.2.0
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 +265 -118
- package/agent-context/rules.md +62 -9
- package/agent-context/security.md +69 -0
- package/config/default.yaml +89 -0
- package/deploy/.env.production.example +20 -2
- package/deploy/entrypoint.sh +16 -17
- package/deploy/native/README.md +160 -0
- package/deploy/native/install.sh +110 -0
- package/deploy/native/lastlight.env.example +95 -0
- package/deploy/native/lastlight.service +50 -0
- package/deploy/sandbox-entrypoint.sh +59 -42
- package/dist/admin/auth.d.ts +1 -1
- package/dist/admin/auth.js +3 -1
- package/dist/admin/auth.js.map +1 -1
- package/dist/admin/chat-session-reader.d.ts +11 -14
- package/dist/admin/chat-session-reader.js +27 -51
- package/dist/admin/chat-session-reader.js.map +1 -1
- package/dist/admin/docker.d.ts +37 -0
- package/dist/admin/docker.js +86 -1
- package/dist/admin/docker.js.map +1 -1
- package/dist/admin/index.js +38 -3
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/log-search.test.d.ts +1 -0
- package/dist/admin/log-search.test.js +78 -0
- package/dist/admin/log-search.test.js.map +1 -0
- package/dist/admin/routes.d.ts +52 -3
- package/dist/admin/routes.js +780 -63
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/routes.test.js +680 -14
- package/dist/admin/routes.test.js.map +1 -1
- package/dist/admin/server-logs.test.d.ts +1 -0
- package/dist/admin/server-logs.test.js +58 -0
- package/dist/admin/server-logs.test.js.map +1 -0
- package/dist/admin/sessions.d.ts +26 -39
- package/dist/admin/sessions.js +86 -310
- package/dist/admin/sessions.js.map +1 -1
- package/dist/admin/sessions.test.d.ts +1 -0
- package/dist/admin/sessions.test.js +78 -0
- package/dist/admin/sessions.test.js.map +1 -0
- package/dist/admin/version.d.ts +15 -0
- package/dist/admin/version.js +73 -0
- package/dist/admin/version.js.map +1 -0
- package/dist/admin/version.test.d.ts +1 -0
- package/dist/admin/version.test.js +71 -0
- package/dist/admin/version.test.js.map +1 -0
- package/dist/cli-config.d.ts +55 -0
- package/dist/cli-config.js +119 -0
- package/dist/cli-config.js.map +1 -0
- package/dist/cli-config.test.d.ts +1 -0
- package/dist/cli-config.test.js +92 -0
- package/dist/cli-config.test.js.map +1 -0
- package/dist/cli-format.d.ts +19 -0
- package/dist/cli-format.js +107 -0
- package/dist/cli-format.js.map +1 -0
- package/dist/cli-server.d.ts +73 -0
- package/dist/cli-server.js +347 -0
- package/dist/cli-server.js.map +1 -0
- package/dist/cli-server.test.d.ts +1 -0
- package/dist/cli-server.test.js +38 -0
- package/dist/cli-server.test.js.map +1 -0
- package/dist/cli-timeline.d.ts +35 -0
- package/dist/cli-timeline.js +373 -0
- package/dist/cli-timeline.js.map +1 -0
- package/dist/cli-timeline.test.d.ts +1 -0
- package/dist/cli-timeline.test.js +104 -0
- package/dist/cli-timeline.test.js.map +1 -0
- package/dist/cli.d.ts +0 -19
- package/dist/cli.js +910 -194
- package/dist/cli.js.map +1 -1
- package/dist/config-overlay.test.d.ts +1 -0
- package/dist/config-overlay.test.js +112 -0
- package/dist/config-overlay.test.js.map +1 -0
- package/dist/config-resolve.d.ts +28 -0
- package/dist/config-resolve.js +47 -0
- package/dist/config-resolve.js.map +1 -0
- package/dist/config-resolve.test.d.ts +1 -0
- package/dist/config-resolve.test.js +68 -0
- package/dist/config-resolve.test.js.map +1 -0
- package/dist/config.d.ts +62 -49
- package/dist/config.js +452 -76
- package/dist/config.js.map +1 -1
- package/dist/config.test.js +201 -32
- package/dist/config.test.js.map +1 -1
- package/dist/connectors/github-webhook.js +83 -5
- package/dist/connectors/github-webhook.js.map +1 -1
- package/dist/connectors/github-webhook.test.d.ts +1 -0
- package/dist/connectors/github-webhook.test.js +156 -0
- package/dist/connectors/github-webhook.test.js.map +1 -0
- package/dist/connectors/messaging/session-manager.d.ts +18 -0
- package/dist/connectors/messaging/session-manager.js +83 -2
- package/dist/connectors/messaging/session-manager.js.map +1 -1
- package/dist/connectors/messaging/session-manager.test.d.ts +1 -0
- package/dist/connectors/messaging/session-manager.test.js +144 -0
- package/dist/connectors/messaging/session-manager.test.js.map +1 -0
- package/dist/connectors/slack/connector.d.ts +9 -0
- package/dist/connectors/slack/connector.js +15 -0
- package/dist/connectors/slack/connector.js.map +1 -1
- package/dist/connectors/slack/mrkdwn.js +81 -0
- package/dist/connectors/slack/mrkdwn.js.map +1 -1
- package/dist/connectors/slack/mrkdwn.test.js +49 -0
- package/dist/connectors/slack/mrkdwn.test.js.map +1 -1
- package/dist/connectors/types.d.ts +1 -1
- package/dist/cron/fanout.d.ts +33 -0
- package/dist/cron/fanout.js +55 -0
- package/dist/cron/fanout.js.map +1 -0
- package/dist/cron/fanout.test.d.ts +1 -0
- package/dist/cron/fanout.test.js +73 -0
- package/dist/cron/fanout.test.js.map +1 -0
- package/dist/cron/jobs.d.ts +5 -0
- package/dist/cron/jobs.js +10 -3
- package/dist/cron/jobs.js.map +1 -1
- package/dist/cron/scheduler.d.ts +12 -0
- package/dist/cron/scheduler.js +27 -1
- package/dist/cron/scheduler.js.map +1 -1
- package/dist/engine/agent-executor.d.ts +158 -0
- package/dist/engine/agent-executor.js +1140 -0
- package/dist/engine/agent-executor.js.map +1 -0
- package/dist/engine/agent-executor.test.d.ts +1 -0
- package/dist/engine/agent-executor.test.js +395 -0
- package/dist/engine/agent-executor.test.js.map +1 -0
- package/dist/engine/chat-runner.d.ts +123 -0
- package/dist/engine/chat-runner.js +379 -0
- package/dist/engine/chat-runner.js.map +1 -0
- package/dist/engine/chat-runner.test.d.ts +1 -0
- package/dist/engine/chat-runner.test.js +104 -0
- package/dist/engine/chat-runner.test.js.map +1 -0
- package/dist/engine/chat-skills.d.ts +45 -0
- package/dist/engine/chat-skills.js +184 -0
- package/dist/engine/chat-skills.js.map +1 -0
- package/dist/engine/chat-skills.test.d.ts +1 -0
- package/dist/engine/chat-skills.test.js +20 -0
- package/dist/engine/chat-skills.test.js.map +1 -0
- package/dist/engine/chat.d.ts +20 -23
- package/dist/engine/chat.js +251 -155
- package/dist/engine/chat.js.map +1 -1
- package/dist/engine/chat.test.d.ts +1 -0
- package/dist/engine/chat.test.js +42 -0
- package/dist/engine/chat.test.js.map +1 -0
- package/dist/engine/classifier.d.ts +35 -2
- package/dist/engine/classifier.js +170 -31
- package/dist/engine/classifier.js.map +1 -1
- package/dist/engine/classifier.test.d.ts +1 -0
- package/dist/engine/classifier.test.js +115 -0
- package/dist/engine/classifier.test.js.map +1 -0
- package/dist/engine/dispatcher.d.ts +60 -0
- package/dist/engine/dispatcher.js +601 -0
- package/dist/engine/dispatcher.js.map +1 -0
- package/dist/engine/dispatcher.test.d.ts +1 -0
- package/dist/engine/dispatcher.test.js +511 -0
- package/dist/engine/dispatcher.test.js.map +1 -0
- package/dist/engine/event-shim.d.ts +117 -0
- package/dist/engine/event-shim.js +435 -0
- package/dist/engine/event-shim.js.map +1 -0
- package/dist/engine/event-shim.test.d.ts +1 -0
- package/dist/engine/event-shim.test.js +194 -0
- package/dist/engine/event-shim.test.js.map +1 -0
- package/dist/engine/git-auth.d.ts +13 -17
- package/dist/engine/git-auth.js +99 -42
- package/dist/engine/git-auth.js.map +1 -1
- package/dist/engine/git-auth.test.d.ts +1 -0
- package/dist/engine/git-auth.test.js +117 -0
- package/dist/engine/git-auth.test.js.map +1 -0
- package/dist/engine/github-app-client.d.ts +7 -0
- package/dist/engine/github-app-client.js +16 -0
- package/dist/engine/github-app-client.js.map +1 -0
- package/dist/engine/github-app-client.test.d.ts +1 -0
- package/dist/engine/github-app-client.test.js +44 -0
- package/dist/engine/github-app-client.test.js.map +1 -0
- package/dist/engine/github-tools.d.ts +12 -0
- package/dist/engine/github-tools.js +261 -0
- package/dist/engine/github-tools.js.map +1 -0
- package/dist/engine/github.d.ts +1027 -43
- package/dist/engine/github.js +153 -14
- package/dist/engine/github.js.map +1 -1
- package/dist/engine/llm.d.ts +47 -0
- package/dist/engine/llm.js +221 -0
- package/dist/engine/llm.js.map +1 -0
- package/dist/engine/llm.test.d.ts +1 -0
- package/dist/engine/llm.test.js +189 -0
- package/dist/engine/llm.test.js.map +1 -0
- package/dist/engine/profiles.d.ts +249 -0
- package/dist/engine/profiles.js +42 -0
- package/dist/engine/profiles.js.map +1 -0
- package/dist/engine/router.d.ts +12 -6
- package/dist/engine/router.js +339 -81
- package/dist/engine/router.js.map +1 -1
- package/dist/engine/router.test.js +428 -78
- package/dist/engine/router.test.js.map +1 -1
- package/dist/engine/screen.d.ts +41 -0
- package/dist/engine/screen.js +93 -0
- package/dist/engine/screen.js.map +1 -0
- package/dist/engine/screen.test.d.ts +1 -0
- package/dist/engine/screen.test.js +82 -0
- package/dist/engine/screen.test.js.map +1 -0
- package/dist/index.js +377 -432
- package/dist/index.js.map +1 -1
- package/dist/managed-repos.d.ts +7 -9
- package/dist/managed-repos.js +12 -15
- package/dist/managed-repos.js.map +1 -1
- package/dist/managed-repos.test.js +24 -19
- package/dist/managed-repos.test.js.map +1 -1
- package/dist/notify/index.d.ts +15 -0
- package/dist/notify/index.js +6 -0
- package/dist/notify/index.js.map +1 -0
- package/dist/notify/model.d.ts +57 -0
- package/dist/notify/model.js +89 -0
- package/dist/notify/model.js.map +1 -0
- package/dist/notify/model.test.d.ts +1 -0
- package/dist/notify/model.test.js +109 -0
- package/dist/notify/model.test.js.map +1 -0
- package/dist/notify/notifier.d.ts +17 -0
- package/dist/notify/notifier.js +87 -0
- package/dist/notify/notifier.js.map +1 -0
- package/dist/notify/notifier.test.d.ts +1 -0
- package/dist/notify/notifier.test.js +100 -0
- package/dist/notify/notifier.test.js.map +1 -0
- package/dist/notify/render.d.ts +21 -0
- package/dist/notify/render.js +59 -0
- package/dist/notify/render.js.map +1 -0
- package/dist/notify/render.test.d.ts +1 -0
- package/dist/notify/render.test.js +65 -0
- package/dist/notify/render.test.js.map +1 -0
- package/dist/notify/transports/github.d.ts +26 -0
- package/dist/notify/transports/github.js +26 -0
- package/dist/notify/transports/github.js.map +1 -0
- package/dist/notify/transports/slack.d.ts +26 -0
- package/dist/notify/transports/slack.js +28 -0
- package/dist/notify/transports/slack.js.map +1 -0
- package/dist/notify/transports.test.d.ts +1 -0
- package/dist/notify/transports.test.js +71 -0
- package/dist/notify/transports.test.js.map +1 -0
- package/dist/notify/types.d.ts +95 -0
- package/dist/notify/types.js +16 -0
- package/dist/notify/types.js.map +1 -0
- package/dist/sandbox/docker-compose.test.d.ts +1 -0
- package/dist/sandbox/docker-compose.test.js +128 -0
- package/dist/sandbox/docker-compose.test.js.map +1 -0
- package/dist/sandbox/docker.d.ts +97 -9
- package/dist/sandbox/docker.js +192 -41
- package/dist/sandbox/docker.js.map +1 -1
- package/dist/sandbox/docker.test.d.ts +1 -0
- package/dist/sandbox/docker.test.js +137 -0
- package/dist/sandbox/docker.test.js.map +1 -0
- package/dist/sandbox/egress-allowlist.d.ts +69 -0
- package/dist/sandbox/egress-allowlist.js +164 -0
- package/dist/sandbox/egress-allowlist.js.map +1 -0
- package/dist/sandbox/egress-allowlist.test.d.ts +1 -0
- package/dist/sandbox/egress-allowlist.test.js +65 -0
- package/dist/sandbox/egress-allowlist.test.js.map +1 -0
- package/dist/sandbox/egress-firewall-config.d.ts +127 -0
- package/dist/sandbox/egress-firewall-config.js +434 -0
- package/dist/sandbox/egress-firewall-config.js.map +1 -0
- package/dist/sandbox/egress-firewall-config.test.d.ts +1 -0
- package/dist/sandbox/egress-firewall-config.test.js +244 -0
- package/dist/sandbox/egress-firewall-config.test.js.map +1 -0
- package/dist/sandbox/images.d.ts +23 -0
- package/dist/sandbox/images.js +55 -0
- package/dist/sandbox/images.js.map +1 -0
- package/dist/sandbox/index.d.ts +82 -3
- package/dist/sandbox/index.js +223 -93
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/index.test.d.ts +1 -0
- package/dist/sandbox/index.test.js +157 -0
- package/dist/sandbox/index.test.js.map +1 -0
- package/dist/session-log.d.ts +63 -0
- package/dist/session-log.js +290 -0
- package/dist/session-log.js.map +1 -0
- package/dist/session-log.test.d.ts +1 -0
- package/dist/session-log.test.js +85 -0
- package/dist/session-log.test.js.map +1 -0
- package/dist/setup.d.ts +30 -1
- package/dist/setup.js +241 -25
- package/dist/setup.js.map +1 -1
- package/dist/setup.test.js +138 -6
- package/dist/setup.test.js.map +1 -1
- package/dist/state/approval-store.d.ts +86 -0
- package/dist/state/approval-store.js +140 -0
- package/dist/state/approval-store.js.map +1 -0
- package/dist/state/build-assets.d.ts +50 -0
- package/dist/state/build-assets.js +154 -0
- package/dist/state/build-assets.js.map +1 -0
- package/dist/state/build-assets.test.d.ts +1 -0
- package/dist/state/build-assets.test.js +106 -0
- package/dist/state/build-assets.test.js.map +1 -0
- package/dist/state/db.d.ts +65 -333
- package/dist/state/db.js +112 -835
- package/dist/state/db.js.map +1 -1
- package/dist/state/db.test.js +127 -91
- package/dist/state/db.test.js.map +1 -1
- package/dist/state/execution-store.d.ts +257 -0
- package/dist/state/execution-store.js +527 -0
- package/dist/state/execution-store.js.map +1 -0
- package/dist/state/migrate.d.ts +15 -0
- package/dist/state/migrate.js +175 -0
- package/dist/state/migrate.js.map +1 -0
- package/dist/state/workflow-run-store.d.ts +195 -0
- package/dist/state/workflow-run-store.js +363 -0
- package/dist/state/workflow-run-store.js.map +1 -0
- package/dist/state/workflow-run-store.test.d.ts +1 -0
- package/dist/state/workflow-run-store.test.js +264 -0
- package/dist/state/workflow-run-store.test.js.map +1 -0
- package/dist/telemetry/index.d.ts +38 -0
- package/dist/telemetry/index.js +253 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/index.test.d.ts +1 -0
- package/dist/telemetry/index.test.js +73 -0
- package/dist/telemetry/index.test.js.map +1 -0
- package/dist/telemetry/pi-events.d.ts +12 -0
- package/dist/telemetry/pi-events.js +134 -0
- package/dist/telemetry/pi-events.js.map +1 -0
- package/dist/telemetry/pi-events.test.d.ts +1 -0
- package/dist/telemetry/pi-events.test.js +69 -0
- package/dist/telemetry/pi-events.test.js.map +1 -0
- package/dist/workflows/dag.d.ts +13 -1
- package/dist/workflows/dag.js +7 -3
- package/dist/workflows/dag.js.map +1 -1
- package/dist/workflows/dag.test.js +22 -0
- package/dist/workflows/dag.test.js.map +1 -1
- package/dist/workflows/golden-build.test.d.ts +1 -0
- package/dist/workflows/golden-build.test.js +45 -0
- package/dist/workflows/golden-build.test.js.map +1 -0
- package/dist/workflows/loader-overlay.test.d.ts +1 -0
- package/dist/workflows/loader-overlay.test.js +101 -0
- package/dist/workflows/loader-overlay.test.js.map +1 -0
- package/dist/workflows/loader.d.ts +36 -11
- package/dist/workflows/loader.js +311 -87
- package/dist/workflows/loader.js.map +1 -1
- package/dist/workflows/loader.test.js +114 -10
- package/dist/workflows/loader.test.js.map +1 -1
- package/dist/workflows/loop-eval.js +2 -0
- package/dist/workflows/loop-eval.js.map +1 -1
- package/dist/workflows/loop-eval.test.js +14 -0
- package/dist/workflows/loop-eval.test.js.map +1 -1
- package/dist/workflows/phase-executor.d.ts +145 -0
- package/dist/workflows/phase-executor.js +691 -0
- package/dist/workflows/phase-executor.js.map +1 -0
- package/dist/workflows/phase-executor.test.d.ts +1 -0
- package/dist/workflows/phase-executor.test.js +434 -0
- package/dist/workflows/phase-executor.test.js.map +1 -0
- package/dist/workflows/phase-ref.d.ts +44 -0
- package/dist/workflows/phase-ref.js +78 -0
- package/dist/workflows/phase-ref.js.map +1 -0
- package/dist/workflows/phase-ref.test.d.ts +1 -0
- package/dist/workflows/phase-ref.test.js +24 -0
- package/dist/workflows/phase-ref.test.js.map +1 -0
- package/dist/workflows/resume.d.ts +5 -11
- package/dist/workflows/resume.js +88 -7
- package/dist/workflows/resume.js.map +1 -1
- package/dist/workflows/runner.d.ts +34 -27
- package/dist/workflows/runner.js +252 -930
- package/dist/workflows/runner.js.map +1 -1
- package/dist/workflows/runner.test.js +346 -35
- package/dist/workflows/runner.test.js.map +1 -1
- package/dist/workflows/schema.d.ts +52 -10
- package/dist/workflows/schema.js +147 -7
- package/dist/workflows/schema.js.map +1 -1
- package/dist/workflows/simple.d.ts +67 -3
- package/dist/workflows/simple.js +248 -87
- package/dist/workflows/simple.js.map +1 -1
- package/dist/workflows/simple.test.d.ts +1 -0
- package/dist/workflows/simple.test.js +107 -0
- package/dist/workflows/simple.test.js.map +1 -0
- package/dist/workflows/templates.d.ts +29 -0
- package/dist/workflows/templates.js +42 -4
- package/dist/workflows/templates.js.map +1 -1
- package/dist/workflows/templates.test.js +103 -0
- package/dist/workflows/templates.test.js.map +1 -1
- package/dist/workflows/triggers.d.ts +21 -0
- package/dist/workflows/triggers.js +44 -0
- package/dist/workflows/triggers.js.map +1 -0
- package/dist/workflows/verdict.d.ts +19 -0
- package/dist/workflows/verdict.js +30 -0
- package/dist/workflows/verdict.js.map +1 -0
- package/dist/workflows/verdict.test.d.ts +1 -0
- package/dist/workflows/verdict.test.js +44 -0
- package/dist/workflows/verdict.test.js.map +1 -0
- package/dist/worktree/manager.d.ts +1 -1
- package/dist/worktree/manager.js +14 -14
- package/dist/worktree/manager.js.map +1 -1
- package/dist/worktree/manager.test.d.ts +1 -0
- package/dist/worktree/manager.test.js +87 -0
- package/dist/worktree/manager.test.js.map +1 -0
- package/docker-compose.yml +206 -5
- package/package.json +17 -7
- package/sandbox.Dockerfile +97 -18
- package/skills/README.md +40 -0
- package/skills/browser-qa/SKILL.md +193 -0
- package/skills/browser-qa/scripts/agent-browser.mjs +380 -0
- package/skills/building/SKILL.md +95 -0
- package/skills/chat/SKILL.md +30 -11
- package/skills/code-review/SKILL.md +59 -0
- package/skills/debug-production/SKILL.md +108 -0
- package/skills/demo/SKILL.md +194 -0
- package/skills/demo/scripts/compose-demo.sh +205 -0
- package/skills/issue-answer/SKILL.md +90 -0
- package/skills/issue-comment/SKILL.md +38 -24
- package/skills/issue-triage/SKILL.md +103 -37
- package/skills/issue-triage/references/AGENT-BRIEF.md +61 -0
- package/skills/pr-comment/SKILL.md +64 -0
- package/skills/pr-review/SKILL.md +65 -49
- package/skills/qa-test/SKILL.md +97 -0
- package/skills/repo-health/SKILL.md +48 -45
- package/skills/security-feedback/SKILL.md +173 -0
- package/skills/security-feedback/references/templates.md +77 -0
- package/skills/security-review/SKILL.md +213 -0
- package/skills/security-review/references/issue-format.md +302 -0
- package/skills/verify/SKILL.md +118 -0
- package/workflows/answer.yaml +37 -0
- package/workflows/build.yaml +32 -22
- package/workflows/cron-security.yaml +6 -0
- package/workflows/demo.yaml +55 -0
- package/workflows/explore.yaml +9 -0
- package/workflows/pr-comment.yaml +16 -0
- package/workflows/pr-fix.yaml +3 -0
- package/workflows/pr-review.yaml +4 -1
- package/workflows/prompts/answer.md +67 -0
- package/workflows/prompts/architect.md +24 -7
- package/workflows/prompts/demo.md +100 -0
- package/workflows/prompts/executor.md +29 -20
- package/workflows/prompts/explore-ask.md +51 -22
- package/workflows/prompts/explore-publish.md +2 -2
- package/workflows/prompts/explore-read.md +24 -10
- package/workflows/prompts/explore-synthesize.md +15 -8
- package/workflows/prompts/fix.md +9 -10
- package/workflows/prompts/guardrails.md +26 -8
- package/workflows/prompts/pr-fix.md +6 -7
- package/workflows/prompts/pr.md +11 -10
- package/workflows/prompts/qa-browser.md +95 -0
- package/workflows/prompts/qa-synth.md +44 -0
- package/workflows/prompts/qa-test.md +60 -0
- package/workflows/prompts/re-reviewer.md +8 -9
- package/workflows/prompts/reviewer.md +10 -9
- package/workflows/prompts/verify-browser.md +93 -0
- package/workflows/prompts/verify-synth.md +44 -0
- package/workflows/prompts/verify.md +63 -0
- package/workflows/qa-test.yaml +87 -0
- package/workflows/security-feedback.yaml +25 -0
- package/workflows/security-review.yaml +29 -0
- package/workflows/verify.yaml +85 -0
- package/deploy/mcp-config.tmpl.json +0 -14
- package/dist/cron/rate-limits.d.ts +0 -26
- package/dist/cron/rate-limits.js +0 -193
- package/dist/cron/rate-limits.js.map +0 -1
- package/dist/engine/executor.d.ts +0 -75
- package/dist/engine/executor.js +0 -292
- package/dist/engine/executor.js.map +0 -1
- package/mcp-github-app/package.json +0 -18
- package/mcp-github-app/src/auth.js +0 -66
- package/mcp-github-app/src/github.js +0 -371
- package/mcp-github-app/src/index.js +0 -534
- package/skills/devops/webhook-subscriptions/SKILL.md +0 -180
- package/skills/github/DESCRIPTION.md +0 -3
- package/skills/github/codebase-inspection/SKILL.md +0 -115
- package/skills/github/github-auth/SKILL.md +0 -54
- package/skills/github/github-auth/scripts/gh-env.sh +0 -66
- package/skills/github/github-code-review/SKILL.md +0 -480
- package/skills/github/github-code-review/references/review-output-template.md +0 -74
- package/skills/github/github-issues/SKILL.md +0 -369
- package/skills/github/github-issues/templates/bug-report.md +0 -35
- package/skills/github/github-issues/templates/feature-request.md +0 -31
- package/skills/github/github-pr-workflow/SKILL.md +0 -395
- package/skills/github/github-pr-workflow/references/ci-troubleshooting.md +0 -183
- package/skills/github/github-pr-workflow/references/conventional-commits.md +0 -71
- package/skills/github/github-pr-workflow/templates/pr-body-bugfix.md +0 -35
- package/skills/github/github-pr-workflow/templates/pr-body-feature.md +0 -33
- package/skills/github/github-repo-management/SKILL.md +0 -515
- package/skills/github/github-repo-management/references/github-api-cheatsheet.md +0 -161
- package/skills/github-orchestrator/SKILL.md +0 -103
- package/skills/mcp/DESCRIPTION.md +0 -3
- package/skills/mcp/mcporter/SKILL.md +0 -122
- package/skills/mcp/native-mcp/SKILL.md +0 -356
- package/skills/software-development/architect/SKILL.md +0 -154
- package/skills/software-development/assure-guardrails/SKILL.md +0 -239
- package/skills/software-development/plan/SKILL.md +0 -64
- package/skills/software-development/requesting-code-review/SKILL.md +0 -291
- package/skills/software-development/subagent-driven-development/SKILL.md +0 -433
- package/skills/software-development/systematic-debugging/SKILL.md +0 -366
- package/skills/software-development/test-driven-development/SKILL.md +0 -342
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared, platform-agnostic notification model.
|
|
3
|
+
*
|
|
4
|
+
* The notifier renders workflow progress as a single "task list" surface that
|
|
5
|
+
* is **edited in place** as phases run — one GitHub comment (via
|
|
6
|
+
* `issues.updateComment`) and/or one Slack message (via `chat.update`) instead
|
|
7
|
+
* of a fresh comment per phase. The model here is the canonical content; the
|
|
8
|
+
* renderer (`render.ts`) turns it into markdown that both platforms consume
|
|
9
|
+
* (Slack runs the markdown through `markdownToSlackMrkdwn` in its transport).
|
|
10
|
+
*
|
|
11
|
+
* Nothing in this module imports GitHub or Slack — platform code lives behind
|
|
12
|
+
* the `NotifierTransport` interface so the content model stays decoupled and
|
|
13
|
+
* shared.
|
|
14
|
+
*/
|
|
15
|
+
/** Lifecycle state of a single checklist step. */
|
|
16
|
+
export type StepStatus = "pending" | "running" | "done" | "blocked" | "awaiting" | "failed" | "skipped";
|
|
17
|
+
/** One row in the task list. `key` is stable; `label` is what humans see. */
|
|
18
|
+
export interface ProgressStep {
|
|
19
|
+
key: string;
|
|
20
|
+
label: string;
|
|
21
|
+
status: StepStatus;
|
|
22
|
+
/** Optional one-line context shown after the label (e.g. a link or status). */
|
|
23
|
+
detail?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The full content model rendered into the single status surface. */
|
|
26
|
+
export interface ProgressModel {
|
|
27
|
+
/** Heading line, e.g. "build for #18". */
|
|
28
|
+
title: string;
|
|
29
|
+
/** Optional bold sub-heading, e.g. the issue title. */
|
|
30
|
+
subtitle?: string;
|
|
31
|
+
/** Optional metadata lines under the heading (branch link, PR link, …). */
|
|
32
|
+
meta?: string[];
|
|
33
|
+
/** Ordered checklist. */
|
|
34
|
+
steps: ProgressStep[];
|
|
35
|
+
/** Optional trailing line (e.g. artifacts link). */
|
|
36
|
+
footer?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A platform binding. Each transport owns its own in-place-update handle
|
|
40
|
+
* (a GitHub comment id or a Slack message ts) internally.
|
|
41
|
+
*/
|
|
42
|
+
export interface NotifierTransport {
|
|
43
|
+
/** Create-or-update the single status surface with the rendered markdown. */
|
|
44
|
+
publish(markdown: string): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Post a *new, separate* message (not an edit). Used for approval prompts —
|
|
47
|
+
* moments worth an actual notification, since an in-place edit is silent.
|
|
48
|
+
*/
|
|
49
|
+
note(markdown: string): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this surface wants a separate *completion* ping at the end of a
|
|
52
|
+
* run. Slack sets this (its in-place edits are silent and it has no other
|
|
53
|
+
* signal); GitHub leaves it false — the edited checklist plus the
|
|
54
|
+
* PR-opened event already notify watchers, so a terminal comment would just
|
|
55
|
+
* be noise. Default false.
|
|
56
|
+
*/
|
|
57
|
+
readonly terminalPing?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The runner-facing API. `runner.ts` only ever sees this interface — it never
|
|
61
|
+
* touches a transport or the markdown directly.
|
|
62
|
+
*/
|
|
63
|
+
export interface ProgressReporter {
|
|
64
|
+
/** Seed the task list. Idempotent: a resumed run re-seeds the same surface. */
|
|
65
|
+
start(model: ProgressModel): Promise<void>;
|
|
66
|
+
/** Transition a step's status (and optionally set its one-line detail). */
|
|
67
|
+
step(key: string, status: StepStatus, detail?: string): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Insert (or update) a dynamic step before `beforeKey` — used for loop
|
|
70
|
+
* iterations (re-review / fix cycles). Appends when `beforeKey` is omitted
|
|
71
|
+
* or not found.
|
|
72
|
+
*/
|
|
73
|
+
insertStep(step: ProgressStep, beforeKey?: string): Promise<void>;
|
|
74
|
+
/** Post a standalone message to every surface (e.g. an approval prompt). */
|
|
75
|
+
note(markdown: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Set (or clear) the trailing footer of the single status surface and
|
|
78
|
+
* re-publish in place. Used to fold a workflow's final synthesized result
|
|
79
|
+
* into the same comment as the checklist rather than posting a new one.
|
|
80
|
+
* Pass an empty string to clear.
|
|
81
|
+
*/
|
|
82
|
+
footer(markdown: string): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Post the run's completion message, but only to surfaces that want a
|
|
85
|
+
* terminal ping (Slack) — GitHub is left with just the finished checklist.
|
|
86
|
+
*/
|
|
87
|
+
noteTerminal(markdown: string): Promise<void>;
|
|
88
|
+
}
|
|
89
|
+
/** Persisted in-place-update handles, stored under `workflow_runs.scratch.notifier`. */
|
|
90
|
+
export interface NotifierState {
|
|
91
|
+
githubCommentId?: number;
|
|
92
|
+
slackTs?: string;
|
|
93
|
+
slackChannel?: string;
|
|
94
|
+
slackThread?: string;
|
|
95
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared, platform-agnostic notification model.
|
|
3
|
+
*
|
|
4
|
+
* The notifier renders workflow progress as a single "task list" surface that
|
|
5
|
+
* is **edited in place** as phases run — one GitHub comment (via
|
|
6
|
+
* `issues.updateComment`) and/or one Slack message (via `chat.update`) instead
|
|
7
|
+
* of a fresh comment per phase. The model here is the canonical content; the
|
|
8
|
+
* renderer (`render.ts`) turns it into markdown that both platforms consume
|
|
9
|
+
* (Slack runs the markdown through `markdownToSlackMrkdwn` in its transport).
|
|
10
|
+
*
|
|
11
|
+
* Nothing in this module imports GitHub or Slack — platform code lives behind
|
|
12
|
+
* the `NotifierTransport` interface so the content model stays decoupled and
|
|
13
|
+
* shared.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/notify/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { readFileSync } from "fs";
|
|
3
|
+
import { resolve } from "path";
|
|
4
|
+
import { parse } from "yaml";
|
|
5
|
+
import { COREDNS_OPEN_IP, COREDNS_STRICT_IP, NGINX_OPEN_IP, NGINX_STRICT_IP, OTEL_COLLECTOR_IP, OTEL_COLLECTOR_UID, SANDBOX_EGRESS_SUBNET, } from "./egress-firewall-config.js";
|
|
6
|
+
const compose = parse(readFileSync(resolve(__dirname, "../../docker-compose.yml"), "utf-8"));
|
|
7
|
+
const FIREWALL_SERVICES = [
|
|
8
|
+
"nginx-egress-strict",
|
|
9
|
+
"nginx-egress-open",
|
|
10
|
+
"coredns-strict",
|
|
11
|
+
"coredns-open",
|
|
12
|
+
];
|
|
13
|
+
const HARNESS_SERVICES = ["agent", "caddy"];
|
|
14
|
+
function networkNamesOf(service) {
|
|
15
|
+
const nets = compose.services[service]?.networks;
|
|
16
|
+
if (!nets)
|
|
17
|
+
return [];
|
|
18
|
+
if (Array.isArray(nets))
|
|
19
|
+
return nets;
|
|
20
|
+
return Object.keys(nets);
|
|
21
|
+
}
|
|
22
|
+
function ipv4OnNetwork(service, net) {
|
|
23
|
+
const nets = compose.services[service]?.networks;
|
|
24
|
+
if (!nets || Array.isArray(nets))
|
|
25
|
+
return undefined;
|
|
26
|
+
const cfg = nets[net];
|
|
27
|
+
if (cfg && typeof cfg === "object" && "ipv4_address" in cfg) {
|
|
28
|
+
return String(cfg.ipv4_address);
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
describe("docker-compose egress topology", () => {
|
|
33
|
+
it("declares the three expected networks", () => {
|
|
34
|
+
expect(Object.keys(compose.networks).sort()).toEqual(["internal", "proxy-egress", "sandbox-egress"].sort());
|
|
35
|
+
});
|
|
36
|
+
it("marks sandbox-egress as internal: true with the expected static subnet", () => {
|
|
37
|
+
const net = compose.networks["sandbox-egress"];
|
|
38
|
+
expect(net?.internal).toBe(true);
|
|
39
|
+
// Subnet must match SANDBOX_EGRESS_SUBNET so the constants in
|
|
40
|
+
// egress-firewall-config.ts are valid IPs in that range.
|
|
41
|
+
const subnet = net?.ipam?.config?.[0]?.subnet;
|
|
42
|
+
expect(subnet).toBe(SANDBOX_EGRESS_SUBNET);
|
|
43
|
+
});
|
|
44
|
+
it("proxy-egress is a regular bridge (no internal: true) so firewalls can reach the internet", () => {
|
|
45
|
+
const net = compose.networks["proxy-egress"];
|
|
46
|
+
// YAML `proxy-egress:` parses to null when no fields are set.
|
|
47
|
+
expect(net == null || net.internal !== true).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
for (const svc of FIREWALL_SERVICES) {
|
|
50
|
+
describe(svc, () => {
|
|
51
|
+
const nets = networkNamesOf(svc);
|
|
52
|
+
it("does NOT attach to the harness `internal` network", () => {
|
|
53
|
+
// Security-critical: if regressed, an unrestricted sandbox can
|
|
54
|
+
// bridge into compose-internal services via the firewall.
|
|
55
|
+
expect(nets).not.toContain("internal");
|
|
56
|
+
});
|
|
57
|
+
it("attaches to sandbox-egress (so sandboxes can reach it)", () => {
|
|
58
|
+
expect(nets).toContain("sandbox-egress");
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
it("nginx firewalls attach to proxy-egress (so they can reach the public internet)", () => {
|
|
63
|
+
for (const svc of ["nginx-egress-strict", "nginx-egress-open"]) {
|
|
64
|
+
expect(networkNamesOf(svc)).toContain("proxy-egress");
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
describe("otel-collector", () => {
|
|
68
|
+
const nets = networkNamesOf("otel-collector");
|
|
69
|
+
it("is dual-homed on sandbox-egress (ingress from sandboxes) + proxy-egress (outbound to backend)", () => {
|
|
70
|
+
expect(nets).toContain("sandbox-egress");
|
|
71
|
+
expect(nets).toContain("proxy-egress");
|
|
72
|
+
});
|
|
73
|
+
it("does NOT attach to the harness `internal` network (can't bridge a sandbox into harness services)", () => {
|
|
74
|
+
expect(nets).not.toContain("internal");
|
|
75
|
+
});
|
|
76
|
+
it("uses the static IP the harness bakes into the sandbox OTLP endpoint", () => {
|
|
77
|
+
expect(ipv4OnNetwork("otel-collector", "sandbox-egress")).toBe(OTEL_COLLECTOR_IP);
|
|
78
|
+
});
|
|
79
|
+
it("does NOT force root — runs as the image's non-root UID", () => {
|
|
80
|
+
// The harness writes the mode-0600 config as UID OTEL_COLLECTOR_UID (its
|
|
81
|
+
// `lastlight` user is pinned to it), so the collector reads it as owner
|
|
82
|
+
// without root. If this ever regresses to `user: "0:0"`, we'd be running
|
|
83
|
+
// a sandbox-facing service as root unnecessarily.
|
|
84
|
+
expect(compose.services["otel-collector"]?.user).toBeUndefined();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
it("pins the harness `lastlight` UID to the collector image UID so it can read the 0600 config", () => {
|
|
88
|
+
// The collector reads the harness-written mode-0600 OTLP config as its
|
|
89
|
+
// owner. That only works if the harness writes it as the collector's UID,
|
|
90
|
+
// so the Dockerfile must `useradd -u <OTEL_COLLECTOR_UID> lastlight`. If
|
|
91
|
+
// the collector image's UID ever changes, this test fails loudly to force
|
|
92
|
+
// bumping both together.
|
|
93
|
+
const dockerfile = readFileSync(resolve(__dirname, "../../Dockerfile"), "utf-8");
|
|
94
|
+
expect(dockerfile).toMatch(new RegExp(`useradd[^\\n]*-u\\s+${OTEL_COLLECTOR_UID}\\s+lastlight`));
|
|
95
|
+
});
|
|
96
|
+
it("coredns containers do NOT attach to proxy-egress (no internet needed)", () => {
|
|
97
|
+
// CoreDNS only synthesises answers from its config; it never recurses.
|
|
98
|
+
// Keeping it off proxy-egress is defence in depth.
|
|
99
|
+
for (const svc of ["coredns-strict", "coredns-open"]) {
|
|
100
|
+
expect(networkNamesOf(svc)).not.toContain("proxy-egress");
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
it("static IPs match the constants the harness bakes into the generated configs", () => {
|
|
104
|
+
expect(ipv4OnNetwork("coredns-strict", "sandbox-egress")).toBe(COREDNS_STRICT_IP);
|
|
105
|
+
expect(ipv4OnNetwork("coredns-open", "sandbox-egress")).toBe(COREDNS_OPEN_IP);
|
|
106
|
+
expect(ipv4OnNetwork("nginx-egress-strict", "sandbox-egress")).toBe(NGINX_STRICT_IP);
|
|
107
|
+
expect(ipv4OnNetwork("nginx-egress-open", "sandbox-egress")).toBe(NGINX_OPEN_IP);
|
|
108
|
+
});
|
|
109
|
+
for (const svc of HARNESS_SERVICES) {
|
|
110
|
+
it(`harness service \`${svc}\` does NOT attach to proxy-egress or sandbox-egress`, () => {
|
|
111
|
+
// Keeps the egress fabric isolated from anything carrying secrets.
|
|
112
|
+
const nets = networkNamesOf(svc);
|
|
113
|
+
expect(nets).not.toContain("proxy-egress");
|
|
114
|
+
expect(nets).not.toContain("sandbox-egress");
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
it("proxy-egress contains exactly the two nginx firewalls and the otel-collector", () => {
|
|
118
|
+
// These are the only services allowed an outbound path: the firewalls
|
|
119
|
+
// tunnel sandbox HTTPS, and the collector re-exports sandbox telemetry.
|
|
120
|
+
// None touch `internal`, so none can bridge a sandbox into harness
|
|
121
|
+
// services. Any other service appearing here is a regression.
|
|
122
|
+
const onProxyEgress = Object.keys(compose.services)
|
|
123
|
+
.filter((name) => networkNamesOf(name).includes("proxy-egress"))
|
|
124
|
+
.sort();
|
|
125
|
+
expect(onProxyEgress).toEqual(["nginx-egress-open", "nginx-egress-strict", "otel-collector"]);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=docker-compose.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker-compose.test.js","sourceRoot":"","sources":["../../src/sandbox/docker-compose.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AA8BrC,MAAM,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AAC,CAAC,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;YAC3C,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,EAAE,CAAC,8EAA8E,EAAE,GAAG,EAAE;QACtF,sEAAsE;QACtE,wEAAwE;QACxE,mEAAmE;QACnE,8DAA8D;QAC9D,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;aAChD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;aAC/D,IAAI,EAAE,CAAC;QACV,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,mBAAmB,EAAE,qBAAqB,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAChG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/sandbox/docker.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* workspace after volumes are mounted — no post-run docker exec needed.
|
|
7
7
|
*
|
|
8
8
|
* Volumes mounted at runtime:
|
|
9
|
-
* - Shared data volume (/data):
|
|
9
|
+
* - Shared data volume (/data): secrets (app.pem), session logs
|
|
10
10
|
* - Task worktree (/home/agent/workspace): per-task git repo
|
|
11
11
|
*/
|
|
12
12
|
export interface SandboxConfig {
|
|
@@ -16,12 +16,61 @@ export interface SandboxConfig {
|
|
|
16
16
|
env: Record<string, string>;
|
|
17
17
|
/** Timeout in seconds (default: 1800 = 30 min) */
|
|
18
18
|
timeoutSeconds?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Per-sandbox memory cap, in Docker's `--memory` format (e.g. "2g", "512m").
|
|
21
|
+
* Default: 2g — enough headroom for `npm install`, vite build, and an
|
|
22
|
+
* agent loop, but small enough that several concurrent sandboxes can't
|
|
23
|
+
* exhaust a 16 GB host. Override via the `SANDBOX_MEMORY_LIMIT` env var.
|
|
24
|
+
*/
|
|
25
|
+
memoryLimit?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Docker network to attach the sandbox container to. Defaults to
|
|
28
|
+
* `LASTLIGHT_SANDBOX_NETWORK` env var or `lastlight_sandbox-egress`
|
|
29
|
+
* (the `internal: true` network declared in docker-compose.yml). The
|
|
30
|
+
* sandbox can only reach the public internet through the nginx-egress
|
|
31
|
+
* firewall sidecars on this network.
|
|
32
|
+
*/
|
|
33
|
+
network?: string;
|
|
34
|
+
/**
|
|
35
|
+
* IP of the coredns sidecar this sandbox uses as its DNS resolver.
|
|
36
|
+
* `coredns-strict` (172.30.0.10) returns the strict-nginx IP for
|
|
37
|
+
* allowlisted hosts and NXDOMAIN for everything else; `coredns-open`
|
|
38
|
+
* (172.30.0.11) returns the open-nginx IP for any hostname (minus a
|
|
39
|
+
* small SSRF deny set). Passed to `docker run` as `--dns <ip>`.
|
|
40
|
+
*
|
|
41
|
+
* No env vars are injected — the sandbox has no idea a firewall is
|
|
42
|
+
* in front of it. Works for every SDK regardless of whether it
|
|
43
|
+
* honours HTTP_PROXY / HTTPS_PROXY.
|
|
44
|
+
*/
|
|
45
|
+
dnsIp?: string;
|
|
19
46
|
}
|
|
20
47
|
export interface SandboxInfo {
|
|
21
48
|
containerId: string;
|
|
22
49
|
containerName: string;
|
|
23
50
|
worktreePath: string;
|
|
24
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* How `/home/agent/workspace` is materialized inside the sandbox container.
|
|
54
|
+
*
|
|
55
|
+
* - `bind`: classic host-path bind mount. Only safe when the host filesystem
|
|
56
|
+
* path is identical from the harness's view and the docker daemon's view —
|
|
57
|
+
* i.e. local dev where the harness runs directly on the host, or any
|
|
58
|
+
* deployment where `SANDBOX_DATA_VOLUME` is a real host path.
|
|
59
|
+
* - `volume-subpath`: mount a subpath of a named docker volume. Required
|
|
60
|
+
* when the harness runs inside a container that holds the data dir via a
|
|
61
|
+
* named volume (the standard docker-compose setup). A bare bind would
|
|
62
|
+
* resolve `/app/data/sandboxes/<id>` against the host's empty bare-FS
|
|
63
|
+
* `/app/data/...` rather than the named volume's `_data/sandboxes/<id>`,
|
|
64
|
+
* producing two divergent trees and breaking skill staging.
|
|
65
|
+
*/
|
|
66
|
+
export type WorkspaceMount = {
|
|
67
|
+
type: "bind";
|
|
68
|
+
hostPath: string;
|
|
69
|
+
} | {
|
|
70
|
+
type: "volume-subpath";
|
|
71
|
+
volume: string;
|
|
72
|
+
subpath: string;
|
|
73
|
+
};
|
|
25
74
|
export declare class DockerSandbox {
|
|
26
75
|
private config;
|
|
27
76
|
private activeContainers;
|
|
@@ -32,25 +81,64 @@ export declare class DockerSandbox {
|
|
|
32
81
|
create(opts: {
|
|
33
82
|
taskId: string;
|
|
34
83
|
worktreePath: string;
|
|
84
|
+
workspaceMount: WorkspaceMount;
|
|
35
85
|
}): Promise<SandboxInfo>;
|
|
36
86
|
/**
|
|
37
|
-
* Wait for the sandbox entrypoint to finish setup.
|
|
38
|
-
*
|
|
87
|
+
* Wait for the sandbox entrypoint to finish setup. The entrypoint touches
|
|
88
|
+
* `$WORKSPACE/.ready` as its last step before exec'ing the agent shell.
|
|
39
89
|
*/
|
|
40
90
|
private waitForReady;
|
|
41
91
|
/**
|
|
42
|
-
* Run the
|
|
92
|
+
* Run the agentic-pi CLI inside the sandbox with a prompt.
|
|
43
93
|
*
|
|
44
|
-
* Streams stdout line-by-line so the caller can react to
|
|
45
|
-
* (e.g. capture the
|
|
46
|
-
*
|
|
47
|
-
* post-run parsing of the
|
|
94
|
+
* Streams stdout line-by-line so the caller can react to JSON events
|
|
95
|
+
* (e.g. capture the top-level `session` record's id) before the agent
|
|
96
|
+
* has finished. The full stdout is also buffered and returned for
|
|
97
|
+
* post-run parsing of the usage_snapshot rollup.
|
|
48
98
|
*/
|
|
49
99
|
runAgent(taskId: string, prompt: string, opts?: {
|
|
50
100
|
model?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Pi thinking level: `off | minimal | low | medium | high | xhigh`.
|
|
103
|
+
* Validated against the closed set before being shell-interpolated.
|
|
104
|
+
*/
|
|
105
|
+
thinking?: string;
|
|
106
|
+
/** agentic-pi GitHub profile: `read | issues-write | review-write | repo-write`. */
|
|
107
|
+
profile?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Env forwarded INTO the sandboxed run via repeated `--sandbox-env`
|
|
110
|
+
* flags. Used to inject git identity. Keys / values are charset-asserted
|
|
111
|
+
* before shell interpolation.
|
|
112
|
+
*/
|
|
113
|
+
sandboxEnv?: Record<string, string>;
|
|
114
|
+
/**
|
|
115
|
+
* Working directory for the agent process inside the container.
|
|
116
|
+
* Defaults to WORKSPACE_DIR (the workspace root). When the harness
|
|
117
|
+
* pre-cloned the target repo, the executor passes
|
|
118
|
+
* `<WORKSPACE_DIR>/<repo>` so the agent starts inside the checked-out
|
|
119
|
+
* tree. The path is asserted against an allowlist before being passed
|
|
120
|
+
* to `docker exec -w` to keep it shell-safe.
|
|
121
|
+
*/
|
|
122
|
+
agentCwd?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Enable agentic-pi's web-search extension. When false (or omitted),
|
|
125
|
+
* `--no-web-search` is appended to suppress auto-enable. When true,
|
|
126
|
+
* the flag is omitted and agentic-pi auto-detects the provider from
|
|
127
|
+
* whichever `*_API_KEY` env var the container received.
|
|
128
|
+
*/
|
|
129
|
+
webSearch?: boolean;
|
|
130
|
+
/** Force a specific web-search provider. Validated against a closed set. */
|
|
131
|
+
webSearchProvider?: "tavily" | "brave" | "exa";
|
|
132
|
+
/**
|
|
133
|
+
* Per-phase skill directories to load, as absolute in-container paths
|
|
134
|
+
* under WORKSPACE_DIR (e.g. `/home/agent/workspace/.lastlight-skills/
|
|
135
|
+
* <phase>/<skill>`). Each becomes a repeated `--skill <dir>` flag.
|
|
136
|
+
* Charset/prefix-asserted before shell interpolation.
|
|
137
|
+
*/
|
|
138
|
+
skillDirs?: string[];
|
|
51
139
|
/** Called for each newline-terminated stdout line as it arrives. */
|
|
52
140
|
onLine?: (line: string) => void;
|
|
53
|
-
}): Promise<
|
|
141
|
+
}): Promise<void>;
|
|
54
142
|
/**
|
|
55
143
|
* Remove a sandbox container.
|
|
56
144
|
*/
|