@roj-ai/sdk 0.0.2
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.d.ts +453 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/builtin-events.d.ts +16 -0
- package/dist/builtin-events.d.ts.map +1 -0
- package/dist/bun-platform/fs.d.ts +9 -0
- package/dist/bun-platform/fs.d.ts.map +1 -0
- package/dist/bun-platform/index.d.ts +12 -0
- package/dist/bun-platform/index.d.ts.map +1 -0
- package/dist/bun-platform/process.d.ts +6 -0
- package/dist/bun-platform/process.d.ts.map +1 -0
- package/dist/config.d.ts +38 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.test.d.ts +2 -0
- package/dist/config.test.d.ts.map +1 -0
- package/dist/core/agent-loop.integration.test.d.ts +2 -0
- package/dist/core/agent-loop.integration.test.d.ts.map +1 -0
- package/dist/core/agents/agent-config.test.d.ts +2 -0
- package/dist/core/agents/agent-config.test.d.ts.map +1 -0
- package/dist/core/agents/agent-roles.d.ts +33 -0
- package/dist/core/agents/agent-roles.d.ts.map +1 -0
- package/dist/core/agents/agent-shutdown.test.d.ts +6 -0
- package/dist/core/agents/agent-shutdown.test.d.ts.map +1 -0
- package/dist/core/agents/agent.d.ts +234 -0
- package/dist/core/agents/agent.d.ts.map +1 -0
- package/dist/core/agents/agent.test.d.ts +2 -0
- package/dist/core/agents/agent.test.d.ts.map +1 -0
- package/dist/core/agents/communicator.d.ts +3 -0
- package/dist/core/agents/communicator.d.ts.map +1 -0
- package/dist/core/agents/config.d.ts +84 -0
- package/dist/core/agents/config.d.ts.map +1 -0
- package/dist/core/agents/context.d.ts +16 -0
- package/dist/core/agents/context.d.ts.map +1 -0
- package/dist/core/agents/debounce.d.ts +52 -0
- package/dist/core/agents/debounce.d.ts.map +1 -0
- package/dist/core/agents/handler-events.test.d.ts +5 -0
- package/dist/core/agents/handler-events.test.d.ts.map +1 -0
- package/dist/core/agents/index.d.ts +2 -0
- package/dist/core/agents/index.d.ts.map +1 -0
- package/dist/core/agents/response-sanitizer.d.ts +25 -0
- package/dist/core/agents/response-sanitizer.d.ts.map +1 -0
- package/dist/core/agents/response-sanitizer.test.d.ts +2 -0
- package/dist/core/agents/response-sanitizer.test.d.ts.map +1 -0
- package/dist/core/agents/retry.d.ts +40 -0
- package/dist/core/agents/retry.d.ts.map +1 -0
- package/dist/core/agents/schema.d.ts +57 -0
- package/dist/core/agents/schema.d.ts.map +1 -0
- package/dist/core/agents/state.d.ts +255 -0
- package/dist/core/agents/state.d.ts.map +1 -0
- package/dist/core/context/state.d.ts +28 -0
- package/dist/core/context/state.d.ts.map +1 -0
- package/dist/core/errors.d.ts +29 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/event-sourcing.integration.test.d.ts +2 -0
- package/dist/core/event-sourcing.integration.test.d.ts.map +1 -0
- package/dist/core/events/base-event-store.d.ts +55 -0
- package/dist/core/events/base-event-store.d.ts.map +1 -0
- package/dist/core/events/event-store.d.ts +108 -0
- package/dist/core/events/event-store.d.ts.map +1 -0
- package/dist/core/events/file.d.ts +50 -0
- package/dist/core/events/file.d.ts.map +1 -0
- package/dist/core/events/file.test.d.ts +2 -0
- package/dist/core/events/file.test.d.ts.map +1 -0
- package/dist/core/events/index.d.ts +4 -0
- package/dist/core/events/index.d.ts.map +1 -0
- package/dist/core/events/memory.d.ts +43 -0
- package/dist/core/events/memory.d.ts.map +1 -0
- package/dist/core/events/memory.test.d.ts +2 -0
- package/dist/core/events/memory.test.d.ts.map +1 -0
- package/dist/core/events/metadata-utils.d.ts +27 -0
- package/dist/core/events/metadata-utils.d.ts.map +1 -0
- package/dist/core/events/test-helpers.d.ts +28 -0
- package/dist/core/events/test-helpers.d.ts.map +1 -0
- package/dist/core/events/types.d.ts +46 -0
- package/dist/core/events/types.d.ts.map +1 -0
- package/dist/core/file-store/file-store.d.ts +56 -0
- package/dist/core/file-store/file-store.d.ts.map +1 -0
- package/dist/core/file-store/types.d.ts +50 -0
- package/dist/core/file-store/types.d.ts.map +1 -0
- package/dist/core/image/image-processor.d.ts +15 -0
- package/dist/core/image/image-processor.d.ts.map +1 -0
- package/dist/core/image/image-processor.test.d.ts +2 -0
- package/dist/core/image/image-processor.test.d.ts.map +1 -0
- package/dist/core/image/index.d.ts +5 -0
- package/dist/core/image/index.d.ts.map +1 -0
- package/dist/core/image/noop-resizer.d.ts +5 -0
- package/dist/core/image/noop-resizer.d.ts.map +1 -0
- package/dist/core/image/types.d.ts +20 -0
- package/dist/core/image/types.d.ts.map +1 -0
- package/dist/core/image/vips-resizer.d.ts +21 -0
- package/dist/core/image/vips-resizer.d.ts.map +1 -0
- package/dist/core/image/vips-resizer.test.d.ts +2 -0
- package/dist/core/image/vips-resizer.test.d.ts.map +1 -0
- package/dist/core/llm/anthropic.d.ts +51 -0
- package/dist/core/llm/anthropic.d.ts.map +1 -0
- package/dist/core/llm/anthropic.test.d.ts +2 -0
- package/dist/core/llm/anthropic.test.d.ts.map +1 -0
- package/dist/core/llm/cache-breakpoints.d.ts +17 -0
- package/dist/core/llm/cache-breakpoints.d.ts.map +1 -0
- package/dist/core/llm/cache-live.test.d.ts +16 -0
- package/dist/core/llm/cache-live.test.d.ts.map +1 -0
- package/dist/core/llm/index.d.ts +16 -0
- package/dist/core/llm/index.d.ts.map +1 -0
- package/dist/core/llm/llm-log-types.d.ts +148 -0
- package/dist/core/llm/llm-log-types.d.ts.map +1 -0
- package/dist/core/llm/logger.d.ts +74 -0
- package/dist/core/llm/logger.d.ts.map +1 -0
- package/dist/core/llm/logger.test.d.ts +7 -0
- package/dist/core/llm/logger.test.d.ts.map +1 -0
- package/dist/core/llm/logging-provider.d.ts +20 -0
- package/dist/core/llm/logging-provider.d.ts.map +1 -0
- package/dist/core/llm/middleware.d.ts +79 -0
- package/dist/core/llm/middleware.d.ts.map +1 -0
- package/dist/core/llm/mock.d.ts +79 -0
- package/dist/core/llm/mock.d.ts.map +1 -0
- package/dist/core/llm/mock.test.d.ts +2 -0
- package/dist/core/llm/mock.test.d.ts.map +1 -0
- package/dist/core/llm/openrouter-mapping.test.d.ts +2 -0
- package/dist/core/llm/openrouter-mapping.test.d.ts.map +1 -0
- package/dist/core/llm/openrouter.d.ts +37 -0
- package/dist/core/llm/openrouter.d.ts.map +1 -0
- package/dist/core/llm/openrouter.test.d.ts +2 -0
- package/dist/core/llm/openrouter.test.d.ts.map +1 -0
- package/dist/core/llm/provider-integration.test.d.ts +12 -0
- package/dist/core/llm/provider-integration.test.d.ts.map +1 -0
- package/dist/core/llm/provider.d.ts +175 -0
- package/dist/core/llm/provider.d.ts.map +1 -0
- package/dist/core/llm/routing-provider.d.ts +31 -0
- package/dist/core/llm/routing-provider.d.ts.map +1 -0
- package/dist/core/llm/routing-provider.test.d.ts +2 -0
- package/dist/core/llm/routing-provider.test.d.ts.map +1 -0
- package/dist/core/llm/schema.d.ts +24 -0
- package/dist/core/llm/schema.d.ts.map +1 -0
- package/dist/core/llm/snapshot-fetch.d.ts +21 -0
- package/dist/core/llm/snapshot-fetch.d.ts.map +1 -0
- package/dist/core/llm/snapshot-middleware.d.ts +71 -0
- package/dist/core/llm/snapshot-middleware.d.ts.map +1 -0
- package/dist/core/llm/snapshot-middleware.test.d.ts +2 -0
- package/dist/core/llm/snapshot-middleware.test.d.ts.map +1 -0
- package/dist/core/llm/state.d.ts +73 -0
- package/dist/core/llm/state.d.ts.map +1 -0
- package/dist/core/llm/tokens.d.ts +36 -0
- package/dist/core/llm/tokens.d.ts.map +1 -0
- package/dist/core/multi-agent.integration.test.d.ts +2 -0
- package/dist/core/multi-agent.integration.test.d.ts.map +1 -0
- package/dist/core/plugin-hooks.integration.test.d.ts +2 -0
- package/dist/core/plugin-hooks.integration.test.d.ts.map +1 -0
- package/dist/core/plugins/hook-types.d.ts +55 -0
- package/dist/core/plugins/hook-types.d.ts.map +1 -0
- package/dist/core/plugins/index.d.ts +23 -0
- package/dist/core/plugins/index.d.ts.map +1 -0
- package/dist/core/plugins/plugin-builder.d.ts +474 -0
- package/dist/core/plugins/plugin-builder.d.ts.map +1 -0
- package/dist/core/preset/config.d.ts +55 -0
- package/dist/core/preset/config.d.ts.map +1 -0
- package/dist/core/preset/index.d.ts +8 -0
- package/dist/core/preset/index.d.ts.map +1 -0
- package/dist/core/preset/preset-builder.d.ts +44 -0
- package/dist/core/preset/preset-builder.d.ts.map +1 -0
- package/dist/core/session-lifecycle.integration.test.d.ts +2 -0
- package/dist/core/session-lifecycle.integration.test.d.ts.map +1 -0
- package/dist/core/sessions/apply-event.d.ts +19 -0
- package/dist/core/sessions/apply-event.d.ts.map +1 -0
- package/dist/core/sessions/context.d.ts +34 -0
- package/dist/core/sessions/context.d.ts.map +1 -0
- package/dist/core/sessions/fork-utils.d.ts +20 -0
- package/dist/core/sessions/fork-utils.d.ts.map +1 -0
- package/dist/core/sessions/fork-utils.test.d.ts +2 -0
- package/dist/core/sessions/fork-utils.test.d.ts.map +1 -0
- package/dist/core/sessions/reducer.d.ts +50 -0
- package/dist/core/sessions/reducer.d.ts.map +1 -0
- package/dist/core/sessions/schema.d.ts +82 -0
- package/dist/core/sessions/schema.d.ts.map +1 -0
- package/dist/core/sessions/session-environment.d.ts +13 -0
- package/dist/core/sessions/session-environment.d.ts.map +1 -0
- package/dist/core/sessions/session-manager.d.ts +183 -0
- package/dist/core/sessions/session-manager.d.ts.map +1 -0
- package/dist/core/sessions/session-store.d.ts +69 -0
- package/dist/core/sessions/session-store.d.ts.map +1 -0
- package/dist/core/sessions/session.d.ts +212 -0
- package/dist/core/sessions/session.d.ts.map +1 -0
- package/dist/core/sessions/session.test.d.ts +2 -0
- package/dist/core/sessions/session.test.d.ts.map +1 -0
- package/dist/core/sessions/state.d.ts +110 -0
- package/dist/core/sessions/state.d.ts.map +1 -0
- package/dist/core/system.d.ts +97 -0
- package/dist/core/system.d.ts.map +1 -0
- package/dist/core/tools/context.d.ts +3 -0
- package/dist/core/tools/context.d.ts.map +1 -0
- package/dist/core/tools/definition.d.ts +10 -0
- package/dist/core/tools/definition.d.ts.map +1 -0
- package/dist/core/tools/executor.d.ts +28 -0
- package/dist/core/tools/executor.d.ts.map +1 -0
- package/dist/core/tools/executor.test.d.ts +2 -0
- package/dist/core/tools/executor.test.d.ts.map +1 -0
- package/dist/core/tools/index.d.ts +4 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/schema.d.ts +61 -0
- package/dist/core/tools/schema.d.ts.map +1 -0
- package/dist/core/tools/state.d.ts +28 -0
- package/dist/core/tools/state.d.ts.map +1 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/json/index.d.ts +17 -0
- package/dist/lib/json/index.d.ts.map +1 -0
- package/dist/lib/logger/console.d.ts +35 -0
- package/dist/lib/logger/console.d.ts.map +1 -0
- package/dist/lib/logger/console.test.d.ts +2 -0
- package/dist/lib/logger/console.test.d.ts.map +1 -0
- package/dist/lib/logger/file.d.ts +20 -0
- package/dist/lib/logger/file.d.ts.map +1 -0
- package/dist/lib/logger/index.d.ts +5 -0
- package/dist/lib/logger/index.d.ts.map +1 -0
- package/dist/lib/logger/logger.d.ts +87 -0
- package/dist/lib/logger/logger.d.ts.map +1 -0
- package/dist/lib/logger/ring-buffer.d.ts +33 -0
- package/dist/lib/logger/ring-buffer.d.ts.map +1 -0
- package/dist/lib/logger/tee.d.ts +15 -0
- package/dist/lib/logger/tee.d.ts.map +1 -0
- package/dist/lib/mime.d.ts +9 -0
- package/dist/lib/mime.d.ts.map +1 -0
- package/dist/lib/never.d.ts +2 -0
- package/dist/lib/never.d.ts.map +1 -0
- package/dist/lib/utils/hash.d.ts +19 -0
- package/dist/lib/utils/hash.d.ts.map +1 -0
- package/dist/lib/utils/result.d.ts +26 -0
- package/dist/lib/utils/result.d.ts.map +1 -0
- package/dist/platform/fs.d.ts +39 -0
- package/dist/platform/fs.d.ts.map +1 -0
- package/dist/platform/index.d.ts +21 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/process.d.ts +24 -0
- package/dist/platform/process.d.ts.map +1 -0
- package/dist/plugins/agent-status/plugin.d.ts +8 -0
- package/dist/plugins/agent-status/plugin.d.ts.map +1 -0
- package/dist/plugins/agents/agents.integration.test.d.ts +2 -0
- package/dist/plugins/agents/agents.integration.test.d.ts.map +1 -0
- package/dist/plugins/agents/index.d.ts +3 -0
- package/dist/plugins/agents/index.d.ts.map +1 -0
- package/dist/plugins/agents/plugin.d.ts +57 -0
- package/dist/plugins/agents/plugin.d.ts.map +1 -0
- package/dist/plugins/context-compact/context-compact.integration.test.d.ts +2 -0
- package/dist/plugins/context-compact/context-compact.integration.test.d.ts.map +1 -0
- package/dist/plugins/context-compact/context-compactor.d.ts +88 -0
- package/dist/plugins/context-compact/context-compactor.d.ts.map +1 -0
- package/dist/plugins/context-compact/context-compactor.test.d.ts +2 -0
- package/dist/plugins/context-compact/context-compactor.test.d.ts.map +1 -0
- package/dist/plugins/context-compact/history-offloader.d.ts +17 -0
- package/dist/plugins/context-compact/history-offloader.d.ts.map +1 -0
- package/dist/plugins/context-compact/history-offloader.test.d.ts +2 -0
- package/dist/plugins/context-compact/history-offloader.test.d.ts.map +1 -0
- package/dist/plugins/context-compact/index.d.ts +4 -0
- package/dist/plugins/context-compact/index.d.ts.map +1 -0
- package/dist/plugins/context-compact/plugin.d.ts +15 -0
- package/dist/plugins/context-compact/plugin.d.ts.map +1 -0
- package/dist/plugins/filesystem/filesystem.integration.test.d.ts +2 -0
- package/dist/plugins/filesystem/filesystem.integration.test.d.ts.map +1 -0
- package/dist/plugins/filesystem/helpers.d.ts +34 -0
- package/dist/plugins/filesystem/helpers.d.ts.map +1 -0
- package/dist/plugins/filesystem/index.d.ts +5 -0
- package/dist/plugins/filesystem/index.d.ts.map +1 -0
- package/dist/plugins/filesystem/listing.d.ts +38 -0
- package/dist/plugins/filesystem/listing.d.ts.map +1 -0
- package/dist/plugins/filesystem/plugin.d.ts +53 -0
- package/dist/plugins/filesystem/plugin.d.ts.map +1 -0
- package/dist/plugins/filesystem/schema.d.ts +7 -0
- package/dist/plugins/filesystem/schema.d.ts.map +1 -0
- package/dist/plugins/git-status/index.d.ts +2 -0
- package/dist/plugins/git-status/index.d.ts.map +1 -0
- package/dist/plugins/git-status/plugin.d.ts +12 -0
- package/dist/plugins/git-status/plugin.d.ts.map +1 -0
- package/dist/plugins/limits-guard/config.d.ts +23 -0
- package/dist/plugins/limits-guard/config.d.ts.map +1 -0
- package/dist/plugins/limits-guard/index.d.ts +5 -0
- package/dist/plugins/limits-guard/index.d.ts.map +1 -0
- package/dist/plugins/limits-guard/limit-guard.d.ts +40 -0
- package/dist/plugins/limits-guard/limit-guard.d.ts.map +1 -0
- package/dist/plugins/limits-guard/limit-guard.test.d.ts +2 -0
- package/dist/plugins/limits-guard/limit-guard.test.d.ts.map +1 -0
- package/dist/plugins/limits-guard/limits-guard.integration.test.d.ts +2 -0
- package/dist/plugins/limits-guard/limits-guard.integration.test.d.ts.map +1 -0
- package/dist/plugins/limits-guard/plugin.d.ts +39 -0
- package/dist/plugins/limits-guard/plugin.d.ts.map +1 -0
- package/dist/plugins/llm-debug/index.d.ts +2 -0
- package/dist/plugins/llm-debug/index.d.ts.map +1 -0
- package/dist/plugins/llm-debug/llm-debug.integration.test.d.ts +2 -0
- package/dist/plugins/llm-debug/llm-debug.integration.test.d.ts.map +1 -0
- package/dist/plugins/llm-debug/plugin.d.ts +31 -0
- package/dist/plugins/llm-debug/plugin.d.ts.map +1 -0
- package/dist/plugins/logs/index.d.ts +2 -0
- package/dist/plugins/logs/index.d.ts.map +1 -0
- package/dist/plugins/logs/plugin.d.ts +10 -0
- package/dist/plugins/logs/plugin.d.ts.map +1 -0
- package/dist/plugins/mailbox/helpers.d.ts +20 -0
- package/dist/plugins/mailbox/helpers.d.ts.map +1 -0
- package/dist/plugins/mailbox/index.d.ts +9 -0
- package/dist/plugins/mailbox/index.d.ts.map +1 -0
- package/dist/plugins/mailbox/mailbox.integration.test.d.ts +2 -0
- package/dist/plugins/mailbox/mailbox.integration.test.d.ts.map +1 -0
- package/dist/plugins/mailbox/plugin.d.ts +31 -0
- package/dist/plugins/mailbox/plugin.d.ts.map +1 -0
- package/dist/plugins/mailbox/prompts.d.ts +21 -0
- package/dist/plugins/mailbox/prompts.d.ts.map +1 -0
- package/dist/plugins/mailbox/query.d.ts +33 -0
- package/dist/plugins/mailbox/query.d.ts.map +1 -0
- package/dist/plugins/mailbox/schema.d.ts +54 -0
- package/dist/plugins/mailbox/schema.d.ts.map +1 -0
- package/dist/plugins/mailbox/state.d.ts +40 -0
- package/dist/plugins/mailbox/state.d.ts.map +1 -0
- package/dist/plugins/resources/index.d.ts +7 -0
- package/dist/plugins/resources/index.d.ts.map +1 -0
- package/dist/plugins/resources/manifest.d.ts +23 -0
- package/dist/plugins/resources/manifest.d.ts.map +1 -0
- package/dist/plugins/resources/plugin.d.ts +28 -0
- package/dist/plugins/resources/plugin.d.ts.map +1 -0
- package/dist/plugins/resources/post-inject.d.ts +39 -0
- package/dist/plugins/resources/post-inject.d.ts.map +1 -0
- package/dist/plugins/resources/state.d.ts +25 -0
- package/dist/plugins/resources/state.d.ts.map +1 -0
- package/dist/plugins/result-eviction/index.d.ts +3 -0
- package/dist/plugins/result-eviction/index.d.ts.map +1 -0
- package/dist/plugins/result-eviction/plugin.d.ts +19 -0
- package/dist/plugins/result-eviction/plugin.d.ts.map +1 -0
- package/dist/plugins/result-eviction/result-eviction.integration.test.d.ts +2 -0
- package/dist/plugins/result-eviction/result-eviction.integration.test.d.ts.map +1 -0
- package/dist/plugins/services/plugin.d.ts +85 -0
- package/dist/plugins/services/plugin.d.ts.map +1 -0
- package/dist/plugins/services/port-pool.d.ts +32 -0
- package/dist/plugins/services/port-pool.d.ts.map +1 -0
- package/dist/plugins/services/prompt.d.ts +13 -0
- package/dist/plugins/services/prompt.d.ts.map +1 -0
- package/dist/plugins/services/schema.d.ts +70 -0
- package/dist/plugins/services/schema.d.ts.map +1 -0
- package/dist/plugins/services/service.d.ts +86 -0
- package/dist/plugins/services/service.d.ts.map +1 -0
- package/dist/plugins/services/services.integration.test.d.ts +2 -0
- package/dist/plugins/services/services.integration.test.d.ts.map +1 -0
- package/dist/plugins/session-lifecycle/index.d.ts +2 -0
- package/dist/plugins/session-lifecycle/index.d.ts.map +1 -0
- package/dist/plugins/session-lifecycle/plugin.d.ts +97 -0
- package/dist/plugins/session-lifecycle/plugin.d.ts.map +1 -0
- package/dist/plugins/session-lifecycle/session-lifecycle.integration.test.d.ts +2 -0
- package/dist/plugins/session-lifecycle/session-lifecycle.integration.test.d.ts.map +1 -0
- package/dist/plugins/session-state/plugin.d.ts +48 -0
- package/dist/plugins/session-state/plugin.d.ts.map +1 -0
- package/dist/plugins/session-stats/index.d.ts +4 -0
- package/dist/plugins/session-stats/index.d.ts.map +1 -0
- package/dist/plugins/session-stats/plugin.d.ts +29 -0
- package/dist/plugins/session-stats/plugin.d.ts.map +1 -0
- package/dist/plugins/shell/executor.d.ts +78 -0
- package/dist/plugins/shell/executor.d.ts.map +1 -0
- package/dist/plugins/shell/index.d.ts +6 -0
- package/dist/plugins/shell/index.d.ts.map +1 -0
- package/dist/plugins/shell/plugin.d.ts +51 -0
- package/dist/plugins/shell/plugin.d.ts.map +1 -0
- package/dist/plugins/shell/shell.integration.test.d.ts +2 -0
- package/dist/plugins/shell/shell.integration.test.d.ts.map +1 -0
- package/dist/plugins/shell/shell.test.d.ts +2 -0
- package/dist/plugins/shell/shell.test.d.ts.map +1 -0
- package/dist/plugins/skills/discovery.d.ts +69 -0
- package/dist/plugins/skills/discovery.d.ts.map +1 -0
- package/dist/plugins/skills/discovery.test.d.ts +2 -0
- package/dist/plugins/skills/discovery.test.d.ts.map +1 -0
- package/dist/plugins/skills/index.d.ts +11 -0
- package/dist/plugins/skills/index.d.ts.map +1 -0
- package/dist/plugins/skills/plugin.d.ts +94 -0
- package/dist/plugins/skills/plugin.d.ts.map +1 -0
- package/dist/plugins/skills/prompts.d.ts +29 -0
- package/dist/plugins/skills/prompts.d.ts.map +1 -0
- package/dist/plugins/skills/schema.d.ts +64 -0
- package/dist/plugins/skills/schema.d.ts.map +1 -0
- package/dist/plugins/skills/skills.integration.test.d.ts +2 -0
- package/dist/plugins/skills/skills.integration.test.d.ts.map +1 -0
- package/dist/plugins/snapshotting/index.d.ts +4 -0
- package/dist/plugins/snapshotting/index.d.ts.map +1 -0
- package/dist/plugins/snapshotting/jj-snapshotter.d.ts +27 -0
- package/dist/plugins/snapshotting/jj-snapshotter.d.ts.map +1 -0
- package/dist/plugins/snapshotting/plugin.d.ts +15 -0
- package/dist/plugins/snapshotting/plugin.d.ts.map +1 -0
- package/dist/plugins/snapshotting/snapshotter.d.ts +19 -0
- package/dist/plugins/snapshotting/snapshotter.d.ts.map +1 -0
- package/dist/plugins/todo/index.d.ts +7 -0
- package/dist/plugins/todo/index.d.ts.map +1 -0
- package/dist/plugins/todo/plugin.d.ts +95 -0
- package/dist/plugins/todo/plugin.d.ts.map +1 -0
- package/dist/plugins/todo/prompts.d.ts +13 -0
- package/dist/plugins/todo/prompts.d.ts.map +1 -0
- package/dist/plugins/todo/schema.d.ts +44 -0
- package/dist/plugins/todo/schema.d.ts.map +1 -0
- package/dist/plugins/todo/todo.integration.test.d.ts +2 -0
- package/dist/plugins/todo/todo.integration.test.d.ts.map +1 -0
- package/dist/plugins/uploads/index.d.ts +9 -0
- package/dist/plugins/uploads/index.d.ts.map +1 -0
- package/dist/plugins/uploads/plugin.d.ts +56 -0
- package/dist/plugins/uploads/plugin.d.ts.map +1 -0
- package/dist/plugins/uploads/preprocessor.d.ts +70 -0
- package/dist/plugins/uploads/preprocessor.d.ts.map +1 -0
- package/dist/plugins/uploads/preprocessors/image-classifier.d.ts +49 -0
- package/dist/plugins/uploads/preprocessors/image-classifier.d.ts.map +1 -0
- package/dist/plugins/uploads/preprocessors/index.d.ts +7 -0
- package/dist/plugins/uploads/preprocessors/index.d.ts.map +1 -0
- package/dist/plugins/uploads/preprocessors/markitdown-preprocessor.d.ts +43 -0
- package/dist/plugins/uploads/preprocessors/markitdown-preprocessor.d.ts.map +1 -0
- package/dist/plugins/uploads/preprocessors/zip-preprocessor.d.ts +30 -0
- package/dist/plugins/uploads/preprocessors/zip-preprocessor.d.ts.map +1 -0
- package/dist/plugins/uploads/schema.d.ts +72 -0
- package/dist/plugins/uploads/schema.d.ts.map +1 -0
- package/dist/plugins/uploads/state.d.ts +38 -0
- package/dist/plugins/uploads/state.d.ts.map +1 -0
- package/dist/plugins/uploads/uploads.integration.test.d.ts +2 -0
- package/dist/plugins/uploads/uploads.integration.test.d.ts.map +1 -0
- package/dist/plugins/user-chat/index.d.ts +7 -0
- package/dist/plugins/user-chat/index.d.ts.map +1 -0
- package/dist/plugins/user-chat/plugin.d.ts +221 -0
- package/dist/plugins/user-chat/plugin.d.ts.map +1 -0
- package/dist/plugins/user-chat/prompts.d.ts +13 -0
- package/dist/plugins/user-chat/prompts.d.ts.map +1 -0
- package/dist/plugins/user-chat/schema.d.ts +82 -0
- package/dist/plugins/user-chat/schema.d.ts.map +1 -0
- package/dist/plugins/user-chat/user-chat.integration.test.d.ts +2 -0
- package/dist/plugins/user-chat/user-chat.integration.test.d.ts.map +1 -0
- package/dist/plugins/workers/context.d.ts +159 -0
- package/dist/plugins/workers/context.d.ts.map +1 -0
- package/dist/plugins/workers/definition.d.ts +118 -0
- package/dist/plugins/workers/definition.d.ts.map +1 -0
- package/dist/plugins/workers/index.d.ts +11 -0
- package/dist/plugins/workers/index.d.ts.map +1 -0
- package/dist/plugins/workers/plugin.d.ts +125 -0
- package/dist/plugins/workers/plugin.d.ts.map +1 -0
- package/dist/plugins/workers/worker.d.ts +76 -0
- package/dist/plugins/workers/worker.d.ts.map +1 -0
- package/dist/plugins/workers/workers.integration.test.d.ts +2 -0
- package/dist/plugins/workers/workers.integration.test.d.ts.map +1 -0
- package/dist/prompts/base.d.ts +75 -0
- package/dist/prompts/base.d.ts.map +1 -0
- package/dist/prompts/builder.d.ts +73 -0
- package/dist/prompts/builder.d.ts.map +1 -0
- package/dist/prompts/index.d.ts +10 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/macros.d.ts +15 -0
- package/dist/prompts/macros.d.ts.map +1 -0
- package/dist/prompts/macros.test.d.ts +2 -0
- package/dist/prompts/macros.test.d.ts.map +1 -0
- package/dist/testing/bootstrap-for-testing.d.ts +12 -0
- package/dist/testing/bootstrap-for-testing.d.ts.map +1 -0
- package/dist/testing/index.d.ts +8 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/node-platform.d.ts +12 -0
- package/dist/testing/node-platform.d.ts.map +1 -0
- package/dist/testing/notification-collector.d.ts +46 -0
- package/dist/testing/notification-collector.d.ts.map +1 -0
- package/dist/testing/preset-helpers.d.ts +28 -0
- package/dist/testing/preset-helpers.d.ts.map +1 -0
- package/dist/testing/test-harness.d.ts +117 -0
- package/dist/testing/test-harness.d.ts.map +1 -0
- package/dist/testing/test-harness.test.d.ts +2 -0
- package/dist/testing/test-harness.test.d.ts.map +1 -0
- package/dist/testing/wait-helpers.d.ts +17 -0
- package/dist/testing/wait-helpers.d.ts.map +1 -0
- package/dist/transport/adapter/client-adapter.d.ts +32 -0
- package/dist/transport/adapter/client-adapter.d.ts.map +1 -0
- package/dist/transport/adapter/index.d.ts +23 -0
- package/dist/transport/adapter/index.d.ts.map +1 -0
- package/dist/transport/adapter/server-adapter.d.ts +29 -0
- package/dist/transport/adapter/server-adapter.d.ts.map +1 -0
- package/dist/transport/adapter/types.d.ts +14 -0
- package/dist/transport/adapter/types.d.ts.map +1 -0
- package/dist/transport/http/app.d.ts +41 -0
- package/dist/transport/http/app.d.ts.map +1 -0
- package/dist/transport/http/index.d.ts +7 -0
- package/dist/transport/http/index.d.ts.map +1 -0
- package/dist/transport/http/middleware/bearer-auth.d.ts +16 -0
- package/dist/transport/http/middleware/bearer-auth.d.ts.map +1 -0
- package/dist/transport/http/middleware/error-handler.d.ts +21 -0
- package/dist/transport/http/middleware/error-handler.d.ts.map +1 -0
- package/dist/transport/http/routes/files.d.ts +16 -0
- package/dist/transport/http/routes/files.d.ts.map +1 -0
- package/dist/transport/http/routes/resources.d.ts +12 -0
- package/dist/transport/http/routes/resources.d.ts.map +1 -0
- package/dist/transport/http/routes/rpc.d.ts +22 -0
- package/dist/transport/http/routes/rpc.d.ts.map +1 -0
- package/dist/transport/http/routes/rpc.integration.test.d.ts +2 -0
- package/dist/transport/http/routes/rpc.integration.test.d.ts.map +1 -0
- package/dist/transport/http/routes/rpc.test.d.ts +2 -0
- package/dist/transport/http/routes/rpc.test.d.ts.map +1 -0
- package/dist/transport/http/routes/upload.d.ts +14 -0
- package/dist/transport/http/routes/upload.d.ts.map +1 -0
- package/dist/transport/rpc/index.d.ts +8 -0
- package/dist/transport/rpc/index.d.ts.map +1 -0
- package/dist/transport/rpc/methods.d.ts +25 -0
- package/dist/transport/rpc/methods.d.ts.map +1 -0
- package/dist/user-config.d.ts +29 -0
- package/dist/user-config.d.ts.map +1 -0
- package/package.json +154 -0
- package/src/bootstrap.ts +268 -0
- package/src/builtin-events.ts +25 -0
- package/src/bun-platform/fs.ts +50 -0
- package/src/bun-platform/index.ts +21 -0
- package/src/bun-platform/process.ts +25 -0
- package/src/config.test.ts +174 -0
- package/src/config.ts +103 -0
- package/src/core/agent-loop.integration.test.ts +503 -0
- package/src/core/agents/agent-config.test.ts +240 -0
- package/src/core/agents/agent-roles.ts +41 -0
- package/src/core/agents/agent-shutdown.test.ts +236 -0
- package/src/core/agents/agent.test.ts +387 -0
- package/src/core/agents/agent.ts +1472 -0
- package/src/core/agents/communicator.ts +16 -0
- package/src/core/agents/config.ts +98 -0
- package/src/core/agents/context.ts +19 -0
- package/src/core/agents/debounce.ts +116 -0
- package/src/core/agents/handler-events.test.ts +167 -0
- package/src/core/agents/index.ts +1 -0
- package/src/core/agents/response-sanitizer.test.ts +137 -0
- package/src/core/agents/response-sanitizer.ts +67 -0
- package/src/core/agents/retry.ts +164 -0
- package/src/core/agents/schema.ts +75 -0
- package/src/core/agents/state.ts +272 -0
- package/src/core/context/state.ts +38 -0
- package/src/core/errors.ts +55 -0
- package/src/core/event-sourcing.integration.test.ts +191 -0
- package/src/core/events/base-event-store.ts +264 -0
- package/src/core/events/event-store.ts +143 -0
- package/src/core/events/file.test.ts +436 -0
- package/src/core/events/file.ts +372 -0
- package/src/core/events/index.ts +3 -0
- package/src/core/events/memory.test.ts +741 -0
- package/src/core/events/memory.ts +131 -0
- package/src/core/events/metadata-utils.ts +133 -0
- package/src/core/events/test-helpers.ts +31 -0
- package/src/core/events/types.ts +64 -0
- package/src/core/file-store/file-store.ts +275 -0
- package/src/core/file-store/types.ts +52 -0
- package/src/core/image/image-processor.test.ts +218 -0
- package/src/core/image/image-processor.ts +127 -0
- package/src/core/image/index.ts +4 -0
- package/src/core/image/noop-resizer.ts +7 -0
- package/src/core/image/types.ts +24 -0
- package/src/core/image/vips-resizer.test.ts +377 -0
- package/src/core/image/vips-resizer.ts +124 -0
- package/src/core/llm/__snapshots__/anthropic-assistant-text-with-tool-calls.json +156 -0
- package/src/core/llm/__snapshots__/anthropic-consecutive-tool-results.json +152 -0
- package/src/core/llm/__snapshots__/anthropic-image-data-url.json +105 -0
- package/src/core/llm/__snapshots__/anthropic-image-http-url.json +104 -0
- package/src/core/llm/__snapshots__/anthropic-multiple-images.json +113 -0
- package/src/core/llm/__snapshots__/anthropic-multiple-tool-calls-requested.json +151 -0
- package/src/core/llm/__snapshots__/anthropic-simple-user-message.json +97 -0
- package/src/core/llm/__snapshots__/anthropic-system-message-in-conversation.json +119 -0
- package/src/core/llm/__snapshots__/anthropic-tool-call.json +123 -0
- package/src/core/llm/__snapshots__/anthropic-tool-error-result.json +139 -0
- package/src/core/llm/__snapshots__/anthropic-tool-result-with-image.json +152 -0
- package/src/core/llm/__snapshots__/anthropic-tool-roundtrip.json +139 -0
- package/src/core/llm/__snapshots__/openrouter-assistant-text-with-tool-calls.json +150 -0
- package/src/core/llm/__snapshots__/openrouter-consecutive-tool-results.json +150 -0
- package/src/core/llm/__snapshots__/openrouter-image-data-url.json +107 -0
- package/src/core/llm/__snapshots__/openrouter-image-http-url.json +107 -0
- package/src/core/llm/__snapshots__/openrouter-multiple-images.json +113 -0
- package/src/core/llm/__snapshots__/openrouter-multiple-tool-calls-requested.json +158 -0
- package/src/core/llm/__snapshots__/openrouter-simple-user-message.json +96 -0
- package/src/core/llm/__snapshots__/openrouter-system-message-in-conversation.json +108 -0
- package/src/core/llm/__snapshots__/openrouter-tool-call.json +129 -0
- package/src/core/llm/__snapshots__/openrouter-tool-error-result.json +137 -0
- package/src/core/llm/__snapshots__/openrouter-tool-result-with-image.json +148 -0
- package/src/core/llm/__snapshots__/openrouter-tool-roundtrip.json +137 -0
- package/src/core/llm/anthropic.test.ts +509 -0
- package/src/core/llm/anthropic.ts +578 -0
- package/src/core/llm/cache-breakpoints.ts +38 -0
- package/src/core/llm/cache-live.test.ts +155 -0
- package/src/core/llm/index.ts +30 -0
- package/src/core/llm/llm-log-types.ts +167 -0
- package/src/core/llm/logger.test.ts +270 -0
- package/src/core/llm/logger.ts +306 -0
- package/src/core/llm/logging-provider.ts +73 -0
- package/src/core/llm/middleware.ts +172 -0
- package/src/core/llm/mock.test.ts +402 -0
- package/src/core/llm/mock.ts +234 -0
- package/src/core/llm/openrouter-mapping.test.ts +153 -0
- package/src/core/llm/openrouter.test.ts +499 -0
- package/src/core/llm/openrouter.ts +458 -0
- package/src/core/llm/provider-integration.test.ts +408 -0
- package/src/core/llm/provider.ts +238 -0
- package/src/core/llm/routing-provider.test.ts +113 -0
- package/src/core/llm/routing-provider.ts +86 -0
- package/src/core/llm/schema.ts +47 -0
- package/src/core/llm/snapshot-fetch.ts +158 -0
- package/src/core/llm/snapshot-middleware.test.ts +168 -0
- package/src/core/llm/snapshot-middleware.ts +185 -0
- package/src/core/llm/state.ts +92 -0
- package/src/core/llm/tokens.ts +61 -0
- package/src/core/multi-agent.integration.test.ts +340 -0
- package/src/core/plugin-hooks.integration.test.ts +428 -0
- package/src/core/plugins/hook-types.ts +49 -0
- package/src/core/plugins/index.ts +52 -0
- package/src/core/plugins/plugin-builder.ts +967 -0
- package/src/core/preset/config.ts +110 -0
- package/src/core/preset/index.ts +11 -0
- package/src/core/preset/preset-builder.ts +111 -0
- package/src/core/session-lifecycle.integration.test.ts +202 -0
- package/src/core/sessions/apply-event.ts +46 -0
- package/src/core/sessions/context.ts +36 -0
- package/src/core/sessions/fork-utils.test.ts +158 -0
- package/src/core/sessions/fork-utils.ts +71 -0
- package/src/core/sessions/reducer.ts +95 -0
- package/src/core/sessions/schema.ts +91 -0
- package/src/core/sessions/session-environment.ts +12 -0
- package/src/core/sessions/session-manager.ts +883 -0
- package/src/core/sessions/session-store.ts +141 -0
- package/src/core/sessions/session.test.ts +1730 -0
- package/src/core/sessions/session.ts +833 -0
- package/src/core/sessions/state.ts +520 -0
- package/src/core/system.ts +206 -0
- package/src/core/tools/context.ts +3 -0
- package/src/core/tools/definition.ts +15 -0
- package/src/core/tools/executor.test.ts +160 -0
- package/src/core/tools/executor.ts +117 -0
- package/src/core/tools/index.ts +3 -0
- package/src/core/tools/schema.ts +80 -0
- package/src/core/tools/state.ts +34 -0
- package/src/index.ts +165 -0
- package/src/lib/json/index.ts +20 -0
- package/src/lib/logger/console.test.ts +348 -0
- package/src/lib/logger/console.ts +185 -0
- package/src/lib/logger/file.ts +65 -0
- package/src/lib/logger/index.ts +4 -0
- package/src/lib/logger/logger.ts +114 -0
- package/src/lib/logger/ring-buffer.ts +65 -0
- package/src/lib/logger/tee.ts +51 -0
- package/src/lib/mime.ts +23 -0
- package/src/lib/never.ts +3 -0
- package/src/lib/utils/hash.ts +38 -0
- package/src/lib/utils/result.ts +35 -0
- package/src/platform/fs.ts +38 -0
- package/src/platform/index.ts +23 -0
- package/src/platform/process.ts +28 -0
- package/src/plugins/agent-status/plugin.ts +77 -0
- package/src/plugins/agents/agents.integration.test.ts +808 -0
- package/src/plugins/agents/index.ts +2 -0
- package/src/plugins/agents/plugin.ts +242 -0
- package/src/plugins/context-compact/context-compact.integration.test.ts +207 -0
- package/src/plugins/context-compact/context-compactor.test.ts +923 -0
- package/src/plugins/context-compact/context-compactor.ts +343 -0
- package/src/plugins/context-compact/history-offloader.test.ts +100 -0
- package/src/plugins/context-compact/history-offloader.ts +47 -0
- package/src/plugins/context-compact/index.ts +3 -0
- package/src/plugins/context-compact/plugin.ts +62 -0
- package/src/plugins/filesystem/filesystem.integration.test.ts +485 -0
- package/src/plugins/filesystem/helpers.ts +216 -0
- package/src/plugins/filesystem/index.ts +4 -0
- package/src/plugins/filesystem/listing.ts +276 -0
- package/src/plugins/filesystem/plugin.ts +468 -0
- package/src/plugins/filesystem/schema.ts +6 -0
- package/src/plugins/git-status/index.ts +1 -0
- package/src/plugins/git-status/plugin.ts +166 -0
- package/src/plugins/limits-guard/config.ts +26 -0
- package/src/plugins/limits-guard/index.ts +4 -0
- package/src/plugins/limits-guard/limit-guard.test.ts +161 -0
- package/src/plugins/limits-guard/limit-guard.ts +164 -0
- package/src/plugins/limits-guard/limits-guard.integration.test.ts +437 -0
- package/src/plugins/limits-guard/plugin.ts +306 -0
- package/src/plugins/llm-debug/index.ts +1 -0
- package/src/plugins/llm-debug/llm-debug.integration.test.ts +192 -0
- package/src/plugins/llm-debug/plugin.ts +172 -0
- package/src/plugins/logs/index.ts +1 -0
- package/src/plugins/logs/plugin.ts +39 -0
- package/src/plugins/mailbox/helpers.ts +83 -0
- package/src/plugins/mailbox/index.ts +13 -0
- package/src/plugins/mailbox/mailbox.integration.test.ts +705 -0
- package/src/plugins/mailbox/plugin.ts +270 -0
- package/src/plugins/mailbox/prompts.ts +104 -0
- package/src/plugins/mailbox/query.ts +53 -0
- package/src/plugins/mailbox/schema.ts +81 -0
- package/src/plugins/mailbox/state.ts +52 -0
- package/src/plugins/resources/index.ts +11 -0
- package/src/plugins/resources/manifest.ts +25 -0
- package/src/plugins/resources/plugin.ts +201 -0
- package/src/plugins/resources/post-inject.ts +74 -0
- package/src/plugins/resources/state.ts +30 -0
- package/src/plugins/result-eviction/index.ts +2 -0
- package/src/plugins/result-eviction/plugin.ts +65 -0
- package/src/plugins/result-eviction/result-eviction.integration.test.ts +244 -0
- package/src/plugins/services/plugin.ts +485 -0
- package/src/plugins/services/port-pool.ts +73 -0
- package/src/plugins/services/prompt.ts +53 -0
- package/src/plugins/services/schema.ts +83 -0
- package/src/plugins/services/service.ts +578 -0
- package/src/plugins/services/services.integration.test.ts +595 -0
- package/src/plugins/session-lifecycle/index.ts +1 -0
- package/src/plugins/session-lifecycle/plugin.ts +302 -0
- package/src/plugins/session-lifecycle/session-lifecycle.integration.test.ts +639 -0
- package/src/plugins/session-state/plugin.ts +179 -0
- package/src/plugins/session-stats/index.ts +3 -0
- package/src/plugins/session-stats/plugin.ts +120 -0
- package/src/plugins/shell/executor.ts +462 -0
- package/src/plugins/shell/index.ts +23 -0
- package/src/plugins/shell/plugin.ts +118 -0
- package/src/plugins/shell/shell.integration.test.ts +273 -0
- package/src/plugins/shell/shell.test.ts +314 -0
- package/src/plugins/skills/discovery.test.ts +395 -0
- package/src/plugins/skills/discovery.ts +276 -0
- package/src/plugins/skills/index.ts +32 -0
- package/src/plugins/skills/plugin.ts +381 -0
- package/src/plugins/skills/prompts.ts +84 -0
- package/src/plugins/skills/schema.ts +88 -0
- package/src/plugins/skills/skills.integration.test.ts +580 -0
- package/src/plugins/snapshotting/index.ts +3 -0
- package/src/plugins/snapshotting/jj-snapshotter.ts +122 -0
- package/src/plugins/snapshotting/plugin.ts +36 -0
- package/src/plugins/snapshotting/snapshotter.ts +20 -0
- package/src/plugins/todo/index.ts +11 -0
- package/src/plugins/todo/plugin.ts +363 -0
- package/src/plugins/todo/prompts.ts +63 -0
- package/src/plugins/todo/schema.ts +71 -0
- package/src/plugins/todo/todo.integration.test.ts +687 -0
- package/src/plugins/uploads/index.ts +13 -0
- package/src/plugins/uploads/plugin.ts +406 -0
- package/src/plugins/uploads/preprocessor.ts +111 -0
- package/src/plugins/uploads/preprocessors/image-classifier.ts +176 -0
- package/src/plugins/uploads/preprocessors/index.ts +7 -0
- package/src/plugins/uploads/preprocessors/markitdown-preprocessor.ts +262 -0
- package/src/plugins/uploads/preprocessors/zip-preprocessor.ts +210 -0
- package/src/plugins/uploads/schema.ts +92 -0
- package/src/plugins/uploads/state.ts +42 -0
- package/src/plugins/uploads/uploads.integration.test.ts +654 -0
- package/src/plugins/user-chat/index.ts +17 -0
- package/src/plugins/user-chat/plugin.ts +728 -0
- package/src/plugins/user-chat/prompts.ts +30 -0
- package/src/plugins/user-chat/schema.ts +80 -0
- package/src/plugins/user-chat/user-chat.integration.test.ts +794 -0
- package/src/plugins/workers/context.ts +251 -0
- package/src/plugins/workers/definition.ts +169 -0
- package/src/plugins/workers/index.ts +21 -0
- package/src/plugins/workers/plugin.ts +722 -0
- package/src/plugins/workers/worker.ts +115 -0
- package/src/plugins/workers/workers.integration.test.ts +778 -0
- package/src/prompts/base.ts +266 -0
- package/src/prompts/builder.ts +194 -0
- package/src/prompts/index.ts +36 -0
- package/src/prompts/macros.test.ts +107 -0
- package/src/prompts/macros.ts +27 -0
- package/src/testing/bootstrap-for-testing.ts +39 -0
- package/src/testing/index.ts +7 -0
- package/src/testing/node-platform.ts +80 -0
- package/src/testing/notification-collector.ts +100 -0
- package/src/testing/preset-helpers.ts +57 -0
- package/src/testing/test-harness.test.ts +63 -0
- package/src/testing/test-harness.ts +279 -0
- package/src/testing/wait-helpers.ts +84 -0
- package/src/transport/adapter/client-adapter.ts +81 -0
- package/src/transport/adapter/index.ts +42 -0
- package/src/transport/adapter/server-adapter.ts +93 -0
- package/src/transport/adapter/types.ts +20 -0
- package/src/transport/http/app.ts +129 -0
- package/src/transport/http/index.ts +7 -0
- package/src/transport/http/middleware/bearer-auth.ts +40 -0
- package/src/transport/http/middleware/error-handler.ts +76 -0
- package/src/transport/http/routes/files.ts +274 -0
- package/src/transport/http/routes/resources.ts +115 -0
- package/src/transport/http/routes/rpc.integration.test.ts +243 -0
- package/src/transport/http/routes/rpc.test.ts +372 -0
- package/src/transport/http/routes/rpc.ts +156 -0
- package/src/transport/http/routes/upload.ts +286 -0
- package/src/transport/rpc/index.ts +11 -0
- package/src/transport/rpc/methods.ts +38 -0
- package/src/user-config.ts +33 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service domain types
|
|
3
|
+
*
|
|
4
|
+
* Services are session-scoped background processes (e.g., dev servers)
|
|
5
|
+
* that agents can observe and control. Unlike workers, services are
|
|
6
|
+
* long-running, one instance per type, and shared across agents.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Service lifecycle status.
|
|
10
|
+
*/
|
|
11
|
+
export type ServiceStatus = 'stopped' | 'starting' | 'ready' | 'stopping' | 'failed' | 'paused';
|
|
12
|
+
/**
|
|
13
|
+
* Arguments passed to command callback for dynamic command construction.
|
|
14
|
+
*/
|
|
15
|
+
export interface ServiceCommandArgs {
|
|
16
|
+
port: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Service configuration declared inline in presets.
|
|
20
|
+
* Defines how to spawn and monitor a background process.
|
|
21
|
+
*/
|
|
22
|
+
export interface ServiceConfig {
|
|
23
|
+
/** Unique service type within preset, e.g. 'astro-dev' */
|
|
24
|
+
type: string;
|
|
25
|
+
/** Human-readable description */
|
|
26
|
+
description: string;
|
|
27
|
+
/** Shell command to run, or a callback receiving allocated port */
|
|
28
|
+
command: string | ((args: ServiceCommandArgs) => string);
|
|
29
|
+
/** Working directory (defaults to workspace dir) */
|
|
30
|
+
cwd?: string;
|
|
31
|
+
/** Additional environment variables */
|
|
32
|
+
env?: Record<string, string>;
|
|
33
|
+
/** Start automatically with session (default: false) */
|
|
34
|
+
autoStart?: boolean;
|
|
35
|
+
/** Regex pattern to detect "ready" in stdout */
|
|
36
|
+
readyPattern?: string;
|
|
37
|
+
/** SIGTERM→SIGKILL timeout in ms (default: 5000) */
|
|
38
|
+
gracefulStopMs?: number;
|
|
39
|
+
/** Ring buffer size for log lines (default: 200) */
|
|
40
|
+
logBufferSize?: number;
|
|
41
|
+
/** Startup timeout in ms — service marked as failed if not ready within this time (default: 30000) */
|
|
42
|
+
startupTimeoutMs?: number;
|
|
43
|
+
/** Auto-pause configuration (interface prepared, not yet implemented) */
|
|
44
|
+
autoPause?: {
|
|
45
|
+
inactivityMs: number;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Service entry tracked in session state.
|
|
50
|
+
* Updated via service_status_changed events.
|
|
51
|
+
*/
|
|
52
|
+
export interface ServiceEntry {
|
|
53
|
+
serviceType: string;
|
|
54
|
+
status: ServiceStatus;
|
|
55
|
+
port?: number;
|
|
56
|
+
error?: string;
|
|
57
|
+
startedAt?: number;
|
|
58
|
+
readyAt?: number;
|
|
59
|
+
stoppedAt?: number;
|
|
60
|
+
/** Process group PID (tracked for orphan cleanup after restart) */
|
|
61
|
+
pid?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Process start time in clock ticks since boot, read from /proc/<pid>/stat field 22.
|
|
64
|
+
* Used to detect PID reuse during orphan reconcile: before SIGKILL, we re-read the
|
|
65
|
+
* current start time and compare — mismatch means the PID was recycled by an
|
|
66
|
+
* unrelated process and must NOT be killed. Linux-only; undefined on macOS/Windows.
|
|
67
|
+
*/
|
|
68
|
+
pidStartTime?: number;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/plugins/services/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAM/F;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IACZ,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,mEAAmE;IACnE,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,kBAAkB,KAAK,MAAM,CAAC,CAAA;IACxD,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,sGAAsG;IACtG,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,yEAAyE;IACzE,SAAS,CAAC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAA;CACpC;AAMD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,aAAa,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ServiceExecutor - Manages child processes for session services.
|
|
3
|
+
*
|
|
4
|
+
* Each service type has at most one running instance per session.
|
|
5
|
+
* Services are long-running background processes (e.g., dev servers).
|
|
6
|
+
* Ports are allocated from a global PortPool and injected via PORT env var.
|
|
7
|
+
*/
|
|
8
|
+
import type { SessionId } from '../../core/sessions/schema.js';
|
|
9
|
+
import type { Result } from '../../lib/utils/result.js';
|
|
10
|
+
import type { FileSystem } from '../../platform/fs.js';
|
|
11
|
+
import type { ProcessRunner } from '../../platform/process.js';
|
|
12
|
+
import type { PortPool } from '../../plugins/services/port-pool.js';
|
|
13
|
+
import type { ServiceConfig, ServiceStatus } from '../../plugins/services/schema.js';
|
|
14
|
+
import type { ToolError } from '../../core/tools/executor.js';
|
|
15
|
+
import type { Logger } from '../../lib/logger/logger.js';
|
|
16
|
+
/**
|
|
17
|
+
* Read a process's start time from /proc/<pid>/stat field 22 (starttime in clock
|
|
18
|
+
* ticks since boot). Used to detect PID reuse: a captured value paired with a PID
|
|
19
|
+
* uniquely identifies a process, since the kernel guarantees start time is
|
|
20
|
+
* monotonic within a boot. Returns undefined on non-Linux, if the process is
|
|
21
|
+
* gone, or on parse failure — callers must treat undefined as "unknown, don't
|
|
22
|
+
* rely on it" rather than "process is dead".
|
|
23
|
+
*/
|
|
24
|
+
export declare function getProcessStartTime(fs: FileSystem, pid: number): Promise<number | undefined>;
|
|
25
|
+
export interface ServiceExecutorDeps {
|
|
26
|
+
fs: FileSystem;
|
|
27
|
+
process: ProcessRunner;
|
|
28
|
+
}
|
|
29
|
+
export declare class ServiceExecutor {
|
|
30
|
+
private readonly services;
|
|
31
|
+
private readonly allocatedPorts;
|
|
32
|
+
private readonly waiters;
|
|
33
|
+
private readonly logger;
|
|
34
|
+
private readonly portPool;
|
|
35
|
+
private readonly fs;
|
|
36
|
+
private readonly processRunner;
|
|
37
|
+
/** Optional callback invoked on every service status change */
|
|
38
|
+
onStatusChanged?: (sessionId: string, serviceType: string, status: ServiceStatus, port?: number, error?: string, pid?: number, pidStartTime?: number) => void;
|
|
39
|
+
constructor(logger: Logger, portPool: PortPool, deps: ServiceExecutorDeps);
|
|
40
|
+
private notifyStatusChanged;
|
|
41
|
+
private resolveWaiters;
|
|
42
|
+
/**
|
|
43
|
+
* Wait for a service to reach a terminal status (ready, failed, or stopped).
|
|
44
|
+
* Returns immediately if the service is already in a terminal status.
|
|
45
|
+
*/
|
|
46
|
+
waitForReady(serviceType: string, timeoutMs?: number): Promise<Result<void, ToolError>>;
|
|
47
|
+
/**
|
|
48
|
+
* Start a service. Idempotent — returns Ok if already running or starting.
|
|
49
|
+
*/
|
|
50
|
+
start(config: ServiceConfig, sessionId: SessionId, workspaceDir?: string, preferredPort?: number): Promise<Result<void, ToolError>>;
|
|
51
|
+
/**
|
|
52
|
+
* Stop a running service gracefully.
|
|
53
|
+
* Port is NOT released — kept for session-level stability across restarts.
|
|
54
|
+
*/
|
|
55
|
+
stop(serviceType: string, sessionId: SessionId): Promise<Result<void, ToolError>>;
|
|
56
|
+
/**
|
|
57
|
+
* Restart a service (stop + start).
|
|
58
|
+
*/
|
|
59
|
+
restart(config: ServiceConfig, sessionId: SessionId, workspaceDir?: string, preferredPort?: number): Promise<Result<void, ToolError>>;
|
|
60
|
+
/**
|
|
61
|
+
* Pause a running service (SIGSTOP).
|
|
62
|
+
*/
|
|
63
|
+
pause(serviceType: string, sessionId: SessionId): Promise<Result<void, ToolError>>;
|
|
64
|
+
/**
|
|
65
|
+
* Resume a paused service (SIGCONT).
|
|
66
|
+
*/
|
|
67
|
+
resume(config: ServiceConfig, sessionId: SessionId, _workspaceDir?: string): Promise<Result<void, ToolError>>;
|
|
68
|
+
/**
|
|
69
|
+
* Get recent log lines for a service.
|
|
70
|
+
*/
|
|
71
|
+
getLogs(serviceType: string, lines?: number): Result<string[], ToolError>;
|
|
72
|
+
/**
|
|
73
|
+
* Get the current status of a service.
|
|
74
|
+
*/
|
|
75
|
+
getStatus(serviceType: string): ServiceStatus | null;
|
|
76
|
+
/**
|
|
77
|
+
* Check if a service is running (starting or ready).
|
|
78
|
+
*/
|
|
79
|
+
isRunning(serviceType: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Shutdown all services and release all ports back to pool.
|
|
82
|
+
* Called on session close.
|
|
83
|
+
*/
|
|
84
|
+
shutdown(): Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/plugins/services/service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAOxD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAelG;AAmBD,MAAM,WAAW,mBAAmB;IACnC,EAAE,EAAE,UAAU,CAAA;IACd,OAAO,EAAE,aAAa,CAAA;CACtB;AAED,qBAAa,eAAe;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoC;IAC7D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA4B;IAC3D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyH;IACjJ,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAE7C,+DAA+D;IAC/D,eAAe,CAAC,EAAE,CACjB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,aAAa,EACrB,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,KACjB,IAAI,CAAA;gBAEG,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,mBAAmB;IAOzE,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,cAAc;IAetB;;;OAGG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IA2BvF;;OAEG;IACG,KAAK,CACV,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS,EACpB,YAAY,CAAC,EAAE,MAAM,EACrB,aAAa,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAiMnC;;;OAGG;IACG,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAqDvF;;OAEG;IACG,OAAO,CACZ,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS,EACpB,YAAY,CAAC,EAAE,MAAM,EACrB,aAAa,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAUnC;;OAEG;IACG,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAsBxF;;OAEG;IACG,MAAM,CACX,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS,EACpB,aAAa,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAsBnC;;OAEG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC;IAQzE;;OAEG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAIpD;;OAEG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAKvC;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CA2D/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.integration.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/services/services.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/session-lifecycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Lifecycle Plugin
|
|
3
|
+
*
|
|
4
|
+
* Manager methods: create, list, fork.
|
|
5
|
+
* Session methods: get, close, reopen, getEvents.
|
|
6
|
+
* Preset listing is a separate presetsPlugin.
|
|
7
|
+
*/
|
|
8
|
+
import z4 from 'zod/v4';
|
|
9
|
+
export declare const presetsPlugin: import("../../core/plugins/index.js").PluginDefinition<"presets", void, void, Record<"list", {
|
|
10
|
+
input: Record<string, never>;
|
|
11
|
+
output: {
|
|
12
|
+
presets: {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
defaultResourceSlugs?: string[];
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
}> & Record<"getAgents", {
|
|
20
|
+
input: {
|
|
21
|
+
sessionId: string & z4.core.$brand<"SessionId">;
|
|
22
|
+
};
|
|
23
|
+
output: {
|
|
24
|
+
agents: {
|
|
25
|
+
name: string;
|
|
26
|
+
spawnableBy: string[];
|
|
27
|
+
hasInputSchema: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
}>, {}>;
|
|
31
|
+
export declare const sessionLifecyclePlugin: import("../../core/plugins/index.js").PluginDefinition<"sessions", void, void, Record<"create", {
|
|
32
|
+
input: {
|
|
33
|
+
presetId: string;
|
|
34
|
+
workspaceDir?: string | undefined;
|
|
35
|
+
sessionId?: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
output: {
|
|
38
|
+
sessionId: string & z4.core.$brand<"SessionId">;
|
|
39
|
+
};
|
|
40
|
+
}> & Record<"list", {
|
|
41
|
+
input: {
|
|
42
|
+
status?: "active" | "closed" | "errored" | undefined;
|
|
43
|
+
tags?: string[] | undefined;
|
|
44
|
+
limit?: number | undefined;
|
|
45
|
+
offset?: number | undefined;
|
|
46
|
+
orderBy?: "createdAt" | "lastActivityAt" | undefined;
|
|
47
|
+
order?: "asc" | "desc" | undefined;
|
|
48
|
+
};
|
|
49
|
+
output: {
|
|
50
|
+
sessions: unknown[];
|
|
51
|
+
total: number;
|
|
52
|
+
};
|
|
53
|
+
}> & Record<"fork", {
|
|
54
|
+
input: {
|
|
55
|
+
sessionId: string & z4.core.$brand<"SessionId">;
|
|
56
|
+
eventIndex: number;
|
|
57
|
+
};
|
|
58
|
+
output: {
|
|
59
|
+
sessionId: string & z4.core.$brand<"SessionId">;
|
|
60
|
+
};
|
|
61
|
+
}>, Record<"get", {
|
|
62
|
+
input: Record<string, never>;
|
|
63
|
+
output: {
|
|
64
|
+
sessionId: string & z4.core.$brand<"SessionId">;
|
|
65
|
+
presetId: string;
|
|
66
|
+
status: string;
|
|
67
|
+
createdAt: number;
|
|
68
|
+
agentCount: number;
|
|
69
|
+
entryAgentId: (string & z4.core.$brand<"AgentId">) | null;
|
|
70
|
+
closedAt?: number | undefined;
|
|
71
|
+
};
|
|
72
|
+
}> & Record<"close", {
|
|
73
|
+
input: Record<string, never>;
|
|
74
|
+
output: {};
|
|
75
|
+
}> & Record<"reopen", {
|
|
76
|
+
input: Record<string, never>;
|
|
77
|
+
output: {};
|
|
78
|
+
}> & Record<"updateMetadata", {
|
|
79
|
+
input: {
|
|
80
|
+
name?: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
output: {};
|
|
83
|
+
}> & Record<"getEvents", {
|
|
84
|
+
input: {
|
|
85
|
+
since?: number | undefined;
|
|
86
|
+
limit?: number | undefined;
|
|
87
|
+
offset?: number | undefined;
|
|
88
|
+
type?: string | undefined;
|
|
89
|
+
agentId?: string | undefined;
|
|
90
|
+
};
|
|
91
|
+
output: {
|
|
92
|
+
events: unknown[];
|
|
93
|
+
total: number;
|
|
94
|
+
lastIndex: number;
|
|
95
|
+
};
|
|
96
|
+
}>>;
|
|
97
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/session-lifecycle/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,QAAQ,CAAA;AAavB,eAAO,MAAM,aAAa;;;;gBAYI,MAAM;kBAAQ,MAAM;0BAAgB,MAAM;mCAAyB,MAAM,EAAE;;;;;;;;;kBAwC1E,MAAM;yBAAe,MAAM,EAAE;4BAAkB,OAAO;;;OAgC5E,CAAA;AAMT,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8L1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-lifecycle.integration.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/session-lifecycle/session-lifecycle.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session State Plugin
|
|
3
|
+
*
|
|
4
|
+
* Provides a typed, persistent state object per session that can be updated by:
|
|
5
|
+
* - Agent (via tool)
|
|
6
|
+
* - Client/SPA (via RPC method)
|
|
7
|
+
* - Backend/system (via RPC method with system caller context)
|
|
8
|
+
*
|
|
9
|
+
* State changes are broadcast as notifications and can trigger agent dequeue.
|
|
10
|
+
* A preset-defined validate function controls write permissions per caller.
|
|
11
|
+
*/
|
|
12
|
+
import z from 'zod/v4';
|
|
13
|
+
import type { CallerContext } from '../../core/plugins/plugin-builder.js';
|
|
14
|
+
export declare const sessionStateEvents: import("../../core/events/types.js").EventsFactory<{
|
|
15
|
+
session_state_updated: z.ZodObject<{
|
|
16
|
+
state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
17
|
+
callerSource: z.ZodEnum<{
|
|
18
|
+
system: "system";
|
|
19
|
+
agent: "agent";
|
|
20
|
+
client: "client";
|
|
21
|
+
}>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
session_state_external_consumed: z.ZodObject<{}, z.core.$strip>;
|
|
24
|
+
}>;
|
|
25
|
+
export interface SessionStatePluginConfig {
|
|
26
|
+
schema: z.ZodType;
|
|
27
|
+
initial: Record<string, unknown>;
|
|
28
|
+
validate?: (current: Record<string, unknown>, proposed: Record<string, unknown>, caller: CallerContext) => true | string;
|
|
29
|
+
}
|
|
30
|
+
export declare const sessionStatePlugin: import("../../core/plugins/plugin-builder.js").PluginDefinition<"sessionState", SessionStatePluginConfig, void, {}, Record<"get", {
|
|
31
|
+
input: {
|
|
32
|
+
sessionId: string;
|
|
33
|
+
};
|
|
34
|
+
output: {
|
|
35
|
+
state: Record<string, unknown>;
|
|
36
|
+
};
|
|
37
|
+
}> & Record<"update", {
|
|
38
|
+
input: {
|
|
39
|
+
sessionId: string;
|
|
40
|
+
updates: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
output: {
|
|
43
|
+
state: {
|
|
44
|
+
[x: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}>>;
|
|
48
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/session-state/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAOrE,eAAO,MAAM,kBAAkB;;;;;;;;;;EAQ7B,CAAA;AAEF,MAAM,WAAW,wBAAwB;IACxC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAA;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,MAAM,CAAA;CACxH;AAOD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;GA0ItB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/session-stats/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SessionState } from '../../core/sessions/state.js';
|
|
2
|
+
export interface ProviderStats {
|
|
3
|
+
llmCalls: number;
|
|
4
|
+
totalTokens: number;
|
|
5
|
+
promptTokens: number;
|
|
6
|
+
completionTokens: number;
|
|
7
|
+
totalCost: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SessionStatsState {
|
|
10
|
+
totalTokens: number;
|
|
11
|
+
promptTokens: number;
|
|
12
|
+
completionTokens: number;
|
|
13
|
+
totalCost: number;
|
|
14
|
+
llmCalls: number;
|
|
15
|
+
llmErrors: number;
|
|
16
|
+
toolCalls: number;
|
|
17
|
+
toolErrors: number;
|
|
18
|
+
agentCount: number;
|
|
19
|
+
firstEventAt: number | null;
|
|
20
|
+
lastEventAt: number | null;
|
|
21
|
+
/** Per-provider breakdown of LLM usage */
|
|
22
|
+
byProvider: Record<string, ProviderStats>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Select session stats from session state (for external consumers).
|
|
26
|
+
*/
|
|
27
|
+
export declare function selectSessionStats(sessionState: SessionState): SessionStatsState;
|
|
28
|
+
export declare const sessionStatsPlugin: import("../../core/plugins/plugin-builder.js").PluginDefinition<"session-stats", void, void, {}, {}>;
|
|
29
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/session-stats/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAO5D,MAAM,WAAW,aAAa;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,iBAAiB;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CACzC;AAmBD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,iBAAiB,CAEhF;AAMD,eAAO,MAAM,kBAAkB,kGAwDtB,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { SessionEnvironment } from '../../core/sessions/session-environment.js';
|
|
2
|
+
import type { ToolError } from '../../core/tools/executor.js';
|
|
3
|
+
import { type Result } from '../../lib/utils/result.js';
|
|
4
|
+
import type { FileSystem } from '../../platform/fs.js';
|
|
5
|
+
import type { ProcessRunner } from '../../platform/process.js';
|
|
6
|
+
/**
|
|
7
|
+
* Extra path to bind-mount inside bwrap sandbox.
|
|
8
|
+
*/
|
|
9
|
+
export interface ExtraBind {
|
|
10
|
+
/** Absolute path on the host to bind-mount */
|
|
11
|
+
path: string;
|
|
12
|
+
/** Mount mode: 'rw' for read-write, 'ro' for read-only */
|
|
13
|
+
mode: 'rw' | 'ro';
|
|
14
|
+
/** Destination path inside the sandbox. Defaults to `path` (same as host). */
|
|
15
|
+
destPath?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface SandboxConfig {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
/** Allow network access (default: false) */
|
|
20
|
+
network?: boolean;
|
|
21
|
+
/** Paths with read-write access (default: [cwd]) */
|
|
22
|
+
writablePaths?: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface ShellConfig {
|
|
25
|
+
/** Working directory for commands (fallback when not sandboxed and no workspace) */
|
|
26
|
+
cwd: string;
|
|
27
|
+
/** Command timeout in milliseconds (default: 30000) */
|
|
28
|
+
timeout?: number;
|
|
29
|
+
/** Environment variables to add/override */
|
|
30
|
+
env?: Record<string, string>;
|
|
31
|
+
/** Shell to use (default: sh on unix, cmd.exe on windows) */
|
|
32
|
+
shell?: string;
|
|
33
|
+
/** Whether sandbox is active */
|
|
34
|
+
sandboxed: boolean;
|
|
35
|
+
/** Extra paths to bind-mount inside bwrap sandbox */
|
|
36
|
+
extraBinds?: ExtraBind[];
|
|
37
|
+
/** Bubblewrap sandbox config (default: enabled) */
|
|
38
|
+
sandbox?: SandboxConfig;
|
|
39
|
+
}
|
|
40
|
+
export interface BwrapOptions {
|
|
41
|
+
command: string;
|
|
42
|
+
cwd: string;
|
|
43
|
+
sandbox: SandboxConfig;
|
|
44
|
+
/** Real session directory to map into sandbox */
|
|
45
|
+
sessionDir?: string;
|
|
46
|
+
/** Real workspace directory to map into sandbox */
|
|
47
|
+
workspaceDir?: string;
|
|
48
|
+
/** Extra paths to bind-mount inside sandbox */
|
|
49
|
+
extraBinds?: ExtraBind[];
|
|
50
|
+
}
|
|
51
|
+
export declare function buildBwrapArgs(opts: BwrapOptions): string[];
|
|
52
|
+
export interface RunCommandInput {
|
|
53
|
+
command: string;
|
|
54
|
+
args?: string | string[];
|
|
55
|
+
cwd?: string;
|
|
56
|
+
timeout?: number;
|
|
57
|
+
stdin?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ShellResult {
|
|
60
|
+
stdout: string;
|
|
61
|
+
stderr: string;
|
|
62
|
+
exitCode: number;
|
|
63
|
+
signal?: string;
|
|
64
|
+
timedOut: boolean;
|
|
65
|
+
durationMs: number;
|
|
66
|
+
}
|
|
67
|
+
export interface ShellExecutorDeps {
|
|
68
|
+
fs: FileSystem;
|
|
69
|
+
process: ProcessRunner;
|
|
70
|
+
}
|
|
71
|
+
export declare class ShellExecutor {
|
|
72
|
+
private config;
|
|
73
|
+
private readonly fs;
|
|
74
|
+
private readonly process;
|
|
75
|
+
constructor(config: ShellConfig, deps: ShellExecutorDeps);
|
|
76
|
+
execute(input: RunCommandInput, environment: SessionEnvironment): Promise<Result<ShellResult, ToolError>>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/plugins/shell/executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAiHxE;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB;AAED,MAAM,WAAW,WAAW;IAC3B,oFAAoF;IACpF,GAAG,EAAE,MAAM,CAAA;IACX,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,SAAS,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,mDAAmD;IACnD,OAAO,CAAC,EAAE,aAAa,CAAA;CACvB;AAqBD,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,aAAa,CAAA;IACtB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;CACxB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,EAAE,CA6D3D;AAMD,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,WAAW;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,UAAU,CAAA;IACd,OAAO,EAAE,aAAa,CAAA;CACtB;AAED,qBAAa,aAAa;IAIb,OAAO,CAAC,MAAM;IAH1B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAEnB,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB;IAK1D,OAAO,CACZ,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,kBAAkB,GAC7B,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;CA8K1C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell plugin - command execution with sandbox support
|
|
3
|
+
*/
|
|
4
|
+
export { createRestrictedShellConfig, createSafeShellConfig, type ExtraBind as ShellExtraBind, type ShellAgentConfig, shellPlugin, type ShellPresetConfig, } from './plugin.js';
|
|
5
|
+
export { buildBwrapArgs, type BwrapOptions, type ExtraBind, type RunCommandInput, type SandboxConfig, type ShellConfig, ShellExecutor, type ShellResult, } from './executor.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/shell/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,2BAA2B,EAC3B,qBAAqB,EACrB,KAAK,SAAS,IAAI,cAAc,EAChC,KAAK,gBAAgB,EACrB,WAAW,EACX,KAAK,iBAAiB,GACtB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACN,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,aAAa,EACb,KAAK,WAAW,GAChB,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extra path to bind-mount inside bwrap sandbox.
|
|
3
|
+
*/
|
|
4
|
+
export interface ExtraBind {
|
|
5
|
+
/** Absolute path on the host to bind-mount */
|
|
6
|
+
path: string;
|
|
7
|
+
/** Mount mode: 'rw' for read-write, 'ro' for read-only */
|
|
8
|
+
mode: 'rw' | 'ro';
|
|
9
|
+
/** Destination path inside the sandbox. Defaults to `path` (same as host). */
|
|
10
|
+
destPath?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Session-wide shell configuration.
|
|
14
|
+
*/
|
|
15
|
+
export interface ShellPresetConfig {
|
|
16
|
+
/** Working directory for commands (fallback when not sandboxed and no workspace) */
|
|
17
|
+
cwd: string;
|
|
18
|
+
/** Command timeout in milliseconds (default: 30000) */
|
|
19
|
+
timeout?: number;
|
|
20
|
+
/** Environment variables to add/override */
|
|
21
|
+
env?: Record<string, string>;
|
|
22
|
+
/** Shell to use (default: sh on unix, cmd.exe on windows) */
|
|
23
|
+
shell?: string;
|
|
24
|
+
/** Whether sandbox is active */
|
|
25
|
+
sandboxed?: boolean;
|
|
26
|
+
/** Extra paths to bind-mount inside bwrap sandbox */
|
|
27
|
+
extraBinds?: ExtraBind[];
|
|
28
|
+
/** Bubblewrap sandbox config (default: enabled) */
|
|
29
|
+
sandbox?: {
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
/** Allow network access (default: false) */
|
|
32
|
+
network?: boolean;
|
|
33
|
+
/** Paths with read-write access (default: [cwd]) */
|
|
34
|
+
writablePaths?: string[];
|
|
35
|
+
};
|
|
36
|
+
/** Default enabled state for agents (default: true). Agents can override via ShellAgentConfig.enabled. */
|
|
37
|
+
defaultEnabled?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Agent-specific shell configuration.
|
|
41
|
+
*/
|
|
42
|
+
export interface ShellAgentConfig {
|
|
43
|
+
/** Whether shell is enabled for this agent (default: true) */
|
|
44
|
+
enabled?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const shellPlugin: import("../../core/plugins/plugin-builder.js").PluginDefinition<"shell", ShellPresetConfig, ShellAgentConfig, {}, {}>;
|
|
47
|
+
/** Safe shell config for typical development tasks */
|
|
48
|
+
export declare function createSafeShellConfig(cwd: string): ShellPresetConfig;
|
|
49
|
+
/** Restrictive shell config for untrusted agents */
|
|
50
|
+
export declare function createRestrictedShellConfig(cwd: string): ShellPresetConfig;
|
|
51
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/shell/plugin.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,oFAAoF;IACpF,GAAG,EAAE,MAAM,CAAA;IACX,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qDAAqD;IACrD,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,mDAAmD;IACnD,OAAO,CAAC,EAAE;QACT,OAAO,EAAE,OAAO,CAAA;QAChB,4CAA4C;QAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,oDAAoD;QACpD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;KACxB,CAAA;IACD,0GAA0G;IAC1G,cAAc,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAA;CACjB;AAcD,eAAO,MAAM,WAAW,mHAyCf,CAAA;AAET,sDAAsD;AACtD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAEpE;AAED,oDAAoD;AACpD,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAE1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.integration.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/shell/shell.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/shell/shell.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Discovery - Scans directories for SKILL.md files and parses frontmatter.
|
|
3
|
+
*
|
|
4
|
+
* Skills are discovered at preset load time. The system scans configured
|
|
5
|
+
* source directories for subdirectories containing SKILL.md files.
|
|
6
|
+
*
|
|
7
|
+
* Expected directory structure:
|
|
8
|
+
* /skills/
|
|
9
|
+
* research/
|
|
10
|
+
* SKILL.md
|
|
11
|
+
* code-review/
|
|
12
|
+
* SKILL.md
|
|
13
|
+
*
|
|
14
|
+
* SKILL.md format:
|
|
15
|
+
* ---
|
|
16
|
+
* name: research
|
|
17
|
+
* description: Structured research workflow
|
|
18
|
+
* ---
|
|
19
|
+
* # Research Skill
|
|
20
|
+
* ...
|
|
21
|
+
*/
|
|
22
|
+
import type { Result } from '../../lib/utils/result.js';
|
|
23
|
+
import type { FileSystem } from '../../platform/fs.js';
|
|
24
|
+
import type { SkillMetadata } from '../../plugins/skills/schema.js';
|
|
25
|
+
export interface SkillDiscoveryError {
|
|
26
|
+
type: 'discovery_error';
|
|
27
|
+
message: string;
|
|
28
|
+
path?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface FrontmatterParseError {
|
|
31
|
+
type: 'frontmatter_error';
|
|
32
|
+
message: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ParsedFrontmatter {
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ParsedSkillFile {
|
|
39
|
+
frontmatter: ParsedFrontmatter;
|
|
40
|
+
content: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Parse YAML frontmatter from a SKILL.md file content.
|
|
44
|
+
* Returns the parsed name and description fields.
|
|
45
|
+
*
|
|
46
|
+
* Expected format:
|
|
47
|
+
* ```
|
|
48
|
+
* ---
|
|
49
|
+
* name: skill-name
|
|
50
|
+
* description: Short description
|
|
51
|
+
* ---
|
|
52
|
+
* # Content follows...
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function parseSkillFrontmatter(content: string): Result<ParsedFrontmatter, FrontmatterParseError>;
|
|
56
|
+
/**
|
|
57
|
+
* Parse a SKILL.md file, extracting frontmatter and content separately.
|
|
58
|
+
*/
|
|
59
|
+
export declare function parseSkillFile(fileContent: string): Result<ParsedSkillFile, FrontmatterParseError>;
|
|
60
|
+
/**
|
|
61
|
+
* Discover skills from configured source directories.
|
|
62
|
+
* Scans each source directory for subdirectories containing SKILL.md files.
|
|
63
|
+
*/
|
|
64
|
+
export declare function discoverSkills(fs: FileSystem, sources: string[], basePath: string): Promise<Result<SkillMetadata[], SkillDiscoveryError>>;
|
|
65
|
+
/**
|
|
66
|
+
* Load the full content of a skill file (without frontmatter).
|
|
67
|
+
*/
|
|
68
|
+
export declare function loadSkillContent(fs: FileSystem, skillPath: string): Promise<Result<string, SkillDiscoveryError>>;
|
|
69
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/plugins/skills/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAO/D,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,iBAAiB,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,mBAAmB,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,WAAW,EAAE,iBAAiB,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAA;CACf;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,MAAM,GACb,MAAM,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAkElD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,WAAW,EAAE,MAAM,GACjB,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAchD;AAMD;;;GAGG;AACH,wBAAsB,cAAc,CACnC,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAwEvD;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACrC,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAqB9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/skills/discovery.test.ts"],"names":[],"mappings":""}
|