@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 @@
|
|
|
1
|
+
{"version":3,"file":"preprocessor.d.ts","sourceRoot":"","sources":["../../../src/plugins/uploads/preprocessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAMnD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,qEAAqE;IACrE,KAAK,EAAE,SAAS,CAAA;CAChB;AAMD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB;AAMD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,kFAAkF;IAClF,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B;;;;;;;OAOG;IACH,OAAO,CACN,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,mBAAmB,GACtB,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC,CAAA;CAC7C;AAMD;;;GAGG;AACH,qBAAa,oBAAoB;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAEhD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,YAAY,GAAG,IAAI;IAIvC;;;;;;OAMG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAYrD;;OAEG;IACH,MAAM,IAAI,SAAS,YAAY,EAAE;CAGjC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image Classifier Preprocessor
|
|
3
|
+
*
|
|
4
|
+
* Sends images to a vision-capable LLM for description.
|
|
5
|
+
* Falls back to basic metadata if vision is not available.
|
|
6
|
+
*/
|
|
7
|
+
import type { LLMProvider } from '../../../core/llm/provider.js';
|
|
8
|
+
import type { Result } from '../../../lib/utils/result.js';
|
|
9
|
+
import type { FileSystem } from '../../../platform/fs.js';
|
|
10
|
+
import type { Logger } from '../../../lib/logger/logger.js';
|
|
11
|
+
import type { Preprocessor, PreprocessorContext, PreprocessorResult } from '../preprocessor.js';
|
|
12
|
+
export interface ImageClassifierConfig {
|
|
13
|
+
/** LLM provider for vision inference */
|
|
14
|
+
llmProvider: LLMProvider;
|
|
15
|
+
/** Model to use for vision (should be vision-capable) */
|
|
16
|
+
visionModel?: string;
|
|
17
|
+
/** Logger for debug output */
|
|
18
|
+
logger: Logger;
|
|
19
|
+
/** FileSystem adapter (for checking + reading image files) */
|
|
20
|
+
fs: FileSystem;
|
|
21
|
+
/** Whether to skip vision and just return metadata */
|
|
22
|
+
skipVision?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Image classifier preprocessor.
|
|
26
|
+
* Describes images using a vision-capable LLM.
|
|
27
|
+
*/
|
|
28
|
+
export declare class ImageClassifierPreprocessor implements Preprocessor {
|
|
29
|
+
readonly name = "image-classifier";
|
|
30
|
+
readonly supportedMimeTypes: string[];
|
|
31
|
+
private readonly llmProvider;
|
|
32
|
+
private readonly visionModel;
|
|
33
|
+
private readonly logger;
|
|
34
|
+
private readonly fs;
|
|
35
|
+
private readonly skipVision;
|
|
36
|
+
constructor(config: ImageClassifierConfig);
|
|
37
|
+
process(filePath: string, mimeType: string, ctx: PreprocessorContext): Promise<Result<PreprocessorResult, Error>>;
|
|
38
|
+
/**
|
|
39
|
+
* Describe image using vision LLM.
|
|
40
|
+
* Returns null if vision is not available or fails.
|
|
41
|
+
*/
|
|
42
|
+
private describeImage;
|
|
43
|
+
private formatSize;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create an image classifier preprocessor.
|
|
47
|
+
*/
|
|
48
|
+
export declare function createImageClassifierPreprocessor(config: ImageClassifierConfig): ImageClassifierPreprocessor;
|
|
49
|
+
//# sourceMappingURL=image-classifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-classifier.d.ts","sourceRoot":"","sources":["../../../../src/plugins/uploads/preprocessors/image-classifier.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAM/F,MAAM,WAAW,qBAAqB;IACrC,wCAAwC;IACxC,WAAW,EAAE,WAAW,CAAA;IACxB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,EAAE,EAAE,UAAU,CAAA;IACd,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAA;CACpB;AAMD;;;GAGG;AACH,qBAAa,2BAA4B,YAAW,YAAY;IAC/D,QAAQ,CAAC,IAAI,sBAAqB;IAClC,QAAQ,CAAC,kBAAkB,WAAc;IAEzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,MAAM,EAAE,qBAAqB;IAQnC,OAAO,CACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,mBAAmB,GACtB,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAsD7C;;;OAGG;YACW,aAAa;IAyC3B,OAAO,CAAC,UAAU;CAKlB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAChD,MAAM,EAAE,qBAAqB,GAC3B,2BAA2B,CAE7B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preprocessors module exports
|
|
3
|
+
*/
|
|
4
|
+
export { createImageClassifierPreprocessor, type ImageClassifierConfig, ImageClassifierPreprocessor } from './image-classifier.js';
|
|
5
|
+
export { MarkitdownPreprocessor, type MarkitdownPreprocessorConfig } from './markitdown-preprocessor.js';
|
|
6
|
+
export { ZipPreprocessor, type ZipPreprocessorConfig } from './zip-preprocessor.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/uploads/preprocessors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iCAAiC,EAAE,KAAK,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAClI,OAAO,EAAE,sBAAsB,EAAE,KAAK,4BAA4B,EAAE,MAAM,8BAA8B,CAAA;AACxG,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markitdown Preprocessor
|
|
3
|
+
*
|
|
4
|
+
* Converts documents to markdown using Microsoft's markitdown CLI.
|
|
5
|
+
* Supports PDF, DOCX, XLSX, PPTX, HTML, CSV, JSON, XML, EPUB, and more.
|
|
6
|
+
*
|
|
7
|
+
* Image extraction:
|
|
8
|
+
* - PDF: uses pdfimages (poppler-utils)
|
|
9
|
+
* - DOCX/ODT/EPUB: uses pandoc --extract-media
|
|
10
|
+
*
|
|
11
|
+
* Extracted images are classified via the image classifier preprocessor.
|
|
12
|
+
* Full content is written to disk; extractedContent contains a structured manifest.
|
|
13
|
+
*/
|
|
14
|
+
import type { Result } from '../../../lib/utils/result.js';
|
|
15
|
+
import type { FileSystem } from '../../../platform/fs.js';
|
|
16
|
+
import type { ProcessRunner } from '../../../platform/process.js';
|
|
17
|
+
import type { FileStore } from '../../../core/file-store/types.js';
|
|
18
|
+
import type { Logger } from '../../../lib/logger/logger.js';
|
|
19
|
+
import type { Preprocessor, PreprocessorContext, PreprocessorRegistry, PreprocessorResult } from '../preprocessor.js';
|
|
20
|
+
export interface MarkitdownPreprocessorConfig {
|
|
21
|
+
registry: PreprocessorRegistry;
|
|
22
|
+
logger: Logger;
|
|
23
|
+
fs: FileSystem;
|
|
24
|
+
process: ProcessRunner;
|
|
25
|
+
}
|
|
26
|
+
export declare class MarkitdownPreprocessor implements Preprocessor {
|
|
27
|
+
readonly name = "markitdown";
|
|
28
|
+
readonly supportedMimeTypes: string[];
|
|
29
|
+
private readonly registry;
|
|
30
|
+
private readonly logger;
|
|
31
|
+
private readonly fs;
|
|
32
|
+
private readonly exec;
|
|
33
|
+
constructor(config: MarkitdownPreprocessorConfig);
|
|
34
|
+
process(filePath: string, mimeType: string, ctx: PreprocessorContext): Promise<Result<PreprocessorResult, Error>>;
|
|
35
|
+
private extractImagesWithPandoc;
|
|
36
|
+
private extractImagesWithPdfimages;
|
|
37
|
+
}
|
|
38
|
+
export declare function guessImageMime(filename: string): string;
|
|
39
|
+
export declare function classifyExtractedImages(imageStore: FileStore, relativePrefix: string, ctx: PreprocessorContext, registry: PreprocessorRegistry, logger: Logger): Promise<Array<{
|
|
40
|
+
relativePath: string;
|
|
41
|
+
description: string;
|
|
42
|
+
}>>;
|
|
43
|
+
//# sourceMappingURL=markitdown-preprocessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markitdown-preprocessor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/uploads/preprocessors/markitdown-preprocessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;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,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AA2CrH,MAAM,WAAW,4BAA4B;IAC5C,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,EAAE,UAAU,CAAA;IACd,OAAO,EAAE,aAAa,CAAA;CACtB;AAED,qBAAa,sBAAuB,YAAW,YAAY;IAC1D,QAAQ,CAAC,IAAI,gBAAe;IAC5B,QAAQ,CAAC,kBAAkB,WAAuB;IAElD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA8E;gBAEvF,MAAM,EAAE,4BAA4B;IAO1C,OAAO,CACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,mBAAmB,GACtB,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;YA2D/B,uBAAuB;YA+BvB,0BAA0B;CAiBxC;AAoBD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,wBAAsB,uBAAuB,CAC5C,UAAU,EAAE,SAAS,EACrB,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,mBAAmB,EACxB,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,KAAK,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAgC/D"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZIP Preprocessor
|
|
3
|
+
*
|
|
4
|
+
* Extracts ZIP contents via `unzip` CLI and recursively preprocesses files.
|
|
5
|
+
* Each extracted file is processed by its matching preprocessor (markitdown for
|
|
6
|
+
* documents, image classifier for images, nested zip for archives).
|
|
7
|
+
* Full manifest is written to disk; extractedContent contains a structured summary.
|
|
8
|
+
*/
|
|
9
|
+
import type { Result } from '../../../lib/utils/result.js';
|
|
10
|
+
import type { ProcessRunner } from '../../../platform/process.js';
|
|
11
|
+
import type { Logger } from '../../../lib/logger/logger.js';
|
|
12
|
+
import type { Preprocessor, PreprocessorContext, PreprocessorRegistry, PreprocessorResult } from '../preprocessor.js';
|
|
13
|
+
export interface ZipPreprocessorConfig {
|
|
14
|
+
registry: PreprocessorRegistry;
|
|
15
|
+
logger: Logger;
|
|
16
|
+
process: ProcessRunner;
|
|
17
|
+
depth?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class ZipPreprocessor implements Preprocessor {
|
|
20
|
+
readonly name = "zip";
|
|
21
|
+
readonly supportedMimeTypes: string[];
|
|
22
|
+
private readonly registry;
|
|
23
|
+
private readonly logger;
|
|
24
|
+
private readonly processRunner;
|
|
25
|
+
private readonly exec;
|
|
26
|
+
private readonly depth;
|
|
27
|
+
constructor(config: ZipPreprocessorConfig);
|
|
28
|
+
process(filePath: string, _mimeType: string, ctx: PreprocessorContext): Promise<Result<PreprocessorResult, Error>>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=zip-preprocessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zip-preprocessor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/uploads/preprocessors/zip-preprocessor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AA4CrH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,aAAa,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,qBAAa,eAAgB,YAAW,YAAY;IACnD,QAAQ,CAAC,IAAI,SAAQ;IACrB,QAAQ,CAAC,kBAAkB,WAAsB;IAEjD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA8E;IACnG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAElB,MAAM,EAAE,qBAAqB;IAQnC,OAAO,CACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,mBAAmB,GACtB,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;CA0H7C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upload domain types and schemas
|
|
3
|
+
*
|
|
4
|
+
* Contains all types related to uploads:
|
|
5
|
+
* - Branded ID type and constructor
|
|
6
|
+
* - Upload metadata types
|
|
7
|
+
* - Zod schemas for validation
|
|
8
|
+
*/
|
|
9
|
+
import z from 'zod/v4';
|
|
10
|
+
import type { SessionId } from '../../core/sessions/schema.js';
|
|
11
|
+
/** UploadId schema - validates any string and brands as UploadId. */
|
|
12
|
+
export declare const uploadIdSchema: z.core.$ZodBranded<z.ZodString, "UploadId", "out">;
|
|
13
|
+
/** Branded UploadId type */
|
|
14
|
+
export type UploadId = z.infer<typeof uploadIdSchema>;
|
|
15
|
+
/** Constructor for UploadId */
|
|
16
|
+
export declare const UploadId: (id: string) => UploadId;
|
|
17
|
+
/** Generate a new UploadId (UUIDv7) */
|
|
18
|
+
export declare const generateUploadId: () => UploadId;
|
|
19
|
+
/**
|
|
20
|
+
* Information about an uploaded file stored on disk.
|
|
21
|
+
*/
|
|
22
|
+
export interface UploadedFile {
|
|
23
|
+
/** Relative path within upload directory */
|
|
24
|
+
filename: string;
|
|
25
|
+
/** Absolute path to the file */
|
|
26
|
+
path: string;
|
|
27
|
+
/** File size in bytes */
|
|
28
|
+
size: number;
|
|
29
|
+
/** MIME type of the file */
|
|
30
|
+
mimeType: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Attachment included with a mailbox message.
|
|
34
|
+
* Represents a user-uploaded file that has been processed.
|
|
35
|
+
*/
|
|
36
|
+
export interface MessageAttachment {
|
|
37
|
+
/** Unique identifier for this upload */
|
|
38
|
+
uploadId: UploadId;
|
|
39
|
+
/** Original filename as uploaded by user */
|
|
40
|
+
filename: string;
|
|
41
|
+
/** MIME type of the original file */
|
|
42
|
+
mimeType: string;
|
|
43
|
+
/** File size in bytes */
|
|
44
|
+
size: number;
|
|
45
|
+
/** Absolute path to the original file */
|
|
46
|
+
path: string;
|
|
47
|
+
/** Text content extracted by pre-processor (image description, PDF text, etc.) */
|
|
48
|
+
extractedContent?: string;
|
|
49
|
+
/** Paths to derived files (extracted images, converted documents, etc.) */
|
|
50
|
+
derivedPaths?: string[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Metadata for an upload stored on disk.
|
|
54
|
+
* Used to track upload status and associate with messages later.
|
|
55
|
+
*/
|
|
56
|
+
export interface UploadMetadata {
|
|
57
|
+
uploadId: UploadId;
|
|
58
|
+
sessionId: SessionId;
|
|
59
|
+
filename: string;
|
|
60
|
+
mimeType: string;
|
|
61
|
+
size: number;
|
|
62
|
+
path: string;
|
|
63
|
+
status: 'processing' | 'ready' | 'failed' | 'deleted';
|
|
64
|
+
extractedContent?: string;
|
|
65
|
+
derivedPaths?: string[];
|
|
66
|
+
createdAt: number;
|
|
67
|
+
completedAt?: number;
|
|
68
|
+
error?: string;
|
|
69
|
+
/** Set when the upload is attached to a message via sendMessage */
|
|
70
|
+
usedInMessageId?: string;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/plugins/uploads/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAM9D,qEAAqE;AACrE,eAAO,MAAM,cAAc,oDAA+B,CAAA;AAE1D,4BAA4B;AAC5B,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAErD,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,GAAI,IAAI,MAAM,KAAG,QAA0B,CAAA;AAEhE,uCAAuC;AACvC,eAAO,MAAM,gBAAgB,QAAO,QAA8B,CAAA;AAUlE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC,wCAAwC;IACxC,QAAQ,EAAE,QAAQ,CAAA;IAClB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAA;IAChB,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,EAAE,SAAS,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAA;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import z4 from 'zod/v4';
|
|
2
|
+
export declare const uploadEvents: import("../../core/events/types").EventsFactory<{
|
|
3
|
+
attachment_uploaded: z4.ZodObject<{
|
|
4
|
+
uploadId: z4.core.$ZodBranded<z4.ZodString, "UploadId", "out">;
|
|
5
|
+
filename: z4.ZodString;
|
|
6
|
+
mimeType: z4.ZodString;
|
|
7
|
+
size: z4.ZodNumber;
|
|
8
|
+
status: z4.ZodEnum<{
|
|
9
|
+
ready: "ready";
|
|
10
|
+
failed: "failed";
|
|
11
|
+
}>;
|
|
12
|
+
extractedContent: z4.ZodOptional<z4.ZodString>;
|
|
13
|
+
derivedPaths: z4.ZodOptional<z4.ZodArray<z4.ZodString>>;
|
|
14
|
+
error: z4.ZodOptional<z4.ZodString>;
|
|
15
|
+
}, z4.core.$strip>;
|
|
16
|
+
attachments_consumed: z4.ZodObject<{
|
|
17
|
+
agentId: z4.ZodString;
|
|
18
|
+
uploadIds: z4.ZodArray<z4.core.$ZodBranded<z4.ZodString, "UploadId", "out">>;
|
|
19
|
+
}, z4.core.$strip>;
|
|
20
|
+
}>;
|
|
21
|
+
export type AttachmentUploadedEvent = (typeof uploadEvents)['Events']['attachment_uploaded'];
|
|
22
|
+
export type AttachmentsConsumedEvent = (typeof uploadEvents)['Events']['attachments_consumed'];
|
|
23
|
+
/** A pending upload tracked in session state */
|
|
24
|
+
export interface PendingUpload {
|
|
25
|
+
uploadId: string;
|
|
26
|
+
filename: string;
|
|
27
|
+
mimeType: string;
|
|
28
|
+
size: number;
|
|
29
|
+
status: 'ready' | 'failed';
|
|
30
|
+
extractedContent?: string;
|
|
31
|
+
derivedPaths?: string[];
|
|
32
|
+
}
|
|
33
|
+
/** Uploads plugin state slice — tracks pending (unconsumed) uploads */
|
|
34
|
+
export interface UploadsState {
|
|
35
|
+
/** Uploads that have been uploaded but not yet consumed by an agent */
|
|
36
|
+
pending: PendingUpload[];
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/plugins/uploads/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,QAAQ,CAAA;AAIvB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;EAiBvB,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAA;AAC5F,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,sBAAsB,CAAC,CAAA;AAE9F,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB;AAED,uEAAuE;AACvE,MAAM,WAAW,YAAY;IAC5B,uEAAuE;IACvE,OAAO,EAAE,aAAa,EAAE,CAAA;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.integration.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/uploads/uploads.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { userChatPlugin, userChatPlugin as userCommunicationPlugin } from './plugin.js';
|
|
2
|
+
export type { UserChatAgentConfig as UserCommunicationAgentConfig, UserChatPresetConfig as UserCommunicationPresetConfig, UserCommunicationMode, } from './plugin.js';
|
|
3
|
+
export type { AskUserInputType, AskUserOption } from './schema.js';
|
|
4
|
+
export { userChatEvents, userChatEvents as userCommunicationEvents } from './plugin.js';
|
|
5
|
+
export type { UserMessageSentEvent, UserQuestionAskedEvent } from './plugin.js';
|
|
6
|
+
export type { AgentChatMessage, AskUserChatMessage, ChatMessage, PendingInboundMessage, UserChatMessage } from './plugin.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/user-chat/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACvF,YAAY,EACX,mBAAmB,IAAI,4BAA4B,EACnD,oBAAoB,IAAI,6BAA6B,EACrD,qBAAqB,GACrB,MAAM,aAAa,CAAA;AAGpB,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,EAAE,cAAc,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACvF,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAG/E,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Chat Plugin - Three-level plugin architecture for user interaction
|
|
3
|
+
*
|
|
4
|
+
* Level 1 (Preset): UserChatPresetConfig with session-wide enable flag
|
|
5
|
+
* Level 2 (Session): Plugin methods (askQuestion, tellUser, getMessages, sendMessage, answerQuestion)
|
|
6
|
+
* Level 3 (Agent): Agent-specific configuration and tools
|
|
7
|
+
*
|
|
8
|
+
* Owns the `messages` state slice (chat messages for the UI)
|
|
9
|
+
* and the full user message lifecycle via dequeue.
|
|
10
|
+
*/
|
|
11
|
+
import z from "zod/v4";
|
|
12
|
+
import { type AgentId } from "../../core/agents/schema.js";
|
|
13
|
+
import { type AskUserInputType, ChatMessageId } from "./schema.js";
|
|
14
|
+
export declare const userChatEvents: import("../../core/events/types.js").EventsFactory<{
|
|
15
|
+
user_question_asked: z.ZodObject<{
|
|
16
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
17
|
+
messageId: z.core.$ZodBranded<z.ZodString, "ChatMessageId", "out">;
|
|
18
|
+
question: z.ZodString;
|
|
19
|
+
inputType: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<"text">;
|
|
21
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
22
|
+
multiline: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"single_choice">;
|
|
25
|
+
options: z.ZodArray<z.ZodObject<{
|
|
26
|
+
value: z.ZodString;
|
|
27
|
+
label: z.ZodString;
|
|
28
|
+
description: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
+
type: z.ZodLiteral<"multi_choice">;
|
|
32
|
+
options: z.ZodArray<z.ZodObject<{
|
|
33
|
+
value: z.ZodString;
|
|
34
|
+
label: z.ZodString;
|
|
35
|
+
description: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
minSelect: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
maxSelect: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
type: z.ZodLiteral<"rating">;
|
|
41
|
+
min: z.ZodNumber;
|
|
42
|
+
max: z.ZodNumber;
|
|
43
|
+
labels: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
min: z.ZodOptional<z.ZodString>;
|
|
45
|
+
max: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
type: z.ZodLiteral<"confirm">;
|
|
49
|
+
confirmLabel: z.ZodOptional<z.ZodString>;
|
|
50
|
+
cancelLabel: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>], "type">;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
user_message_sent: z.ZodObject<{
|
|
54
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
55
|
+
messageId: z.core.$ZodBranded<z.ZodString, "ChatMessageId", "out">;
|
|
56
|
+
message: z.ZodString;
|
|
57
|
+
format: z.ZodEnum<{
|
|
58
|
+
text: "text";
|
|
59
|
+
markdown: "markdown";
|
|
60
|
+
}>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
user_chat_message_received: z.ZodObject<{
|
|
63
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
64
|
+
messageId: z.core.$ZodBranded<z.ZodString, "ChatMessageId", "out">;
|
|
65
|
+
content: z.ZodString;
|
|
66
|
+
timestamp: z.ZodNumber;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
user_chat_answer_received: z.ZodObject<{
|
|
69
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
70
|
+
messageId: z.core.$ZodBranded<z.ZodString, "ChatMessageId", "out">;
|
|
71
|
+
questionId: z.core.$ZodBranded<z.ZodString, "ChatMessageId", "out">;
|
|
72
|
+
answerValue: z.ZodUnknown;
|
|
73
|
+
timestamp: z.ZodNumber;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
user_chat_messages_consumed: z.ZodObject<{
|
|
76
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
77
|
+
messageIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ChatMessageId", "out">>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
}>;
|
|
80
|
+
export type UserQuestionAskedEvent = (typeof userChatEvents)["Events"]["user_question_asked"];
|
|
81
|
+
export type UserMessageSentEvent = (typeof userChatEvents)["Events"]["user_message_sent"];
|
|
82
|
+
export type UserChatMessageReceivedEvent = (typeof userChatEvents)["Events"]["user_chat_message_received"];
|
|
83
|
+
export type UserChatAnswerReceivedEvent = (typeof userChatEvents)["Events"]["user_chat_answer_received"];
|
|
84
|
+
export type UserChatMessagesConsumedEvent = (typeof userChatEvents)["Events"]["user_chat_messages_consumed"];
|
|
85
|
+
export { userChatEvents as userCommunicationEvents };
|
|
86
|
+
export interface UserChatMessage {
|
|
87
|
+
type: "user_message";
|
|
88
|
+
messageId: ChatMessageId;
|
|
89
|
+
content: string;
|
|
90
|
+
timestamp: number;
|
|
91
|
+
}
|
|
92
|
+
export interface AgentChatMessage {
|
|
93
|
+
type: "agent_message";
|
|
94
|
+
messageId: ChatMessageId;
|
|
95
|
+
content: string;
|
|
96
|
+
format: "text" | "markdown";
|
|
97
|
+
timestamp: number;
|
|
98
|
+
}
|
|
99
|
+
export interface AskUserChatMessage {
|
|
100
|
+
type: "ask_user";
|
|
101
|
+
questionId: ChatMessageId;
|
|
102
|
+
question: string;
|
|
103
|
+
inputType: AskUserInputType;
|
|
104
|
+
answered: boolean;
|
|
105
|
+
answer?: unknown;
|
|
106
|
+
timestamp: number;
|
|
107
|
+
}
|
|
108
|
+
export type ChatMessage = UserChatMessage | AgentChatMessage | AskUserChatMessage;
|
|
109
|
+
export interface PendingInboundMessage {
|
|
110
|
+
messageId: ChatMessageId;
|
|
111
|
+
agentId: AgentId;
|
|
112
|
+
content: string;
|
|
113
|
+
timestamp: number;
|
|
114
|
+
consumed: boolean;
|
|
115
|
+
/** For answers: the question's message ID */
|
|
116
|
+
questionId?: ChatMessageId;
|
|
117
|
+
/** The answer value, only present for answers */
|
|
118
|
+
answerValue?: unknown;
|
|
119
|
+
}
|
|
120
|
+
export interface UserChatState {
|
|
121
|
+
messages: ChatMessage[];
|
|
122
|
+
counter: number;
|
|
123
|
+
pendingInbound: PendingInboundMessage[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Session-wide user Chat configuration.
|
|
127
|
+
*/
|
|
128
|
+
export interface UserChatPresetConfig {
|
|
129
|
+
/** Whether user Chat is enabled by default (default: true) */
|
|
130
|
+
enabled?: boolean;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* User communication mode for agents.
|
|
134
|
+
* - 'tool': Use tell_user/ask_user tools only (default)
|
|
135
|
+
* - 'xml': Use <user> tags in response content
|
|
136
|
+
* - 'both': Support both tools and <user> tags
|
|
137
|
+
*/
|
|
138
|
+
export type UserCommunicationMode = "tool" | "xml" | "both";
|
|
139
|
+
/**
|
|
140
|
+
* Agent-specific user Chat configuration.
|
|
141
|
+
*/
|
|
142
|
+
export interface UserChatAgentConfig {
|
|
143
|
+
/** Whether user Chat is enabled for this agent (default: true for entry agent) */
|
|
144
|
+
enabled?: boolean;
|
|
145
|
+
/** User communication mode. Default: 'tool' */
|
|
146
|
+
userCommunication?: UserCommunicationMode;
|
|
147
|
+
}
|
|
148
|
+
export declare const userChatPlugin: import("../../core/plugins/plugin-builder.js").PluginDefinition<"user-chat", UserChatPresetConfig, UserChatAgentConfig, {}, Record<"askQuestion", {
|
|
149
|
+
input: {
|
|
150
|
+
agentId: string & z.core.$brand<"AgentId">;
|
|
151
|
+
question: string;
|
|
152
|
+
inputType: {
|
|
153
|
+
type: "text";
|
|
154
|
+
placeholder?: string | undefined;
|
|
155
|
+
multiline?: boolean | undefined;
|
|
156
|
+
} | {
|
|
157
|
+
type: "single_choice";
|
|
158
|
+
options: {
|
|
159
|
+
value: string;
|
|
160
|
+
label: string;
|
|
161
|
+
description?: string | undefined;
|
|
162
|
+
}[];
|
|
163
|
+
} | {
|
|
164
|
+
type: "multi_choice";
|
|
165
|
+
options: {
|
|
166
|
+
value: string;
|
|
167
|
+
label: string;
|
|
168
|
+
description?: string | undefined;
|
|
169
|
+
}[];
|
|
170
|
+
minSelect?: number | undefined;
|
|
171
|
+
maxSelect?: number | undefined;
|
|
172
|
+
} | {
|
|
173
|
+
type: "rating";
|
|
174
|
+
min: number;
|
|
175
|
+
max: number;
|
|
176
|
+
labels?: {
|
|
177
|
+
min?: string | undefined;
|
|
178
|
+
max?: string | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
} | {
|
|
181
|
+
type: "confirm";
|
|
182
|
+
confirmLabel?: string | undefined;
|
|
183
|
+
cancelLabel?: string | undefined;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
output: {
|
|
187
|
+
messageId: string;
|
|
188
|
+
};
|
|
189
|
+
}> & Record<"tellUser", {
|
|
190
|
+
input: {
|
|
191
|
+
agentId: string & z.core.$brand<"AgentId">;
|
|
192
|
+
message: string;
|
|
193
|
+
format: "text" | "markdown";
|
|
194
|
+
};
|
|
195
|
+
output: {
|
|
196
|
+
messageId: string;
|
|
197
|
+
};
|
|
198
|
+
}> & Record<"sendMessage", {
|
|
199
|
+
input: {
|
|
200
|
+
content: string;
|
|
201
|
+
agentId?: (string & z.core.$brand<"AgentId">) | undefined;
|
|
202
|
+
};
|
|
203
|
+
output: {
|
|
204
|
+
messageId: string & z.core.$brand<"ChatMessageId">;
|
|
205
|
+
};
|
|
206
|
+
}> & Record<"answerQuestion", {
|
|
207
|
+
input: {
|
|
208
|
+
agentId: string & z.core.$brand<"AgentId">;
|
|
209
|
+
questionId: string & z.core.$brand<"ChatMessageId">;
|
|
210
|
+
answer: unknown;
|
|
211
|
+
};
|
|
212
|
+
output: {};
|
|
213
|
+
}> & Record<"getMessages", {
|
|
214
|
+
input: {
|
|
215
|
+
sessionId: string;
|
|
216
|
+
};
|
|
217
|
+
output: {
|
|
218
|
+
messages: unknown[];
|
|
219
|
+
};
|
|
220
|
+
}>>;
|
|
221
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/user-chat/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,yBAAyB,CAAC;AActE,OAAO,EACN,KAAK,gBAAgB,EAErB,aAAa,EAGb,MAAM,aAAa,CAAC;AAMrB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCzB,CAAC;AAEH,MAAM,MAAM,sBAAsB,GACjC,CAAC,OAAO,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAC;AAC1D,MAAM,MAAM,oBAAoB,GAC/B,CAAC,OAAO,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACxD,MAAM,MAAM,4BAA4B,GACvC,CAAC,OAAO,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,4BAA4B,CAAC,CAAC;AACjE,MAAM,MAAM,2BAA2B,GACtC,CAAC,OAAO,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,2BAA2B,CAAC,CAAC;AAChE,MAAM,MAAM,6BAA6B,GACxC,CAAC,OAAO,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,6BAA6B,CAAC,CAAC;AAGlE,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,CAAC;AAMrD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,aAAa,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,WAAW,GACpB,eAAe,GACf,gBAAgB,GAChB,kBAAkB,CAAC;AAMtB,MAAM,WAAW,qBAAqB;IACrC,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAMD,MAAM,WAAW,aAAa;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,qBAAqB,EAAE,CAAC;CACxC;AAMD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;CAC1C;AAsID,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkalB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User communication prompt sections for system prompt composition.
|
|
3
|
+
* Used by agents that communicate directly with users (entry + communicator roles).
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Mandatory user communication instructions.
|
|
7
|
+
*/
|
|
8
|
+
export declare const USER_COMMUNICATION_SECTION = "## User Communication (MANDATORY)\n\n**Every time you receive a user message, you MUST respond to the user via `tell_user` or `ask_user` before stopping.** The user is waiting for a response and will see nothing unless you explicitly call a communication tool.\n\n- **Direct response**: If you can answer immediately, call `tell_user`.\n- **Delegating work**: If you spawn child agents or start background work, call `tell_user` to inform the user what is happening (e.g. \"I'm starting work on your request\u2026\"). Once the work is done, call `tell_user` again with the results.\n- **Need more info**: If you need clarification, call `ask_user`.\n\n**Never stop without calling `tell_user` or `ask_user`.** Silent processing leaves the user with no feedback.";
|
|
9
|
+
/**
|
|
10
|
+
* Structured input preferences for asking questions.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ASKING_QUESTIONS_SECTION = "## Asking Users Questions\n\nWhen you need to ask the user multiple questions, **call `ask_user` multiple times in a single response** rather than asking one question at a time. The user will receive all questions as a single questionnaire, which is much better UX than being asked one-by-one.\n\nOnly ask questions sequentially when a later question depends on the answer to an earlier one.\n\n### Prefer Structured Input Types\n\nWhen asking questions, prefer `single_choice`, `multi_choice`, or `confirm` over free-text `text` input whenever the possible answers are known. Only use `text` when the answer is truly open-ended. Structured inputs are faster for users and produce more consistent answers.";
|
|
13
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/plugins/user-chat/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B,8vBAQ2E,CAAA;AAElH;;GAEG;AACH,eAAO,MAAM,wBAAwB,ssBAQuP,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
export declare const chatMessageIdSchema: z.core.$ZodBranded<z.ZodString, "ChatMessageId", "out">;
|
|
3
|
+
export type ChatMessageId = z.infer<typeof chatMessageIdSchema>;
|
|
4
|
+
export declare const ChatMessageId: (id: string) => ChatMessageId;
|
|
5
|
+
export declare const generateChatMessageId: (seq: number) => ChatMessageId;
|
|
6
|
+
/**
|
|
7
|
+
* Option for ask_user single/multi choice input types.
|
|
8
|
+
*/
|
|
9
|
+
export type AskUserOption = {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Input type for ask_user tool - defines how the user should respond.
|
|
16
|
+
*/
|
|
17
|
+
export type AskUserInputType = {
|
|
18
|
+
type: 'text';
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
multiline?: boolean;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'single_choice';
|
|
23
|
+
options: AskUserOption[];
|
|
24
|
+
} | {
|
|
25
|
+
type: 'multi_choice';
|
|
26
|
+
options: AskUserOption[];
|
|
27
|
+
minSelect?: number;
|
|
28
|
+
maxSelect?: number;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'rating';
|
|
31
|
+
min: number;
|
|
32
|
+
max: number;
|
|
33
|
+
labels?: {
|
|
34
|
+
min?: string;
|
|
35
|
+
max?: string;
|
|
36
|
+
};
|
|
37
|
+
} | {
|
|
38
|
+
type: 'confirm';
|
|
39
|
+
confirmLabel?: string;
|
|
40
|
+
cancelLabel?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const askUserOptionSchema: z.ZodObject<{
|
|
43
|
+
value: z.ZodString;
|
|
44
|
+
label: z.ZodString;
|
|
45
|
+
description: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export declare const askUserInputTypeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
48
|
+
type: z.ZodLiteral<"text">;
|
|
49
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
50
|
+
multiline: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
+
type: z.ZodLiteral<"single_choice">;
|
|
53
|
+
options: z.ZodArray<z.ZodObject<{
|
|
54
|
+
value: z.ZodString;
|
|
55
|
+
label: z.ZodString;
|
|
56
|
+
description: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"multi_choice">;
|
|
60
|
+
options: z.ZodArray<z.ZodObject<{
|
|
61
|
+
value: z.ZodString;
|
|
62
|
+
label: z.ZodString;
|
|
63
|
+
description: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
minSelect: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
maxSelect: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"rating">;
|
|
69
|
+
min: z.ZodNumber;
|
|
70
|
+
max: z.ZodNumber;
|
|
71
|
+
labels: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
min: z.ZodOptional<z.ZodString>;
|
|
73
|
+
max: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
+
type: z.ZodLiteral<"confirm">;
|
|
77
|
+
confirmLabel: z.ZodOptional<z.ZodString>;
|
|
78
|
+
cancelLabel: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>], "type">;
|
|
80
|
+
export type AskUserInputTypeSchema = z.infer<typeof askUserInputTypeSchema>;
|
|
81
|
+
export type AskUserOptionInput = z.infer<typeof askUserOptionSchema>;
|
|
82
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/plugins/user-chat/schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AAEtB,eAAO,MAAM,mBAAmB,yDAAoC,CAAA;AAEpE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,eAAO,MAAM,aAAa,GAAI,IAAI,MAAM,KAAG,aAAoC,CAAA;AAE/E,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,KAAG,aAAyC,CAAA;AAE7F;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,aAAa,EAAE,CAAA;CAAE,GACnD;IACD,IAAI,EAAE,cAAc,CAAA;IACpB,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB,GACC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GACrF;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAMnE,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAgCjC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAC3E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-chat.integration.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/user-chat/user-chat.integration.test.ts"],"names":[],"mappings":""}
|