@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,474 @@
|
|
|
1
|
+
import z4 from 'zod/v4';
|
|
2
|
+
import type { DomainError } from '../../core/errors.js';
|
|
3
|
+
import type { Logger } from '../../lib/logger/logger.js';
|
|
4
|
+
import type { Result } from '../../lib/utils/result.js';
|
|
5
|
+
import type { MailboxMessage } from '../../plugins/mailbox/schema.js';
|
|
6
|
+
import type { AgentConfig } from '../agents/agent.js';
|
|
7
|
+
import type { AgentContext } from '../agents/context.js';
|
|
8
|
+
import type { AgentId } from '../agents/schema.js';
|
|
9
|
+
import type { EventStore } from '../events/event-store.js';
|
|
10
|
+
import type { BaseEvent, DomainEvent } from '../events/types.js';
|
|
11
|
+
import type { ToolResultContent } from '../llm/llm-log-types.js';
|
|
12
|
+
import type { LLMLogger } from '../llm/logger.js';
|
|
13
|
+
import type { LLMResponse } from '../llm/state.js';
|
|
14
|
+
import type { Preset } from '../preset/index.js';
|
|
15
|
+
import type { SessionContext } from '../sessions/context.js';
|
|
16
|
+
import type { StateSlice } from '../sessions/reducer.js';
|
|
17
|
+
import type { SessionManager } from '../sessions/session-manager.js';
|
|
18
|
+
import type { SessionState } from '../sessions/state.js';
|
|
19
|
+
import type { ToolContext } from '../tools/context.js';
|
|
20
|
+
import type { ToolDefinition } from '../tools/definition.js';
|
|
21
|
+
import type { ToolResponse } from '../tools/schema.js';
|
|
22
|
+
import type { ToolCall } from '../tools/schema.js';
|
|
23
|
+
import type { AfterInferenceResult, AfterToolCallResult, BeforeInferenceResult, BeforeToolCallResult, OnCompleteResult, OnErrorResult, OnStartResult } from './hook-types.js';
|
|
24
|
+
import type { PluginDequeueHook, PluginPendingMessages } from './index.js';
|
|
25
|
+
type EventSourceRef = {
|
|
26
|
+
create(type: string, input: unknown): unknown;
|
|
27
|
+
EventType: unknown;
|
|
28
|
+
Events: unknown;
|
|
29
|
+
};
|
|
30
|
+
type MethodEntry = {
|
|
31
|
+
input: unknown;
|
|
32
|
+
output: unknown;
|
|
33
|
+
};
|
|
34
|
+
type ManagerMethodEntry = {
|
|
35
|
+
input: unknown;
|
|
36
|
+
output: unknown;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Notification entry — registered via .notification() on PluginBuilder.
|
|
40
|
+
* Schema is stored for documentation/validation but not enforced at runtime.
|
|
41
|
+
*/
|
|
42
|
+
type NotificationEntry = {
|
|
43
|
+
schema: z4.ZodType;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* A collected notification — emitted by ctx.notify() during handler/hook execution.
|
|
47
|
+
* Ephemeral (not persisted), broadcast to connected clients via transport.
|
|
48
|
+
*/
|
|
49
|
+
export interface PluginNotification {
|
|
50
|
+
pluginName: string;
|
|
51
|
+
type: string;
|
|
52
|
+
payload: unknown;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Session-level plugin configuration — binds a plugin name to its session config.
|
|
56
|
+
* Created via `pluginDefinition.configure(config)`.
|
|
57
|
+
*/
|
|
58
|
+
export interface SessionPluginConfig<TName extends string = string, TConfig = unknown> {
|
|
59
|
+
readonly pluginName: TName;
|
|
60
|
+
readonly config: TConfig;
|
|
61
|
+
readonly definition: PluginDefinition<TName, TConfig, any, any, any>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Agent-level plugin configuration — binds a plugin name to its per-agent config.
|
|
65
|
+
* Created via `pluginDefinition.configureAgent(config)`.
|
|
66
|
+
*/
|
|
67
|
+
export interface AgentPluginConfig<TName extends string = string, TAgentConfig = unknown> {
|
|
68
|
+
readonly pluginName: TName;
|
|
69
|
+
readonly config: TAgentConfig;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Extract typed session-level method callers from a PluginDefinition.
|
|
73
|
+
* Uses indexed access on _methods brand (pre-resolved types) instead of
|
|
74
|
+
* conditional `infer` on 5-param generic + Zod type extraction.
|
|
75
|
+
*/
|
|
76
|
+
type PluginMethodCallers<TPlugin extends PluginDefinition<string, any, any, any, any>> = {
|
|
77
|
+
[K in keyof NonNullable<TPlugin['_methods']>]: (input: NonNullable<TPlugin['_methods']>[K]['input']) => Promise<Result<NonNullable<TPlugin['_methods']>[K]['output'], DomainError>>;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Build deps object type from an array of PluginDefinition instances.
|
|
81
|
+
* Maps each plugin's TName to its session-level method callers.
|
|
82
|
+
*/
|
|
83
|
+
export type DepsFromPlugins<TPlugins extends readonly PluginDefinition<string, any, any, any, any>[]> = {
|
|
84
|
+
[P in TPlugins[number] as P['name']]: PluginMethodCallers<P>;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Identifies who is calling a plugin method.
|
|
88
|
+
* - 'agent': called via agent tool (ctx.self)
|
|
89
|
+
* - 'client': called via SPA RPC (user-initiated)
|
|
90
|
+
* - 'system': called via backend/webhook (trusted)
|
|
91
|
+
*/
|
|
92
|
+
export type CallerContext = {
|
|
93
|
+
source: 'agent' | 'client' | 'system';
|
|
94
|
+
meta: Record<string, unknown>;
|
|
95
|
+
};
|
|
96
|
+
export declare const DEFAULT_CALLER: CallerContext;
|
|
97
|
+
export declare const AGENT_CALLER: CallerContext;
|
|
98
|
+
/**
|
|
99
|
+
* Context for method handlers — has pluginContext + pluginState + pluginConfig, no self.
|
|
100
|
+
*/
|
|
101
|
+
export type MethodHandlerContext<TConfig, TContext, TState, TNotifications extends Record<string, NotificationEntry> = {}, TDeps = {}> = SessionContext & {
|
|
102
|
+
caller: CallerContext;
|
|
103
|
+
pluginConfig: TConfig;
|
|
104
|
+
pluginContext: TContext;
|
|
105
|
+
pluginState: TState;
|
|
106
|
+
scheduleAgent: (agentId: AgentId) => void;
|
|
107
|
+
notify: <K extends string & keyof TNotifications>(type: K, payload: z4.infer<TNotifications[K]['schema']>) => void;
|
|
108
|
+
deps: TDeps;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Context for hooks, tools callbacks, status — has self + pluginConfig.
|
|
112
|
+
*/
|
|
113
|
+
export type PluginHookContext<TConfig, TMethods extends Record<string, MethodEntry>, TAgentConfig, TContext, TState, TNotifications extends Record<string, NotificationEntry> = {}, TDeps = {}> = AgentContext & {
|
|
114
|
+
pluginConfig: TConfig;
|
|
115
|
+
pluginAgentConfig?: TAgentConfig;
|
|
116
|
+
pluginContext: TContext;
|
|
117
|
+
pluginState: TState;
|
|
118
|
+
self: PluginSelf<TMethods>;
|
|
119
|
+
schedule: () => void;
|
|
120
|
+
notify: <K extends string & keyof TNotifications>(type: K, payload: z4.infer<TNotifications[K]['schema']>) => void;
|
|
121
|
+
deps: TDeps;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Context for session-level hooks — has pluginConfig.
|
|
125
|
+
*/
|
|
126
|
+
export type PluginSessionHookContext<TConfig, TMethods extends Record<string, MethodEntry>, TContext, TState, TNotifications extends Record<string, NotificationEntry> = {}, TDeps = {}> = SessionContext & {
|
|
127
|
+
pluginConfig: TConfig;
|
|
128
|
+
pluginContext: TContext;
|
|
129
|
+
pluginState: TState;
|
|
130
|
+
self: PluginSelf<TMethods>;
|
|
131
|
+
scheduleAgent: (agentId: AgentId) => void;
|
|
132
|
+
notify: <K extends string & keyof TNotifications>(type: K, payload: z4.infer<TNotifications[K]['schema']>) => void;
|
|
133
|
+
deps: TDeps;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Context for manager-level method handlers — operates outside session context.
|
|
137
|
+
* Used for operations like session creation, listing, preset queries.
|
|
138
|
+
*/
|
|
139
|
+
export type ManagerMethodContext = {
|
|
140
|
+
sessionManager: SessionManager;
|
|
141
|
+
eventStore: EventStore;
|
|
142
|
+
presets: Map<string, Preset>;
|
|
143
|
+
logger: Logger;
|
|
144
|
+
/** Optional LLM logger for LLM call queries */
|
|
145
|
+
llmLogger?: LLMLogger;
|
|
146
|
+
/** Host-environment adapters (filesystem, process). */
|
|
147
|
+
platform: import('../../platform/index.js').Platform;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Self accessor — typed method callers derived from accumulated types.
|
|
151
|
+
*/
|
|
152
|
+
type PluginSelf<TMethods extends Record<string, MethodEntry>> = {
|
|
153
|
+
[K in keyof TMethods]: (input: TMethods[K]['input']) => Promise<Result<TMethods[K]['output'], DomainError>>;
|
|
154
|
+
};
|
|
155
|
+
type HookMap<TCtx> = {
|
|
156
|
+
onStart: (ctx: TCtx) => Promise<OnStartResult>;
|
|
157
|
+
beforeInference: (ctx: TCtx & {
|
|
158
|
+
pendingMessages: MailboxMessage[];
|
|
159
|
+
turnNumber: number;
|
|
160
|
+
}) => Promise<BeforeInferenceResult>;
|
|
161
|
+
afterInference: (ctx: TCtx & {
|
|
162
|
+
response: LLMResponse;
|
|
163
|
+
turnNumber: number;
|
|
164
|
+
}) => Promise<AfterInferenceResult>;
|
|
165
|
+
beforeToolCall: (ctx: TCtx & {
|
|
166
|
+
toolCall: ToolCall;
|
|
167
|
+
}) => Promise<BeforeToolCallResult>;
|
|
168
|
+
afterToolCall: (ctx: TCtx & {
|
|
169
|
+
toolCall: ToolCall;
|
|
170
|
+
result: {
|
|
171
|
+
isError: boolean;
|
|
172
|
+
content: ToolResultContent;
|
|
173
|
+
};
|
|
174
|
+
}) => Promise<AfterToolCallResult>;
|
|
175
|
+
onComplete: (ctx: TCtx) => Promise<OnCompleteResult>;
|
|
176
|
+
onError: (ctx: TCtx & {
|
|
177
|
+
error: string;
|
|
178
|
+
}) => Promise<OnErrorResult>;
|
|
179
|
+
};
|
|
180
|
+
type SessionHookMap<TCtx> = {
|
|
181
|
+
onSessionReady: (ctx: TCtx) => Promise<void>;
|
|
182
|
+
onSessionClose: (ctx: TCtx) => Promise<void>;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Base plugin hook context — agent-level hooks, tools, status, dequeue.
|
|
186
|
+
* This is the type-erased form used by ConfiguredPlugin consumers.
|
|
187
|
+
*/
|
|
188
|
+
export type BasePluginHookContext = AgentContext & {
|
|
189
|
+
pluginConfig: unknown;
|
|
190
|
+
pluginAgentConfig: unknown;
|
|
191
|
+
pluginContext: unknown;
|
|
192
|
+
pluginState: unknown;
|
|
193
|
+
self: Record<string, (input: unknown) => Promise<unknown>>;
|
|
194
|
+
schedule: () => void;
|
|
195
|
+
notify: (type: string, payload: unknown) => void;
|
|
196
|
+
deps: Record<string, Record<string, (input: unknown) => Promise<Result<unknown, DomainError>>>>;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Base session hook context — session-level hooks (onSessionReady, onSessionClose).
|
|
200
|
+
*/
|
|
201
|
+
export type BaseSessionHookContext = SessionContext & {
|
|
202
|
+
caller: CallerContext;
|
|
203
|
+
pluginConfig: unknown;
|
|
204
|
+
pluginContext: unknown;
|
|
205
|
+
pluginState: unknown;
|
|
206
|
+
self: Record<string, (input: unknown) => Promise<unknown>>;
|
|
207
|
+
scheduleAgent: (agentId: AgentId) => void;
|
|
208
|
+
notify: (type: string, payload: unknown) => void;
|
|
209
|
+
deps: Record<string, Record<string, (input: unknown) => Promise<Result<unknown, DomainError>>>>;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Base method handler context — session-level method handlers.
|
|
213
|
+
*/
|
|
214
|
+
export type BaseMethodHandlerContext = SessionContext & {
|
|
215
|
+
caller: CallerContext;
|
|
216
|
+
pluginConfig: unknown;
|
|
217
|
+
pluginContext: unknown;
|
|
218
|
+
pluginState: unknown;
|
|
219
|
+
scheduleAgent: (agentId: AgentId) => void;
|
|
220
|
+
notify: (type: string, payload: unknown) => void;
|
|
221
|
+
deps: Record<string, Record<string, (input: unknown) => Promise<Result<unknown, DomainError>>>>;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Agent-level hook map with proper return types but erased context.
|
|
225
|
+
*/
|
|
226
|
+
type ErasedAgentHookMap = {
|
|
227
|
+
onStart: (ctx: BasePluginHookContext) => Promise<OnStartResult>;
|
|
228
|
+
beforeInference: (ctx: BasePluginHookContext & {
|
|
229
|
+
pendingMessages: MailboxMessage[];
|
|
230
|
+
turnNumber: number;
|
|
231
|
+
}) => Promise<BeforeInferenceResult>;
|
|
232
|
+
afterInference: (ctx: BasePluginHookContext & {
|
|
233
|
+
response: LLMResponse;
|
|
234
|
+
turnNumber: number;
|
|
235
|
+
}) => Promise<AfterInferenceResult>;
|
|
236
|
+
beforeToolCall: (ctx: BasePluginHookContext & {
|
|
237
|
+
toolCall: ToolCall;
|
|
238
|
+
}) => Promise<BeforeToolCallResult>;
|
|
239
|
+
afterToolCall: (ctx: BasePluginHookContext & {
|
|
240
|
+
toolCall: ToolCall;
|
|
241
|
+
result: {
|
|
242
|
+
isError: boolean;
|
|
243
|
+
content: ToolResultContent;
|
|
244
|
+
};
|
|
245
|
+
}) => Promise<AfterToolCallResult>;
|
|
246
|
+
onComplete: (ctx: BasePluginHookContext) => Promise<OnCompleteResult>;
|
|
247
|
+
onError: (ctx: BasePluginHookContext & {
|
|
248
|
+
error: string;
|
|
249
|
+
}) => Promise<OnErrorResult>;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Session-level hook map with proper return types but erased context.
|
|
253
|
+
*/
|
|
254
|
+
type ErasedSessionHookMap = {
|
|
255
|
+
onSessionReady: (ctx: BaseSessionHookContext) => Promise<void>;
|
|
256
|
+
onSessionClose: (ctx: BaseSessionHookContext) => Promise<void>;
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* ConfiguredPlugin — runtime-ready plugin instance with config bound.
|
|
260
|
+
* This is the shape that session/runtime code consumes.
|
|
261
|
+
*/
|
|
262
|
+
export interface ConfiguredPlugin {
|
|
263
|
+
name: string;
|
|
264
|
+
methods: Record<string, {
|
|
265
|
+
input: z4.ZodType;
|
|
266
|
+
output: z4.ZodType;
|
|
267
|
+
handler: (ctx: BaseMethodHandlerContext, input: unknown) => Promise<Result<unknown, DomainError>>;
|
|
268
|
+
}>;
|
|
269
|
+
/** Registered notification types (for introspection/documentation) */
|
|
270
|
+
notifications: Record<string, {
|
|
271
|
+
schema: z4.ZodType;
|
|
272
|
+
}>;
|
|
273
|
+
/** Names of dependency plugins for runtime wiring */
|
|
274
|
+
dependencyNames: string[];
|
|
275
|
+
createContext?: (ctx: SessionContext) => Promise<unknown>;
|
|
276
|
+
state?: {
|
|
277
|
+
key: string;
|
|
278
|
+
events: readonly EventSourceRef[];
|
|
279
|
+
initialState: () => unknown;
|
|
280
|
+
reduce: (state: unknown, event: DomainEvent, sessionState: SessionState) => unknown;
|
|
281
|
+
};
|
|
282
|
+
agentHooks?: Partial<ErasedAgentHookMap>;
|
|
283
|
+
sessionHooks?: Partial<ErasedSessionHookMap>;
|
|
284
|
+
getTools?: (ctx: BasePluginHookContext) => ToolDefinition<any>[];
|
|
285
|
+
getStatus?: (ctx: BasePluginHookContext) => string | null;
|
|
286
|
+
getSystemPrompt?: (ctx: BasePluginHookContext) => string | null;
|
|
287
|
+
dequeue?: {
|
|
288
|
+
hasPendingMessages: (ctx: BasePluginHookContext) => boolean;
|
|
289
|
+
getPendingMessages: (ctx: BasePluginHookContext) => PluginPendingMessages | null;
|
|
290
|
+
markConsumed: (ctx: BasePluginHookContext, token: unknown) => Promise<void>;
|
|
291
|
+
};
|
|
292
|
+
slice?: StateSlice;
|
|
293
|
+
isEnabled?: (ctx: {
|
|
294
|
+
pluginConfig: unknown;
|
|
295
|
+
pluginAgentConfig: unknown;
|
|
296
|
+
agentConfig: AgentConfig;
|
|
297
|
+
}) => boolean;
|
|
298
|
+
isSessionEnabled?: (ctx: {
|
|
299
|
+
pluginConfig: unknown;
|
|
300
|
+
}) => boolean;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* PluginDefinition — static global constant. Call .create(config) to bind config.
|
|
304
|
+
* managerMethods are available without creating a session (manager-level operations).
|
|
305
|
+
*/
|
|
306
|
+
/** Erased runtime shape for manager methods — used for iteration in SessionManager */
|
|
307
|
+
type ManagerMethodRecord = Record<string, {
|
|
308
|
+
input: z4.ZodType;
|
|
309
|
+
output: z4.ZodType;
|
|
310
|
+
handler: (ctx: ManagerMethodContext, input: unknown) => Promise<Result<unknown, DomainError>>;
|
|
311
|
+
}>;
|
|
312
|
+
/** Erased runtime shape for session method schemas — no handler, just input/output */
|
|
313
|
+
type SessionMethodSchemaRecord = Record<string, {
|
|
314
|
+
input: z4.ZodType;
|
|
315
|
+
output: z4.ZodType;
|
|
316
|
+
}>;
|
|
317
|
+
export interface PluginDefinition<TName extends string = string, TConfig = void, TAgentConfig = void, TManagerMethods extends Record<string, ManagerMethodEntry> = {}, TMethods extends Record<string, MethodEntry> = {}> {
|
|
318
|
+
name: TName;
|
|
319
|
+
create(...args: TConfig extends void ? [] : [config: TConfig]): ConfiguredPlugin;
|
|
320
|
+
configure(...args: TConfig extends void ? [] : [config: TConfig]): SessionPluginConfig<TName, TConfig>;
|
|
321
|
+
configureAgent(...args: TAgentConfig extends void ? [] : [config: TAgentConfig]): AgentPluginConfig<TName, TAgentConfig>;
|
|
322
|
+
managerMethods: ManagerMethodRecord;
|
|
323
|
+
/** Session-level method schemas — available statically without calling .create() */
|
|
324
|
+
sessionMethods: SessionMethodSchemaRecord;
|
|
325
|
+
/** Type-only brand — carries session method types as plain TS types */
|
|
326
|
+
readonly _methods?: TMethods;
|
|
327
|
+
/** Type-only brand — carries manager method types as plain TS types */
|
|
328
|
+
readonly _managerMethods?: TManagerMethods;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Static tool spec — stored by .tool(), converted to ToolDefinition at runtime.
|
|
332
|
+
* Keeps the 3-arg execute signature so we can bind pluginCtx via closure.
|
|
333
|
+
*/
|
|
334
|
+
interface StaticToolSpec {
|
|
335
|
+
name: string;
|
|
336
|
+
description: string;
|
|
337
|
+
input: z4.ZodType;
|
|
338
|
+
execute: (input: unknown, toolCtx: ToolContext, pluginCtx: BasePluginHookContext) => Promise<ToolResponse>;
|
|
339
|
+
}
|
|
340
|
+
interface BuilderConfig {
|
|
341
|
+
name: string;
|
|
342
|
+
events: readonly EventSourceRef[];
|
|
343
|
+
/** Names of dependency plugins — stored for runtime wiring */
|
|
344
|
+
dependencyNames: string[];
|
|
345
|
+
stateConfig: {
|
|
346
|
+
key: string;
|
|
347
|
+
initial: () => unknown;
|
|
348
|
+
reduce: (state: unknown, event: unknown, sessionState: SessionState, pluginConfig: unknown) => unknown;
|
|
349
|
+
} | undefined;
|
|
350
|
+
contextFactory: ((ctx: SessionContext, pluginConfig: unknown) => Promise<unknown>) | undefined;
|
|
351
|
+
isSessionEnabledFn: ((ctx: {
|
|
352
|
+
pluginConfig: unknown;
|
|
353
|
+
}) => boolean) | undefined;
|
|
354
|
+
methods: Record<string, {
|
|
355
|
+
input: z4.ZodType;
|
|
356
|
+
output: z4.ZodType;
|
|
357
|
+
handler: (ctx: BaseMethodHandlerContext, input: unknown) => Promise<Result<unknown, DomainError>>;
|
|
358
|
+
}>;
|
|
359
|
+
managerMethods: Record<string, {
|
|
360
|
+
input: z4.ZodType;
|
|
361
|
+
output: z4.ZodType;
|
|
362
|
+
handler: (ctx: ManagerMethodContext, input: unknown) => Promise<Result<unknown, DomainError>>;
|
|
363
|
+
}>;
|
|
364
|
+
notifications: Record<string, {
|
|
365
|
+
schema: z4.ZodType;
|
|
366
|
+
}>;
|
|
367
|
+
staticTools: StaticToolSpec[];
|
|
368
|
+
dynamicTools: ((ctx: BasePluginHookContext) => ToolDefinition<any>[]) | undefined;
|
|
369
|
+
statusFn: ((ctx: BasePluginHookContext) => string | null) | undefined;
|
|
370
|
+
systemPromptFn: ((ctx: BasePluginHookContext) => string | null) | undefined;
|
|
371
|
+
agentHooks: Partial<ErasedAgentHookMap>;
|
|
372
|
+
sessionHooks: Partial<ErasedSessionHookMap>;
|
|
373
|
+
isEnabledFn: ((ctx: {
|
|
374
|
+
pluginConfig: unknown;
|
|
375
|
+
pluginAgentConfig: unknown;
|
|
376
|
+
agentConfig: AgentConfig;
|
|
377
|
+
}) => boolean) | undefined;
|
|
378
|
+
dequeueHook: {
|
|
379
|
+
hasPendingMessages: (ctx: BasePluginHookContext) => boolean;
|
|
380
|
+
getPendingMessages: (ctx: BasePluginHookContext) => PluginPendingMessages | null;
|
|
381
|
+
markConsumed: (ctx: BasePluginHookContext, token: unknown) => Promise<void>;
|
|
382
|
+
} | undefined;
|
|
383
|
+
}
|
|
384
|
+
export declare class PluginBuilder<TName extends string, TConfig, TContext, TState, TMethods extends Record<string, MethodEntry>, TManagerMethods extends Record<string, ManagerMethodEntry>, TAgentConfig, TFactories extends readonly EventSourceRef[], TNotifications extends Record<string, NotificationEntry> = {}, TDeps = {}> {
|
|
385
|
+
/** @internal */
|
|
386
|
+
_cfg: BuilderConfig;
|
|
387
|
+
/** @internal */
|
|
388
|
+
readonly _name: TName;
|
|
389
|
+
constructor(name: TName, cfg?: BuilderConfig);
|
|
390
|
+
pluginConfig<T>(): PluginBuilder<TName, T, TContext, TState, TMethods, TManagerMethods, TAgentConfig, TFactories, TNotifications, TDeps>;
|
|
391
|
+
events<const F extends readonly EventSourceRef[]>(factories: F): PluginBuilder<TName, TConfig, TContext, TState, TMethods, TManagerMethods, TAgentConfig, F, TNotifications, TDeps>;
|
|
392
|
+
state<S>(config: {
|
|
393
|
+
key: string;
|
|
394
|
+
initial: () => S;
|
|
395
|
+
reduce: (state: S, event: TFactories[number]['EventType'] & BaseEvent<string>, sessionState: SessionState, pluginConfig: TConfig) => S;
|
|
396
|
+
}): PluginBuilder<TName, TConfig, TContext, S, TMethods, TManagerMethods, TAgentConfig, TFactories, TNotifications, TDeps>;
|
|
397
|
+
context<C>(factory: (ctx: SessionContext, pluginConfig: TConfig) => Promise<C>): PluginBuilder<TName, TConfig, C, TState, TMethods, TManagerMethods, TAgentConfig, TFactories, TNotifications, TDeps>;
|
|
398
|
+
agentConfig<A>(): PluginBuilder<TName, TConfig, TContext, TState, TMethods, TManagerMethods, A, TFactories, TNotifications, TDeps>;
|
|
399
|
+
/**
|
|
400
|
+
* Declare dependencies on other plugins. The dependency plugins' session-level methods
|
|
401
|
+
* become available as `ctx.deps.pluginName.methodName(input)` in all handler contexts.
|
|
402
|
+
*/
|
|
403
|
+
dependencies<const TPlugins extends readonly PluginDefinition<string, any, any, any, any>[]>(plugins: TPlugins): PluginBuilder<TName, TConfig, TContext, TState, TMethods, TManagerMethods, TAgentConfig, TFactories, TNotifications, DepsFromPlugins<TPlugins>>;
|
|
404
|
+
method<TMethodName extends string, TInput, TOutput>(name: TMethodName, def: {
|
|
405
|
+
input: z4.ZodSchema<TInput>;
|
|
406
|
+
output: z4.ZodSchema<TOutput>;
|
|
407
|
+
handler: (ctx: MethodHandlerContext<TConfig, TContext, TState, TNotifications, TDeps>, input: TInput) => Promise<Result<TOutput, DomainError>>;
|
|
408
|
+
}): PluginBuilder<TName, TConfig, TContext, TState, TMethods & Record<TMethodName, {
|
|
409
|
+
input: TInput;
|
|
410
|
+
output: TOutput;
|
|
411
|
+
}>, TManagerMethods, TAgentConfig, TFactories, TNotifications, TDeps>;
|
|
412
|
+
managerMethod<TMethodName extends string, TInput, TOutput>(name: TMethodName, def: {
|
|
413
|
+
input: z4.ZodSchema<TInput>;
|
|
414
|
+
output: z4.ZodSchema<TOutput>;
|
|
415
|
+
handler: (ctx: ManagerMethodContext, input: TInput) => Promise<Result<TOutput, DomainError>>;
|
|
416
|
+
}): PluginBuilder<TName, TConfig, TContext, TState, TMethods, TManagerMethods & Record<TMethodName, {
|
|
417
|
+
input: TInput;
|
|
418
|
+
output: TOutput;
|
|
419
|
+
}>, TAgentConfig, TFactories, TNotifications, TDeps>;
|
|
420
|
+
notification<TNotifName extends string, TPayload>(name: TNotifName, def: {
|
|
421
|
+
schema: z4.ZodSchema<TPayload>;
|
|
422
|
+
}): PluginBuilder<TName, TConfig, TContext, TState, TMethods, TManagerMethods, TAgentConfig, TFactories, TNotifications & Record<TNotifName, {
|
|
423
|
+
schema: typeof def.schema;
|
|
424
|
+
}>, TDeps>;
|
|
425
|
+
tool<TInput>(name: string, def: {
|
|
426
|
+
description: string;
|
|
427
|
+
input: z4.ZodSchema<TInput>;
|
|
428
|
+
execute: (input: TInput, toolCtx: ToolContext, pluginCtx: PluginHookContext<TConfig, TMethods, TAgentConfig, TContext, TState, TNotifications, TDeps>) => Promise<ToolResponse>;
|
|
429
|
+
}): this;
|
|
430
|
+
tools(fn: (ctx: PluginHookContext<TConfig, TMethods, TAgentConfig, TContext, TState, TNotifications, TDeps>) => ToolDefinition<any>[]): this;
|
|
431
|
+
status(fn: (ctx: PluginHookContext<TConfig, TMethods, TAgentConfig, TContext, TState, TNotifications, TDeps>) => string | null): this;
|
|
432
|
+
systemPrompt(fn: (ctx: PluginHookContext<TConfig, TMethods, TAgentConfig, TContext, TState, TNotifications, TDeps>) => string | null): this;
|
|
433
|
+
hook<TName extends keyof HookMap<PluginHookContext<TConfig, TMethods, TAgentConfig, TContext, TState, TNotifications, TDeps>>>(name: TName, fn: HookMap<PluginHookContext<TConfig, TMethods, TAgentConfig, TContext, TState, TNotifications, TDeps>>[TName]): this;
|
|
434
|
+
sessionHook<TName extends keyof SessionHookMap<PluginSessionHookContext<TConfig, TMethods, TContext, TState, TNotifications, TDeps>>>(name: TName, fn: SessionHookMap<PluginSessionHookContext<TConfig, TMethods, TContext, TState, TNotifications, TDeps>>[TName]): this;
|
|
435
|
+
/**
|
|
436
|
+
* Define a function to determine if this plugin is enabled at session level.
|
|
437
|
+
* Called once when building plugins for a session.
|
|
438
|
+
*
|
|
439
|
+
* @param fn Function that receives plugin config and returns true if plugin should be active
|
|
440
|
+
*/
|
|
441
|
+
isSessionEnabled(fn: (ctx: {
|
|
442
|
+
pluginConfig: TConfig | undefined;
|
|
443
|
+
}) => boolean): this;
|
|
444
|
+
/**
|
|
445
|
+
* Define a function to determine if this plugin is enabled for a specific agent.
|
|
446
|
+
* Called once when creating agent plugins.
|
|
447
|
+
*
|
|
448
|
+
* @param fn Function that receives context and returns true if plugin should be active
|
|
449
|
+
*/
|
|
450
|
+
isEnabled(fn: (ctx: {
|
|
451
|
+
pluginConfig: TConfig;
|
|
452
|
+
pluginAgentConfig: TAgentConfig | undefined;
|
|
453
|
+
agentConfig: AgentConfig;
|
|
454
|
+
}) => boolean): this;
|
|
455
|
+
dequeue<TToken>(hook: PluginDequeueHook<PluginHookContext<TConfig, TMethods, TAgentConfig, TContext, TState, TNotifications, TDeps>, TToken>): this;
|
|
456
|
+
build(): PluginDefinition<TName, TConfig, TAgentConfig, TManagerMethods, TMethods>;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Callback type for resolving a plugin method call at runtime.
|
|
460
|
+
* Used by session.ts and agent.ts to delegate to the session's callPluginMethod.
|
|
461
|
+
*/
|
|
462
|
+
export type PluginMethodCaller = (pluginName: string, methodName: string, input: unknown) => Promise<Result<unknown, DomainError>>;
|
|
463
|
+
/**
|
|
464
|
+
* Build a `deps` object for a plugin at runtime.
|
|
465
|
+
* Creates proxy-like method callers for each dependency plugin.
|
|
466
|
+
*
|
|
467
|
+
* @param dependencyNames - Plugin names this plugin depends on
|
|
468
|
+
* @param allPlugins - All configured plugins in the session (to discover method names)
|
|
469
|
+
* @param callMethod - Callback that routes to the session's callPluginMethod
|
|
470
|
+
*/
|
|
471
|
+
export declare function buildPluginDeps(dependencyNames: string[], allPlugins: ConfiguredPlugin[], callMethod: PluginMethodCaller): Record<string, Record<string, (input: unknown) => Promise<Result<unknown, DomainError>>>>;
|
|
472
|
+
export declare function definePlugin<TName extends string>(name: TName): PluginBuilder<TName, void, void, undefined, {}, {}, void, [], {}, {}>;
|
|
473
|
+
export {};
|
|
474
|
+
//# sourceMappingURL=plugin-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-builder.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/plugin-builder.ts"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;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC9B,eAAe,EAAE,MAAM,EAAE,EACzB,UAAU,EAAE,gBAAgB,EAAE,EAC9B,UAAU,EAAE,kBAAkB,GAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAe3F;AAMD,wBAAgB,YAAY,CAAC,KAAK,SAAS,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAErI"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { AnyAgentDefinition, CommunicatorConfig, OrchestratorConfig } from '../../core/agents/config.js';
|
|
2
|
+
import type { LLMMiddleware } from '../../core/llm/middleware.js';
|
|
3
|
+
import type { SessionPluginConfig } from '../../core/plugins/plugin-builder.js';
|
|
4
|
+
import type { CreatePresetInput } from './preset-builder.js';
|
|
5
|
+
/**
|
|
6
|
+
* Preset - complete configuration for a Roj session
|
|
7
|
+
*/
|
|
8
|
+
export interface PresetDefinition {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
/** Default workspace directory path. Can be overridden per session. */
|
|
13
|
+
workspaceDir?: string;
|
|
14
|
+
/** When true, agents see virtual paths (/home/user/session, /home/user/workspace) instead of real filesystem paths */
|
|
15
|
+
sandboxed?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Session-level plugin configurations.
|
|
18
|
+
* Created via `pluginDefinition.configure(config)`.
|
|
19
|
+
*/
|
|
20
|
+
plugins?: SessionPluginConfig[];
|
|
21
|
+
/** Orchestrator configuration (always exists) */
|
|
22
|
+
orchestrator: OrchestratorConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Communication agent configuration.
|
|
25
|
+
* When present, user messages are routed through communicator first.
|
|
26
|
+
* When absent, messages go directly to orchestrator.
|
|
27
|
+
*/
|
|
28
|
+
communicator?: CommunicatorConfig;
|
|
29
|
+
/** Definitions of spawnable agents (accepts both typed and untyped agents) */
|
|
30
|
+
agents: AnyAgentDefinition[];
|
|
31
|
+
/** LLM middleware chain applied to all agents in this preset (runs before agent-level middleware) */
|
|
32
|
+
llmMiddleware?: LLMMiddleware[];
|
|
33
|
+
/**
|
|
34
|
+
* Platform resource slugs to inject into sessions by default.
|
|
35
|
+
* The init workflow resolves these slugs to resource files and injects them
|
|
36
|
+
* into the workspace when no explicit resourceIds are provided.
|
|
37
|
+
*/
|
|
38
|
+
defaultResourceSlugs?: string[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a preset with automatic collection.
|
|
42
|
+
*
|
|
43
|
+
* Recursively walks the orchestrator (and communicator) tree to collect
|
|
44
|
+
* all agents. Then validates with `validatePreset()`.
|
|
45
|
+
*
|
|
46
|
+
* @throws Error if preset validation fails
|
|
47
|
+
*/
|
|
48
|
+
export declare function createPreset(input: CreatePresetInput): PresetDefinition;
|
|
49
|
+
/**
|
|
50
|
+
* Validates a preset configuration, checking that all referenced agents, and services exist.
|
|
51
|
+
* @param preset The preset to validate
|
|
52
|
+
* @returns Array of error messages (empty if valid)
|
|
53
|
+
*/
|
|
54
|
+
export declare const validatePreset: (preset: PresetDefinition) => string[];
|
|
55
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/core/preset/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACzG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAG5D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,sHAAsH;IACtH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAA;IAE/B,iDAAiD;IACjD,YAAY,EAAE,kBAAkB,CAAA;IAEhC;;;;OAIG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAA;IAEjC,8EAA8E;IAC9E,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAE5B,qGAAqG;IACrG,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAE/B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAqBvE;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,gBAAgB,KAAG,MAAM,EAuB/D,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preset module - type-safe preset builder and configuration
|
|
3
|
+
*/
|
|
4
|
+
export type { PresetDefinition as Preset } from './config.js';
|
|
5
|
+
export { createPreset, validatePreset } from './config.js';
|
|
6
|
+
export type { CreateOrchestratorInput, DefineAgentInput } from './preset-builder.js';
|
|
7
|
+
export { createOrchestrator, defineAgent } from './preset-builder.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/preset/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAG1D,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-safe preset builder for Roj SDK.
|
|
3
|
+
*
|
|
4
|
+
* Replaces string-based cross-references (spawnableAgents)
|
|
5
|
+
* with object references, catching typos and renames at compile time.
|
|
6
|
+
*
|
|
7
|
+
* `createPreset` recursively collects agents from the orchestrator tree.
|
|
8
|
+
*/
|
|
9
|
+
import type { Preset } from '../../core/preset/index.js';
|
|
10
|
+
import type { AgentDefinition, AnyAgentDefinition, BaseAgentConfig, OrchestratorConfig } from '../agents/config.js';
|
|
11
|
+
interface ObjectRefs {
|
|
12
|
+
agents?: AnyAgentDefinition[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Replace string ref fields with short object-ref fields.
|
|
16
|
+
* `agents: string[]` → `agents: AnyAgentDefinition[]`
|
|
17
|
+
*/
|
|
18
|
+
type WithObjectRefs<T> = Omit<T, 'spawnableAgents' | 'agents'> & ObjectRefs;
|
|
19
|
+
/** Input type for defineAgent - uses object refs instead of string names */
|
|
20
|
+
export type DefineAgentInput<TInput = unknown> = WithObjectRefs<AgentDefinition<TInput>>;
|
|
21
|
+
/** Input type for createOrchestrator - uses object refs instead of string names */
|
|
22
|
+
export type CreateOrchestratorInput = WithObjectRefs<BaseAgentConfig>;
|
|
23
|
+
/** Input type for createPreset - agents are auto-collected from the tree */
|
|
24
|
+
export type CreatePresetInput = Omit<Preset, 'agents'>;
|
|
25
|
+
/** Recursively collect agents from a config node */
|
|
26
|
+
export declare function collectFromTree(root: object): {
|
|
27
|
+
agents: AnyAgentDefinition[];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Define an agent with type-safe object references.
|
|
31
|
+
*
|
|
32
|
+
* Accepts `agents` as object references
|
|
33
|
+
* and resolves them to string names for the runtime.
|
|
34
|
+
*/
|
|
35
|
+
export declare function defineAgent<TInput = unknown>(input: DefineAgentInput<TInput>): AgentDefinition<TInput>;
|
|
36
|
+
/**
|
|
37
|
+
* Create an orchestrator config with type-safe object references.
|
|
38
|
+
*
|
|
39
|
+
* Accepts `agents` as object references
|
|
40
|
+
* and resolves them to string names for the runtime.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createOrchestrator(input: CreateOrchestratorInput): OrchestratorConfig;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=preset-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-builder.d.ts","sourceRoot":"","sources":["../../../src/core/preset/preset-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAMnH,UAAU,UAAU;IACnB,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAC7B;AAED;;;GAGG;AACH,KAAK,cAAc,CAAC,CAAC,IAClB,IAAI,CAAC,CAAC,EAAE,iBAAiB,GAAG,QAAQ,CAAC,GACrC,UAAU,CAAA;AAMb,4EAA4E;AAC5E,MAAM,MAAM,gBAAgB,CAAC,MAAM,GAAG,OAAO,IAAI,cAAc,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAA;AAExF,mFAAmF;AACnF,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAA;AAErE,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AA2BtD,oDAAoD;AACpD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAiB9E;AAMD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,CAGtG;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,kBAAkB,CAGrF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-lifecycle.integration.test.d.ts","sourceRoot":"","sources":["../../src/core/session-lifecycle.integration.test.ts"],"names":[],"mappings":""}
|