@roj-ai/sdk 0.1.36 → 0.2.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 +420 -26
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +55 -24
- package/dist/bootstrap.js.map +1 -1
- package/dist/bun-platform/fs.d.ts.map +1 -1
- package/dist/bun-platform/fs.js +1 -0
- package/dist/bun-platform/fs.js.map +1 -1
- package/dist/bun-platform/index.d.ts +4 -1
- package/dist/bun-platform/index.d.ts.map +1 -1
- package/dist/bun-platform/index.js +7 -1
- package/dist/bun-platform/index.js.map +1 -1
- package/dist/bun-platform/server-lifecycle.d.ts +30 -0
- package/dist/bun-platform/server-lifecycle.d.ts.map +1 -0
- package/dist/bun-platform/server-lifecycle.js +182 -0
- package/dist/bun-platform/server-lifecycle.js.map +1 -0
- package/dist/bun-platform/shell.d.ts +33 -0
- package/dist/bun-platform/shell.d.ts.map +1 -0
- package/dist/bun-platform/shell.js +322 -0
- package/dist/bun-platform/shell.js.map +1 -0
- package/dist/config.d.ts +34 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +97 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agents/agent.d.ts +42 -7
- package/dist/core/agents/agent.d.ts.map +1 -1
- package/dist/core/agents/agent.js +202 -87
- package/dist/core/agents/agent.js.map +1 -1
- package/dist/core/agents/config.d.ts +8 -1
- package/dist/core/agents/config.d.ts.map +1 -1
- package/dist/core/agents/config.js +5 -1
- package/dist/core/agents/config.js.map +1 -1
- package/dist/core/agents/retry.d.ts +1 -1
- package/dist/core/agents/retry.d.ts.map +1 -1
- package/dist/core/agents/retry.js +14 -16
- package/dist/core/agents/retry.js.map +1 -1
- package/dist/core/agents/state.d.ts +3 -1
- package/dist/core/agents/state.d.ts.map +1 -1
- package/dist/core/agents/state.js +1 -1
- package/dist/core/agents/state.js.map +1 -1
- package/dist/core/context/state.d.ts +3 -3
- package/dist/core/context/state.js +2 -2
- package/dist/core/events/base-event-store.d.ts.map +1 -1
- package/dist/core/events/base-event-store.js +22 -14
- package/dist/core/events/base-event-store.js.map +1 -1
- package/dist/core/events/file.d.ts +39 -1
- package/dist/core/events/file.d.ts.map +1 -1
- package/dist/core/events/file.js +159 -20
- package/dist/core/events/file.js.map +1 -1
- package/dist/core/events/types.d.ts +1 -1
- package/dist/core/file-store/containment.d.ts +19 -0
- package/dist/core/file-store/containment.d.ts.map +1 -0
- package/dist/core/file-store/containment.js +62 -0
- package/dist/core/file-store/containment.js.map +1 -0
- package/dist/core/file-store/file-store.d.ts +22 -2
- package/dist/core/file-store/file-store.d.ts.map +1 -1
- package/dist/core/file-store/file-store.js +88 -20
- package/dist/core/file-store/file-store.js.map +1 -1
- package/dist/core/file-store/types.d.ts +13 -1
- package/dist/core/file-store/types.d.ts.map +1 -1
- package/dist/core/image/image-processor.d.ts.map +1 -1
- package/dist/core/image/image-processor.js +3 -1
- package/dist/core/image/image-processor.js.map +1 -1
- package/dist/core/image/types.d.ts +2 -0
- package/dist/core/image/types.d.ts.map +1 -1
- package/dist/core/image/vips-resizer.d.ts.map +1 -1
- package/dist/core/image/vips-resizer.js +81 -33
- package/dist/core/image/vips-resizer.js.map +1 -1
- package/dist/core/llm/anthropic.d.ts +0 -1
- package/dist/core/llm/anthropic.d.ts.map +1 -1
- package/dist/core/llm/anthropic.js +58 -72
- package/dist/core/llm/anthropic.js.map +1 -1
- package/dist/core/llm/logger.d.ts +14 -2
- package/dist/core/llm/logger.d.ts.map +1 -1
- package/dist/core/llm/logger.js +161 -36
- package/dist/core/llm/logger.js.map +1 -1
- package/dist/core/llm/openrouter.d.ts +0 -1
- package/dist/core/llm/openrouter.d.ts.map +1 -1
- package/dist/core/llm/openrouter.js +53 -66
- package/dist/core/llm/openrouter.js.map +1 -1
- package/dist/core/llm/provider-request.d.ts +10 -0
- package/dist/core/llm/provider-request.d.ts.map +1 -0
- package/dist/core/llm/provider-request.js +41 -0
- package/dist/core/llm/provider-request.js.map +1 -0
- package/dist/core/llm/provider.d.ts +11 -0
- package/dist/core/llm/provider.d.ts.map +1 -1
- package/dist/core/llm/provider.js +26 -0
- package/dist/core/llm/provider.js.map +1 -1
- package/dist/core/llm/state.d.ts +2 -2
- package/dist/core/llm/state.js +4 -4
- package/dist/core/plugins/plugin-builder.d.ts +57 -3
- package/dist/core/plugins/plugin-builder.d.ts.map +1 -1
- package/dist/core/plugins/plugin-builder.js +68 -14
- package/dist/core/plugins/plugin-builder.js.map +1 -1
- package/dist/core/preset/preset-builder.d.ts +3 -2
- package/dist/core/preset/preset-builder.d.ts.map +1 -1
- package/dist/core/preset/preset-builder.js +7 -16
- package/dist/core/preset/preset-builder.js.map +1 -1
- package/dist/core/sessions/context.d.ts +23 -5
- package/dist/core/sessions/context.d.ts.map +1 -1
- package/dist/core/sessions/runtime-activity.d.ts +33 -0
- package/dist/core/sessions/runtime-activity.d.ts.map +1 -0
- package/dist/core/sessions/runtime-activity.js +55 -0
- package/dist/core/sessions/runtime-activity.js.map +1 -0
- package/dist/core/sessions/schema.d.ts +23 -2
- package/dist/core/sessions/schema.d.ts.map +1 -1
- package/dist/core/sessions/schema.js +24 -3
- package/dist/core/sessions/schema.js.map +1 -1
- package/dist/core/sessions/session-manager.d.ts +83 -6
- package/dist/core/sessions/session-manager.d.ts.map +1 -1
- package/dist/core/sessions/session-manager.js +517 -118
- package/dist/core/sessions/session-manager.js.map +1 -1
- package/dist/core/sessions/session-store.d.ts +18 -0
- package/dist/core/sessions/session-store.d.ts.map +1 -1
- package/dist/core/sessions/session-store.js +33 -0
- package/dist/core/sessions/session-store.js.map +1 -1
- package/dist/core/sessions/session.d.ts +42 -6
- package/dist/core/sessions/session.d.ts.map +1 -1
- package/dist/core/sessions/session.js +176 -44
- package/dist/core/sessions/session.js.map +1 -1
- package/dist/core/sessions/state.d.ts +10 -1
- package/dist/core/sessions/state.d.ts.map +1 -1
- package/dist/core/sessions/state.js +11 -1
- package/dist/core/sessions/state.js.map +1 -1
- package/dist/core/system.d.ts +9 -0
- package/dist/core/system.d.ts.map +1 -1
- package/dist/core/system.js +4 -1
- package/dist/core/system.js.map +1 -1
- package/dist/core/tools/executor.d.ts +1 -1
- package/dist/core/wake-key.d.ts +34 -0
- package/dist/core/wake-key.d.ts.map +1 -0
- package/dist/core/wake-key.js +51 -0
- package/dist/core/wake-key.js.map +1 -0
- package/dist/index.d.ts +25 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/archive/archive-inspection.d.ts +48 -0
- package/dist/lib/archive/archive-inspection.d.ts.map +1 -0
- package/dist/lib/archive/archive-inspection.fixtures.d.ts +7 -0
- package/dist/lib/archive/archive-inspection.fixtures.d.ts.map +1 -0
- package/dist/lib/archive/archive-inspection.fixtures.js +134 -0
- package/dist/lib/archive/archive-inspection.fixtures.js.map +1 -0
- package/dist/lib/archive/archive-inspection.js +253 -0
- package/dist/lib/archive/archive-inspection.js.map +1 -0
- package/dist/lib/archive/index.d.ts +3 -0
- package/dist/lib/archive/index.d.ts.map +1 -0
- package/dist/lib/archive/index.js +2 -0
- package/dist/lib/archive/index.js.map +1 -0
- package/dist/lib/logger/console.d.ts +5 -12
- package/dist/lib/logger/console.d.ts.map +1 -1
- package/dist/lib/logger/console.js +5 -47
- package/dist/lib/logger/console.js.map +1 -1
- package/dist/lib/logger/file.d.ts +8 -11
- package/dist/lib/logger/file.d.ts.map +1 -1
- package/dist/lib/logger/file.js +26 -37
- package/dist/lib/logger/file.js.map +1 -1
- package/dist/lib/logger/index.d.ts +3 -1
- package/dist/lib/logger/index.d.ts.map +1 -1
- package/dist/lib/logger/index.js +3 -1
- package/dist/lib/logger/index.js.map +1 -1
- package/dist/lib/logger/jsonl.d.ts +21 -0
- package/dist/lib/logger/jsonl.d.ts.map +1 -0
- package/dist/lib/logger/jsonl.js +29 -0
- package/dist/lib/logger/jsonl.js.map +1 -0
- package/dist/lib/logger/logger.d.ts +22 -0
- package/dist/lib/logger/logger.d.ts.map +1 -1
- package/dist/lib/logger/logger.js +37 -0
- package/dist/lib/logger/logger.js.map +1 -1
- package/dist/lib/logger/session-log.d.ts +21 -0
- package/dist/lib/logger/session-log.d.ts.map +1 -0
- package/dist/lib/logger/session-log.js +37 -0
- package/dist/lib/logger/session-log.js.map +1 -0
- package/dist/lib/utils/concurrency.d.ts +1 -1
- package/dist/lib/utils/concurrency.d.ts.map +1 -1
- package/dist/lib/utils/concurrency.js +30 -7
- package/dist/lib/utils/concurrency.js.map +1 -1
- package/dist/lib/utils/fs-batch.d.ts +17 -0
- package/dist/lib/utils/fs-batch.d.ts.map +1 -0
- package/dist/lib/utils/fs-batch.js +38 -0
- package/dist/lib/utils/fs-batch.js.map +1 -0
- package/dist/lib/utils/result.d.ts +7 -22
- package/dist/lib/utils/result.d.ts.map +1 -1
- package/dist/lib/utils/result.js +6 -17
- package/dist/lib/utils/result.js.map +1 -1
- package/dist/lib/utils/sleep.d.ts +10 -0
- package/dist/lib/utils/sleep.d.ts.map +1 -0
- package/dist/lib/utils/sleep.js +26 -0
- package/dist/lib/utils/sleep.js.map +1 -0
- package/dist/platform/fs-revision.d.ts +21 -0
- package/dist/platform/fs-revision.d.ts.map +1 -0
- package/dist/platform/fs-revision.js +9 -0
- package/dist/platform/fs-revision.js.map +1 -0
- package/dist/platform/fs.d.ts +104 -1
- package/dist/platform/fs.d.ts.map +1 -1
- package/dist/platform/git.d.ts +59 -0
- package/dist/platform/git.d.ts.map +1 -0
- package/dist/platform/git.js +8 -0
- package/dist/platform/git.js.map +1 -0
- package/dist/platform/index.d.ts +40 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/llm-call-log.d.ts +80 -0
- package/dist/platform/llm-call-log.d.ts.map +1 -0
- package/dist/platform/llm-call-log.js +12 -0
- package/dist/platform/llm-call-log.js.map +1 -0
- package/dist/platform/scheduler.d.ts +32 -0
- package/dist/platform/scheduler.d.ts.map +1 -0
- package/dist/platform/scheduler.js +46 -0
- package/dist/platform/scheduler.js.map +1 -0
- package/dist/platform/session-log.d.ts +36 -0
- package/dist/platform/session-log.d.ts.map +1 -0
- package/dist/platform/session-log.js +12 -0
- package/dist/platform/session-log.js.map +1 -0
- package/dist/platform/shell.d.ts +83 -0
- package/dist/platform/shell.d.ts.map +1 -0
- package/dist/platform/shell.js +13 -0
- package/dist/platform/shell.js.map +1 -0
- package/dist/plugins/agent-status/plugin.d.ts.map +1 -1
- package/dist/plugins/agent-status/plugin.js +1 -0
- package/dist/plugins/agent-status/plugin.js.map +1 -1
- package/dist/plugins/agents/plugin.d.ts.map +1 -1
- package/dist/plugins/agents/plugin.js +129 -62
- package/dist/plugins/agents/plugin.js.map +1 -1
- package/dist/plugins/filesystem/listing.d.ts +3 -0
- package/dist/plugins/filesystem/listing.d.ts.map +1 -1
- package/dist/plugins/filesystem/listing.js +66 -10
- package/dist/plugins/filesystem/listing.js.map +1 -1
- package/dist/plugins/filesystem/plugin.d.ts.map +1 -1
- package/dist/plugins/filesystem/plugin.js +8 -6
- package/dist/plugins/filesystem/plugin.js.map +1 -1
- package/dist/plugins/git-status/index.d.ts +1 -0
- package/dist/plugins/git-status/index.d.ts.map +1 -1
- package/dist/plugins/git-status/plugin.d.ts +38 -7
- package/dist/plugins/git-status/plugin.d.ts.map +1 -1
- package/dist/plugins/git-status/plugin.js +169 -64
- package/dist/plugins/git-status/plugin.js.map +1 -1
- package/dist/plugins/llm-debug/plugin.d.ts.map +1 -1
- package/dist/plugins/llm-debug/plugin.js +1 -0
- package/dist/plugins/llm-debug/plugin.js.map +1 -1
- package/dist/plugins/logs/plugin.d.ts +1 -4
- package/dist/plugins/logs/plugin.d.ts.map +1 -1
- package/dist/plugins/logs/plugin.js +7 -0
- package/dist/plugins/logs/plugin.js.map +1 -1
- package/dist/plugins/mailbox/helpers.d.ts +2 -2
- package/dist/plugins/mailbox/helpers.js +1 -1
- package/dist/plugins/mailbox/plugin.d.ts.map +1 -1
- package/dist/plugins/mailbox/plugin.js +38 -43
- package/dist/plugins/mailbox/plugin.js.map +1 -1
- package/dist/plugins/mailbox/query.d.ts +7 -2
- package/dist/plugins/mailbox/query.d.ts.map +1 -1
- package/dist/plugins/mailbox/query.js +14 -7
- package/dist/plugins/mailbox/query.js.map +1 -1
- package/dist/plugins/mailbox/state.d.ts +5 -4
- package/dist/plugins/mailbox/state.d.ts.map +1 -1
- package/dist/plugins/mailbox/state.js +6 -5
- package/dist/plugins/mailbox/state.js.map +1 -1
- package/dist/plugins/resources/filename.d.ts +4 -0
- package/dist/plugins/resources/filename.d.ts.map +1 -0
- package/dist/plugins/resources/filename.js +18 -0
- package/dist/plugins/resources/filename.js.map +1 -0
- package/dist/plugins/resources/plugin.d.ts +3 -0
- package/dist/plugins/resources/plugin.d.ts.map +1 -1
- package/dist/plugins/resources/plugin.js +97 -60
- package/dist/plugins/resources/plugin.js.map +1 -1
- package/dist/plugins/resources/state.d.ts +1 -1
- package/dist/plugins/resources/state.js +1 -1
- package/dist/plugins/result-eviction/plugin.d.ts.map +1 -1
- package/dist/plugins/result-eviction/plugin.js +6 -1
- package/dist/plugins/result-eviction/plugin.js.map +1 -1
- package/dist/plugins/services/plugin.d.ts +4 -1
- package/dist/plugins/services/plugin.d.ts.map +1 -1
- package/dist/plugins/services/plugin.js +251 -100
- package/dist/plugins/services/plugin.js.map +1 -1
- package/dist/plugins/services/prompt.d.ts.map +1 -1
- package/dist/plugins/services/prompt.js +1 -4
- package/dist/plugins/services/prompt.js.map +1 -1
- package/dist/plugins/services/schema.d.ts +15 -5
- package/dist/plugins/services/schema.d.ts.map +1 -1
- package/dist/plugins/services/service.d.ts +100 -18
- package/dist/plugins/services/service.d.ts.map +1 -1
- package/dist/plugins/services/service.js +680 -230
- package/dist/plugins/services/service.js.map +1 -1
- package/dist/plugins/session-lifecycle/plugin.d.ts +21 -1
- package/dist/plugins/session-lifecycle/plugin.d.ts.map +1 -1
- package/dist/plugins/session-lifecycle/plugin.js +53 -40
- package/dist/plugins/session-lifecycle/plugin.js.map +1 -1
- package/dist/plugins/session-state/plugin.d.ts +21 -13
- package/dist/plugins/session-state/plugin.d.ts.map +1 -1
- package/dist/plugins/session-state/plugin.js +214 -79
- package/dist/plugins/session-state/plugin.js.map +1 -1
- package/dist/plugins/session-stats/plugin.d.ts.map +1 -1
- package/dist/plugins/session-stats/plugin.js +1 -0
- package/dist/plugins/session-stats/plugin.js.map +1 -1
- package/dist/plugins/shell/executor.d.ts +17 -15
- package/dist/plugins/shell/executor.d.ts.map +1 -1
- package/dist/plugins/shell/executor.js +130 -195
- package/dist/plugins/shell/executor.js.map +1 -1
- package/dist/plugins/shell/index.d.ts +2 -2
- package/dist/plugins/shell/index.d.ts.map +1 -1
- package/dist/plugins/shell/index.js +2 -2
- package/dist/plugins/shell/index.js.map +1 -1
- package/dist/plugins/shell/plugin.d.ts +5 -4
- package/dist/plugins/shell/plugin.d.ts.map +1 -1
- package/dist/plugins/shell/plugin.js +4 -8
- package/dist/plugins/shell/plugin.js.map +1 -1
- package/dist/plugins/skills/discovery.d.ts.map +1 -1
- package/dist/plugins/skills/discovery.js +10 -8
- package/dist/plugins/skills/discovery.js.map +1 -1
- package/dist/plugins/skills/index.d.ts +1 -1
- package/dist/plugins/skills/index.d.ts.map +1 -1
- package/dist/plugins/skills/plugin.d.ts +1 -1
- package/dist/plugins/skills/plugin.d.ts.map +1 -1
- package/dist/plugins/skills/plugin.js +23 -30
- package/dist/plugins/skills/plugin.js.map +1 -1
- package/dist/plugins/skills/prompts.d.ts +3 -3
- package/dist/plugins/skills/prompts.d.ts.map +1 -1
- package/dist/plugins/skills/prompts.js.map +1 -1
- package/dist/plugins/skills/schema.d.ts +4 -2
- package/dist/plugins/skills/schema.d.ts.map +1 -1
- package/dist/plugins/todo/schema.d.ts +1 -1
- package/dist/plugins/uploads/plugin.d.ts +11 -4
- package/dist/plugins/uploads/plugin.d.ts.map +1 -1
- package/dist/plugins/uploads/plugin.js +891 -225
- package/dist/plugins/uploads/plugin.js.map +1 -1
- package/dist/plugins/uploads/preprocessor.d.ts +14 -0
- package/dist/plugins/uploads/preprocessor.d.ts.map +1 -1
- package/dist/plugins/uploads/preprocessor.js +11 -0
- package/dist/plugins/uploads/preprocessor.js.map +1 -1
- package/dist/plugins/uploads/preprocessors/image-classifier.d.ts +1 -1
- package/dist/plugins/uploads/preprocessors/image-classifier.d.ts.map +1 -1
- package/dist/plugins/uploads/preprocessors/image-classifier.js +51 -26
- package/dist/plugins/uploads/preprocessors/image-classifier.js.map +1 -1
- package/dist/plugins/uploads/preprocessors/markitdown-preprocessor.d.ts +2 -2
- package/dist/plugins/uploads/preprocessors/markitdown-preprocessor.d.ts.map +1 -1
- package/dist/plugins/uploads/preprocessors/markitdown-preprocessor.js +41 -16
- package/dist/plugins/uploads/preprocessors/markitdown-preprocessor.js.map +1 -1
- package/dist/plugins/uploads/preprocessors/pdf-preprocessor.d.ts +1 -1
- package/dist/plugins/uploads/preprocessors/pdf-preprocessor.d.ts.map +1 -1
- package/dist/plugins/uploads/preprocessors/pdf-preprocessor.js +29 -14
- package/dist/plugins/uploads/preprocessors/pdf-preprocessor.js.map +1 -1
- package/dist/plugins/uploads/preprocessors/zip-preprocessor.d.ts +1 -1
- package/dist/plugins/uploads/preprocessors/zip-preprocessor.d.ts.map +1 -1
- package/dist/plugins/uploads/preprocessors/zip-preprocessor.js +62 -34
- package/dist/plugins/uploads/preprocessors/zip-preprocessor.js.map +1 -1
- package/dist/plugins/uploads/schema.d.ts +25 -2
- package/dist/plugins/uploads/schema.d.ts.map +1 -1
- package/dist/plugins/uploads/schema.js +24 -3
- package/dist/plugins/uploads/schema.js.map +1 -1
- package/dist/plugins/uploads/state.d.ts +13 -1
- package/dist/plugins/uploads/state.d.ts.map +1 -1
- package/dist/plugins/uploads/state.js +4 -1
- package/dist/plugins/uploads/state.js.map +1 -1
- package/dist/plugins/user-chat/plugin.d.ts +12 -5
- package/dist/plugins/user-chat/plugin.d.ts.map +1 -1
- package/dist/plugins/user-chat/plugin.js +141 -32
- package/dist/plugins/user-chat/plugin.js.map +1 -1
- package/dist/plugins/workers/context.d.ts +35 -13
- package/dist/plugins/workers/context.d.ts.map +1 -1
- package/dist/plugins/workers/context.js +82 -32
- package/dist/plugins/workers/context.js.map +1 -1
- package/dist/plugins/workers/definition.d.ts +7 -0
- package/dist/plugins/workers/definition.d.ts.map +1 -1
- package/dist/plugins/workers/definition.js.map +1 -1
- package/dist/plugins/workers/index.d.ts +4 -4
- package/dist/plugins/workers/index.d.ts.map +1 -1
- package/dist/plugins/workers/index.js +2 -2
- package/dist/plugins/workers/index.js.map +1 -1
- package/dist/plugins/workers/plugin.d.ts +10 -57
- package/dist/plugins/workers/plugin.d.ts.map +1 -1
- package/dist/plugins/workers/plugin.js +385 -123
- package/dist/plugins/workers/plugin.js.map +1 -1
- package/dist/plugins/workers/state.d.ts +69 -0
- package/dist/plugins/workers/state.d.ts.map +1 -0
- package/dist/plugins/workers/state.js +52 -0
- package/dist/plugins/workers/state.js.map +1 -0
- package/dist/plugins/workers/worker.d.ts +15 -4
- package/dist/plugins/workers/worker.d.ts.map +1 -1
- package/dist/testing/conformance.d.ts +106 -0
- package/dist/testing/conformance.d.ts.map +1 -0
- package/dist/testing/conformance.js +1463 -0
- package/dist/testing/conformance.js.map +1 -0
- package/dist/testing/node-platform.d.ts.map +1 -1
- package/dist/testing/node-platform.js +5 -0
- package/dist/testing/node-platform.js.map +1 -1
- package/dist/testing/test-harness.d.ts +11 -1
- package/dist/testing/test-harness.d.ts.map +1 -1
- package/dist/testing/test-harness.js +17 -37
- package/dist/testing/test-harness.js.map +1 -1
- package/dist/testing/wait-helpers.d.ts.map +1 -1
- package/dist/testing/wait-helpers.js +1 -3
- package/dist/testing/wait-helpers.js.map +1 -1
- package/dist/transport/adapter/client-adapter.d.ts +6 -0
- package/dist/transport/adapter/client-adapter.d.ts.map +1 -1
- package/dist/transport/adapter/client-adapter.js +50 -3
- package/dist/transport/adapter/client-adapter.js.map +1 -1
- package/dist/transport/adapter/heartbeat.d.ts +16 -0
- package/dist/transport/adapter/heartbeat.d.ts.map +1 -0
- package/dist/transport/adapter/heartbeat.js +41 -0
- package/dist/transport/adapter/heartbeat.js.map +1 -0
- package/dist/transport/adapter/server-adapter.d.ts.map +1 -1
- package/dist/transport/adapter/server-adapter.js +6 -0
- package/dist/transport/adapter/server-adapter.js.map +1 -1
- package/dist/transport/http/app.d.ts +3 -30
- package/dist/transport/http/app.d.ts.map +1 -1
- package/dist/transport/http/app.js +3 -7
- package/dist/transport/http/app.js.map +1 -1
- package/dist/transport/http/context.d.ts +40 -0
- package/dist/transport/http/context.d.ts.map +1 -0
- package/dist/transport/http/context.js +17 -0
- package/dist/transport/http/context.js.map +1 -0
- package/dist/transport/http/fetch-guard.d.ts +49 -0
- package/dist/transport/http/fetch-guard.d.ts.map +1 -0
- package/dist/transport/http/fetch-guard.js +312 -0
- package/dist/transport/http/fetch-guard.js.map +1 -0
- package/dist/transport/http/index.d.ts +1 -1
- package/dist/transport/http/index.d.ts.map +1 -1
- package/dist/transport/http/middleware/bearer-auth.d.ts +1 -1
- package/dist/transport/http/middleware/bearer-auth.d.ts.map +1 -1
- package/dist/transport/http/middleware/error-handler.d.ts +2 -2
- package/dist/transport/http/middleware/error-handler.d.ts.map +1 -1
- package/dist/transport/http/path-containment.d.ts +20 -0
- package/dist/transport/http/path-containment.d.ts.map +1 -0
- package/dist/transport/http/path-containment.js +31 -0
- package/dist/transport/http/path-containment.js.map +1 -0
- package/dist/transport/http/responses.d.ts +30 -0
- package/dist/transport/http/responses.d.ts.map +1 -0
- package/dist/transport/http/responses.js +5 -0
- package/dist/transport/http/responses.js.map +1 -0
- package/dist/transport/http/routes/files.d.ts +1 -1
- package/dist/transport/http/routes/files.d.ts.map +1 -1
- package/dist/transport/http/routes/files.js +54 -155
- package/dist/transport/http/routes/files.js.map +1 -1
- package/dist/transport/http/routes/resources.d.ts +1 -1
- package/dist/transport/http/routes/resources.d.ts.map +1 -1
- package/dist/transport/http/routes/resources.js +92 -57
- package/dist/transport/http/routes/resources.js.map +1 -1
- package/dist/transport/http/routes/rpc.d.ts +6 -1
- package/dist/transport/http/routes/rpc.d.ts.map +1 -1
- package/dist/transport/http/routes/rpc.js +51 -21
- package/dist/transport/http/routes/rpc.js.map +1 -1
- package/dist/transport/http/routes/upload.d.ts +1 -1
- package/dist/transport/http/routes/upload.d.ts.map +1 -1
- package/dist/transport/http/routes/upload.js +256 -169
- package/dist/transport/http/routes/upload.js.map +1 -1
- package/dist/user-config.d.ts +34 -7
- package/dist/user-config.d.ts.map +1 -1
- package/dist/user-config.js +71 -0
- package/dist/user-config.js.map +1 -1
- package/package.json +17 -7
- package/src/bootstrap.ts +119 -35
- package/src/bun-platform/fs.ts +1 -0
- package/src/bun-platform/index.ts +18 -1
- package/src/bun-platform/server-lifecycle.ts +218 -0
- package/src/bun-platform/shell.ts +362 -0
- package/src/config.ts +130 -0
- package/src/core/agents/agent.ts +210 -92
- package/src/core/agents/config.ts +8 -0
- package/src/core/agents/retry.ts +16 -17
- package/src/core/agents/state.ts +2 -0
- package/src/core/events/base-event-store.ts +24 -16
- package/src/core/events/file.ts +198 -22
- package/src/core/file-store/containment.ts +75 -0
- package/src/core/file-store/file-store.ts +106 -25
- package/src/core/file-store/types.ts +14 -1
- package/src/core/image/image-processor.ts +3 -1
- package/src/core/image/types.ts +2 -0
- package/src/core/image/vips-resizer.ts +102 -37
- package/src/core/llm/anthropic.ts +63 -79
- package/src/core/llm/logger.ts +175 -37
- package/src/core/llm/openrouter.ts +57 -72
- package/src/core/llm/provider-request.ts +40 -0
- package/src/core/llm/provider.ts +28 -0
- package/src/core/plugins/plugin-builder.ts +106 -14
- package/src/core/preset/preset-builder.ts +12 -22
- package/src/core/sessions/context.ts +18 -0
- package/src/core/sessions/runtime-activity.ts +78 -0
- package/src/core/sessions/schema.ts +29 -3
- package/src/core/sessions/session-manager.ts +560 -140
- package/src/core/sessions/session-store.ts +38 -0
- package/src/core/sessions/session.ts +187 -47
- package/src/core/sessions/state.ts +11 -0
- package/src/core/system.ts +15 -0
- package/src/core/wake-key.ts +65 -0
- package/src/index.ts +32 -12
- package/src/lib/archive/archive-inspection.fixtures.ts +138 -0
- package/src/lib/archive/archive-inspection.ts +359 -0
- package/src/lib/archive/index.ts +17 -0
- package/src/lib/logger/console.ts +7 -57
- package/src/lib/logger/file.ts +28 -50
- package/src/lib/logger/index.ts +3 -1
- package/src/lib/logger/jsonl.ts +36 -0
- package/src/lib/logger/logger.ts +48 -0
- package/src/lib/logger/session-log.ts +42 -0
- package/src/lib/utils/concurrency.ts +37 -8
- package/src/lib/utils/fs-batch.ts +49 -0
- package/src/lib/utils/result.ts +7 -31
- package/src/lib/utils/sleep.ts +23 -0
- package/src/platform/fs-revision.ts +21 -0
- package/src/platform/fs.ts +109 -1
- package/src/platform/git.ts +67 -0
- package/src/platform/index.ts +51 -1
- package/src/platform/llm-call-log.ts +86 -0
- package/src/platform/scheduler.ts +71 -0
- package/src/platform/session-log.ts +39 -0
- package/src/platform/shell.ts +89 -0
- package/src/plugins/agent-status/plugin.ts +1 -0
- package/src/plugins/agents/plugin.ts +134 -81
- package/src/plugins/filesystem/listing.ts +70 -12
- package/src/plugins/filesystem/plugin.ts +8 -6
- package/src/plugins/git-status/index.ts +1 -0
- package/src/plugins/git-status/plugin.ts +211 -77
- package/src/plugins/llm-debug/plugin.ts +1 -0
- package/src/plugins/logs/plugin.ts +9 -0
- package/src/plugins/mailbox/plugin.ts +46 -64
- package/src/plugins/mailbox/query.ts +15 -7
- package/src/plugins/mailbox/state.ts +1 -0
- package/src/plugins/resources/filename.ts +19 -0
- package/src/plugins/resources/plugin.ts +111 -59
- package/src/plugins/result-eviction/plugin.ts +6 -1
- package/src/plugins/services/plugin.ts +254 -98
- package/src/plugins/services/prompt.ts +1 -6
- package/src/plugins/services/schema.ts +17 -3
- package/src/plugins/services/service.ts +702 -252
- package/src/plugins/session-lifecycle/plugin.ts +56 -41
- package/src/plugins/session-state/plugin.ts +242 -88
- package/src/plugins/session-stats/plugin.ts +1 -0
- package/src/plugins/shell/executor.ts +144 -226
- package/src/plugins/shell/index.ts +1 -4
- package/src/plugins/shell/plugin.ts +7 -9
- package/src/plugins/skills/discovery.ts +10 -8
- package/src/plugins/skills/index.ts +1 -1
- package/src/plugins/skills/plugin.ts +19 -27
- package/src/plugins/skills/prompts.ts +3 -3
- package/src/plugins/skills/schema.ts +5 -2
- package/src/plugins/uploads/plugin.ts +991 -273
- package/src/plugins/uploads/preprocessor.ts +25 -0
- package/src/plugins/uploads/preprocessors/image-classifier.ts +56 -25
- package/src/plugins/uploads/preprocessors/markitdown-preprocessor.ts +41 -15
- package/src/plugins/uploads/preprocessors/pdf-preprocessor.ts +32 -16
- package/src/plugins/uploads/preprocessors/zip-preprocessor.ts +67 -38
- package/src/plugins/uploads/schema.ts +30 -3
- package/src/plugins/uploads/state.ts +12 -0
- package/src/plugins/user-chat/plugin.ts +196 -40
- package/src/plugins/workers/context.ts +102 -39
- package/src/plugins/workers/definition.ts +7 -0
- package/src/plugins/workers/index.ts +4 -4
- package/src/plugins/workers/plugin.ts +461 -151
- package/src/plugins/workers/state.ts +64 -0
- package/src/plugins/workers/worker.ts +15 -4
- package/src/testing/conformance.ts +1751 -0
- package/src/testing/node-platform.ts +5 -0
- package/src/testing/test-harness.ts +21 -38
- package/src/testing/wait-helpers.ts +1 -4
- package/src/transport/adapter/client-adapter.ts +60 -3
- package/src/transport/adapter/heartbeat.ts +50 -0
- package/src/transport/adapter/server-adapter.ts +6 -0
- package/src/transport/http/app.ts +7 -35
- package/src/transport/http/context.ts +46 -0
- package/src/transport/http/fetch-guard.ts +318 -0
- package/src/transport/http/index.ts +1 -1
- package/src/transport/http/middleware/bearer-auth.ts +1 -1
- package/src/transport/http/middleware/error-handler.ts +1 -1
- package/src/transport/http/path-containment.ts +44 -0
- package/src/transport/http/responses.ts +20 -0
- package/src/transport/http/routes/files.ts +69 -159
- package/src/transport/http/routes/resources.ts +124 -93
- package/src/transport/http/routes/rpc.ts +63 -26
- package/src/transport/http/routes/upload.ts +327 -258
- package/src/user-config.ts +93 -7
- package/dist/config.test.d.ts +0 -2
- package/dist/config.test.d.ts.map +0 -1
- package/dist/config.test.js +0 -155
- package/dist/config.test.js.map +0 -1
- package/dist/core/agent-loop.integration.test.d.ts +0 -2
- package/dist/core/agent-loop.integration.test.d.ts.map +0 -1
- package/dist/core/agent-loop.integration.test.js +0 -414
- package/dist/core/agent-loop.integration.test.js.map +0 -1
- package/dist/core/agents/agent-config.test.d.ts +0 -2
- package/dist/core/agents/agent-config.test.d.ts.map +0 -1
- package/dist/core/agents/agent-config.test.js +0 -194
- package/dist/core/agents/agent-config.test.js.map +0 -1
- package/dist/core/agents/agent-shutdown.test.d.ts +0 -6
- package/dist/core/agents/agent-shutdown.test.d.ts.map +0 -1
- package/dist/core/agents/agent-shutdown.test.js +0 -180
- package/dist/core/agents/agent-shutdown.test.js.map +0 -1
- package/dist/core/agents/agent.test.d.ts +0 -2
- package/dist/core/agents/agent.test.d.ts.map +0 -1
- package/dist/core/agents/agent.test.js +0 -313
- package/dist/core/agents/agent.test.js.map +0 -1
- package/dist/core/agents/communicator.d.ts +0 -3
- package/dist/core/agents/communicator.d.ts.map +0 -1
- package/dist/core/agents/communicator.js +0 -13
- package/dist/core/agents/communicator.js.map +0 -1
- package/dist/core/agents/handler-events.test.d.ts +0 -5
- package/dist/core/agents/handler-events.test.d.ts.map +0 -1
- package/dist/core/agents/handler-events.test.js +0 -115
- package/dist/core/agents/handler-events.test.js.map +0 -1
- package/dist/core/agents/response-sanitizer.test.d.ts +0 -2
- package/dist/core/agents/response-sanitizer.test.d.ts.map +0 -1
- package/dist/core/agents/response-sanitizer.test.js +0 -101
- package/dist/core/agents/response-sanitizer.test.js.map +0 -1
- package/dist/core/error-recovery.integration.test.d.ts +0 -2
- package/dist/core/error-recovery.integration.test.d.ts.map +0 -1
- package/dist/core/error-recovery.integration.test.js +0 -288
- package/dist/core/error-recovery.integration.test.js.map +0 -1
- package/dist/core/event-sourcing.integration.test.d.ts +0 -2
- package/dist/core/event-sourcing.integration.test.d.ts.map +0 -1
- package/dist/core/event-sourcing.integration.test.js +0 -154
- package/dist/core/event-sourcing.integration.test.js.map +0 -1
- package/dist/core/events/file.test.d.ts +0 -2
- package/dist/core/events/file.test.d.ts.map +0 -1
- package/dist/core/events/file.test.js +0 -284
- package/dist/core/events/file.test.js.map +0 -1
- package/dist/core/events/memory.test.d.ts +0 -2
- package/dist/core/events/memory.test.d.ts.map +0 -1
- package/dist/core/events/memory.test.js +0 -502
- package/dist/core/events/memory.test.js.map +0 -1
- package/dist/core/image/image-processor.test.d.ts +0 -2
- package/dist/core/image/image-processor.test.d.ts.map +0 -1
- package/dist/core/image/image-processor.test.js +0 -171
- package/dist/core/image/image-processor.test.js.map +0 -1
- package/dist/core/image/vips-resizer.test.d.ts +0 -2
- package/dist/core/image/vips-resizer.test.d.ts.map +0 -1
- package/dist/core/image/vips-resizer.test.js +0 -336
- package/dist/core/image/vips-resizer.test.js.map +0 -1
- package/dist/core/llm/anthropic.test.d.ts +0 -2
- package/dist/core/llm/anthropic.test.d.ts.map +0 -1
- package/dist/core/llm/anthropic.test.js +0 -464
- package/dist/core/llm/anthropic.test.js.map +0 -1
- package/dist/core/llm/cache-breakpoints.test.d.ts +0 -2
- package/dist/core/llm/cache-breakpoints.test.d.ts.map +0 -1
- package/dist/core/llm/cache-breakpoints.test.js +0 -69
- package/dist/core/llm/cache-breakpoints.test.js.map +0 -1
- package/dist/core/llm/cache-live.test.d.ts +0 -16
- package/dist/core/llm/cache-live.test.d.ts.map +0 -1
- package/dist/core/llm/cache-live.test.js +0 -137
- package/dist/core/llm/cache-live.test.js.map +0 -1
- package/dist/core/llm/logger.test.d.ts +0 -7
- package/dist/core/llm/logger.test.d.ts.map +0 -1
- package/dist/core/llm/logger.test.js +0 -228
- package/dist/core/llm/logger.test.js.map +0 -1
- package/dist/core/llm/message-sanitization.test.d.ts +0 -2
- package/dist/core/llm/message-sanitization.test.d.ts.map +0 -1
- package/dist/core/llm/message-sanitization.test.js +0 -181
- package/dist/core/llm/message-sanitization.test.js.map +0 -1
- package/dist/core/llm/mock.test.d.ts +0 -2
- package/dist/core/llm/mock.test.d.ts.map +0 -1
- package/dist/core/llm/mock.test.js +0 -318
- package/dist/core/llm/mock.test.js.map +0 -1
- package/dist/core/llm/model-shortlist-live.test.d.ts +0 -35
- package/dist/core/llm/model-shortlist-live.test.d.ts.map +0 -1
- package/dist/core/llm/model-shortlist-live.test.js +0 -452
- package/dist/core/llm/model-shortlist-live.test.js.map +0 -1
- package/dist/core/llm/openrouter-mapping.test.d.ts +0 -2
- package/dist/core/llm/openrouter-mapping.test.d.ts.map +0 -1
- package/dist/core/llm/openrouter-mapping.test.js +0 -190
- package/dist/core/llm/openrouter-mapping.test.js.map +0 -1
- package/dist/core/llm/openrouter.test.d.ts +0 -2
- package/dist/core/llm/openrouter.test.d.ts.map +0 -1
- package/dist/core/llm/openrouter.test.js +0 -377
- package/dist/core/llm/openrouter.test.js.map +0 -1
- package/dist/core/llm/provider-integration.test.d.ts +0 -12
- package/dist/core/llm/provider-integration.test.d.ts.map +0 -1
- package/dist/core/llm/provider-integration.test.js +0 -350
- package/dist/core/llm/provider-integration.test.js.map +0 -1
- package/dist/core/llm/reasoning-details.test.d.ts +0 -2
- package/dist/core/llm/reasoning-details.test.d.ts.map +0 -1
- package/dist/core/llm/reasoning-details.test.js +0 -144
- package/dist/core/llm/reasoning-details.test.js.map +0 -1
- package/dist/core/llm/routing-provider.test.d.ts +0 -2
- package/dist/core/llm/routing-provider.test.d.ts.map +0 -1
- package/dist/core/llm/routing-provider.test.js +0 -94
- package/dist/core/llm/routing-provider.test.js.map +0 -1
- package/dist/core/llm/snapshot-middleware.test.d.ts +0 -2
- package/dist/core/llm/snapshot-middleware.test.d.ts.map +0 -1
- package/dist/core/llm/snapshot-middleware.test.js +0 -144
- package/dist/core/llm/snapshot-middleware.test.js.map +0 -1
- package/dist/core/llm/thinking-blocks.test.d.ts +0 -2
- package/dist/core/llm/thinking-blocks.test.d.ts.map +0 -1
- package/dist/core/llm/thinking-blocks.test.js +0 -291
- package/dist/core/llm/thinking-blocks.test.js.map +0 -1
- package/dist/core/multi-agent.integration.test.d.ts +0 -2
- package/dist/core/multi-agent.integration.test.d.ts.map +0 -1
- package/dist/core/multi-agent.integration.test.js +0 -298
- package/dist/core/multi-agent.integration.test.js.map +0 -1
- package/dist/core/plugin-hooks.integration.test.d.ts +0 -2
- package/dist/core/plugin-hooks.integration.test.d.ts.map +0 -1
- package/dist/core/plugin-hooks.integration.test.js +0 -458
- package/dist/core/plugin-hooks.integration.test.js.map +0 -1
- package/dist/core/reasoning-round-trip.integration.test.d.ts +0 -2
- package/dist/core/reasoning-round-trip.integration.test.d.ts.map +0 -1
- package/dist/core/reasoning-round-trip.integration.test.js +0 -150
- package/dist/core/reasoning-round-trip.integration.test.js.map +0 -1
- package/dist/core/session-lifecycle.integration.test.d.ts +0 -2
- package/dist/core/session-lifecycle.integration.test.d.ts.map +0 -1
- package/dist/core/session-lifecycle.integration.test.js +0 -159
- package/dist/core/session-lifecycle.integration.test.js.map +0 -1
- package/dist/core/sessions/fork-utils.test.d.ts +0 -2
- package/dist/core/sessions/fork-utils.test.d.ts.map +0 -1
- package/dist/core/sessions/fork-utils.test.js +0 -129
- package/dist/core/sessions/fork-utils.test.js.map +0 -1
- package/dist/core/sessions/session-overrides.integration.test.d.ts +0 -2
- package/dist/core/sessions/session-overrides.integration.test.d.ts.map +0 -1
- package/dist/core/sessions/session-overrides.integration.test.js +0 -154
- package/dist/core/sessions/session-overrides.integration.test.js.map +0 -1
- package/dist/core/sessions/session.test.d.ts +0 -2
- package/dist/core/sessions/session.test.d.ts.map +0 -1
- package/dist/core/sessions/session.test.js +0 -1100
- package/dist/core/sessions/session.test.js.map +0 -1
- package/dist/core/tools/executor.test.d.ts +0 -2
- package/dist/core/tools/executor.test.d.ts.map +0 -1
- package/dist/core/tools/executor.test.js +0 -144
- package/dist/core/tools/executor.test.js.map +0 -1
- package/dist/lib/logger/console.test.d.ts +0 -2
- package/dist/lib/logger/console.test.d.ts.map +0 -1
- package/dist/lib/logger/console.test.js +0 -258
- package/dist/lib/logger/console.test.js.map +0 -1
- package/dist/lib/never.d.ts +0 -2
- package/dist/lib/never.d.ts.map +0 -1
- package/dist/lib/never.js +0 -4
- package/dist/lib/never.js.map +0 -1
- package/dist/lib/utils/concurrency.test.d.ts +0 -2
- package/dist/lib/utils/concurrency.test.d.ts.map +0 -1
- package/dist/lib/utils/concurrency.test.js +0 -135
- package/dist/lib/utils/concurrency.test.js.map +0 -1
- package/dist/plugins/agent-status/agent-status.test.d.ts +0 -2
- package/dist/plugins/agent-status/agent-status.test.d.ts.map +0 -1
- package/dist/plugins/agent-status/agent-status.test.js +0 -136
- package/dist/plugins/agent-status/agent-status.test.js.map +0 -1
- package/dist/plugins/agents/agents.integration.test.d.ts +0 -2
- package/dist/plugins/agents/agents.integration.test.d.ts.map +0 -1
- package/dist/plugins/agents/agents.integration.test.js +0 -830
- package/dist/plugins/agents/agents.integration.test.js.map +0 -1
- package/dist/plugins/agents/supervision.integration.test.d.ts +0 -2
- package/dist/plugins/agents/supervision.integration.test.d.ts.map +0 -1
- package/dist/plugins/agents/supervision.integration.test.js +0 -215
- package/dist/plugins/agents/supervision.integration.test.js.map +0 -1
- package/dist/plugins/context-compact/compaction-live.test.d.ts +0 -17
- package/dist/plugins/context-compact/compaction-live.test.d.ts.map +0 -1
- package/dist/plugins/context-compact/compaction-live.test.js +0 -177
- package/dist/plugins/context-compact/compaction-live.test.js.map +0 -1
- package/dist/plugins/context-compact/context-compact.integration.test.d.ts +0 -2
- package/dist/plugins/context-compact/context-compact.integration.test.d.ts.map +0 -1
- package/dist/plugins/context-compact/context-compact.integration.test.js +0 -364
- package/dist/plugins/context-compact/context-compact.integration.test.js.map +0 -1
- package/dist/plugins/context-compact/context-compactor.test.d.ts +0 -2
- package/dist/plugins/context-compact/context-compactor.test.d.ts.map +0 -1
- package/dist/plugins/context-compact/context-compactor.test.js +0 -858
- package/dist/plugins/context-compact/context-compactor.test.js.map +0 -1
- package/dist/plugins/context-compact/history-offloader.test.d.ts +0 -2
- package/dist/plugins/context-compact/history-offloader.test.d.ts.map +0 -1
- package/dist/plugins/context-compact/history-offloader.test.js +0 -77
- package/dist/plugins/context-compact/history-offloader.test.js.map +0 -1
- package/dist/plugins/filesystem/filesystem.integration.test.d.ts +0 -2
- package/dist/plugins/filesystem/filesystem.integration.test.d.ts.map +0 -1
- package/dist/plugins/filesystem/filesystem.integration.test.js +0 -447
- package/dist/plugins/filesystem/filesystem.integration.test.js.map +0 -1
- package/dist/plugins/filesystem/schema.d.ts +0 -7
- package/dist/plugins/filesystem/schema.d.ts.map +0 -1
- package/dist/plugins/filesystem/schema.js +0 -2
- package/dist/plugins/filesystem/schema.js.map +0 -1
- package/dist/plugins/limits-guard/limit-guard.test.d.ts +0 -2
- package/dist/plugins/limits-guard/limit-guard.test.d.ts.map +0 -1
- package/dist/plugins/limits-guard/limit-guard.test.js +0 -194
- package/dist/plugins/limits-guard/limit-guard.test.js.map +0 -1
- package/dist/plugins/limits-guard/limits-guard.integration.test.d.ts +0 -2
- package/dist/plugins/limits-guard/limits-guard.integration.test.d.ts.map +0 -1
- package/dist/plugins/limits-guard/limits-guard.integration.test.js +0 -887
- package/dist/plugins/limits-guard/limits-guard.integration.test.js.map +0 -1
- package/dist/plugins/llm-debug/llm-debug.integration.test.d.ts +0 -2
- package/dist/plugins/llm-debug/llm-debug.integration.test.d.ts.map +0 -1
- package/dist/plugins/llm-debug/llm-debug.integration.test.js +0 -157
- package/dist/plugins/llm-debug/llm-debug.integration.test.js.map +0 -1
- package/dist/plugins/mailbox/mailbox.integration.test.d.ts +0 -2
- package/dist/plugins/mailbox/mailbox.integration.test.d.ts.map +0 -1
- package/dist/plugins/mailbox/mailbox.integration.test.js +0 -678
- package/dist/plugins/mailbox/mailbox.integration.test.js.map +0 -1
- package/dist/plugins/resources/resources.integration.test.d.ts +0 -2
- package/dist/plugins/resources/resources.integration.test.d.ts.map +0 -1
- package/dist/plugins/resources/resources.integration.test.js +0 -62
- package/dist/plugins/resources/resources.integration.test.js.map +0 -1
- package/dist/plugins/result-eviction/result-eviction.integration.test.d.ts +0 -2
- package/dist/plugins/result-eviction/result-eviction.integration.test.d.ts.map +0 -1
- package/dist/plugins/result-eviction/result-eviction.integration.test.js +0 -294
- package/dist/plugins/result-eviction/result-eviction.integration.test.js.map +0 -1
- package/dist/plugins/services/pid-registry.test.d.ts +0 -2
- package/dist/plugins/services/pid-registry.test.d.ts.map +0 -1
- package/dist/plugins/services/pid-registry.test.js +0 -161
- package/dist/plugins/services/pid-registry.test.js.map +0 -1
- package/dist/plugins/services/services.integration.test.d.ts +0 -2
- package/dist/plugins/services/services.integration.test.d.ts.map +0 -1
- package/dist/plugins/services/services.integration.test.js +0 -1057
- package/dist/plugins/services/services.integration.test.js.map +0 -1
- package/dist/plugins/session-lifecycle/session-lifecycle.integration.test.d.ts +0 -2
- package/dist/plugins/session-lifecycle/session-lifecycle.integration.test.d.ts.map +0 -1
- package/dist/plugins/session-lifecycle/session-lifecycle.integration.test.js +0 -498
- package/dist/plugins/session-lifecycle/session-lifecycle.integration.test.js.map +0 -1
- package/dist/plugins/session-stats/plugin.test.d.ts +0 -2
- package/dist/plugins/session-stats/plugin.test.d.ts.map +0 -1
- package/dist/plugins/session-stats/plugin.test.js +0 -145
- package/dist/plugins/session-stats/plugin.test.js.map +0 -1
- package/dist/plugins/shell/shell.integration.test.d.ts +0 -2
- package/dist/plugins/shell/shell.integration.test.d.ts.map +0 -1
- package/dist/plugins/shell/shell.integration.test.js +0 -234
- package/dist/plugins/shell/shell.integration.test.js.map +0 -1
- package/dist/plugins/shell/shell.test.d.ts +0 -2
- package/dist/plugins/shell/shell.test.d.ts.map +0 -1
- package/dist/plugins/shell/shell.test.js +0 -236
- package/dist/plugins/shell/shell.test.js.map +0 -1
- package/dist/plugins/skills/discovery.test.d.ts +0 -2
- package/dist/plugins/skills/discovery.test.d.ts.map +0 -1
- package/dist/plugins/skills/discovery.test.js +0 -312
- package/dist/plugins/skills/discovery.test.js.map +0 -1
- package/dist/plugins/skills/skills.integration.test.d.ts +0 -2
- package/dist/plugins/skills/skills.integration.test.d.ts.map +0 -1
- package/dist/plugins/skills/skills.integration.test.js +0 -475
- package/dist/plugins/skills/skills.integration.test.js.map +0 -1
- package/dist/plugins/todo/todo.integration.test.d.ts +0 -2
- package/dist/plugins/todo/todo.integration.test.d.ts.map +0 -1
- package/dist/plugins/todo/todo.integration.test.js +0 -605
- package/dist/plugins/todo/todo.integration.test.js.map +0 -1
- package/dist/plugins/uploads/preprocessors/image-classifier.test.d.ts +0 -2
- package/dist/plugins/uploads/preprocessors/image-classifier.test.d.ts.map +0 -1
- package/dist/plugins/uploads/preprocessors/image-classifier.test.js +0 -113
- package/dist/plugins/uploads/preprocessors/image-classifier.test.js.map +0 -1
- package/dist/plugins/uploads/uploads.integration.test.d.ts +0 -2
- package/dist/plugins/uploads/uploads.integration.test.d.ts.map +0 -1
- package/dist/plugins/uploads/uploads.integration.test.js +0 -639
- package/dist/plugins/uploads/uploads.integration.test.js.map +0 -1
- package/dist/plugins/user-chat/user-chat.integration.test.d.ts +0 -2
- package/dist/plugins/user-chat/user-chat.integration.test.d.ts.map +0 -1
- package/dist/plugins/user-chat/user-chat.integration.test.js +0 -754
- package/dist/plugins/user-chat/user-chat.integration.test.js.map +0 -1
- package/dist/plugins/workers/workers.integration.test.d.ts +0 -2
- package/dist/plugins/workers/workers.integration.test.d.ts.map +0 -1
- package/dist/plugins/workers/workers.integration.test.js +0 -629
- package/dist/plugins/workers/workers.integration.test.js.map +0 -1
- package/dist/prompts/macros.test.d.ts +0 -2
- package/dist/prompts/macros.test.d.ts.map +0 -1
- package/dist/prompts/macros.test.js +0 -80
- package/dist/prompts/macros.test.js.map +0 -1
- package/dist/testing/test-harness.test.d.ts +0 -2
- package/dist/testing/test-harness.test.d.ts.map +0 -1
- package/dist/testing/test-harness.test.js +0 -92
- package/dist/testing/test-harness.test.js.map +0 -1
- package/dist/transport/http/routes/rpc.integration.test.d.ts +0 -2
- package/dist/transport/http/routes/rpc.integration.test.d.ts.map +0 -1
- package/dist/transport/http/routes/rpc.integration.test.js +0 -189
- package/dist/transport/http/routes/rpc.integration.test.js.map +0 -1
- package/dist/transport/http/routes/rpc.test.d.ts +0 -2
- package/dist/transport/http/routes/rpc.test.d.ts.map +0 -1
- package/dist/transport/http/routes/rpc.test.js +0 -316
- package/dist/transport/http/routes/rpc.test.js.map +0 -1
- package/src/config.test.ts +0 -174
- package/src/core/agent-loop.integration.test.ts +0 -503
- package/src/core/agents/agent-config.test.ts +0 -240
- package/src/core/agents/agent-shutdown.test.ts +0 -236
- package/src/core/agents/agent.test.ts +0 -387
- package/src/core/agents/communicator.ts +0 -16
- package/src/core/agents/handler-events.test.ts +0 -167
- package/src/core/agents/response-sanitizer.test.ts +0 -137
- package/src/core/error-recovery.integration.test.ts +0 -343
- package/src/core/event-sourcing.integration.test.ts +0 -191
- package/src/core/events/file.test.ts +0 -436
- package/src/core/events/memory.test.ts +0 -741
- package/src/core/image/image-processor.test.ts +0 -218
- package/src/core/image/vips-resizer.test.ts +0 -388
- package/src/core/llm/anthropic.test.ts +0 -546
- package/src/core/llm/cache-breakpoints.test.ts +0 -85
- package/src/core/llm/cache-live.test.ts +0 -155
- package/src/core/llm/logger.test.ts +0 -270
- package/src/core/llm/message-sanitization.test.ts +0 -217
- package/src/core/llm/mock.test.ts +0 -402
- package/src/core/llm/model-shortlist-live.test.ts +0 -577
- package/src/core/llm/openrouter-mapping.test.ts +0 -234
- package/src/core/llm/openrouter.test.ts +0 -499
- package/src/core/llm/provider-integration.test.ts +0 -408
- package/src/core/llm/reasoning-details.test.ts +0 -177
- package/src/core/llm/routing-provider.test.ts +0 -113
- package/src/core/llm/snapshot-middleware.test.ts +0 -168
- package/src/core/llm/thinking-blocks.test.ts +0 -345
- package/src/core/multi-agent.integration.test.ts +0 -340
- package/src/core/plugin-hooks.integration.test.ts +0 -568
- package/src/core/reasoning-round-trip.integration.test.ts +0 -188
- package/src/core/session-lifecycle.integration.test.ts +0 -202
- package/src/core/sessions/fork-utils.test.ts +0 -158
- package/src/core/sessions/session-overrides.integration.test.ts +0 -210
- package/src/core/sessions/session.test.ts +0 -1736
- package/src/core/tools/executor.test.ts +0 -161
- package/src/lib/logger/console.test.ts +0 -348
- package/src/lib/never.ts +0 -3
- package/src/lib/utils/concurrency.test.ts +0 -169
- package/src/plugins/agent-status/agent-status.test.ts +0 -164
- package/src/plugins/agents/agents.integration.test.ts +0 -976
- package/src/plugins/agents/supervision.integration.test.ts +0 -249
- package/src/plugins/context-compact/compaction-live.test.ts +0 -221
- package/src/plugins/context-compact/context-compact.integration.test.ts +0 -418
- package/src/plugins/context-compact/context-compactor.test.ts +0 -1036
- package/src/plugins/context-compact/history-offloader.test.ts +0 -100
- package/src/plugins/filesystem/filesystem.integration.test.ts +0 -529
- package/src/plugins/filesystem/schema.ts +0 -6
- package/src/plugins/limits-guard/limit-guard.test.ts +0 -253
- package/src/plugins/limits-guard/limits-guard.integration.test.ts +0 -1012
- package/src/plugins/llm-debug/llm-debug.integration.test.ts +0 -192
- package/src/plugins/mailbox/mailbox.integration.test.ts +0 -794
- package/src/plugins/resources/resources.integration.test.ts +0 -68
- package/src/plugins/result-eviction/result-eviction.integration.test.ts +0 -332
- package/src/plugins/services/pid-registry.test.ts +0 -180
- package/src/plugins/services/services.integration.test.ts +0 -1223
- package/src/plugins/session-lifecycle/session-lifecycle.integration.test.ts +0 -639
- package/src/plugins/session-stats/plugin.test.ts +0 -160
- package/src/plugins/shell/shell.integration.test.ts +0 -273
- package/src/plugins/shell/shell.test.ts +0 -314
- package/src/plugins/skills/discovery.test.ts +0 -395
- package/src/plugins/skills/skills.integration.test.ts +0 -580
- package/src/plugins/todo/todo.integration.test.ts +0 -687
- package/src/plugins/uploads/preprocessors/image-classifier.test.ts +0 -142
- package/src/plugins/uploads/uploads.integration.test.ts +0 -831
- package/src/plugins/user-chat/user-chat.integration.test.ts +0 -893
- package/src/plugins/workers/workers.integration.test.ts +0 -778
- package/src/prompts/macros.test.ts +0 -107
- package/src/testing/test-harness.test.ts +0 -114
- package/src/transport/http/routes/rpc.integration.test.ts +0 -243
- package/src/transport/http/routes/rpc.test.ts +0 -372
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { resolve } from 'node:path';
|
|
1
|
+
import { isAbsolute, resolve } from 'node:path';
|
|
2
2
|
import { Err, Ok } from '../../lib/utils/result.js';
|
|
3
3
|
// ============================================================================
|
|
4
4
|
// Constants
|
|
5
5
|
// ============================================================================
|
|
6
6
|
const VIRTUAL_SESSION = '/home/user/session';
|
|
7
7
|
const VIRTUAL_WORKSPACE = '/home/user/workspace';
|
|
8
|
-
/**
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
/** The sandbox covers these with a tmpfs, so only what a grant mounts back exists under them. */
|
|
9
|
+
const HIDDEN_ROOTS = ['/home', '/root'];
|
|
10
|
+
function isWithin(path, root) {
|
|
11
|
+
return path === root || path.startsWith(root + '/');
|
|
12
|
+
}
|
|
12
13
|
// ============================================================================
|
|
13
14
|
// Shell escaping
|
|
14
15
|
// ============================================================================
|
|
@@ -95,73 +96,14 @@ async function resolveAgentPath(fs, agentPath, sessionDir, workspaceDir, sandbox
|
|
|
95
96
|
}
|
|
96
97
|
return Ok(absolutePath);
|
|
97
98
|
}
|
|
98
|
-
// ============================================================================
|
|
99
|
-
// Environment
|
|
100
|
-
// ============================================================================
|
|
101
|
-
/** Safe environment variables that can be passed to child processes */
|
|
102
|
-
const SAFE_ENV_VARS = ['PATH', 'HOME', 'USER', 'SHELL', 'TERM', 'LANG', 'LC_ALL', 'TZ'];
|
|
103
|
-
function getSafeEnv() {
|
|
104
|
-
return Object.fromEntries(SAFE_ENV_VARS
|
|
105
|
-
.filter(key => process.env[key])
|
|
106
|
-
.map(key => [key, process.env[key]]));
|
|
107
|
-
}
|
|
108
|
-
export function buildBwrapArgs(opts) {
|
|
109
|
-
const { command, cwd, sandbox, extraBinds } = opts;
|
|
110
|
-
const sessionDir = opts.sessionDir ? resolve(opts.sessionDir) : undefined;
|
|
111
|
-
const workspaceDir = opts.workspaceDir ? resolve(opts.workspaceDir) : undefined;
|
|
112
|
-
const args = [
|
|
113
|
-
'--ro-bind',
|
|
114
|
-
'/',
|
|
115
|
-
'/',
|
|
116
|
-
'--dev',
|
|
117
|
-
'/dev',
|
|
118
|
-
'--proc',
|
|
119
|
-
'/proc',
|
|
120
|
-
'--tmpfs',
|
|
121
|
-
'/tmp',
|
|
122
|
-
];
|
|
123
|
-
// Hide sensitive directories with tmpfs overlays
|
|
124
|
-
// (overrides --ro-bind / / for these paths, preventing access to user home dirs and root)
|
|
125
|
-
args.push('--tmpfs', '/home');
|
|
126
|
-
args.push('--tmpfs', '/root');
|
|
127
|
-
if (sessionDir) {
|
|
128
|
-
// Map real session dir to /home/user/session (read-write)
|
|
129
|
-
args.push('--bind', sessionDir, VIRTUAL_SESSION);
|
|
130
|
-
}
|
|
131
|
-
if (workspaceDir) {
|
|
132
|
-
// Map real workspace dir to /home/user/workspace (read-write)
|
|
133
|
-
args.push('--bind', workspaceDir, VIRTUAL_WORKSPACE);
|
|
134
|
-
}
|
|
135
|
-
// Extra bind mounts (e.g. git project dir for worktree support, .gitconfig)
|
|
136
|
-
for (const bind of extraBinds ?? []) {
|
|
137
|
-
args.push(bind.mode === 'ro' ? '--ro-bind' : '--bind', bind.path, bind.destPath ?? bind.path);
|
|
138
|
-
}
|
|
139
|
-
// Additional writable paths (legacy support)
|
|
140
|
-
for (const p of sandbox.writablePaths ?? []) {
|
|
141
|
-
args.push('--bind', p, p);
|
|
142
|
-
}
|
|
143
|
-
// If no sessionDir/workspaceDir mapping, fall back to making cwd writable
|
|
144
|
-
if (!sessionDir && !workspaceDir) {
|
|
145
|
-
args.push('--bind', cwd, cwd);
|
|
146
|
-
}
|
|
147
|
-
args.push('--unshare-all');
|
|
148
|
-
if (sandbox.network) {
|
|
149
|
-
args.push('--share-net');
|
|
150
|
-
}
|
|
151
|
-
args.push('--die-with-parent');
|
|
152
|
-
// Set working directory inside the namespace
|
|
153
|
-
args.push('--chdir', cwd);
|
|
154
|
-
args.push('/bin/sh', '-c', command);
|
|
155
|
-
return args;
|
|
156
|
-
}
|
|
157
99
|
export class ShellExecutor {
|
|
158
100
|
config;
|
|
159
101
|
fs;
|
|
160
|
-
|
|
102
|
+
shell;
|
|
161
103
|
constructor(config, deps) {
|
|
162
104
|
this.config = config;
|
|
163
105
|
this.fs = deps.fs;
|
|
164
|
-
this.
|
|
106
|
+
this.shell = deps.shell;
|
|
165
107
|
}
|
|
166
108
|
async execute(input, environment) {
|
|
167
109
|
const args = typeof input.args === 'string' ? [input.args] : input.args;
|
|
@@ -175,16 +117,30 @@ export class ShellExecutor {
|
|
|
175
117
|
const workspaceDir = environment.workspaceDir;
|
|
176
118
|
// Determine sandbox mode from config
|
|
177
119
|
const sandboxEnabled = this.config.sandboxed && this.config.sandbox?.enabled !== false;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
120
|
+
const shell = this.shell;
|
|
121
|
+
if (!shell) {
|
|
122
|
+
return Err({
|
|
123
|
+
message: 'This host cannot run shell commands: it has no shell.',
|
|
124
|
+
recoverable: false,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (sandboxEnabled && shell.confinement === 'none') {
|
|
128
|
+
return Err({
|
|
129
|
+
message: 'This session runs commands sandboxed, but the host shell cannot confine them.',
|
|
130
|
+
recoverable: false,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
// A `host` shell needs no grants: its filesystem holds nothing but this session.
|
|
134
|
+
const confineByPaths = sandboxEnabled && shell.confinement === 'paths';
|
|
135
|
+
// A sandboxed agent sends virtual paths: the shell presents them, or we resolve them here.
|
|
182
136
|
let cwd;
|
|
183
137
|
if (sandboxEnabled) {
|
|
184
|
-
|
|
138
|
+
const cwdResult = await this.resolveSandboxCwd(input.cwd ?? VIRTUAL_SESSION, sessionDir, workspaceDir);
|
|
139
|
+
if (!cwdResult.ok)
|
|
140
|
+
return cwdResult;
|
|
141
|
+
cwd = cwdResult.value;
|
|
185
142
|
}
|
|
186
143
|
else if (this.config.sandboxed && input.cwd) {
|
|
187
|
-
// Sandboxed env but bwrap disabled — resolve virtual paths to real paths
|
|
188
144
|
const cwdResult = await resolveAgentPath(this.fs, input.cwd, sessionDir, workspaceDir, this.config.sandboxed);
|
|
189
145
|
if (!cwdResult.ok)
|
|
190
146
|
return cwdResult;
|
|
@@ -208,132 +164,111 @@ export class ShellExecutor {
|
|
|
208
164
|
});
|
|
209
165
|
}
|
|
210
166
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
const shell = this.config.shell ?? (process.platform === 'win32' ? 'cmd.exe' : '/bin/sh');
|
|
236
|
-
const shellFlag = process.platform === 'win32' ? '/c' : '-c';
|
|
237
|
-
child = this.process.spawn(shell, [shellFlag, fullCommand], {
|
|
238
|
-
cwd,
|
|
239
|
-
env: { ...getSafeEnv(), ...this.config.env },
|
|
240
|
-
detached: true,
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
// Handle stdin
|
|
244
|
-
if (input.stdin) {
|
|
245
|
-
child.stdin?.write(input.stdin);
|
|
246
|
-
child.stdin?.end();
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
child.stdin?.end();
|
|
250
|
-
}
|
|
251
|
-
// Collect stdout with size cap
|
|
252
|
-
let stdoutBytes = 0;
|
|
253
|
-
let stdoutTruncated = false;
|
|
254
|
-
child.stdout?.on('data', (data) => {
|
|
255
|
-
if (stdoutTruncated)
|
|
256
|
-
return;
|
|
257
|
-
const remaining = MAX_OUTPUT_BYTES - stdoutBytes;
|
|
258
|
-
if (data.length > remaining) {
|
|
259
|
-
stdout += data.toString('utf-8', 0, remaining);
|
|
260
|
-
stdoutBytes = MAX_OUTPUT_BYTES;
|
|
261
|
-
stdoutTruncated = true;
|
|
262
|
-
stdout += '\n[stdout truncated at 1 MB]';
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
stdout += data.toString();
|
|
266
|
-
stdoutBytes += data.length;
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
// Collect stderr with size cap
|
|
270
|
-
let stderrBytes = 0;
|
|
271
|
-
let stderrTruncated = false;
|
|
272
|
-
child.stderr?.on('data', (data) => {
|
|
273
|
-
if (stderrTruncated)
|
|
274
|
-
return;
|
|
275
|
-
const remaining = MAX_OUTPUT_BYTES - stderrBytes;
|
|
276
|
-
if (data.length > remaining) {
|
|
277
|
-
stderr += data.toString('utf-8', 0, remaining);
|
|
278
|
-
stderrBytes = MAX_OUTPUT_BYTES;
|
|
279
|
-
stderrTruncated = true;
|
|
280
|
-
stderr += '\n[stderr truncated at 1 MB]';
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
stderr += data.toString();
|
|
284
|
-
stderrBytes += data.length;
|
|
285
|
-
}
|
|
167
|
+
const runOptions = {
|
|
168
|
+
command: fullCommand,
|
|
169
|
+
cwd,
|
|
170
|
+
env: this.config.env,
|
|
171
|
+
stdin: input.stdin,
|
|
172
|
+
timeoutMs: timeout,
|
|
173
|
+
shell: this.config.shell,
|
|
174
|
+
};
|
|
175
|
+
if (confineByPaths) {
|
|
176
|
+
runOptions.grants = this.grants(cwd, sessionDir, workspaceDir);
|
|
177
|
+
runOptions.network = this.config.sandbox?.network;
|
|
178
|
+
runOptions.limits = this.config.sandbox?.limits;
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
const result = await shell.run(runOptions);
|
|
182
|
+
return Ok({
|
|
183
|
+
stdout: result.stdout,
|
|
184
|
+
stderr: result.stderr,
|
|
185
|
+
exitCode: result.exitCode,
|
|
186
|
+
signal: result.signal,
|
|
187
|
+
timedOut: result.timedOut,
|
|
188
|
+
durationMs: Date.now() - startTime,
|
|
286
189
|
});
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
child.kill('SIGTERM');
|
|
296
|
-
}
|
|
297
|
-
killTimeoutId = setTimeout(() => {
|
|
298
|
-
try {
|
|
299
|
-
process.kill(-child.pid, 'SIGKILL');
|
|
300
|
-
}
|
|
301
|
-
catch {
|
|
302
|
-
try {
|
|
303
|
-
child.kill('SIGKILL');
|
|
304
|
-
}
|
|
305
|
-
catch { /* already dead */ }
|
|
306
|
-
}
|
|
307
|
-
}, GRACEFUL_KILL_DELAY_MS);
|
|
308
|
-
}, timeout);
|
|
309
|
-
// Process exit
|
|
310
|
-
child.on('close', (code, signal) => {
|
|
311
|
-
clearTimeout(timeoutId);
|
|
312
|
-
if (killTimeoutId)
|
|
313
|
-
clearTimeout(killTimeoutId);
|
|
314
|
-
const durationMs = Date.now() - startTime;
|
|
315
|
-
resolve(Ok({
|
|
316
|
-
stdout: stdout.trim(),
|
|
317
|
-
stderr: stderr.trim(),
|
|
318
|
-
exitCode: code ?? -1,
|
|
319
|
-
signal: signal ?? undefined,
|
|
320
|
-
timedOut,
|
|
321
|
-
durationMs,
|
|
322
|
-
}));
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
const durationMs = Date.now() - startTime;
|
|
193
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
194
|
+
return Err({
|
|
195
|
+
message,
|
|
196
|
+
recoverable: false,
|
|
197
|
+
details: error instanceof Error && 'details' in error ? error.details : { durationMs },
|
|
323
198
|
});
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Keep the working directory inside what the sandbox mounts, before the host chdirs into it.
|
|
203
|
+
* Paths under the hidden home roots exist only where a grant mounts them back; the rest of
|
|
204
|
+
* the tree the sandbox binds read-only, so a directory there grants nothing.
|
|
205
|
+
*/
|
|
206
|
+
async resolveSandboxCwd(agentCwd, sessionDir, workspaceDir) {
|
|
207
|
+
if (!isAbsolute(agentCwd)) {
|
|
208
|
+
return Err({ message: `Working directory '${agentCwd}' must be an absolute path`, recoverable: false });
|
|
209
|
+
}
|
|
210
|
+
const normalized = resolve(agentCwd);
|
|
211
|
+
if (isWithin(normalized, VIRTUAL_SESSION) || isWithin(normalized, VIRTUAL_WORKSPACE)) {
|
|
212
|
+
const contained = await resolveAgentPath(this.fs, normalized, sessionDir, workspaceDir, true);
|
|
213
|
+
if (!contained.ok)
|
|
214
|
+
return contained;
|
|
215
|
+
return this.requireExists(contained.value, agentCwd, normalized);
|
|
216
|
+
}
|
|
217
|
+
for (const root of this.boundRoots()) {
|
|
218
|
+
if (!isWithin(normalized, root.seen))
|
|
219
|
+
continue;
|
|
220
|
+
const hostPath = resolve(root.host + normalized.slice(root.seen.length));
|
|
221
|
+
if (await checkSymlinkEscape(this.fs, hostPath, root.host)) {
|
|
222
|
+
return Err({ message: `Path '${agentCwd}' resolves outside its bind mount via symlink`, recoverable: false });
|
|
223
|
+
}
|
|
224
|
+
return this.requireExists(hostPath, agentCwd, normalized);
|
|
225
|
+
}
|
|
226
|
+
if (HIDDEN_ROOTS.some((root) => isWithin(normalized, root))) {
|
|
227
|
+
const mounted = [
|
|
228
|
+
VIRTUAL_SESSION,
|
|
229
|
+
...(workspaceDir ? [VIRTUAL_WORKSPACE] : []),
|
|
230
|
+
...this.boundRoots().map((root) => root.seen),
|
|
231
|
+
];
|
|
232
|
+
return Err({
|
|
233
|
+
message: `Path '${agentCwd}' is not mounted in this sandbox. Mounted roots: ${mounted.join(', ')}`,
|
|
234
|
+
recoverable: false,
|
|
335
235
|
});
|
|
336
|
-
}
|
|
236
|
+
}
|
|
237
|
+
return Ok(normalized);
|
|
238
|
+
}
|
|
239
|
+
async requireExists(hostPath, agentCwd, seen) {
|
|
240
|
+
if (await this.fs.exists(hostPath))
|
|
241
|
+
return Ok(seen);
|
|
242
|
+
return Err({ message: `Working directory '${agentCwd}' does not exist`, recoverable: false });
|
|
243
|
+
}
|
|
244
|
+
/** Granted roots beyond the session and workspace, as the command sees them and where the host keeps them. */
|
|
245
|
+
boundRoots() {
|
|
246
|
+
return [
|
|
247
|
+
...(this.config.extraBinds ?? []).map((bind) => ({ seen: resolve(bind.destPath ?? bind.path), host: resolve(bind.path) })),
|
|
248
|
+
...(this.config.sandbox?.writablePaths ?? []).map((path) => ({ seen: resolve(path), host: resolve(path) })),
|
|
249
|
+
];
|
|
250
|
+
}
|
|
251
|
+
/** Session and workspace keep their agent-visible names; everything else stays where it is. */
|
|
252
|
+
grants(cwd, sessionDir, workspaceDir) {
|
|
253
|
+
const grants = [];
|
|
254
|
+
if (sessionDir) {
|
|
255
|
+
grants.push({ path: VIRTUAL_SESSION, source: sessionDir, mode: 'rw' });
|
|
256
|
+
}
|
|
257
|
+
if (workspaceDir) {
|
|
258
|
+
grants.push({ path: VIRTUAL_WORKSPACE, source: workspaceDir, mode: 'rw' });
|
|
259
|
+
}
|
|
260
|
+
// Extra binds (e.g. git project dir for worktree support, .gitconfig)
|
|
261
|
+
for (const bind of this.config.extraBinds ?? []) {
|
|
262
|
+
grants.push({ path: bind.destPath ?? bind.path, source: bind.path, mode: bind.mode });
|
|
263
|
+
}
|
|
264
|
+
// Additional writable paths (legacy support)
|
|
265
|
+
for (const path of this.config.sandbox?.writablePaths ?? []) {
|
|
266
|
+
grants.push({ path, mode: 'rw' });
|
|
267
|
+
}
|
|
268
|
+
if (!sessionDir && !workspaceDir) {
|
|
269
|
+
grants.push({ path: cwd, mode: 'rw' });
|
|
270
|
+
}
|
|
271
|
+
return grants;
|
|
337
272
|
}
|
|
338
273
|
}
|
|
339
274
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/plugins/shell/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,uBAAuB,CAAA;AAI5D,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,eAAe,GAAG,oBAAoB,CAAA;AAC5C,MAAM,iBAAiB,GAAG,sBAAsB,CAAA;AAEhD,qDAAqD;AACrD,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAElC,qDAAqD;AACrD,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAEnC,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,SAAS,WAAW,CAAC,GAAW;IAC/B,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IACjC,IAAI,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAA;IACrD,OAAO,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,GAAG,CAAA;AAC9C,CAAC;AAED,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E;;;GAGG;AACH,KAAK,UAAU,kBAAkB,CAAC,EAAc,EAAE,YAAoB,EAAE,GAAG,YAA2C;IACrH,IAAI,CAAC;QACJ,MAAM,QAAQ,GAA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AE,CAAA;QAE/B,IAAI,UAAU,EAAE,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QACvE,CAAC;QACD,IAAI,YAAY,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QAC3E,CAAC;QAED,sEAAsE;QACtE,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC;YACjD,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QACtF,CAAC;QAED,6CAA6C;QAC7C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,IAAI,EAAE,EAAE,CAAC;YAC7D,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QAClC,CAAC;QAED,IAAI,CAAC,UAAU,IAAI,CAAC,YAAY,EAAE,CAAC;YAClC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QACvC,CAAC;QAED,OAAO,MAAM,CAAA;IACd,CAAC;CACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shell plugin - command execution with sandbox support
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { createSandboxedShellConfig, type ExtraBind as ShellExtraBind, type ShellAgentConfig, shellPlugin, type ShellPresetConfig, } from './plugin.js';
|
|
5
|
+
export { type ExtraBind, type RunCommandInput, type SandboxConfig, type ShellConfig, ShellExecutor, type ShellResult, } from './executor.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/shell/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/shell/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,0BAA0B,EAC1B,KAAK,SAAS,IAAI,cAAc,EAChC,KAAK,gBAAgB,EACrB,WAAW,EACX,KAAK,iBAAiB,GACtB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACN,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,aAAa,EACb,KAAK,WAAW,GAChB,MAAM,eAAe,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shell plugin - command execution with sandbox support
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
4
|
+
export { createSandboxedShellConfig, shellPlugin, } from './plugin.js';
|
|
5
|
+
export { ShellExecutor, } from './executor.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/shell/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/shell/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,0BAA0B,EAG1B,WAAW,GAEX,MAAM,aAAa,CAAA;AAEpB,OAAO,EAKN,aAAa,GAEb,MAAM,eAAe,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ShellLimits } from '../../platform/shell.js';
|
|
1
2
|
/**
|
|
2
3
|
* Extra path to bind-mount inside bwrap sandbox.
|
|
3
4
|
*/
|
|
@@ -32,6 +33,8 @@ export interface ShellPresetConfig {
|
|
|
32
33
|
network?: boolean;
|
|
33
34
|
/** Paths with read-write access (default: [cwd]) */
|
|
34
35
|
writablePaths?: string[];
|
|
36
|
+
/** Resource caps for the confined command; a `null` field asks for no cap. */
|
|
37
|
+
limits?: ShellLimits;
|
|
35
38
|
};
|
|
36
39
|
/** Default enabled state for agents (default: true). Agents can override via ShellAgentConfig.enabled. */
|
|
37
40
|
defaultEnabled?: boolean;
|
|
@@ -44,8 +47,6 @@ export interface ShellAgentConfig {
|
|
|
44
47
|
enabled?: boolean;
|
|
45
48
|
}
|
|
46
49
|
export declare const shellPlugin: import("../../core/plugins/plugin-builder.js").PluginDefinition<"shell", ShellPresetConfig, ShellAgentConfig, {}, {}>;
|
|
47
|
-
/**
|
|
48
|
-
export declare function
|
|
49
|
-
/** Restrictive shell config for untrusted agents */
|
|
50
|
-
export declare function createRestrictedShellConfig(cwd: string): ShellPresetConfig;
|
|
50
|
+
/** Sandboxed shell config; the command timeout is the only knob it sets. */
|
|
51
|
+
export declare function createSandboxedShellConfig(cwd: string, timeout?: number): ShellPresetConfig;
|
|
51
52
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/shell/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/shell/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAGtD;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,oFAAoF;IACpF,GAAG,EAAE,MAAM,CAAA;IACX,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qDAAqD;IACrD,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,mDAAmD;IACnD,OAAO,CAAC,EAAE;QACT,OAAO,EAAE,OAAO,CAAA;QAChB,4CAA4C;QAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,oDAAoD;QACpD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;QACxB,8EAA8E;QAC9E,MAAM,CAAC,EAAE,WAAW,CAAA;KACpB,CAAA;IACD,0GAA0G;IAC1G,cAAc,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAA;CACjB;AAcD,eAAO,MAAM,WAAW,mHAyCf,CAAA;AAET,4EAA4E;AAC5E,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,SAAQ,GAAG,iBAAiB,CAE1F"}
|
|
@@ -26,7 +26,7 @@ export const shellPlugin = definePlugin('shell')
|
|
|
26
26
|
extraBinds: pluginConfig.extraBinds,
|
|
27
27
|
sandbox: pluginConfig.sandbox,
|
|
28
28
|
};
|
|
29
|
-
const executor = new ShellExecutor(shellConfig, { fs: ctx.platform.fs,
|
|
29
|
+
const executor = new ShellExecutor(shellConfig, { fs: ctx.platform.fs, shell: ctx.platform.shell });
|
|
30
30
|
return { executor };
|
|
31
31
|
})
|
|
32
32
|
.agentConfig()
|
|
@@ -55,12 +55,8 @@ export const shellPlugin = definePlugin('shell')
|
|
|
55
55
|
];
|
|
56
56
|
})
|
|
57
57
|
.build();
|
|
58
|
-
/**
|
|
59
|
-
export function
|
|
60
|
-
return { cwd, timeout
|
|
61
|
-
}
|
|
62
|
-
/** Restrictive shell config for untrusted agents */
|
|
63
|
-
export function createRestrictedShellConfig(cwd) {
|
|
64
|
-
return { cwd, timeout: 30000, sandbox: { enabled: true } };
|
|
58
|
+
/** Sandboxed shell config; the command timeout is the only knob it sets. */
|
|
59
|
+
export function createSandboxedShellConfig(cwd, timeout = 60000) {
|
|
60
|
+
return { cwd, timeout, sandbox: { enabled: true } };
|
|
65
61
|
}
|
|
66
62
|
//# sourceMappingURL=plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/plugins/shell/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/plugins/shell/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EAA0C,aAAa,EAAE,MAAM,eAAe,CAAA;AAoDrF,MAAM,qBAAqB,GAAG,CAAC,CAAC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AO,GAAG,KAAK;IACtE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAA;AACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/plugins/skills/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/plugins/skills/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAO/D,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,iBAAiB,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,mBAAmB,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,WAAW,EAAE,iBAAiB,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAA;CACf;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,MAAM,GACb,MAAM,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAkElD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,WAAW,EAAE,MAAM,GACjB,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAchD;AAMD;;;GAGG;AACH,wBAAsB,cAAc,CACnC,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAyEvD;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACrC,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAqB9C"}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* ...
|
|
21
21
|
*/
|
|
22
22
|
import * as path from 'node:path';
|
|
23
|
+
import { readTextFilesOrUndefined } from '../../lib/utils/fs-batch.js';
|
|
23
24
|
import { Err, Ok } from '../../lib/utils/result.js';
|
|
24
25
|
import { SkillId } from '../../plugins/skills/schema.js';
|
|
25
26
|
// ============================================================================
|
|
@@ -141,15 +142,16 @@ export async function discoverSkills(fs, sources, basePath) {
|
|
|
141
142
|
}
|
|
142
143
|
// Scan for subdirectories containing SKILL.md
|
|
143
144
|
const entries = await fs.readdir(sourcePath, { withFileTypes: true });
|
|
144
|
-
for
|
|
145
|
-
|
|
145
|
+
// One read for every candidate, and no separate probe: a directory with no
|
|
146
|
+
// SKILL.md comes back with nothing rather than being asked about twice.
|
|
147
|
+
const candidates = entries
|
|
148
|
+
.filter((entry) => entry.isDirectory())
|
|
149
|
+
.map((entry) => path.join(sourcePath, entry.name, 'SKILL.md'));
|
|
150
|
+
const contents = await readTextFilesOrUndefined(fs, candidates);
|
|
151
|
+
for (const [index, skillFile] of candidates.entries()) {
|
|
152
|
+
const content = contents[index];
|
|
153
|
+
if (content === undefined)
|
|
146
154
|
continue;
|
|
147
|
-
const skillDir = path.join(sourcePath, entry.name);
|
|
148
|
-
const skillFile = path.join(skillDir, 'SKILL.md');
|
|
149
|
-
if (!(await fs.exists(skillFile)))
|
|
150
|
-
continue;
|
|
151
|
-
// Read and parse the skill file
|
|
152
|
-
const content = await fs.readFile(skillFile, 'utf-8');
|
|
153
155
|
const parseResult = parseSkillFrontmatter(content);
|
|
154
156
|
if (!parseResult.ok) {
|
|
155
157
|
return Err({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../../src/plugins/skills/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../../src/plugins/skills/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAElE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAA;AAG/C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AA2BpD,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CACpC,OAAe;IAEf,mCAAmC;IACnC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,GAAG,CAAC;YACV,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,oDAAoD;SAC7D,CAAC,CAAA;IACH,CAAC;IAED,6BAA6B;IAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAC1C,IAAI,QAAQ,KAAK,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC;YACV,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,2CAA2C;SACpD,CAAC,CAAA;IACH,CAAC;IAED,MAAM,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAA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IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,OAAO;YAClC,IAAI,EAAE,SAAS;SACf,CAAC,CAAA;IACH,CAAC;IAED,OAAO,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AACrC,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
export { skillsPlugin } from './plugin.js';
|
|
5
5
|
export type { PresetSkill, SkillsAgentConfig, SkillsPluginConfig as SkillsPresetConfig, SkillsPluginContext, } from './plugin.js';
|
|
6
6
|
export { SkillId, skillIdSchema } from './schema.js';
|
|
7
|
-
export type { LoadedSkill, SkillMetadata } from './schema.js';
|
|
7
|
+
export type { LoadedSkill, LoadedSkillContent, SkillMetadata } from './schema.js';
|
|
8
8
|
export { skillEvents } from './plugin.js';
|
|
9
9
|
export type { SkillLoadedEvent } from './plugin.js';
|
|
10
10
|
export { discoverSkills, type FrontmatterParseError, loadSkillContent, type ParsedFrontmatter, type ParsedSkillFile, parseSkillFile, parseSkillFrontmatter, type SkillDiscoveryError, } from './discovery.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/skills/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,YAAY,EACX,WAAW,EACX,iBAAiB,EACjB,kBAAkB,IAAI,kBAAkB,EACxC,mBAAmB,GACnB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACpD,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/skills/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,YAAY,EACX,WAAW,EACX,iBAAiB,EACjB,kBAAkB,IAAI,kBAAkB,EACxC,mBAAmB,GACnB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACpD,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGjF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGnD,OAAO,EACN,cAAc,EACd,KAAK,qBAAqB,EAC1B,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,cAAc,EACd,qBAAqB,EACrB,KAAK,mBAAmB,GACxB,MAAM,gBAAgB,CAAA"}
|
|
@@ -63,7 +63,7 @@ export declare const skillEvents: import("../../core/events/types.js").EventsFac
|
|
|
63
63
|
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
64
64
|
skillId: z.core.$ZodBranded<z.ZodString, "SkillId", "out">;
|
|
65
65
|
skillName: z.ZodString;
|
|
66
|
-
content: z.ZodString
|
|
66
|
+
content: z.ZodOptional<z.ZodString>;
|
|
67
67
|
}, z.core.$strip>;
|
|
68
68
|
}>;
|
|
69
69
|
export type SkillLoadedEvent = (typeof skillEvents)['Events']['skill_loaded'];
|