@kenkaiiii/gg-engine 0.0.0-stage → 7.1.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/LICENSE +661 -0
- package/NOTICE +43 -0
- package/README.md +53 -2
- package/assets/skills/bulletproof/SKILL.md +132 -0
- package/assets/skills/bulletproof/references/agent-surface.md +113 -0
- package/assets/skills/bulletproof/references/attack-classes.md +226 -0
- package/assets/skills/bulletproof/references/audit-protocol.md +232 -0
- package/assets/skills/bulletproof/references/platform-playbooks.md +196 -0
- package/assets/skills/bulletproof/references/provenance.md +146 -0
- package/assets/skills/bulletproof/references/secure-defaults.md +137 -0
- package/assets/skills/bulletproof/references/supply-chain.md +84 -0
- package/assets/skills/bulletproof/references/threat-landscape.md +66 -0
- package/assets/skills/bulletproof/references/verification.md +74 -0
- package/assets/skills/compliance-guard/SKILL.md +115 -0
- package/assets/skills/compliance-guard/references/artifacts.md +199 -0
- package/assets/skills/compliance-guard/references/eu-uk.md +162 -0
- package/assets/skills/compliance-guard/references/exposure-triage.md +177 -0
- package/assets/skills/compliance-guard/references/full-review.md +155 -0
- package/assets/skills/compliance-guard/references/lawsuit-vectors.md +153 -0
- package/assets/skills/compliance-guard/references/provenance.md +135 -0
- package/assets/skills/compliance-guard/references/sector-gates.md +187 -0
- package/assets/skills/compliance-guard/references/security-baseline.md +117 -0
- package/assets/skills/compliance-guard/references/trigger-map.md +177 -0
- package/assets/skills/compliance-guard/references/us.md +194 -0
- package/assets/skills/durable/SKILL.md +114 -0
- package/assets/skills/durable/references/agent-db-safety.md +76 -0
- package/assets/skills/durable/references/backups-and-runtime.md +93 -0
- package/assets/skills/durable/references/migrations-and-schema.md +87 -0
- package/assets/skills/gg-guide/SKILL.md +43 -0
- package/assets/skills/gg-guide/references/chat-motion-goals.md +217 -0
- package/assets/skills/gg-guide/references/checklist-and-safety.md +177 -0
- package/assets/skills/gg-guide/references/code-mode.md +272 -0
- package/assets/skills/gg-guide/references/getting-started.md +295 -0
- package/assets/skills/gg-guide/references/ken-and-autopilot.md +172 -0
- package/assets/skills/gg-guide/references/mcp-and-skills.md +204 -0
- package/assets/skills/gg-guide/references/models-and-sign-in.md +200 -0
- package/assets/skills/gg-guide/references/sessions-and-history.md +213 -0
- package/assets/skills/gg-guide/references/settings.md +193 -0
- package/assets/skills/gg-guide/references/troubleshooting-and-data.md +186 -0
- package/assets/skills/lean/SKILL.md +117 -0
- package/assets/skills/lean/references/memory-and-processes.md +99 -0
- package/assets/skills/lean/references/playbooks.md +134 -0
- package/dist/app-error.d.ts +22 -0
- package/dist/app-error.js +41 -0
- package/dist/app-error.js.map +1 -0
- package/dist/config.d.ts +90 -0
- package/dist/config.js +240 -0
- package/dist/config.js.map +1 -0
- package/dist/core/acceptance-checks.d.ts +48 -0
- package/dist/core/acceptance-checks.js +151 -0
- package/dist/core/acceptance-checks.js.map +1 -0
- package/dist/core/action-threats.d.ts +68 -0
- package/dist/core/action-threats.js +894 -0
- package/dist/core/action-threats.js.map +1 -0
- package/dist/core/agent-notifications.d.ts +79 -0
- package/dist/core/agent-notifications.js +125 -0
- package/dist/core/agent-notifications.js.map +1 -0
- package/dist/core/agent-session/helpers.d.ts +26 -0
- package/dist/core/agent-session/helpers.js +47 -0
- package/dist/core/agent-session/helpers.js.map +1 -0
- package/dist/core/agent-session/mcp-tools.d.ts +87 -0
- package/dist/core/agent-session/mcp-tools.js +227 -0
- package/dist/core/agent-session/mcp-tools.js.map +1 -0
- package/dist/core/agent-session/run-loop-monitor.d.ts +63 -0
- package/dist/core/agent-session/run-loop-monitor.js +164 -0
- package/dist/core/agent-session/run-loop-monitor.js.map +1 -0
- package/dist/core/agent-session/transcript-markers.d.ts +57 -0
- package/dist/core/agent-session/transcript-markers.js +166 -0
- package/dist/core/agent-session/transcript-markers.js.map +1 -0
- package/dist/core/agent-session/verification-tracker.d.ts +71 -0
- package/dist/core/agent-session/verification-tracker.js +295 -0
- package/dist/core/agent-session/verification-tracker.js.map +1 -0
- package/dist/core/agent-session.d.ts +1401 -0
- package/dist/core/agent-session.js +5160 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/agents.d.ts +63 -0
- package/dist/core/agents.js +160 -0
- package/dist/core/agents.js.map +1 -0
- package/dist/core/ask-user.d.ts +163 -0
- package/dist/core/ask-user.js +178 -0
- package/dist/core/ask-user.js.map +1 -0
- package/dist/core/auto-update.d.ts +32 -0
- package/dist/core/auto-update.js +218 -0
- package/dist/core/auto-update.js.map +1 -0
- package/dist/core/autopilot-cycle.d.ts +127 -0
- package/dist/core/autopilot-cycle.js +182 -0
- package/dist/core/autopilot-cycle.js.map +1 -0
- package/dist/core/autopilot-gate.d.ts +106 -0
- package/dist/core/autopilot-gate.js +192 -0
- package/dist/core/autopilot-gate.js.map +1 -0
- package/dist/core/autopilot-verdict.d.ts +55 -0
- package/dist/core/autopilot-verdict.js +226 -0
- package/dist/core/autopilot-verdict.js.map +1 -0
- package/dist/core/blocked-packages-file.d.ts +33 -0
- package/dist/core/blocked-packages-file.js +274 -0
- package/dist/core/blocked-packages-file.js.map +1 -0
- package/dist/core/bundled-agents.d.ts +2 -0
- package/dist/core/bundled-agents.js +253 -0
- package/dist/core/bundled-agents.js.map +1 -0
- package/dist/core/cache-diagnostics.d.ts +72 -0
- package/dist/core/cache-diagnostics.js +200 -0
- package/dist/core/cache-diagnostics.js.map +1 -0
- package/dist/core/cache-expiry.d.ts +89 -0
- package/dist/core/cache-expiry.js +117 -0
- package/dist/core/cache-expiry.js.map +1 -0
- package/dist/core/checklist-detection.d.ts +8 -0
- package/dist/core/checklist-detection.js +238 -0
- package/dist/core/checklist-detection.js.map +1 -0
- package/dist/core/checklist-git.d.ts +19 -0
- package/dist/core/checklist-git.js +54 -0
- package/dist/core/checklist-git.js.map +1 -0
- package/dist/core/checklist-items.d.ts +182 -0
- package/dist/core/checklist-items.js +228 -0
- package/dist/core/checklist-items.js.map +1 -0
- package/dist/core/checklist-prompt.d.ts +14 -0
- package/dist/core/checklist-prompt.js +64 -0
- package/dist/core/checklist-prompt.js.map +1 -0
- package/dist/core/checklist-snapshot.d.ts +7 -0
- package/dist/core/checklist-snapshot.js +46 -0
- package/dist/core/checklist-snapshot.js.map +1 -0
- package/dist/core/checklist-store.d.ts +45 -0
- package/dist/core/checklist-store.js +281 -0
- package/dist/core/checklist-store.js.map +1 -0
- package/dist/core/checkout-record.d.ts +22 -0
- package/dist/core/checkout-record.js +68 -0
- package/dist/core/checkout-record.js.map +1 -0
- package/dist/core/checkpoint-store.d.ts +109 -0
- package/dist/core/checkpoint-store.js +260 -0
- package/dist/core/checkpoint-store.js.map +1 -0
- package/dist/core/claude-code/complete.d.ts +35 -0
- package/dist/core/claude-code/complete.js +125 -0
- package/dist/core/claude-code/complete.js.map +1 -0
- package/dist/core/claude-code/events.d.ts +67 -0
- package/dist/core/claude-code/events.js +460 -0
- package/dist/core/claude-code/events.js.map +1 -0
- package/dist/core/claude-code/live-session.d.ts +94 -0
- package/dist/core/claude-code/live-session.js +525 -0
- package/dist/core/claude-code/live-session.js.map +1 -0
- package/dist/core/claude-code/loop.d.ts +9 -0
- package/dist/core/claude-code/loop.js +15 -0
- package/dist/core/claude-code/loop.js.map +1 -0
- package/dist/core/claude-code/session-sync.d.ts +28 -0
- package/dist/core/claude-code/session-sync.js +53 -0
- package/dist/core/claude-code/session-sync.js.map +1 -0
- package/dist/core/claude-code/tool-bridge.d.ts +49 -0
- package/dist/core/claude-code/tool-bridge.js +352 -0
- package/dist/core/claude-code/tool-bridge.js.map +1 -0
- package/dist/core/claude-code/transcripts.d.ts +39 -0
- package/dist/core/claude-code/transcripts.js +195 -0
- package/dist/core/claude-code/transcripts.js.map +1 -0
- package/dist/core/code-retrieval-chunkers.d.ts +26 -0
- package/dist/core/code-retrieval-chunkers.js +264 -0
- package/dist/core/code-retrieval-chunkers.js.map +1 -0
- package/dist/core/code-retrieval.d.ts +18 -0
- package/dist/core/code-retrieval.js +124 -0
- package/dist/core/code-retrieval.js.map +1 -0
- package/dist/core/codex-request-shape.d.ts +7 -0
- package/dist/core/codex-request-shape.js +19 -0
- package/dist/core/codex-request-shape.js.map +1 -0
- package/dist/core/compaction/active-context.d.ts +16 -0
- package/dist/core/compaction/active-context.js +20 -0
- package/dist/core/compaction/active-context.js.map +1 -0
- package/dist/core/compaction/compactor.d.ts +281 -0
- package/dist/core/compaction/compactor.js +1451 -0
- package/dist/core/compaction/compactor.js.map +1 -0
- package/dist/core/compaction/plan-step-policy.d.ts +46 -0
- package/dist/core/compaction/plan-step-policy.js +57 -0
- package/dist/core/compaction/plan-step-policy.js.map +1 -0
- package/dist/core/compaction/policy.d.ts +36 -0
- package/dist/core/compaction/policy.js +144 -0
- package/dist/core/compaction/policy.js.map +1 -0
- package/dist/core/compaction/query-aware-selector.d.ts +32 -0
- package/dist/core/compaction/query-aware-selector.js +202 -0
- package/dist/core/compaction/query-aware-selector.js.map +1 -0
- package/dist/core/compaction/token-estimator.d.ts +36 -0
- package/dist/core/compaction/token-estimator.js +180 -0
- package/dist/core/compaction/token-estimator.js.map +1 -0
- package/dist/core/compaction/tool-result-pruner.d.ts +90 -0
- package/dist/core/compaction/tool-result-pruner.js +238 -0
- package/dist/core/compaction/tool-result-pruner.js.map +1 -0
- package/dist/core/completion-review.d.ts +24 -0
- package/dist/core/completion-review.js +2 -0
- package/dist/core/completion-review.js.map +1 -0
- package/dist/core/context-files.d.ts +8 -0
- package/dist/core/context-files.js +46 -0
- package/dist/core/context-files.js.map +1 -0
- package/dist/core/context-limits.d.ts +40 -0
- package/dist/core/context-limits.js +43 -0
- package/dist/core/context-limits.js.map +1 -0
- package/dist/core/custom-commands.d.ts +18 -0
- package/dist/core/custom-commands.js +57 -0
- package/dist/core/custom-commands.js.map +1 -0
- package/dist/core/destructive-git-guard.d.ts +113 -0
- package/dist/core/destructive-git-guard.js +874 -0
- package/dist/core/destructive-git-guard.js.map +1 -0
- package/dist/core/display-items.d.ts +8 -0
- package/dist/core/display-items.js +2 -0
- package/dist/core/display-items.js.map +1 -0
- package/dist/core/encode-cwd.d.ts +41 -0
- package/dist/core/encode-cwd.js +53 -0
- package/dist/core/encode-cwd.js.map +1 -0
- package/dist/core/env-delta.d.ts +34 -0
- package/dist/core/env-delta.js +84 -0
- package/dist/core/env-delta.js.map +1 -0
- package/dist/core/event-bus.d.ts +178 -0
- package/dist/core/event-bus.js +171 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +7 -0
- package/dist/core/extensions/loader.js +68 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/plugin-bundles.d.ts +13 -0
- package/dist/core/extensions/plugin-bundles.js +45 -0
- package/dist/core/extensions/plugin-bundles.js.map +1 -0
- package/dist/core/extensions/types.d.ts +18 -0
- package/dist/core/extensions/types.js +2 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/foreign-session-import.d.ts +119 -0
- package/dist/core/foreign-session-import.js +598 -0
- package/dist/core/foreign-session-import.js.map +1 -0
- package/dist/core/foreign-transcript-blocks.d.ts +50 -0
- package/dist/core/foreign-transcript-blocks.js +151 -0
- package/dist/core/foreign-transcript-blocks.js.map +1 -0
- package/dist/core/frontmatter.d.ts +22 -0
- package/dist/core/frontmatter.js +90 -0
- package/dist/core/frontmatter.js.map +1 -0
- package/dist/core/goal-run-marker.d.ts +32 -0
- package/dist/core/goal-run-marker.js +178 -0
- package/dist/core/goal-run-marker.js.map +1 -0
- package/dist/core/goal-summary.d.ts +15 -0
- package/dist/core/goal-summary.js +110 -0
- package/dist/core/goal-summary.js.map +1 -0
- package/dist/core/goals-store.d.ts +208 -0
- package/dist/core/goals-store.js +577 -0
- package/dist/core/goals-store.js.map +1 -0
- package/dist/core/hashline.d.ts +51 -0
- package/dist/core/hashline.js +76 -0
- package/dist/core/hashline.js.map +1 -0
- package/dist/core/idle-wake.d.ts +62 -0
- package/dist/core/idle-wake.js +103 -0
- package/dist/core/idle-wake.js.map +1 -0
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.js +15 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/injection-detect.d.ts +39 -0
- package/dist/core/injection-detect.js +241 -0
- package/dist/core/injection-detect.js.map +1 -0
- package/dist/core/installed-threats.d.ts +23 -0
- package/dist/core/installed-threats.js +71 -0
- package/dist/core/installed-threats.js.map +1 -0
- package/dist/core/internal-diagnostics.d.ts +159 -0
- package/dist/core/internal-diagnostics.js +495 -0
- package/dist/core/internal-diagnostics.js.map +1 -0
- package/dist/core/keep-awake.d.ts +88 -0
- package/dist/core/keep-awake.js +251 -0
- package/dist/core/keep-awake.js.map +1 -0
- package/dist/core/ken-ask-answer.d.ts +24 -0
- package/dist/core/ken-ask-answer.js +96 -0
- package/dist/core/ken-ask-answer.js.map +1 -0
- package/dist/core/ken-context.d.ts +119 -0
- package/dist/core/ken-context.js +447 -0
- package/dist/core/ken-context.js.map +1 -0
- package/dist/core/ken-model.d.ts +45 -0
- package/dist/core/ken-model.js +26 -0
- package/dist/core/ken-model.js.map +1 -0
- package/dist/core/ken-prompt.d.ts +21 -0
- package/dist/core/ken-prompt.js +370 -0
- package/dist/core/ken-prompt.js.map +1 -0
- package/dist/core/language-detector.d.ts +41 -0
- package/dist/core/language-detector.js +293 -0
- package/dist/core/language-detector.js.map +1 -0
- package/dist/core/live-preview.d.ts +26 -0
- package/dist/core/live-preview.js +80 -0
- package/dist/core/live-preview.js.map +1 -0
- package/dist/core/local-endpoint-store.d.ts +53 -0
- package/dist/core/local-endpoint-store.js +221 -0
- package/dist/core/local-endpoint-store.js.map +1 -0
- package/dist/core/logger.d.ts +21 -0
- package/dist/core/logger.js +94 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/loop-breaker.d.ts +89 -0
- package/dist/core/loop-breaker.js +204 -0
- package/dist/core/loop-breaker.js.map +1 -0
- package/dist/core/lsp/client.d.ts +206 -0
- package/dist/core/lsp/client.js +685 -0
- package/dist/core/lsp/client.js.map +1 -0
- package/dist/core/lsp/edit-telemetry.d.ts +26 -0
- package/dist/core/lsp/edit-telemetry.js +52 -0
- package/dist/core/lsp/edit-telemetry.js.map +1 -0
- package/dist/core/lsp/format.d.ts +11 -0
- package/dist/core/lsp/format.js +30 -0
- package/dist/core/lsp/format.js.map +1 -0
- package/dist/core/lsp/jsonrpc.d.ts +68 -0
- package/dist/core/lsp/jsonrpc.js +153 -0
- package/dist/core/lsp/jsonrpc.js.map +1 -0
- package/dist/core/lsp/manager.d.ts +188 -0
- package/dist/core/lsp/manager.js +576 -0
- package/dist/core/lsp/manager.js.map +1 -0
- package/dist/core/lsp/pool.d.ts +114 -0
- package/dist/core/lsp/pool.js +259 -0
- package/dist/core/lsp/pool.js.map +1 -0
- package/dist/core/lsp/project-root.d.ts +9 -0
- package/dist/core/lsp/project-root.js +75 -0
- package/dist/core/lsp/project-root.js.map +1 -0
- package/dist/core/lsp/reference-project.d.ts +6 -0
- package/dist/core/lsp/reference-project.js +110 -0
- package/dist/core/lsp/reference-project.js.map +1 -0
- package/dist/core/lsp/servers.d.ts +44 -0
- package/dist/core/lsp/servers.js +289 -0
- package/dist/core/lsp/servers.js.map +1 -0
- package/dist/core/lsp/test-support.d.ts +17 -0
- package/dist/core/lsp/test-support.js +27 -0
- package/dist/core/lsp/test-support.js.map +1 -0
- package/dist/core/mcp/catalog-cache.d.ts +64 -0
- package/dist/core/mcp/catalog-cache.js +166 -0
- package/dist/core/mcp/catalog-cache.js.map +1 -0
- package/dist/core/mcp/client.d.ts +317 -0
- package/dist/core/mcp/client.js +1168 -0
- package/dist/core/mcp/client.js.map +1 -0
- package/dist/core/mcp/content.d.ts +23 -0
- package/dist/core/mcp/content.js +194 -0
- package/dist/core/mcp/content.js.map +1 -0
- package/dist/core/mcp/defaults.d.ts +26 -0
- package/dist/core/mcp/defaults.js +81 -0
- package/dist/core/mcp/defaults.js.map +1 -0
- package/dist/core/mcp/deferred-catalog.d.ts +53 -0
- package/dist/core/mcp/deferred-catalog.js +117 -0
- package/dist/core/mcp/deferred-catalog.js.map +1 -0
- package/dist/core/mcp/elicitation-bridge.d.ts +40 -0
- package/dist/core/mcp/elicitation-bridge.js +36 -0
- package/dist/core/mcp/elicitation-bridge.js.map +1 -0
- package/dist/core/mcp/index.d.ts +16 -0
- package/dist/core/mcp/index.js +10 -0
- package/dist/core/mcp/index.js.map +1 -0
- package/dist/core/mcp/loopback.d.ts +26 -0
- package/dist/core/mcp/loopback.js +66 -0
- package/dist/core/mcp/loopback.js.map +1 -0
- package/dist/core/mcp/oauth-provider.d.ts +55 -0
- package/dist/core/mcp/oauth-provider.js +106 -0
- package/dist/core/mcp/oauth-provider.js.map +1 -0
- package/dist/core/mcp/oauth-store.d.ts +44 -0
- package/dist/core/mcp/oauth-store.js +76 -0
- package/dist/core/mcp/oauth-store.js.map +1 -0
- package/dist/core/mcp/parse-add-command.d.ts +50 -0
- package/dist/core/mcp/parse-add-command.js +391 -0
- package/dist/core/mcp/parse-add-command.js.map +1 -0
- package/dist/core/mcp/resolve-stdio.d.ts +77 -0
- package/dist/core/mcp/resolve-stdio.js +359 -0
- package/dist/core/mcp/resolve-stdio.js.map +1 -0
- package/dist/core/mcp/shared-pool.d.ts +157 -0
- package/dist/core/mcp/shared-pool.js +236 -0
- package/dist/core/mcp/shared-pool.js.map +1 -0
- package/dist/core/mcp/store.d.ts +100 -0
- package/dist/core/mcp/store.js +202 -0
- package/dist/core/mcp/store.js.map +1 -0
- package/dist/core/mcp/tool-guard.d.ts +58 -0
- package/dist/core/mcp/tool-guard.js +215 -0
- package/dist/core/mcp/tool-guard.js.map +1 -0
- package/dist/core/mcp/types.d.ts +57 -0
- package/dist/core/mcp/types.js +2 -0
- package/dist/core/mcp/types.js.map +1 -0
- package/dist/core/message-images.d.ts +11 -0
- package/dist/core/message-images.js +52 -0
- package/dist/core/message-images.js.map +1 -0
- package/dist/core/model-unavailable.d.ts +14 -0
- package/dist/core/model-unavailable.js +23 -0
- package/dist/core/model-unavailable.js.map +1 -0
- package/dist/core/network-guard.d.ts +28 -0
- package/dist/core/network-guard.js +251 -0
- package/dist/core/network-guard.js.map +1 -0
- package/dist/core/node-debugger.d.ts +148 -0
- package/dist/core/node-debugger.js +642 -0
- package/dist/core/node-debugger.js.map +1 -0
- package/dist/core/opencode-catalog-store.d.ts +20 -0
- package/dist/core/opencode-catalog-store.js +82 -0
- package/dist/core/opencode-catalog-store.js.map +1 -0
- package/dist/core/openrouter-catalog-store.d.ts +24 -0
- package/dist/core/openrouter-catalog-store.js +140 -0
- package/dist/core/openrouter-catalog-store.js.map +1 -0
- package/dist/core/package-cooldown.d.ts +69 -0
- package/dist/core/package-cooldown.js +297 -0
- package/dist/core/package-cooldown.js.map +1 -0
- package/dist/core/package-threats.d.ts +92 -0
- package/dist/core/package-threats.js +1339 -0
- package/dist/core/package-threats.js.map +1 -0
- package/dist/core/parked-requests.d.ts +43 -0
- package/dist/core/parked-requests.js +34 -0
- package/dist/core/parked-requests.js.map +1 -0
- package/dist/core/persistent-shell.d.ts +81 -0
- package/dist/core/persistent-shell.js +452 -0
- package/dist/core/persistent-shell.js.map +1 -0
- package/dist/core/plan-delta.d.ts +23 -0
- package/dist/core/plan-delta.js +36 -0
- package/dist/core/plan-delta.js.map +1 -0
- package/dist/core/plan-handoff.d.ts +38 -0
- package/dist/core/plan-handoff.js +21 -0
- package/dist/core/plan-handoff.js.map +1 -0
- package/dist/core/plan-submission-gate.d.ts +28 -0
- package/dist/core/plan-submission-gate.js +27 -0
- package/dist/core/plan-submission-gate.js.map +1 -0
- package/dist/core/platform-clis.d.ts +15 -0
- package/dist/core/platform-clis.js +299 -0
- package/dist/core/platform-clis.js.map +1 -0
- package/dist/core/process-gate.d.ts +61 -0
- package/dist/core/process-gate.js +103 -0
- package/dist/core/process-gate.js.map +1 -0
- package/dist/core/process-manager.d.ts +242 -0
- package/dist/core/process-manager.js +902 -0
- package/dist/core/process-manager.js.map +1 -0
- package/dist/core/progress/engine.d.ts +22 -0
- package/dist/core/progress/engine.js +131 -0
- package/dist/core/progress/engine.js.map +1 -0
- package/dist/core/progress/git-xp.d.ts +15 -0
- package/dist/core/progress/git-xp.js +100 -0
- package/dist/core/progress/git-xp.js.map +1 -0
- package/dist/core/progress/ranks.d.ts +31 -0
- package/dist/core/progress/ranks.js +310 -0
- package/dist/core/progress/ranks.js.map +1 -0
- package/dist/core/progress/rebuild.d.ts +8 -0
- package/dist/core/progress/rebuild.js +125 -0
- package/dist/core/progress/rebuild.js.map +1 -0
- package/dist/core/progress/store.d.ts +34 -0
- package/dist/core/progress/store.js +200 -0
- package/dist/core/progress/store.js.map +1 -0
- package/dist/core/progress/types.d.ts +56 -0
- package/dist/core/progress/types.js +2 -0
- package/dist/core/progress/types.js.map +1 -0
- package/dist/core/project-discovery.d.ts +64 -0
- package/dist/core/project-discovery.js +908 -0
- package/dist/core/project-discovery.js.map +1 -0
- package/dist/core/project-files.d.ts +15 -0
- package/dist/core/project-files.js +37 -0
- package/dist/core/project-files.js.map +1 -0
- package/dist/core/project-health-scan.d.ts +109 -0
- package/dist/core/project-health-scan.js +673 -0
- package/dist/core/project-health-scan.js.map +1 -0
- package/dist/core/project-health-score.d.ts +41 -0
- package/dist/core/project-health-score.js +257 -0
- package/dist/core/project-health-score.js.map +1 -0
- package/dist/core/prompt-command-expansion.d.ts +13 -0
- package/dist/core/prompt-command-expansion.js +48 -0
- package/dist/core/prompt-command-expansion.js.map +1 -0
- package/dist/core/prompt-commands.d.ts +13 -0
- package/dist/core/prompt-commands.js +370 -0
- package/dist/core/prompt-commands.js.map +1 -0
- package/dist/core/pull-requests.d.ts +18 -0
- package/dist/core/pull-requests.js +95 -0
- package/dist/core/pull-requests.js.map +1 -0
- package/dist/core/radio-players.d.ts +28 -0
- package/dist/core/radio-players.js +132 -0
- package/dist/core/radio-players.js.map +1 -0
- package/dist/core/radio.d.ts +42 -0
- package/dist/core/radio.js +499 -0
- package/dist/core/radio.js.map +1 -0
- package/dist/core/regrounding.d.ts +37 -0
- package/dist/core/regrounding.js +89 -0
- package/dist/core/regrounding.js.map +1 -0
- package/dist/core/resolve-start.d.ts +28 -0
- package/dist/core/resolve-start.js +35 -0
- package/dist/core/resolve-start.js.map +1 -0
- package/dist/core/run-claim.d.ts +36 -0
- package/dist/core/run-claim.js +46 -0
- package/dist/core/run-claim.js.map +1 -0
- package/dist/core/run-lifecycle.d.ts +58 -0
- package/dist/core/run-lifecycle.js +104 -0
- package/dist/core/run-lifecycle.js.map +1 -0
- package/dist/core/run-status.d.ts +17 -0
- package/dist/core/run-status.js +28 -0
- package/dist/core/run-status.js.map +1 -0
- package/dist/core/runtime-mode.d.ts +21 -0
- package/dist/core/runtime-mode.js +43 -0
- package/dist/core/runtime-mode.js.map +1 -0
- package/dist/core/sandbox-domains.d.ts +13 -0
- package/dist/core/sandbox-domains.js +76 -0
- package/dist/core/sandbox-domains.js.map +1 -0
- package/dist/core/sandbox-feedback.d.ts +21 -0
- package/dist/core/sandbox-feedback.js +69 -0
- package/dist/core/sandbox-feedback.js.map +1 -0
- package/dist/core/sandbox.d.ts +106 -0
- package/dist/core/sandbox.js +383 -0
- package/dist/core/sandbox.js.map +1 -0
- package/dist/core/semantic-loop-check.d.ts +58 -0
- package/dist/core/semantic-loop-check.js +103 -0
- package/dist/core/semantic-loop-check.js.map +1 -0
- package/dist/core/session-compaction.d.ts +23 -0
- package/dist/core/session-compaction.js +54 -0
- package/dist/core/session-compaction.js.map +1 -0
- package/dist/core/session-export.d.ts +97 -0
- package/dist/core/session-export.js +368 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-history.d.ts +160 -0
- package/dist/core/session-history.js +467 -0
- package/dist/core/session-history.js.map +1 -0
- package/dist/core/session-manager.d.ts +512 -0
- package/dist/core/session-manager.js +1370 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/session-preview.d.ts +12 -0
- package/dist/core/session-preview.js +58 -0
- package/dist/core/session-preview.js.map +1 -0
- package/dist/core/session-storage.d.ts +78 -0
- package/dist/core/session-storage.js +659 -0
- package/dist/core/session-storage.js.map +1 -0
- package/dist/core/session-summary-index.d.ts +51 -0
- package/dist/core/session-summary-index.js +192 -0
- package/dist/core/session-summary-index.js.map +1 -0
- package/dist/core/settings-manager.d.ts +113 -0
- package/dist/core/settings-manager.js +281 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/shared-checkout-guard.d.ts +78 -0
- package/dist/core/shared-checkout-guard.js +219 -0
- package/dist/core/shared-checkout-guard.js.map +1 -0
- package/dist/core/shell-path.d.ts +13 -0
- package/dist/core/shell-path.js +175 -0
- package/dist/core/shell-path.js.map +1 -0
- package/dist/core/shell-threats-popular-packages.d.ts +11 -0
- package/dist/core/shell-threats-popular-packages.js +675 -0
- package/dist/core/shell-threats-popular-packages.js.map +1 -0
- package/dist/core/shell-threats.d.ts +21 -0
- package/dist/core/shell-threats.js +235 -0
- package/dist/core/shell-threats.js.map +1 -0
- package/dist/core/shell.d.ts +54 -0
- package/dist/core/shell.js +99 -0
- package/dist/core/shell.js.map +1 -0
- package/dist/core/shutdown.d.ts +70 -0
- package/dist/core/shutdown.js +144 -0
- package/dist/core/shutdown.js.map +1 -0
- package/dist/core/skill-scan.d.ts +112 -0
- package/dist/core/skill-scan.js +781 -0
- package/dist/core/skill-scan.js.map +1 -0
- package/dist/core/skills.d.ts +80 -0
- package/dist/core/skills.js +270 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +58 -0
- package/dist/core/slash-commands.js +242 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/steering.d.ts +47 -0
- package/dist/core/steering.js +65 -0
- package/dist/core/steering.js.map +1 -0
- package/dist/core/steroids.d.ts +66 -0
- package/dist/core/steroids.js +243 -0
- package/dist/core/steroids.js.map +1 -0
- package/dist/core/stream-diag-level.d.ts +3 -0
- package/dist/core/stream-diag-level.js +24 -0
- package/dist/core/stream-diag-level.js.map +1 -0
- package/dist/core/stream-rules.d.ts +30 -0
- package/dist/core/stream-rules.js +151 -0
- package/dist/core/stream-rules.js.map +1 -0
- package/dist/core/subagent-manager.d.ts +242 -0
- package/dist/core/subagent-manager.js +1075 -0
- package/dist/core/subagent-manager.js.map +1 -0
- package/dist/core/subagent-policy.d.ts +9 -0
- package/dist/core/subagent-policy.js +41 -0
- package/dist/core/subagent-policy.js.map +1 -0
- package/dist/core/subagent-receipt.d.ts +54 -0
- package/dist/core/subagent-receipt.js +274 -0
- package/dist/core/subagent-receipt.js.map +1 -0
- package/dist/core/subagent-store.d.ts +41 -0
- package/dist/core/subagent-store.js +284 -0
- package/dist/core/subagent-store.js.map +1 -0
- package/dist/core/subagent-turn-record.d.ts +18 -0
- package/dist/core/subagent-turn-record.js +82 -0
- package/dist/core/subagent-turn-record.js.map +1 -0
- package/dist/core/tasks-store.d.ts +31 -0
- package/dist/core/tasks-store.js +97 -0
- package/dist/core/tasks-store.js.map +1 -0
- package/dist/core/telegram-config.d.ts +20 -0
- package/dist/core/telegram-config.js +52 -0
- package/dist/core/telegram-config.js.map +1 -0
- package/dist/core/telegram.d.ts +114 -0
- package/dist/core/telegram.js +275 -0
- package/dist/core/telegram.js.map +1 -0
- package/dist/core/temp-paths.d.ts +5 -0
- package/dist/core/temp-paths.js +50 -0
- package/dist/core/temp-paths.js.map +1 -0
- package/dist/core/test-impact.d.ts +73 -0
- package/dist/core/test-impact.js +467 -0
- package/dist/core/test-impact.js.map +1 -0
- package/dist/core/threat-feed.d.ts +65 -0
- package/dist/core/threat-feed.js +334 -0
- package/dist/core/threat-feed.js.map +1 -0
- package/dist/core/trophies/catalog-more.d.ts +2 -0
- package/dist/core/trophies/catalog-more.js +837 -0
- package/dist/core/trophies/catalog-more.js.map +1 -0
- package/dist/core/trophies/catalog.d.ts +4 -0
- package/dist/core/trophies/catalog.js +649 -0
- package/dist/core/trophies/catalog.js.map +1 -0
- package/dist/core/trophies/engine.d.ts +70 -0
- package/dist/core/trophies/engine.js +347 -0
- package/dist/core/trophies/engine.js.map +1 -0
- package/dist/core/trophies/store.d.ts +17 -0
- package/dist/core/trophies/store.js +113 -0
- package/dist/core/trophies/store.js.map +1 -0
- package/dist/core/trophies/types.d.ts +87 -0
- package/dist/core/trophies/types.js +74 -0
- package/dist/core/trophies/types.js.map +1 -0
- package/dist/core/ui-adoption.d.ts +32 -0
- package/dist/core/ui-adoption.js +302 -0
- package/dist/core/ui-adoption.js.map +1 -0
- package/dist/core/ui-compatibility.d.ts +10 -0
- package/dist/core/ui-compatibility.js +51 -0
- package/dist/core/ui-compatibility.js.map +1 -0
- package/dist/core/ui-registry.d.ts +101 -0
- package/dist/core/ui-registry.js +292 -0
- package/dist/core/ui-registry.js.map +1 -0
- package/dist/core/user-shell-context.d.ts +8 -0
- package/dist/core/user-shell-context.js +12 -0
- package/dist/core/user-shell-context.js.map +1 -0
- package/dist/core/verification-evidence.d.ts +49 -0
- package/dist/core/verification-evidence.js +816 -0
- package/dist/core/verification-evidence.js.map +1 -0
- package/dist/core/verification-gate.d.ts +77 -0
- package/dist/core/verification-gate.js +504 -0
- package/dist/core/verification-gate.js.map +1 -0
- package/dist/core/verification-snapshot.d.ts +7 -0
- package/dist/core/verification-snapshot.js +109 -0
- package/dist/core/verification-snapshot.js.map +1 -0
- package/dist/core/verify-commands.d.ts +34 -0
- package/dist/core/verify-commands.js +203 -0
- package/dist/core/verify-commands.js.map +1 -0
- package/dist/core/voice-transcriber.d.ts +32 -0
- package/dist/core/voice-transcriber.js +114 -0
- package/dist/core/voice-transcriber.js.map +1 -0
- package/dist/core/workspace-guard.d.ts +56 -0
- package/dist/core/workspace-guard.js +334 -0
- package/dist/core/workspace-guard.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/session.d.ts +44 -0
- package/dist/session.js +105 -0
- package/dist/session.js.map +1 -0
- package/dist/system-prompt.d.ts +104 -0
- package/dist/system-prompt.js +480 -0
- package/dist/system-prompt.js.map +1 -0
- package/dist/test-support/fake-home.d.ts +19 -0
- package/dist/test-support/fake-home.js +37 -0
- package/dist/test-support/fake-home.js.map +1 -0
- package/dist/test-support/keep-alive.d.ts +14 -0
- package/dist/test-support/keep-alive.js +17 -0
- package/dist/test-support/keep-alive.js.map +1 -0
- package/dist/test-support/slow-git.d.ts +1 -0
- package/dist/test-support/slow-git.js +21 -0
- package/dist/test-support/slow-git.js.map +1 -0
- package/dist/test-support/system-tools.d.ts +6 -0
- package/dist/test-support/system-tools.js +36 -0
- package/dist/test-support/system-tools.js.map +1 -0
- package/dist/tools/ask-user.d.ts +34 -0
- package/dist/tools/ask-user.js +99 -0
- package/dist/tools/ask-user.js.map +1 -0
- package/dist/tools/background-watch-lint.d.ts +18 -0
- package/dist/tools/background-watch-lint.js +102 -0
- package/dist/tools/background-watch-lint.js.map +1 -0
- package/dist/tools/bash-read-evidence.d.ts +23 -0
- package/dist/tools/bash-read-evidence.js +180 -0
- package/dist/tools/bash-read-evidence.js.map +1 -0
- package/dist/tools/bash.d.ts +64 -0
- package/dist/tools/bash.js +552 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/browser-api.d.ts +27 -0
- package/dist/tools/browser-api.js +449 -0
- package/dist/tools/browser-api.js.map +1 -0
- package/dist/tools/browser-sandbox.d.ts +16 -0
- package/dist/tools/browser-sandbox.js +158 -0
- package/dist/tools/browser-sandbox.js.map +1 -0
- package/dist/tools/browser-session.d.ts +84 -0
- package/dist/tools/browser-session.js +304 -0
- package/dist/tools/browser-session.js.map +1 -0
- package/dist/tools/browser-snapshot.d.ts +19 -0
- package/dist/tools/browser-snapshot.js +109 -0
- package/dist/tools/browser-snapshot.js.map +1 -0
- package/dist/tools/browser.d.ts +11 -0
- package/dist/tools/browser.js +106 -0
- package/dist/tools/browser.js.map +1 -0
- package/dist/tools/checklist.d.ts +49 -0
- package/dist/tools/checklist.js +154 -0
- package/dist/tools/checklist.js.map +1 -0
- package/dist/tools/compress.d.ts +56 -0
- package/dist/tools/compress.js +226 -0
- package/dist/tools/compress.js.map +1 -0
- package/dist/tools/debug.d.ts +54 -0
- package/dist/tools/debug.js +230 -0
- package/dist/tools/debug.js.map +1 -0
- package/dist/tools/document-text.d.ts +6 -0
- package/dist/tools/document-text.js +154 -0
- package/dist/tools/document-text.js.map +1 -0
- package/dist/tools/edit-diff.d.ts +123 -0
- package/dist/tools/edit-diff.js +476 -0
- package/dist/tools/edit-diff.js.map +1 -0
- package/dist/tools/edit-targets.d.ts +10 -0
- package/dist/tools/edit-targets.js +31 -0
- package/dist/tools/edit-targets.js.map +1 -0
- package/dist/tools/edit.d.ts +38 -0
- package/dist/tools/edit.js +695 -0
- package/dist/tools/edit.js.map +1 -0
- package/dist/tools/enter-plan.d.ts +7 -0
- package/dist/tools/enter-plan.js +20 -0
- package/dist/tools/enter-plan.js.map +1 -0
- package/dist/tools/exit-plan.d.ts +7 -0
- package/dist/tools/exit-plan.js +51 -0
- package/dist/tools/exit-plan.js.map +1 -0
- package/dist/tools/find.d.ts +17 -0
- package/dist/tools/find.js +100 -0
- package/dist/tools/find.js.map +1 -0
- package/dist/tools/generate-image.d.ts +83 -0
- package/dist/tools/generate-image.js +625 -0
- package/dist/tools/generate-image.js.map +1 -0
- package/dist/tools/grep-scan.d.ts +96 -0
- package/dist/tools/grep-scan.js +283 -0
- package/dist/tools/grep-scan.js.map +1 -0
- package/dist/tools/grep.d.ts +48 -0
- package/dist/tools/grep.js +1013 -0
- package/dist/tools/grep.js.map +1 -0
- package/dist/tools/html-extract.d.ts +57 -0
- package/dist/tools/html-extract.js +130 -0
- package/dist/tools/html-extract.js.map +1 -0
- package/dist/tools/index.d.ts +198 -0
- package/dist/tools/index.js +216 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/live-preview.d.ts +23 -0
- package/dist/tools/live-preview.js +41 -0
- package/dist/tools/live-preview.js.map +1 -0
- package/dist/tools/ls.d.ts +9 -0
- package/dist/tools/ls.js +59 -0
- package/dist/tools/ls.js.map +1 -0
- package/dist/tools/operations.d.ts +86 -0
- package/dist/tools/operations.js +117 -0
- package/dist/tools/operations.js.map +1 -0
- package/dist/tools/overflow.d.ts +17 -0
- package/dist/tools/overflow.js +68 -0
- package/dist/tools/overflow.js.map +1 -0
- package/dist/tools/path-utils.d.ts +30 -0
- package/dist/tools/path-utils.js +74 -0
- package/dist/tools/path-utils.js.map +1 -0
- package/dist/tools/pdf-extract.d.ts +17 -0
- package/dist/tools/pdf-extract.js +43 -0
- package/dist/tools/pdf-extract.js.map +1 -0
- package/dist/tools/prompt-hints.d.ts +46 -0
- package/dist/tools/prompt-hints.js +171 -0
- package/dist/tools/prompt-hints.js.map +1 -0
- package/dist/tools/read-only-bash.d.ts +31 -0
- package/dist/tools/read-only-bash.js +338 -0
- package/dist/tools/read-only-bash.js.map +1 -0
- package/dist/tools/read-tracker.d.ts +43 -0
- package/dist/tools/read-tracker.js +120 -0
- package/dist/tools/read-tracker.js.map +1 -0
- package/dist/tools/read.d.ts +18 -0
- package/dist/tools/read.js +316 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/redaction-guard.d.ts +10 -0
- package/dist/tools/redaction-guard.js +55 -0
- package/dist/tools/redaction-guard.js.map +1 -0
- package/dist/tools/routine-output.d.ts +39 -0
- package/dist/tools/routine-output.js +281 -0
- package/dist/tools/routine-output.js.map +1 -0
- package/dist/tools/safe-env.d.ts +1 -0
- package/dist/tools/safe-env.js +79 -0
- package/dist/tools/safe-env.js.map +1 -0
- package/dist/tools/session-stats.d.ts +26 -0
- package/dist/tools/session-stats.js +51 -0
- package/dist/tools/session-stats.js.map +1 -0
- package/dist/tools/side-web-search.d.ts +34 -0
- package/dist/tools/side-web-search.js +146 -0
- package/dist/tools/side-web-search.js.map +1 -0
- package/dist/tools/skill.d.ts +12 -0
- package/dist/tools/skill.js +94 -0
- package/dist/tools/skill.js.map +1 -0
- package/dist/tools/source-path.d.ts +8 -0
- package/dist/tools/source-path.js +135 -0
- package/dist/tools/source-path.js.map +1 -0
- package/dist/tools/steroids.d.ts +44 -0
- package/dist/tools/steroids.js +356 -0
- package/dist/tools/steroids.js.map +1 -0
- package/dist/tools/subagent-control.d.ts +5 -0
- package/dist/tools/subagent-control.js +211 -0
- package/dist/tools/subagent-control.js.map +1 -0
- package/dist/tools/subagent-shared.d.ts +115 -0
- package/dist/tools/subagent-shared.js +182 -0
- package/dist/tools/subagent-shared.js.map +1 -0
- package/dist/tools/subagent.d.ts +39 -0
- package/dist/tools/subagent.js +412 -0
- package/dist/tools/subagent.js.map +1 -0
- package/dist/tools/task-output.d.ts +10 -0
- package/dist/tools/task-output.js +74 -0
- package/dist/tools/task-output.js.map +1 -0
- package/dist/tools/task-send.d.ts +11 -0
- package/dist/tools/task-send.js +36 -0
- package/dist/tools/task-send.js.map +1 -0
- package/dist/tools/task-stop.d.ts +8 -0
- package/dist/tools/task-stop.js +15 -0
- package/dist/tools/task-stop.js.map +1 -0
- package/dist/tools/tasks.d.ts +15 -0
- package/dist/tools/tasks.js +94 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/tool-search.d.ts +26 -0
- package/dist/tools/tool-search.js +81 -0
- package/dist/tools/tool-search.js.map +1 -0
- package/dist/tools/tool-tiers.d.ts +65 -0
- package/dist/tools/tool-tiers.js +121 -0
- package/dist/tools/tool-tiers.js.map +1 -0
- package/dist/tools/truncate.d.ts +39 -0
- package/dist/tools/truncate.js +242 -0
- package/dist/tools/truncate.js.map +1 -0
- package/dist/tools/ui-adopt.d.ts +16 -0
- package/dist/tools/ui-adopt.js +66 -0
- package/dist/tools/ui-adopt.js.map +1 -0
- package/dist/tools/ui-registry.d.ts +15 -0
- package/dist/tools/ui-registry.js +39 -0
- package/dist/tools/ui-registry.js.map +1 -0
- package/dist/tools/verification-review.d.ts +2 -0
- package/dist/tools/verification-review.js +41 -0
- package/dist/tools/verification-review.js.map +1 -0
- package/dist/tools/web-fetch.d.ts +52 -0
- package/dist/tools/web-fetch.js +986 -0
- package/dist/tools/web-fetch.js.map +1 -0
- package/dist/tools/web-search.d.ts +35 -0
- package/dist/tools/web-search.js +926 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/tools/write.d.ts +16 -0
- package/dist/tools/write.js +196 -0
- package/dist/tools/write.js.map +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/commit-message.d.ts +25 -0
- package/dist/utils/commit-message.js +72 -0
- package/dist/utils/commit-message.js.map +1 -0
- package/dist/utils/git.d.ts +102 -0
- package/dist/utils/git.js +325 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/github-ci.d.ts +9 -0
- package/dist/utils/github-ci.js +138 -0
- package/dist/utils/github-ci.js.map +1 -0
- package/dist/utils/github.d.ts +19 -0
- package/dist/utils/github.js +67 -0
- package/dist/utils/github.js.map +1 -0
- package/dist/utils/image.d.ts +166 -0
- package/dist/utils/image.js +673 -0
- package/dist/utils/image.js.map +1 -0
- package/dist/utils/open-browser.d.ts +13 -0
- package/dist/utils/open-browser.js +31 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/plan-steps.d.ts +90 -0
- package/dist/utils/plan-steps.js +209 -0
- package/dist/utils/plan-steps.js.map +1 -0
- package/dist/utils/process.d.ts +48 -0
- package/dist/utils/process.js +175 -0
- package/dist/utils/process.js.map +1 -0
- package/dist/utils/prompt-enhancer.d.ts +34 -0
- package/dist/utils/prompt-enhancer.js +178 -0
- package/dist/utils/prompt-enhancer.js.map +1 -0
- package/dist/utils/text.d.ts +61 -0
- package/dist/utils/text.js +68 -0
- package/dist/utils/text.js.map +1 -0
- package/package.json +87 -3
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default network allowlist for the OS command sandbox.
|
|
3
|
+
*
|
|
4
|
+
* The sandbox is allowlist-only (a bare `*` is rejected), so shipping it on by
|
|
5
|
+
* default is only viable if ordinary development still works untouched. These
|
|
6
|
+
* are the hosts mainstream toolchains actually contact for dependency
|
|
7
|
+
* resolution, source checkout and registry auth — nothing that reads user data.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately excluded: arbitrary app/API hosts, telemetry endpoints and
|
|
10
|
+
* URL shorteners. A project that needs one adds it once in Settings, which is
|
|
11
|
+
* the moment the boundary earns its keep.
|
|
12
|
+
*/
|
|
13
|
+
export const DEFAULT_ALLOWED_DOMAINS = [
|
|
14
|
+
// ── Source hosting (git clone/fetch/push over HTTPS) ──
|
|
15
|
+
"github.com",
|
|
16
|
+
"*.github.com",
|
|
17
|
+
"*.githubusercontent.com",
|
|
18
|
+
"gitlab.com",
|
|
19
|
+
"*.gitlab.com",
|
|
20
|
+
"bitbucket.org",
|
|
21
|
+
"*.bitbucket.org",
|
|
22
|
+
"codeberg.org",
|
|
23
|
+
// ── JavaScript ──
|
|
24
|
+
"registry.npmjs.org",
|
|
25
|
+
"*.npmjs.org",
|
|
26
|
+
"registry.yarnpkg.com",
|
|
27
|
+
"*.yarnpkg.com",
|
|
28
|
+
"jsr.io",
|
|
29
|
+
"deno.land",
|
|
30
|
+
"*.deno.land",
|
|
31
|
+
"unpkg.com",
|
|
32
|
+
"cdn.jsdelivr.net",
|
|
33
|
+
"*.jsdelivr.net",
|
|
34
|
+
"cdnjs.cloudflare.com",
|
|
35
|
+
// ── Python ──
|
|
36
|
+
"pypi.org",
|
|
37
|
+
"*.pypi.org",
|
|
38
|
+
"files.pythonhosted.org",
|
|
39
|
+
"*.pythonhosted.org",
|
|
40
|
+
// ── Go (module proxy + checksum database) ──
|
|
41
|
+
"proxy.golang.org",
|
|
42
|
+
"sum.golang.org",
|
|
43
|
+
"*.golang.org",
|
|
44
|
+
"storage.googleapis.com",
|
|
45
|
+
// ── Rust ──
|
|
46
|
+
"crates.io",
|
|
47
|
+
"*.crates.io",
|
|
48
|
+
"static.rust-lang.org",
|
|
49
|
+
"*.rust-lang.org",
|
|
50
|
+
// ── Ruby ──
|
|
51
|
+
"rubygems.org",
|
|
52
|
+
"*.rubygems.org",
|
|
53
|
+
// ── JVM ──
|
|
54
|
+
"repo1.maven.org",
|
|
55
|
+
"*.maven.org",
|
|
56
|
+
"repo.maven.apache.org",
|
|
57
|
+
"plugins.gradle.org",
|
|
58
|
+
"*.gradle.org",
|
|
59
|
+
// ── PHP ──
|
|
60
|
+
"packagist.org",
|
|
61
|
+
"*.packagist.org",
|
|
62
|
+
// ── .NET ──
|
|
63
|
+
"api.nuget.org",
|
|
64
|
+
"*.nuget.org",
|
|
65
|
+
// ── Containers ──
|
|
66
|
+
"docker.io",
|
|
67
|
+
"*.docker.io",
|
|
68
|
+
"*.docker.com",
|
|
69
|
+
"ghcr.io",
|
|
70
|
+
"quay.io",
|
|
71
|
+
"registry.k8s.io",
|
|
72
|
+
// ── macOS/Linux toolchain installers ──
|
|
73
|
+
"formulae.brew.sh",
|
|
74
|
+
"*.brew.sh",
|
|
75
|
+
];
|
|
76
|
+
//# sourceMappingURL=sandbox-domains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-domains.js","sourceRoot":"","sources":["../../src/core/sandbox-domains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,yDAAyD;IACzD,YAAY;IACZ,cAAc;IACd,yBAAyB;IACzB,YAAY;IACZ,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,cAAc;IAEd,mBAAmB;IACnB,oBAAoB;IACpB,aAAa;IACb,sBAAsB;IACtB,eAAe;IACf,QAAQ;IACR,WAAW;IACX,aAAa;IACb,WAAW;IACX,kBAAkB;IAClB,gBAAgB;IAChB,sBAAsB;IAEtB,eAAe;IACf,UAAU;IACV,YAAY;IACZ,wBAAwB;IACxB,oBAAoB;IAEpB,8CAA8C;IAC9C,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,wBAAwB;IAExB,aAAa;IACb,WAAW;IACX,aAAa;IACb,sBAAsB;IACtB,iBAAiB;IAEjB,aAAa;IACb,cAAc;IACd,gBAAgB;IAEhB,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,uBAAuB;IACvB,oBAAoB;IACpB,cAAc;IAEd,YAAY;IACZ,eAAe;IACf,iBAAiB;IAEjB,aAAa;IACb,eAAe;IACf,aAAa;IAEb,mBAAmB;IACnB,WAAW;IACX,aAAa;IACb,cAAc;IACd,SAAS;IACT,SAAS;IACT,iBAAiB;IAEjB,yCAAyC;IACzC,kBAAkB;IAClB,WAAW;CACZ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turn raw OS-sandbox denials into guidance the model can act on.
|
|
3
|
+
*
|
|
4
|
+
* A blocked command otherwise surfaces as inscrutable tool noise ("CONNECT
|
|
5
|
+
* tunnel failed, response 403", "Operation not permitted"), which the model
|
|
6
|
+
* tends to retry verbatim. Naming the boundary and the one-step fix is what
|
|
7
|
+
* turns a dead end into a recoverable turn.
|
|
8
|
+
*/
|
|
9
|
+
export interface SandboxDenialNote {
|
|
10
|
+
kind: "network" | "filesystem";
|
|
11
|
+
note: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Inspect finished command output for a sandbox denial.
|
|
15
|
+
*
|
|
16
|
+
* @param output Combined stdout/stderr as returned to the model.
|
|
17
|
+
* @param sandboxed Whether this command actually ran isolated.
|
|
18
|
+
*/
|
|
19
|
+
export declare function describeSandboxDenial(output: string, sandboxed: boolean): SandboxDenialNote | null;
|
|
20
|
+
/** Append the denial note to command output when one applies. */
|
|
21
|
+
export declare function annotateSandboxDenial(output: string, sandboxed: boolean): string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turn raw OS-sandbox denials into guidance the model can act on.
|
|
3
|
+
*
|
|
4
|
+
* A blocked command otherwise surfaces as inscrutable tool noise ("CONNECT
|
|
5
|
+
* tunnel failed, response 403", "Operation not permitted"), which the model
|
|
6
|
+
* tends to retry verbatim. Naming the boundary and the one-step fix is what
|
|
7
|
+
* turns a dead end into a recoverable turn.
|
|
8
|
+
*/
|
|
9
|
+
/** SRT's proxy rejection, plus how common clients report it. */
|
|
10
|
+
const NETWORK_DENIAL = [
|
|
11
|
+
"blocked-by-allowlist",
|
|
12
|
+
"Connection blocked by network allowlist",
|
|
13
|
+
"CONNECT tunnel failed, response 403",
|
|
14
|
+
];
|
|
15
|
+
const FILESYSTEM_DENIAL = ["Operation not permitted", "operation not permitted", "EPERM"];
|
|
16
|
+
/** Hosts the command tried to reach, best-effort, for a precise suggestion. */
|
|
17
|
+
function extractHosts(output) {
|
|
18
|
+
const hosts = new Set();
|
|
19
|
+
const patterns = [
|
|
20
|
+
/(?:CONNECT|to)\s+([a-z0-9.-]+\.[a-z]{2,})(?::\d+)?/gi,
|
|
21
|
+
/https?:\/\/([a-z0-9.-]+\.[a-z]{2,})/gi,
|
|
22
|
+
];
|
|
23
|
+
for (const pattern of patterns) {
|
|
24
|
+
for (const match of output.matchAll(pattern)) {
|
|
25
|
+
const host = match[1]?.toLowerCase();
|
|
26
|
+
if (host && !host.endsWith(".local"))
|
|
27
|
+
hosts.add(host);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return [...hosts].slice(0, 3);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Inspect finished command output for a sandbox denial.
|
|
34
|
+
*
|
|
35
|
+
* @param output Combined stdout/stderr as returned to the model.
|
|
36
|
+
* @param sandboxed Whether this command actually ran isolated.
|
|
37
|
+
*/
|
|
38
|
+
export function describeSandboxDenial(output, sandboxed) {
|
|
39
|
+
if (!sandboxed || !output)
|
|
40
|
+
return null;
|
|
41
|
+
if (NETWORK_DENIAL.some((marker) => output.includes(marker))) {
|
|
42
|
+
const hosts = extractHosts(output);
|
|
43
|
+
const target = hosts.length > 0 ? hosts.join(", ") : "that host";
|
|
44
|
+
return {
|
|
45
|
+
kind: "network",
|
|
46
|
+
note: `\n\n[Sandbox] Network blocked: ${target} is not an approved destination. ` +
|
|
47
|
+
`Common package registries and git hosts are approved already, so double-check the ` +
|
|
48
|
+
`address first. If the user genuinely needs it, ask them to add it under ` +
|
|
49
|
+
`Settings → Command safety → Approved sites (or turn command safety off).`,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (FILESYSTEM_DENIAL.some((marker) => output.includes(marker))) {
|
|
53
|
+
return {
|
|
54
|
+
kind: "filesystem",
|
|
55
|
+
note: `\n\n[Sandbox] Write blocked: that path is either outside this project or a ` +
|
|
56
|
+
`protected file (.env). Prefer a path inside the project, or use the write ` +
|
|
57
|
+
`tool if the user asked for that exact file. If they genuinely need shell ` +
|
|
58
|
+
`writes elsewhere, ask them to enable Settings → Command safety → Allow ` +
|
|
59
|
+
`changes outside the project.`,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
/** Append the denial note to command output when one applies. */
|
|
65
|
+
export function annotateSandboxDenial(output, sandboxed) {
|
|
66
|
+
const denial = describeSandboxDenial(output, sandboxed);
|
|
67
|
+
return denial ? `${output}${denial.note}` : output;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=sandbox-feedback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-feedback.js","sourceRoot":"","sources":["../../src/core/sandbox-feedback.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gEAAgE;AAChE,MAAM,cAAc,GAAG;IACrB,sBAAsB;IACtB,yCAAyC;IACzC,qCAAqC;CACtC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,yBAAyB,EAAE,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAE1F,+EAA+E;AAC/E,SAAS,YAAY,CAAC,MAAc;IAClC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,MAAM,QAAQ,GAAG;QACf,sDAAsD;QACtD,uCAAuC;KACxC,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;YACrC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAChC,CAAC;AAOD;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAc,EACd,SAAkB;IAElB,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEvC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAC7D,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QACjE,OAAO;YACL,IAAI,EAAE,SAAS;YACf,IAAI,EACF,kCAAkC,MAAM,mCAAmC;gBAC3E,oFAAoF;gBACpF,0EAA0E;gBAC1E,0EAA0E;SAC7E,CAAC;IACJ,CAAC;IAED,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAChE,OAAO;YACL,IAAI,EAAE,YAAY;YAClB,IAAI,EACF,6EAA6E;gBAC7E,4EAA4E;gBAC5E,2EAA2E;gBAC3E,yEAAyE;gBACzE,8BAA8B;SACjC,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,qBAAqB,CAAC,MAAc,EAAE,SAAkB;IACtE,MAAM,MAAM,GAAG,qBAAqB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ShellResolution } from "./shell.js";
|
|
2
|
+
export interface SandboxPolicy {
|
|
3
|
+
/**
|
|
4
|
+
* `workspace` always isolates and fails closed. `auto` isolates wherever the
|
|
5
|
+
* OS supports it and degrades with a warning where the prerequisites are
|
|
6
|
+
* absent, because SRT needs bubblewrap/socat on Linux and an elevated
|
|
7
|
+
* `windows-install` on Windows — enforcing there would break every command.
|
|
8
|
+
*/
|
|
9
|
+
mode: "auto" | "workspace" | "off";
|
|
10
|
+
/**
|
|
11
|
+
* Extra hosts reachable while sandboxed, on top of
|
|
12
|
+
* {@link DEFAULT_ALLOWED_DOMAINS} unless {@link strictDomains} is set.
|
|
13
|
+
*/
|
|
14
|
+
allowedDomains: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Use only {@link allowedDomains}, dropping the built-in developer defaults.
|
|
17
|
+
* Set when the user has explicitly taken over network policy.
|
|
18
|
+
*/
|
|
19
|
+
strictDomains?: boolean;
|
|
20
|
+
/** Extra workspace roots (multi-root sessions), mirroring the write guard. */
|
|
21
|
+
additionalRoots?: string[];
|
|
22
|
+
/** The user consented to writes outside the workspace; do not contradict them. */
|
|
23
|
+
allowOutsideWorkspaceWrites?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Unix socket paths sandboxed commands may open, e.g.
|
|
26
|
+
* `/var/run/docker.sock`. Empty by default — each entry is a hole straight
|
|
27
|
+
* through the sandbox (see {@link buildSandboxSettings}).
|
|
28
|
+
*/
|
|
29
|
+
allowUnixSockets?: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface SandboxLaunch extends ShellResolution {
|
|
32
|
+
sandboxed: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Environment applied only to sandboxed commands.
|
|
36
|
+
*
|
|
37
|
+
* The sandbox permanently protects `.git/hooks`, and git's only reason to write
|
|
38
|
+
* there is copying inert `*.sample` templates during `init`/`clone` — which
|
|
39
|
+
* fails the whole command. Pointing git at an empty template directory removes
|
|
40
|
+
* that write, so cloning works with hook protection fully intact.
|
|
41
|
+
*/
|
|
42
|
+
export declare const SANDBOX_ENV_PATCH: Readonly<Record<string, string>>;
|
|
43
|
+
interface SandboxSettings {
|
|
44
|
+
network: {
|
|
45
|
+
allowedDomains: string[];
|
|
46
|
+
deniedDomains: string[];
|
|
47
|
+
strictAllowlist: boolean;
|
|
48
|
+
allowUnixSockets: string[];
|
|
49
|
+
allowLocalBinding: boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* macOS only: let sandboxed processes reach `com.apple.trustd.agent`.
|
|
53
|
+
*
|
|
54
|
+
* Without it, every client that verifies certificates through Security
|
|
55
|
+
* framework fails — pip (truststore) and Go-based CLIs like gh, terraform
|
|
56
|
+
* and kubectl. We do not terminate TLS, so certificates are still validated
|
|
57
|
+
* against the real upstream and the domain allowlist still applies; this only
|
|
58
|
+
* restores certificate checking itself.
|
|
59
|
+
*/
|
|
60
|
+
enableWeakerNetworkIsolation?: boolean;
|
|
61
|
+
filesystem: {
|
|
62
|
+
denyRead: string[];
|
|
63
|
+
allowWrite: string[];
|
|
64
|
+
denyWrite: string[];
|
|
65
|
+
/** Git cannot initialise or clone a repository without writing its config. */
|
|
66
|
+
allowGitConfig: boolean;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface SandboxSupport {
|
|
70
|
+
supported: boolean;
|
|
71
|
+
reason: string;
|
|
72
|
+
/** Isolation started but is missing a control we promised; null when intact. */
|
|
73
|
+
degraded?: string | null;
|
|
74
|
+
}
|
|
75
|
+
/** Pure policy builder, exported so the security boundary is regression-tested. */
|
|
76
|
+
export declare function buildSandboxSettings(cwd: string, policy: SandboxPolicy, platform?: NodeJS.Platform): SandboxSettings;
|
|
77
|
+
export declare function resetSandboxSupportProbeForTests(seed?: SandboxSupport): void;
|
|
78
|
+
/**
|
|
79
|
+
* Known limitations when `sandboxMode` is enabled (upstream, not fixable here):
|
|
80
|
+
*
|
|
81
|
+
* - **Linux pipes/redirections**: `echo hi | grep hi` fails with "Permission
|
|
82
|
+
* denied" on /proc/self/fd/3 because bash's pipe setup clobbers the fd the
|
|
83
|
+
* seccomp filter arrives on (sandbox-runtime#261).
|
|
84
|
+
* - **git over SSH**: `git@host:` remotes fail the SOCKS handshake on macOS —
|
|
85
|
+
* the injected ProxyCommand uses `nc`, which cannot authenticate. HTTPS
|
|
86
|
+
* remotes work. `~/.ssh` is also unreadable by design.
|
|
87
|
+
* - **`git config --global`**: `~/.gitconfig` is a mandatory upstream write
|
|
88
|
+
* protection with no opt-out. Repo-local `git config` works.
|
|
89
|
+
* - **Corporate TLS interception / private registries**: need the CA and
|
|
90
|
+
* registry host configured explicitly.
|
|
91
|
+
* - **Ubuntu 24.04+**: AppArmor blocks the sandbox entirely, so `auto`
|
|
92
|
+
* degrades to no isolation (sandbox-runtime#428, #429).
|
|
93
|
+
* - **Loopback egress is unfiltered**: sandboxed commands can reach any local
|
|
94
|
+
* TCP port, because upstream ties that to port binding and dev servers need
|
|
95
|
+
* to bind. A service listening on localhost without authentication is
|
|
96
|
+
* reachable from sandboxed bash.
|
|
97
|
+
*
|
|
98
|
+
* These are why the default is `off`; revisit when fixed upstream.
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* Wrap an already-resolved shell with Anthropic's cross-platform OS sandbox.
|
|
102
|
+
* Initialization and dependency failures remain visible and fail closed: the
|
|
103
|
+
* original command is never spawned outside the sandbox as an implicit fallback.
|
|
104
|
+
*/
|
|
105
|
+
export declare function prepareSandboxLaunch(shell: ShellResolution, cwd: string, policy: SandboxPolicy): Promise<SandboxLaunch>;
|
|
106
|
+
export {};
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import fs from "node:fs/promises";
|
|
4
|
+
import { realpathSync } from "node:fs";
|
|
5
|
+
import os from "node:os";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { log } from "@kenkaiiii/gg-core";
|
|
9
|
+
import { getAppPaths } from "../config.js";
|
|
10
|
+
import { DEFAULT_ALLOWED_DOMAINS } from "./sandbox-domains.js";
|
|
11
|
+
import { getTempRoots } from "./temp-paths.js";
|
|
12
|
+
/**
|
|
13
|
+
* Environment applied only to sandboxed commands.
|
|
14
|
+
*
|
|
15
|
+
* The sandbox permanently protects `.git/hooks`, and git's only reason to write
|
|
16
|
+
* there is copying inert `*.sample` templates during `init`/`clone` — which
|
|
17
|
+
* fails the whole command. Pointing git at an empty template directory removes
|
|
18
|
+
* that write, so cloning works with hook protection fully intact.
|
|
19
|
+
*/
|
|
20
|
+
export const SANDBOX_ENV_PATCH = {
|
|
21
|
+
GIT_TEMPLATE_DIR: "",
|
|
22
|
+
};
|
|
23
|
+
const SANDBOX_CONFIG_DIR = path.join(os.homedir(), ".gg", "sandbox-configs");
|
|
24
|
+
const PROBE_TIMEOUT_MS = 20_000;
|
|
25
|
+
let warnedUnsupported = false;
|
|
26
|
+
let warnedDegraded = false;
|
|
27
|
+
/**
|
|
28
|
+
* Linux ships unix-socket blocking as a separate `apply-seccomp` helper, and
|
|
29
|
+
* when it is missing SRT continues with the filter silently dropped
|
|
30
|
+
* (linux-sandbox-utils.js:403 and :1118). The sandbox still starts, still
|
|
31
|
+
* reports success, and still filters the network — but a sandboxed process can
|
|
32
|
+
* open AF_UNIX sockets again, which is the Docker/SSH-agent socket back.
|
|
33
|
+
* `workspace` mode promises to fail closed, so it has to notice.
|
|
34
|
+
*/
|
|
35
|
+
const DEGRADED_ISOLATION = /seccomp[^\n]*not available|unix socket (?:blocking disabled|access not restricted)/i;
|
|
36
|
+
function sensitiveReadPaths(home) {
|
|
37
|
+
return [
|
|
38
|
+
path.join(home, ".ssh"),
|
|
39
|
+
path.join(home, ".aws"),
|
|
40
|
+
path.join(home, ".gnupg"),
|
|
41
|
+
path.join(home, ".kube"),
|
|
42
|
+
path.join(home, ".config", "gcloud"),
|
|
43
|
+
path.join(home, ".azure"),
|
|
44
|
+
path.join(home, ".gg", "auth.json"),
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Package-manager caches that live outside the workspace.
|
|
49
|
+
*
|
|
50
|
+
* `npm install`, `cargo build`, `go mod download` and friends all write to a
|
|
51
|
+
* shared cache in $HOME; without these the sandbox looks like it "breaks npm".
|
|
52
|
+
* Everything here is regenerable build state — no credentials, which stay
|
|
53
|
+
* unreadable via {@link sensitiveReadPaths}.
|
|
54
|
+
*/
|
|
55
|
+
function toolCacheDirs(home) {
|
|
56
|
+
return [
|
|
57
|
+
path.join(home, ".npm"),
|
|
58
|
+
path.join(home, ".cache"),
|
|
59
|
+
path.join(home, "Library", "Caches"),
|
|
60
|
+
path.join(home, ".pnpm-store"),
|
|
61
|
+
path.join(home, ".yarn"),
|
|
62
|
+
path.join(home, ".bun"),
|
|
63
|
+
path.join(home, ".deno"),
|
|
64
|
+
path.join(home, ".cargo"),
|
|
65
|
+
path.join(home, ".rustup"),
|
|
66
|
+
path.join(home, "go", "pkg", "mod"),
|
|
67
|
+
path.join(home, ".m2"),
|
|
68
|
+
path.join(home, ".gradle"),
|
|
69
|
+
path.join(home, ".gem"),
|
|
70
|
+
path.join(home, ".bundle"),
|
|
71
|
+
path.join(home, ".nuget"),
|
|
72
|
+
path.join(home, ".composer"),
|
|
73
|
+
path.join(home, ".local", "share", "virtualenvs"),
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A path plus its symlink-resolved twin.
|
|
78
|
+
*
|
|
79
|
+
* macOS resolves /tmp to /private/tmp and /var/folders to /private/var/folders.
|
|
80
|
+
* The sandbox matches on the real path, so listing only the symlink silently
|
|
81
|
+
* denies every write to the system temp directory.
|
|
82
|
+
*/
|
|
83
|
+
function withRealPath(target) {
|
|
84
|
+
try {
|
|
85
|
+
const real = realpathSync(target);
|
|
86
|
+
return real === target ? [target] : [target, real];
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return [target];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** `candidate` is `zone` or sits underneath it. */
|
|
93
|
+
function isInside(candidate, zone) {
|
|
94
|
+
return candidate === zone || candidate.startsWith(zone + path.sep);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Resolve one WRITE root, refusing to let a symlink widen our own authority.
|
|
98
|
+
*
|
|
99
|
+
* {@link withRealPath} grants write access to wherever a path resolves to. That
|
|
100
|
+
* is required for OS aliases (/tmp → /private/tmp) but is unsafe for roots the
|
|
101
|
+
* sandbox itself hands over to untrusted code: every {@link toolCacheDirs}
|
|
102
|
+
* entry is writable *by the sandboxed process*, so a command could delete one
|
|
103
|
+
* and leave a symlink behind (`rm -rf ~/.deno && ln -s / ~/.deno`). The next
|
|
104
|
+
* policy build would resolve that root to `/` and grant write access to the
|
|
105
|
+
* whole filesystem — a persistent escape that outlives the run that planted it.
|
|
106
|
+
*
|
|
107
|
+
* So a resolved root is only accepted while it stays inside a zone we already
|
|
108
|
+
* intended to expose. Anything else is an authority expansion rather than a
|
|
109
|
+
* path alias, and BOTH forms are dropped: keeping the symlink itself would
|
|
110
|
+
* still write through to the target. Losing a tool cache costs a slower
|
|
111
|
+
* install; keeping it can cost the machine.
|
|
112
|
+
*/
|
|
113
|
+
function safeWriteRoots(target, zones) {
|
|
114
|
+
let real;
|
|
115
|
+
try {
|
|
116
|
+
real = realpathSync(target);
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// Not created yet (common for tool caches) — nothing to resolve, and a
|
|
120
|
+
// path that does not exist cannot be pointing anywhere dangerous yet.
|
|
121
|
+
return [target];
|
|
122
|
+
}
|
|
123
|
+
if (real === target)
|
|
124
|
+
return [target];
|
|
125
|
+
if (!zones.some((zone) => isInside(real, zone))) {
|
|
126
|
+
log("WARN", "sandbox", "refusing write root that resolves outside the sandbox", {
|
|
127
|
+
target,
|
|
128
|
+
real,
|
|
129
|
+
});
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
132
|
+
return [target, real];
|
|
133
|
+
}
|
|
134
|
+
/** Pure policy builder, exported so the security boundary is regression-tested. */
|
|
135
|
+
export function buildSandboxSettings(cwd, policy, platform = process.platform) {
|
|
136
|
+
const workspace = path.resolve(cwd);
|
|
137
|
+
const tempRoots = getTempRoots(platform);
|
|
138
|
+
const home = os.homedir();
|
|
139
|
+
const allowedDomains = [
|
|
140
|
+
...new Set([...(policy.strictDomains ? [] : DEFAULT_ALLOWED_DOMAINS), ...policy.allowedDomains]
|
|
141
|
+
.map((host) => host.trim())
|
|
142
|
+
.filter(Boolean)),
|
|
143
|
+
].sort();
|
|
144
|
+
// Where a write root is allowed to LAND once symlinks are resolved. These are
|
|
145
|
+
// the areas we already intended to expose, so an alias inside them is just an
|
|
146
|
+
// alias; a root resolving anywhere else is an escape attempt (see
|
|
147
|
+
// safeWriteRoots). Anchors are themselves resolved so the comparison works on
|
|
148
|
+
// macOS, where the workspace and temp dir are usually reached via /var.
|
|
149
|
+
const writeZones = [
|
|
150
|
+
...new Set([
|
|
151
|
+
...tempRoots,
|
|
152
|
+
workspace,
|
|
153
|
+
...(policy.additionalRoots ?? []).map((root) => path.resolve(root)),
|
|
154
|
+
path.resolve(getAppPaths().agentDir),
|
|
155
|
+
// Only when the user opted in. Listing $HOME unconditionally would
|
|
156
|
+
// accept a tool cache repointed at ~/.ssh — writing authorized_keys is
|
|
157
|
+
// persistence, and this list governs WRITES, so the ~/.ssh READ denial
|
|
158
|
+
// below would not stop it.
|
|
159
|
+
...(policy.allowOutsideWorkspaceWrites ? [home] : []),
|
|
160
|
+
// NB: the macOS /private aliases need no entry of their own — each
|
|
161
|
+
// anchor above is expanded through withRealPath, so /var/folders/… and
|
|
162
|
+
// /private/var/folders/… are both already zones. Listing bare /private
|
|
163
|
+
// would be far wider than intended (it also holds /private/etc).
|
|
164
|
+
].flatMap(withRealPath)),
|
|
165
|
+
];
|
|
166
|
+
// Mirror resolveWriteGuard's roots. The sandbox must never be stricter than
|
|
167
|
+
// the write guard the user already controls, or bash silently loses
|
|
168
|
+
// multi-root workspaces and the documented outside-workspace opt-out.
|
|
169
|
+
const writeRoots = [
|
|
170
|
+
...new Set([
|
|
171
|
+
workspace,
|
|
172
|
+
...(policy.additionalRoots ?? []).map((root) => path.resolve(root)),
|
|
173
|
+
...tempRoots,
|
|
174
|
+
path.resolve(getAppPaths().agentDir),
|
|
175
|
+
...toolCacheDirs(home),
|
|
176
|
+
...(policy.allowOutsideWorkspaceWrites ? [home] : []),
|
|
177
|
+
].flatMap((target) => safeWriteRoots(target, writeZones))),
|
|
178
|
+
];
|
|
179
|
+
return {
|
|
180
|
+
network: {
|
|
181
|
+
allowedDomains,
|
|
182
|
+
deniedDomains: [],
|
|
183
|
+
strictAllowlist: true,
|
|
184
|
+
// Opt-in, and empty by default. Every entry is a full bypass of the
|
|
185
|
+
// isolation around it: `/var/run/docker.sock` is unauthenticated
|
|
186
|
+
// root-equivalent control of the host (mount / into a container and the
|
|
187
|
+
// workspace boundary is gone), and the SSH agent socket signs anything
|
|
188
|
+
// asked of it. The domain allowlist cannot see either — no TCP is
|
|
189
|
+
// involved. Users who need `docker` in sandboxed bash grant it here
|
|
190
|
+
// explicitly, rather than the sandbox quietly deciding for them.
|
|
191
|
+
//
|
|
192
|
+
// macOS only: on Linux/WSL2 SRT's seccomp filter blocks AF_UNIX by
|
|
193
|
+
// syscall and cannot inspect paths, so a per-path list is unenforceable
|
|
194
|
+
// there (it would need allowAllUnixSockets, which we do not expose).
|
|
195
|
+
allowUnixSockets: platform === "darwin" ? [...new Set(policy.allowUnixSockets ?? [])] : [],
|
|
196
|
+
// Always on, with no setting to turn it off.
|
|
197
|
+
//
|
|
198
|
+
// SRT couples three rules into this flag: network-bind, network-inbound
|
|
199
|
+
// and `(allow network-outbound (remote ip "localhost:*"))`
|
|
200
|
+
// (macos-sandbox-utils.js:473-477), with no per-port form. Dev servers,
|
|
201
|
+
// preview servers and the screenshot tool all bind loopback, so turning
|
|
202
|
+
// it off breaks everyday work outright.
|
|
203
|
+
//
|
|
204
|
+
// The egress half is a real hole only for someone running an
|
|
205
|
+
// unauthenticated service on a local TCP port — `docker` exposed on
|
|
206
|
+
// tcp://localhost:2375, a bare Ollama, a live `kubectl proxy`. That is
|
|
207
|
+
// rare and self-inflicted, and the common case is already covered: Docker
|
|
208
|
+
// listens on /var/run/docker.sock by default, which allowUnixSockets
|
|
209
|
+
// above keeps shut. A setting for the remainder would be one more knob
|
|
210
|
+
// nobody turns, breaking dev servers for whoever found it by accident.
|
|
211
|
+
//
|
|
212
|
+
// Linux is unaffected regardless: bwrap gives the sandbox its own network
|
|
213
|
+
// namespace, so its loopback is not the host's.
|
|
214
|
+
allowLocalBinding: true,
|
|
215
|
+
},
|
|
216
|
+
...(platform === "darwin" ? { enableWeakerNetworkIsolation: true } : {}),
|
|
217
|
+
filesystem: {
|
|
218
|
+
denyRead: sensitiveReadPaths(home),
|
|
219
|
+
// SRT adds its platform-required temporary paths; these are the only
|
|
220
|
+
// product-owned write roots supplied by GG Coder.
|
|
221
|
+
allowWrite: platform === "win32" ? writeRoots : [...writeRoots, "/dev/null"],
|
|
222
|
+
// `.git/hooks` is a mandatory sandbox protection with no opt-out, which
|
|
223
|
+
// is worth keeping: it stops a command installing a hook that later runs
|
|
224
|
+
// unsandboxed. `git clone`/`git init` only write there to copy inert
|
|
225
|
+
// `.sample` files, which SANDBOX_ENV_PATCH turns off.
|
|
226
|
+
//
|
|
227
|
+
// `.git/config` must be writable or `git init`, `git remote add` and
|
|
228
|
+
// `git clone` all fail outright.
|
|
229
|
+
allowGitConfig: true,
|
|
230
|
+
// Resolve the workspace first: on macOS the sandbox matches real paths, so
|
|
231
|
+
// a deny rule built from the symlinked path (/var/... vs /private/var/...)
|
|
232
|
+
// silently never matches.
|
|
233
|
+
denyWrite: withRealPath(workspace).flatMap((root) => [
|
|
234
|
+
path.join(root, ".env"),
|
|
235
|
+
path.join(root, ".env.local"),
|
|
236
|
+
]),
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
function resolveSandboxCli() {
|
|
241
|
+
const packageEntry = import.meta.resolve("@anthropic-ai/sandbox-runtime");
|
|
242
|
+
return path.join(path.dirname(fileURLToPath(packageEntry)), "cli.js");
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Does this machine actually support OS sandboxing? SRT reports missing
|
|
246
|
+
* bubblewrap/socat or an unprovisioned Windows sandbox user only when it
|
|
247
|
+
* initializes, so probe once per process with a trivial command instead of
|
|
248
|
+
* reimplementing its per-platform dependency matrix.
|
|
249
|
+
*/
|
|
250
|
+
let supportProbe = null;
|
|
251
|
+
export function resetSandboxSupportProbeForTests(seed) {
|
|
252
|
+
supportProbe = seed ? Promise.resolve(seed) : null;
|
|
253
|
+
warnedUnsupported = false;
|
|
254
|
+
warnedDegraded = false;
|
|
255
|
+
}
|
|
256
|
+
function probeSandboxSupport(settingsPath) {
|
|
257
|
+
supportProbe ??= new Promise((resolve) => {
|
|
258
|
+
let child;
|
|
259
|
+
try {
|
|
260
|
+
child = spawn(process.execPath, [resolveSandboxCli(), "--settings", settingsPath, "-c", "exit 0"], {
|
|
261
|
+
stdio: ["ignore", "ignore", "pipe"],
|
|
262
|
+
// SRT reports the dropped seccomp filter through its debug logger, so
|
|
263
|
+
// the one probe run has to ask for it. Only on Linux, which is the
|
|
264
|
+
// only platform that degrades this way, and the output is parsed and
|
|
265
|
+
// discarded here rather than shown.
|
|
266
|
+
...(process.platform === "linux" ? { env: { ...process.env, SRT_DEBUG: "1" } } : {}),
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
resolve({ supported: false, reason: error.message });
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
let stderr = "";
|
|
274
|
+
let degraded = null;
|
|
275
|
+
child.stderr?.on("data", (chunk) => {
|
|
276
|
+
const text = chunk.toString("utf8");
|
|
277
|
+
// Match per chunk: `stderr` keeps only the tail for the failure message,
|
|
278
|
+
// and under SRT_DEBUG the warning is easily scrolled past it.
|
|
279
|
+
degraded ??= text.match(DEGRADED_ISOLATION)?.[0] ?? null;
|
|
280
|
+
stderr = `${stderr}${text}`.slice(-500);
|
|
281
|
+
});
|
|
282
|
+
const timer = setTimeout(() => {
|
|
283
|
+
child.kill("SIGKILL");
|
|
284
|
+
resolve({ supported: false, reason: "sandbox probe timed out", degraded });
|
|
285
|
+
}, PROBE_TIMEOUT_MS);
|
|
286
|
+
timer.unref?.();
|
|
287
|
+
child.once("error", (error) => {
|
|
288
|
+
clearTimeout(timer);
|
|
289
|
+
resolve({ supported: false, reason: error.message });
|
|
290
|
+
});
|
|
291
|
+
child.once("exit", (code) => {
|
|
292
|
+
clearTimeout(timer);
|
|
293
|
+
resolve({
|
|
294
|
+
supported: code === 0,
|
|
295
|
+
reason: code === 0 ? "ok" : stderr.trim() || `sandbox probe exited with code ${code}`,
|
|
296
|
+
degraded,
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
return supportProbe;
|
|
301
|
+
}
|
|
302
|
+
async function writeStableSettings(settings) {
|
|
303
|
+
const json = `${JSON.stringify(settings, null, 2)}\n`;
|
|
304
|
+
const digest = createHash("sha256").update(json).digest("hex").slice(0, 20);
|
|
305
|
+
const settingsPath = path.join(SANDBOX_CONFIG_DIR, `${digest}.json`);
|
|
306
|
+
await fs.mkdir(SANDBOX_CONFIG_DIR, { recursive: true, mode: 0o700 });
|
|
307
|
+
try {
|
|
308
|
+
await fs.writeFile(settingsPath, json, { encoding: "utf8", mode: 0o600, flag: "wx" });
|
|
309
|
+
}
|
|
310
|
+
catch (error) {
|
|
311
|
+
if (error.code !== "EEXIST")
|
|
312
|
+
throw error;
|
|
313
|
+
}
|
|
314
|
+
return settingsPath;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Known limitations when `sandboxMode` is enabled (upstream, not fixable here):
|
|
318
|
+
*
|
|
319
|
+
* - **Linux pipes/redirections**: `echo hi | grep hi` fails with "Permission
|
|
320
|
+
* denied" on /proc/self/fd/3 because bash's pipe setup clobbers the fd the
|
|
321
|
+
* seccomp filter arrives on (sandbox-runtime#261).
|
|
322
|
+
* - **git over SSH**: `git@host:` remotes fail the SOCKS handshake on macOS —
|
|
323
|
+
* the injected ProxyCommand uses `nc`, which cannot authenticate. HTTPS
|
|
324
|
+
* remotes work. `~/.ssh` is also unreadable by design.
|
|
325
|
+
* - **`git config --global`**: `~/.gitconfig` is a mandatory upstream write
|
|
326
|
+
* protection with no opt-out. Repo-local `git config` works.
|
|
327
|
+
* - **Corporate TLS interception / private registries**: need the CA and
|
|
328
|
+
* registry host configured explicitly.
|
|
329
|
+
* - **Ubuntu 24.04+**: AppArmor blocks the sandbox entirely, so `auto`
|
|
330
|
+
* degrades to no isolation (sandbox-runtime#428, #429).
|
|
331
|
+
* - **Loopback egress is unfiltered**: sandboxed commands can reach any local
|
|
332
|
+
* TCP port, because upstream ties that to port binding and dev servers need
|
|
333
|
+
* to bind. A service listening on localhost without authentication is
|
|
334
|
+
* reachable from sandboxed bash.
|
|
335
|
+
*
|
|
336
|
+
* These are why the default is `off`; revisit when fixed upstream.
|
|
337
|
+
*/
|
|
338
|
+
/**
|
|
339
|
+
* Wrap an already-resolved shell with Anthropic's cross-platform OS sandbox.
|
|
340
|
+
* Initialization and dependency failures remain visible and fail closed: the
|
|
341
|
+
* original command is never spawned outside the sandbox as an implicit fallback.
|
|
342
|
+
*/
|
|
343
|
+
export async function prepareSandboxLaunch(shell, cwd, policy) {
|
|
344
|
+
if (policy.mode === "off")
|
|
345
|
+
return { ...shell, sandboxed: false };
|
|
346
|
+
const settingsPath = await writeStableSettings(buildSandboxSettings(cwd, policy));
|
|
347
|
+
const support = await probeSandboxSupport(settingsPath);
|
|
348
|
+
if (!support.supported) {
|
|
349
|
+
if (policy.mode === "workspace") {
|
|
350
|
+
throw new Error(`${support.reason}. Install the OS sandbox prerequisites ` +
|
|
351
|
+
`(Linux: bubblewrap + socat; Windows: run \`srt windows-install\`), ` +
|
|
352
|
+
`or set sandboxMode to "auto" to run without OS isolation.`);
|
|
353
|
+
}
|
|
354
|
+
if (!warnedUnsupported) {
|
|
355
|
+
warnedUnsupported = true;
|
|
356
|
+
log("WARN", "sandbox", "OS sandbox unavailable; commands run unisolated", {
|
|
357
|
+
reason: support.reason,
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
return { ...shell, sandboxed: false };
|
|
361
|
+
}
|
|
362
|
+
if (support.degraded) {
|
|
363
|
+
if (policy.mode === "workspace") {
|
|
364
|
+
throw new Error(`OS sandbox isolation is incomplete: ${support.degraded}. Unix sockets ` +
|
|
365
|
+
`(Docker, the SSH agent) stay reachable from sandboxed commands. Install ` +
|
|
366
|
+
`@anthropic-ai/sandbox-runtime globally so the apply-seccomp helper is on ` +
|
|
367
|
+
`disk, or set sandboxMode to "auto" to accept reduced isolation.`);
|
|
368
|
+
}
|
|
369
|
+
if (!warnedDegraded) {
|
|
370
|
+
warnedDegraded = true;
|
|
371
|
+
log("WARN", "sandbox", "OS sandbox running with reduced isolation", {
|
|
372
|
+
reason: support.degraded,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return {
|
|
377
|
+
file: process.execPath,
|
|
378
|
+
args: [resolveSandboxCli(), "--settings", settingsPath, "--", shell.file, ...shell.args],
|
|
379
|
+
isCmdFallback: shell.isCmdFallback,
|
|
380
|
+
sandboxed: true,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=sandbox.js.map
|