@dexto/core 1.7.2 → 1.8.1
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/agent/DextoAgent.cjs +163 -77
- package/dist/agent/DextoAgent.d.ts +73 -19
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +165 -67
- package/dist/agent/agent-options.d.ts +6 -10
- package/dist/agent/agent-options.d.ts.map +1 -1
- package/dist/agent/agentCard.js +1 -1
- package/dist/agent/error-codes.js +1 -1
- package/dist/agent/errors.js +1 -1
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/schemas.d.ts +2 -2
- package/dist/agent/schemas.js +1 -1
- package/dist/agent/state-manager.js +1 -1
- package/dist/agent/types.d.ts +1 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/approval/error-codes.cjs +1 -1
- package/dist/approval/error-codes.d.ts +1 -1
- package/dist/approval/error-codes.d.ts.map +1 -1
- package/dist/approval/error-codes.js +2 -2
- package/dist/approval/errors.cjs +2 -5
- package/dist/approval/errors.d.ts.map +1 -1
- package/dist/approval/errors.js +3 -6
- package/dist/approval/factory.cjs +19 -4
- package/dist/approval/factory.d.ts +4 -1
- package/dist/approval/factory.d.ts.map +1 -1
- package/dist/approval/factory.js +19 -5
- package/dist/approval/index.d.ts +1 -1
- package/dist/approval/index.d.ts.map +1 -1
- package/dist/approval/index.js +1 -1
- package/dist/approval/manager.cjs +168 -26
- package/dist/approval/manager.d.ts +46 -12
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +177 -29
- package/dist/approval/schemas.cjs +26 -26
- package/dist/approval/schemas.d.ts +29 -29
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +23 -23
- package/dist/approval/types.cjs +5 -5
- package/dist/approval/types.d.ts +18 -18
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +6 -6
- package/dist/{chunk-PTJYTZNU.js → chunk-C6A6W6XS.js} +1 -44
- package/dist/config/index.cjs +75 -0
- package/dist/config/index.d.ts +15 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +50 -0
- package/dist/context/compaction/overflow.d.ts +1 -1
- package/dist/context/compaction/overflow.d.ts.map +1 -1
- package/dist/context/compaction/overflow.js +1 -1
- package/dist/context/compaction/strategies/noop.js +1 -1
- package/dist/context/compaction/strategies/reactive-overflow-compaction.js +1 -1
- package/dist/context/content-clone.cjs +131 -0
- package/dist/context/content-clone.d.ts +7 -0
- package/dist/context/content-clone.d.ts.map +1 -0
- package/dist/context/content-clone.js +104 -0
- package/dist/context/error-codes.js +1 -1
- package/dist/context/errors.js +1 -1
- package/dist/context/index.cjs +2 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -1
- package/dist/context/manager.cjs +52 -41
- package/dist/context/manager.d.ts +8 -8
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +46 -35
- package/dist/context/media-helpers.js +1 -1
- package/dist/context/schemas.cjs +77 -0
- package/dist/context/schemas.d.ts +5 -0
- package/dist/context/schemas.d.ts.map +1 -0
- package/dist/context/schemas.js +53 -0
- package/dist/context/types.d.ts +1 -1
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/types.js +1 -1
- package/dist/context/utils.cjs +73 -72
- package/dist/context/utils.d.ts +4 -4
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +72 -71
- package/dist/errors/DextoBaseError.js +1 -1
- package/dist/errors/DextoRuntimeError.js +1 -1
- package/dist/errors/DextoValidationError.js +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/result-bridge.js +1 -1
- package/dist/errors/types.js +1 -1
- package/dist/events/index.cjs +9 -1
- package/dist/events/index.d.ts +22 -10
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +10 -2
- package/dist/hooks/builtins/content-policy.js +1 -1
- package/dist/hooks/builtins/response-sanitizer.js +1 -1
- package/dist/hooks/error-codes.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/manager.cjs +1 -1
- package/dist/hooks/manager.d.ts +2 -2
- package/dist/hooks/manager.d.ts.map +1 -1
- package/dist/hooks/manager.js +2 -2
- package/dist/hooks/types.d.ts +2 -2
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/index.browser.cjs +9 -9
- package/dist/index.browser.d.ts +4 -4
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +2 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/llm/curation-config.cjs +3 -3
- package/dist/llm/curation-config.d.ts +1 -1
- package/dist/llm/curation-config.js +4 -4
- package/dist/llm/curation.cjs +2 -2
- package/dist/llm/curation.d.ts +2 -2
- package/dist/llm/curation.d.ts.map +1 -1
- package/dist/llm/curation.js +2 -2
- package/dist/llm/error-codes.js +1 -1
- package/dist/llm/errors.cjs +3 -3
- package/dist/llm/errors.d.ts +1 -1
- package/dist/llm/errors.d.ts.map +1 -1
- package/dist/llm/errors.js +2 -2
- package/dist/llm/{reasoning/anthropic-betas.cjs → executor/index.cjs} +10 -9
- package/dist/llm/executor/index.d.ts +2 -0
- package/dist/llm/executor/index.d.ts.map +1 -0
- package/dist/llm/executor/index.js +11 -0
- package/dist/llm/executor/provider-options.cjs +22 -25
- package/dist/llm/executor/provider-options.d.ts +1 -1
- package/dist/llm/executor/provider-options.d.ts.map +1 -1
- package/dist/llm/executor/provider-options.js +18 -17
- package/dist/llm/executor/stream-processor.cjs +28 -139
- package/dist/llm/executor/stream-processor.d.ts +3 -14
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +29 -140
- package/dist/llm/{reasoning/profiles/openai.cjs → executor/tool-definitions.cjs} +22 -18
- package/dist/llm/executor/tool-definitions.d.ts +4 -0
- package/dist/llm/executor/tool-definitions.d.ts.map +1 -0
- package/dist/llm/executor/tool-definitions.js +22 -0
- package/dist/llm/executor/tool-output-truncator.js +1 -1
- package/dist/llm/executor/turn-executor.cjs +1093 -458
- package/dist/llm/executor/turn-executor.d.ts +269 -43
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +1079 -405
- package/dist/llm/executor/types.d.ts +7 -1
- package/dist/llm/executor/types.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.cjs +2 -2
- package/dist/llm/formatters/vercel.d.ts +1 -1
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +1 -1
- package/dist/llm/index.cjs +2 -4
- package/dist/llm/index.d.ts +1 -2
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +2 -3
- package/dist/llm/providers/codex-app-server.cjs +22 -2
- package/dist/llm/providers/codex-app-server.d.ts.map +1 -1
- package/dist/llm/providers/codex-app-server.js +23 -3
- package/dist/llm/providers/codex-base-url.js +1 -1
- package/dist/llm/providers/local/ai-sdk-adapter.js +1 -1
- package/dist/llm/providers/local/downloader.js +1 -1
- package/dist/llm/providers/local/error-codes.js +1 -1
- package/dist/llm/providers/local/errors.js +1 -1
- package/dist/llm/providers/local/gpu-detector.js +1 -1
- package/dist/llm/providers/local/index.js +1 -1
- package/dist/llm/providers/local/node-llama-provider.js +1 -1
- package/dist/llm/providers/local/ollama-provider.js +1 -1
- package/dist/llm/providers/local/registry.js +1 -1
- package/dist/llm/providers/local/schemas.js +1 -1
- package/dist/llm/providers/openrouter-model-registry.js +1 -1
- package/dist/llm/registry/auto-update.cjs +5 -5
- package/dist/llm/registry/auto-update.d.ts.map +1 -1
- package/dist/llm/registry/auto-update.js +3 -3
- package/dist/llm/registry/index.cjs +96 -789
- package/dist/llm/registry/index.d.ts +4 -323
- package/dist/llm/registry/index.d.ts.map +1 -1
- package/dist/llm/registry/index.js +100 -763
- package/dist/llm/registry/sync.d.ts +2 -2
- package/dist/llm/registry/sync.d.ts.map +1 -1
- package/dist/llm/registry/sync.js +1 -1
- package/dist/llm/resolver.cjs +7 -6
- package/dist/llm/resolver.d.ts +1 -1
- package/dist/llm/resolver.js +5 -5
- package/dist/llm/schemas.cjs +14 -14
- package/dist/llm/schemas.d.ts +1 -1
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +6 -5
- package/dist/llm/services/factory.cjs +13 -15
- package/dist/llm/services/factory.d.ts +3 -3
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +16 -16
- package/dist/llm/services/types.d.ts +11 -2
- package/dist/llm/services/types.d.ts.map +1 -1
- package/dist/llm/services/vercel.cjs +23 -8
- package/dist/llm/services/vercel.d.ts +11 -7
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +24 -9
- package/dist/llm/usage-metadata.cjs +23 -6
- package/dist/llm/usage-metadata.d.ts +3 -2
- package/dist/llm/usage-metadata.d.ts.map +1 -1
- package/dist/llm/usage-metadata.js +20 -7
- package/dist/llm/usage-scope.js +1 -1
- package/dist/llm/usage-summary.d.ts +1 -1
- package/dist/llm/usage-summary.js +1 -1
- package/dist/llm/validation.cjs +4 -4
- package/dist/llm/validation.d.ts +1 -1
- package/dist/llm/validation.js +2 -2
- package/dist/logger/browser.js +1 -1
- package/dist/logger/default-logger-factory.js +1 -1
- package/dist/logger/factory.js +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/logger/logger.js +1 -1
- package/dist/logger/v2/dexto-logger.js +1 -1
- package/dist/logger/v2/error-codes.js +1 -1
- package/dist/logger/v2/errors.js +1 -1
- package/dist/logger/v2/schemas.js +1 -1
- package/dist/logger/v2/test-utils.js +1 -1
- package/dist/logger/v2/transport-factory.js +1 -1
- package/dist/logger/v2/transports/console-transport.js +1 -1
- package/dist/logger/v2/transports/file-transport.js +1 -1
- package/dist/logger/v2/transports/silent-transport.js +1 -1
- package/dist/logger/v2/types.js +1 -1
- package/dist/mcp/bundled-config.js +1 -1
- package/dist/mcp/error-codes.js +1 -1
- package/dist/mcp/errors.js +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/manager.js +1 -1
- package/dist/mcp/mcp-client.js +1 -1
- package/dist/mcp/resolver.js +1 -1
- package/dist/mcp/schemas.js +1 -1
- package/dist/memory/error-codes.js +1 -1
- package/dist/memory/errors.js +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/memory/manager.cjs +7 -27
- package/dist/memory/manager.d.ts +4 -12
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/manager.js +8 -28
- package/dist/memory/schemas.js +1 -1
- package/dist/prompts/error-codes.js +1 -1
- package/dist/prompts/errors.js +1 -1
- package/dist/prompts/index.js +1 -1
- package/dist/prompts/name-validation.js +1 -1
- package/dist/prompts/prompt-manager.cjs +9 -38
- package/dist/prompts/prompt-manager.d.ts +2 -10
- package/dist/prompts/prompt-manager.d.ts.map +1 -1
- package/dist/prompts/prompt-manager.js +10 -39
- package/dist/prompts/providers/config-prompt-provider.cjs +8 -87
- package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/config-prompt-provider.js +9 -88
- package/dist/prompts/providers/custom-prompt-provider.cjs +21 -22
- package/dist/prompts/providers/custom-prompt-provider.d.ts +19 -4
- package/dist/prompts/providers/custom-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/custom-prompt-provider.js +22 -23
- package/dist/prompts/providers/mcp-prompt-provider.js +1 -1
- package/dist/prompts/schemas.cjs +2 -24
- package/dist/prompts/schemas.d.ts +0 -52
- package/dist/prompts/schemas.d.ts.map +1 -1
- package/dist/prompts/schemas.js +3 -25
- package/dist/prompts/types.d.ts +5 -32
- package/dist/prompts/types.d.ts.map +1 -1
- package/dist/prompts/utils.js +1 -1
- package/dist/resources/agent-resources-provider.js +1 -1
- package/dist/resources/error-codes.js +1 -1
- package/dist/resources/errors.js +1 -1
- package/dist/resources/handlers/blob-handler.cjs +14 -11
- package/dist/resources/handlers/blob-handler.d.ts +4 -4
- package/dist/resources/handlers/blob-handler.d.ts.map +1 -1
- package/dist/resources/handlers/blob-handler.js +15 -12
- package/dist/resources/handlers/factory.cjs +3 -3
- package/dist/resources/handlers/factory.js +4 -4
- package/dist/resources/handlers/filesystem-handler.js +1 -1
- package/dist/resources/handlers/types.d.ts +2 -2
- package/dist/resources/handlers/types.d.ts.map +1 -1
- package/dist/resources/index.js +1 -1
- package/dist/resources/manager.cjs +10 -7
- package/dist/resources/manager.d.ts +4 -4
- package/dist/resources/manager.d.ts.map +1 -1
- package/dist/resources/manager.js +11 -8
- package/dist/resources/reference-parser.js +1 -1
- package/dist/resources/schemas.cjs +1 -1
- package/dist/resources/schemas.d.ts +2 -2
- package/dist/resources/schemas.js +2 -2
- package/dist/runtime/host-runtime.js +1 -1
- package/dist/runtime/index.cjs +3 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +3 -1
- package/dist/runtime/run-context.js +1 -1
- package/dist/search/index.js +1 -1
- package/dist/search/search-service.cjs +6 -13
- package/dist/search/search-service.d.ts +5 -3
- package/dist/search/search-service.d.ts.map +1 -1
- package/dist/search/search-service.js +7 -14
- package/dist/session/chat-session.cjs +264 -108
- package/dist/session/chat-session.d.ts +75 -21
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +268 -108
- package/dist/session/error-codes.js +1 -1
- package/dist/session/errors.js +1 -1
- package/dist/session/index.cjs +19 -2
- package/dist/session/index.d.ts +4 -3
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +19 -3
- package/dist/session/message-queue.cjs +82 -51
- package/dist/session/message-queue.d.ts +13 -8
- package/dist/session/message-queue.d.ts.map +1 -1
- package/dist/session/message-queue.js +83 -52
- package/dist/session/queue-clone.cjs +50 -0
- package/dist/session/queue-clone.d.ts +5 -0
- package/dist/session/queue-clone.d.ts.map +1 -0
- package/dist/session/queue-clone.js +25 -0
- package/dist/session/schemas.cjs +74 -2
- package/dist/session/schemas.d.ts +94 -0
- package/dist/session/schemas.d.ts.map +1 -1
- package/dist/session/schemas.js +69 -2
- package/dist/session/session-manager.cjs +107 -123
- package/dist/session/session-manager.d.ts +8 -7
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +108 -124
- package/dist/session/title-generator.cjs +14 -26
- package/dist/session/title-generator.d.ts +4 -6
- package/dist/session/title-generator.d.ts.map +1 -1
- package/dist/session/title-generator.js +16 -28
- package/dist/session/types.cjs +28 -0
- package/dist/session/types.d.ts +5 -1
- package/dist/session/types.d.ts.map +1 -1
- package/dist/session/types.js +19 -0
- package/dist/{session/history/factory.cjs → skills/index.cjs} +9 -9
- package/dist/skills/index.d.ts +4 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +7 -0
- package/dist/skills/skill-manager.cjs +76 -0
- package/dist/skills/skill-manager.d.ts +13 -0
- package/dist/skills/skill-manager.d.ts.map +1 -0
- package/dist/skills/skill-manager.js +53 -0
- package/dist/skills/types.d.ts +24 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/workspace-skill-source.cjs +120 -0
- package/dist/skills/workspace-skill-source.d.ts +16 -0
- package/dist/skills/workspace-skill-source.d.ts.map +1 -0
- package/dist/skills/workspace-skill-source.js +97 -0
- package/dist/{llm → storage/approvals}/types.cjs +13 -30
- package/dist/storage/approvals/types.d.ts +54 -0
- package/dist/storage/approvals/types.d.ts.map +1 -0
- package/dist/storage/approvals/types.js +14 -0
- package/dist/storage/artifacts/types.d.ts +73 -0
- package/dist/storage/artifacts/types.d.ts.map +1 -0
- package/dist/storage/conversation/database.cjs +233 -0
- package/dist/storage/conversation/database.d.ts +38 -0
- package/dist/storage/conversation/database.d.ts.map +1 -0
- package/dist/storage/conversation/database.js +210 -0
- package/dist/storage/conversation/types.cjs +16 -0
- package/dist/storage/conversation/types.d.ts +21 -0
- package/dist/storage/conversation/types.d.ts.map +1 -0
- package/dist/storage/conversation/types.js +0 -0
- package/dist/storage/database/types.d.ts +4 -0
- package/dist/storage/database/types.d.ts.map +1 -1
- package/dist/storage/error-codes.js +1 -1
- package/dist/storage/errors.cjs +6 -6
- package/dist/storage/errors.d.ts +2 -2
- package/dist/storage/errors.js +7 -7
- package/dist/storage/index.cjs +42 -5
- package/dist/storage/index.d.ts +19 -8
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +39 -4
- package/dist/storage/memories/types.cjs +16 -0
- package/dist/storage/memories/types.d.ts +17 -0
- package/dist/storage/memories/types.d.ts.map +1 -0
- package/dist/storage/memories/types.js +0 -0
- package/dist/storage/message-queue/types.cjs +16 -0
- package/dist/storage/message-queue/types.d.ts +15 -0
- package/dist/storage/message-queue/types.d.ts.map +1 -0
- package/dist/storage/message-queue/types.js +0 -0
- package/dist/storage/prompts/types.cjs +16 -0
- package/dist/storage/prompts/types.d.ts +14 -0
- package/dist/storage/prompts/types.d.ts.map +1 -0
- package/dist/storage/prompts/types.js +0 -0
- package/dist/storage/runtime-events/types.cjs +16 -0
- package/dist/storage/runtime-events/types.d.ts +19 -0
- package/dist/storage/runtime-events/types.d.ts.map +1 -0
- package/dist/storage/runtime-events/types.js +0 -0
- package/dist/storage/sessions/types.cjs +16 -0
- package/dist/storage/sessions/types.d.ts +19 -0
- package/dist/storage/sessions/types.d.ts.map +1 -0
- package/dist/storage/sessions/types.js +0 -0
- package/dist/storage/stores/backend.cjs +702 -0
- package/dist/storage/stores/backend.d.ts +303 -0
- package/dist/storage/stores/backend.d.ts.map +1 -0
- package/dist/storage/stores/backend.js +677 -0
- package/dist/storage/stores/in-memory.cjs +510 -0
- package/dist/storage/stores/in-memory.d.ts +11 -0
- package/dist/storage/stores/in-memory.d.ts.map +1 -0
- package/dist/storage/stores/in-memory.js +487 -0
- package/dist/storage/stores/types.cjs +16 -0
- package/dist/storage/stores/types.d.ts +36 -0
- package/dist/storage/stores/types.d.ts.map +1 -0
- package/dist/storage/stores/types.js +0 -0
- package/dist/storage/tool-executions/types.cjs +127 -0
- package/dist/storage/tool-executions/types.d.ts +193 -0
- package/dist/storage/tool-executions/types.d.ts.map +1 -0
- package/dist/storage/tool-executions/types.js +96 -0
- package/dist/storage/tool-preferences/types.cjs +16 -0
- package/dist/storage/tool-preferences/types.d.ts +29 -0
- package/dist/storage/tool-preferences/types.d.ts.map +1 -0
- package/dist/storage/tool-preferences/types.js +0 -0
- package/dist/storage/tool-state/types.cjs +16 -0
- package/dist/storage/tool-state/types.d.ts +20 -0
- package/dist/storage/tool-state/types.d.ts.map +1 -0
- package/dist/storage/tool-state/types.js +0 -0
- package/dist/storage/workspaces/types.cjs +16 -0
- package/dist/storage/workspaces/types.d.ts +19 -0
- package/dist/storage/workspaces/types.d.ts.map +1 -0
- package/dist/storage/workspaces/types.js +0 -0
- package/dist/systemPrompt/contributors.cjs +10 -14
- package/dist/systemPrompt/contributors.d.ts +3 -3
- package/dist/systemPrompt/contributors.d.ts.map +1 -1
- package/dist/systemPrompt/contributors.js +11 -15
- package/dist/systemPrompt/error-codes.js +1 -1
- package/dist/systemPrompt/errors.js +1 -1
- package/dist/systemPrompt/in-built-prompts.js +1 -1
- package/dist/systemPrompt/index.js +1 -1
- package/dist/systemPrompt/manager.js +1 -1
- package/dist/systemPrompt/registry.js +1 -1
- package/dist/systemPrompt/schemas.js +1 -1
- package/dist/telemetry/decorators.js +1 -1
- package/dist/telemetry/error-codes.js +1 -1
- package/dist/telemetry/errors.js +1 -1
- package/dist/telemetry/exporters.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/schemas.js +1 -1
- package/dist/telemetry/telemetry.js +1 -1
- package/dist/telemetry/utils.js +1 -1
- package/dist/test-utils/in-memory-storage.cjs +9 -17
- package/dist/test-utils/in-memory-storage.js +9 -16
- package/dist/test-utils/session-state-stores.cjs +21 -24
- package/dist/test-utils/session-state-stores.js +22 -24
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/factory.cjs +1 -1
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/factory.d.ts +2 -2
- package/dist/tools/approval/allowed-tools-provider/factory.d.ts.map +1 -0
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/factory.js +2 -2
- package/dist/tools/approval/allowed-tools-provider/in-memory.d.ts.map +1 -0
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/in-memory.js +1 -1
- package/dist/tools/approval/allowed-tools-provider/storage.cjs +66 -0
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/storage.d.ts +4 -10
- package/dist/tools/approval/allowed-tools-provider/storage.d.ts.map +1 -0
- package/dist/tools/approval/allowed-tools-provider/storage.js +43 -0
- package/dist/tools/approval/allowed-tools-provider/types.cjs +16 -0
- package/dist/tools/approval/allowed-tools-provider/types.d.ts.map +1 -0
- package/dist/tools/approval/allowed-tools-provider/types.js +0 -0
- package/dist/tools/approval/session-tool-policy.cjs +269 -0
- package/dist/tools/approval/session-tool-policy.d.ts +43 -0
- package/dist/tools/approval/session-tool-policy.d.ts.map +1 -0
- package/dist/tools/approval/session-tool-policy.js +245 -0
- package/dist/tools/define-tool.js +1 -1
- package/dist/tools/display-types.js +1 -1
- package/dist/tools/error-codes.cjs +3 -3
- package/dist/tools/error-codes.d.ts +4 -4
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +4 -4
- package/dist/tools/errors.cjs +12 -12
- package/dist/tools/errors.d.ts +6 -6
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +13 -13
- package/dist/tools/index.cjs +3 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -1
- package/dist/tools/pattern-utils.js +1 -1
- package/dist/tools/presentation/tool-presentation.cjs +182 -0
- package/dist/tools/presentation/tool-presentation.d.ts +51 -0
- package/dist/tools/presentation/tool-presentation.d.ts.map +1 -0
- package/dist/tools/presentation/tool-presentation.js +159 -0
- package/dist/tools/presentation.js +1 -1
- package/dist/tools/schemas.cjs +5 -10
- package/dist/tools/schemas.d.ts +1 -4
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +6 -11
- package/dist/tools/session-tool-preferences-store.cjs +12 -28
- package/dist/tools/session-tool-preferences-store.d.ts +4 -7
- package/dist/tools/session-tool-preferences-store.d.ts.map +1 -1
- package/dist/tools/session-tool-preferences-store.js +12 -29
- package/dist/tools/tool-call-metadata.js +1 -1
- package/dist/tools/tool-manager.cjs +871 -834
- package/dist/tools/tool-manager.d.ts +94 -96
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +876 -833
- package/dist/tools/types.d.ts +10 -14
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.d.ts +1 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.js +1 -1
- package/dist/utils/async-context.js +1 -1
- package/dist/utils/debug.js +1 -1
- package/dist/utils/defer.js +1 -1
- package/dist/utils/env.js +1 -1
- package/dist/utils/error-conversion.js +1 -1
- package/dist/utils/execution-context.js +1 -1
- package/dist/utils/fs-walk.js +1 -1
- package/dist/utils/path.js +1 -1
- package/dist/utils/redactor.js +1 -1
- package/dist/utils/result.js +1 -1
- package/dist/utils/safe-stringify.js +1 -1
- package/dist/utils/schema.js +1 -1
- package/dist/utils/service-initializer.cjs +37 -33
- package/dist/utils/service-initializer.d.ts +9 -5
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +38 -34
- package/dist/utils/zod-schema-converter.js +1 -1
- package/dist/workspace/error-codes.cjs +5 -1
- package/dist/workspace/error-codes.d.ts +4 -0
- package/dist/workspace/error-codes.d.ts.map +1 -1
- package/dist/workspace/error-codes.js +6 -2
- package/dist/workspace/errors.cjs +43 -0
- package/dist/workspace/errors.d.ts +9 -0
- package/dist/workspace/errors.d.ts.map +1 -1
- package/dist/workspace/errors.js +44 -1
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/manager.cjs +21 -29
- package/dist/workspace/manager.d.ts +6 -6
- package/dist/workspace/manager.d.ts.map +1 -1
- package/dist/workspace/manager.js +22 -30
- package/dist/workspace/types.d.ts +47 -0
- package/dist/workspace/types.d.ts.map +1 -1
- package/package.json +116 -3
- package/dist/approval/session-approval-store.cjs +0 -91
- package/dist/approval/session-approval-store.d.ts +0 -37
- package/dist/approval/session-approval-store.d.ts.map +0 -1
- package/dist/approval/session-approval-store.js +0 -68
- package/dist/llm/reasoning/anthropic-betas.d.ts +0 -3
- package/dist/llm/reasoning/anthropic-betas.d.ts.map +0 -1
- package/dist/llm/reasoning/anthropic-betas.js +0 -7
- package/dist/llm/reasoning/anthropic-thinking.cjs +0 -79
- package/dist/llm/reasoning/anthropic-thinking.d.ts +0 -15
- package/dist/llm/reasoning/anthropic-thinking.d.ts.map +0 -1
- package/dist/llm/reasoning/anthropic-thinking.js +0 -52
- package/dist/llm/reasoning/openai-reasoning-effort.cjs +0 -86
- package/dist/llm/reasoning/openai-reasoning-effort.d.ts +0 -5
- package/dist/llm/reasoning/openai-reasoning-effort.d.ts.map +0 -1
- package/dist/llm/reasoning/openai-reasoning-effort.js +0 -61
- package/dist/llm/reasoning/profile.cjs +0 -113
- package/dist/llm/reasoning/profile.d.ts +0 -13
- package/dist/llm/reasoning/profile.d.ts.map +0 -1
- package/dist/llm/reasoning/profile.js +0 -92
- package/dist/llm/reasoning/profiles/anthropic.cjs +0 -61
- package/dist/llm/reasoning/profiles/anthropic.d.ts +0 -8
- package/dist/llm/reasoning/profiles/anthropic.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/anthropic.js +0 -45
- package/dist/llm/reasoning/profiles/bedrock.cjs +0 -54
- package/dist/llm/reasoning/profiles/bedrock.d.ts +0 -3
- package/dist/llm/reasoning/profiles/bedrock.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/bedrock.js +0 -36
- package/dist/llm/reasoning/profiles/google.cjs +0 -45
- package/dist/llm/reasoning/profiles/google.d.ts +0 -9
- package/dist/llm/reasoning/profiles/google.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/google.js +0 -21
- package/dist/llm/reasoning/profiles/openai-compatible.cjs +0 -39
- package/dist/llm/reasoning/profiles/openai-compatible.d.ts +0 -3
- package/dist/llm/reasoning/profiles/openai-compatible.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/openai-compatible.js +0 -16
- package/dist/llm/reasoning/profiles/openai.d.ts +0 -3
- package/dist/llm/reasoning/profiles/openai.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/openai.js +0 -18
- package/dist/llm/reasoning/profiles/openrouter.cjs +0 -83
- package/dist/llm/reasoning/profiles/openrouter.d.ts +0 -10
- package/dist/llm/reasoning/profiles/openrouter.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/openrouter.js +0 -59
- package/dist/llm/reasoning/profiles/shared.cjs +0 -80
- package/dist/llm/reasoning/profiles/shared.d.ts +0 -25
- package/dist/llm/reasoning/profiles/shared.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/shared.js +0 -53
- package/dist/llm/reasoning/profiles/vertex.cjs +0 -46
- package/dist/llm/reasoning/profiles/vertex.d.ts +0 -3
- package/dist/llm/reasoning/profiles/vertex.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/vertex.js +0 -23
- package/dist/llm/registry/models.generated.cjs +0 -10741
- package/dist/llm/registry/models.generated.d.ts +0 -2945
- package/dist/llm/registry/models.generated.d.ts.map +0 -1
- package/dist/llm/registry/models.generated.js +0 -10717
- package/dist/llm/registry/models.manual.cjs +0 -44
- package/dist/llm/registry/models.manual.d.ts +0 -22
- package/dist/llm/registry/models.manual.d.ts.map +0 -1
- package/dist/llm/registry/models.manual.js +0 -21
- package/dist/llm/types.d.ts +0 -39
- package/dist/llm/types.d.ts.map +0 -1
- package/dist/llm/types.js +0 -30
- package/dist/session/history/database.cjs +0 -232
- package/dist/session/history/database.d.ts +0 -41
- package/dist/session/history/database.d.ts.map +0 -1
- package/dist/session/history/database.js +0 -209
- package/dist/session/history/factory.d.ts +0 -11
- package/dist/session/history/factory.d.ts.map +0 -1
- package/dist/session/history/factory.js +0 -8
- package/dist/session/history/memory.cjs +0 -57
- package/dist/session/history/memory.d.ts +0 -22
- package/dist/session/history/memory.d.ts.map +0 -1
- package/dist/session/history/memory.js +0 -34
- package/dist/session/history/types.d.ts +0 -26
- package/dist/session/history/types.d.ts.map +0 -1
- package/dist/session/message-queue-store.cjs +0 -75
- package/dist/session/message-queue-store.d.ts +0 -16
- package/dist/session/message-queue-store.d.ts.map +0 -1
- package/dist/session/message-queue-store.js +0 -52
- package/dist/storage/storage-manager.cjs +0 -209
- package/dist/storage/storage-manager.d.ts +0 -77
- package/dist/storage/storage-manager.d.ts.map +0 -1
- package/dist/storage/storage-manager.js +0 -186
- package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts.map +0 -1
- package/dist/tools/confirmation/allowed-tools-provider/in-memory.d.ts.map +0 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.cjs +0 -69
- package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts.map +0 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.js +0 -46
- package/dist/tools/confirmation/allowed-tools-provider/types.d.ts.map +0 -1
- /package/dist/{session/history → skills}/types.cjs +0 -0
- /package/dist/{session/history → skills}/types.js +0 -0
- /package/dist/{tools/confirmation/allowed-tools-provider → storage/artifacts}/types.cjs +0 -0
- /package/dist/{tools/confirmation/allowed-tools-provider → storage/artifacts}/types.js +0 -0
- /package/dist/tools/{confirmation → approval}/allowed-tools-provider/in-memory.cjs +0 -0
- /package/dist/tools/{confirmation → approval}/allowed-tools-provider/in-memory.d.ts +0 -0
- /package/dist/tools/{confirmation → approval}/allowed-tools-provider/types.d.ts +0 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import "../chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { MessageQueueService } from "./message-queue.js";
|
|
6
|
-
async function generateSessionTitle(config, toolManager, systemPromptManager, resourceManager, userText, logger, opts = {}) {
|
|
1
|
+
import "../chunk-C6A6W6XS.js";
|
|
2
|
+
import { createVercelModel } from "../llm/services/factory.js";
|
|
3
|
+
import { generateText } from "ai";
|
|
4
|
+
async function generateSessionTitle(config, userText, logger, opts = {}) {
|
|
7
5
|
const timeoutMs = opts.timeoutMs;
|
|
8
6
|
const controller = timeoutMs !== void 0 ? new AbortController() : void 0;
|
|
9
7
|
let timer;
|
|
@@ -11,24 +9,12 @@ async function generateSessionTitle(config, toolManager, systemPromptManager, re
|
|
|
11
9
|
timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
12
10
|
}
|
|
13
11
|
try {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const sessionId = `titlegen-${Math.random().toString(36).slice(2)}`;
|
|
17
|
-
const options = {
|
|
18
|
-
messageQueue: MessageQueueService.createEphemeral(bus, logger, sessionId)
|
|
19
|
-
};
|
|
20
|
-
const tempService = createLLMService(
|
|
12
|
+
const providerContext = opts.providerContext ?? {};
|
|
13
|
+
const model = opts.languageModelFactory?.({
|
|
21
14
|
config,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
bus,
|
|
26
|
-
sessionId,
|
|
27
|
-
resourceManager,
|
|
28
|
-
logger,
|
|
29
|
-
options,
|
|
30
|
-
opts.languageModelFactory
|
|
31
|
-
);
|
|
15
|
+
context: providerContext,
|
|
16
|
+
createDefaultLanguageModel: () => createVercelModel(config, providerContext)
|
|
17
|
+
}) ?? createVercelModel(config, providerContext);
|
|
32
18
|
const instruction = [
|
|
33
19
|
"Generate a short conversation title from the following user message.",
|
|
34
20
|
"Rules: 3\u20138 words; no surrounding punctuation, emojis, or PII; return only the title.",
|
|
@@ -36,11 +22,13 @@ async function generateSessionTitle(config, toolManager, systemPromptManager, re
|
|
|
36
22
|
"Message:",
|
|
37
23
|
sanitizeUserText(userText, 512)
|
|
38
24
|
].join("\n");
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
const result = await generateText({
|
|
26
|
+
model,
|
|
27
|
+
prompt: instruction,
|
|
28
|
+
maxOutputTokens: 32,
|
|
29
|
+
...controller ? { abortSignal: controller.signal } : {}
|
|
30
|
+
});
|
|
31
|
+
const processed = postProcessTitle(result.text);
|
|
44
32
|
if (!processed) {
|
|
45
33
|
return { error: "LLM returned empty title" };
|
|
46
34
|
}
|
package/dist/session/types.cjs
CHANGED
|
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
6
10
|
var __copyProps = (to, from, except, desc) => {
|
|
7
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -13,4 +17,28 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
17
|
};
|
|
14
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
19
|
var types_exports = {};
|
|
20
|
+
__export(types_exports, {
|
|
21
|
+
CoalescedMessageSchema: () => CoalescedMessageSchema,
|
|
22
|
+
QueuedMessageSchema: () => QueuedMessageSchema,
|
|
23
|
+
QueuedMessagesSchema: () => QueuedMessagesSchema
|
|
24
|
+
});
|
|
16
25
|
module.exports = __toCommonJS(types_exports);
|
|
26
|
+
var import_zod = require("zod");
|
|
27
|
+
var import_schemas = require("../context/schemas.js");
|
|
28
|
+
const QueuedMessageSchema = import_zod.z.custom(
|
|
29
|
+
(value) => typeof value === "object" && value !== null && "id" in value && typeof value.id === "string" && "queuedAt" in value && typeof value.queuedAt === "number" && "content" in value && Array.isArray(value.content) && value.content.every((part) => import_schemas.ContentPartSchema.safeParse(part).success),
|
|
30
|
+
{ message: "Expected a Dexto queued message." }
|
|
31
|
+
);
|
|
32
|
+
const QueuedMessagesSchema = import_zod.z.array(QueuedMessageSchema);
|
|
33
|
+
const CoalescedMessageSchema = import_zod.z.object({
|
|
34
|
+
messages: QueuedMessagesSchema,
|
|
35
|
+
combinedContent: import_zod.z.array(import_schemas.ContentPartSchema),
|
|
36
|
+
firstQueuedAt: import_zod.z.number(),
|
|
37
|
+
lastQueuedAt: import_zod.z.number()
|
|
38
|
+
}).strict();
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
CoalescedMessageSchema,
|
|
42
|
+
QueuedMessageSchema,
|
|
43
|
+
QueuedMessagesSchema
|
|
44
|
+
});
|
package/dist/session/types.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ContentPart } from '../context/types.js';
|
|
3
|
+
export declare const QueuedMessageSchema: z.ZodType<QueuedMessage>;
|
|
4
|
+
export declare const QueuedMessagesSchema: z.ZodArray<z.ZodType<QueuedMessage, unknown, z.core.$ZodTypeInternals<QueuedMessage, unknown>>>;
|
|
5
|
+
export declare const CoalescedMessageSchema: z.ZodType<CoalescedMessage>;
|
|
2
6
|
export interface QueuedMessage {
|
|
3
7
|
id: string;
|
|
4
8
|
content: ContentPart[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/session/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/session/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAYxD,CAAC;AAEF,eAAO,MAAM,oBAAoB,iGAA+B,CAAC;AAEjE,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAOlD,CAAC;AAEd,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB"}
|
package/dist/session/types.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "../chunk-C6A6W6XS.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { ContentPartSchema } from "../context/schemas.js";
|
|
4
|
+
const QueuedMessageSchema = z.custom(
|
|
5
|
+
(value) => typeof value === "object" && value !== null && "id" in value && typeof value.id === "string" && "queuedAt" in value && typeof value.queuedAt === "number" && "content" in value && Array.isArray(value.content) && value.content.every((part) => ContentPartSchema.safeParse(part).success),
|
|
6
|
+
{ message: "Expected a Dexto queued message." }
|
|
7
|
+
);
|
|
8
|
+
const QueuedMessagesSchema = z.array(QueuedMessageSchema);
|
|
9
|
+
const CoalescedMessageSchema = z.object({
|
|
10
|
+
messages: QueuedMessagesSchema,
|
|
11
|
+
combinedContent: z.array(ContentPartSchema),
|
|
12
|
+
firstQueuedAt: z.number(),
|
|
13
|
+
lastQueuedAt: z.number()
|
|
14
|
+
}).strict();
|
|
15
|
+
export {
|
|
16
|
+
CoalescedMessageSchema,
|
|
17
|
+
QueuedMessageSchema,
|
|
18
|
+
QueuedMessagesSchema
|
|
19
|
+
};
|
|
@@ -16,16 +16,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
|
|
19
|
+
var skills_exports = {};
|
|
20
|
+
__export(skills_exports, {
|
|
21
|
+
CompositeSkillManager: () => import_skill_manager.CompositeSkillManager,
|
|
22
|
+
WorkspaceSkillSource: () => import_workspace_skill_source.WorkspaceSkillSource
|
|
22
23
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
return new import_database.DatabaseHistoryProvider(sessionId, database, logger);
|
|
27
|
-
}
|
|
24
|
+
module.exports = __toCommonJS(skills_exports);
|
|
25
|
+
var import_skill_manager = require("./skill-manager.js");
|
|
26
|
+
var import_workspace_skill_source = require("./workspace-skill-source.js");
|
|
28
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
28
|
0 && (module.exports = {
|
|
30
|
-
|
|
29
|
+
CompositeSkillManager,
|
|
30
|
+
WorkspaceSkillSource
|
|
31
31
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var skill_manager_exports = {};
|
|
20
|
+
__export(skill_manager_exports, {
|
|
21
|
+
CompositeSkillManager: () => CompositeSkillManager
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(skill_manager_exports);
|
|
24
|
+
class CompositeSkillManager {
|
|
25
|
+
constructor(sources) {
|
|
26
|
+
this.sources = sources;
|
|
27
|
+
}
|
|
28
|
+
async list() {
|
|
29
|
+
return (await this.entries()).map((entry) => entry.summary);
|
|
30
|
+
}
|
|
31
|
+
async get(id) {
|
|
32
|
+
const entry = await this.findEntry(id);
|
|
33
|
+
if (!entry?.source.get) return null;
|
|
34
|
+
return entry.source.get(entry.summary.id);
|
|
35
|
+
}
|
|
36
|
+
async readFile(skillId, path) {
|
|
37
|
+
const entry = await this.findEntry(skillId);
|
|
38
|
+
if (!entry?.source.readFile) throw new Error(`Skill file not found: ${skillId}/${path}`);
|
|
39
|
+
return entry.source.readFile(entry.summary.id, path);
|
|
40
|
+
}
|
|
41
|
+
async invoke(id, args) {
|
|
42
|
+
const entry = await this.findEntry(id);
|
|
43
|
+
if (!entry) return null;
|
|
44
|
+
if (entry.source.invoke) {
|
|
45
|
+
return entry.source.invoke(entry.summary.id, args);
|
|
46
|
+
}
|
|
47
|
+
if (!entry.source.get) return null;
|
|
48
|
+
return entry.source.get(entry.summary.id);
|
|
49
|
+
}
|
|
50
|
+
async refresh() {
|
|
51
|
+
for (const source of this.sources) {
|
|
52
|
+
await source.refresh?.();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async findEntry(id) {
|
|
56
|
+
return (await this.entries()).find(
|
|
57
|
+
(entry) => entry.summary.id === id || entry.summary.displayName === id
|
|
58
|
+
) ?? null;
|
|
59
|
+
}
|
|
60
|
+
async entries() {
|
|
61
|
+
const seen = /* @__PURE__ */ new Set();
|
|
62
|
+
const skills = [];
|
|
63
|
+
for (const source of this.sources) {
|
|
64
|
+
for (const skill of await source.list()) {
|
|
65
|
+
if (seen.has(skill.id)) continue;
|
|
66
|
+
seen.add(skill.id);
|
|
67
|
+
skills.push({ source, summary: skill });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return skills;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
+
0 && (module.exports = {
|
|
75
|
+
CompositeSkillManager
|
|
76
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SkillDocument, SkillManager, SkillSource, SkillSummary } from './types.js';
|
|
2
|
+
export declare class CompositeSkillManager implements SkillManager {
|
|
3
|
+
private sources;
|
|
4
|
+
constructor(sources: SkillSource[]);
|
|
5
|
+
list(): Promise<SkillSummary[]>;
|
|
6
|
+
get(id: string): Promise<SkillDocument | null>;
|
|
7
|
+
readFile(skillId: string, path: string): Promise<string>;
|
|
8
|
+
invoke(id: string, args?: Record<string, string>): Promise<SkillDocument | null>;
|
|
9
|
+
refresh(): Promise<void>;
|
|
10
|
+
private findEntry;
|
|
11
|
+
private entries;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=skill-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-manager.d.ts","sourceRoot":"","sources":["../../src/skills/skill-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAOzF,qBAAa,qBAAsB,YAAW,YAAY;IAC1C,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW,EAAE;IAEpC,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAI/B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAM9C,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMxD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAUhF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAMhB,SAAS;YAQT,OAAO;CAcxB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import "../chunk-C6A6W6XS.js";
|
|
2
|
+
class CompositeSkillManager {
|
|
3
|
+
constructor(sources) {
|
|
4
|
+
this.sources = sources;
|
|
5
|
+
}
|
|
6
|
+
async list() {
|
|
7
|
+
return (await this.entries()).map((entry) => entry.summary);
|
|
8
|
+
}
|
|
9
|
+
async get(id) {
|
|
10
|
+
const entry = await this.findEntry(id);
|
|
11
|
+
if (!entry?.source.get) return null;
|
|
12
|
+
return entry.source.get(entry.summary.id);
|
|
13
|
+
}
|
|
14
|
+
async readFile(skillId, path) {
|
|
15
|
+
const entry = await this.findEntry(skillId);
|
|
16
|
+
if (!entry?.source.readFile) throw new Error(`Skill file not found: ${skillId}/${path}`);
|
|
17
|
+
return entry.source.readFile(entry.summary.id, path);
|
|
18
|
+
}
|
|
19
|
+
async invoke(id, args) {
|
|
20
|
+
const entry = await this.findEntry(id);
|
|
21
|
+
if (!entry) return null;
|
|
22
|
+
if (entry.source.invoke) {
|
|
23
|
+
return entry.source.invoke(entry.summary.id, args);
|
|
24
|
+
}
|
|
25
|
+
if (!entry.source.get) return null;
|
|
26
|
+
return entry.source.get(entry.summary.id);
|
|
27
|
+
}
|
|
28
|
+
async refresh() {
|
|
29
|
+
for (const source of this.sources) {
|
|
30
|
+
await source.refresh?.();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async findEntry(id) {
|
|
34
|
+
return (await this.entries()).find(
|
|
35
|
+
(entry) => entry.summary.id === id || entry.summary.displayName === id
|
|
36
|
+
) ?? null;
|
|
37
|
+
}
|
|
38
|
+
async entries() {
|
|
39
|
+
const seen = /* @__PURE__ */ new Set();
|
|
40
|
+
const skills = [];
|
|
41
|
+
for (const source of this.sources) {
|
|
42
|
+
for (const skill of await source.list()) {
|
|
43
|
+
if (seen.has(skill.id)) continue;
|
|
44
|
+
seen.add(skill.id);
|
|
45
|
+
skills.push({ source, summary: skill });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return skills;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
CompositeSkillManager
|
|
53
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface SkillSummary {
|
|
2
|
+
id: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
description?: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface SkillDocument extends SkillSummary {
|
|
7
|
+
instructions: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SkillSource {
|
|
10
|
+
id: string;
|
|
11
|
+
list(): Promise<SkillSummary[]>;
|
|
12
|
+
get?(id: string): Promise<SkillDocument | null>;
|
|
13
|
+
readFile?(skillId: string, path: string): Promise<string>;
|
|
14
|
+
invoke?(id: string, args?: Record<string, string>): Promise<SkillDocument | null>;
|
|
15
|
+
refresh?(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export interface SkillManager {
|
|
18
|
+
list(): Promise<SkillSummary[]>;
|
|
19
|
+
get(id: string): Promise<SkillDocument | null>;
|
|
20
|
+
readFile(skillId: string, path: string): Promise<string>;
|
|
21
|
+
invoke(id: string, args?: Record<string, string>): Promise<SkillDocument | null>;
|
|
22
|
+
refresh(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/skills/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IAC/C,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAChC,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAChD,QAAQ,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,MAAM,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAClF,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAChC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IACjF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var workspace_skill_source_exports = {};
|
|
20
|
+
__export(workspace_skill_source_exports, {
|
|
21
|
+
WorkspaceSkillSource: () => WorkspaceSkillSource
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(workspace_skill_source_exports);
|
|
24
|
+
const SKILL_PATTERNS = [
|
|
25
|
+
".agents/skills/*/SKILL.md",
|
|
26
|
+
"skills/*/SKILL.md",
|
|
27
|
+
".dexto/skills/*/SKILL.md"
|
|
28
|
+
];
|
|
29
|
+
class WorkspaceSkillSource {
|
|
30
|
+
constructor(workspaceManager) {
|
|
31
|
+
this.workspaceManager = workspaceManager;
|
|
32
|
+
}
|
|
33
|
+
id = "workspace";
|
|
34
|
+
skills;
|
|
35
|
+
async list() {
|
|
36
|
+
return (await this.entries()).map(
|
|
37
|
+
({ skillDirectory: _skillDirectory, skillFile: _skillFile, ...summary }) => ({
|
|
38
|
+
...summary
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
async get(id) {
|
|
43
|
+
const entry = await this.findEntry(id);
|
|
44
|
+
if (!entry) return null;
|
|
45
|
+
const instructions = await this.readWorkspaceText(entry.skillFile);
|
|
46
|
+
return {
|
|
47
|
+
id: entry.id,
|
|
48
|
+
displayName: entry.displayName,
|
|
49
|
+
...entry.description !== void 0 && { description: entry.description },
|
|
50
|
+
instructions
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
async readFile(skillId, path) {
|
|
54
|
+
const entry = await this.findEntry(skillId);
|
|
55
|
+
if (!entry || path.startsWith("/") || path.split("/").includes("..")) {
|
|
56
|
+
throw new Error(`Skill file not found: ${skillId}/${path}`);
|
|
57
|
+
}
|
|
58
|
+
return this.readWorkspaceText(`${entry.skillDirectory}/${path}`);
|
|
59
|
+
}
|
|
60
|
+
async refresh() {
|
|
61
|
+
this.skills = void 0;
|
|
62
|
+
}
|
|
63
|
+
async entries() {
|
|
64
|
+
if (this.skills) return this.skills;
|
|
65
|
+
const workspace = await this.workspaceManager.getWorkspace();
|
|
66
|
+
if (!workspace) {
|
|
67
|
+
this.skills = [];
|
|
68
|
+
return this.skills;
|
|
69
|
+
}
|
|
70
|
+
const handle = await this.workspaceManager.open({ intent: "read" });
|
|
71
|
+
if (typeof handle.files.glob !== "function" || typeof handle.files.readText !== "function") {
|
|
72
|
+
throw new Error("Workspace file capability requires glob and readText");
|
|
73
|
+
}
|
|
74
|
+
const skills = [];
|
|
75
|
+
for (const pattern of SKILL_PATTERNS) {
|
|
76
|
+
const skillFiles = await handle.files.glob(pattern);
|
|
77
|
+
for (const skillFile of skillFiles) {
|
|
78
|
+
const skillDirectory = skillFile.slice(0, -"/SKILL.md".length);
|
|
79
|
+
const id = skillDirectory.split("/").at(-1);
|
|
80
|
+
if (!id) continue;
|
|
81
|
+
const instructions = await handle.files.readText(skillFile);
|
|
82
|
+
const description = frontmatterDescription(instructions);
|
|
83
|
+
skills.push({
|
|
84
|
+
id,
|
|
85
|
+
displayName: firstHeading(instructions) ?? id,
|
|
86
|
+
...description !== void 0 && { description },
|
|
87
|
+
skillDirectory,
|
|
88
|
+
skillFile
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
this.skills = skills;
|
|
93
|
+
return skills;
|
|
94
|
+
}
|
|
95
|
+
async findEntry(id) {
|
|
96
|
+
return (await this.entries()).find((entry) => entry.id === id || entry.displayName === id) ?? null;
|
|
97
|
+
}
|
|
98
|
+
async readWorkspaceText(path) {
|
|
99
|
+
const handle = await this.workspaceManager.open({ intent: "read" });
|
|
100
|
+
if (typeof handle.files.readText !== "function") {
|
|
101
|
+
throw new Error(`Workspace file read unavailable: ${path}`);
|
|
102
|
+
}
|
|
103
|
+
return handle.files.readText(path);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function firstHeading(markdown) {
|
|
107
|
+
const heading = markdown.split("\n").find((line) => line.startsWith("# ") && line.slice(2).trim().length > 0);
|
|
108
|
+
return heading?.slice(2).trim();
|
|
109
|
+
}
|
|
110
|
+
function frontmatterDescription(markdown) {
|
|
111
|
+
if (!markdown.startsWith("---\n")) return void 0;
|
|
112
|
+
const end = markdown.indexOf("\n---", 4);
|
|
113
|
+
if (end < 0) return void 0;
|
|
114
|
+
const line = markdown.slice(4, end).split("\n").find((candidate) => candidate.trim().startsWith("description:"));
|
|
115
|
+
return line?.split(":").slice(1).join(":").trim() || void 0;
|
|
116
|
+
}
|
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
+
0 && (module.exports = {
|
|
119
|
+
WorkspaceSkillSource
|
|
120
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WorkspaceManager } from '../workspace/index.js';
|
|
2
|
+
import type { SkillDocument, SkillSource, SkillSummary } from './types.js';
|
|
3
|
+
export declare class WorkspaceSkillSource implements SkillSource {
|
|
4
|
+
private workspaceManager;
|
|
5
|
+
readonly id = "workspace";
|
|
6
|
+
private skills;
|
|
7
|
+
constructor(workspaceManager: Pick<WorkspaceManager, 'getWorkspace' | 'open'>);
|
|
8
|
+
list(): Promise<SkillSummary[]>;
|
|
9
|
+
get(id: string): Promise<SkillDocument | null>;
|
|
10
|
+
readFile(skillId: string, path: string): Promise<string>;
|
|
11
|
+
refresh(): Promise<void>;
|
|
12
|
+
private entries;
|
|
13
|
+
private findEntry;
|
|
14
|
+
private readWorkspaceText;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=workspace-skill-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-skill-source.d.ts","sourceRoot":"","sources":["../../src/skills/workspace-skill-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAa3E,qBAAa,oBAAqB,YAAW,WAAW;IAIxC,OAAO,CAAC,gBAAgB;IAHpC,QAAQ,CAAC,EAAE,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAoC;gBAE9B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,cAAc,GAAG,MAAM,CAAC;IAE/E,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAQ/B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAY9C,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQxD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAIhB,OAAO;YAwCP,SAAS;YAOT,iBAAiB;CAOlC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import "../chunk-C6A6W6XS.js";
|
|
2
|
+
const SKILL_PATTERNS = [
|
|
3
|
+
".agents/skills/*/SKILL.md",
|
|
4
|
+
"skills/*/SKILL.md",
|
|
5
|
+
".dexto/skills/*/SKILL.md"
|
|
6
|
+
];
|
|
7
|
+
class WorkspaceSkillSource {
|
|
8
|
+
constructor(workspaceManager) {
|
|
9
|
+
this.workspaceManager = workspaceManager;
|
|
10
|
+
}
|
|
11
|
+
id = "workspace";
|
|
12
|
+
skills;
|
|
13
|
+
async list() {
|
|
14
|
+
return (await this.entries()).map(
|
|
15
|
+
({ skillDirectory: _skillDirectory, skillFile: _skillFile, ...summary }) => ({
|
|
16
|
+
...summary
|
|
17
|
+
})
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
async get(id) {
|
|
21
|
+
const entry = await this.findEntry(id);
|
|
22
|
+
if (!entry) return null;
|
|
23
|
+
const instructions = await this.readWorkspaceText(entry.skillFile);
|
|
24
|
+
return {
|
|
25
|
+
id: entry.id,
|
|
26
|
+
displayName: entry.displayName,
|
|
27
|
+
...entry.description !== void 0 && { description: entry.description },
|
|
28
|
+
instructions
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async readFile(skillId, path) {
|
|
32
|
+
const entry = await this.findEntry(skillId);
|
|
33
|
+
if (!entry || path.startsWith("/") || path.split("/").includes("..")) {
|
|
34
|
+
throw new Error(`Skill file not found: ${skillId}/${path}`);
|
|
35
|
+
}
|
|
36
|
+
return this.readWorkspaceText(`${entry.skillDirectory}/${path}`);
|
|
37
|
+
}
|
|
38
|
+
async refresh() {
|
|
39
|
+
this.skills = void 0;
|
|
40
|
+
}
|
|
41
|
+
async entries() {
|
|
42
|
+
if (this.skills) return this.skills;
|
|
43
|
+
const workspace = await this.workspaceManager.getWorkspace();
|
|
44
|
+
if (!workspace) {
|
|
45
|
+
this.skills = [];
|
|
46
|
+
return this.skills;
|
|
47
|
+
}
|
|
48
|
+
const handle = await this.workspaceManager.open({ intent: "read" });
|
|
49
|
+
if (typeof handle.files.glob !== "function" || typeof handle.files.readText !== "function") {
|
|
50
|
+
throw new Error("Workspace file capability requires glob and readText");
|
|
51
|
+
}
|
|
52
|
+
const skills = [];
|
|
53
|
+
for (const pattern of SKILL_PATTERNS) {
|
|
54
|
+
const skillFiles = await handle.files.glob(pattern);
|
|
55
|
+
for (const skillFile of skillFiles) {
|
|
56
|
+
const skillDirectory = skillFile.slice(0, -"/SKILL.md".length);
|
|
57
|
+
const id = skillDirectory.split("/").at(-1);
|
|
58
|
+
if (!id) continue;
|
|
59
|
+
const instructions = await handle.files.readText(skillFile);
|
|
60
|
+
const description = frontmatterDescription(instructions);
|
|
61
|
+
skills.push({
|
|
62
|
+
id,
|
|
63
|
+
displayName: firstHeading(instructions) ?? id,
|
|
64
|
+
...description !== void 0 && { description },
|
|
65
|
+
skillDirectory,
|
|
66
|
+
skillFile
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
this.skills = skills;
|
|
71
|
+
return skills;
|
|
72
|
+
}
|
|
73
|
+
async findEntry(id) {
|
|
74
|
+
return (await this.entries()).find((entry) => entry.id === id || entry.displayName === id) ?? null;
|
|
75
|
+
}
|
|
76
|
+
async readWorkspaceText(path) {
|
|
77
|
+
const handle = await this.workspaceManager.open({ intent: "read" });
|
|
78
|
+
if (typeof handle.files.readText !== "function") {
|
|
79
|
+
throw new Error(`Workspace file read unavailable: ${path}`);
|
|
80
|
+
}
|
|
81
|
+
return handle.files.readText(path);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function firstHeading(markdown) {
|
|
85
|
+
const heading = markdown.split("\n").find((line) => line.startsWith("# ") && line.slice(2).trim().length > 0);
|
|
86
|
+
return heading?.slice(2).trim();
|
|
87
|
+
}
|
|
88
|
+
function frontmatterDescription(markdown) {
|
|
89
|
+
if (!markdown.startsWith("---\n")) return void 0;
|
|
90
|
+
const end = markdown.indexOf("\n---", 4);
|
|
91
|
+
if (end < 0) return void 0;
|
|
92
|
+
const line = markdown.slice(4, end).split("\n").find((candidate) => candidate.trim().startsWith("description:"));
|
|
93
|
+
return line?.split(":").slice(1).join(":").trim() || void 0;
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
WorkspaceSkillSource
|
|
97
|
+
};
|
|
@@ -18,38 +18,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
SUPPORTED_FILE_TYPES: () => SUPPORTED_FILE_TYPES
|
|
21
|
+
PersistedApprovedDirectorySchema: () => PersistedApprovedDirectorySchema,
|
|
22
|
+
SessionApprovalStateSchema: () => SessionApprovalStateSchema
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(types_exports);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"glm",
|
|
36
|
-
"openrouter",
|
|
37
|
-
"litellm",
|
|
38
|
-
"glama",
|
|
39
|
-
"vertex",
|
|
40
|
-
"bedrock",
|
|
41
|
-
"local",
|
|
42
|
-
// Native node-llama-cpp execution (GGUF models)
|
|
43
|
-
"ollama",
|
|
44
|
-
// Ollama server integration
|
|
45
|
-
"dexto-nova"
|
|
46
|
-
// Dexto gateway - routes through api.dexto.ai/v1 with billing
|
|
47
|
-
];
|
|
48
|
-
const LLM_PRICING_STATUSES = ["estimated", "unpriced"];
|
|
49
|
-
const SUPPORTED_FILE_TYPES = ["pdf", "image", "audio", "video", "document"];
|
|
25
|
+
var import_zod = require("zod");
|
|
26
|
+
const PersistedApprovedDirectorySchema = import_zod.z.object({
|
|
27
|
+
path: import_zod.z.string(),
|
|
28
|
+
type: import_zod.z.enum(["session", "once"])
|
|
29
|
+
}).strict();
|
|
30
|
+
const SessionApprovalStateSchema = import_zod.z.object({
|
|
31
|
+
toolPatterns: import_zod.z.record(import_zod.z.string(), import_zod.z.array(import_zod.z.string())).default({}),
|
|
32
|
+
approvedDirectories: import_zod.z.array(PersistedApprovedDirectorySchema).default([])
|
|
33
|
+
}).strict();
|
|
50
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
51
35
|
0 && (module.exports = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
SUPPORTED_FILE_TYPES
|
|
36
|
+
PersistedApprovedDirectorySchema,
|
|
37
|
+
SessionApprovalStateSchema
|
|
55
38
|
});
|