@theowlops/boombot 0.0.0-stage → 1.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/README.md +69 -3
- package/dist/LICENSE +21 -0
- package/dist/bin/boombot.js +16 -0
- package/dist/cli/api-key.js +123 -0
- package/dist/cli/bin-bun.js +17 -0
- package/dist/cli/bin.js +34 -0
- package/dist/cli/cli/cli-error.js +61 -0
- package/dist/cli/cli/dispatch.js +138 -0
- package/dist/cli/cli/help.js +83 -0
- package/dist/cli/cli/parser.js +89 -0
- package/dist/cli/cli/registry.js +185 -0
- package/dist/cli/cli/spec.js +41 -0
- package/dist/cli/cli/suggest.js +125 -0
- package/dist/cli/cli/version.js +30 -0
- package/dist/cli/cli/vocabulary.js +87 -0
- package/dist/cli/commands/doctor.js +365 -0
- package/dist/cli/commands/gateway.js +290 -0
- package/dist/cli/commands/migrate.js +270 -0
- package/dist/cli/commands/plugin.js +97 -0
- package/dist/cli/commands/setup.js +230 -0
- package/dist/cli/config-file.js +133 -0
- package/dist/cli/master-key.js +78 -0
- package/dist/cli/open-browser.js +59 -0
- package/dist/cli/web-assets.js +58 -0
- package/dist/gateway/auth.js +46 -0
- package/dist/gateway/config-format.js +202 -0
- package/dist/gateway/config.js +427 -0
- package/dist/gateway/context.js +1 -0
- package/dist/gateway/env-file.js +129 -0
- package/dist/gateway/events.js +172 -0
- package/dist/gateway/guard/tagging.js +505 -0
- package/dist/gateway/handlers/index.js +66 -0
- package/dist/gateway/handlers/memory.js +54 -0
- package/dist/gateway/handlers/providers.js +73 -0
- package/dist/gateway/handlers/registry.js +39 -0
- package/dist/gateway/handlers/sessions.js +188 -0
- package/dist/gateway/handlers/system.js +12 -0
- package/dist/gateway/handlers/tasks.js +191 -0
- package/dist/gateway/handlers/turn.js +100 -0
- package/dist/gateway/index.js +126 -0
- package/dist/gateway/main.js +23 -0
- package/dist/gateway/server.js +354 -0
- package/dist/gateway/services/context-limits.js +75 -0
- package/dist/gateway/services/history-normalizer.js +42 -0
- package/dist/gateway/services/image-pipeline.js +56 -0
- package/dist/gateway/services/key-roulette-client.js +43 -0
- package/dist/gateway/services/llm-client.js +593 -0
- package/dist/gateway/services/llm-decoder.js +200 -0
- package/dist/gateway/services/local-fallback.js +135 -0
- package/dist/gateway/services/memory.js +511 -0
- package/dist/gateway/services/persistent-memory.js +196 -0
- package/dist/gateway/services/providers.js +44 -0
- package/dist/gateway/services/tasks.js +237 -0
- package/dist/gateway/services/verification.js +124 -0
- package/dist/gateway/services/vision-payload.js +48 -0
- package/dist/gateway/services.js +257 -0
- package/dist/gateway/session-snapshot.js +19 -0
- package/dist/gateway/sessions.js +701 -0
- package/dist/gateway/static.js +239 -0
- package/dist/gateway/turns/clarify-tool.js +57 -0
- package/dist/gateway/turns/cronjob-tool.js +96 -0
- package/dist/gateway/turns/deferred-tools.js +154 -0
- package/dist/gateway/turns/execute-code-tool.js +84 -0
- package/dist/gateway/turns/file-tool-defs.js +178 -0
- package/dist/gateway/turns/file-tool-ops.js +178 -0
- package/dist/gateway/turns/file-tool-scan.js +182 -0
- package/dist/gateway/turns/file-tool.js +302 -0
- package/dist/gateway/turns/index.js +416 -0
- package/dist/gateway/turns/jev-middleware.js +91 -0
- package/dist/gateway/turns/local-reply.js +156 -0
- package/dist/gateway/turns/mcp-client.js +643 -0
- package/dist/gateway/turns/memory-tool.js +171 -0
- package/dist/gateway/turns/middleware.js +96 -0
- package/dist/gateway/turns/python-core.js +397 -0
- package/dist/gateway/turns/routing/index.js +3 -0
- package/dist/gateway/turns/routing/intent-classifier.js +60 -0
- package/dist/gateway/turns/routing/planner-adapter.js +91 -0
- package/dist/gateway/turns/routing/types.js +1 -0
- package/dist/gateway/turns/runtime-deps.js +228 -0
- package/dist/gateway/turns/self-config-tool.js +277 -0
- package/dist/gateway/turns/service-types.js +11 -0
- package/dist/gateway/turns/service.js +820 -0
- package/dist/gateway/turns/session-adapter.js +158 -0
- package/dist/gateway/turns/session-tool.js +49 -0
- package/dist/gateway/turns/shell-tool.js +190 -0
- package/dist/gateway/turns/skill-tool.js +239 -0
- package/dist/gateway/turns/spillover.js +201 -0
- package/dist/gateway/turns/subagent-tool.js +140 -0
- package/dist/gateway/turns/system-prompt.js +121 -0
- package/dist/gateway/turns/tool-schema.js +90 -0
- package/dist/gateway/turns/turn-utils.js +58 -0
- package/dist/gateway/turns/vision-tool.js +120 -0
- package/dist/gateway/types.js +1 -0
- package/dist/native/win32-x64/boombot-native-host.exe +0 -0
- package/dist/node_modules/@boombot/channels/handlers.d.ts +9 -0
- package/dist/node_modules/@boombot/channels/handlers.js +109 -0
- package/dist/node_modules/@boombot/channels/index.d.ts +12 -0
- package/dist/node_modules/@boombot/channels/index.js +12 -0
- package/dist/node_modules/@boombot/channels/package.json +9 -0
- package/dist/node_modules/@boombot/channels/service.d.ts +62 -0
- package/dist/node_modules/@boombot/channels/service.js +608 -0
- package/dist/node_modules/@boombot/channels/tool.d.ts +10 -0
- package/dist/node_modules/@boombot/channels/tool.js +46 -0
- package/dist/node_modules/@boombot/channels/transports/common/dedup.d.ts +17 -0
- package/dist/node_modules/@boombot/channels/transports/common/dedup.js +42 -0
- package/dist/node_modules/@boombot/channels/transports/common/handoff.d.ts +19 -0
- package/dist/node_modules/@boombot/channels/transports/common/handoff.js +32 -0
- package/dist/node_modules/@boombot/channels/transports/common/index.d.ts +3 -0
- package/dist/node_modules/@boombot/channels/transports/common/index.js +3 -0
- package/dist/node_modules/@boombot/channels/transports/common/types.d.ts +99 -0
- package/dist/node_modules/@boombot/channels/transports/common/types.js +54 -0
- package/dist/node_modules/@boombot/channels/transports/common.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/common.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/dedup/index.d.ts +1 -0
- package/dist/node_modules/@boombot/channels/transports/dedup/index.js +1 -0
- package/dist/node_modules/@boombot/channels/transports/dedup.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/dedup.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/discord/index.d.ts +1 -0
- package/dist/node_modules/@boombot/channels/transports/discord/index.js +1 -0
- package/dist/node_modules/@boombot/channels/transports/discord/transport.d.ts +36 -0
- package/dist/node_modules/@boombot/channels/transports/discord/transport.js +199 -0
- package/dist/node_modules/@boombot/channels/transports/discord.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/discord.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/handoff.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/handoff.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/messenger/index.d.ts +1 -0
- package/dist/node_modules/@boombot/channels/transports/messenger/index.js +1 -0
- package/dist/node_modules/@boombot/channels/transports/messenger/transport.d.ts +34 -0
- package/dist/node_modules/@boombot/channels/transports/messenger/transport.js +180 -0
- package/dist/node_modules/@boombot/channels/transports/messenger.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/messenger.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/slack/index.d.ts +1 -0
- package/dist/node_modules/@boombot/channels/transports/slack/index.js +1 -0
- package/dist/node_modules/@boombot/channels/transports/slack/transport.d.ts +35 -0
- package/dist/node_modules/@boombot/channels/transports/slack/transport.js +183 -0
- package/dist/node_modules/@boombot/channels/transports/slack.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/slack.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/streamer/index.d.ts +1 -0
- package/dist/node_modules/@boombot/channels/transports/streamer/index.js +1 -0
- package/dist/node_modules/@boombot/channels/transports/streamer/streamer.d.ts +31 -0
- package/dist/node_modules/@boombot/channels/transports/streamer/streamer.js +141 -0
- package/dist/node_modules/@boombot/channels/transports/streamer.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/streamer.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/telegram/index.d.ts +1 -0
- package/dist/node_modules/@boombot/channels/transports/telegram/index.js +1 -0
- package/dist/node_modules/@boombot/channels/transports/telegram/transport.d.ts +75 -0
- package/dist/node_modules/@boombot/channels/transports/telegram/transport.js +395 -0
- package/dist/node_modules/@boombot/channels/transports/telegram.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/telegram.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/tiktok/index.d.ts +1 -0
- package/dist/node_modules/@boombot/channels/transports/tiktok/index.js +1 -0
- package/dist/node_modules/@boombot/channels/transports/tiktok/transport.d.ts +27 -0
- package/dist/node_modules/@boombot/channels/transports/tiktok/transport.js +97 -0
- package/dist/node_modules/@boombot/channels/transports/tiktok.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/tiktok.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/whatsapp/index.d.ts +1 -0
- package/dist/node_modules/@boombot/channels/transports/whatsapp/index.js +1 -0
- package/dist/node_modules/@boombot/channels/transports/whatsapp/transport.d.ts +38 -0
- package/dist/node_modules/@boombot/channels/transports/whatsapp/transport.js +189 -0
- package/dist/node_modules/@boombot/channels/transports/whatsapp.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/whatsapp.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/zalo/index.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/zalo/index.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/zalo/oa.d.ts +28 -0
- package/dist/node_modules/@boombot/channels/transports/zalo/oa.js +94 -0
- package/dist/node_modules/@boombot/channels/transports/zalo/personal.d.ts +106 -0
- package/dist/node_modules/@boombot/channels/transports/zalo/personal.js +171 -0
- package/dist/node_modules/@boombot/channels/transports/zalo-personal.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/zalo-personal.js +2 -0
- package/dist/node_modules/@boombot/channels/transports/zalo.d.ts +2 -0
- package/dist/node_modules/@boombot/channels/transports/zalo.js +2 -0
- package/dist/node_modules/@boombot/core/agent-core/index.d.ts +12 -0
- package/dist/node_modules/@boombot/core/agent-core/index.js +12 -0
- package/dist/node_modules/@boombot/core/agent-core/middleware.d.ts +60 -0
- package/dist/node_modules/@boombot/core/agent-core/middleware.js +152 -0
- package/dist/node_modules/@boombot/core/agent-core/routing.d.ts +128 -0
- package/dist/node_modules/@boombot/core/agent-core/routing.js +437 -0
- package/dist/node_modules/@boombot/core/agent-core/runtime-deps.d.ts +88 -0
- package/dist/node_modules/@boombot/core/agent-core/runtime-deps.js +8 -0
- package/dist/node_modules/@boombot/core/agent-core/tool-errors.d.ts +44 -0
- package/dist/node_modules/@boombot/core/agent-core/tool-errors.js +60 -0
- package/dist/node_modules/@boombot/core/agent-core/turn-loop.d.ts +21 -0
- package/dist/node_modules/@boombot/core/agent-core/turn-loop.js +561 -0
- package/dist/node_modules/@boombot/core/agent-core/types.d.ts +189 -0
- package/dist/node_modules/@boombot/core/agent-core/types.js +7 -0
- package/dist/node_modules/@boombot/core/compaction/compactor.d.ts +19 -0
- package/dist/node_modules/@boombot/core/compaction/compactor.js +127 -0
- package/dist/node_modules/@boombot/core/compaction/estimator.d.ts +10 -0
- package/dist/node_modules/@boombot/core/compaction/estimator.js +48 -0
- package/dist/node_modules/@boombot/core/compaction/index.d.ts +3 -0
- package/dist/node_modules/@boombot/core/compaction/index.js +3 -0
- package/dist/node_modules/@boombot/core/compaction/types.d.ts +31 -0
- package/dist/node_modules/@boombot/core/compaction/types.js +7 -0
- package/dist/node_modules/@boombot/core/index.d.ts +9 -0
- package/dist/node_modules/@boombot/core/index.js +9 -0
- package/dist/node_modules/@boombot/core/jev/index.d.ts +2 -0
- package/dist/node_modules/@boombot/core/jev/index.js +2 -0
- package/dist/node_modules/@boombot/core/jev/jev.d.ts +30 -0
- package/dist/node_modules/@boombot/core/jev/jev.js +164 -0
- package/dist/node_modules/@boombot/core/jev/types.d.ts +22 -0
- package/dist/node_modules/@boombot/core/jev/types.js +1 -0
- package/dist/node_modules/@boombot/core/memory/consolidation/budget.d.ts +63 -0
- package/dist/node_modules/@boombot/core/memory/consolidation/budget.js +94 -0
- package/dist/node_modules/@boombot/core/memory/consolidation/consolidator.d.ts +152 -0
- package/dist/node_modules/@boombot/core/memory/consolidation/consolidator.js +318 -0
- package/dist/node_modules/@boombot/core/memory/consolidation/index.d.ts +12 -0
- package/dist/node_modules/@boombot/core/memory/consolidation/index.js +12 -0
- package/dist/node_modules/@boombot/core/memory/curation.d.ts +86 -0
- package/dist/node_modules/@boombot/core/memory/curation.js +120 -0
- package/dist/node_modules/@boombot/core/memory/errors.d.ts +12 -0
- package/dist/node_modules/@boombot/core/memory/errors.js +20 -0
- package/dist/node_modules/@boombot/core/memory/hybrid-search.d.ts +29 -0
- package/dist/node_modules/@boombot/core/memory/hybrid-search.js +52 -0
- package/dist/node_modules/@boombot/core/memory/index.d.ts +23 -0
- package/dist/node_modules/@boombot/core/memory/index.js +23 -0
- package/dist/node_modules/@boombot/core/memory/indexer.d.ts +47 -0
- package/dist/node_modules/@boombot/core/memory/indexer.js +138 -0
- package/dist/node_modules/@boombot/core/memory/lifecycle.d.ts +12 -0
- package/dist/node_modules/@boombot/core/memory/lifecycle.js +66 -0
- package/dist/node_modules/@boombot/core/memory/provider.d.ts +84 -0
- package/dist/node_modules/@boombot/core/memory/provider.js +117 -0
- package/dist/node_modules/@boombot/core/memory/recall.d.ts +7 -0
- package/dist/node_modules/@boombot/core/memory/recall.js +111 -0
- package/dist/node_modules/@boombot/core/memory/scope-resolver.d.ts +27 -0
- package/dist/node_modules/@boombot/core/memory/scope-resolver.js +60 -0
- package/dist/node_modules/@boombot/core/memory/search.d.ts +37 -0
- package/dist/node_modules/@boombot/core/memory/search.js +158 -0
- package/dist/node_modules/@boombot/core/memory/store.d.ts +60 -0
- package/dist/node_modules/@boombot/core/memory/store.js +289 -0
- package/dist/node_modules/@boombot/core/memory/types.d.ts +121 -0
- package/dist/node_modules/@boombot/core/memory/types.js +21 -0
- package/dist/node_modules/@boombot/core/memory/vector-index.d.ts +34 -0
- package/dist/node_modules/@boombot/core/memory/vector-index.js +65 -0
- package/dist/node_modules/@boombot/core/package.json +9 -0
- package/dist/node_modules/@boombot/core/reflection/classifier.d.ts +13 -0
- package/dist/node_modules/@boombot/core/reflection/classifier.js +77 -0
- package/dist/node_modules/@boombot/core/reflection/index.d.ts +2 -0
- package/dist/node_modules/@boombot/core/reflection/index.js +2 -0
- package/dist/node_modules/@boombot/core/reflection/types.d.ts +13 -0
- package/dist/node_modules/@boombot/core/reflection/types.js +4 -0
- package/dist/node_modules/@boombot/core/research/config.d.ts +89 -0
- package/dist/node_modules/@boombot/core/research/config.js +206 -0
- package/dist/node_modules/@boombot/core/research/crawl.d.ts +36 -0
- package/dist/node_modules/@boombot/core/research/crawl.js +179 -0
- package/dist/node_modules/@boombot/core/research/factory.d.ts +26 -0
- package/dist/node_modules/@boombot/core/research/factory.js +46 -0
- package/dist/node_modules/@boombot/core/research/http.d.ts +87 -0
- package/dist/node_modules/@boombot/core/research/http.js +250 -0
- package/dist/node_modules/@boombot/core/research/index.d.ts +17 -0
- package/dist/node_modules/@boombot/core/research/index.js +10 -0
- package/dist/node_modules/@boombot/core/research/orchestrator.d.ts +113 -0
- package/dist/node_modules/@boombot/core/research/orchestrator.js +252 -0
- package/dist/node_modules/@boombot/core/research/parse/docx.d.ts +24 -0
- package/dist/node_modules/@boombot/core/research/parse/docx.js +183 -0
- package/dist/node_modules/@boombot/core/research/parse/guards.d.ts +89 -0
- package/dist/node_modules/@boombot/core/research/parse/guards.js +171 -0
- package/dist/node_modules/@boombot/core/research/parse/index.d.ts +68 -0
- package/dist/node_modules/@boombot/core/research/parse/index.js +219 -0
- package/dist/node_modules/@boombot/core/research/parse/pdf.d.ts +38 -0
- package/dist/node_modules/@boombot/core/research/parse/pdf.js +567 -0
- package/dist/node_modules/@boombot/core/research/providers/arxiv.d.ts +9 -0
- package/dist/node_modules/@boombot/core/research/providers/arxiv.js +72 -0
- package/dist/node_modules/@boombot/core/research/providers/brave.d.ts +11 -0
- package/dist/node_modules/@boombot/core/research/providers/brave.js +36 -0
- package/dist/node_modules/@boombot/core/research/providers/duckduckgo.d.ts +9 -0
- package/dist/node_modules/@boombot/core/research/providers/duckduckgo.js +78 -0
- package/dist/node_modules/@boombot/core/research/providers/exa.d.ts +11 -0
- package/dist/node_modules/@boombot/core/research/providers/exa.js +34 -0
- package/dist/node_modules/@boombot/core/research/providers/firecrawl.d.ts +16 -0
- package/dist/node_modules/@boombot/core/research/providers/firecrawl.js +47 -0
- package/dist/node_modules/@boombot/core/research/providers/index.d.ts +17 -0
- package/dist/node_modules/@boombot/core/research/providers/index.js +11 -0
- package/dist/node_modules/@boombot/core/research/providers/jina.d.ts +13 -0
- package/dist/node_modules/@boombot/core/research/providers/jina.js +114 -0
- package/dist/node_modules/@boombot/core/research/providers/openalex.d.ts +14 -0
- package/dist/node_modules/@boombot/core/research/providers/openalex.js +66 -0
- package/dist/node_modules/@boombot/core/research/providers/semantic-scholar.d.ts +9 -0
- package/dist/node_modules/@boombot/core/research/providers/semantic-scholar.js +56 -0
- package/dist/node_modules/@boombot/core/research/providers/tavily.d.ts +11 -0
- package/dist/node_modules/@boombot/core/research/providers/tavily.js +35 -0
- package/dist/node_modules/@boombot/core/research/providers/wikipedia.d.ts +12 -0
- package/dist/node_modules/@boombot/core/research/providers/wikipedia.js +47 -0
- package/dist/node_modules/@boombot/core/research/tools.d.ts +27 -0
- package/dist/node_modules/@boombot/core/research/tools.js +251 -0
- package/dist/node_modules/@boombot/core/research/types.d.ts +133 -0
- package/dist/node_modules/@boombot/core/research/types.js +8 -0
- package/dist/node_modules/@boombot/core/research/wiring.d.ts +25 -0
- package/dist/node_modules/@boombot/core/research/wiring.js +51 -0
- package/dist/node_modules/@boombot/core/scheduler/cron.d.ts +34 -0
- package/dist/node_modules/@boombot/core/scheduler/cron.js +147 -0
- package/dist/node_modules/@boombot/core/scheduler/evaluator.d.ts +42 -0
- package/dist/node_modules/@boombot/core/scheduler/evaluator.js +148 -0
- package/dist/node_modules/@boombot/core/scheduler/index.d.ts +15 -0
- package/dist/node_modules/@boombot/core/scheduler/index.js +15 -0
- package/dist/node_modules/@boombot/core/scheduler/registry.d.ts +81 -0
- package/dist/node_modules/@boombot/core/scheduler/registry.js +263 -0
- package/dist/node_modules/@boombot/core/scheduler/runner.d.ts +59 -0
- package/dist/node_modules/@boombot/core/scheduler/runner.js +257 -0
- package/dist/node_modules/@boombot/core/scheduler/store.d.ts +150 -0
- package/dist/node_modules/@boombot/core/scheduler/store.js +526 -0
- package/dist/node_modules/@boombot/core/scheduler/timezone.d.ts +35 -0
- package/dist/node_modules/@boombot/core/scheduler/timezone.js +96 -0
- package/dist/node_modules/@boombot/core/scheduler/types.d.ts +157 -0
- package/dist/node_modules/@boombot/core/scheduler/types.js +89 -0
- package/dist/node_modules/@boombot/core/task-runner/index.d.ts +7 -0
- package/dist/node_modules/@boombot/core/task-runner/index.js +5 -0
- package/dist/node_modules/@boombot/core/task-runner/planner.d.ts +37 -0
- package/dist/node_modules/@boombot/core/task-runner/planner.js +154 -0
- package/dist/node_modules/@boombot/core/task-runner/runner.d.ts +8 -0
- package/dist/node_modules/@boombot/core/task-runner/runner.js +564 -0
- package/dist/node_modules/@boombot/core/task-runner/store.d.ts +28 -0
- package/dist/node_modules/@boombot/core/task-runner/store.js +126 -0
- package/dist/node_modules/@boombot/core/task-runner/types.d.ts +138 -0
- package/dist/node_modules/@boombot/core/task-runner/types.js +11 -0
- package/dist/node_modules/@boombot/core/workflow/dag.d.ts +16 -0
- package/dist/node_modules/@boombot/core/workflow/dag.js +109 -0
- package/dist/node_modules/@boombot/core/workflow/engine.d.ts +34 -0
- package/dist/node_modules/@boombot/core/workflow/engine.js +304 -0
- package/dist/node_modules/@boombot/core/workflow/index.d.ts +3 -0
- package/dist/node_modules/@boombot/core/workflow/index.js +3 -0
- package/dist/node_modules/@boombot/core/workflow/types.d.ts +98 -0
- package/dist/node_modules/@boombot/core/workflow/types.js +21 -0
- package/dist/node_modules/@boombot/cronjobs/handlers.d.ts +11 -0
- package/dist/node_modules/@boombot/cronjobs/handlers.js +174 -0
- package/dist/node_modules/@boombot/cronjobs/index.d.ts +2 -0
- package/dist/node_modules/@boombot/cronjobs/index.js +2 -0
- package/dist/node_modules/@boombot/cronjobs/package.json +9 -0
- package/dist/node_modules/@boombot/cronjobs/service.d.ts +53 -0
- package/dist/node_modules/@boombot/cronjobs/service.js +200 -0
- package/dist/node_modules/@boombot/plugins/index.d.ts +2 -0
- package/dist/node_modules/@boombot/plugins/index.js +2 -0
- package/dist/node_modules/@boombot/plugins/installer.d.ts +45 -0
- package/dist/node_modules/@boombot/plugins/installer.js +487 -0
- package/dist/node_modules/@boombot/plugins/manager.d.ts +23 -0
- package/dist/node_modules/@boombot/plugins/manager.js +243 -0
- package/dist/node_modules/@boombot/plugins/package.json +9 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/commands-channels.d.ts +125 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/commands-channels.js +76 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/commands-plugins.d.ts +220 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/commands-plugins.js +60 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/commands-scheduler.d.ts +33 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/commands-scheduler.js +25 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/commands.d.ts +4349 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/commands.js +563 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/envelope.d.ts +32 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/envelope.js +61 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/errors.d.ts +13 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/errors.js +16 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/events.d.ts +567 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/events.js +395 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/index.d.ts +20 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/index.js +13 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/types.d.ts +91 -0
- package/dist/node_modules/@boombot/protocol/gateway-protocol/types.js +7 -0
- package/dist/node_modules/@boombot/protocol/index.d.ts +4 -0
- package/dist/node_modules/@boombot/protocol/index.js +3 -0
- package/dist/node_modules/@boombot/protocol/package.json +9 -0
- package/dist/node_modules/@boombot/protocol/plugin-sdk/channel.d.ts +41 -0
- package/dist/node_modules/@boombot/protocol/plugin-sdk/channel.js +17 -0
- package/dist/node_modules/@boombot/protocol/plugin-sdk/index.d.ts +10 -0
- package/dist/node_modules/@boombot/protocol/plugin-sdk/index.js +10 -0
- package/dist/node_modules/@boombot/protocol/plugin-sdk/manifest.d.ts +58 -0
- package/dist/node_modules/@boombot/protocol/plugin-sdk/manifest.js +116 -0
- package/dist/node_modules/@boombot/protocol/plugin-sdk/plugin.d.ts +25 -0
- package/dist/node_modules/@boombot/protocol/plugin-sdk/plugin.js +1 -0
- package/dist/node_modules/@boombot/protocol/providers/cipher.d.ts +7 -0
- package/dist/node_modules/@boombot/protocol/providers/cipher.js +52 -0
- package/dist/node_modules/@boombot/protocol/providers/index.d.ts +19 -0
- package/dist/node_modules/@boombot/protocol/providers/index.js +19 -0
- package/dist/node_modules/@boombot/protocol/providers/key-roulette.d.ts +79 -0
- package/dist/node_modules/@boombot/protocol/providers/key-roulette.js +81 -0
- package/dist/node_modules/@boombot/protocol/providers/probe.d.ts +29 -0
- package/dist/node_modules/@boombot/protocol/providers/probe.js +96 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/anthropic.d.ts +11 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/anthropic.js +11 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/custom.d.ts +22 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/custom.js +222 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/deepseek.d.ts +7 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/deepseek.js +9 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/google.d.ts +10 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/google.js +10 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/index.d.ts +31 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/index.js +56 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/local.d.ts +10 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/local.js +11 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/mistral.d.ts +7 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/mistral.js +9 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/openai-compatible.d.ts +10 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/openai-compatible.js +10 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/openai.d.ts +7 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/openai.js +11 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/types.d.ts +58 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/types.js +1 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/xai.d.ts +7 -0
- package/dist/node_modules/@boombot/protocol/providers/profiles/xai.js +10 -0
- package/dist/node_modules/@boombot/protocol/providers/request-profile.d.ts +102 -0
- package/dist/node_modules/@boombot/protocol/providers/request-profile.js +118 -0
- package/dist/node_modules/@boombot/protocol/providers/service.d.ts +2 -0
- package/dist/node_modules/@boombot/protocol/providers/service.js +418 -0
- package/dist/node_modules/@boombot/protocol/providers/types.d.ts +141 -0
- package/dist/node_modules/@boombot/protocol/providers/types.js +16 -0
- package/dist/node_modules/@boombot/sandbox/fs-path.d.ts +13 -0
- package/dist/node_modules/@boombot/sandbox/fs-path.js +79 -0
- package/dist/node_modules/@boombot/sandbox/index.d.ts +13 -0
- package/dist/node_modules/@boombot/sandbox/index.js +13 -0
- package/dist/node_modules/@boombot/sandbox/native.d.ts +39 -0
- package/dist/node_modules/@boombot/sandbox/native.js +224 -0
- package/dist/node_modules/@boombot/sandbox/package.json +9 -0
- package/dist/node_modules/@boombot/sandbox/sandbox.d.ts +92 -0
- package/dist/node_modules/@boombot/sandbox/sandbox.js +229 -0
- package/dist/node_modules/@boombot/security/harness-guard/boundary.d.ts +22 -0
- package/dist/node_modules/@boombot/security/harness-guard/boundary.js +105 -0
- package/dist/node_modules/@boombot/security/harness-guard/gates.d.ts +90 -0
- package/dist/node_modules/@boombot/security/harness-guard/gates.js +791 -0
- package/dist/node_modules/@boombot/security/harness-guard/index.d.ts +23 -0
- package/dist/node_modules/@boombot/security/harness-guard/index.js +23 -0
- package/dist/node_modules/@boombot/security/harness-guard/policy.d.ts +20 -0
- package/dist/node_modules/@boombot/security/harness-guard/policy.js +70 -0
- package/dist/node_modules/@boombot/security/harness-guard/sanitizer.d.ts +53 -0
- package/dist/node_modules/@boombot/security/harness-guard/sanitizer.js +145 -0
- package/dist/node_modules/@boombot/security/harness-guard/types.d.ts +71 -0
- package/dist/node_modules/@boombot/security/harness-guard/types.js +10 -0
- package/dist/node_modules/@boombot/security/harness-guard/verifier.d.ts +59 -0
- package/dist/node_modules/@boombot/security/harness-guard/verifier.js +169 -0
- package/dist/node_modules/@boombot/security/index.d.ts +5 -0
- package/dist/node_modules/@boombot/security/index.js +9 -0
- package/dist/node_modules/@boombot/security/package.json +9 -0
- package/dist/node_modules/@boombot/security/policy/approval.d.ts +117 -0
- package/dist/node_modules/@boombot/security/policy/approval.js +223 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/claim-extractor.d.ts +10 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/claim-extractor.js +124 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/evidence-ledger.d.ts +25 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/evidence-ledger.js +70 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/gate.d.ts +38 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/gate.js +61 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/grounding-check.d.ts +12 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/grounding-check.js +234 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/index.d.ts +17 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/index.js +13 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/policy.d.ts +15 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/policy.js +39 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/types.d.ts +46 -0
- package/dist/node_modules/@boombot/security/reasoning-guard/types.js +7 -0
- package/dist/node_modules/@boombot/security/security/approval.d.ts +63 -0
- package/dist/node_modules/@boombot/security/security/approval.js +140 -0
- package/dist/node_modules/@boombot/security/security/audit.d.ts +39 -0
- package/dist/node_modules/@boombot/security/security/audit.js +70 -0
- package/dist/node_modules/@boombot/security/security/index.d.ts +12 -0
- package/dist/node_modules/@boombot/security/security/index.js +12 -0
- package/dist/node_modules/@boombot/security/security/trust.d.ts +79 -0
- package/dist/node_modules/@boombot/security/security/trust.js +87 -0
- package/dist/package.json +5 -0
- package/dist/proto/agent_core.proto +56 -0
- package/dist/python/agent-core-python/pyproject.toml +40 -0
- package/dist/python/agent-core-python/src/boombot_agent/__init__.py +5 -0
- package/dist/python/agent-core-python/src/boombot_agent/generated/__init__.py +0 -0
- package/dist/python/agent-core-python/src/boombot_agent/generated/agent_core_pb2.py +54 -0
- package/dist/python/agent-core-python/src/boombot_agent/generated/agent_core_pb2_grpc.py +140 -0
- package/dist/python/agent-core-python/src/boombot_agent/rpc.py +265 -0
- package/dist/python/agent-core-python/src/boombot_agent/turn.py +577 -0
- package/dist/python/agent-core-python/src/boombot_ml/__init__.py +12 -0
- package/dist/python/agent-core-python/src/boombot_ml/embeddings.py +58 -0
- package/dist/python/agent-core-python/src/boombot_ml/training.py +156 -0
- package/dist/python/agent-core-python/uv.lock +2856 -0
- package/dist/web/assets/ChatView-BZrSD-64.js +262 -0
- package/dist/web/assets/ChatView-Cahbjez6.css +1 -0
- package/dist/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/web/assets/MemoryView-BJbXqqs7.css +1 -0
- package/dist/web/assets/MemoryView-BfMq_6CD.js +1 -0
- package/dist/web/assets/SchedulesView-B22QmPR-.js +1 -0
- package/dist/web/assets/SchedulesView-C6XK7A8a.css +1 -0
- package/dist/web/assets/SessionsView-C1dqdhxI.css +1 -0
- package/dist/web/assets/SessionsView-DS0-aH2a.js +1 -0
- package/dist/web/assets/TasksView-Dtasg4hd.css +1 -0
- package/dist/web/assets/TasksView-ey0FLsW8.js +2 -0
- package/dist/web/assets/Textarea-DN3Zybl1.js +1 -0
- package/dist/web/assets/Tooltip-Bn2cqFPz.css +1 -0
- package/dist/web/assets/Tooltip-MzV2Gqnc.js +1 -0
- package/dist/web/assets/browser-Bnt73-Ub.js +8 -0
- package/dist/web/assets/index-BL8bi7Yt.css +1 -0
- package/dist/web/assets/index-CuPR73Tn.js +73 -0
- package/dist/web/favicon.svg +4 -0
- package/dist/web/index.html +26 -0
- package/dist/web/logo.jpg +0 -0
- package/dist/web/logo.png +0 -0
- package/package.json +51 -4
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { registeredProviderKinds } from './profiles/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* All known provider kinds, derived from the profile registry
|
|
4
|
+
* (`./profiles/`). The registry is the single source of truth; this list
|
|
5
|
+
* stays in sync automatically as providers are added.
|
|
6
|
+
*/
|
|
7
|
+
export const PROVIDER_KINDS = registeredProviderKinds();
|
|
8
|
+
/** Error thrown by `ProviderService` for expected failure modes. */
|
|
9
|
+
export class ProviderError extends Error {
|
|
10
|
+
code;
|
|
11
|
+
constructor(code, message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = 'ProviderError';
|
|
14
|
+
this.code = code;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves `target` relative to `root` and guarantees the result stays
|
|
3
|
+
* within `root`.
|
|
4
|
+
*
|
|
5
|
+
* Returns the symlink-resolved absolute path. Throws `Error` when:
|
|
6
|
+
* - `target` is empty or contains a NUL byte;
|
|
7
|
+
* - the path escapes the root, including via symlink or prefix trick
|
|
8
|
+
* (`root-evil` does not count as inside `root`).
|
|
9
|
+
*
|
|
10
|
+
* `root` itself is considered valid (returned as-is), since `target: '.'` is
|
|
11
|
+
* a reasonable request — the caller decides whether to accept a directory.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveWithin(root: string, target: string): Promise<string>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path confinement for direct file operations (not via subprocess).
|
|
3
|
+
*
|
|
4
|
+
* `confineCwd` (`./sandbox.ts`) only uses `path.resolve` — it matches the
|
|
5
|
+
* string prefix, so a symlink INSIDE the root that points OUTSIDE slips
|
|
6
|
+
* through. For a child process's cwd that is a narrow hole (the child is
|
|
7
|
+
* still env-scrubbed with shell-less argv). For files it is not:
|
|
8
|
+
* `root/link` → `/etc/passwd` is a direct read path, and `root/link` →
|
|
9
|
+
* `~/.ssh` is a direct write path. So the file tool does NOT use
|
|
10
|
+
* `confineCwd`; it uses `resolveWithin` below, which uses `realpath`.
|
|
11
|
+
*
|
|
12
|
+
* Boundary: only `node:fs/promises` + `node:path`, no `@boombot/*` imports.
|
|
13
|
+
*/
|
|
14
|
+
import { realpath } from 'node:fs/promises';
|
|
15
|
+
import { dirname, resolve, sep } from 'node:path';
|
|
16
|
+
/** `realpath` returning `null` instead of throwing when the path doesn't exist. */
|
|
17
|
+
async function realpathOrNull(path) {
|
|
18
|
+
try {
|
|
19
|
+
return await realpath(path);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Resolves symlinks at the **deepest existing ancestor**, then re-attaches
|
|
27
|
+
* the non-existent tail.
|
|
28
|
+
*
|
|
29
|
+
* This is the crux: `file.write` must be able to write NEW files (not yet
|
|
30
|
+
* existing, so `realpath` on them would throw), but symlinks in every ancestor
|
|
31
|
+
* directory that DOES exist must still be resolved — otherwise
|
|
32
|
+
* `root/link-to-outside/new.txt` would be accepted because its string still
|
|
33
|
+
* lies within the root.
|
|
34
|
+
*/
|
|
35
|
+
async function realpathDeepest(path) {
|
|
36
|
+
const tail = [];
|
|
37
|
+
let current = path;
|
|
38
|
+
for (;;) {
|
|
39
|
+
const real = await realpathOrNull(current);
|
|
40
|
+
if (real !== null) {
|
|
41
|
+
return tail.length === 0 ? real : resolve(real, ...[...tail].reverse());
|
|
42
|
+
}
|
|
43
|
+
const parent = dirname(current);
|
|
44
|
+
// Hit the filesystem root with nothing existing yet: nothing left to resolve.
|
|
45
|
+
if (parent === current)
|
|
46
|
+
return path;
|
|
47
|
+
tail.push(current.slice(parent.length + 1));
|
|
48
|
+
current = parent;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Resolves `target` relative to `root` and guarantees the result stays
|
|
53
|
+
* within `root`.
|
|
54
|
+
*
|
|
55
|
+
* Returns the symlink-resolved absolute path. Throws `Error` when:
|
|
56
|
+
* - `target` is empty or contains a NUL byte;
|
|
57
|
+
* - the path escapes the root, including via symlink or prefix trick
|
|
58
|
+
* (`root-evil` does not count as inside `root`).
|
|
59
|
+
*
|
|
60
|
+
* `root` itself is considered valid (returned as-is), since `target: '.'` is
|
|
61
|
+
* a reasonable request — the caller decides whether to accept a directory.
|
|
62
|
+
*/
|
|
63
|
+
export async function resolveWithin(root, target) {
|
|
64
|
+
if (typeof target !== 'string' || target.length === 0) {
|
|
65
|
+
throw new Error('resolveWithin: target path must be a non-empty string');
|
|
66
|
+
}
|
|
67
|
+
if (target.includes('\0')) {
|
|
68
|
+
throw new Error('resolveWithin: target path contains a NUL byte');
|
|
69
|
+
}
|
|
70
|
+
// realpath the root too: if the root itself sits behind a symlink (e.g.
|
|
71
|
+
// `/tmp` → `/private/tmp` on macOS), comparing against the UNRESOLVED root
|
|
72
|
+
// would wrongly reject every valid path.
|
|
73
|
+
const realRoot = await realpathDeepest(resolve(root));
|
|
74
|
+
const realCandidate = await realpathDeepest(resolve(realRoot, target));
|
|
75
|
+
if (realCandidate !== realRoot && !realCandidate.startsWith(realRoot + sep)) {
|
|
76
|
+
throw new Error(`resolveWithin: path escapes the workspace root (root=${realRoot}, target=${target})`);
|
|
77
|
+
}
|
|
78
|
+
return realCandidate;
|
|
79
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @boombot/sandbox — injectable subprocess sandbox.
|
|
3
|
+
*
|
|
4
|
+
* Public surface:
|
|
5
|
+
* - `SandboxProvider` — swappable backend interface
|
|
6
|
+
* - `SubprocessSandbox` — spawn without shell, timeout kill
|
|
7
|
+
* (SIGTERM → SIGKILL), cwd confinement, env allowlist, output caps
|
|
8
|
+
* - `confineCwd` — cwd confinement helper (also unit-tested directly)
|
|
9
|
+
* - `resolveWithin` — symlink-aware path confinement for direct fs access
|
|
10
|
+
*/
|
|
11
|
+
export { SubprocessSandbox, confineCwd, type SandboxProvider, type SandboxRunOptions, type SandboxResult, type SubprocessSandboxOptions, } from './sandbox.js';
|
|
12
|
+
export { resolveWithin } from './fs-path.js';
|
|
13
|
+
export { NativeSandbox, createSandboxProvider, findNativeHostBinary, type CreateSandboxOptions, type NativeSandboxOptions, type SandboxBackend, } from './native.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @boombot/sandbox — injectable subprocess sandbox.
|
|
3
|
+
*
|
|
4
|
+
* Public surface:
|
|
5
|
+
* - `SandboxProvider` — swappable backend interface
|
|
6
|
+
* - `SubprocessSandbox` — spawn without shell, timeout kill
|
|
7
|
+
* (SIGTERM → SIGKILL), cwd confinement, env allowlist, output caps
|
|
8
|
+
* - `confineCwd` — cwd confinement helper (also unit-tested directly)
|
|
9
|
+
* - `resolveWithin` — symlink-aware path confinement for direct fs access
|
|
10
|
+
*/
|
|
11
|
+
export { SubprocessSandbox, confineCwd, } from './sandbox.js';
|
|
12
|
+
export { resolveWithin } from './fs-path.js';
|
|
13
|
+
export { NativeSandbox, createSandboxProvider, findNativeHostBinary, } from './native.js';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type SandboxProvider, type SandboxResult, type SandboxRunOptions, type SubprocessSandboxOptions } from './sandbox.js';
|
|
2
|
+
export type SandboxBackend = 'auto' | 'native' | 'subprocess';
|
|
3
|
+
export interface NativeSandboxOptions extends SubprocessSandboxOptions {
|
|
4
|
+
/** Compiled `boombot-native-host` executable. */
|
|
5
|
+
binaryPath: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateSandboxOptions extends SubprocessSandboxOptions {
|
|
8
|
+
/** `auto` uses Rust when built, otherwise preserves the Node rollback path. */
|
|
9
|
+
backend?: SandboxBackend;
|
|
10
|
+
nativeHostPath?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Find an explicitly configured or repository-local release binary. */
|
|
13
|
+
export declare function findNativeHostBinary(explicit?: string | undefined): string | undefined;
|
|
14
|
+
/** Rust-backed subprocess runner using one restartable, line-framed host. */
|
|
15
|
+
export declare class NativeSandbox implements SandboxProvider {
|
|
16
|
+
readonly name = "native";
|
|
17
|
+
private readonly binaryPath;
|
|
18
|
+
private readonly workspaceRoot;
|
|
19
|
+
private readonly defaultTimeoutMs;
|
|
20
|
+
private readonly maxOutputBytes;
|
|
21
|
+
private readonly killGraceMs;
|
|
22
|
+
private readonly minPath;
|
|
23
|
+
private child;
|
|
24
|
+
private stdoutBuffer;
|
|
25
|
+
private stderrBuffer;
|
|
26
|
+
private queue;
|
|
27
|
+
private pending;
|
|
28
|
+
private closed;
|
|
29
|
+
constructor(options: NativeSandboxOptions);
|
|
30
|
+
run(cmd: readonly string[], opts: SandboxRunOptions): Promise<SandboxResult>;
|
|
31
|
+
close(): Promise<void>;
|
|
32
|
+
private send;
|
|
33
|
+
private ensureHost;
|
|
34
|
+
private consume;
|
|
35
|
+
private failHost;
|
|
36
|
+
private rejectPending;
|
|
37
|
+
}
|
|
38
|
+
/** Compatibility-safe backend selection: Rust by default when present, Node as rollback. */
|
|
39
|
+
export declare function createSandboxProvider(options: CreateSandboxOptions): SandboxProvider;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { dirname, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { assertNoShellMetacharacters, buildSandboxEnv, confineCwd, defaultMinPath, SubprocessSandbox, } from './sandbox.js';
|
|
6
|
+
const PROTOCOL_VERSION = 1;
|
|
7
|
+
const HOST_STDERR_LIMIT = 64 * 1024;
|
|
8
|
+
function executableName() {
|
|
9
|
+
return process.platform === 'win32' ? 'boombot-native-host.exe' : 'boombot-native-host';
|
|
10
|
+
}
|
|
11
|
+
function packagedBinaryPath(root) {
|
|
12
|
+
return resolve(root, 'native', `${process.platform}-${process.arch}`, executableName());
|
|
13
|
+
}
|
|
14
|
+
/** Find an explicitly configured or repository-local release binary. */
|
|
15
|
+
export function findNativeHostBinary(explicit = process.env['BOOMBOT_NATIVE_HOST']) {
|
|
16
|
+
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const candidates = [
|
|
18
|
+
explicit,
|
|
19
|
+
resolve(process.cwd(), 'native', 'host', 'target', 'release', executableName()),
|
|
20
|
+
packagedBinaryPath(resolve(process.cwd(), 'apps', 'cli', 'dist')),
|
|
21
|
+
resolve(moduleDir, '..', '..', '..', 'native', 'host', 'target', 'release', executableName()),
|
|
22
|
+
resolve(moduleDir, '..', '..', '..', '..', 'native', 'host', 'target', 'release', executableName()),
|
|
23
|
+
packagedBinaryPath(resolve(moduleDir, '..', '..', '..')),
|
|
24
|
+
];
|
|
25
|
+
return candidates.find((candidate) => typeof candidate === 'string' && candidate.length > 0 && existsSync(candidate));
|
|
26
|
+
}
|
|
27
|
+
function readNativeResult(value) {
|
|
28
|
+
if (value.version !== PROTOCOL_VERSION) {
|
|
29
|
+
throw new Error(`NativeSandbox: unsupported host protocol ${String(value.version)}`);
|
|
30
|
+
}
|
|
31
|
+
if (value.ok !== true) {
|
|
32
|
+
throw new Error(`NativeSandbox: ${typeof value.error === 'string' ? value.error : 'native host failed'}`);
|
|
33
|
+
}
|
|
34
|
+
if (typeof value.stdout !== 'string' ||
|
|
35
|
+
typeof value.stderr !== 'string' ||
|
|
36
|
+
(typeof value.exitCode !== 'number' && value.exitCode !== null) ||
|
|
37
|
+
typeof value.timedOut !== 'boolean' ||
|
|
38
|
+
typeof value.truncated !== 'boolean') {
|
|
39
|
+
throw new Error('NativeSandbox: malformed host response');
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
stdout: value.stdout,
|
|
43
|
+
stderr: value.stderr,
|
|
44
|
+
exitCode: value.exitCode,
|
|
45
|
+
timedOut: value.timedOut,
|
|
46
|
+
truncated: value.truncated,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Rust-backed subprocess runner using one restartable, line-framed host. */
|
|
50
|
+
export class NativeSandbox {
|
|
51
|
+
name = 'native';
|
|
52
|
+
binaryPath;
|
|
53
|
+
workspaceRoot;
|
|
54
|
+
defaultTimeoutMs;
|
|
55
|
+
maxOutputBytes;
|
|
56
|
+
killGraceMs;
|
|
57
|
+
minPath;
|
|
58
|
+
child;
|
|
59
|
+
stdoutBuffer = '';
|
|
60
|
+
stderrBuffer = '';
|
|
61
|
+
queue = Promise.resolve();
|
|
62
|
+
pending;
|
|
63
|
+
closed = false;
|
|
64
|
+
constructor(options) {
|
|
65
|
+
if (typeof options.workspaceRoot !== 'string' || options.workspaceRoot.length === 0) {
|
|
66
|
+
throw new Error('NativeSandbox: workspaceRoot is required');
|
|
67
|
+
}
|
|
68
|
+
if (!existsSync(options.binaryPath)) {
|
|
69
|
+
throw new Error(`NativeSandbox: binary not found at ${options.binaryPath}`);
|
|
70
|
+
}
|
|
71
|
+
this.binaryPath = resolve(options.binaryPath);
|
|
72
|
+
this.workspaceRoot = resolve(options.workspaceRoot);
|
|
73
|
+
this.defaultTimeoutMs = options.defaultTimeoutMs ?? 30_000;
|
|
74
|
+
this.maxOutputBytes = options.maxOutputBytes ?? 1_048_576;
|
|
75
|
+
this.killGraceMs = options.killGraceMs ?? 2_000;
|
|
76
|
+
this.minPath = options.minPath ?? defaultMinPath();
|
|
77
|
+
}
|
|
78
|
+
async run(cmd, opts) {
|
|
79
|
+
if (this.closed)
|
|
80
|
+
throw new Error('NativeSandbox: closed');
|
|
81
|
+
if (cmd.length === 0 || cmd[0] === undefined || cmd[0].length === 0) {
|
|
82
|
+
throw new Error('NativeSandbox: cmd must contain a non-empty executable');
|
|
83
|
+
}
|
|
84
|
+
assertNoShellMetacharacters(cmd);
|
|
85
|
+
const timeoutMs = opts.timeoutMs > 0 ? opts.timeoutMs : this.defaultTimeoutMs;
|
|
86
|
+
const cwd = confineCwd(this.workspaceRoot, opts.cwd);
|
|
87
|
+
const request = JSON.stringify({
|
|
88
|
+
version: PROTOCOL_VERSION,
|
|
89
|
+
command: cmd,
|
|
90
|
+
workspaceRoot: this.workspaceRoot,
|
|
91
|
+
cwd,
|
|
92
|
+
timeoutMs,
|
|
93
|
+
killGraceMs: this.killGraceMs,
|
|
94
|
+
maxOutputBytes: this.maxOutputBytes,
|
|
95
|
+
env: buildSandboxEnv(opts.envAllowlist ?? [], this.minPath),
|
|
96
|
+
});
|
|
97
|
+
const result = this.queue.then(() => this.send(request, timeoutMs));
|
|
98
|
+
this.queue = result.then(() => undefined, () => undefined);
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
async close() {
|
|
102
|
+
if (this.closed)
|
|
103
|
+
return;
|
|
104
|
+
this.closed = true;
|
|
105
|
+
await this.queue;
|
|
106
|
+
const child = this.child;
|
|
107
|
+
this.child = undefined;
|
|
108
|
+
if (child === undefined || child.exitCode !== null || child.signalCode !== null)
|
|
109
|
+
return;
|
|
110
|
+
await new Promise((resolveClose) => {
|
|
111
|
+
const timer = setTimeout(() => child.kill('SIGKILL'), this.killGraceMs);
|
|
112
|
+
timer.unref?.();
|
|
113
|
+
child.once('close', () => {
|
|
114
|
+
clearTimeout(timer);
|
|
115
|
+
resolveClose();
|
|
116
|
+
});
|
|
117
|
+
child.stdin.end();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
send(request, timeoutMs) {
|
|
121
|
+
const child = this.ensureHost();
|
|
122
|
+
this.stderrBuffer = '';
|
|
123
|
+
return new Promise((resolveResult, rejectResult) => {
|
|
124
|
+
const watchdog = setTimeout(() => {
|
|
125
|
+
this.failHost(new Error('NativeSandbox: native host watchdog expired'));
|
|
126
|
+
}, timeoutMs + this.killGraceMs + 5_000);
|
|
127
|
+
watchdog.unref?.();
|
|
128
|
+
this.pending = { resolve: resolveResult, reject: rejectResult, watchdog };
|
|
129
|
+
child.stdin.write(`${request}\n`, (error) => {
|
|
130
|
+
if (error !== null && error !== undefined) {
|
|
131
|
+
this.failHost(new Error(`NativeSandbox: ${error.message}`));
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
ensureHost() {
|
|
137
|
+
if (this.child !== undefined)
|
|
138
|
+
return this.child;
|
|
139
|
+
const child = spawn(this.binaryPath, [], {
|
|
140
|
+
shell: false,
|
|
141
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
142
|
+
windowsHide: true,
|
|
143
|
+
});
|
|
144
|
+
this.child = child;
|
|
145
|
+
child.stdout.setEncoding('utf8');
|
|
146
|
+
child.stdout.on('data', (chunk) => this.consume(chunk));
|
|
147
|
+
child.stderr.setEncoding('utf8');
|
|
148
|
+
child.stderr.on('data', (chunk) => {
|
|
149
|
+
this.stderrBuffer = (this.stderrBuffer + chunk).slice(-HOST_STDERR_LIMIT);
|
|
150
|
+
});
|
|
151
|
+
child.on('error', (error) => {
|
|
152
|
+
if (this.child === child)
|
|
153
|
+
this.failHost(new Error(`NativeSandbox: ${error.message}`));
|
|
154
|
+
});
|
|
155
|
+
child.on('close', () => {
|
|
156
|
+
if (this.child !== child)
|
|
157
|
+
return;
|
|
158
|
+
this.child = undefined;
|
|
159
|
+
if (this.pending !== undefined) {
|
|
160
|
+
this.rejectPending(new Error(`NativeSandbox: host exited without a result${this.stderrBuffer === '' ? '' : `: ${this.stderrBuffer}`}`));
|
|
161
|
+
}
|
|
162
|
+
this.stdoutBuffer = '';
|
|
163
|
+
});
|
|
164
|
+
return child;
|
|
165
|
+
}
|
|
166
|
+
consume(chunk) {
|
|
167
|
+
this.stdoutBuffer += chunk;
|
|
168
|
+
const limit = this.maxOutputBytes * 8 + 65_536;
|
|
169
|
+
if (Buffer.byteLength(this.stdoutBuffer) > limit && !this.stdoutBuffer.includes('\n')) {
|
|
170
|
+
this.failHost(new Error('NativeSandbox: host response exceeded protocol limit'));
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const newline = this.stdoutBuffer.indexOf('\n');
|
|
174
|
+
if (newline < 0)
|
|
175
|
+
return;
|
|
176
|
+
const line = this.stdoutBuffer.slice(0, newline).trim();
|
|
177
|
+
this.stdoutBuffer = this.stdoutBuffer.slice(newline + 1);
|
|
178
|
+
if (Buffer.byteLength(line) > limit) {
|
|
179
|
+
this.failHost(new Error('NativeSandbox: host response exceeded protocol limit'));
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const pending = this.pending;
|
|
183
|
+
if (pending === undefined || line === '') {
|
|
184
|
+
this.failHost(new Error('NativeSandbox: unexpected host response'));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
this.pending = undefined;
|
|
188
|
+
clearTimeout(pending.watchdog);
|
|
189
|
+
try {
|
|
190
|
+
pending.resolve(readNativeResult(JSON.parse(line)));
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
pending.reject(error instanceof Error ? error : new Error('NativeSandbox: invalid host response'));
|
|
194
|
+
this.child?.kill('SIGKILL');
|
|
195
|
+
this.child = undefined;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
failHost(error) {
|
|
199
|
+
this.rejectPending(error);
|
|
200
|
+
this.child?.kill('SIGKILL');
|
|
201
|
+
this.child = undefined;
|
|
202
|
+
this.stdoutBuffer = '';
|
|
203
|
+
}
|
|
204
|
+
rejectPending(error) {
|
|
205
|
+
const pending = this.pending;
|
|
206
|
+
if (pending === undefined)
|
|
207
|
+
return;
|
|
208
|
+
this.pending = undefined;
|
|
209
|
+
clearTimeout(pending.watchdog);
|
|
210
|
+
pending.reject(error);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/** Compatibility-safe backend selection: Rust by default when present, Node as rollback. */
|
|
214
|
+
export function createSandboxProvider(options) {
|
|
215
|
+
if (options.backend === 'subprocess')
|
|
216
|
+
return new SubprocessSandbox(options);
|
|
217
|
+
const binaryPath = findNativeHostBinary(options.nativeHostPath);
|
|
218
|
+
if (binaryPath !== undefined)
|
|
219
|
+
return new NativeSandbox({ ...options, binaryPath });
|
|
220
|
+
if (options.backend === 'native') {
|
|
221
|
+
throw new Error('NativeSandbox: native backend requested but binary is missing; run `pnpm native:build` or set BOOMBOT_NATIVE_HOST');
|
|
222
|
+
}
|
|
223
|
+
return new SubprocessSandbox(options);
|
|
224
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/** Options for a single sandboxed run. */
|
|
2
|
+
export interface SandboxRunOptions {
|
|
3
|
+
/** Working directory. Must resolve inside the sandbox's workspaceRoot. */
|
|
4
|
+
cwd: string;
|
|
5
|
+
/** Kill the process if it runs longer than this (ms). */
|
|
6
|
+
timeoutMs: number;
|
|
7
|
+
/** Env var names to pass through. Everything else is scrubbed. */
|
|
8
|
+
envAllowlist?: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
/** Result of a sandboxed run. */
|
|
11
|
+
export interface SandboxResult {
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
/** Process exit code, or null when killed by a signal. */
|
|
15
|
+
exitCode: number | null;
|
|
16
|
+
/** True when the run was killed because it exceeded timeoutMs. */
|
|
17
|
+
timedOut: boolean;
|
|
18
|
+
/** True when stdout/stderr exceeded maxOutputBytes and was cut. */
|
|
19
|
+
truncated: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Swappable sandbox backend. Hosts select the backend via config;
|
|
23
|
+
* callers only depend on this interface.
|
|
24
|
+
*/
|
|
25
|
+
export interface SandboxProvider {
|
|
26
|
+
readonly name: string;
|
|
27
|
+
run(cmd: readonly string[], opts: SandboxRunOptions): Promise<SandboxResult>;
|
|
28
|
+
close?(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export interface SubprocessSandboxOptions {
|
|
31
|
+
/** Root the child cwd may never escape. */
|
|
32
|
+
workspaceRoot: string;
|
|
33
|
+
/** Default timeout when the call omits timeoutMs. Default 30_000. */
|
|
34
|
+
defaultTimeoutMs?: number;
|
|
35
|
+
/** Max bytes kept per stream (stdout/stderr). Default 1 MiB. */
|
|
36
|
+
maxOutputBytes?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Delay between SIGTERM and SIGKILL. Default 2000.
|
|
39
|
+
* Windows note: Node maps both signals to TerminateProcess, so there is
|
|
40
|
+
* no graceful phase on win32 — the first kill already terminates.
|
|
41
|
+
*/
|
|
42
|
+
killGraceMs?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Minimal PATH given to the child. Default '/usr/bin:/bin'.
|
|
45
|
+
* The default is POSIX-only: on Windows pass an explicit Windows-style
|
|
46
|
+
* PATH (e.g. `C:\Windows\System32`) or the child will not resolve
|
|
47
|
+
* executables by name.
|
|
48
|
+
*/
|
|
49
|
+
minPath?: string;
|
|
50
|
+
}
|
|
51
|
+
export declare function assertNoShellMetacharacters(cmd: readonly string[]): void;
|
|
52
|
+
/** Resolve `cwd` and prove it stays inside `root`. Throws on escape. */
|
|
53
|
+
export declare function confineCwd(root: string, cwd: string): string;
|
|
54
|
+
export declare function buildSandboxEnv(allowlist: readonly string[], minPath: string): Record<string, string>;
|
|
55
|
+
/**
|
|
56
|
+
* Platform-aware default for `minPath`. The POSIX value cannot work on
|
|
57
|
+
* Windows: `spawn` resolves bare executables via PATH, and without
|
|
58
|
+
* System32 even `where`/built-ins fail. The running Node's own directory
|
|
59
|
+
* is appended so `node` itself is spawnable by name (the gateway's own
|
|
60
|
+
* runtime — scripts the agent runs usually want it).
|
|
61
|
+
*/
|
|
62
|
+
export declare function defaultMinPath(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Subprocess sandbox: `spawn` WITHOUT a shell, timeout kill
|
|
65
|
+
* (SIGTERM → SIGKILL after grace, delivered to the whole process group on
|
|
66
|
+
* POSIX), cwd confinement, env allowlist-only, and per-stream output caps.
|
|
67
|
+
*
|
|
68
|
+
* Known limitations: on POSIX the child is spawned detached as a process
|
|
69
|
+
* group leader, so the timeout kill reaches grandchildren — unless a
|
|
70
|
+
* grandchild calls setsid() to escape into its own group. On Windows Node
|
|
71
|
+
* cannot signal a process group, so the kill stays single-process and
|
|
72
|
+
* grandchildren may survive. Neither is a container/VM boundary: use a
|
|
73
|
+
* container backend when that matters.
|
|
74
|
+
*
|
|
75
|
+
* Windows behavior: Node maps both SIGTERM and SIGKILL to TerminateProcess,
|
|
76
|
+
* so the two-phase kill has no graceful phase on win32 — the process dies on
|
|
77
|
+
* the first kill and the grace timer is cleared by `close`. `kill()` on an
|
|
78
|
+
* already-exited process is a safe no-op (returns false, never throws), and
|
|
79
|
+
* a group kill whose members are all gone throws ESRCH which is swallowed,
|
|
80
|
+
* so a grace timer racing the process's natural exit cannot throw or hang
|
|
81
|
+
* the promise: `finish()` is idempotent and `close` always clears the timer.
|
|
82
|
+
*/
|
|
83
|
+
export declare class SubprocessSandbox implements SandboxProvider {
|
|
84
|
+
readonly name = "subprocess";
|
|
85
|
+
private readonly workspaceRoot;
|
|
86
|
+
private readonly defaultTimeoutMs;
|
|
87
|
+
private readonly maxOutputBytes;
|
|
88
|
+
private readonly killGraceMs;
|
|
89
|
+
private readonly minPath;
|
|
90
|
+
constructor(options: SubprocessSandboxOptions);
|
|
91
|
+
run(cmd: readonly string[], opts: SandboxRunOptions): Promise<SandboxResult>;
|
|
92
|
+
}
|