@roj-ai/sdk 0.1.1 → 0.1.4
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/dist/bootstrap.js +191 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/builtin-events.js +8 -0
- package/dist/builtin-events.js.map +1 -0
- package/dist/bun-platform/fs.js +39 -0
- package/dist/bun-platform/fs.js.map +1 -0
- package/dist/bun-platform/index.js +18 -0
- package/dist/bun-platform/index.js.map +1 -0
- package/dist/bun-platform/process.js +21 -0
- package/dist/bun-platform/process.js.map +1 -0
- package/dist/config.js +54 -0
- package/dist/config.js.map +1 -0
- package/dist/config.test.js +155 -0
- package/dist/config.test.js.map +1 -0
- package/dist/core/agent-loop.integration.test.js +414 -0
- package/dist/core/agent-loop.integration.test.js.map +1 -0
- package/dist/core/agents/agent-config.test.js +194 -0
- package/dist/core/agents/agent-config.test.js.map +1 -0
- package/dist/core/agents/agent-roles.js +25 -0
- package/dist/core/agents/agent-roles.js.map +1 -0
- package/dist/core/agents/agent-shutdown.test.js +180 -0
- package/dist/core/agents/agent-shutdown.test.js.map +1 -0
- package/dist/core/agents/agent.js +1205 -0
- package/dist/core/agents/agent.js.map +1 -0
- package/dist/core/agents/agent.test.js +313 -0
- package/dist/core/agents/agent.test.js.map +1 -0
- package/dist/core/agents/communicator.js +13 -0
- package/dist/core/agents/communicator.js.map +1 -0
- package/dist/core/agents/config.js +5 -0
- package/dist/core/agents/config.js.map +1 -0
- package/dist/core/agents/context.js +2 -0
- package/dist/core/agents/context.js.map +1 -0
- package/dist/core/agents/debounce.js +74 -0
- package/dist/core/agents/debounce.js.map +1 -0
- package/dist/core/agents/handler-events.test.js +115 -0
- package/dist/core/agents/handler-events.test.js.map +1 -0
- package/dist/core/agents/index.js +2 -0
- package/dist/core/agents/index.js.map +1 -0
- package/dist/core/agents/response-sanitizer.js +46 -0
- package/dist/core/agents/response-sanitizer.js.map +1 -0
- package/dist/core/agents/response-sanitizer.test.js +101 -0
- package/dist/core/agents/response-sanitizer.test.js.map +1 -0
- package/dist/core/agents/retry.js +105 -0
- package/dist/core/agents/retry.js.map +1 -0
- package/dist/core/agents/schema.js +39 -0
- package/dist/core/agents/schema.js.map +1 -0
- package/dist/core/agents/state.js +90 -0
- package/dist/core/agents/state.js.map +1 -0
- package/dist/core/context/state.js +23 -0
- package/dist/core/context/state.js.map +1 -0
- package/dist/core/errors.js +38 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/event-sourcing.integration.test.js +154 -0
- package/dist/core/event-sourcing.integration.test.js.map +1 -0
- package/dist/core/events/base-event-store.js +201 -0
- package/dist/core/events/base-event-store.js.map +1 -0
- package/dist/core/events/event-store.js +26 -0
- package/dist/core/events/event-store.js.map +1 -0
- package/dist/core/events/file.js +320 -0
- package/dist/core/events/file.js.map +1 -0
- package/dist/core/events/file.test.js +284 -0
- package/dist/core/events/file.test.js.map +1 -0
- package/dist/core/events/index.js +3 -0
- package/dist/core/events/index.js.map +1 -0
- package/dist/core/events/memory.js +101 -0
- package/dist/core/events/memory.js.map +1 -0
- package/dist/core/events/memory.test.js +502 -0
- package/dist/core/events/memory.test.js.map +1 -0
- package/dist/core/events/metadata-utils.js +107 -0
- package/dist/core/events/metadata-utils.js.map +1 -0
- package/dist/core/events/test-helpers.js +15 -0
- package/dist/core/events/test-helpers.js.map +1 -0
- package/dist/core/events/types.js +21 -0
- package/dist/core/events/types.js.map +1 -0
- package/dist/core/file-store/file-store.js +250 -0
- package/dist/core/file-store/file-store.js.map +1 -0
- package/dist/core/file-store/types.js +7 -0
- package/dist/core/file-store/types.js.map +1 -0
- package/dist/core/image/image-processor.js +106 -0
- package/dist/core/image/image-processor.js.map +1 -0
- package/dist/core/image/image-processor.test.js +171 -0
- package/dist/core/image/image-processor.test.js.map +1 -0
- package/dist/core/image/index.js +4 -0
- package/dist/core/image/index.js.map +1 -0
- package/dist/core/image/noop-resizer.js +6 -0
- package/dist/core/image/noop-resizer.js.map +1 -0
- package/dist/core/image/types.js +2 -0
- package/dist/core/image/types.js.map +1 -0
- package/dist/core/image/vips-resizer.js +100 -0
- package/dist/core/image/vips-resizer.js.map +1 -0
- package/dist/core/image/vips-resizer.test.js +324 -0
- package/dist/core/image/vips-resizer.test.js.map +1 -0
- package/dist/core/llm/anthropic.js +396 -0
- package/dist/core/llm/anthropic.js.map +1 -0
- package/dist/core/llm/anthropic.test.js +434 -0
- package/dist/core/llm/anthropic.test.js.map +1 -0
- package/dist/core/llm/cache-breakpoints.js +37 -0
- package/dist/core/llm/cache-breakpoints.js.map +1 -0
- package/dist/core/llm/cache-live.test.js +137 -0
- package/dist/core/llm/cache-live.test.js.map +1 -0
- package/dist/core/llm/index.js +9 -0
- package/dist/core/llm/index.js.map +1 -0
- package/dist/core/llm/llm-log-types.js +12 -0
- package/dist/core/llm/llm-log-types.js.map +1 -0
- package/dist/core/llm/logger.js +241 -0
- package/dist/core/llm/logger.js.map +1 -0
- package/dist/core/llm/logger.test.js +228 -0
- package/dist/core/llm/logger.test.js.map +1 -0
- package/dist/core/llm/logging-provider.js +49 -0
- package/dist/core/llm/logging-provider.js.map +1 -0
- package/dist/core/llm/middleware.js +114 -0
- package/dist/core/llm/middleware.js.map +1 -0
- package/dist/core/llm/mock.js +186 -0
- package/dist/core/llm/mock.js.map +1 -0
- package/dist/core/llm/mock.test.js +318 -0
- package/dist/core/llm/mock.test.js.map +1 -0
- package/dist/core/llm/openrouter-mapping.test.js +125 -0
- package/dist/core/llm/openrouter-mapping.test.js.map +1 -0
- package/dist/core/llm/openrouter.js +298 -0
- package/dist/core/llm/openrouter.js.map +1 -0
- package/dist/core/llm/openrouter.test.js +377 -0
- package/dist/core/llm/openrouter.test.js.map +1 -0
- package/dist/core/llm/provider-integration.test.js +350 -0
- package/dist/core/llm/provider-integration.test.js.map +1 -0
- package/dist/core/llm/provider.js +18 -0
- package/dist/core/llm/provider.js.map +1 -0
- package/dist/core/llm/routing-provider.js +52 -0
- package/dist/core/llm/routing-provider.js.map +1 -0
- package/dist/core/llm/routing-provider.test.js +94 -0
- package/dist/core/llm/routing-provider.test.js.map +1 -0
- package/dist/core/llm/schema.js +31 -0
- package/dist/core/llm/schema.js.map +1 -0
- package/dist/core/llm/snapshot-fetch.js +122 -0
- package/dist/core/llm/snapshot-fetch.js.map +1 -0
- package/dist/core/llm/snapshot-middleware.js +142 -0
- package/dist/core/llm/snapshot-middleware.js.map +1 -0
- package/dist/core/llm/snapshot-middleware.test.js +144 -0
- package/dist/core/llm/snapshot-middleware.test.js.map +1 -0
- package/dist/core/llm/state.js +48 -0
- package/dist/core/llm/state.js.map +1 -0
- package/dist/core/llm/tokens.js +40 -0
- package/dist/core/llm/tokens.js.map +1 -0
- package/dist/core/multi-agent.integration.test.js +298 -0
- package/dist/core/multi-agent.integration.test.js.map +1 -0
- package/dist/core/plugin-hooks.integration.test.js +344 -0
- package/dist/core/plugin-hooks.integration.test.js.map +1 -0
- package/dist/core/plugins/hook-types.js +5 -0
- package/dist/core/plugins/hook-types.js.map +1 -0
- package/dist/core/plugins/index.js +5 -0
- package/dist/core/plugins/index.js.map +1 -0
- package/dist/core/plugins/plugin-builder.js +321 -0
- package/dist/core/plugins/plugin-builder.js.map +1 -0
- package/dist/core/preset/config.js +54 -0
- package/dist/core/preset/config.js.map +1 -0
- package/dist/core/preset/index.js +6 -0
- package/dist/core/preset/index.js.map +1 -0
- package/dist/core/preset/preset-builder.js +63 -0
- package/dist/core/preset/preset-builder.js.map +1 -0
- package/dist/core/session-lifecycle.integration.test.js +159 -0
- package/dist/core/session-lifecycle.integration.test.js.map +1 -0
- package/dist/core/sessions/apply-event.js +41 -0
- package/dist/core/sessions/apply-event.js.map +1 -0
- package/dist/core/sessions/context.js +2 -0
- package/dist/core/sessions/context.js.map +1 -0
- package/dist/core/sessions/fork-utils.js +42 -0
- package/dist/core/sessions/fork-utils.js.map +1 -0
- package/dist/core/sessions/fork-utils.test.js +129 -0
- package/dist/core/sessions/fork-utils.test.js.map +1 -0
- package/dist/core/sessions/reducer.js +55 -0
- package/dist/core/sessions/reducer.js.map +1 -0
- package/dist/core/sessions/schema.js +66 -0
- package/dist/core/sessions/schema.js.map +1 -0
- package/dist/core/sessions/session-environment.js +2 -0
- package/dist/core/sessions/session-environment.js.map +1 -0
- package/dist/core/sessions/session-manager.js +650 -0
- package/dist/core/sessions/session-manager.js.map +1 -0
- package/dist/core/sessions/session-store.js +118 -0
- package/dist/core/sessions/session-store.js.map +1 -0
- package/dist/core/sessions/session.js +675 -0
- package/dist/core/sessions/session.js.map +1 -0
- package/dist/core/sessions/session.test.js +1095 -0
- package/dist/core/sessions/session.test.js.map +1 -0
- package/dist/core/sessions/state.js +377 -0
- package/dist/core/sessions/state.js.map +1 -0
- package/dist/core/system.js +66 -0
- package/dist/core/system.js.map +1 -0
- package/dist/core/tools/context.js +2 -0
- package/dist/core/tools/context.js.map +1 -0
- package/dist/core/tools/definition.js +4 -0
- package/dist/core/tools/definition.js.map +1 -0
- package/dist/core/tools/executor.js +82 -0
- package/dist/core/tools/executor.js.map +1 -0
- package/dist/core/tools/executor.test.js +143 -0
- package/dist/core/tools/executor.test.js.map +1 -0
- package/dist/core/tools/index.js +4 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/schema.js +20 -0
- package/dist/core/tools/schema.js.map +1 -0
- package/dist/core/tools/state.js +29 -0
- package/dist/core/tools/state.js.map +1 -0
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/json/index.js +5 -0
- package/dist/lib/json/index.js.map +1 -0
- package/dist/lib/logger/console.js +147 -0
- package/dist/lib/logger/console.js.map +1 -0
- package/dist/lib/logger/console.test.js +258 -0
- package/dist/lib/logger/console.test.js.map +1 -0
- package/dist/lib/logger/file.js +54 -0
- package/dist/lib/logger/file.js.map +1 -0
- package/dist/lib/logger/index.js +4 -0
- package/dist/lib/logger/index.js.map +1 -0
- package/dist/lib/logger/logger.js +28 -0
- package/dist/lib/logger/logger.js.map +1 -0
- package/dist/lib/logger/ring-buffer.js +61 -0
- package/dist/lib/logger/ring-buffer.js.map +1 -0
- package/dist/lib/logger/tee.js +43 -0
- package/dist/lib/logger/tee.js.map +1 -0
- package/dist/lib/mime.js +22 -0
- package/dist/lib/mime.js.map +1 -0
- package/dist/lib/never.js +4 -0
- package/dist/lib/never.js.map +1 -0
- package/dist/lib/utils/hash.js +35 -0
- package/dist/lib/utils/hash.js.map +1 -0
- package/dist/lib/utils/result.js +21 -0
- package/dist/lib/utils/result.js.map +1 -0
- package/dist/platform/fs.js +8 -0
- package/dist/platform/fs.js.map +1 -0
- package/dist/platform/index.js +9 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/process.js +8 -0
- package/dist/platform/process.js.map +1 -0
- package/dist/plugins/agent-status/plugin.js +77 -0
- package/dist/plugins/agent-status/plugin.js.map +1 -0
- package/dist/plugins/agents/agents.integration.test.js +683 -0
- package/dist/plugins/agents/agents.integration.test.js.map +1 -0
- package/dist/plugins/agents/index.js +2 -0
- package/dist/plugins/agents/index.js.map +1 -0
- package/dist/plugins/agents/plugin.js +199 -0
- package/dist/plugins/agents/plugin.js.map +1 -0
- package/dist/plugins/context-compact/context-compact.integration.test.js +174 -0
- package/dist/plugins/context-compact/context-compact.integration.test.js.map +1 -0
- package/dist/plugins/context-compact/context-compactor.js +238 -0
- package/dist/plugins/context-compact/context-compactor.js.map +1 -0
- package/dist/plugins/context-compact/context-compactor.test.js +763 -0
- package/dist/plugins/context-compact/context-compactor.test.js.map +1 -0
- package/dist/plugins/context-compact/history-offloader.js +42 -0
- package/dist/plugins/context-compact/history-offloader.js.map +1 -0
- package/dist/plugins/context-compact/history-offloader.test.js +77 -0
- package/dist/plugins/context-compact/history-offloader.test.js.map +1 -0
- package/dist/plugins/context-compact/index.js +4 -0
- package/dist/plugins/context-compact/index.js.map +1 -0
- package/dist/plugins/context-compact/plugin.js +37 -0
- package/dist/plugins/context-compact/plugin.js.map +1 -0
- package/dist/plugins/filesystem/filesystem.integration.test.js +411 -0
- package/dist/plugins/filesystem/filesystem.integration.test.js.map +1 -0
- package/dist/plugins/filesystem/helpers.js +170 -0
- package/dist/plugins/filesystem/helpers.js.map +1 -0
- package/dist/plugins/filesystem/index.js +3 -0
- package/dist/plugins/filesystem/index.js.map +1 -0
- package/dist/plugins/filesystem/listing.js +247 -0
- package/dist/plugins/filesystem/listing.js.map +1 -0
- package/dist/plugins/filesystem/plugin.js +364 -0
- package/dist/plugins/filesystem/plugin.js.map +1 -0
- package/dist/plugins/filesystem/schema.js +2 -0
- package/dist/plugins/filesystem/schema.js.map +1 -0
- package/dist/plugins/git-status/index.js +2 -0
- package/dist/plugins/git-status/index.js.map +1 -0
- package/dist/plugins/git-status/plugin.js +144 -0
- package/dist/plugins/git-status/plugin.js.map +1 -0
- package/dist/plugins/limits-guard/config.js +5 -0
- package/dist/plugins/limits-guard/config.js.map +1 -0
- package/dist/plugins/limits-guard/index.js +3 -0
- package/dist/plugins/limits-guard/index.js.map +1 -0
- package/dist/plugins/limits-guard/limit-guard.js +125 -0
- package/dist/plugins/limits-guard/limit-guard.js.map +1 -0
- package/dist/plugins/limits-guard/limit-guard.test.js +121 -0
- package/dist/plugins/limits-guard/limit-guard.test.js.map +1 -0
- package/dist/plugins/limits-guard/limits-guard.integration.test.js +378 -0
- package/dist/plugins/limits-guard/limits-guard.integration.test.js.map +1 -0
- package/dist/plugins/limits-guard/plugin.js +240 -0
- package/dist/plugins/limits-guard/plugin.js.map +1 -0
- package/dist/plugins/llm-debug/index.js +2 -0
- package/dist/plugins/llm-debug/index.js.map +1 -0
- package/dist/plugins/llm-debug/llm-debug.integration.test.js +157 -0
- package/dist/plugins/llm-debug/llm-debug.integration.test.js.map +1 -0
- package/dist/plugins/llm-debug/plugin.js +148 -0
- package/dist/plugins/llm-debug/plugin.js.map +1 -0
- package/dist/plugins/logs/index.js +2 -0
- package/dist/plugins/logs/index.js.map +1 -0
- package/dist/plugins/logs/plugin.js +38 -0
- package/dist/plugins/logs/plugin.js.map +1 -0
- package/dist/plugins/mailbox/helpers.js +66 -0
- package/dist/plugins/mailbox/helpers.js.map +1 -0
- package/dist/plugins/mailbox/index.js +9 -0
- package/dist/plugins/mailbox/index.js.map +1 -0
- package/dist/plugins/mailbox/mailbox.integration.test.js +605 -0
- package/dist/plugins/mailbox/mailbox.integration.test.js.map +1 -0
- package/dist/plugins/mailbox/plugin.js +204 -0
- package/dist/plugins/mailbox/plugin.js.map +1 -0
- package/dist/plugins/mailbox/prompts.js +93 -0
- package/dist/plugins/mailbox/prompts.js.map +1 -0
- package/dist/plugins/mailbox/query.js +38 -0
- package/dist/plugins/mailbox/query.js.map +1 -0
- package/dist/plugins/mailbox/schema.js +32 -0
- package/dist/plugins/mailbox/schema.js.map +1 -0
- package/dist/plugins/mailbox/state.js +41 -0
- package/dist/plugins/mailbox/state.js.map +1 -0
- package/dist/plugins/resources/index.js +4 -0
- package/dist/plugins/resources/index.js.map +1 -0
- package/dist/plugins/resources/manifest.js +20 -0
- package/dist/plugins/resources/manifest.js.map +1 -0
- package/dist/plugins/resources/plugin.js +171 -0
- package/dist/plugins/resources/plugin.js.map +1 -0
- package/dist/plugins/resources/post-inject.js +32 -0
- package/dist/plugins/resources/post-inject.js.map +1 -0
- package/dist/plugins/resources/state.js +16 -0
- package/dist/plugins/resources/state.js.map +1 -0
- package/dist/plugins/result-eviction/index.js +2 -0
- package/dist/plugins/result-eviction/index.js.map +1 -0
- package/dist/plugins/result-eviction/plugin.js +43 -0
- package/dist/plugins/result-eviction/plugin.js.map +1 -0
- package/dist/plugins/result-eviction/result-eviction.integration.test.js +217 -0
- package/dist/plugins/result-eviction/result-eviction.integration.test.js.map +1 -0
- package/dist/plugins/services/plugin.js +453 -0
- package/dist/plugins/services/plugin.js.map +1 -0
- package/dist/plugins/services/port-pool.js +70 -0
- package/dist/plugins/services/port-pool.js.map +1 -0
- package/dist/plugins/services/prompt.js +40 -0
- package/dist/plugins/services/prompt.js.map +1 -0
- package/dist/plugins/services/schema.js +9 -0
- package/dist/plugins/services/schema.js.map +1 -0
- package/dist/plugins/services/service.js +470 -0
- package/dist/plugins/services/service.js.map +1 -0
- package/dist/plugins/services/services.integration.test.js +485 -0
- package/dist/plugins/services/services.integration.test.js.map +1 -0
- package/dist/plugins/session-lifecycle/index.js +2 -0
- package/dist/plugins/session-lifecycle/index.js.map +1 -0
- package/dist/plugins/session-lifecycle/plugin.js +273 -0
- package/dist/plugins/session-lifecycle/plugin.js.map +1 -0
- package/dist/plugins/session-lifecycle/session-lifecycle.integration.test.js +498 -0
- package/dist/plugins/session-lifecycle/session-lifecycle.integration.test.js.map +1 -0
- package/dist/plugins/session-state/plugin.js +159 -0
- package/dist/plugins/session-state/plugin.js.map +1 -0
- package/dist/plugins/session-stats/index.js +3 -0
- package/dist/plugins/session-stats/index.js.map +1 -0
- package/dist/plugins/session-stats/plugin.js +81 -0
- package/dist/plugins/session-stats/plugin.js.map +1 -0
- package/dist/plugins/shell/executor.js +339 -0
- package/dist/plugins/shell/executor.js.map +1 -0
- package/dist/plugins/shell/index.js +6 -0
- package/dist/plugins/shell/index.js.map +1 -0
- package/dist/plugins/shell/plugin.js +66 -0
- package/dist/plugins/shell/plugin.js.map +1 -0
- package/dist/plugins/shell/shell.integration.test.js +234 -0
- package/dist/plugins/shell/shell.integration.test.js.map +1 -0
- package/dist/plugins/shell/shell.test.js +236 -0
- package/dist/plugins/shell/shell.test.js.map +1 -0
- package/dist/plugins/skills/discovery.js +205 -0
- package/dist/plugins/skills/discovery.js.map +1 -0
- package/dist/plugins/skills/discovery.test.js +312 -0
- package/dist/plugins/skills/discovery.test.js.map +1 -0
- package/dist/plugins/skills/index.js +12 -0
- package/dist/plugins/skills/index.js.map +1 -0
- package/dist/plugins/skills/plugin.js +293 -0
- package/dist/plugins/skills/plugin.js.map +1 -0
- package/dist/plugins/skills/prompts.js +70 -0
- package/dist/plugins/skills/prompts.js.map +1 -0
- package/dist/plugins/skills/schema.js +18 -0
- package/dist/plugins/skills/schema.js.map +1 -0
- package/dist/plugins/skills/skills.integration.test.js +475 -0
- package/dist/plugins/skills/skills.integration.test.js.map +1 -0
- package/dist/plugins/snapshotting/index.js +3 -0
- package/dist/plugins/snapshotting/index.js.map +1 -0
- package/dist/plugins/snapshotting/jj-snapshotter.js +106 -0
- package/dist/plugins/snapshotting/jj-snapshotter.js.map +1 -0
- package/dist/plugins/snapshotting/plugin.js +28 -0
- package/dist/plugins/snapshotting/plugin.js.map +1 -0
- package/dist/plugins/snapshotting/snapshotter.js +2 -0
- package/dist/plugins/snapshotting/snapshotter.js.map +1 -0
- package/dist/plugins/todo/index.js +7 -0
- package/dist/plugins/todo/index.js.map +1 -0
- package/dist/plugins/todo/plugin.js +319 -0
- package/dist/plugins/todo/plugin.js.map +1 -0
- package/dist/plugins/todo/prompts.js +54 -0
- package/dist/plugins/todo/prompts.js.map +1 -0
- package/dist/plugins/todo/schema.js +18 -0
- package/dist/plugins/todo/schema.js.map +1 -0
- package/dist/plugins/todo/todo.integration.test.js +605 -0
- package/dist/plugins/todo/todo.integration.test.js.map +1 -0
- package/dist/plugins/uploads/index.js +8 -0
- package/dist/plugins/uploads/index.js.map +1 -0
- package/dist/plugins/uploads/plugin.js +346 -0
- package/dist/plugins/uploads/plugin.js.map +1 -0
- package/dist/plugins/uploads/preprocessor.js +44 -0
- package/dist/plugins/uploads/preprocessor.js.map +1 -0
- package/dist/plugins/uploads/preprocessors/image-classifier.js +127 -0
- package/dist/plugins/uploads/preprocessors/image-classifier.js.map +1 -0
- package/dist/plugins/uploads/preprocessors/index.js +7 -0
- package/dist/plugins/uploads/preprocessors/index.js.map +1 -0
- package/dist/plugins/uploads/preprocessors/markitdown-preprocessor.js +204 -0
- package/dist/plugins/uploads/preprocessors/markitdown-preprocessor.js.map +1 -0
- package/dist/plugins/uploads/preprocessors/zip-preprocessor.js +172 -0
- package/dist/plugins/uploads/preprocessors/zip-preprocessor.js.map +1 -0
- package/dist/plugins/uploads/schema.js +20 -0
- package/dist/plugins/uploads/schema.js.map +1 -0
- package/dist/plugins/uploads/state.js +22 -0
- package/dist/plugins/uploads/state.js.map +1 -0
- package/dist/plugins/uploads/uploads.integration.test.js +496 -0
- package/dist/plugins/uploads/uploads.integration.test.js.map +1 -0
- package/dist/plugins/user-chat/index.js +5 -0
- package/dist/plugins/user-chat/index.js.map +1 -0
- package/dist/plugins/user-chat/plugin.js +544 -0
- package/dist/plugins/user-chat/plugin.js.map +1 -0
- package/dist/plugins/user-chat/prompts.js +29 -0
- package/dist/plugins/user-chat/prompts.js.map +1 -0
- package/dist/plugins/user-chat/schema.js +46 -0
- package/dist/plugins/user-chat/schema.js.map +1 -0
- package/dist/plugins/user-chat/user-chat.integration.test.js +668 -0
- package/dist/plugins/user-chat/user-chat.integration.test.js.map +1 -0
- package/dist/plugins/workers/context.js +143 -0
- package/dist/plugins/workers/context.js.map +1 -0
- package/dist/plugins/workers/definition.js +30 -0
- package/dist/plugins/workers/definition.js.map +1 -0
- package/dist/plugins/workers/index.js +7 -0
- package/dist/plugins/workers/index.js.map +1 -0
- package/dist/plugins/workers/plugin.js +578 -0
- package/dist/plugins/workers/plugin.js.map +1 -0
- package/dist/plugins/workers/worker.js +18 -0
- package/dist/plugins/workers/worker.js.map +1 -0
- package/dist/plugins/workers/workers.integration.test.js +629 -0
- package/dist/plugins/workers/workers.integration.test.js.map +1 -0
- package/dist/prompts/base.js +239 -0
- package/dist/prompts/base.js.map +1 -0
- package/dist/prompts/builder.js +131 -0
- package/dist/prompts/builder.js.map +1 -0
- package/dist/prompts/index.js +20 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/macros.js +26 -0
- package/dist/prompts/macros.js.map +1 -0
- package/dist/prompts/macros.test.js +80 -0
- package/dist/prompts/macros.test.js.map +1 -0
- package/dist/testing/bootstrap-for-testing.js +28 -0
- package/dist/testing/bootstrap-for-testing.js.map +1 -0
- package/dist/testing/index.js +7 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/node-platform.js +65 -0
- package/dist/testing/node-platform.js.map +1 -0
- package/dist/testing/notification-collector.js +82 -0
- package/dist/testing/notification-collector.js.map +1 -0
- package/dist/testing/preset-helpers.js +37 -0
- package/dist/testing/preset-helpers.js.map +1 -0
- package/dist/testing/test-harness.js +226 -0
- package/dist/testing/test-harness.js.map +1 -0
- package/dist/testing/test-harness.test.js +51 -0
- package/dist/testing/test-harness.test.js.map +1 -0
- package/dist/testing/wait-helpers.js +64 -0
- package/dist/testing/wait-helpers.js.map +1 -0
- package/dist/transport/adapter/client-adapter.js +64 -0
- package/dist/transport/adapter/client-adapter.js.map +1 -0
- package/dist/transport/adapter/index.js +24 -0
- package/dist/transport/adapter/index.js.map +1 -0
- package/dist/transport/adapter/server-adapter.js +73 -0
- package/dist/transport/adapter/server-adapter.js.map +1 -0
- package/dist/transport/adapter/types.js +8 -0
- package/dist/transport/adapter/types.js.map +1 -0
- package/dist/transport/http/app.js +86 -0
- package/dist/transport/http/app.js.map +1 -0
- package/dist/transport/http/index.js +6 -0
- package/dist/transport/http/index.js.map +1 -0
- package/dist/transport/http/middleware/bearer-auth.js +33 -0
- package/dist/transport/http/middleware/bearer-auth.js.map +1 -0
- package/dist/transport/http/middleware/error-handler.js +56 -0
- package/dist/transport/http/middleware/error-handler.js.map +1 -0
- package/dist/transport/http/routes/files.js +237 -0
- package/dist/transport/http/routes/files.js.map +1 -0
- package/dist/transport/http/routes/resources.js +77 -0
- package/dist/transport/http/routes/resources.js.map +1 -0
- package/dist/transport/http/routes/rpc.integration.test.js +189 -0
- package/dist/transport/http/routes/rpc.integration.test.js.map +1 -0
- package/dist/transport/http/routes/rpc.js +110 -0
- package/dist/transport/http/routes/rpc.js.map +1 -0
- package/dist/transport/http/routes/rpc.test.js +316 -0
- package/dist/transport/http/routes/rpc.test.js.map +1 -0
- package/dist/transport/http/routes/upload.js +205 -0
- package/dist/transport/http/routes/upload.js.map +1 -0
- package/dist/transport/rpc/index.js +7 -0
- package/dist/transport/rpc/index.js.map +1 -0
- package/dist/transport/rpc/methods.js +8 -0
- package/dist/transport/rpc/methods.js.map +1 -0
- package/dist/user-config.js +14 -0
- package/dist/user-config.js.map +1 -0
- package/package.json +47 -57
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
import { definePlugin } from '../../core/plugins/plugin-builder.js';
|
|
3
|
+
import { createTool } from '../../core/tools/definition.js';
|
|
4
|
+
import { Err, Ok } from '../../lib/utils/result.js';
|
|
5
|
+
import { ShellExecutor } from './executor.js';
|
|
6
|
+
const runCommandInputSchema = z.object({
|
|
7
|
+
command: z.string().describe('Shell command to execute'),
|
|
8
|
+
args: z.union([z.string(), z.array(z.string())]).optional()
|
|
9
|
+
.describe('Command arguments. String or array of strings.'),
|
|
10
|
+
cwd: z.string().optional()
|
|
11
|
+
.describe('Working directory for the command.'),
|
|
12
|
+
timeout: z.number().int().positive().optional()
|
|
13
|
+
.describe('Command timeout in milliseconds.'),
|
|
14
|
+
stdin: z.string().optional()
|
|
15
|
+
.describe("Input to send to the command's stdin"),
|
|
16
|
+
});
|
|
17
|
+
export const shellPlugin = definePlugin('shell')
|
|
18
|
+
.pluginConfig()
|
|
19
|
+
.context(async (ctx, pluginConfig) => {
|
|
20
|
+
const shellConfig = {
|
|
21
|
+
cwd: pluginConfig.cwd,
|
|
22
|
+
timeout: pluginConfig.timeout,
|
|
23
|
+
env: pluginConfig.env,
|
|
24
|
+
shell: pluginConfig.shell,
|
|
25
|
+
sandboxed: pluginConfig.sandboxed ?? ctx.environment.sandboxed,
|
|
26
|
+
extraBinds: pluginConfig.extraBinds,
|
|
27
|
+
sandbox: pluginConfig.sandbox,
|
|
28
|
+
};
|
|
29
|
+
const executor = new ShellExecutor(shellConfig, { fs: ctx.platform.fs, process: ctx.platform.process });
|
|
30
|
+
return { executor };
|
|
31
|
+
})
|
|
32
|
+
.agentConfig()
|
|
33
|
+
.tools((ctx) => {
|
|
34
|
+
const defaultEnabled = ctx.pluginConfig.defaultEnabled ?? true;
|
|
35
|
+
const agentEnabled = ctx.pluginAgentConfig?.enabled ?? defaultEnabled;
|
|
36
|
+
if (!agentEnabled)
|
|
37
|
+
return [];
|
|
38
|
+
return [
|
|
39
|
+
createTool({
|
|
40
|
+
name: 'run_command',
|
|
41
|
+
description: 'Execute a shell command. Returns stdout, stderr, and exit code.',
|
|
42
|
+
input: runCommandInputSchema,
|
|
43
|
+
execute: async (input, context) => {
|
|
44
|
+
const executor = ctx.pluginContext.executor;
|
|
45
|
+
const result = await executor.execute(input, context.environment);
|
|
46
|
+
if (!result.ok)
|
|
47
|
+
return Err(result.error);
|
|
48
|
+
const output = JSON.stringify(result.value, null, 2);
|
|
49
|
+
if (result.value.exitCode !== 0) {
|
|
50
|
+
return Err({ message: output, recoverable: true });
|
|
51
|
+
}
|
|
52
|
+
return Ok(output);
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
];
|
|
56
|
+
})
|
|
57
|
+
.build();
|
|
58
|
+
/** Safe shell config for typical development tasks */
|
|
59
|
+
export function createSafeShellConfig(cwd) {
|
|
60
|
+
return { cwd, timeout: 60000, sandbox: { enabled: true } };
|
|
61
|
+
}
|
|
62
|
+
/** Restrictive shell config for untrusted agents */
|
|
63
|
+
export function createRestrictedShellConfig(cwd) {
|
|
64
|
+
return { cwd, timeout: 30000, sandbox: { enabled: true } };
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/plugins/shell/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAA0C,aAAa,EAAE,MAAM,eAAe,CAAA;AA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,UAAU,qBAAqB,CAAC,GAAW;IAChD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAA;AAC3D,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,2BAA2B,CAAC,GAAW;IACtD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAA;AAC3D,CAAC"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
import { contentToString } from '../../core/llm/llm-log-types.js';
|
|
3
|
+
import { MockLLMProvider } from '../../core/llm/mock.js';
|
|
4
|
+
import { ToolCallId } from '../../core/tools/schema.js';
|
|
5
|
+
import { createTestPreset, TestHarness } from '../../testing/index.js';
|
|
6
|
+
import { shellPlugin } from './index.js';
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// Helpers
|
|
9
|
+
// ============================================================================
|
|
10
|
+
function createShellPreset(overrides) {
|
|
11
|
+
const { shellConfig, ...rest } = overrides ?? {};
|
|
12
|
+
return createTestPreset({
|
|
13
|
+
...rest,
|
|
14
|
+
plugins: [
|
|
15
|
+
shellPlugin.configure({
|
|
16
|
+
cwd: '/tmp',
|
|
17
|
+
sandboxed: false,
|
|
18
|
+
timeout: 30000,
|
|
19
|
+
...shellConfig,
|
|
20
|
+
}),
|
|
21
|
+
...(rest?.plugins ?? []),
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function createShellHarness(options) {
|
|
26
|
+
return new TestHarness({ ...options, systemPlugins: [shellPlugin] });
|
|
27
|
+
}
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Tests
|
|
30
|
+
// ============================================================================
|
|
31
|
+
describe('shell plugin', () => {
|
|
32
|
+
// =========================================================================
|
|
33
|
+
// run_command tool
|
|
34
|
+
// =========================================================================
|
|
35
|
+
describe('run_command tool', () => {
|
|
36
|
+
it('echo hello → stdout contains "hello", exitCode 0', async () => {
|
|
37
|
+
const harness = createShellHarness({
|
|
38
|
+
presets: [createShellPreset()],
|
|
39
|
+
llmProvider: MockLLMProvider.withSequence([
|
|
40
|
+
{
|
|
41
|
+
toolCalls: [{
|
|
42
|
+
id: ToolCallId('tc1'),
|
|
43
|
+
name: 'run_command',
|
|
44
|
+
input: { command: 'echo hello' },
|
|
45
|
+
}],
|
|
46
|
+
},
|
|
47
|
+
{ content: 'Done', toolCalls: [] },
|
|
48
|
+
]),
|
|
49
|
+
});
|
|
50
|
+
const session = await harness.createSession('test');
|
|
51
|
+
await session.sendAndWaitForIdle('Run command');
|
|
52
|
+
const callHistory = harness.llmProvider.getCallHistory();
|
|
53
|
+
const toolMessages = callHistory[1].messages.filter((m) => m.role === 'tool');
|
|
54
|
+
const result = JSON.parse(contentToString(toolMessages[0].content));
|
|
55
|
+
expect(result.stdout).toContain('hello');
|
|
56
|
+
expect(result.exitCode).toBe(0);
|
|
57
|
+
await harness.shutdown();
|
|
58
|
+
});
|
|
59
|
+
it('command with exit code 1 → exitCode 1', async () => {
|
|
60
|
+
const harness = createShellHarness({
|
|
61
|
+
presets: [createShellPreset()],
|
|
62
|
+
llmProvider: MockLLMProvider.withSequence([
|
|
63
|
+
{
|
|
64
|
+
toolCalls: [{
|
|
65
|
+
id: ToolCallId('tc1'),
|
|
66
|
+
name: 'run_command',
|
|
67
|
+
input: { command: 'false' },
|
|
68
|
+
}],
|
|
69
|
+
},
|
|
70
|
+
{ content: 'Done', toolCalls: [] },
|
|
71
|
+
]),
|
|
72
|
+
});
|
|
73
|
+
const session = await harness.createSession('test');
|
|
74
|
+
await session.sendAndWaitForIdle('Run command');
|
|
75
|
+
const callHistory = harness.llmProvider.getCallHistory();
|
|
76
|
+
const toolMessages = callHistory[1].messages.filter((m) => m.role === 'tool');
|
|
77
|
+
const result = JSON.parse(contentToString(toolMessages[0].content));
|
|
78
|
+
expect(result.exitCode).toBe(1);
|
|
79
|
+
await harness.shutdown();
|
|
80
|
+
});
|
|
81
|
+
it('command with stderr → stderr captured', async () => {
|
|
82
|
+
const harness = createShellHarness({
|
|
83
|
+
presets: [createShellPreset()],
|
|
84
|
+
llmProvider: MockLLMProvider.withSequence([
|
|
85
|
+
{
|
|
86
|
+
toolCalls: [{
|
|
87
|
+
id: ToolCallId('tc1'),
|
|
88
|
+
name: 'run_command',
|
|
89
|
+
input: { command: 'echo error_output >&2' },
|
|
90
|
+
}],
|
|
91
|
+
},
|
|
92
|
+
{ content: 'Done', toolCalls: [] },
|
|
93
|
+
]),
|
|
94
|
+
});
|
|
95
|
+
const session = await harness.createSession('test');
|
|
96
|
+
await session.sendAndWaitForIdle('Run command');
|
|
97
|
+
const callHistory = harness.llmProvider.getCallHistory();
|
|
98
|
+
const toolMessages = callHistory[1].messages.filter((m) => m.role === 'tool');
|
|
99
|
+
const result = JSON.parse(contentToString(toolMessages[0].content));
|
|
100
|
+
expect(result.stderr).toContain('error_output');
|
|
101
|
+
await harness.shutdown();
|
|
102
|
+
});
|
|
103
|
+
it('command with stdin → stdin delivered', async () => {
|
|
104
|
+
const harness = createShellHarness({
|
|
105
|
+
presets: [createShellPreset()],
|
|
106
|
+
llmProvider: MockLLMProvider.withSequence([
|
|
107
|
+
{
|
|
108
|
+
toolCalls: [{
|
|
109
|
+
id: ToolCallId('tc1'),
|
|
110
|
+
name: 'run_command',
|
|
111
|
+
input: { command: 'cat', stdin: 'stdin_content' },
|
|
112
|
+
}],
|
|
113
|
+
},
|
|
114
|
+
{ content: 'Done', toolCalls: [] },
|
|
115
|
+
]),
|
|
116
|
+
});
|
|
117
|
+
const session = await harness.createSession('test');
|
|
118
|
+
await session.sendAndWaitForIdle('Run command');
|
|
119
|
+
const callHistory = harness.llmProvider.getCallHistory();
|
|
120
|
+
const toolMessages = callHistory[1].messages.filter((m) => m.role === 'tool');
|
|
121
|
+
const result = JSON.parse(contentToString(toolMessages[0].content));
|
|
122
|
+
expect(result.stdout).toContain('stdin_content');
|
|
123
|
+
await harness.shutdown();
|
|
124
|
+
});
|
|
125
|
+
it('command with env vars → env vars available', async () => {
|
|
126
|
+
const harness = createShellHarness({
|
|
127
|
+
presets: [createShellPreset({
|
|
128
|
+
shellConfig: {
|
|
129
|
+
env: { TEST_VAR: 'test_value_123' },
|
|
130
|
+
},
|
|
131
|
+
})],
|
|
132
|
+
llmProvider: MockLLMProvider.withSequence([
|
|
133
|
+
{
|
|
134
|
+
toolCalls: [{
|
|
135
|
+
id: ToolCallId('tc1'),
|
|
136
|
+
name: 'run_command',
|
|
137
|
+
input: { command: 'echo $TEST_VAR' },
|
|
138
|
+
}],
|
|
139
|
+
},
|
|
140
|
+
{ content: 'Done', toolCalls: [] },
|
|
141
|
+
]),
|
|
142
|
+
});
|
|
143
|
+
const session = await harness.createSession('test');
|
|
144
|
+
await session.sendAndWaitForIdle('Run command');
|
|
145
|
+
const callHistory = harness.llmProvider.getCallHistory();
|
|
146
|
+
const toolMessages = callHistory[1].messages.filter((m) => m.role === 'tool');
|
|
147
|
+
const result = JSON.parse(contentToString(toolMessages[0].content));
|
|
148
|
+
expect(result.stdout).toContain('test_value_123');
|
|
149
|
+
await harness.shutdown();
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
// =========================================================================
|
|
153
|
+
// Timeout
|
|
154
|
+
// =========================================================================
|
|
155
|
+
describe('timeout', () => {
|
|
156
|
+
it('slow command with short timeout → timedOut: true', async () => {
|
|
157
|
+
const harness = createShellHarness({
|
|
158
|
+
presets: [createShellPreset({
|
|
159
|
+
shellConfig: { timeout: 500 },
|
|
160
|
+
})],
|
|
161
|
+
llmProvider: MockLLMProvider.withSequence([
|
|
162
|
+
{
|
|
163
|
+
toolCalls: [{
|
|
164
|
+
id: ToolCallId('tc1'),
|
|
165
|
+
name: 'run_command',
|
|
166
|
+
input: { command: 'sleep 10', timeout: 500 },
|
|
167
|
+
}],
|
|
168
|
+
},
|
|
169
|
+
{ content: 'Done', toolCalls: [] },
|
|
170
|
+
]),
|
|
171
|
+
});
|
|
172
|
+
const session = await harness.createSession('test');
|
|
173
|
+
await session.sendAndWaitForIdle('Run command', { timeoutMs: 15000 });
|
|
174
|
+
const callHistory = harness.llmProvider.getCallHistory();
|
|
175
|
+
const toolMessages = callHistory[1].messages.filter((m) => m.role === 'tool');
|
|
176
|
+
const result = JSON.parse(contentToString(toolMessages[0].content));
|
|
177
|
+
expect(result.timedOut).toBe(true);
|
|
178
|
+
await harness.shutdown();
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
// =========================================================================
|
|
182
|
+
// Working directory
|
|
183
|
+
// =========================================================================
|
|
184
|
+
describe('working directory', () => {
|
|
185
|
+
it('pwd with custom cwd → output matches cwd', async () => {
|
|
186
|
+
const harness = createShellHarness({
|
|
187
|
+
presets: [createShellPreset({
|
|
188
|
+
shellConfig: { cwd: '/tmp' },
|
|
189
|
+
})],
|
|
190
|
+
llmProvider: MockLLMProvider.withSequence([
|
|
191
|
+
{
|
|
192
|
+
toolCalls: [{
|
|
193
|
+
id: ToolCallId('tc1'),
|
|
194
|
+
name: 'run_command',
|
|
195
|
+
input: { command: 'pwd' },
|
|
196
|
+
}],
|
|
197
|
+
},
|
|
198
|
+
{ content: 'Done', toolCalls: [] },
|
|
199
|
+
]),
|
|
200
|
+
});
|
|
201
|
+
const session = await harness.createSession('test');
|
|
202
|
+
await session.sendAndWaitForIdle('Run command');
|
|
203
|
+
const callHistory = harness.llmProvider.getCallHistory();
|
|
204
|
+
const toolMessages = callHistory[1].messages.filter((m) => m.role === 'tool');
|
|
205
|
+
const result = JSON.parse(contentToString(toolMessages[0].content));
|
|
206
|
+
// /tmp may resolve to a different path on some systems
|
|
207
|
+
expect(result.stdout.trim()).toMatch(/tmp/);
|
|
208
|
+
await harness.shutdown();
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
// =========================================================================
|
|
212
|
+
// Disabled
|
|
213
|
+
// =========================================================================
|
|
214
|
+
describe('disabled', () => {
|
|
215
|
+
it('enabled: false → no run_command tool', async () => {
|
|
216
|
+
const harness = createShellHarness({
|
|
217
|
+
presets: [createTestPreset({
|
|
218
|
+
plugins: [shellPlugin.configure({ cwd: '/tmp', sandboxed: false })],
|
|
219
|
+
orchestratorPlugins: [
|
|
220
|
+
shellPlugin.configureAgent({ enabled: false }),
|
|
221
|
+
],
|
|
222
|
+
})],
|
|
223
|
+
llmProvider: MockLLMProvider.withFixedResponse({ content: 'Ok', toolCalls: [] }),
|
|
224
|
+
});
|
|
225
|
+
const session = await harness.createSession('test');
|
|
226
|
+
await session.sendAndWaitForIdle('Hi');
|
|
227
|
+
const lastRequest = harness.llmProvider.getLastRequest();
|
|
228
|
+
const toolNames = lastRequest?.tools?.map((t) => t.name) ?? [];
|
|
229
|
+
expect(toolNames).not.toContain('run_command');
|
|
230
|
+
await harness.shutdown();
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
//# sourceMappingURL=shell.integration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.integration.test.js","sourceRoot":"","sources":["../../../src/plugins/shell/shell.integration.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,SAAS,iBAAiB,CAAC,SAAuH;IACjJ,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,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,4EAA4E;IAC5E,WAAW;IACX,4EAA4E;IAE5E,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACzB,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;YACrD,MAAM,OAAO,GAAG,kBAAkB,CAAC;gBAClC,OAAO,EAAE,CAAC,gBAAgB,CAAC;wBAC1B,OAAO,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;wBACnE,mBAAmB,EAAE;4BACpB,WAAW,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;yBAC9C;qBACD,CAAC,CAAC;gBACH,WAAW,EAAE,eAAe,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;aAChF,CAAC,CAAA;YAEF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;YACnD,MAAM,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;YAEtC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,EAAE,CAAA;YACxD,MAAM,SAAS,GAAG,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;YAC9D,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;YAE9C,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;QACzB,CAAC,CAAC,CAAA;IACH,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
import { createNodePlatform } from '../../testing/node-platform.js';
|
|
3
|
+
import { buildBwrapArgs, ShellExecutor } from './executor.js';
|
|
4
|
+
const testPlatform = createNodePlatform();
|
|
5
|
+
const testExecutorDeps = { fs: testPlatform.fs, process: testPlatform.process };
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// Test Helpers
|
|
8
|
+
// ============================================================================
|
|
9
|
+
const defaultConfig = {
|
|
10
|
+
cwd: process.cwd(),
|
|
11
|
+
timeout: 5000,
|
|
12
|
+
sandboxed: false,
|
|
13
|
+
sandbox: { enabled: false },
|
|
14
|
+
};
|
|
15
|
+
const createTestEnvironment = () => ({
|
|
16
|
+
sessionDir: '/tmp/test-session',
|
|
17
|
+
sandboxed: false,
|
|
18
|
+
});
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// buildBwrapArgs Tests
|
|
21
|
+
// ============================================================================
|
|
22
|
+
describe('buildBwrapArgs', () => {
|
|
23
|
+
it('builds basic args with session dir mapping', () => {
|
|
24
|
+
const args = buildBwrapArgs({
|
|
25
|
+
command: 'echo hello',
|
|
26
|
+
cwd: '/home/user/session',
|
|
27
|
+
sandbox: { enabled: true },
|
|
28
|
+
sessionDir: '/real/session/path',
|
|
29
|
+
});
|
|
30
|
+
expect(args).toContain('--ro-bind');
|
|
31
|
+
expect(args).toContain('--dev');
|
|
32
|
+
expect(args).toContain('--proc');
|
|
33
|
+
expect(args).toContain('--tmpfs');
|
|
34
|
+
expect(args).toContain('--unshare-all');
|
|
35
|
+
expect(args).toContain('--die-with-parent');
|
|
36
|
+
// Session dir should be mapped
|
|
37
|
+
const bindIdx = args.indexOf('--bind');
|
|
38
|
+
expect(args[bindIdx + 1]).toBe('/real/session/path');
|
|
39
|
+
expect(args[bindIdx + 2]).toBe('/home/user/session');
|
|
40
|
+
// No --share-net by default
|
|
41
|
+
expect(args).not.toContain('--share-net');
|
|
42
|
+
// --chdir sets working directory inside namespace
|
|
43
|
+
const chdirIdx = args.indexOf('--chdir');
|
|
44
|
+
expect(chdirIdx).toBeGreaterThan(0);
|
|
45
|
+
expect(args[chdirIdx + 1]).toBe('/home/user/session');
|
|
46
|
+
// Command at the end
|
|
47
|
+
expect(args.slice(-3)).toEqual(['/bin/sh', '-c', 'echo hello']);
|
|
48
|
+
});
|
|
49
|
+
it('includes --share-net when network enabled', () => {
|
|
50
|
+
const args = buildBwrapArgs({
|
|
51
|
+
command: 'curl example.com',
|
|
52
|
+
cwd: '/home/user/session',
|
|
53
|
+
sandbox: { enabled: true, network: true },
|
|
54
|
+
sessionDir: '/tmp/session',
|
|
55
|
+
});
|
|
56
|
+
expect(args).toContain('--share-net');
|
|
57
|
+
});
|
|
58
|
+
it('maps both session and workspace dirs', () => {
|
|
59
|
+
const args = buildBwrapArgs({
|
|
60
|
+
command: 'ls',
|
|
61
|
+
cwd: '/home/user/session',
|
|
62
|
+
sandbox: { enabled: true },
|
|
63
|
+
sessionDir: '/real/session',
|
|
64
|
+
workspaceDir: '/real/workspace',
|
|
65
|
+
});
|
|
66
|
+
const bindIndices = [];
|
|
67
|
+
args.forEach((a, i) => {
|
|
68
|
+
if (a === '--bind')
|
|
69
|
+
bindIndices.push(i);
|
|
70
|
+
});
|
|
71
|
+
expect(bindIndices.length).toBe(2); // session + workspace
|
|
72
|
+
// Verify session mapping
|
|
73
|
+
expect(args[bindIndices[0] + 1]).toBe('/real/session');
|
|
74
|
+
expect(args[bindIndices[0] + 2]).toBe('/home/user/session');
|
|
75
|
+
// Verify workspace mapping
|
|
76
|
+
expect(args[bindIndices[1] + 1]).toBe('/real/workspace');
|
|
77
|
+
expect(args[bindIndices[1] + 2]).toBe('/home/user/workspace');
|
|
78
|
+
});
|
|
79
|
+
it('adds extra bind mounts with correct mode', () => {
|
|
80
|
+
const args = buildBwrapArgs({
|
|
81
|
+
command: 'git status',
|
|
82
|
+
cwd: '/home/user/session',
|
|
83
|
+
sandbox: { enabled: true },
|
|
84
|
+
sessionDir: '/real/session',
|
|
85
|
+
extraBinds: [
|
|
86
|
+
{ path: '/home/user/project', mode: 'rw' },
|
|
87
|
+
{ path: '/opt/shared', mode: 'ro' },
|
|
88
|
+
],
|
|
89
|
+
});
|
|
90
|
+
// rw bind: --bind path path
|
|
91
|
+
const rwIdx = args.indexOf('/home/user/project');
|
|
92
|
+
expect(rwIdx).toBeGreaterThan(0);
|
|
93
|
+
expect(args[rwIdx - 1]).toBe('--bind');
|
|
94
|
+
expect(args[rwIdx + 1]).toBe('/home/user/project');
|
|
95
|
+
// ro bind: --ro-bind path path
|
|
96
|
+
const roIdx = args.indexOf('/opt/shared');
|
|
97
|
+
expect(roIdx).toBeGreaterThan(0);
|
|
98
|
+
expect(args[roIdx - 1]).toBe('--ro-bind');
|
|
99
|
+
expect(args[roIdx + 1]).toBe('/opt/shared');
|
|
100
|
+
});
|
|
101
|
+
it('sets --chdir to workspace cwd', () => {
|
|
102
|
+
const args = buildBwrapArgs({
|
|
103
|
+
command: 'git status',
|
|
104
|
+
cwd: '/home/user/workspace',
|
|
105
|
+
sandbox: { enabled: true },
|
|
106
|
+
sessionDir: '/real/session',
|
|
107
|
+
workspaceDir: '/real/workspace',
|
|
108
|
+
});
|
|
109
|
+
const chdirIdx = args.indexOf('--chdir');
|
|
110
|
+
expect(chdirIdx).toBeGreaterThan(0);
|
|
111
|
+
expect(args[chdirIdx + 1]).toBe('/home/user/workspace');
|
|
112
|
+
});
|
|
113
|
+
it('falls back to cwd writable when no session/workspace dirs', () => {
|
|
114
|
+
const args = buildBwrapArgs({
|
|
115
|
+
command: 'ls',
|
|
116
|
+
cwd: '/home/user',
|
|
117
|
+
sandbox: { enabled: true },
|
|
118
|
+
});
|
|
119
|
+
const bindIndices = [];
|
|
120
|
+
args.forEach((a, i) => {
|
|
121
|
+
if (a === '--bind')
|
|
122
|
+
bindIndices.push(i);
|
|
123
|
+
});
|
|
124
|
+
expect(bindIndices.length).toBe(1);
|
|
125
|
+
expect(args[bindIndices[0] + 1]).toBe('/home/user');
|
|
126
|
+
expect(args[bindIndices[0] + 2]).toBe('/home/user');
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
// ============================================================================
|
|
130
|
+
// ShellExecutor Tests
|
|
131
|
+
// ============================================================================
|
|
132
|
+
describe('ShellExecutor', () => {
|
|
133
|
+
it('executes simple echo command', async () => {
|
|
134
|
+
const executor = new ShellExecutor(defaultConfig, testExecutorDeps);
|
|
135
|
+
const environment = createTestEnvironment();
|
|
136
|
+
const result = await executor.execute({ command: "echo 'Hello, World!'" }, environment);
|
|
137
|
+
expect(result.ok).toBe(true);
|
|
138
|
+
if (!result.ok)
|
|
139
|
+
return;
|
|
140
|
+
expect(result.value.stdout).toBe('Hello, World!');
|
|
141
|
+
expect(result.value.stderr).toBe('');
|
|
142
|
+
expect(result.value.exitCode).toBe(0);
|
|
143
|
+
expect(result.value.timedOut).toBe(false);
|
|
144
|
+
expect(result.value.durationMs).toBeGreaterThan(0);
|
|
145
|
+
});
|
|
146
|
+
it('returns stderr for errors', async () => {
|
|
147
|
+
const executor = new ShellExecutor(defaultConfig, testExecutorDeps);
|
|
148
|
+
const environment = createTestEnvironment();
|
|
149
|
+
const result = await executor.execute({ command: 'ls /nonexistent_directory_12345' }, environment);
|
|
150
|
+
expect(result.ok).toBe(true);
|
|
151
|
+
if (!result.ok)
|
|
152
|
+
return;
|
|
153
|
+
expect(result.value.exitCode).not.toBe(0);
|
|
154
|
+
expect(result.value.stderr).toContain('No such file or directory');
|
|
155
|
+
});
|
|
156
|
+
it('handles command with args array', async () => {
|
|
157
|
+
const executor = new ShellExecutor(defaultConfig, testExecutorDeps);
|
|
158
|
+
const environment = createTestEnvironment();
|
|
159
|
+
const result = await executor.execute({ command: 'echo', args: ['arg1', 'arg2', 'arg3'] }, environment);
|
|
160
|
+
expect(result.ok).toBe(true);
|
|
161
|
+
if (!result.ok)
|
|
162
|
+
return;
|
|
163
|
+
expect(result.value.stdout).toBe('arg1 arg2 arg3');
|
|
164
|
+
expect(result.value.exitCode).toBe(0);
|
|
165
|
+
});
|
|
166
|
+
it('supports stdin input', async () => {
|
|
167
|
+
const executor = new ShellExecutor(defaultConfig, testExecutorDeps);
|
|
168
|
+
const environment = createTestEnvironment();
|
|
169
|
+
const result = await executor.execute({ command: 'cat', stdin: 'Hello from stdin' }, environment);
|
|
170
|
+
expect(result.ok).toBe(true);
|
|
171
|
+
if (!result.ok)
|
|
172
|
+
return;
|
|
173
|
+
expect(result.value.stdout).toBe('Hello from stdin');
|
|
174
|
+
expect(result.value.exitCode).toBe(0);
|
|
175
|
+
});
|
|
176
|
+
it('times out long-running commands', async () => {
|
|
177
|
+
const executor = new ShellExecutor({ ...defaultConfig, timeout: 200 }, testExecutorDeps);
|
|
178
|
+
const environment = createTestEnvironment();
|
|
179
|
+
const result = await executor.execute({ command: 'sleep 10' }, environment);
|
|
180
|
+
expect(result.ok).toBe(true);
|
|
181
|
+
if (!result.ok)
|
|
182
|
+
return;
|
|
183
|
+
expect(result.value.timedOut).toBe(true);
|
|
184
|
+
expect(result.value.signal).toBeDefined();
|
|
185
|
+
}, { timeout: 10000 });
|
|
186
|
+
it('allows overriding timeout per-command', async () => {
|
|
187
|
+
const executor = new ShellExecutor({ ...defaultConfig, timeout: 10000 }, testExecutorDeps);
|
|
188
|
+
const environment = createTestEnvironment();
|
|
189
|
+
const result = await executor.execute({ command: 'sleep 10', timeout: 200 }, environment);
|
|
190
|
+
expect(result.ok).toBe(true);
|
|
191
|
+
if (!result.ok)
|
|
192
|
+
return;
|
|
193
|
+
expect(result.value.timedOut).toBe(true);
|
|
194
|
+
}, { timeout: 10000 });
|
|
195
|
+
it('collects large stdout without truncation', async () => {
|
|
196
|
+
const executor = new ShellExecutor(defaultConfig, testExecutorDeps);
|
|
197
|
+
const environment = createTestEnvironment();
|
|
198
|
+
// Generate large output - shell tool no longer truncates, eviction happens at agent level
|
|
199
|
+
const result = await executor.execute({ command: "yes 'test' | head -n 1000" }, environment);
|
|
200
|
+
expect(result.ok).toBe(true);
|
|
201
|
+
if (!result.ok)
|
|
202
|
+
return;
|
|
203
|
+
expect(result.value.stdout.split('\n').length).toBe(1000);
|
|
204
|
+
});
|
|
205
|
+
it('uses custom working directory', async () => {
|
|
206
|
+
const executor = new ShellExecutor(defaultConfig, testExecutorDeps);
|
|
207
|
+
const environment = createTestEnvironment();
|
|
208
|
+
const result = await executor.execute({ command: 'pwd', cwd: '/tmp' }, environment);
|
|
209
|
+
expect(result.ok).toBe(true);
|
|
210
|
+
if (!result.ok)
|
|
211
|
+
return;
|
|
212
|
+
expect(result.value.stdout).toMatch(/^(\/private)?\/tmp$/);
|
|
213
|
+
});
|
|
214
|
+
it('passes environment variables', async () => {
|
|
215
|
+
const executor = new ShellExecutor({
|
|
216
|
+
...defaultConfig,
|
|
217
|
+
env: { TEST_VAR: 'test_value' },
|
|
218
|
+
}, testExecutorDeps);
|
|
219
|
+
const environment = createTestEnvironment();
|
|
220
|
+
const result = await executor.execute({ command: 'echo $TEST_VAR' }, environment);
|
|
221
|
+
expect(result.ok).toBe(true);
|
|
222
|
+
if (!result.ok)
|
|
223
|
+
return;
|
|
224
|
+
expect(result.value.stdout).toBe('test_value');
|
|
225
|
+
});
|
|
226
|
+
it('returns non-zero exit code for failing commands', async () => {
|
|
227
|
+
const executor = new ShellExecutor(defaultConfig, testExecutorDeps);
|
|
228
|
+
const environment = createTestEnvironment();
|
|
229
|
+
const result = await executor.execute({ command: 'exit 42' }, environment);
|
|
230
|
+
expect(result.ok).toBe(true);
|
|
231
|
+
if (!result.ok)
|
|
232
|
+
return;
|
|
233
|
+
expect(result.value.exitCode).toBe(42);
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
//# sourceMappingURL=shell.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.test.js","sourceRoot":"","sources":["../../../src/plugins/shell/shell.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAoB,aAAa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