@elie-laloum/outpost 7.0.0 → 9.0.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/CHANGELOG.md +36 -0
- package/README.md +95 -35
- package/SECURITY.md +4 -2
- package/dist/adapters/agents/agent-descriptor.types.d.ts +56 -0
- package/dist/adapters/agents/agent-descriptor.types.js +2 -0
- package/dist/adapters/agents/agent-descriptor.types.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-adapter.d.ts +3 -0
- package/dist/adapters/agents/antigravity/antigravity-adapter.js +48 -0
- package/dist/adapters/agents/antigravity/antigravity-adapter.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-authentication.d.ts +2 -0
- package/dist/adapters/agents/{antigravity-authentication.js → antigravity/antigravity-authentication.js} +5 -5
- package/dist/adapters/agents/antigravity/antigravity-authentication.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-descriptor.d.ts +37 -0
- package/dist/adapters/agents/antigravity/antigravity-descriptor.js +38 -0
- package/dist/adapters/agents/antigravity/antigravity-descriptor.js.map +1 -0
- package/dist/adapters/agents/{antigravity-diagnostics.d.ts → antigravity/antigravity-diagnostics.d.ts} +1 -1
- package/dist/adapters/agents/{antigravity-diagnostics.js → antigravity/antigravity-diagnostics.js} +1 -1
- package/dist/adapters/agents/antigravity/antigravity-diagnostics.js.map +1 -0
- package/dist/adapters/agents/{antigravity-events.d.ts → antigravity/antigravity-events.d.ts} +1 -1
- package/dist/adapters/agents/{antigravity-events.js → antigravity/antigravity-events.js} +3 -3
- package/dist/adapters/agents/antigravity/antigravity-events.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-install.constants.js.map +1 -0
- package/dist/{providers → adapters/agents/antigravity}/antigravity-install.js +1 -1
- package/dist/adapters/agents/antigravity/antigravity-install.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-install.types.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-mcp.d.ts +3 -0
- package/dist/adapters/agents/antigravity/antigravity-mcp.js +27 -0
- package/dist/adapters/agents/antigravity/antigravity-mcp.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-protocol.constants.d.ts +2 -0
- package/dist/adapters/agents/antigravity/antigravity-protocol.constants.js +56 -0
- package/dist/adapters/agents/antigravity/antigravity-protocol.constants.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity-request.d.ts +5 -0
- package/dist/adapters/agents/{antigravity-request.js → antigravity/antigravity-request.js} +2 -2
- package/dist/adapters/agents/antigravity/antigravity-request.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity.constants.d.ts +14 -0
- package/dist/adapters/agents/antigravity/antigravity.constants.js +31 -0
- package/dist/adapters/agents/antigravity/antigravity.constants.js.map +1 -0
- package/dist/adapters/agents/antigravity/antigravity.types.d.ts +9 -0
- package/dist/adapters/agents/antigravity/antigravity.types.js.map +1 -0
- package/dist/adapters/agents/authentication.constants.d.ts +0 -20
- package/dist/adapters/agents/authentication.constants.js +0 -9
- package/dist/adapters/agents/authentication.constants.js.map +1 -1
- package/dist/adapters/agents/catalog.d.ts +160 -0
- package/dist/adapters/agents/catalog.js +30 -0
- package/dist/adapters/agents/catalog.js.map +1 -0
- package/dist/adapters/agents/catalog.types.d.ts +8 -0
- package/dist/adapters/agents/catalog.types.js +2 -0
- package/dist/adapters/agents/catalog.types.js.map +1 -0
- package/dist/adapters/agents/claude/claude-adapter.d.ts +3 -0
- package/dist/adapters/agents/claude/claude-adapter.js +63 -0
- package/dist/adapters/agents/claude/claude-adapter.js.map +1 -0
- package/dist/adapters/agents/claude/claude-authentication.d.ts +2 -0
- package/dist/adapters/agents/{claude-authentication.js → claude/claude-authentication.js} +6 -9
- package/dist/adapters/agents/claude/claude-authentication.js.map +1 -0
- package/dist/adapters/agents/claude/claude-conversations.d.ts +5 -0
- package/dist/adapters/agents/claude/claude-conversations.js +22 -0
- package/dist/adapters/agents/claude/claude-conversations.js.map +1 -0
- package/dist/adapters/agents/claude/claude-descriptor.d.ts +36 -0
- package/dist/adapters/agents/claude/claude-descriptor.js +41 -0
- package/dist/adapters/agents/claude/claude-descriptor.js.map +1 -0
- package/dist/adapters/agents/claude/claude-diagnostics.d.ts +1 -0
- package/dist/adapters/agents/{claude-diagnostics.js → claude/claude-diagnostics.js} +2 -2
- package/dist/adapters/agents/claude/claude-diagnostics.js.map +1 -0
- package/dist/adapters/agents/{claude-events.d.ts → claude/claude-events.d.ts} +1 -1
- package/dist/adapters/agents/{claude-events.js → claude/claude-events.js} +29 -5
- package/dist/adapters/agents/claude/claude-events.js.map +1 -0
- package/dist/adapters/agents/claude/claude-input.d.ts +5 -0
- package/dist/adapters/agents/claude/claude-input.js +21 -0
- package/dist/adapters/agents/claude/claude-input.js.map +1 -0
- package/dist/adapters/agents/claude/claude-mcp.d.ts +4 -0
- package/dist/adapters/agents/claude/claude-mcp.js +44 -0
- package/dist/adapters/agents/claude/claude-mcp.js.map +1 -0
- package/dist/adapters/agents/claude/claude-protocol.constants.d.ts +2 -0
- package/dist/adapters/agents/claude/claude-protocol.constants.js +35 -0
- package/dist/adapters/agents/claude/claude-protocol.constants.js.map +1 -0
- package/dist/adapters/agents/claude/claude-request.d.ts +4 -0
- package/dist/adapters/agents/{claude-request.js → claude/claude-request.js} +11 -3
- package/dist/adapters/agents/claude/claude-request.js.map +1 -0
- package/dist/adapters/agents/claude/claude.constants.d.ts +26 -0
- package/dist/adapters/agents/claude/claude.constants.js +42 -0
- package/dist/adapters/agents/claude/claude.constants.js.map +1 -0
- package/dist/adapters/agents/cli-diagnostics.constants.d.ts +0 -10
- package/dist/adapters/agents/cli-diagnostics.constants.js +0 -10
- package/dist/adapters/agents/cli-diagnostics.constants.js.map +1 -1
- package/dist/adapters/agents/codex/codex-adapter.d.ts +3 -0
- package/dist/adapters/agents/codex/codex-adapter.js +48 -0
- package/dist/adapters/agents/codex/codex-adapter.js.map +1 -0
- package/dist/adapters/agents/codex/codex-app-events.d.ts +4 -0
- package/dist/adapters/agents/codex/codex-app-events.js +105 -0
- package/dist/adapters/agents/codex/codex-app-events.js.map +1 -0
- package/dist/adapters/agents/codex/codex-app-session.d.ts +6 -0
- package/dist/adapters/agents/codex/codex-app-session.js +136 -0
- package/dist/adapters/agents/codex/codex-app-session.js.map +1 -0
- package/dist/adapters/agents/codex/codex-app.constants.d.ts +17 -0
- package/dist/adapters/agents/codex/codex-app.constants.js +18 -0
- package/dist/adapters/agents/codex/codex-app.constants.js.map +1 -0
- package/dist/adapters/agents/codex/codex-authentication.d.ts +3 -0
- package/dist/adapters/agents/{codex-authentication.js → codex/codex-authentication.js} +7 -7
- package/dist/adapters/agents/codex/codex-authentication.js.map +1 -0
- package/dist/adapters/agents/codex/codex-conversations.d.ts +5 -0
- package/dist/adapters/agents/codex/codex-conversations.js +21 -0
- package/dist/adapters/agents/codex/codex-conversations.js.map +1 -0
- package/dist/adapters/agents/codex/codex-descriptor.d.ts +31 -0
- package/dist/adapters/agents/codex/codex-descriptor.js +32 -0
- package/dist/adapters/agents/codex/codex-descriptor.js.map +1 -0
- package/dist/adapters/agents/codex/codex-diagnostics.d.ts +1 -0
- package/dist/adapters/agents/{codex-diagnostics.js → codex/codex-diagnostics.js} +2 -2
- package/dist/adapters/agents/codex/codex-diagnostics.js.map +1 -0
- package/dist/adapters/agents/codex/codex-events.d.ts +2 -0
- package/dist/adapters/agents/{codex-events.js → codex/codex-events.js} +18 -5
- package/dist/adapters/agents/codex/codex-events.js.map +1 -0
- package/dist/adapters/agents/codex/codex-mcp.d.ts +4 -0
- package/dist/adapters/agents/codex/codex-mcp.js +72 -0
- package/dist/adapters/agents/codex/codex-mcp.js.map +1 -0
- package/dist/adapters/agents/codex/codex-protocol.constants.d.ts +2 -0
- package/dist/adapters/agents/codex/codex-protocol.constants.js +32 -0
- package/dist/adapters/agents/codex/codex-protocol.constants.js.map +1 -0
- package/dist/adapters/agents/{codex-provider.d.ts → codex/codex-provider.d.ts} +1 -1
- package/dist/adapters/agents/{codex-provider.js → codex/codex-provider.js} +1 -1
- package/dist/adapters/agents/codex/codex-provider.js.map +1 -0
- package/dist/adapters/agents/codex/codex-request.d.ts +4 -0
- package/dist/adapters/agents/{codex-request.js → codex/codex-request.js} +11 -2
- package/dist/adapters/agents/codex/codex-request.js.map +1 -0
- package/dist/adapters/agents/codex/codex.constants.d.ts +22 -0
- package/dist/adapters/agents/codex/codex.constants.js +38 -0
- package/dist/adapters/agents/codex/codex.constants.js.map +1 -0
- package/dist/adapters/agents/conversation-settings.d.ts +5 -0
- package/dist/adapters/agents/conversation-settings.js +13 -0
- package/dist/adapters/agents/conversation-settings.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-adapter.d.ts +3 -0
- package/dist/adapters/agents/copilot/copilot-adapter.js +53 -0
- package/dist/adapters/agents/copilot/copilot-adapter.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-authentication.d.ts +2 -0
- package/dist/adapters/agents/{copilot-authentication.js → copilot/copilot-authentication.js} +6 -6
- package/dist/adapters/agents/copilot/copilot-authentication.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-conversations.d.ts +5 -0
- package/dist/adapters/agents/copilot/copilot-conversations.js +32 -0
- package/dist/adapters/agents/copilot/copilot-conversations.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-descriptor.d.ts +36 -0
- package/dist/adapters/agents/copilot/copilot-descriptor.js +35 -0
- package/dist/adapters/agents/copilot/copilot-descriptor.js.map +1 -0
- package/dist/adapters/agents/{copilot-diagnostics.d.ts → copilot/copilot-diagnostics.d.ts} +1 -1
- package/dist/adapters/agents/{copilot-diagnostics.js → copilot/copilot-diagnostics.js} +1 -1
- package/dist/adapters/agents/copilot/copilot-diagnostics.js.map +1 -0
- package/dist/adapters/agents/{copilot-events.d.ts → copilot/copilot-events.d.ts} +1 -1
- package/dist/adapters/agents/{copilot-events.js → copilot/copilot-events.js} +10 -6
- package/dist/adapters/agents/copilot/copilot-events.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-mcp.d.ts +2 -0
- package/dist/adapters/agents/copilot/copilot-mcp.js +30 -0
- package/dist/adapters/agents/copilot/copilot-mcp.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-protocol.constants.d.ts +2 -0
- package/dist/adapters/agents/copilot/copilot-protocol.constants.js +56 -0
- package/dist/adapters/agents/copilot/copilot-protocol.constants.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot-request.d.ts +5 -0
- package/dist/adapters/agents/{copilot-request.js → copilot/copilot-request.js} +4 -3
- package/dist/adapters/agents/copilot/copilot-request.js.map +1 -0
- package/dist/adapters/agents/{copilot-usage.d.ts → copilot/copilot-usage.d.ts} +1 -1
- package/dist/adapters/agents/{copilot-usage.js → copilot/copilot-usage.js} +3 -3
- package/dist/adapters/agents/copilot/copilot-usage.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot.constants.d.ts +11 -0
- package/dist/adapters/agents/copilot/copilot.constants.js +29 -0
- package/dist/adapters/agents/copilot/copilot.constants.js.map +1 -0
- package/dist/adapters/agents/copilot/copilot.types.d.ts +10 -0
- package/dist/adapters/agents/copilot/copilot.types.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-adapter.d.ts +3 -0
- package/dist/adapters/agents/kimi/kimi-adapter.js +59 -0
- package/dist/adapters/agents/kimi/kimi-adapter.js.map +1 -0
- package/dist/adapters/agents/{kimi-authentication.d.ts → kimi/kimi-authentication.d.ts} +1 -1
- package/dist/adapters/agents/{kimi-authentication.js → kimi/kimi-authentication.js} +6 -7
- package/dist/adapters/agents/kimi/kimi-authentication.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-conversations.d.ts +5 -0
- package/dist/adapters/agents/kimi/kimi-conversations.js +49 -0
- package/dist/adapters/agents/kimi/kimi-conversations.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-descriptor.d.ts +30 -0
- package/dist/adapters/agents/kimi/kimi-descriptor.js +31 -0
- package/dist/adapters/agents/kimi/kimi-descriptor.js.map +1 -0
- package/dist/adapters/agents/{kimi-diagnostics.d.ts → kimi/kimi-diagnostics.d.ts} +1 -1
- package/dist/adapters/agents/{kimi-diagnostics.js → kimi/kimi-diagnostics.js} +1 -1
- package/dist/adapters/agents/kimi/kimi-diagnostics.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-events.d.ts +2 -0
- package/dist/adapters/agents/{kimi-events.js → kimi/kimi-events.js} +3 -3
- package/dist/adapters/agents/kimi/kimi-events.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-fork.d.ts +2 -0
- package/dist/adapters/agents/{kimi-fork.js → kimi/kimi-fork.js} +3 -3
- package/dist/adapters/agents/kimi/kimi-fork.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-mcp.d.ts +6 -0
- package/dist/adapters/agents/kimi/kimi-mcp.js +65 -0
- package/dist/adapters/agents/kimi/kimi-mcp.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-protocol.constants.d.ts +2 -0
- package/dist/adapters/agents/kimi/kimi-protocol.constants.js +50 -0
- package/dist/adapters/agents/kimi/kimi-protocol.constants.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-request.d.ts +5 -0
- package/dist/adapters/agents/{kimi-request.js → kimi/kimi-request.js} +3 -3
- package/dist/adapters/agents/kimi/kimi-request.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi-usage.d.ts +2 -0
- package/dist/adapters/agents/{kimi-usage.js → kimi/kimi-usage.js} +2 -2
- package/dist/adapters/agents/kimi/kimi-usage.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi.constants.d.ts +28 -0
- package/dist/adapters/agents/kimi/kimi.constants.js +51 -0
- package/dist/adapters/agents/kimi/kimi.constants.js.map +1 -0
- package/dist/adapters/agents/kimi/kimi.types.d.ts +11 -0
- package/dist/adapters/agents/kimi/kimi.types.js.map +1 -0
- package/dist/adapters/agents/mcp-configuration.d.ts +12 -0
- package/dist/adapters/agents/mcp-configuration.js +57 -0
- package/dist/adapters/agents/mcp-configuration.js.map +1 -0
- package/dist/adapters/agents/mcp-support.types.d.ts +7 -0
- package/dist/adapters/agents/mcp-support.types.js +2 -0
- package/dist/adapters/agents/mcp-support.types.js.map +1 -0
- package/dist/adapters/agents/model-support.constants.d.ts +0 -7
- package/dist/adapters/agents/model-support.constants.js +0 -26
- package/dist/adapters/agents/model-support.constants.js.map +1 -1
- package/dist/adapters/agents/model-support.d.ts +2 -1
- package/dist/adapters/agents/model-support.js +12 -1
- package/dist/adapters/agents/model-support.js.map +1 -1
- package/dist/adapters/agents/protocol-fixtures.types.d.ts +0 -1
- package/dist/adapters/agents/protocol-fixtures.types.js.map +1 -1
- package/dist/adapters/agents/settings.types.d.ts +12 -0
- package/dist/adapters/agents/settings.types.js.map +1 -1
- package/dist/adapters/agents/text-matcher.d.ts +1 -0
- package/dist/adapters/agents/text-matcher.js +5 -0
- package/dist/adapters/agents/text-matcher.js.map +1 -0
- package/dist/adapters/agents/unavailable.constants.d.ts +3 -0
- package/dist/adapters/agents/unavailable.constants.js +13 -0
- package/dist/adapters/agents/unavailable.constants.js.map +1 -0
- package/dist/adapters/models/anthropic-model-provider.d.ts +1 -1
- package/dist/adapters/models/anthropic-model-provider.js +1 -1
- package/dist/adapters/models/anthropic-model-provider.js.map +1 -1
- package/dist/adapters/models/http-provider.js +12 -3
- package/dist/adapters/models/http-provider.js.map +1 -1
- package/dist/adapters/models/model.constants.d.ts +5 -0
- package/dist/adapters/models/model.constants.js +15 -0
- package/dist/adapters/models/model.constants.js.map +1 -1
- package/dist/adapters/models/openai-model-provider.d.ts +1 -1
- package/dist/adapters/models/openai-model-provider.js +1 -1
- package/dist/adapters/models/openai-model-provider.js.map +1 -1
- package/dist/adapters/models/stream-events.js +14 -5
- package/dist/adapters/models/stream-events.js.map +1 -1
- package/dist/adapters/tools/edit-tools.d.ts +1 -1
- package/dist/adapters/tools/edit-tools.js +1 -1
- package/dist/adapters/tools/edit-tools.js.map +1 -1
- package/dist/adapters/tools/file-tools.d.ts +1 -1
- package/dist/adapters/tools/file-tools.js +1 -1
- package/dist/adapters/tools/file-tools.js.map +1 -1
- package/dist/adapters/tools/git-tools.d.ts +1 -1
- package/dist/adapters/tools/git-tools.js +1 -1
- package/dist/adapters/tools/git-tools.js.map +1 -1
- package/dist/adapters/tools/mcp-connection.d.ts +2 -0
- package/dist/adapters/tools/mcp-connection.js +93 -0
- package/dist/adapters/tools/mcp-connection.js.map +1 -0
- package/dist/adapters/tools/mcp-content.d.ts +4 -0
- package/dist/adapters/tools/mcp-content.js +24 -0
- package/dist/adapters/tools/mcp-content.js.map +1 -0
- package/dist/adapters/tools/mcp-launcher.constants.d.ts +1 -0
- package/dist/adapters/tools/mcp-launcher.constants.js +210 -0
- package/dist/adapters/tools/mcp-launcher.constants.js.map +1 -0
- package/dist/adapters/tools/mcp-process.d.ts +4 -0
- package/dist/adapters/tools/mcp-process.js +65 -0
- package/dist/adapters/tools/mcp-process.js.map +1 -0
- package/dist/adapters/tools/mcp-resources.d.ts +5 -0
- package/dist/adapters/tools/mcp-resources.js +157 -0
- package/dist/adapters/tools/mcp-resources.js.map +1 -0
- package/dist/adapters/tools/mcp-tools.d.ts +6 -0
- package/dist/adapters/tools/mcp-tools.js +98 -0
- package/dist/adapters/tools/mcp-tools.js.map +1 -0
- package/dist/adapters/tools/mcp.constants.d.ts +22 -0
- package/dist/adapters/tools/mcp.constants.js +24 -0
- package/dist/adapters/tools/mcp.constants.js.map +1 -0
- package/dist/adapters/tools/mcp.d.ts +4 -0
- package/dist/adapters/tools/mcp.js +88 -0
- package/dist/adapters/tools/mcp.js.map +1 -0
- package/dist/adapters/tools/mcp.types.d.ts +55 -0
- package/dist/adapters/tools/mcp.types.js +2 -0
- package/dist/adapters/tools/mcp.types.js.map +1 -0
- package/dist/adapters/tools/search-tools.d.ts +1 -1
- package/dist/adapters/tools/search-tools.js +1 -1
- package/dist/adapters/tools/search-tools.js.map +1 -1
- package/dist/adapters/tools/shell-tools.d.ts +1 -1
- package/dist/adapters/tools/shell-tools.js +1 -1
- package/dist/adapters/tools/shell-tools.js.map +1 -1
- package/dist/adapters/triggers/github-webhook.d.ts +4 -0
- package/dist/adapters/triggers/github-webhook.js +41 -0
- package/dist/adapters/triggers/github-webhook.js.map +1 -0
- package/dist/adapters/triggers/gitlab-webhook.d.ts +4 -0
- package/dist/adapters/triggers/gitlab-webhook.js +48 -0
- package/dist/adapters/triggers/gitlab-webhook.js.map +1 -0
- package/dist/adapters/triggers/slack-request.d.ts +4 -0
- package/dist/adapters/triggers/slack-request.js +55 -0
- package/dist/adapters/triggers/slack-request.js.map +1 -0
- package/dist/adapters/triggers/standard-webhook.d.ts +6 -0
- package/dist/adapters/triggers/standard-webhook.js +50 -0
- package/dist/adapters/triggers/standard-webhook.js.map +1 -0
- package/dist/adapters/triggers/trigger-body.d.ts +5 -0
- package/dist/adapters/triggers/trigger-body.js +16 -0
- package/dist/adapters/triggers/trigger-body.js.map +1 -0
- package/dist/adapters/triggers/trigger-events.d.ts +6 -0
- package/dist/adapters/triggers/trigger-events.js +91 -0
- package/dist/adapters/triggers/trigger-events.js.map +1 -0
- package/dist/adapters/triggers/triggers.types.d.ts +47 -0
- package/dist/adapters/triggers/triggers.types.js +2 -0
- package/dist/adapters/triggers/triggers.types.js.map +1 -0
- package/dist/application/agent-bootstrap.js +16 -19
- package/dist/application/agent-bootstrap.js.map +1 -1
- package/dist/application/agent-bootstrap.types.d.ts +2 -11
- package/dist/application/agent-bootstrap.types.js.map +1 -1
- package/dist/application/agent-configuration.d.ts +4 -0
- package/dist/application/agent-configuration.js +50 -0
- package/dist/application/agent-configuration.js.map +1 -0
- package/dist/application/agent-failure.d.ts +11 -0
- package/dist/application/agent-failure.js +48 -0
- package/dist/application/agent-failure.js.map +1 -0
- package/dist/application/agent-fallback.d.ts +5 -0
- package/dist/application/agent-fallback.js +90 -0
- package/dist/application/agent-fallback.js.map +1 -0
- package/dist/application/agent-fallback.types.d.ts +9 -0
- package/dist/application/agent-fallback.types.js +2 -0
- package/dist/application/agent-fallback.types.js.map +1 -0
- package/dist/application/agent-output.js +19 -2
- package/dist/application/agent-output.js.map +1 -1
- package/dist/application/agent-storage.js +5 -10
- package/dist/application/agent-storage.js.map +1 -1
- package/dist/application/agent-turn.js +54 -22
- package/dist/application/agent-turn.js.map +1 -1
- package/dist/application/artifact-tasks.d.ts +1 -1
- package/dist/application/artifact-tasks.js +3 -3
- package/dist/application/artifact-tasks.js.map +1 -1
- package/dist/application/cli-steering.d.ts +6 -0
- package/dist/application/cli-steering.js +107 -0
- package/dist/application/cli-steering.js.map +1 -0
- package/dist/application/cli-steering.types.d.ts +15 -0
- package/dist/application/cli-steering.types.js +2 -0
- package/dist/application/cli-steering.types.js.map +1 -0
- package/dist/application/configuration-installer.constants.d.ts +1 -0
- package/dist/application/configuration-installer.constants.js +37 -0
- package/dist/application/configuration-installer.constants.js.map +1 -0
- package/dist/application/conversation-stores.d.ts +13 -0
- package/dist/application/conversation-stores.js +15 -0
- package/dist/application/conversation-stores.js.map +1 -0
- package/dist/application/custom-turn.js +11 -4
- package/dist/application/custom-turn.js.map +1 -1
- package/dist/application/dispatch-observation.js +14 -1
- package/dist/application/dispatch-observation.js.map +1 -1
- package/dist/application/dispatch-validation.js +10 -1
- package/dist/application/dispatch-validation.js.map +1 -1
- package/dist/application/dispatch.d.ts +2 -4
- package/dist/application/dispatch.js +20 -5
- package/dist/application/dispatch.js.map +1 -1
- package/dist/application/doctor-agent.constants.d.ts +2 -2
- package/dist/application/doctor-agent.constants.js +11 -45
- package/dist/application/doctor-agent.constants.js.map +1 -1
- package/dist/application/doctor-protocol.js +1 -2
- package/dist/application/doctor-protocol.js.map +1 -1
- package/dist/application/doctor.types.d.ts +4 -1
- package/dist/application/doctor.types.js.map +1 -1
- package/dist/application/execution.constants.d.ts +2 -0
- package/dist/application/execution.constants.js +2 -0
- package/dist/application/execution.constants.js.map +1 -1
- package/dist/application/execution.js +13 -5
- package/dist/application/execution.js.map +1 -1
- package/dist/application/execution.types.d.ts +11 -2
- package/dist/application/execution.types.js.map +1 -1
- package/dist/application/harness-loop.js +20 -5
- package/dist/application/harness-loop.js.map +1 -1
- package/dist/application/harness-mcp.d.ts +4 -0
- package/dist/application/harness-mcp.js +16 -0
- package/dist/application/harness-mcp.js.map +1 -0
- package/dist/application/harness-steering.d.ts +4 -0
- package/dist/application/harness-steering.js +16 -0
- package/dist/application/harness-steering.js.map +1 -0
- package/dist/application/harness-subagent.js +9 -4
- package/dist/application/harness-subagent.js.map +1 -1
- package/dist/application/harness.types.d.ts +12 -0
- package/dist/application/harness.types.js.map +1 -1
- package/dist/application/interactive-task-execution.d.ts +3 -0
- package/dist/application/interactive-task-execution.js +76 -0
- package/dist/application/interactive-task-execution.js.map +1 -0
- package/dist/application/interactive-task-protocol.d.ts +4 -0
- package/dist/application/interactive-task-protocol.js +56 -0
- package/dist/application/interactive-task-protocol.js.map +1 -0
- package/dist/application/interactive-task.constants.d.ts +4 -0
- package/dist/application/interactive-task.constants.js +7 -0
- package/dist/application/interactive-task.constants.js.map +1 -0
- package/dist/application/interactive-task.d.ts +3 -0
- package/dist/application/interactive-task.js +84 -0
- package/dist/application/interactive-task.js.map +1 -0
- package/dist/application/interactive-task.types.d.ts +44 -0
- package/dist/application/interactive-task.types.js +2 -0
- package/dist/application/interactive-task.types.js.map +1 -0
- package/dist/application/outpost.types.d.ts +8 -2
- package/dist/application/outpost.types.js.map +1 -1
- package/dist/application/queue-worker.js +19 -1
- package/dist/application/queue-worker.js.map +1 -1
- package/dist/application/queued-task.d.ts +1 -1
- package/dist/application/queued-task.js +20 -5
- package/dist/application/queued-task.js.map +1 -1
- package/dist/application/quota-resume.constants.d.ts +1 -0
- package/dist/application/quota-resume.constants.js +2 -0
- package/dist/application/quota-resume.constants.js.map +1 -0
- package/dist/application/quota-resume.d.ts +9 -0
- package/dist/application/quota-resume.js +38 -0
- package/dist/application/quota-resume.js.map +1 -0
- package/dist/application/quota-resume.types.d.ts +1 -0
- package/dist/application/quota-resume.types.js +2 -0
- package/dist/application/quota-resume.types.js.map +1 -0
- package/dist/application/recovery-retention-policy.js +1 -1
- package/dist/application/recovery-retention-policy.js.map +1 -1
- package/dist/application/recovery-retention.js +3 -3
- package/dist/application/recovery-retention.js.map +1 -1
- package/dist/application/recovery-retention.types.d.ts +1 -1
- package/dist/application/recovery-retention.types.js.map +1 -1
- package/dist/application/remote-workspace.js +2 -1
- package/dist/application/remote-workspace.js.map +1 -1
- package/dist/application/replay-recording.d.ts +2 -0
- package/dist/application/replay-recording.js +22 -0
- package/dist/application/replay-recording.js.map +1 -0
- package/dist/application/replay-turn.d.ts +4 -0
- package/dist/application/replay-turn.js +67 -0
- package/dist/application/replay-turn.js.map +1 -0
- package/dist/application/replay-workspace.d.ts +4 -0
- package/dist/application/replay-workspace.js +71 -0
- package/dist/application/replay-workspace.js.map +1 -0
- package/dist/application/replay-workspace.types.d.ts +6 -0
- package/dist/application/replay-workspace.types.js +2 -0
- package/dist/application/replay-workspace.types.js.map +1 -0
- package/dist/application/repository-fingerprint.d.ts +1 -0
- package/dist/application/repository-fingerprint.js +18 -0
- package/dist/application/repository-fingerprint.js.map +1 -0
- package/dist/application/sandbox-agents.js +8 -6
- package/dist/application/sandbox-agents.js.map +1 -1
- package/dist/application/sandbox-attach.js +6 -6
- package/dist/application/sandbox-attach.js.map +1 -1
- package/dist/application/sandbox-dispatch.js +86 -42
- package/dist/application/sandbox-dispatch.js.map +1 -1
- package/dist/application/sandbox-provision.js +6 -4
- package/dist/application/sandbox-provision.js.map +1 -1
- package/dist/application/sandbox-session.types.d.ts +20 -0
- package/dist/application/sandbox-session.types.js.map +1 -1
- package/dist/application/sandbox.js +3 -2
- package/dist/application/sandbox.js.map +1 -1
- package/dist/application/schedules.constants.d.ts +3 -0
- package/dist/application/schedules.constants.js +4 -0
- package/dist/application/schedules.constants.js.map +1 -0
- package/dist/application/schedules.d.ts +5 -0
- package/dist/application/schedules.js +80 -0
- package/dist/application/schedules.js.map +1 -0
- package/dist/application/schedules.types.d.ts +30 -0
- package/dist/application/schedules.types.js +2 -0
- package/dist/application/schedules.types.js.map +1 -0
- package/dist/application/speculation-checkpoint.js +19 -2
- package/dist/application/speculation-checkpoint.js.map +1 -1
- package/dist/application/speculation-checkpoint.types.d.ts +1 -1
- package/dist/application/speculation-checkpoint.types.js.map +1 -1
- package/dist/application/speculation-resume.js +21 -0
- package/dist/application/speculation-resume.js.map +1 -1
- package/dist/application/speculation-run.js +18 -1
- package/dist/application/speculation-run.js.map +1 -1
- package/dist/application/speculation.types.d.ts +9 -4
- package/dist/application/speculation.types.js.map +1 -1
- package/dist/application/steering-scope.d.ts +7 -0
- package/dist/application/steering-scope.js +33 -0
- package/dist/application/steering-scope.js.map +1 -0
- package/dist/application/steering-turns.d.ts +4 -0
- package/dist/application/steering-turns.js +47 -0
- package/dist/application/steering-turns.js.map +1 -0
- package/dist/application/steering-turns.types.d.ts +7 -0
- package/dist/application/steering-turns.types.js +2 -0
- package/dist/application/steering-turns.types.js.map +1 -0
- package/dist/application/stop-reason.js +3 -0
- package/dist/application/stop-reason.js.map +1 -1
- package/dist/application/tasks.d.ts +3 -3
- package/dist/application/tasks.js +18 -11
- package/dist/application/tasks.js.map +1 -1
- package/dist/application/tasks.types.d.ts +7 -2
- package/dist/application/tasks.types.js.map +1 -1
- package/dist/application/tool-execution.js +1 -0
- package/dist/application/tool-execution.js.map +1 -1
- package/dist/application/transport-inspection.constants.js +1 -0
- package/dist/application/transport-inspection.constants.js.map +1 -1
- package/dist/application/transport-retention.js +33 -1
- package/dist/application/transport-retention.js.map +1 -1
- package/dist/application/workflow-job.d.ts +4 -0
- package/dist/application/workflow-job.js +83 -0
- package/dist/application/workflow-job.js.map +1 -0
- package/dist/application/workflow-job.types.d.ts +21 -0
- package/dist/application/workflow-job.types.js +2 -0
- package/dist/application/workflow-job.types.js.map +1 -0
- package/dist/cli/image-recipe.d.ts +4 -0
- package/dist/cli/image-recipe.js +28 -0
- package/dist/cli/image-recipe.js.map +1 -0
- package/dist/cli/init-authentication.d.ts +2 -1
- package/dist/cli/init-authentication.js +2 -4
- package/dist/cli/init-authentication.js.map +1 -1
- package/dist/cli/init-command.js +4 -3
- package/dist/cli/init-command.js.map +1 -1
- package/dist/cli/main.constants.d.ts +2 -59
- package/dist/cli/main.constants.js +3 -75
- package/dist/cli/main.constants.js.map +1 -1
- package/dist/cli/main.js +0 -0
- package/dist/cli/scaffold-validation.js +7 -13
- package/dist/cli/scaffold-validation.js.map +1 -1
- package/dist/cli/scaffold.constants.js +3 -7
- package/dist/cli/scaffold.constants.js.map +1 -1
- package/dist/cli/scaffold.types.d.ts +4 -8
- package/dist/cli/scaffold.types.js.map +1 -1
- package/dist/cli/starters.js +13 -5
- package/dist/cli/starters.js.map +1 -1
- package/dist/domain/agent-observation.js +1 -0
- package/dist/domain/agent-observation.js.map +1 -1
- package/dist/domain/agent.d.ts +3 -3
- package/dist/domain/agent.js +2 -2
- package/dist/domain/agent.js.map +1 -1
- package/dist/domain/agent.types.d.ts +61 -3
- package/dist/domain/agent.types.js.map +1 -1
- package/dist/domain/artifact.d.ts +2 -4
- package/dist/domain/artifact.js +38 -40
- package/dist/domain/artifact.js.map +1 -1
- package/dist/domain/command.types.d.ts +2 -0
- package/dist/domain/command.types.js.map +1 -1
- package/dist/domain/conversation.d.ts +3 -0
- package/dist/domain/conversation.js +18 -0
- package/dist/domain/conversation.js.map +1 -0
- package/dist/domain/conversation.types.d.ts +9 -0
- package/dist/domain/conversation.types.js.map +1 -1
- package/dist/domain/cron.constants.d.ts +10 -0
- package/dist/domain/cron.constants.js +47 -0
- package/dist/domain/cron.constants.js.map +1 -0
- package/dist/domain/cron.d.ts +2 -0
- package/dist/domain/cron.js +169 -0
- package/dist/domain/cron.js.map +1 -0
- package/dist/domain/cron.types.d.ts +27 -0
- package/dist/domain/cron.types.js +2 -0
- package/dist/domain/cron.types.js.map +1 -0
- package/dist/domain/errors.constants.d.ts +1 -0
- package/dist/domain/errors.constants.js +2 -0
- package/dist/domain/errors.constants.js.map +1 -0
- package/dist/domain/errors.d.ts +2 -0
- package/dist/domain/errors.js +13 -0
- package/dist/domain/errors.js.map +1 -1
- package/dist/domain/errors.types.d.ts +1 -1
- package/dist/domain/errors.types.js.map +1 -1
- package/dist/domain/fallback-agent.constants.d.ts +3 -0
- package/dist/domain/fallback-agent.constants.js +10 -0
- package/dist/domain/fallback-agent.constants.js.map +1 -0
- package/dist/domain/fallback-agent.d.ts +7 -0
- package/dist/domain/fallback-agent.js +46 -0
- package/dist/domain/fallback-agent.js.map +1 -0
- package/dist/domain/fallback-agent.types.d.ts +37 -0
- package/dist/domain/fallback-agent.types.js +2 -0
- package/dist/domain/fallback-agent.types.js.map +1 -0
- package/dist/domain/harness.constants.js +1 -0
- package/dist/domain/harness.constants.js.map +1 -1
- package/dist/domain/harness.d.ts +1 -1
- package/dist/domain/harness.js +15 -9
- package/dist/domain/harness.js.map +1 -1
- package/dist/domain/harness.types.d.ts +7 -0
- package/dist/domain/harness.types.js.map +1 -1
- package/dist/domain/mcp-prompt.d.ts +3 -0
- package/dist/domain/mcp-prompt.js +21 -0
- package/dist/domain/mcp-prompt.js.map +1 -0
- package/dist/domain/mcp-prompt.types.d.ts +5 -0
- package/dist/domain/mcp-prompt.types.js +2 -0
- package/dist/domain/mcp-prompt.types.js.map +1 -0
- package/dist/domain/mcp-server.constants.d.ts +11 -0
- package/dist/domain/mcp-server.constants.js +37 -0
- package/dist/domain/mcp-server.constants.js.map +1 -0
- package/dist/domain/mcp-server.d.ts +7 -0
- package/dist/domain/mcp-server.js +186 -0
- package/dist/domain/mcp-server.js.map +1 -0
- package/dist/domain/mcp-server.types.d.ts +29 -0
- package/dist/domain/mcp-server.types.js +2 -0
- package/dist/domain/mcp-server.types.js.map +1 -0
- package/dist/domain/observation.types.d.ts +6 -1
- package/dist/domain/observation.types.js.map +1 -1
- package/dist/domain/ports.d.ts +2 -2
- package/dist/domain/ports.js.map +1 -1
- package/dist/domain/quota.d.ts +4 -0
- package/dist/domain/quota.js +21 -0
- package/dist/domain/quota.js.map +1 -0
- package/dist/domain/quota.types.d.ts +7 -0
- package/dist/domain/quota.types.js +2 -0
- package/dist/domain/quota.types.js.map +1 -0
- package/dist/domain/replay.constants.d.ts +11 -0
- package/dist/domain/replay.constants.js +44 -0
- package/dist/domain/replay.constants.js.map +1 -0
- package/dist/domain/replay.d.ts +11 -0
- package/dist/domain/replay.js +308 -0
- package/dist/domain/replay.js.map +1 -0
- package/dist/domain/replay.types.d.ts +103 -0
- package/dist/domain/replay.types.js +2 -0
- package/dist/domain/replay.types.js.map +1 -0
- package/dist/domain/response.d.ts +2 -4
- package/dist/domain/response.js +7 -5
- package/dist/domain/response.js.map +1 -1
- package/dist/domain/sandbox.types.d.ts +2 -0
- package/dist/domain/sandbox.types.js.map +1 -1
- package/dist/domain/steering.d.ts +10 -0
- package/dist/domain/steering.js +88 -0
- package/dist/domain/steering.js.map +1 -0
- package/dist/domain/steering.types.d.ts +42 -0
- package/dist/domain/steering.types.js +2 -0
- package/dist/domain/steering.types.js.map +1 -0
- package/dist/domain/subagent.js +2 -2
- package/dist/domain/subagent.js.map +1 -1
- package/dist/domain/task-queue.js +18 -0
- package/dist/domain/task-queue.js.map +1 -1
- package/dist/domain/task-queue.types.d.ts +9 -0
- package/dist/domain/task-queue.types.js.map +1 -1
- package/dist/domain/trigger-job.constants.d.ts +2 -0
- package/dist/domain/trigger-job.constants.js +3 -0
- package/dist/domain/trigger-job.constants.js.map +1 -0
- package/dist/domain/trigger-job.d.ts +5 -0
- package/dist/domain/trigger-job.js +22 -0
- package/dist/domain/trigger-job.js.map +1 -0
- package/dist/domain/trigger-job.types.d.ts +14 -0
- package/dist/domain/trigger-job.types.js +2 -0
- package/dist/domain/trigger-job.types.js.map +1 -0
- package/dist/domain/trigger.constants.d.ts +5 -0
- package/dist/domain/trigger.constants.js +6 -0
- package/dist/domain/trigger.constants.js.map +1 -0
- package/dist/domain/trigger.d.ts +8 -0
- package/dist/domain/trigger.js +32 -0
- package/dist/domain/trigger.js.map +1 -0
- package/dist/domain/trigger.types.d.ts +35 -0
- package/dist/domain/trigger.types.js +2 -0
- package/dist/domain/trigger.types.js.map +1 -0
- package/dist/domain/unavailable.d.ts +3 -0
- package/dist/domain/unavailable.js +9 -0
- package/dist/domain/unavailable.js.map +1 -0
- package/dist/domain/unavailable.types.d.ts +4 -0
- package/dist/domain/unavailable.types.js +2 -0
- package/dist/domain/unavailable.types.js.map +1 -0
- package/dist/domain/workflow/canonical-json.d.ts +3 -0
- package/dist/domain/workflow/canonical-json.js +13 -0
- package/dist/domain/workflow/canonical-json.js.map +1 -0
- package/dist/domain/workflow/checkpoint-validation.js +14 -1
- package/dist/domain/workflow/checkpoint-validation.js.map +1 -1
- package/dist/domain/workflow/checkpoint.js +13 -2
- package/dist/domain/workflow/checkpoint.js.map +1 -1
- package/dist/domain/workflow/gate-validation.js +2 -1
- package/dist/domain/workflow/gate-validation.js.map +1 -1
- package/dist/domain/workflow/gates.d.ts +2 -2
- package/dist/domain/workflow/gates.js +4 -4
- package/dist/domain/workflow/gates.js.map +1 -1
- package/dist/domain/workflow/input-validation.d.ts +7 -0
- package/dist/domain/workflow/input-validation.js +82 -0
- package/dist/domain/workflow/input-validation.js.map +1 -0
- package/dist/domain/workflow/input.d.ts +10 -0
- package/dist/domain/workflow/input.js +93 -0
- package/dist/domain/workflow/input.js.map +1 -0
- package/dist/domain/workflow/input.types.d.ts +37 -0
- package/dist/domain/workflow/input.types.js +2 -0
- package/dist/domain/workflow/input.types.js.map +1 -0
- package/dist/domain/workflow/loop-runner.d.ts +3 -0
- package/dist/domain/workflow/loop-runner.js +91 -0
- package/dist/domain/workflow/loop-runner.js.map +1 -0
- package/dist/domain/workflow/loop-task.d.ts +10 -0
- package/dist/domain/workflow/loop-task.js +39 -0
- package/dist/domain/workflow/loop-task.js.map +1 -0
- package/dist/domain/workflow/loop-task.types.d.ts +28 -0
- package/dist/domain/workflow/loop-task.types.js +2 -0
- package/dist/domain/workflow/loop-task.types.js.map +1 -0
- package/dist/domain/workflow/loop-validation.d.ts +4 -0
- package/dist/domain/workflow/loop-validation.js +62 -0
- package/dist/domain/workflow/loop-validation.js.map +1 -0
- package/dist/domain/workflow/quota-pause.d.ts +7 -0
- package/dist/domain/workflow/quota-pause.js +83 -0
- package/dist/domain/workflow/quota-pause.js.map +1 -0
- package/dist/domain/workflow/quota-pause.types.d.ts +14 -0
- package/dist/domain/workflow/quota-pause.types.js +2 -0
- package/dist/domain/workflow/quota-pause.types.js.map +1 -0
- package/dist/domain/workflow/quota-validation.d.ts +2 -0
- package/dist/domain/workflow/quota-validation.js +30 -0
- package/dist/domain/workflow/quota-validation.js.map +1 -0
- package/dist/domain/workflow/task-cache-entry.d.ts +3 -0
- package/dist/domain/workflow/task-cache-entry.js +47 -0
- package/dist/domain/workflow/task-cache-entry.js.map +1 -0
- package/dist/domain/workflow/task-cache.constants.d.ts +3 -0
- package/dist/domain/workflow/task-cache.constants.js +3 -0
- package/dist/domain/workflow/task-cache.constants.js.map +1 -0
- package/dist/domain/workflow/task-cache.d.ts +6 -0
- package/dist/domain/workflow/task-cache.js +92 -0
- package/dist/domain/workflow/task-cache.js.map +1 -0
- package/dist/domain/workflow/task-cache.types.d.ts +35 -0
- package/dist/domain/workflow/task-cache.types.js +2 -0
- package/dist/domain/workflow/task-cache.types.js.map +1 -0
- package/dist/domain/workflow/task-runner.js +100 -34
- package/dist/domain/workflow/task-runner.js.map +1 -1
- package/dist/domain/workflow/task.d.ts +1 -1
- package/dist/domain/workflow/task.js +22 -1
- package/dist/domain/workflow/task.js.map +1 -1
- package/dist/domain/workflow/validation.js +13 -2
- package/dist/domain/workflow/validation.js.map +1 -1
- package/dist/domain/workflow/workflow-scheduler.js +27 -2
- package/dist/domain/workflow/workflow-scheduler.js.map +1 -1
- package/dist/domain/workflow/workflow-state.js +20 -3
- package/dist/domain/workflow/workflow-state.js.map +1 -1
- package/dist/domain/workflow.d.ts +2 -2
- package/dist/domain/workflow.js +2 -2
- package/dist/domain/workflow.js.map +1 -1
- package/dist/domain/workflow.types.d.ts +26 -3
- package/dist/domain/workflow.types.js.map +1 -1
- package/dist/index.d.ts +78 -32
- package/dist/index.js +51 -28
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/conversations/harness-store.d.ts +1 -1
- package/dist/infrastructure/conversations/harness-store.js +2 -1
- package/dist/infrastructure/conversations/harness-store.js.map +1 -1
- package/dist/infrastructure/conversations/layout.types.d.ts +6 -1
- package/dist/infrastructure/conversations/layout.types.js.map +1 -1
- package/dist/infrastructure/conversations/session-bundle.constants.js +36 -62
- package/dist/infrastructure/conversations/session-bundle.constants.js.map +1 -1
- package/dist/infrastructure/conversations/session-bundle.d.ts +8 -5
- package/dist/infrastructure/conversations/session-bundle.js +64 -7
- package/dist/infrastructure/conversations/session-bundle.js.map +1 -1
- package/dist/infrastructure/conversations/session-bundle.types.d.ts +48 -1
- package/dist/infrastructure/conversations/session-bundle.types.js.map +1 -1
- package/dist/infrastructure/conversations/transcript-store.d.ts +4 -0
- package/dist/infrastructure/conversations/transcript-store.js +134 -0
- package/dist/infrastructure/conversations/transcript-store.js.map +1 -0
- package/dist/infrastructure/conversations.d.ts +6 -29
- package/dist/infrastructure/conversations.js +5 -37
- package/dist/infrastructure/conversations.js.map +1 -1
- package/dist/infrastructure/conversations.types.d.ts +2 -2
- package/dist/infrastructure/conversations.types.js.map +1 -1
- package/dist/infrastructure/custom-reporter.d.ts +1 -1
- package/dist/infrastructure/custom-reporter.js +1 -1
- package/dist/infrastructure/custom-reporter.js.map +1 -1
- package/dist/infrastructure/git/command.d.ts +2 -1
- package/dist/infrastructure/git/command.js +2 -2
- package/dist/infrastructure/git/command.js.map +1 -1
- package/dist/infrastructure/git/lock.constants.d.ts +4 -0
- package/dist/infrastructure/git/lock.constants.js +5 -0
- package/dist/infrastructure/git/lock.constants.js.map +1 -0
- package/dist/infrastructure/git/lock.js +19 -2
- package/dist/infrastructure/git/lock.js.map +1 -1
- package/dist/infrastructure/git/replay-commits.constants.d.ts +5 -0
- package/dist/infrastructure/git/replay-commits.constants.js +6 -0
- package/dist/infrastructure/git/replay-commits.constants.js.map +1 -0
- package/dist/infrastructure/git/replay-commits.d.ts +2 -0
- package/dist/infrastructure/git/replay-commits.js +92 -0
- package/dist/infrastructure/git/replay-commits.js.map +1 -0
- package/dist/infrastructure/inspection-file.d.ts +4 -0
- package/dist/infrastructure/inspection-file.js +9 -2
- package/dist/infrastructure/inspection-file.js.map +1 -1
- package/dist/infrastructure/journal.js +2 -2
- package/dist/infrastructure/journal.js.map +1 -1
- package/dist/infrastructure/journal.types.d.ts +1 -0
- package/dist/infrastructure/journal.types.js.map +1 -1
- package/dist/infrastructure/local-transport.d.ts +1 -1
- package/dist/infrastructure/local-transport.js +33 -7
- package/dist/infrastructure/local-transport.js.map +1 -1
- package/dist/infrastructure/opentelemetry.d.ts +1 -1
- package/dist/infrastructure/opentelemetry.js +1 -1
- package/dist/infrastructure/opentelemetry.js.map +1 -1
- package/dist/infrastructure/process.js +19 -5
- package/dist/infrastructure/process.js.map +1 -1
- package/dist/infrastructure/reporter.d.ts +1 -1
- package/dist/infrastructure/reporter.js +15 -1
- package/dist/infrastructure/reporter.js.map +1 -1
- package/dist/infrastructure/repository-transport.js +2 -2
- package/dist/infrastructure/repository-transport.js.map +1 -1
- package/dist/infrastructure/s3-transport.d.ts +1 -1
- package/dist/infrastructure/s3-transport.js +1 -1
- package/dist/infrastructure/s3-transport.js.map +1 -1
- package/dist/infrastructure/storage-inventory.types.d.ts +1 -1
- package/dist/infrastructure/storage-inventory.types.js.map +1 -1
- package/dist/infrastructure/task-queue-bullmq.d.ts +1 -1
- package/dist/infrastructure/task-queue-bullmq.js +1 -1
- package/dist/infrastructure/task-queue-bullmq.js.map +1 -1
- package/dist/infrastructure/task-queue-http.d.ts +1 -1
- package/dist/infrastructure/task-queue-http.js +1 -1
- package/dist/infrastructure/task-queue-http.js.map +1 -1
- package/dist/infrastructure/task-queue.d.ts +1 -1
- package/dist/infrastructure/task-queue.js +1 -1
- package/dist/infrastructure/task-queue.js.map +1 -1
- package/dist/infrastructure/transport-artifact-store.d.ts +1 -1
- package/dist/infrastructure/transport-artifact-store.js +1 -1
- package/dist/infrastructure/transport-artifact-store.js.map +1 -1
- package/dist/infrastructure/transport-checkpoint.d.ts +1 -1
- package/dist/infrastructure/transport-checkpoint.js +1 -1
- package/dist/infrastructure/transport-checkpoint.js.map +1 -1
- package/dist/infrastructure/transport-conversations.d.ts +2 -2
- package/dist/infrastructure/transport-conversations.js +11 -15
- package/dist/infrastructure/transport-conversations.js.map +1 -1
- package/dist/infrastructure/transport-task-cache.constants.d.ts +2 -0
- package/dist/infrastructure/transport-task-cache.constants.js +3 -0
- package/dist/infrastructure/transport-task-cache.constants.js.map +1 -0
- package/dist/infrastructure/transport-task-cache.d.ts +3 -0
- package/dist/infrastructure/transport-task-cache.js +56 -0
- package/dist/infrastructure/transport-task-cache.js.map +1 -0
- package/dist/infrastructure/transport-task-cache.types.d.ts +4 -0
- package/dist/infrastructure/transport-task-cache.types.js +2 -0
- package/dist/infrastructure/transport-task-cache.types.js.map +1 -0
- package/dist/infrastructure/transport.constants.d.ts +2 -0
- package/dist/infrastructure/transport.constants.js +2 -0
- package/dist/infrastructure/transport.constants.js.map +1 -1
- package/dist/infrastructure/trigger-server.constants.d.ts +2 -0
- package/dist/infrastructure/trigger-server.constants.js +3 -0
- package/dist/infrastructure/trigger-server.constants.js.map +1 -0
- package/dist/infrastructure/trigger-server.d.ts +3 -0
- package/dist/infrastructure/trigger-server.js +153 -0
- package/dist/infrastructure/trigger-server.js.map +1 -0
- package/dist/infrastructure/trigger-server.types.d.ts +30 -0
- package/dist/infrastructure/trigger-server.types.js +2 -0
- package/dist/infrastructure/trigger-server.types.js.map +1 -0
- package/dist/infrastructure/webhook-signature.d.ts +8 -0
- package/dist/infrastructure/webhook-signature.js +43 -0
- package/dist/infrastructure/webhook-signature.js.map +1 -0
- package/dist/infrastructure/workflow-decision-signature.d.ts +1 -1
- package/dist/infrastructure/workflow-decision-signature.js +1 -1
- package/dist/infrastructure/workflow-decision-signature.js.map +1 -1
- package/dist/providers/agents.d.ts +8 -8
- package/dist/providers/agents.js +5 -5
- package/dist/providers/agents.js.map +1 -1
- package/dist/providers/cloud-input.constants.d.ts +2 -0
- package/dist/providers/cloud-input.constants.js +24 -0
- package/dist/providers/cloud-input.constants.js.map +1 -0
- package/dist/providers/cloud-input.d.ts +8 -0
- package/dist/providers/cloud-input.js +42 -0
- package/dist/providers/cloud-input.js.map +1 -0
- package/dist/providers/cloud-input.types.d.ts +4 -0
- package/dist/providers/cloud-input.types.js +2 -0
- package/dist/providers/cloud-input.types.js.map +1 -0
- package/dist/providers/container.js +1 -0
- package/dist/providers/container.js.map +1 -1
- package/dist/providers/daytona-command.js +31 -13
- package/dist/providers/daytona-command.js.map +1 -1
- package/dist/providers/daytona.d.ts +1 -1
- package/dist/providers/daytona.js +2 -2
- package/dist/providers/daytona.js.map +1 -1
- package/dist/providers/docker.d.ts +1 -1
- package/dist/providers/docker.js +1 -1
- package/dist/providers/docker.js.map +1 -1
- package/dist/providers/factories.d.ts +2 -2
- package/dist/providers/factories.js +2 -2
- package/dist/providers/factories.js.map +1 -1
- package/dist/providers/firecracker.d.ts +1 -1
- package/dist/providers/firecracker.js +2 -1
- package/dist/providers/firecracker.js.map +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/local.js +2 -1
- package/dist/providers/local.js.map +1 -1
- package/dist/providers/podman.d.ts +1 -1
- package/dist/providers/podman.js +1 -1
- package/dist/providers/podman.js.map +1 -1
- package/dist/providers/vercel-command.js +51 -14
- package/dist/providers/vercel-command.js.map +1 -1
- package/dist/providers/vercel.d.ts +1 -1
- package/dist/providers/vercel.js +2 -2
- package/dist/providers/vercel.js.map +1 -1
- package/dist/providers/versions.constants.d.ts +1 -7
- package/dist/providers/versions.constants.js +2 -7
- package/dist/providers/versions.constants.js.map +1 -1
- package/package.json +17 -16
- package/dist/adapters/agents/antigravity-adapter.d.ts +0 -3
- package/dist/adapters/agents/antigravity-adapter.js +0 -41
- package/dist/adapters/agents/antigravity-adapter.js.map +0 -1
- package/dist/adapters/agents/antigravity-authentication.d.ts +0 -2
- package/dist/adapters/agents/antigravity-authentication.js.map +0 -1
- package/dist/adapters/agents/antigravity-diagnostics.js.map +0 -1
- package/dist/adapters/agents/antigravity-events.js.map +0 -1
- package/dist/adapters/agents/antigravity-request.d.ts +0 -5
- package/dist/adapters/agents/antigravity-request.js.map +0 -1
- package/dist/adapters/agents/antigravity.constants.d.ts +0 -3
- package/dist/adapters/agents/antigravity.constants.js +0 -4
- package/dist/adapters/agents/antigravity.constants.js.map +0 -1
- package/dist/adapters/agents/antigravity.types.d.ts +0 -7
- package/dist/adapters/agents/antigravity.types.js.map +0 -1
- package/dist/adapters/agents/claude-adapter.d.ts +0 -3
- package/dist/adapters/agents/claude-adapter.js +0 -45
- package/dist/adapters/agents/claude-adapter.js.map +0 -1
- package/dist/adapters/agents/claude-authentication.d.ts +0 -2
- package/dist/adapters/agents/claude-authentication.js.map +0 -1
- package/dist/adapters/agents/claude-diagnostics.d.ts +0 -1
- package/dist/adapters/agents/claude-diagnostics.js.map +0 -1
- package/dist/adapters/agents/claude-events.js.map +0 -1
- package/dist/adapters/agents/claude-request.d.ts +0 -4
- package/dist/adapters/agents/claude-request.js.map +0 -1
- package/dist/adapters/agents/codex-adapter.d.ts +0 -3
- package/dist/adapters/agents/codex-adapter.js +0 -34
- package/dist/adapters/agents/codex-adapter.js.map +0 -1
- package/dist/adapters/agents/codex-authentication.d.ts +0 -3
- package/dist/adapters/agents/codex-authentication.js.map +0 -1
- package/dist/adapters/agents/codex-diagnostics.d.ts +0 -1
- package/dist/adapters/agents/codex-diagnostics.js.map +0 -1
- package/dist/adapters/agents/codex-events.d.ts +0 -2
- package/dist/adapters/agents/codex-events.js.map +0 -1
- package/dist/adapters/agents/codex-provider.js.map +0 -1
- package/dist/adapters/agents/codex-request.d.ts +0 -4
- package/dist/adapters/agents/codex-request.js.map +0 -1
- package/dist/adapters/agents/copilot-adapter.d.ts +0 -3
- package/dist/adapters/agents/copilot-adapter.js +0 -45
- package/dist/adapters/agents/copilot-adapter.js.map +0 -1
- package/dist/adapters/agents/copilot-authentication.d.ts +0 -2
- package/dist/adapters/agents/copilot-authentication.js.map +0 -1
- package/dist/adapters/agents/copilot-diagnostics.js.map +0 -1
- package/dist/adapters/agents/copilot-events.js.map +0 -1
- package/dist/adapters/agents/copilot-request.d.ts +0 -5
- package/dist/adapters/agents/copilot-request.js.map +0 -1
- package/dist/adapters/agents/copilot-usage.js.map +0 -1
- package/dist/adapters/agents/copilot.types.d.ts +0 -6
- package/dist/adapters/agents/copilot.types.js.map +0 -1
- package/dist/adapters/agents/kimi-adapter.d.ts +0 -3
- package/dist/adapters/agents/kimi-adapter.js +0 -51
- package/dist/adapters/agents/kimi-adapter.js.map +0 -1
- package/dist/adapters/agents/kimi-authentication.js.map +0 -1
- package/dist/adapters/agents/kimi-diagnostics.js.map +0 -1
- package/dist/adapters/agents/kimi-events.d.ts +0 -2
- package/dist/adapters/agents/kimi-events.js.map +0 -1
- package/dist/adapters/agents/kimi-fork.d.ts +0 -2
- package/dist/adapters/agents/kimi-fork.js.map +0 -1
- package/dist/adapters/agents/kimi-request.d.ts +0 -5
- package/dist/adapters/agents/kimi-request.js.map +0 -1
- package/dist/adapters/agents/kimi-usage.d.ts +0 -2
- package/dist/adapters/agents/kimi-usage.js.map +0 -1
- package/dist/adapters/agents/kimi.constants.d.ts +0 -13
- package/dist/adapters/agents/kimi.constants.js +0 -14
- package/dist/adapters/agents/kimi.constants.js.map +0 -1
- package/dist/adapters/agents/kimi.types.d.ts +0 -7
- package/dist/adapters/agents/kimi.types.js.map +0 -1
- package/dist/adapters/agents/protocol-fixtures.constants.d.ts +0 -2
- package/dist/adapters/agents/protocol-fixtures.constants.js +0 -227
- package/dist/adapters/agents/protocol-fixtures.constants.js.map +0 -1
- package/dist/application/agent-bootstrap.constants.d.ts +0 -2
- package/dist/application/agent-bootstrap.constants.js +0 -30
- package/dist/application/agent-bootstrap.constants.js.map +0 -1
- package/dist/infrastructure/conversations/capture.d.ts +0 -4
- package/dist/infrastructure/conversations/capture.js +0 -87
- package/dist/infrastructure/conversations/capture.js.map +0 -1
- package/dist/infrastructure/conversations/capture.types.d.ts +0 -5
- package/dist/infrastructure/conversations/capture.types.js +0 -2
- package/dist/infrastructure/conversations/capture.types.js.map +0 -1
- package/dist/infrastructure/conversations/claude-layout.d.ts +0 -2
- package/dist/infrastructure/conversations/claude-layout.js +0 -18
- package/dist/infrastructure/conversations/claude-layout.js.map +0 -1
- package/dist/infrastructure/conversations/codex-layout.d.ts +0 -2
- package/dist/infrastructure/conversations/codex-layout.js +0 -17
- package/dist/infrastructure/conversations/codex-layout.js.map +0 -1
- package/dist/infrastructure/conversations/layout.d.ts +0 -3
- package/dist/infrastructure/conversations/layout.js +0 -9
- package/dist/infrastructure/conversations/layout.js.map +0 -1
- package/dist/infrastructure/conversations/locate.d.ts +0 -2
- package/dist/infrastructure/conversations/locate.js +0 -24
- package/dist/infrastructure/conversations/locate.js.map +0 -1
- package/dist/infrastructure/conversations/native-store.d.ts +0 -3
- package/dist/infrastructure/conversations/native-store.js +0 -27
- package/dist/infrastructure/conversations/native-store.js.map +0 -1
- package/dist/infrastructure/conversations/paths.d.ts +0 -4
- package/dist/infrastructure/conversations/paths.js +0 -11
- package/dist/infrastructure/conversations/paths.js.map +0 -1
- package/dist/infrastructure/conversations/restore.d.ts +0 -3
- package/dist/infrastructure/conversations/restore.js +0 -42
- package/dist/infrastructure/conversations/restore.js.map +0 -1
- package/dist/providers/antigravity-install.constants.js.map +0 -1
- package/dist/providers/antigravity-install.js.map +0 -1
- package/dist/providers/antigravity-install.types.js.map +0 -1
- /package/dist/{providers → adapters/agents/antigravity}/antigravity-install.constants.d.ts +0 -0
- /package/dist/{providers → adapters/agents/antigravity}/antigravity-install.constants.js +0 -0
- /package/dist/{providers → adapters/agents/antigravity}/antigravity-install.d.ts +0 -0
- /package/dist/{providers → adapters/agents/antigravity}/antigravity-install.types.d.ts +0 -0
- /package/dist/{providers → adapters/agents/antigravity}/antigravity-install.types.js +0 -0
- /package/dist/adapters/agents/{antigravity.types.js → antigravity/antigravity.types.js} +0 -0
- /package/dist/adapters/agents/{copilot.types.js → copilot/copilot.types.js} +0 -0
- /package/dist/adapters/agents/{kimi.types.js → kimi/kimi.types.js} +0 -0
|
@@ -6,12 +6,60 @@ import { invariant, OutpostError } from "../../domain/errors.js";
|
|
|
6
6
|
import { executeProcess, requireSuccess } from "../process.js";
|
|
7
7
|
import { validId } from "./identity.js";
|
|
8
8
|
import { sessionBundleLimits, sessionBundleScript, } from "./session-bundle.constants.js";
|
|
9
|
+
function hookSource(name, hook) {
|
|
10
|
+
if (hook === undefined)
|
|
11
|
+
return undefined;
|
|
12
|
+
invariant(typeof hook === "function", `Session bundle ${name} must be a function`);
|
|
13
|
+
const source = Function.prototype.toString.call(hook);
|
|
14
|
+
try {
|
|
15
|
+
// Compiles without running: hooks execute later in the sandbox from their source.
|
|
16
|
+
new Function(`return (${source})`);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
invariant(false, `Session bundle ${name} must be a self-contained function expression, not a method`);
|
|
20
|
+
}
|
|
21
|
+
return source;
|
|
22
|
+
}
|
|
23
|
+
function pattern(name, value) {
|
|
24
|
+
invariant(value instanceof RegExp, `Session bundle ${name} must be a RegExp`);
|
|
25
|
+
invariant(!/[gy]/.test(value.flags), `Session bundle ${name} cannot use the g or y flags`);
|
|
26
|
+
return { source: value.source, flags: value.flags };
|
|
27
|
+
}
|
|
28
|
+
/** Serializes a profile into the argument read by the in-sandbox bundle script. */
|
|
29
|
+
export function sessionBundleProfile(profile) {
|
|
30
|
+
const { format, root, sessions, required, relocated = [] } = profile;
|
|
31
|
+
for (const [name, value] of Object.entries({
|
|
32
|
+
format,
|
|
33
|
+
sessions,
|
|
34
|
+
"root.directory": root?.directory,
|
|
35
|
+
}))
|
|
36
|
+
invariant(typeof value === "string" && value.length > 0, `Session bundle ${name} must be a non-empty string`);
|
|
37
|
+
invariant(root.variable === undefined ||
|
|
38
|
+
/^[A-Za-z_][A-Za-z0-9_]*$/.test(root.variable), "Session bundle root.variable must be an environment variable name");
|
|
39
|
+
invariant(Array.isArray(required) && required.length > 0, "Session bundles require at least one required file");
|
|
40
|
+
invariant(!profile.buckets || profile.bucket !== undefined, "Bucketed session bundles require a bucket function");
|
|
41
|
+
return JSON.stringify({
|
|
42
|
+
format,
|
|
43
|
+
root,
|
|
44
|
+
sessions,
|
|
45
|
+
buckets: profile.buckets === true,
|
|
46
|
+
include: pattern("include", profile.include),
|
|
47
|
+
...(profile.exclude === undefined
|
|
48
|
+
? {}
|
|
49
|
+
: { exclude: pattern("exclude", profile.exclude) }),
|
|
50
|
+
required,
|
|
51
|
+
relocated,
|
|
52
|
+
validate: hookSource("validate", profile.validate),
|
|
53
|
+
bucket: hookSource("bucket", profile.bucket),
|
|
54
|
+
relocate: hookSource("relocate", profile.relocate),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
9
57
|
async function sessionOperation(command, invoke) {
|
|
10
58
|
const result = await invoke(command);
|
|
11
59
|
if (result.status !== 0)
|
|
12
60
|
throw new OutpostError("session", `Native session operation failed: ${result.stderr.trim() || "unknown failure"}`);
|
|
13
61
|
}
|
|
14
|
-
export function sessionBundleCommand(mode,
|
|
62
|
+
export function sessionBundleCommand(mode, profile, id, home, cwd, file) {
|
|
15
63
|
validId(id);
|
|
16
64
|
return {
|
|
17
65
|
executable: "node",
|
|
@@ -19,7 +67,7 @@ export function sessionBundleCommand(mode, format, id, home, cwd, file) {
|
|
|
19
67
|
"-e",
|
|
20
68
|
sessionBundleScript,
|
|
21
69
|
mode,
|
|
22
|
-
|
|
70
|
+
profile,
|
|
23
71
|
id,
|
|
24
72
|
home,
|
|
25
73
|
cwd,
|
|
@@ -33,18 +81,27 @@ export function sessionBundlePath(format, id, repository, home) {
|
|
|
33
81
|
validId(id);
|
|
34
82
|
return join(home ?? repository, ".outpost", "conversations", format, `${id}.json`);
|
|
35
83
|
}
|
|
36
|
-
|
|
84
|
+
/** Creates a native store for CLIs that keep each session as a directory. */
|
|
85
|
+
export function createSessionBundleConversations(sessionProfile) {
|
|
86
|
+
const profile = sessionBundleProfile(sessionProfile);
|
|
87
|
+
const { format } = sessionProfile;
|
|
37
88
|
return {
|
|
38
89
|
name: format,
|
|
90
|
+
format,
|
|
91
|
+
directory: (repository, home) => join(home ?? repository, ".outpost", "conversations", format),
|
|
92
|
+
destination(id, sandbox) {
|
|
93
|
+
validId(id);
|
|
94
|
+
return posix.join(sandbox.home, ".outpost", "conversations", format, `${id}.json`);
|
|
95
|
+
},
|
|
39
96
|
async locate(id, repository, home) {
|
|
40
97
|
const file = sessionBundlePath(format, id, repository, home);
|
|
41
98
|
if (await access(file).then(() => true, () => false)) {
|
|
42
|
-
await sessionOperation(sessionBundleCommand("validate",
|
|
99
|
+
await sessionOperation(sessionBundleCommand("validate", profile, id, home ?? homedir(), repository, file), executeProcess);
|
|
43
100
|
return { id, file, format };
|
|
44
101
|
}
|
|
45
102
|
const scratch = `${file}.${randomUUID()}`;
|
|
46
103
|
try {
|
|
47
|
-
await sessionOperation(sessionBundleCommand("capture",
|
|
104
|
+
await sessionOperation(sessionBundleCommand("capture", profile, id, home ?? homedir(), repository, scratch), executeProcess);
|
|
48
105
|
await rename(scratch, file);
|
|
49
106
|
}
|
|
50
107
|
finally {
|
|
@@ -58,7 +115,7 @@ export function sessionConversations(format) {
|
|
|
58
115
|
const scratch = `${file}.${randomUUID()}`;
|
|
59
116
|
await mkdir(dirname(file), { recursive: true, mode: 0o700 });
|
|
60
117
|
try {
|
|
61
|
-
await sessionOperation(sessionBundleCommand("capture",
|
|
118
|
+
await sessionOperation(sessionBundleCommand("capture", profile, id, context.sandbox.home, context.sandbox.root, remote), context.sandbox.invoke);
|
|
62
119
|
await context.sandbox.download(remote, scratch);
|
|
63
120
|
await rename(scratch, file);
|
|
64
121
|
}
|
|
@@ -80,7 +137,7 @@ export function sessionConversations(format) {
|
|
|
80
137
|
const remote = posix.join(context.sandbox.home.replaceAll("\\", "/"), ".outpost", `restore-${randomUUID()}.json`);
|
|
81
138
|
try {
|
|
82
139
|
await context.sandbox.upload(record.file, remote);
|
|
83
|
-
await sessionOperation(sessionBundleCommand("restore",
|
|
140
|
+
await sessionOperation(sessionBundleCommand("restore", profile, record.id, context.sandbox.home, context.sandbox.root, remote), context.sandbox.invoke);
|
|
84
141
|
}
|
|
85
142
|
finally {
|
|
86
143
|
await requireSuccess({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-bundle.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/session-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AAGvC,KAAK,UAAU,gBAAgB,CAC7B,OAAgB,EAChB,MAAoD;IAEpD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;IACrC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QACrB,MAAM,IAAI,YAAY,CACpB,SAAS,EACT,oCAAoC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,iBAAiB,EAAE,CAChF,CAAC;AACN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F,EACD,OAAO,CAAC,OAAO,CAAC,MAAM,CACvB,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { access, mkdir, rename, rm } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join, posix } from \"node:path\";\nimport type { ConversationStore } from \"../../domain/conversation.types.ts\";\nimport type { Command, CommandResult } from \"../../domain/command.types.ts\";\nimport { invariant, OutpostError } from \"../../domain/errors.ts\";\nimport { executeProcess, requireSuccess } from \"../process.ts\";\nimport { validId } from \"./identity.ts\";\nimport {\n sessionBundleLimits,\n sessionBundleScript,\n} from \"./session-bundle.constants.ts\";\nimport type { SessionBundleFormat } from \"./session-bundle.types.ts\";\n\nasync function sessionOperation(\n command: Command,\n invoke: (command: Command) => Promise<CommandResult>,\n): Promise<void> {\n const result = await invoke(command);\n if (result.status !== 0)\n throw new OutpostError(\n \"session\",\n `Native session operation failed: ${result.stderr.trim() || \"unknown failure\"}`,\n );\n}\n\nexport function sessionBundleCommand(\n mode: \"capture\" | \"restore\" | \"validate\",\n format: SessionBundleFormat,\n id: string,\n home: string,\n cwd: string,\n file: string,\n): Command {\n validId(id);\n return {\n executable: \"node\",\n arguments: [\n \"-e\",\n sessionBundleScript,\n mode,\n format,\n id,\n home,\n cwd,\n file,\n String(sessionBundleLimits.bytes),\n String(sessionBundleLimits.files),\n ],\n };\n}\n\nexport function sessionBundlePath(\n format: SessionBundleFormat,\n id: string,\n repository: string,\n home?: string,\n): string {\n validId(id);\n return join(\n home ?? repository,\n \".outpost\",\n \"conversations\",\n format,\n `${id}.json`,\n );\n}\n\nexport function sessionConversations(\n format: SessionBundleFormat,\n): ConversationStore {\n return {\n name: format,\n async locate(id, repository, home) {\n const file = sessionBundlePath(format, id, repository, home);\n if (\n await access(file).then(\n () => true,\n () => false,\n )\n ) {\n await sessionOperation(\n sessionBundleCommand(\n \"validate\",\n format,\n id,\n home ?? homedir(),\n repository,\n file,\n ),\n executeProcess,\n );\n return { id, file, format };\n }\n const scratch = `${file}.${randomUUID()}`;\n try {\n await sessionOperation(\n sessionBundleCommand(\n \"capture\",\n format,\n id,\n home ?? homedir(),\n repository,\n scratch,\n ),\n executeProcess,\n );\n await rename(scratch, file);\n } finally {\n await rm(scratch, { force: true });\n }\n return { id, file, format };\n },\n async capture(id, context) {\n const file = sessionBundlePath(\n format,\n id,\n context.repository,\n context.home,\n );\n const remote = posix.join(\n context.sandbox.home.replaceAll(\"\\\\\", \"/\"),\n \".outpost\",\n `session-${randomUUID()}.json`,\n );\n const scratch = `${file}.${randomUUID()}`;\n await mkdir(dirname(file), { recursive: true, mode: 0o700 });\n try {\n await sessionOperation(\n sessionBundleCommand(\n \"capture\",\n format,\n id,\n context.sandbox.home,\n context.sandbox.root,\n remote,\n ),\n context.sandbox.invoke,\n );\n await context.sandbox.download(remote, scratch);\n await rename(scratch, file);\n } finally {\n await rm(scratch, { force: true });\n await requireSuccess(\n {\n executable: \"node\",\n arguments: [\n \"-e\",\n \"require('node:fs').rmSync(process.argv[1], {force:true})\",\n remote,\n ],\n },\n context.sandbox.invoke,\n );\n }\n return { id, file, format };\n },\n async restore(record, context) {\n invariant(\n record.format === format,\n \"Conversation format does not match its storage\",\n );\n const remote = posix.join(\n context.sandbox.home.replaceAll(\"\\\\\", \"/\"),\n \".outpost\",\n `restore-${randomUUID()}.json`,\n );\n try {\n await context.sandbox.upload(record.file, remote);\n await sessionOperation(\n sessionBundleCommand(\n \"restore\",\n format,\n record.id,\n context.sandbox.home,\n context.sandbox.root,\n remote,\n ),\n context.sandbox.invoke,\n );\n } finally {\n await requireSuccess(\n {\n executable: \"node\",\n arguments: [\n \"-e\",\n \"require('node:fs').rmSync(process.argv[1], {force:true})\",\n remote,\n ],\n },\n context.sandbox.invoke,\n );\n }\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"session-bundle.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/session-bundle.ts"],"names":[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;gBACnC,MAAM,cAAc,CAClB;oBACE,UAAU,EAAE,MAAM;oBAClB,SAAS,EAAE;wBACT,IAAI;wBACJ,0DAA0D;wBAC1D,MAAM;qBACP;iBACF,EACD,OAAO,CAAC,OAAO,CAAC,MAAM,CACvB,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC9B,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO;YAC3B,SAAS,CACP,MAAM,CAAC,MAAM,KAAK,MAAM,EACxB,gDAAgD,CACjD,CAAC;YACF,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CACvB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,EAC1C,UAAU,EACV,WAAW,UAAU,EAAE,OAAO,CAC/B,CAAC;YACF,IAAI,CAAC;gBACH,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBAClD,MAAM,gBAAgB,CACpB,oBAAoB,CAClB,SAAS,EACT,OAAO,EACP,MAAM,CAAC,EAAE,EACT,OAAO,CAAC,OAAO,CAAC,IAAI,EACpB,OAAO,CAAC,OAAO,CAAC,IAAI,EACpB,MAAM,CACP,EACD,OAAO,CAAC,OAAO,CAAC,MAAM,CACvB,CAAC;YACJ,CAAC;oBAAS,CAAC;gBACT,MAAM,cAAc,CAClB;oBACE,UAAU,EAAE,MAAM;oBAClB,SAAS,EAAE;wBACT,IAAI;wBACJ,0DAA0D;wBAC1D,MAAM;qBACP;iBACF,EACD,OAAO,CAAC,OAAO,CAAC,MAAM,CACvB,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { access, mkdir, rename, rm } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join, posix } from \"node:path\";\nimport type { NativeConversationStore } from \"../../domain/conversation.types.ts\";\nimport type { Command, CommandResult } from \"../../domain/command.types.ts\";\nimport { invariant, OutpostError } from \"../../domain/errors.ts\";\nimport { executeProcess, requireSuccess } from \"../process.ts\";\nimport { validId } from \"./identity.ts\";\nimport {\n sessionBundleLimits,\n sessionBundleScript,\n} from \"./session-bundle.constants.ts\";\nimport type { SessionBundleProfile } from \"./session-bundle.types.ts\";\n\nfunction hookSource(\n name: \"validate\" | \"bucket\" | \"relocate\",\n hook: unknown,\n): string | undefined {\n if (hook === undefined) return undefined;\n invariant(\n typeof hook === \"function\",\n `Session bundle ${name} must be a function`,\n );\n const source = Function.prototype.toString.call(hook);\n try {\n // Compiles without running: hooks execute later in the sandbox from their source.\n new Function(`return (${source})`);\n } catch {\n invariant(\n false,\n `Session bundle ${name} must be a self-contained function expression, not a method`,\n );\n }\n return source;\n}\n\nfunction pattern(name: string, value: unknown) {\n invariant(value instanceof RegExp, `Session bundle ${name} must be a RegExp`);\n invariant(\n !/[gy]/.test(value.flags),\n `Session bundle ${name} cannot use the g or y flags`,\n );\n return { source: value.source, flags: value.flags };\n}\n\n/** Serializes a profile into the argument read by the in-sandbox bundle script. */\nexport function sessionBundleProfile(profile: SessionBundleProfile): string {\n const { format, root, sessions, required, relocated = [] } = profile;\n for (const [name, value] of Object.entries({\n format,\n sessions,\n \"root.directory\": root?.directory,\n }))\n invariant(\n typeof value === \"string\" && value.length > 0,\n `Session bundle ${name} must be a non-empty string`,\n );\n invariant(\n root.variable === undefined ||\n /^[A-Za-z_][A-Za-z0-9_]*$/.test(root.variable),\n \"Session bundle root.variable must be an environment variable name\",\n );\n invariant(\n Array.isArray(required) && required.length > 0,\n \"Session bundles require at least one required file\",\n );\n invariant(\n !profile.buckets || profile.bucket !== undefined,\n \"Bucketed session bundles require a bucket function\",\n );\n return JSON.stringify({\n format,\n root,\n sessions,\n buckets: profile.buckets === true,\n include: pattern(\"include\", profile.include),\n ...(profile.exclude === undefined\n ? {}\n : { exclude: pattern(\"exclude\", profile.exclude) }),\n required,\n relocated,\n validate: hookSource(\"validate\", profile.validate),\n bucket: hookSource(\"bucket\", profile.bucket),\n relocate: hookSource(\"relocate\", profile.relocate),\n });\n}\n\nasync function sessionOperation(\n command: Command,\n invoke: (command: Command) => Promise<CommandResult>,\n): Promise<void> {\n const result = await invoke(command);\n if (result.status !== 0)\n throw new OutpostError(\n \"session\",\n `Native session operation failed: ${result.stderr.trim() || \"unknown failure\"}`,\n );\n}\n\nexport function sessionBundleCommand(\n mode: \"capture\" | \"restore\" | \"validate\",\n profile: string,\n id: string,\n home: string,\n cwd: string,\n file: string,\n): Command {\n validId(id);\n return {\n executable: \"node\",\n arguments: [\n \"-e\",\n sessionBundleScript,\n mode,\n profile,\n id,\n home,\n cwd,\n file,\n String(sessionBundleLimits.bytes),\n String(sessionBundleLimits.files),\n ],\n };\n}\n\nexport function sessionBundlePath(\n format: string,\n id: string,\n repository: string,\n home?: string,\n): string {\n validId(id);\n return join(\n home ?? repository,\n \".outpost\",\n \"conversations\",\n format,\n `${id}.json`,\n );\n}\n\n/** Creates a native store for CLIs that keep each session as a directory. */\nexport function createSessionBundleConversations(\n sessionProfile: SessionBundleProfile,\n): NativeConversationStore {\n const profile = sessionBundleProfile(sessionProfile);\n const { format } = sessionProfile;\n return {\n name: format,\n format,\n directory: (repository, home) =>\n join(home ?? repository, \".outpost\", \"conversations\", format),\n destination(id, sandbox) {\n validId(id);\n return posix.join(\n sandbox.home,\n \".outpost\",\n \"conversations\",\n format,\n `${id}.json`,\n );\n },\n async locate(id, repository, home) {\n const file = sessionBundlePath(format, id, repository, home);\n if (\n await access(file).then(\n () => true,\n () => false,\n )\n ) {\n await sessionOperation(\n sessionBundleCommand(\n \"validate\",\n profile,\n id,\n home ?? homedir(),\n repository,\n file,\n ),\n executeProcess,\n );\n return { id, file, format };\n }\n const scratch = `${file}.${randomUUID()}`;\n try {\n await sessionOperation(\n sessionBundleCommand(\n \"capture\",\n profile,\n id,\n home ?? homedir(),\n repository,\n scratch,\n ),\n executeProcess,\n );\n await rename(scratch, file);\n } finally {\n await rm(scratch, { force: true });\n }\n return { id, file, format };\n },\n async capture(id, context) {\n const file = sessionBundlePath(\n format,\n id,\n context.repository,\n context.home,\n );\n const remote = posix.join(\n context.sandbox.home.replaceAll(\"\\\\\", \"/\"),\n \".outpost\",\n `session-${randomUUID()}.json`,\n );\n const scratch = `${file}.${randomUUID()}`;\n await mkdir(dirname(file), { recursive: true, mode: 0o700 });\n try {\n await sessionOperation(\n sessionBundleCommand(\n \"capture\",\n profile,\n id,\n context.sandbox.home,\n context.sandbox.root,\n remote,\n ),\n context.sandbox.invoke,\n );\n await context.sandbox.download(remote, scratch);\n await rename(scratch, file);\n } finally {\n await rm(scratch, { force: true });\n await requireSuccess(\n {\n executable: \"node\",\n arguments: [\n \"-e\",\n \"require('node:fs').rmSync(process.argv[1], {force:true})\",\n remote,\n ],\n },\n context.sandbox.invoke,\n );\n }\n return { id, file, format };\n },\n async restore(record, context) {\n invariant(\n record.format === format,\n \"Conversation format does not match its storage\",\n );\n const remote = posix.join(\n context.sandbox.home.replaceAll(\"\\\\\", \"/\"),\n \".outpost\",\n `restore-${randomUUID()}.json`,\n );\n try {\n await context.sandbox.upload(record.file, remote);\n await sessionOperation(\n sessionBundleCommand(\n \"restore\",\n profile,\n record.id,\n context.sandbox.home,\n context.sandbox.root,\n remote,\n ),\n context.sandbox.invoke,\n );\n } finally {\n await requireSuccess(\n {\n executable: \"node\",\n arguments: [\n \"-e\",\n \"require('node:fs').rmSync(process.argv[1], {force:true})\",\n remote,\n ],\n },\n context.sandbox.invoke,\n );\n }\n },\n };\n}\n"]}
|
|
@@ -1 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
/** Text of the bundled files a profile hook may read, by bundle-relative path. */
|
|
2
|
+
export interface SessionBundleFiles {
|
|
3
|
+
text(path: string): string | undefined;
|
|
4
|
+
}
|
|
5
|
+
export interface SessionBundleHelpers {
|
|
6
|
+
/** Joins sandbox path segments with the sandbox platform separator. */
|
|
7
|
+
join(...segments: string[]): string;
|
|
8
|
+
/** Hex SHA-256 digest of a UTF-8 string. */
|
|
9
|
+
sha256(text: string): string;
|
|
10
|
+
}
|
|
11
|
+
export interface SessionBundleRelocation {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/** Sandbox workspace the restored session must point to. */
|
|
14
|
+
readonly cwd: string;
|
|
15
|
+
/** Sandbox directory the session is restored into. */
|
|
16
|
+
readonly target: string;
|
|
17
|
+
readonly helpers: SessionBundleHelpers;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* How a CLI stores one session as a directory. Hooks run inside the sandbox
|
|
21
|
+
* from their source text, so they must be self-contained function expressions.
|
|
22
|
+
*/
|
|
23
|
+
export interface SessionBundleProfile {
|
|
24
|
+
/** Persisted format name, used in bundles, transport keys and host paths. */
|
|
25
|
+
readonly format: string;
|
|
26
|
+
/** CLI home: `$variable` when set, otherwise `directory` under the agent home. */
|
|
27
|
+
readonly root: {
|
|
28
|
+
readonly variable?: string;
|
|
29
|
+
readonly directory: string;
|
|
30
|
+
};
|
|
31
|
+
/** Directory under the CLI home that holds sessions. */
|
|
32
|
+
readonly sessions: string;
|
|
33
|
+
/** Sessions are grouped in `<sessions>/<bucket>/<id>` instead of `<sessions>/<id>`. */
|
|
34
|
+
readonly buckets?: boolean;
|
|
35
|
+
/** Bundle-relative paths to capture; a directory is tested by its own path. */
|
|
36
|
+
readonly include: RegExp;
|
|
37
|
+
readonly exclude?: RegExp;
|
|
38
|
+
/** Files whose absence makes the session unusable. */
|
|
39
|
+
readonly required: readonly string[];
|
|
40
|
+
/** Files passed to `relocate` as text during restoration. */
|
|
41
|
+
readonly relocated?: readonly string[];
|
|
42
|
+
/** Returns an error message when the bundled session is unsupported. */
|
|
43
|
+
readonly validate?: (files: SessionBundleFiles, id: string) => string | undefined;
|
|
44
|
+
/** Bucket that restoration uses for a workspace; required with `buckets`. */
|
|
45
|
+
readonly bucket?: (cwd: string, helpers: SessionBundleHelpers) => string;
|
|
46
|
+
/** Rewrites one relocated file for the restored workspace. */
|
|
47
|
+
readonly relocate?: (path: string, text: string, relocation: SessionBundleRelocation) => string;
|
|
48
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-bundle.types.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/session-bundle.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"session-bundle.types.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/session-bundle.types.ts"],"names":[],"mappings":"","sourcesContent":["/** Text of the bundled files a profile hook may read, by bundle-relative path. */\nexport interface SessionBundleFiles {\n text(path: string): string | undefined;\n}\n\nexport interface SessionBundleHelpers {\n /** Joins sandbox path segments with the sandbox platform separator. */\n join(...segments: string[]): string;\n /** Hex SHA-256 digest of a UTF-8 string. */\n sha256(text: string): string;\n}\n\nexport interface SessionBundleRelocation {\n readonly id: string;\n /** Sandbox workspace the restored session must point to. */\n readonly cwd: string;\n /** Sandbox directory the session is restored into. */\n readonly target: string;\n readonly helpers: SessionBundleHelpers;\n}\n\n/**\n * How a CLI stores one session as a directory. Hooks run inside the sandbox\n * from their source text, so they must be self-contained function expressions.\n */\nexport interface SessionBundleProfile {\n /** Persisted format name, used in bundles, transport keys and host paths. */\n readonly format: string;\n /** CLI home: `$variable` when set, otherwise `directory` under the agent home. */\n readonly root: { readonly variable?: string; readonly directory: string };\n /** Directory under the CLI home that holds sessions. */\n readonly sessions: string;\n /** Sessions are grouped in `<sessions>/<bucket>/<id>` instead of `<sessions>/<id>`. */\n readonly buckets?: boolean;\n /** Bundle-relative paths to capture; a directory is tested by its own path. */\n readonly include: RegExp;\n readonly exclude?: RegExp;\n /** Files whose absence makes the session unusable. */\n readonly required: readonly string[];\n /** Files passed to `relocate` as text during restoration. */\n readonly relocated?: readonly string[];\n /** Returns an error message when the bundled session is unsupported. */\n readonly validate?: (\n files: SessionBundleFiles,\n id: string,\n ) => string | undefined;\n /** Bucket that restoration uses for a workspace; required with `buckets`. */\n readonly bucket?: (cwd: string, helpers: SessionBundleHelpers) => string;\n /** Rewrites one relocated file for the restored workspace. */\n readonly relocate?: (\n path: string,\n text: string,\n relocation: SessionBundleRelocation,\n ) => string;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NativeConversationStore } from "../../domain/conversation.types.ts";
|
|
2
|
+
import type { TranscriptConversationLayout } from "./layout.types.ts";
|
|
3
|
+
/** Creates a native store for CLIs that keep one JSONL transcript per conversation. */
|
|
4
|
+
export declare function createTranscriptConversations(layout: TranscriptConversationLayout): NativeConversationStore;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { dirname, join, posix, relative, resolve } from "node:path";
|
|
5
|
+
import { invariant, OutpostError } from "../../domain/errors.js";
|
|
6
|
+
import { safeDestination } from "../files.js";
|
|
7
|
+
import { transcriptSearchBytes } from "./conversation.constants.js";
|
|
8
|
+
import { files } from "./files.js";
|
|
9
|
+
import { validId } from "./identity.js";
|
|
10
|
+
import { relocateTranscript } from "./relocate.js";
|
|
11
|
+
async function locateTranscript(layout, id, repository, home = homedir()) {
|
|
12
|
+
validId(id);
|
|
13
|
+
const { format } = layout;
|
|
14
|
+
const expected = layout.preferredPath?.(id, repository, home);
|
|
15
|
+
if (expected && (await stat(expected).catch(() => undefined))?.isFile())
|
|
16
|
+
return { id, file: expected, format };
|
|
17
|
+
const found = (await files(layout.searchRoot(home))).find((file) => layout.matches(file, id));
|
|
18
|
+
if (found)
|
|
19
|
+
return { id, file: found, format };
|
|
20
|
+
throw new OutpostError("session", `Conversation ${id} was not found in native ${format} storage`, { id, repository });
|
|
21
|
+
}
|
|
22
|
+
async function captureSidecars(id, remote, file, context) {
|
|
23
|
+
const { sandbox, staging, repository } = context;
|
|
24
|
+
const remoteSidecars = posix.join(posix.dirname(remote.replaceAll("\\", "/")), id, "subagents");
|
|
25
|
+
const listed = context.local
|
|
26
|
+
? {
|
|
27
|
+
status: 0,
|
|
28
|
+
stdout: (await files(join(dirname(remote), id, "subagents"))).join("\n"),
|
|
29
|
+
}
|
|
30
|
+
: await sandbox.invoke({
|
|
31
|
+
executable: "find",
|
|
32
|
+
arguments: [remoteSidecars, "-type", "f", "-name", "*.jsonl"],
|
|
33
|
+
retain: transcriptSearchBytes,
|
|
34
|
+
});
|
|
35
|
+
if (listed.status !== 0)
|
|
36
|
+
return;
|
|
37
|
+
for (const child of listed.stdout.split("\n").filter(Boolean)) {
|
|
38
|
+
try {
|
|
39
|
+
const scratch = join(staging, `${randomUUID()}.jsonl`);
|
|
40
|
+
await sandbox.download(child, scratch);
|
|
41
|
+
const destination = await safeDestination(join(dirname(file), id, "subagents"), posix.relative(remoteSidecars.replaceAll("\\", "/"), child.replaceAll("\\", "/")));
|
|
42
|
+
await mkdir(dirname(destination), { recursive: true });
|
|
43
|
+
try {
|
|
44
|
+
await writeFile(destination, relocateTranscript(await readFile(scratch, "utf8"), resolve(repository)), { mode: 0o600 });
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
await rm(scratch, { force: true });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (cause) {
|
|
51
|
+
context.warn?.(`Could not capture child transcript: ${String(cause)}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function captureTranscript(layout, id, context) {
|
|
56
|
+
validId(id);
|
|
57
|
+
const { sandbox, staging, repository } = context;
|
|
58
|
+
const home = context.home ?? homedir();
|
|
59
|
+
const search = layout.remoteSearchRoot(sandbox.home);
|
|
60
|
+
const result = context.local
|
|
61
|
+
? {
|
|
62
|
+
status: 0,
|
|
63
|
+
stdout: (await locateTranscript(layout, id, sandbox.root, sandbox.home))
|
|
64
|
+
.file,
|
|
65
|
+
}
|
|
66
|
+
: await sandbox.invoke({
|
|
67
|
+
executable: "find",
|
|
68
|
+
arguments: [search, "-type", "f", "-name", layout.pattern(id)],
|
|
69
|
+
retain: transcriptSearchBytes,
|
|
70
|
+
});
|
|
71
|
+
const remote = result.stdout.trim().split("\n").filter(Boolean)[0];
|
|
72
|
+
if (result.status !== 0 || !remote)
|
|
73
|
+
throw new OutpostError("session", `Agent emitted conversation ${id} but its transcript is unavailable`, { id, search });
|
|
74
|
+
const file = layout.capturePath(id, repository, home, remote);
|
|
75
|
+
await mkdir(staging, { recursive: true });
|
|
76
|
+
const temporary = join(staging, `${randomUUID()}.jsonl`);
|
|
77
|
+
await sandbox.download(remote, temporary);
|
|
78
|
+
await mkdir(dirname(file), { recursive: true });
|
|
79
|
+
try {
|
|
80
|
+
await writeFile(file, relocateTranscript(await readFile(temporary, "utf8"), resolve(repository)), { mode: 0o600 });
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
await rm(temporary, { force: true });
|
|
84
|
+
}
|
|
85
|
+
if (layout.sidecars)
|
|
86
|
+
await captureSidecars(id, remote, file, context);
|
|
87
|
+
return { id, file, format: layout.format };
|
|
88
|
+
}
|
|
89
|
+
async function uploadRelocated(file, target, sandbox, staging) {
|
|
90
|
+
const temporary = join(staging, `${randomUUID()}.jsonl`);
|
|
91
|
+
await mkdir(staging, { recursive: true });
|
|
92
|
+
await writeFile(temporary, relocateTranscript(await readFile(file, "utf8"), sandbox.root), { mode: 0o600 });
|
|
93
|
+
try {
|
|
94
|
+
await sandbox.upload(temporary, target);
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
await rm(temporary, { force: true });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async function restoreTranscript(layout, record, { sandbox, staging }) {
|
|
101
|
+
validId(record.id);
|
|
102
|
+
const target = layout.remotePath(record.id, sandbox, record.file);
|
|
103
|
+
await uploadRelocated(record.file, target, sandbox, staging);
|
|
104
|
+
if (!layout.sidecars)
|
|
105
|
+
return;
|
|
106
|
+
const sidecars = join(dirname(record.file), record.id, "subagents");
|
|
107
|
+
for (const file of await files(sidecars))
|
|
108
|
+
await uploadRelocated(file, posix.join(posix.dirname(target), record.id, "subagents", relative(sidecars, file).replaceAll("\\", "/")), sandbox, staging);
|
|
109
|
+
}
|
|
110
|
+
/** Creates a native store for CLIs that keep one JSONL transcript per conversation. */
|
|
111
|
+
export function createTranscriptConversations(layout) {
|
|
112
|
+
const { format } = layout;
|
|
113
|
+
invariant(typeof format === "string" && format.length > 0, "Transcript layouts require a format name");
|
|
114
|
+
return {
|
|
115
|
+
name: format,
|
|
116
|
+
format,
|
|
117
|
+
locate: (id, repository, home) => locateTranscript(layout, id, repository, home),
|
|
118
|
+
capture: (id, context) => captureTranscript(layout, id, context),
|
|
119
|
+
async restore(record, context) {
|
|
120
|
+
invariant(record.format === format, "Conversation format does not match its storage");
|
|
121
|
+
if (context.local &&
|
|
122
|
+
context.sandbox.root === context.repository &&
|
|
123
|
+
record.reference === undefined)
|
|
124
|
+
return;
|
|
125
|
+
return restoreTranscript(layout, record, context);
|
|
126
|
+
},
|
|
127
|
+
directory: (repository, home) => layout.directory(repository, home ?? homedir()),
|
|
128
|
+
destination(id, sandbox, original) {
|
|
129
|
+
validId(id);
|
|
130
|
+
return layout.remotePath(id, sandbox, original);
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=transcript-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-store.js","sourceRoot":"","sources":["../../../src/infrastructure/conversations/transcript-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE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AAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,UAAU;gBAC3C,MAAM,CAAC,SAAS,KAAK,SAAS;gBAE9B,OAAO;YACT,OAAO,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;QACD,SAAS,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAC9B,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,IAAI,OAAO,EAAE,CAAC;QACjD,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ;YAC/B,OAAO,CAAC,EAAE,CAAC,CAAC;YACZ,OAAO,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAClD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { mkdir, readFile, rm, stat, writeFile } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join, posix, relative, resolve } from \"node:path\";\nimport type {\n ConversationContext,\n ConversationRecord,\n NativeConversationStore,\n} from \"../../domain/conversation.types.ts\";\nimport { invariant, OutpostError } from \"../../domain/errors.ts\";\nimport type { SandboxLease } from \"../../domain/sandbox.types.ts\";\nimport { safeDestination } from \"../files.ts\";\nimport { transcriptSearchBytes } from \"./conversation.constants.ts\";\nimport { files } from \"./files.ts\";\nimport { validId } from \"./identity.ts\";\nimport type { TranscriptConversationLayout } from \"./layout.types.ts\";\nimport { relocateTranscript } from \"./relocate.ts\";\n\nasync function locateTranscript(\n layout: TranscriptConversationLayout,\n id: string,\n repository: string,\n home = homedir(),\n): Promise<ConversationRecord> {\n validId(id);\n const { format } = layout;\n const expected = layout.preferredPath?.(id, repository, home);\n if (expected && (await stat(expected).catch(() => undefined))?.isFile())\n return { id, file: expected, format };\n const found = (await files(layout.searchRoot(home))).find((file) =>\n layout.matches(file, id),\n );\n if (found) return { id, file: found, format };\n throw new OutpostError(\n \"session\",\n `Conversation ${id} was not found in native ${format} storage`,\n { id, repository },\n );\n}\n\nasync function captureSidecars(\n id: string,\n remote: string,\n file: string,\n context: ConversationContext,\n): Promise<void> {\n const { sandbox, staging, repository } = context;\n const remoteSidecars = posix.join(\n posix.dirname(remote.replaceAll(\"\\\\\", \"/\")),\n id,\n \"subagents\",\n );\n const listed = context.local\n ? {\n status: 0,\n stdout: (await files(join(dirname(remote), id, \"subagents\"))).join(\n \"\\n\",\n ),\n }\n : await sandbox.invoke({\n executable: \"find\",\n arguments: [remoteSidecars, \"-type\", \"f\", \"-name\", \"*.jsonl\"],\n retain: transcriptSearchBytes,\n });\n if (listed.status !== 0) return;\n for (const child of listed.stdout.split(\"\\n\").filter(Boolean)) {\n try {\n const scratch = join(staging, `${randomUUID()}.jsonl`);\n await sandbox.download(child, scratch);\n const destination = await safeDestination(\n join(dirname(file), id, \"subagents\"),\n posix.relative(\n remoteSidecars.replaceAll(\"\\\\\", \"/\"),\n child.replaceAll(\"\\\\\", \"/\"),\n ),\n );\n await mkdir(dirname(destination), { recursive: true });\n try {\n await writeFile(\n destination,\n relocateTranscript(\n await readFile(scratch, \"utf8\"),\n resolve(repository),\n ),\n { mode: 0o600 },\n );\n } finally {\n await rm(scratch, { force: true });\n }\n } catch (cause) {\n context.warn?.(`Could not capture child transcript: ${String(cause)}`);\n }\n }\n}\n\nasync function captureTranscript(\n layout: TranscriptConversationLayout,\n id: string,\n context: ConversationContext,\n): Promise<ConversationRecord> {\n validId(id);\n const { sandbox, staging, repository } = context;\n const home = context.home ?? homedir();\n const search = layout.remoteSearchRoot(sandbox.home);\n const result = context.local\n ? {\n status: 0,\n stdout: (await locateTranscript(layout, id, sandbox.root, sandbox.home))\n .file,\n }\n : await sandbox.invoke({\n executable: \"find\",\n arguments: [search, \"-type\", \"f\", \"-name\", layout.pattern(id)],\n retain: transcriptSearchBytes,\n });\n const remote = result.stdout.trim().split(\"\\n\").filter(Boolean)[0];\n if (result.status !== 0 || !remote)\n throw new OutpostError(\n \"session\",\n `Agent emitted conversation ${id} but its transcript is unavailable`,\n { id, search },\n );\n const file = layout.capturePath(id, repository, home, remote);\n await mkdir(staging, { recursive: true });\n const temporary = join(staging, `${randomUUID()}.jsonl`);\n await sandbox.download(remote, temporary);\n await mkdir(dirname(file), { recursive: true });\n try {\n await writeFile(\n file,\n relocateTranscript(\n await readFile(temporary, \"utf8\"),\n resolve(repository),\n ),\n { mode: 0o600 },\n );\n } finally {\n await rm(temporary, { force: true });\n }\n if (layout.sidecars) await captureSidecars(id, remote, file, context);\n return { id, file, format: layout.format };\n}\n\nasync function uploadRelocated(\n file: string,\n target: string,\n sandbox: SandboxLease,\n staging: string,\n): Promise<void> {\n const temporary = join(staging, `${randomUUID()}.jsonl`);\n await mkdir(staging, { recursive: true });\n await writeFile(\n temporary,\n relocateTranscript(await readFile(file, \"utf8\"), sandbox.root),\n { mode: 0o600 },\n );\n try {\n await sandbox.upload(temporary, target);\n } finally {\n await rm(temporary, { force: true });\n }\n}\n\nasync function restoreTranscript(\n layout: TranscriptConversationLayout,\n record: ConversationRecord,\n { sandbox, staging }: ConversationContext,\n): Promise<void> {\n validId(record.id);\n const target = layout.remotePath(record.id, sandbox, record.file);\n await uploadRelocated(record.file, target, sandbox, staging);\n if (!layout.sidecars) return;\n const sidecars = join(dirname(record.file), record.id, \"subagents\");\n for (const file of await files(sidecars))\n await uploadRelocated(\n file,\n posix.join(\n posix.dirname(target),\n record.id,\n \"subagents\",\n relative(sidecars, file).replaceAll(\"\\\\\", \"/\"),\n ),\n sandbox,\n staging,\n );\n}\n\n/** Creates a native store for CLIs that keep one JSONL transcript per conversation. */\nexport function createTranscriptConversations(\n layout: TranscriptConversationLayout,\n): NativeConversationStore {\n const { format } = layout;\n invariant(\n typeof format === \"string\" && format.length > 0,\n \"Transcript layouts require a format name\",\n );\n return {\n name: format,\n format,\n locate: (id, repository, home) =>\n locateTranscript(layout, id, repository, home),\n capture: (id, context) => captureTranscript(layout, id, context),\n async restore(record, context) {\n invariant(\n record.format === format,\n \"Conversation format does not match its storage\",\n );\n if (\n context.local &&\n context.sandbox.root === context.repository &&\n record.reference === undefined\n )\n return;\n return restoreTranscript(layout, record, context);\n },\n directory: (repository, home) =>\n layout.directory(repository, home ?? homedir()),\n destination(id, sandbox, original) {\n validId(id);\n return layout.remotePath(id, sandbox, original);\n },\n };\n}\n"]}
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { locateConversation } from "./conversations/locate.ts";
|
|
5
|
-
import { harnessConversations } from "./conversations/harness-store.ts";
|
|
6
|
-
import { nativeConversations } from "./conversations/native-store.ts";
|
|
7
|
-
import { projectKey, remotePath } from "./conversations/paths.ts";
|
|
8
|
-
import { relocateTranscript } from "./conversations/relocate.ts";
|
|
9
|
-
import { restoreConversation } from "./conversations/restore.ts";
|
|
10
|
-
export type { ConversationFormat, ConversationLocation, StoredConversationFormat, } from "./conversations.types.ts";
|
|
11
|
-
export { harnessConversations, harnessTranscriptPath, } from "./conversations/harness-store.ts";
|
|
12
|
-
export { captureConversation } from "./conversations/capture.ts";
|
|
13
|
-
export { locateConversation } from "./conversations/locate.ts";
|
|
14
|
-
export { nativeConversations } from "./conversations/native-store.ts";
|
|
15
|
-
export { projectKey } from "./conversations/paths.ts";
|
|
1
|
+
export type { ConversationFormat, ConversationLocation, } from "./conversations.types.ts";
|
|
2
|
+
export { createHarnessConversations, harnessTranscriptPath, } from "./conversations/harness-store.ts";
|
|
3
|
+
export { projectKey } from "./conversations/identity.ts";
|
|
16
4
|
export { relocateTranscript } from "./conversations/relocate.ts";
|
|
17
|
-
export {
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
native: typeof nativeConversations;
|
|
21
|
-
harness: typeof harnessConversations;
|
|
22
|
-
locate: typeof locateConversation;
|
|
23
|
-
capture: typeof captureConversation;
|
|
24
|
-
restore: typeof restoreConversation;
|
|
25
|
-
rewrite: typeof relocateTranscript;
|
|
26
|
-
projectKey: typeof projectKey;
|
|
27
|
-
claudePath(id: string, repository: string, home?: string): string;
|
|
28
|
-
directory(format: ConversationFormat, repository: string, home?: string): string;
|
|
29
|
-
destination: typeof remotePath;
|
|
30
|
-
};
|
|
5
|
+
export { createSessionBundleConversations } from "./conversations/session-bundle.ts";
|
|
6
|
+
export { createTranscriptConversations } from "./conversations/transcript-store.ts";
|
|
7
|
+
export { createTransportStore } from "./transport-conversations.ts";
|
|
@@ -1,39 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { join, resolve } from "node:path";
|
|
4
|
-
import { captureConversation } from "./conversations/capture.js";
|
|
5
|
-
import { conversationLayout } from "./conversations/layout.js";
|
|
6
|
-
import { locateConversation } from "./conversations/locate.js";
|
|
7
|
-
import { harnessConversations } from "./conversations/harness-store.js";
|
|
8
|
-
import { nativeConversations } from "./conversations/native-store.js";
|
|
9
|
-
import { projectKey, remotePath, validId } from "./conversations/paths.js";
|
|
10
|
-
import { relocateTranscript } from "./conversations/relocate.js";
|
|
11
|
-
import { restoreConversation } from "./conversations/restore.js";
|
|
12
|
-
export { harnessConversations, harnessTranscriptPath, } from "./conversations/harness-store.js";
|
|
13
|
-
export { captureConversation } from "./conversations/capture.js";
|
|
14
|
-
export { locateConversation } from "./conversations/locate.js";
|
|
15
|
-
export { nativeConversations } from "./conversations/native-store.js";
|
|
16
|
-
export { projectKey } from "./conversations/paths.js";
|
|
1
|
+
export { createHarnessConversations, harnessTranscriptPath, } from "./conversations/harness-store.js";
|
|
2
|
+
export { projectKey } from "./conversations/identity.js";
|
|
17
3
|
export { relocateTranscript } from "./conversations/relocate.js";
|
|
18
|
-
export {
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
native: nativeConversations,
|
|
22
|
-
harness: harnessConversations,
|
|
23
|
-
locate: locateConversation,
|
|
24
|
-
capture: captureConversation,
|
|
25
|
-
restore: restoreConversation,
|
|
26
|
-
rewrite: relocateTranscript,
|
|
27
|
-
projectKey,
|
|
28
|
-
claudePath(id, repository, home = homedir()) {
|
|
29
|
-
validId(id);
|
|
30
|
-
return join(home, ".claude", "projects", projectKey(resolve(repository)), `${id}.jsonl`);
|
|
31
|
-
},
|
|
32
|
-
directory(format, repository, home) {
|
|
33
|
-
if (format === "copilot" || format === "kimi")
|
|
34
|
-
return join(home ?? repository, ".outpost", "conversations", format);
|
|
35
|
-
return conversationLayout(format).directory(repository, home ?? homedir());
|
|
36
|
-
},
|
|
37
|
-
destination: remotePath,
|
|
38
|
-
};
|
|
4
|
+
export { createSessionBundleConversations } from "./conversations/session-bundle.js";
|
|
5
|
+
export { createTranscriptConversations } from "./conversations/transcript-store.js";
|
|
6
|
+
export { createTransportStore } from "./transport-conversations.js";
|
|
39
7
|
//# sourceMappingURL=conversations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/infrastructure/conversations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/infrastructure/conversations.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["export type {\n ConversationFormat,\n ConversationLocation,\n} from \"./conversations.types.ts\";\nexport {\n createHarnessConversations,\n harnessTranscriptPath,\n} from \"./conversations/harness-store.ts\";\nexport { projectKey } from \"./conversations/identity.ts\";\nexport { relocateTranscript } from \"./conversations/relocate.ts\";\nexport { createSessionBundleConversations } from \"./conversations/session-bundle.ts\";\nexport { createTranscriptConversations } from \"./conversations/transcript-store.ts\";\nexport { createTransportStore } from \"./transport-conversations.ts\";\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
1
|
+
/** Persisted name of a conversation format, such as "claude" or "harness". */
|
|
2
|
+
export type ConversationFormat = string;
|
|
3
3
|
export interface ConversationLocation {
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly file: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.types.js","sourceRoot":"","sources":["../../src/infrastructure/conversations.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"conversations.types.js","sourceRoot":"","sources":["../../src/infrastructure/conversations.types.ts"],"names":[],"mappings":"","sourcesContent":["/** Persisted name of a conversation format, such as \"claude\" or \"harness\". */\nexport type ConversationFormat = string;\n\nexport interface ConversationLocation {\n readonly id: string;\n readonly file: string;\n readonly format: ConversationFormat;\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { CustomReporter, CustomReporterOptions, ReporterHandlers } from "./custom-reporter.types.ts";
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function createCustomReporter(handlers: ReporterHandlers, options?: CustomReporterOptions): CustomReporter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { agentObservation } from "../domain/agent-observation.js";
|
|
2
2
|
import { createObservationHub } from "../domain/observation.js";
|
|
3
|
-
export function
|
|
3
|
+
export function createCustomReporter(handlers, options = {}) {
|
|
4
4
|
const hub = createObservationHub({
|
|
5
5
|
...(options.capacity === undefined ? {} : { capacity: options.capacity }),
|
|
6
6
|
...(options.deliveryTimeoutMs === undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-reporter.js","sourceRoot":"","sources":["../../src/infrastructure/custom-reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,o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E;QAC/C,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACvD,CAAC,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;QAC3B,KAAK,CAAC,KAAK;YACT,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;YAClB,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM;gBAAE,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { agentObservation } from \"../domain/agent-observation.ts\";\nimport { createObservationHub } from \"../domain/observation.ts\";\nimport type { AgentObservation } from \"../domain/agent.types.ts\";\nimport type {\n CustomReporter,\n CustomReporterOptions,\n ReporterHandlers,\n} from \"./custom-reporter.types.ts\";\n\nexport function createCustomReporter(\n handlers: ReporterHandlers,\n options: CustomReporterOptions = {},\n): CustomReporter {\n const hub = createObservationHub({\n ...(options.capacity === undefined ? {} : { capacity: options.capacity }),\n ...(options.deliveryTimeoutMs === undefined\n ? {}\n : { deliveryTimeoutMs: options.deliveryTimeoutMs }),\n sinks: [\n {\n async observe(value) {\n const event = agentObservation(value);\n if (!event) return;\n const handler = handlers[event.kind] as\n ((event: AgentObservation) => void | Promise<void>) | undefined;\n try {\n await handler?.(event);\n } catch (error) {\n try {\n await options.onError?.(error, event);\n } catch {}\n throw error;\n }\n },\n },\n ],\n });\n const report = (event: AgentObservation): void => {\n hub.child({ pass: event.pass }).emit(\"agent\", event);\n };\n return Object.assign(report, {\n async flush() {\n await hub.flush();\n if (hub.errors.length) throw hub.errors[0];\n },\n });\n}\n"]}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Variables } from "../../domain/command.types.ts";
|
|
2
|
+
export declare function git(cwd: string, args: readonly string[], deadlineMs?: number, stdin?: string, variables?: Variables): Promise<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { requireSuccess } from "../process.js";
|
|
2
2
|
import { gitDefaults } from "./git.constants.js";
|
|
3
|
-
export async function git(cwd, args, deadlineMs = gitDefaults.deadlineMs, stdin) {
|
|
3
|
+
export async function git(cwd, args, deadlineMs = gitDefaults.deadlineMs, stdin, variables = {}) {
|
|
4
4
|
const result = await requireSuccess({
|
|
5
5
|
executable: "git",
|
|
6
6
|
arguments: [
|
|
@@ -9,7 +9,7 @@ export async function git(cwd, args, deadlineMs = gitDefaults.deadlineMs, stdin)
|
|
|
9
9
|
...args,
|
|
10
10
|
],
|
|
11
11
|
directory: cwd,
|
|
12
|
-
variables: { LC_ALL: "C", GIT_TERMINAL_PROMPT: "0" },
|
|
12
|
+
variables: { ...variables, LC_ALL: "C", GIT_TERMINAL_PROMPT: "0" },
|
|
13
13
|
deadlineMs,
|
|
14
14
|
retain: gitDefaults.retainBytes,
|
|
15
15
|
...(stdin === undefined ? {} : { stdin }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/infrastructure/git/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/infrastructure/git/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,GAAG,CACvB,GAAW,EACX,IAAuB,EACvB,aAAqB,WAAW,CAAC,UAAU,EAC3C,KAAc,EACd,YAAuB,EAAE;IAEzB,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC;QAClC,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE;YACT,IAAI;YACJ,iBAAiB,GAAG,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC;YACxE,GAAG,IAAI;SACR;QACD,SAAS,EAAE,GAAG;QACd,SAAS,EAAE,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE;QAClE,UAAU;QACV,MAAM,EAAE,WAAW,CAAC,WAAW;QAC/B,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;KAC1C,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC;AACvB,CAAC","sourcesContent":["import type { Variables } from \"../../domain/command.types.ts\";\nimport { requireSuccess } from \"../process.ts\";\nimport { gitDefaults } from \"./git.constants.ts\";\n\nexport async function git(\n cwd: string,\n args: readonly string[],\n deadlineMs: number = gitDefaults.deadlineMs,\n stdin?: string,\n variables: Variables = {},\n): Promise<string> {\n const result = await requireSuccess({\n executable: \"git\",\n arguments: [\n \"-c\",\n \"core.hooksPath=\" + (process.platform === \"win32\" ? \"NUL\" : \"/dev/null\"),\n ...args,\n ],\n directory: cwd,\n variables: { ...variables, LC_ALL: \"C\", GIT_TERMINAL_PROMPT: \"0\" },\n deadlineMs,\n retain: gitDefaults.retainBytes,\n ...(stdin === undefined ? {} : { stdin }),\n });\n return result.stdout;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.constants.js","sourceRoot":"","sources":["../../../src/infrastructure/git/lock.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,qBAAqB,EAAE,EAAE;IACzB,oBAAoB,EAAE,EAAE;CACzB,CAAC,CAAC","sourcesContent":["export const lockDefaults = Object.freeze({\n pendingDeleteAttempts: 50,\n pendingDeleteRetryMs: 10,\n});\n"]}
|