@dexto/core 1.2.4 → 1.2.6
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/README.md +60 -0
- package/dist/agent/DextoAgent.cjs +579 -345
- package/dist/agent/DextoAgent.d.ts +131 -83
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +573 -336
- package/dist/agent/agentCard.cjs +4 -2
- package/dist/agent/agentCard.d.ts +0 -1
- package/dist/agent/agentCard.d.ts.map +1 -1
- package/dist/agent/agentCard.js +4 -2
- package/dist/agent/index.cjs +3 -7
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +7 -6
- package/dist/agent/schemas.cjs +179 -75
- package/dist/agent/schemas.d.ts +2678 -586
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/agent/schemas.js +172 -65
- package/dist/agent/state-manager.cjs +28 -23
- package/dist/agent/state-manager.d.ts +4 -1
- package/dist/agent/state-manager.d.ts.map +1 -1
- package/dist/agent/state-manager.js +28 -23
- package/dist/{preferences/constants.cjs → agent/types.cjs} +2 -14
- package/dist/agent/types.d.ts +54 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +0 -0
- package/dist/approval/errors.cjs +89 -8
- package/dist/approval/errors.d.ts +5 -3
- package/dist/approval/errors.d.ts.map +1 -1
- package/dist/approval/errors.js +89 -8
- package/dist/approval/{providers/factory.d.ts → factory.d.ts} +2 -2
- package/dist/approval/factory.d.ts.map +1 -0
- package/dist/approval/{providers/factory.js → factory.js} +1 -1
- package/dist/approval/index.cjs +4 -6
- package/dist/approval/index.d.ts +3 -5
- package/dist/approval/index.d.ts.map +1 -1
- package/dist/approval/index.js +4 -5
- package/dist/approval/manager.cjs +140 -37
- package/dist/approval/manager.d.ts +56 -17
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +141 -38
- package/dist/approval/schemas.cjs +9 -1
- package/dist/approval/schemas.d.ts +120 -35
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +9 -2
- package/dist/approval/types.cjs +14 -2
- package/dist/approval/types.d.ts +64 -12
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +12 -1
- package/dist/context/compression/middle-removal.cjs +11 -11
- package/dist/context/compression/middle-removal.d.ts +3 -1
- package/dist/context/compression/middle-removal.d.ts.map +1 -1
- package/dist/context/compression/middle-removal.js +11 -11
- package/dist/context/compression/oldest-removal.cjs +18 -5
- package/dist/context/compression/oldest-removal.d.ts +3 -1
- package/dist/context/compression/oldest-removal.d.ts.map +1 -1
- package/dist/context/compression/oldest-removal.js +18 -5
- package/dist/context/manager.cjs +94 -67
- package/dist/context/manager.d.ts +13 -10
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +94 -67
- package/dist/context/utils.cjs +79 -65
- package/dist/context/utils.d.ts +15 -12
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +45 -31
- package/dist/errors/DextoRuntimeError.d.ts +5 -5
- package/dist/errors/DextoRuntimeError.d.ts.map +1 -1
- package/dist/errors/result-bridge.cjs +2 -3
- package/dist/errors/result-bridge.d.ts +5 -3
- package/dist/errors/result-bridge.d.ts.map +1 -1
- package/dist/errors/result-bridge.js +1 -2
- package/dist/errors/types.cjs +1 -2
- package/dist/errors/types.d.ts +5 -8
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/errors/types.js +1 -2
- package/dist/events/index.cjs +125 -55
- package/dist/events/index.d.ts +204 -97
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +123 -55
- package/dist/filesystem/filesystem-service.cjs +40 -30
- package/dist/filesystem/filesystem-service.d.ts +9 -1
- package/dist/filesystem/filesystem-service.d.ts.map +1 -1
- package/dist/filesystem/filesystem-service.js +40 -30
- package/dist/filesystem/path-validator.cjs +4 -3
- package/dist/filesystem/path-validator.d.ts +3 -1
- package/dist/filesystem/path-validator.d.ts.map +1 -1
- package/dist/filesystem/path-validator.js +4 -3
- package/dist/filesystem/types.d.ts +3 -3
- package/dist/filesystem/types.d.ts.map +1 -1
- package/dist/index.browser.cjs +7 -0
- package/dist/index.browser.d.ts +2 -0
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +4 -0
- package/dist/index.cjs +0 -7
- package/dist/index.d.ts +12 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/llm/formatters/anthropic.cjs +32 -21
- package/dist/llm/formatters/anthropic.d.ts +3 -0
- package/dist/llm/formatters/anthropic.d.ts.map +1 -1
- package/dist/llm/formatters/anthropic.js +32 -21
- package/dist/llm/formatters/factory.cjs +6 -7
- package/dist/llm/formatters/factory.d.ts +2 -1
- package/dist/llm/formatters/factory.d.ts.map +1 -1
- package/dist/llm/formatters/factory.js +4 -5
- package/dist/llm/formatters/openai.cjs +38 -9
- package/dist/llm/formatters/openai.d.ts +3 -0
- package/dist/llm/formatters/openai.d.ts.map +1 -1
- package/dist/llm/formatters/openai.js +38 -9
- package/dist/llm/formatters/vercel.cjs +49 -8
- package/dist/llm/formatters/vercel.d.ts +3 -0
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +49 -8
- package/dist/llm/registry.cjs +153 -17
- package/dist/llm/registry.d.ts +5 -2
- package/dist/llm/registry.d.ts.map +1 -1
- package/dist/llm/registry.js +143 -7
- package/dist/llm/resolver.cjs +4 -4
- package/dist/llm/resolver.d.ts +3 -2
- package/dist/llm/resolver.d.ts.map +1 -1
- package/dist/llm/resolver.js +4 -4
- package/dist/llm/schemas.cjs +6 -3
- package/dist/llm/schemas.d.ts +51 -17
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +5 -3
- package/dist/llm/services/anthropic.cjs +216 -183
- package/dist/llm/services/anthropic.d.ts +3 -1
- package/dist/llm/services/anthropic.d.ts.map +1 -1
- package/dist/llm/services/anthropic.js +217 -184
- package/dist/llm/services/factory.cjs +15 -9
- package/dist/llm/services/factory.d.ts +2 -1
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +15 -9
- package/dist/llm/services/openai.cjs +262 -225
- package/dist/llm/services/openai.d.ts +3 -1
- package/dist/llm/services/openai.d.ts.map +1 -1
- package/dist/llm/services/openai.js +263 -226
- package/dist/llm/services/test-utils.integration.cjs +58 -12
- package/dist/llm/services/test-utils.integration.d.ts.map +1 -1
- package/dist/llm/services/test-utils.integration.js +58 -12
- package/dist/llm/services/types.d.ts +9 -0
- package/dist/llm/services/types.d.ts.map +1 -1
- package/dist/llm/services/vercel.cjs +163 -111
- package/dist/llm/services/vercel.d.ts +3 -1
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +157 -105
- package/dist/llm/tokenizer/factory.cjs +2 -2
- package/dist/llm/tokenizer/factory.d.ts +3 -1
- package/dist/llm/tokenizer/factory.d.ts.map +1 -1
- package/dist/llm/tokenizer/factory.js +2 -2
- package/dist/llm/tokenizer/openai.cjs +16 -9
- package/dist/llm/tokenizer/openai.d.ts +4 -1
- package/dist/llm/tokenizer/openai.d.ts.map +1 -1
- package/dist/llm/tokenizer/openai.js +16 -9
- package/dist/llm/validation.cjs +8 -9
- package/dist/llm/validation.d.ts +3 -1
- package/dist/llm/validation.d.ts.map +1 -1
- package/dist/llm/validation.js +5 -6
- package/dist/logger/factory.cjs +54 -0
- package/dist/logger/factory.d.ts +36 -0
- package/dist/logger/factory.d.ts.map +1 -0
- package/dist/logger/factory.js +31 -0
- package/dist/logger/index.cjs +42 -3
- package/dist/logger/index.d.ts +17 -1
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +26 -1
- package/dist/logger/logger.cjs +30 -17
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +30 -17
- package/dist/logger/v2/dexto-logger.cjs +141 -0
- package/dist/logger/v2/dexto-logger.d.ts +54 -0
- package/dist/logger/v2/dexto-logger.d.ts.map +1 -0
- package/dist/logger/v2/dexto-logger.js +118 -0
- package/dist/{preferences → logger/v2}/error-codes.cjs +11 -10
- package/dist/logger/v2/error-codes.d.ts +13 -0
- package/dist/logger/v2/error-codes.d.ts.map +1 -0
- package/dist/logger/v2/error-codes.js +13 -0
- package/dist/logger/v2/errors.cjs +107 -0
- package/dist/logger/v2/errors.d.ts +32 -0
- package/dist/logger/v2/errors.d.ts.map +1 -0
- package/dist/logger/v2/errors.js +84 -0
- package/dist/logger/v2/schemas.cjs +57 -0
- package/dist/logger/v2/schemas.d.ts +147 -0
- package/dist/logger/v2/schemas.d.ts.map +1 -0
- package/dist/logger/v2/schemas.js +33 -0
- package/dist/logger/v2/transport-factory.cjs +53 -0
- package/dist/logger/v2/transport-factory.d.ts +21 -0
- package/dist/logger/v2/transport-factory.d.ts.map +1 -0
- package/dist/logger/v2/transport-factory.js +29 -0
- package/dist/logger/v2/transports/console-transport.cjs +79 -0
- package/dist/logger/v2/transports/console-transport.d.ts +23 -0
- package/dist/logger/v2/transports/console-transport.d.ts.map +1 -0
- package/dist/logger/v2/transports/console-transport.js +46 -0
- package/dist/logger/v2/transports/file-transport.cjs +161 -0
- package/dist/logger/v2/transports/file-transport.d.ts +46 -0
- package/dist/logger/v2/transports/file-transport.d.ts.map +1 -0
- package/dist/logger/v2/transports/file-transport.js +128 -0
- package/dist/logger/v2/types.cjs +49 -0
- package/dist/logger/v2/types.d.ts +123 -0
- package/dist/logger/v2/types.d.ts.map +1 -0
- package/dist/logger/v2/types.js +26 -0
- package/dist/mcp/manager.cjs +88 -78
- package/dist/mcp/manager.d.ts +3 -1
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +88 -78
- package/dist/mcp/mcp-client.cjs +109 -79
- package/dist/mcp/mcp-client.d.ts +3 -0
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +102 -72
- package/dist/memory/index.cjs +2 -0
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +3 -1
- package/dist/memory/manager.cjs +9 -7
- package/dist/memory/manager.d.ts +3 -1
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/manager.js +9 -7
- package/dist/memory/schemas.cjs +10 -0
- package/dist/memory/schemas.d.ts +37 -8
- package/dist/memory/schemas.d.ts.map +1 -1
- package/dist/memory/schemas.js +9 -0
- package/dist/plugins/manager.cjs +21 -19
- package/dist/plugins/manager.d.ts +3 -1
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/plugins/manager.js +21 -19
- package/dist/plugins/schemas.d.ts +9 -9
- package/dist/plugins/types.d.ts +2 -2
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/process/command-validator.cjs +30 -20
- package/dist/process/command-validator.d.ts +4 -1
- package/dist/process/command-validator.d.ts.map +1 -1
- package/dist/process/command-validator.js +30 -20
- package/dist/process/process-service.cjs +23 -21
- package/dist/process/process-service.d.ts +3 -1
- package/dist/process/process-service.d.ts.map +1 -1
- package/dist/process/process-service.js +23 -21
- package/dist/prompts/index.cjs +6 -8
- package/dist/prompts/index.d.ts +2 -4
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +4 -6
- package/dist/prompts/prompt-manager.cjs +25 -20
- package/dist/prompts/prompt-manager.d.ts +3 -1
- package/dist/prompts/prompt-manager.d.ts.map +1 -1
- package/dist/prompts/prompt-manager.js +25 -20
- package/dist/prompts/providers/config-prompt-provider.cjs +331 -0
- package/dist/prompts/providers/config-prompt-provider.d.ts +34 -0
- package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -0
- package/dist/prompts/providers/config-prompt-provider.js +308 -0
- package/dist/prompts/providers/custom-prompt-provider.cjs +11 -7
- package/dist/prompts/providers/custom-prompt-provider.d.ts +3 -1
- package/dist/prompts/providers/custom-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/custom-prompt-provider.js +11 -7
- package/dist/prompts/providers/mcp-prompt-provider.cjs +7 -6
- package/dist/prompts/providers/mcp-prompt-provider.d.ts +3 -1
- package/dist/prompts/providers/mcp-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/mcp-prompt-provider.js +7 -6
- package/dist/prompts/schemas.cjs +42 -23
- package/dist/prompts/schemas.d.ts +123 -14
- package/dist/prompts/schemas.d.ts.map +1 -1
- package/dist/prompts/schemas.js +39 -22
- package/dist/prompts/types.d.ts +1 -1
- package/dist/prompts/types.d.ts.map +1 -1
- package/dist/resources/handlers/blob-handler.cjs +15 -11
- package/dist/resources/handlers/blob-handler.d.ts +3 -1
- package/dist/resources/handlers/blob-handler.d.ts.map +1 -1
- package/dist/resources/handlers/blob-handler.js +15 -11
- package/dist/resources/handlers/factory.cjs +3 -3
- package/dist/resources/handlers/factory.d.ts +2 -1
- package/dist/resources/handlers/factory.d.ts.map +1 -1
- package/dist/resources/handlers/factory.js +3 -3
- package/dist/resources/handlers/filesystem-handler.cjs +10 -8
- package/dist/resources/handlers/filesystem-handler.d.ts +3 -1
- package/dist/resources/handlers/filesystem-handler.d.ts.map +1 -1
- package/dist/resources/handlers/filesystem-handler.js +10 -8
- package/dist/resources/internal-provider.cjs +28 -20
- package/dist/resources/internal-provider.d.ts +3 -1
- package/dist/resources/internal-provider.d.ts.map +1 -1
- package/dist/resources/internal-provider.js +28 -20
- package/dist/resources/manager.cjs +34 -25
- package/dist/resources/manager.d.ts +3 -1
- package/dist/resources/manager.d.ts.map +1 -1
- package/dist/resources/manager.js +34 -25
- package/dist/resources/schemas.d.ts +6 -6
- package/dist/search/search-service.cjs +8 -6
- package/dist/search/search-service.d.ts +3 -1
- package/dist/search/search-service.d.ts.map +1 -1
- package/dist/search/search-service.js +8 -6
- package/dist/session/chat-session.cjs +40 -27
- package/dist/session/chat-session.d.ts +10 -7
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +40 -27
- package/dist/session/history/database.cjs +18 -11
- package/dist/session/history/database.d.ts +3 -1
- package/dist/session/history/database.d.ts.map +1 -1
- package/dist/session/history/database.js +18 -11
- package/dist/session/history/factory.cjs +2 -2
- package/dist/session/history/factory.d.ts +5 -1
- package/dist/session/history/factory.d.ts.map +1 -1
- package/dist/session/history/factory.js +2 -2
- package/dist/session/session-manager.cjs +37 -53
- package/dist/session/session-manager.d.ts +3 -17
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +37 -53
- package/dist/session/title-generator.cjs +3 -2
- package/dist/session/title-generator.d.ts +2 -1
- package/dist/session/title-generator.d.ts.map +1 -1
- package/dist/session/title-generator.js +3 -2
- package/dist/storage/blob/factory.cjs +9 -18
- package/dist/storage/blob/factory.d.ts +5 -4
- package/dist/storage/blob/factory.d.ts.map +1 -1
- package/dist/storage/blob/factory.js +8 -17
- package/dist/storage/blob/local-blob-store.cjs +25 -32
- package/dist/storage/blob/local-blob-store.d.ts +3 -2
- package/dist/storage/blob/local-blob-store.d.ts.map +1 -1
- package/dist/storage/blob/local-blob-store.js +25 -32
- package/dist/storage/blob/memory-blob-store.cjs +326 -0
- package/dist/storage/blob/memory-blob-store.d.ts +66 -0
- package/dist/storage/blob/memory-blob-store.d.ts.map +1 -0
- package/dist/storage/blob/memory-blob-store.js +303 -0
- package/dist/storage/blob/schemas.cjs +3 -1
- package/dist/storage/blob/schemas.d.ts +6 -6
- package/dist/storage/blob/schemas.d.ts.map +1 -1
- package/dist/storage/blob/schemas.js +3 -1
- package/dist/storage/cache/factory.cjs +7 -8
- package/dist/storage/cache/factory.d.ts +4 -1
- package/dist/storage/cache/factory.d.ts.map +1 -1
- package/dist/storage/cache/factory.js +4 -5
- package/dist/storage/cache/redis-store.cjs +4 -1
- package/dist/storage/cache/redis-store.d.ts +3 -1
- package/dist/storage/cache/redis-store.d.ts.map +1 -1
- package/dist/storage/cache/redis-store.js +4 -1
- package/dist/storage/database/factory.cjs +13 -16
- package/dist/storage/database/factory.d.ts +5 -3
- package/dist/storage/database/factory.d.ts.map +1 -1
- package/dist/storage/database/factory.js +9 -12
- package/dist/storage/database/postgres-store.cjs +4 -1
- package/dist/storage/database/postgres-store.d.ts +3 -1
- package/dist/storage/database/postgres-store.d.ts.map +1 -1
- package/dist/storage/database/postgres-store.js +4 -1
- package/dist/storage/database/schemas.cjs +3 -4
- package/dist/storage/database/schemas.d.ts +8 -16
- package/dist/storage/database/schemas.d.ts.map +1 -1
- package/dist/storage/database/schemas.js +3 -4
- package/dist/storage/database/sqlite-store.cjs +17 -45
- package/dist/storage/database/sqlite-store.d.ts +3 -3
- package/dist/storage/database/sqlite-store.d.ts.map +1 -1
- package/dist/storage/database/sqlite-store.js +17 -45
- package/dist/storage/schemas.cjs +3 -1
- package/dist/storage/schemas.d.ts +16 -23
- package/dist/storage/schemas.d.ts.map +1 -1
- package/dist/storage/schemas.js +3 -1
- package/dist/storage/storage-manager.cjs +15 -15
- package/dist/storage/storage-manager.d.ts +6 -6
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +15 -15
- package/dist/systemPrompt/contributors.cjs +15 -15
- package/dist/systemPrompt/contributors.d.ts +5 -3
- package/dist/systemPrompt/contributors.d.ts.map +1 -1
- package/dist/systemPrompt/contributors.js +15 -15
- package/dist/systemPrompt/in-built-prompts.cjs +0 -5
- package/dist/systemPrompt/in-built-prompts.d.ts +1 -2
- package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
- package/dist/systemPrompt/in-built-prompts.js +0 -4
- package/dist/systemPrompt/manager.cjs +31 -23
- package/dist/systemPrompt/manager.d.ts +5 -3
- package/dist/systemPrompt/manager.d.ts.map +1 -1
- package/dist/systemPrompt/manager.js +31 -23
- package/dist/systemPrompt/registry.cjs +1 -2
- package/dist/systemPrompt/registry.d.ts +1 -1
- package/dist/systemPrompt/registry.d.ts.map +1 -1
- package/dist/systemPrompt/registry.js +1 -2
- package/dist/systemPrompt/schemas.cjs +24 -18
- package/dist/systemPrompt/schemas.d.ts +46 -222
- package/dist/systemPrompt/schemas.d.ts.map +1 -1
- package/dist/systemPrompt/schemas.js +14 -18
- package/dist/telemetry/decorators.cjs +54 -15
- package/dist/telemetry/decorators.d.ts.map +1 -1
- package/dist/telemetry/decorators.js +54 -15
- package/dist/telemetry/utils.cjs +21 -14
- package/dist/telemetry/utils.d.ts +7 -3
- package/dist/telemetry/utils.d.ts.map +1 -1
- package/dist/telemetry/utils.js +21 -14
- package/dist/tools/confirmation/allowed-tools-provider/factory.cjs +2 -2
- package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts +2 -1
- package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts.map +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/factory.js +2 -2
- package/dist/tools/confirmation/allowed-tools-provider/storage.cjs +7 -6
- package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts +3 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts.map +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.js +7 -6
- package/dist/tools/errors.cjs +2 -1
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +2 -1
- package/dist/tools/internal-tools/constants.cjs +2 -1
- package/dist/tools/internal-tools/constants.d.ts +1 -1
- package/dist/tools/internal-tools/constants.d.ts.map +1 -1
- package/dist/tools/internal-tools/constants.js +2 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.cjs +1 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.js +1 -1
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.cjs +192 -0
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts +33 -0
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.js +169 -0
- package/dist/tools/internal-tools/provider.cjs +21 -17
- package/dist/tools/internal-tools/provider.d.ts +3 -1
- package/dist/tools/internal-tools/provider.d.ts.map +1 -1
- package/dist/tools/internal-tools/provider.js +21 -17
- package/dist/tools/internal-tools/registry.cjs +5 -0
- package/dist/tools/internal-tools/registry.d.ts.map +1 -1
- package/dist/tools/internal-tools/registry.js +5 -0
- package/dist/tools/schemas.cjs +16 -4
- package/dist/tools/schemas.d.ts +21 -9
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +15 -4
- package/dist/tools/tool-manager.cjs +64 -47
- package/dist/tools/tool-manager.d.ts +4 -2
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +61 -44
- package/dist/tools/types.d.ts +0 -4
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/env-file.cjs +118 -0
- package/dist/utils/env-file.d.ts +5 -0
- package/dist/utils/env-file.d.ts.map +1 -0
- package/dist/utils/env-file.js +85 -0
- package/dist/utils/error-conversion.cjs +23 -1
- package/dist/utils/error-conversion.d.ts +2 -1
- package/dist/utils/error-conversion.d.ts.map +1 -1
- package/dist/utils/error-conversion.js +23 -1
- package/dist/utils/execution-context.d.ts.map +1 -1
- package/dist/utils/fs-walk.d.ts.map +1 -1
- package/dist/utils/index.cjs +7 -9
- package/dist/utils/index.d.ts +3 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -4
- package/dist/utils/path.cjs +22 -57
- package/dist/utils/path.d.ts +8 -7
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +21 -54
- package/dist/utils/result.cjs +37 -14
- package/dist/utils/result.d.ts.map +1 -1
- package/dist/utils/result.js +37 -14
- package/dist/utils/schema.cjs +2 -3
- package/dist/utils/schema.d.ts +2 -1
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +1 -2
- package/dist/utils/service-initializer.cjs +88 -61
- package/dist/utils/service-initializer.d.ts +4 -2
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +70 -43
- package/package.json +7 -3
- package/dist/Dexto.cjs +0 -251
- package/dist/Dexto.d.ts +0 -191
- package/dist/Dexto.d.ts.map +0 -1
- package/dist/Dexto.js +0 -228
- package/dist/agent/registry/error-codes.cjs +0 -44
- package/dist/agent/registry/error-codes.d.ts +0 -21
- package/dist/agent/registry/error-codes.d.ts.map +0 -1
- package/dist/agent/registry/error-codes.js +0 -21
- package/dist/agent/registry/errors.cjs +0 -188
- package/dist/agent/registry/errors.d.ts +0 -63
- package/dist/agent/registry/errors.d.ts.map +0 -1
- package/dist/agent/registry/errors.js +0 -165
- package/dist/agent/registry/registry.cjs +0 -479
- package/dist/agent/registry/registry.d.ts +0 -130
- package/dist/agent/registry/registry.d.ts.map +0 -1
- package/dist/agent/registry/registry.js +0 -453
- package/dist/agent/registry/types.cjs +0 -74
- package/dist/agent/registry/types.d.ts +0 -142
- package/dist/agent/registry/types.d.ts.map +0 -1
- package/dist/agent/registry/types.js +0 -48
- package/dist/agent/registry/user-registry.cjs +0 -140
- package/dist/agent/registry/user-registry.d.ts +0 -34
- package/dist/agent/registry/user-registry.d.ts.map +0 -1
- package/dist/agent/registry/user-registry.js +0 -105
- package/dist/approval/providers/event-based-approval-provider.cjs +0 -156
- package/dist/approval/providers/event-based-approval-provider.d.ts +0 -39
- package/dist/approval/providers/event-based-approval-provider.d.ts.map +0 -1
- package/dist/approval/providers/event-based-approval-provider.js +0 -133
- package/dist/approval/providers/factory.d.ts.map +0 -1
- package/dist/approval/providers/noop-approval-provider.cjs +0 -54
- package/dist/approval/providers/noop-approval-provider.d.ts +0 -18
- package/dist/approval/providers/noop-approval-provider.d.ts.map +0 -1
- package/dist/approval/providers/noop-approval-provider.js +0 -31
- package/dist/config/agent-resolver.cjs +0 -153
- package/dist/config/agent-resolver.d.ts +0 -14
- package/dist/config/agent-resolver.d.ts.map +0 -1
- package/dist/config/agent-resolver.js +0 -123
- package/dist/config/error-codes.cjs +0 -39
- package/dist/config/error-codes.d.ts +0 -16
- package/dist/config/error-codes.d.ts.map +0 -1
- package/dist/config/error-codes.js +0 -16
- package/dist/config/errors.cjs +0 -126
- package/dist/config/errors.d.ts +0 -34
- package/dist/config/errors.d.ts.map +0 -1
- package/dist/config/errors.js +0 -103
- package/dist/config/index.cjs +0 -26
- package/dist/config/index.d.ts +0 -4
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -3
- package/dist/config/loader.cjs +0 -119
- package/dist/config/loader.d.ts +0 -16
- package/dist/config/loader.d.ts.map +0 -1
- package/dist/config/loader.js +0 -86
- package/dist/config/writer.cjs +0 -182
- package/dist/config/writer.d.ts +0 -35
- package/dist/config/writer.d.ts.map +0 -1
- package/dist/config/writer.js +0 -147
- package/dist/preferences/constants.d.ts +0 -2
- package/dist/preferences/constants.d.ts.map +0 -1
- package/dist/preferences/constants.js +0 -5
- package/dist/preferences/error-codes.d.ts +0 -8
- package/dist/preferences/error-codes.d.ts.map +0 -1
- package/dist/preferences/error-codes.js +0 -12
- package/dist/preferences/errors.cjs +0 -75
- package/dist/preferences/errors.d.ts +0 -18
- package/dist/preferences/errors.d.ts.map +0 -1
- package/dist/preferences/errors.js +0 -51
- package/dist/preferences/index.cjs +0 -55
- package/dist/preferences/index.d.ts +0 -6
- package/dist/preferences/index.d.ts.map +0 -1
- package/dist/preferences/index.js +0 -32
- package/dist/preferences/loader.cjs +0 -138
- package/dist/preferences/loader.d.ts +0 -51
- package/dist/preferences/loader.d.ts.map +0 -1
- package/dist/preferences/loader.js +0 -110
- package/dist/preferences/schemas.cjs +0 -75
- package/dist/preferences/schemas.d.ts +0 -110
- package/dist/preferences/schemas.d.ts.map +0 -1
- package/dist/preferences/schemas.js +0 -49
- package/dist/prompts/providers/file-prompt-provider.cjs +0 -399
- package/dist/prompts/providers/file-prompt-provider.d.ts +0 -47
- package/dist/prompts/providers/file-prompt-provider.d.ts.map +0 -1
- package/dist/prompts/providers/file-prompt-provider.js +0 -376
- package/dist/prompts/providers/starter-prompt-provider.cjs +0 -170
- package/dist/prompts/providers/starter-prompt-provider.d.ts +0 -45
- package/dist/prompts/providers/starter-prompt-provider.d.ts.map +0 -1
- package/dist/prompts/providers/starter-prompt-provider.js +0 -147
- package/dist/utils/api-key-store.cjs +0 -56
- package/dist/utils/api-key-store.d.ts +0 -24
- package/dist/utils/api-key-store.d.ts.map +0 -1
- package/dist/utils/api-key-store.js +0 -31
- package/dist/utils/env.cjs +0 -154
- package/dist/utils/env.d.ts +0 -28
- package/dist/utils/env.d.ts.map +0 -1
- package/dist/utils/env.js +0 -119
- package/dist/utils/port-utils.cjs +0 -37
- package/dist/utils/port-utils.d.ts +0 -10
- package/dist/utils/port-utils.d.ts.map +0 -1
- package/dist/utils/port-utils.js +0 -14
- package/dist/utils/port-utils.spec.cjs +0 -26
- package/dist/utils/port-utils.spec.js +0 -25
- /package/dist/approval/{providers/factory.cjs → factory.cjs} +0 -0
package/dist/Dexto.cjs
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
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 Dexto_exports = {};
|
|
20
|
-
__export(Dexto_exports, {
|
|
21
|
-
Dexto: () => Dexto
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(Dexto_exports);
|
|
24
|
-
var import_logger = require("./logger/index.js");
|
|
25
|
-
var import_registry = require("./agent/registry/registry.js");
|
|
26
|
-
var import_loader = require("./config/loader.js");
|
|
27
|
-
var import_errors = require("./agent/errors.js");
|
|
28
|
-
var import_DextoAgent = require("./agent/DextoAgent.js");
|
|
29
|
-
var import_types = require("./agent/registry/types.js");
|
|
30
|
-
class Dexto {
|
|
31
|
-
/**
|
|
32
|
-
* Lists available and installed agents from the registry.
|
|
33
|
-
* Returns a structured object containing both installed and available agents,
|
|
34
|
-
* along with metadata like descriptions, authors, and tags.
|
|
35
|
-
*
|
|
36
|
-
* @returns Promise resolving to object with installed and available agent lists
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* const agents = await Dexto.listAgents();
|
|
41
|
-
* console.log(agents.installed); // ['default', 'my-custom-agent']
|
|
42
|
-
* console.log(agents.available); // [{ name: 'productivity', description: '...', ... }]
|
|
43
|
-
* console.log(agents.current?.name); // 'default'
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
static async listAgents() {
|
|
47
|
-
const agentRegistry = (0, import_registry.getAgentRegistry)();
|
|
48
|
-
const availableMap = agentRegistry.getAvailableAgents();
|
|
49
|
-
const installedNames = await agentRegistry.getInstalledAgents();
|
|
50
|
-
const installed = await Promise.all(
|
|
51
|
-
installedNames.map(async (agentId) => {
|
|
52
|
-
const registryEntry = availableMap[agentId];
|
|
53
|
-
if (registryEntry) {
|
|
54
|
-
return {
|
|
55
|
-
id: agentId,
|
|
56
|
-
name: registryEntry.name,
|
|
57
|
-
description: registryEntry.description,
|
|
58
|
-
author: registryEntry.author,
|
|
59
|
-
tags: registryEntry.tags,
|
|
60
|
-
type: registryEntry.type
|
|
61
|
-
};
|
|
62
|
-
} else {
|
|
63
|
-
try {
|
|
64
|
-
const config = await (0, import_loader.loadAgentConfig)(agentId);
|
|
65
|
-
const author = config.agentCard?.provider?.organization;
|
|
66
|
-
const result = {
|
|
67
|
-
id: agentId,
|
|
68
|
-
name: typeof config.agentCard?.name === "string" ? config.agentCard.name : (0, import_types.deriveDisplayName)(agentId),
|
|
69
|
-
description: config.agentCard?.description || "Local agent",
|
|
70
|
-
tags: [],
|
|
71
|
-
type: "custom"
|
|
72
|
-
// Assume custom if not in registry
|
|
73
|
-
};
|
|
74
|
-
if (author) {
|
|
75
|
-
result.author = author;
|
|
76
|
-
}
|
|
77
|
-
return result;
|
|
78
|
-
} catch {
|
|
79
|
-
const result = {
|
|
80
|
-
id: agentId,
|
|
81
|
-
name: (0, import_types.deriveDisplayName)(agentId),
|
|
82
|
-
description: "Local agent (config unavailable)",
|
|
83
|
-
tags: [],
|
|
84
|
-
type: "custom"
|
|
85
|
-
// Assume custom if not in registry
|
|
86
|
-
};
|
|
87
|
-
return result;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
);
|
|
92
|
-
const available = Object.entries(availableMap).filter(([agentId]) => !installedNames.includes(agentId)).map(([agentId, entry]) => ({
|
|
93
|
-
id: agentId,
|
|
94
|
-
name: entry.name,
|
|
95
|
-
description: entry.description,
|
|
96
|
-
author: entry.author,
|
|
97
|
-
tags: entry.tags,
|
|
98
|
-
type: entry.type
|
|
99
|
-
}));
|
|
100
|
-
return {
|
|
101
|
-
installed,
|
|
102
|
-
available,
|
|
103
|
-
current: { id: null, name: null }
|
|
104
|
-
// TODO: Track current agent name
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Installs an agent from the registry.
|
|
109
|
-
* Downloads and sets up the specified agent, making it available for use.
|
|
110
|
-
*
|
|
111
|
-
* @param agentName The name of the agent to install from the registry
|
|
112
|
-
* @returns Promise that resolves when installation is complete
|
|
113
|
-
*
|
|
114
|
-
* @throws {AgentError} When agent is not found in registry or installation fails
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```typescript
|
|
118
|
-
* await Dexto.installAgent('productivity');
|
|
119
|
-
* console.log('Productivity agent installed successfully');
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
static async installAgent(agentName) {
|
|
123
|
-
const agentRegistry = (0, import_registry.getAgentRegistry)();
|
|
124
|
-
if (!agentRegistry.hasAgent(agentName)) {
|
|
125
|
-
throw import_errors.AgentError.apiValidationError(`Agent '${agentName}' not found in registry`);
|
|
126
|
-
}
|
|
127
|
-
try {
|
|
128
|
-
await agentRegistry.installAgent(agentName, true);
|
|
129
|
-
import_logger.logger.info(`Successfully installed agent: ${agentName}`);
|
|
130
|
-
} catch (error) {
|
|
131
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
132
|
-
import_logger.logger.error(`Failed to install agent ${agentName}: ${errorMessage}`);
|
|
133
|
-
throw import_errors.AgentError.apiValidationError(
|
|
134
|
-
`Installation failed for agent '${agentName}'`,
|
|
135
|
-
error
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Installs a custom agent from a local file or directory path.
|
|
141
|
-
* Creates a new custom agent entry in the user registry with provided metadata.
|
|
142
|
-
*
|
|
143
|
-
* @param agentName The name to use for the custom agent (must be unique)
|
|
144
|
-
* @param sourcePath Absolute path to the agent YAML file or directory
|
|
145
|
-
* @param metadata Agent metadata (description, author, tags, main config file)
|
|
146
|
-
* @param injectPreferences Whether to inject global preferences into agent config (default: true)
|
|
147
|
-
* @returns Promise resolving to the path of the installed main config file
|
|
148
|
-
*
|
|
149
|
-
* @throws {AgentError} When name conflicts with existing agent or installation fails
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* ```typescript
|
|
153
|
-
* await Dexto.installCustomAgent('my-coding-agent', '/path/to/agent.yml', {
|
|
154
|
-
* description: 'Custom coding assistant',
|
|
155
|
-
* author: 'John Doe',
|
|
156
|
-
* tags: ['coding', 'custom']
|
|
157
|
-
* });
|
|
158
|
-
* console.log('Custom agent installed successfully');
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
static async installCustomAgent(agentName, sourcePath, metadata, injectPreferences = true) {
|
|
162
|
-
const agentRegistry = (0, import_registry.getAgentRegistry)();
|
|
163
|
-
try {
|
|
164
|
-
const mainConfigPath = await agentRegistry.installCustomAgentFromPath(
|
|
165
|
-
agentName,
|
|
166
|
-
sourcePath,
|
|
167
|
-
metadata,
|
|
168
|
-
injectPreferences
|
|
169
|
-
);
|
|
170
|
-
import_logger.logger.info(`Successfully installed custom agent: ${agentName}`);
|
|
171
|
-
return mainConfigPath;
|
|
172
|
-
} catch (error) {
|
|
173
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
174
|
-
import_logger.logger.error(`Failed to install custom agent ${agentName}: ${errorMessage}`);
|
|
175
|
-
throw import_errors.AgentError.apiValidationError(
|
|
176
|
-
`Installation failed for custom agent '${agentName}'`,
|
|
177
|
-
error
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Uninstalls an agent by removing its directory from disk.
|
|
183
|
-
* For custom agents: also removes from user registry.
|
|
184
|
-
* For builtin agents: only removes from disk (can be reinstalled).
|
|
185
|
-
*
|
|
186
|
-
* @param agentName The name of the agent to uninstall
|
|
187
|
-
* @param force Whether to force uninstall even if agent is protected (default: false)
|
|
188
|
-
* @returns Promise that resolves when uninstallation is complete
|
|
189
|
-
*
|
|
190
|
-
* @throws {AgentError} When agent is not installed or uninstallation fails
|
|
191
|
-
*
|
|
192
|
-
* @example
|
|
193
|
-
* ```typescript
|
|
194
|
-
* await Dexto.uninstallAgent('my-custom-agent');
|
|
195
|
-
* console.log('Agent uninstalled successfully');
|
|
196
|
-
* ```
|
|
197
|
-
*/
|
|
198
|
-
static async uninstallAgent(agentName, force = false) {
|
|
199
|
-
const agentRegistry = (0, import_registry.getAgentRegistry)();
|
|
200
|
-
try {
|
|
201
|
-
await agentRegistry.uninstallAgent(agentName, force);
|
|
202
|
-
import_logger.logger.info(`Successfully uninstalled agent: ${agentName}`);
|
|
203
|
-
} catch (error) {
|
|
204
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
205
|
-
import_logger.logger.error(`Failed to uninstall agent ${agentName}: ${errorMessage}`);
|
|
206
|
-
throw import_errors.AgentError.apiValidationError(
|
|
207
|
-
`Uninstallation failed for agent '${agentName}'`,
|
|
208
|
-
error
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Creates a new agent instance for the specified agent name.
|
|
214
|
-
* This method resolves the agent (installing if needed), loads its configuration,
|
|
215
|
-
* and returns a new DextoAgent instance ready to be started.
|
|
216
|
-
*
|
|
217
|
-
* This is a factory method that doesn't affect any existing agent instances.
|
|
218
|
-
* The caller is responsible for managing the lifecycle of the returned agent.
|
|
219
|
-
*
|
|
220
|
-
* @param agentName The name of the agent to create
|
|
221
|
-
* @returns Promise resolving to a new DextoAgent instance (not started)
|
|
222
|
-
*
|
|
223
|
-
* @throws {AgentError} When agent is not found or creation fails
|
|
224
|
-
*
|
|
225
|
-
* @example
|
|
226
|
-
* ```typescript
|
|
227
|
-
* const newAgent = await Dexto.createAgent('productivity');
|
|
228
|
-
* await newAgent.start();
|
|
229
|
-
* ```
|
|
230
|
-
*/
|
|
231
|
-
static async createAgent(agentName) {
|
|
232
|
-
const agentRegistry = (0, import_registry.getAgentRegistry)();
|
|
233
|
-
try {
|
|
234
|
-
const agentPath = await agentRegistry.resolveAgent(agentName, true, true);
|
|
235
|
-
const config = await (0, import_loader.loadAgentConfig)(agentPath);
|
|
236
|
-
import_logger.logger.info(`Creating agent: ${agentName}`);
|
|
237
|
-
const newAgent = new import_DextoAgent.DextoAgent(config, agentPath);
|
|
238
|
-
import_logger.logger.info(`Successfully created agent: ${agentName}`);
|
|
239
|
-
return newAgent;
|
|
240
|
-
} catch (error) {
|
|
241
|
-
import_logger.logger.error(
|
|
242
|
-
`Failed to create agent '${agentName}': ${error instanceof Error ? error.message : String(error)}`
|
|
243
|
-
);
|
|
244
|
-
throw import_errors.AgentError.apiValidationError(`Failed to create agent '${agentName}'`, error);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
249
|
-
0 && (module.exports = {
|
|
250
|
-
Dexto
|
|
251
|
-
});
|
package/dist/Dexto.d.ts
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { DextoAgent } from './agent/DextoAgent.js';
|
|
2
|
-
/**
|
|
3
|
-
* Dexto - Main orchestrator class for managing Dexto agents
|
|
4
|
-
*
|
|
5
|
-
* This class serves as the primary entry point for agent lifecycle management,
|
|
6
|
-
* including installation, creation, and coordination of multiple agent instances.
|
|
7
|
-
*
|
|
8
|
-
* ## Current Features
|
|
9
|
-
* - **Agent Discovery**: List available and installed agents
|
|
10
|
-
* - **Agent Installation**: Install agents from registry or custom sources
|
|
11
|
-
* - **Agent Creation**: Factory methods for creating agent instances
|
|
12
|
-
* - **Agent Removal**: Uninstall agents from the system
|
|
13
|
-
*
|
|
14
|
-
* ## Future Orchestration Features (Planned)
|
|
15
|
-
* The following features are planned for future releases to enable advanced
|
|
16
|
-
* multi-agent orchestration and coordination:
|
|
17
|
-
*
|
|
18
|
-
* ### Multi-Agent Instance Management
|
|
19
|
-
* - Manage multiple concurrent agent instances with different configurations
|
|
20
|
-
* - Track agent lifecycle states (created, started, stopped, errored)
|
|
21
|
-
* - Provide APIs for listing and querying active agent instances
|
|
22
|
-
*
|
|
23
|
-
* ### Agent Switching & Routing
|
|
24
|
-
* - Switch between active agents dynamically during runtime
|
|
25
|
-
* - Route requests to appropriate agents based on context or capabilities
|
|
26
|
-
* - Maintain conversation continuity across agent switches
|
|
27
|
-
*
|
|
28
|
-
* ### Cross-Agent Coordination
|
|
29
|
-
* - Enable agents to collaborate on complex tasks requiring specialized skills
|
|
30
|
-
* - Delegate sub-tasks from one agent to another
|
|
31
|
-
* - Aggregate results from multiple agents working in parallel
|
|
32
|
-
*
|
|
33
|
-
* ### Global Event Bus
|
|
34
|
-
* - Centralized event bus for cross-agent communication
|
|
35
|
-
* - Subscribe to events from any managed agent instance
|
|
36
|
-
* - Coordinate state synchronization across agent boundaries
|
|
37
|
-
*
|
|
38
|
-
* ### Resource Management
|
|
39
|
-
* - Shared resource pools (API keys, rate limits, connection pools)
|
|
40
|
-
* - Resource allocation and quota management across agents
|
|
41
|
-
* - Prevent resource conflicts between concurrent agent instances
|
|
42
|
-
*
|
|
43
|
-
* ### Agent Persistence & Sessions
|
|
44
|
-
* - Save and restore agent instances with their full state
|
|
45
|
-
* - Support for long-running agent workflows that span multiple sessions
|
|
46
|
-
* - Checkpoint and resume capabilities for complex agent operations
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
* // List available agents
|
|
51
|
-
* const agents = await Dexto.listAgents();
|
|
52
|
-
* console.log(agents.installed, agents.available);
|
|
53
|
-
*
|
|
54
|
-
* // Install agent
|
|
55
|
-
* await Dexto.installAgent('productivity');
|
|
56
|
-
*
|
|
57
|
-
* // Create and start agent
|
|
58
|
-
* const agent = await Dexto.createAgent('productivity');
|
|
59
|
-
* await agent.start();
|
|
60
|
-
*
|
|
61
|
-
* // Install custom agent
|
|
62
|
-
* await Dexto.installCustomAgent('my-agent', '/path/to/config.yml', {
|
|
63
|
-
* description: 'My custom agent',
|
|
64
|
-
* author: 'John Doe',
|
|
65
|
-
* tags: ['custom', 'specialized']
|
|
66
|
-
* });
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export declare class Dexto {
|
|
70
|
-
/**
|
|
71
|
-
* Lists available and installed agents from the registry.
|
|
72
|
-
* Returns a structured object containing both installed and available agents,
|
|
73
|
-
* along with metadata like descriptions, authors, and tags.
|
|
74
|
-
*
|
|
75
|
-
* @returns Promise resolving to object with installed and available agent lists
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* const agents = await Dexto.listAgents();
|
|
80
|
-
* console.log(agents.installed); // ['default', 'my-custom-agent']
|
|
81
|
-
* console.log(agents.available); // [{ name: 'productivity', description: '...', ... }]
|
|
82
|
-
* console.log(agents.current?.name); // 'default'
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
static listAgents(): Promise<{
|
|
86
|
-
installed: Array<{
|
|
87
|
-
id: string;
|
|
88
|
-
name: string;
|
|
89
|
-
description: string;
|
|
90
|
-
author?: string;
|
|
91
|
-
tags?: string[];
|
|
92
|
-
type: 'builtin' | 'custom';
|
|
93
|
-
}>;
|
|
94
|
-
available: Array<{
|
|
95
|
-
id: string;
|
|
96
|
-
name: string;
|
|
97
|
-
description: string;
|
|
98
|
-
author?: string;
|
|
99
|
-
tags?: string[];
|
|
100
|
-
type: 'builtin' | 'custom';
|
|
101
|
-
}>;
|
|
102
|
-
current?: {
|
|
103
|
-
id?: string | null;
|
|
104
|
-
name?: string | null;
|
|
105
|
-
};
|
|
106
|
-
}>;
|
|
107
|
-
/**
|
|
108
|
-
* Installs an agent from the registry.
|
|
109
|
-
* Downloads and sets up the specified agent, making it available for use.
|
|
110
|
-
*
|
|
111
|
-
* @param agentName The name of the agent to install from the registry
|
|
112
|
-
* @returns Promise that resolves when installation is complete
|
|
113
|
-
*
|
|
114
|
-
* @throws {AgentError} When agent is not found in registry or installation fails
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```typescript
|
|
118
|
-
* await Dexto.installAgent('productivity');
|
|
119
|
-
* console.log('Productivity agent installed successfully');
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
static installAgent(agentName: string): Promise<void>;
|
|
123
|
-
/**
|
|
124
|
-
* Installs a custom agent from a local file or directory path.
|
|
125
|
-
* Creates a new custom agent entry in the user registry with provided metadata.
|
|
126
|
-
*
|
|
127
|
-
* @param agentName The name to use for the custom agent (must be unique)
|
|
128
|
-
* @param sourcePath Absolute path to the agent YAML file or directory
|
|
129
|
-
* @param metadata Agent metadata (description, author, tags, main config file)
|
|
130
|
-
* @param injectPreferences Whether to inject global preferences into agent config (default: true)
|
|
131
|
-
* @returns Promise resolving to the path of the installed main config file
|
|
132
|
-
*
|
|
133
|
-
* @throws {AgentError} When name conflicts with existing agent or installation fails
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* ```typescript
|
|
137
|
-
* await Dexto.installCustomAgent('my-coding-agent', '/path/to/agent.yml', {
|
|
138
|
-
* description: 'Custom coding assistant',
|
|
139
|
-
* author: 'John Doe',
|
|
140
|
-
* tags: ['coding', 'custom']
|
|
141
|
-
* });
|
|
142
|
-
* console.log('Custom agent installed successfully');
|
|
143
|
-
* ```
|
|
144
|
-
*/
|
|
145
|
-
static installCustomAgent(agentName: string, sourcePath: string, metadata: {
|
|
146
|
-
name?: string;
|
|
147
|
-
description: string;
|
|
148
|
-
author: string;
|
|
149
|
-
tags: string[];
|
|
150
|
-
main?: string;
|
|
151
|
-
}, injectPreferences?: boolean): Promise<string>;
|
|
152
|
-
/**
|
|
153
|
-
* Uninstalls an agent by removing its directory from disk.
|
|
154
|
-
* For custom agents: also removes from user registry.
|
|
155
|
-
* For builtin agents: only removes from disk (can be reinstalled).
|
|
156
|
-
*
|
|
157
|
-
* @param agentName The name of the agent to uninstall
|
|
158
|
-
* @param force Whether to force uninstall even if agent is protected (default: false)
|
|
159
|
-
* @returns Promise that resolves when uninstallation is complete
|
|
160
|
-
*
|
|
161
|
-
* @throws {AgentError} When agent is not installed or uninstallation fails
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
* ```typescript
|
|
165
|
-
* await Dexto.uninstallAgent('my-custom-agent');
|
|
166
|
-
* console.log('Agent uninstalled successfully');
|
|
167
|
-
* ```
|
|
168
|
-
*/
|
|
169
|
-
static uninstallAgent(agentName: string, force?: boolean): Promise<void>;
|
|
170
|
-
/**
|
|
171
|
-
* Creates a new agent instance for the specified agent name.
|
|
172
|
-
* This method resolves the agent (installing if needed), loads its configuration,
|
|
173
|
-
* and returns a new DextoAgent instance ready to be started.
|
|
174
|
-
*
|
|
175
|
-
* This is a factory method that doesn't affect any existing agent instances.
|
|
176
|
-
* The caller is responsible for managing the lifecycle of the returned agent.
|
|
177
|
-
*
|
|
178
|
-
* @param agentName The name of the agent to create
|
|
179
|
-
* @returns Promise resolving to a new DextoAgent instance (not started)
|
|
180
|
-
*
|
|
181
|
-
* @throws {AgentError} When agent is not found or creation fails
|
|
182
|
-
*
|
|
183
|
-
* @example
|
|
184
|
-
* ```typescript
|
|
185
|
-
* const newAgent = await Dexto.createAgent('productivity');
|
|
186
|
-
* await newAgent.start();
|
|
187
|
-
* ```
|
|
188
|
-
*/
|
|
189
|
-
static createAgent(agentName: string): Promise<DextoAgent>;
|
|
190
|
-
}
|
|
191
|
-
//# sourceMappingURL=Dexto.d.ts.map
|
package/dist/Dexto.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dexto.d.ts","sourceRoot":"","sources":["../src/Dexto.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,qBAAa,KAAK;IACd;;;;;;;;;;;;;;OAcG;WACiB,UAAU,IAAI,OAAO,CAAC;QACtC,SAAS,EAAE,KAAK,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,EAAE,MAAM,CAAC;YACpB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;YAChB,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;SAC9B,CAAC,CAAC;QACH,SAAS,EAAE,KAAK,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,EAAE,MAAM,CAAC;YACpB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;YAChB,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;SAC9B,CAAC,CAAC;QACH,OAAO,CAAC,EAAE;YAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;KAC1D,CAAC;IAoFF;;;;;;;;;;;;;;OAcG;WACiB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBlE;;;;;;;;;;;;;;;;;;;;;OAqBG;WACiB,kBAAkB,CAClC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,EACD,iBAAiB,GAAE,OAAc,GAClC,OAAO,CAAC,MAAM,CAAC;IAsBlB;;;;;;;;;;;;;;;;OAgBG;WACiB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB5F;;;;;;;;;;;;;;;;;;OAkBG;WACiB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAyB1E"}
|
package/dist/Dexto.js
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import "./chunk-C6A6W6XS.js";
|
|
2
|
-
import { logger } from "./logger/index.js";
|
|
3
|
-
import { getAgentRegistry } from "./agent/registry/registry.js";
|
|
4
|
-
import { loadAgentConfig } from "./config/loader.js";
|
|
5
|
-
import { AgentError } from "./agent/errors.js";
|
|
6
|
-
import { DextoAgent } from "./agent/DextoAgent.js";
|
|
7
|
-
import { deriveDisplayName } from "./agent/registry/types.js";
|
|
8
|
-
class Dexto {
|
|
9
|
-
/**
|
|
10
|
-
* Lists available and installed agents from the registry.
|
|
11
|
-
* Returns a structured object containing both installed and available agents,
|
|
12
|
-
* along with metadata like descriptions, authors, and tags.
|
|
13
|
-
*
|
|
14
|
-
* @returns Promise resolving to object with installed and available agent lists
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const agents = await Dexto.listAgents();
|
|
19
|
-
* console.log(agents.installed); // ['default', 'my-custom-agent']
|
|
20
|
-
* console.log(agents.available); // [{ name: 'productivity', description: '...', ... }]
|
|
21
|
-
* console.log(agents.current?.name); // 'default'
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
static async listAgents() {
|
|
25
|
-
const agentRegistry = getAgentRegistry();
|
|
26
|
-
const availableMap = agentRegistry.getAvailableAgents();
|
|
27
|
-
const installedNames = await agentRegistry.getInstalledAgents();
|
|
28
|
-
const installed = await Promise.all(
|
|
29
|
-
installedNames.map(async (agentId) => {
|
|
30
|
-
const registryEntry = availableMap[agentId];
|
|
31
|
-
if (registryEntry) {
|
|
32
|
-
return {
|
|
33
|
-
id: agentId,
|
|
34
|
-
name: registryEntry.name,
|
|
35
|
-
description: registryEntry.description,
|
|
36
|
-
author: registryEntry.author,
|
|
37
|
-
tags: registryEntry.tags,
|
|
38
|
-
type: registryEntry.type
|
|
39
|
-
};
|
|
40
|
-
} else {
|
|
41
|
-
try {
|
|
42
|
-
const config = await loadAgentConfig(agentId);
|
|
43
|
-
const author = config.agentCard?.provider?.organization;
|
|
44
|
-
const result = {
|
|
45
|
-
id: agentId,
|
|
46
|
-
name: typeof config.agentCard?.name === "string" ? config.agentCard.name : deriveDisplayName(agentId),
|
|
47
|
-
description: config.agentCard?.description || "Local agent",
|
|
48
|
-
tags: [],
|
|
49
|
-
type: "custom"
|
|
50
|
-
// Assume custom if not in registry
|
|
51
|
-
};
|
|
52
|
-
if (author) {
|
|
53
|
-
result.author = author;
|
|
54
|
-
}
|
|
55
|
-
return result;
|
|
56
|
-
} catch {
|
|
57
|
-
const result = {
|
|
58
|
-
id: agentId,
|
|
59
|
-
name: deriveDisplayName(agentId),
|
|
60
|
-
description: "Local agent (config unavailable)",
|
|
61
|
-
tags: [],
|
|
62
|
-
type: "custom"
|
|
63
|
-
// Assume custom if not in registry
|
|
64
|
-
};
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
);
|
|
70
|
-
const available = Object.entries(availableMap).filter(([agentId]) => !installedNames.includes(agentId)).map(([agentId, entry]) => ({
|
|
71
|
-
id: agentId,
|
|
72
|
-
name: entry.name,
|
|
73
|
-
description: entry.description,
|
|
74
|
-
author: entry.author,
|
|
75
|
-
tags: entry.tags,
|
|
76
|
-
type: entry.type
|
|
77
|
-
}));
|
|
78
|
-
return {
|
|
79
|
-
installed,
|
|
80
|
-
available,
|
|
81
|
-
current: { id: null, name: null }
|
|
82
|
-
// TODO: Track current agent name
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Installs an agent from the registry.
|
|
87
|
-
* Downloads and sets up the specified agent, making it available for use.
|
|
88
|
-
*
|
|
89
|
-
* @param agentName The name of the agent to install from the registry
|
|
90
|
-
* @returns Promise that resolves when installation is complete
|
|
91
|
-
*
|
|
92
|
-
* @throws {AgentError} When agent is not found in registry or installation fails
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```typescript
|
|
96
|
-
* await Dexto.installAgent('productivity');
|
|
97
|
-
* console.log('Productivity agent installed successfully');
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
static async installAgent(agentName) {
|
|
101
|
-
const agentRegistry = getAgentRegistry();
|
|
102
|
-
if (!agentRegistry.hasAgent(agentName)) {
|
|
103
|
-
throw AgentError.apiValidationError(`Agent '${agentName}' not found in registry`);
|
|
104
|
-
}
|
|
105
|
-
try {
|
|
106
|
-
await agentRegistry.installAgent(agentName, true);
|
|
107
|
-
logger.info(`Successfully installed agent: ${agentName}`);
|
|
108
|
-
} catch (error) {
|
|
109
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
110
|
-
logger.error(`Failed to install agent ${agentName}: ${errorMessage}`);
|
|
111
|
-
throw AgentError.apiValidationError(
|
|
112
|
-
`Installation failed for agent '${agentName}'`,
|
|
113
|
-
error
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Installs a custom agent from a local file or directory path.
|
|
119
|
-
* Creates a new custom agent entry in the user registry with provided metadata.
|
|
120
|
-
*
|
|
121
|
-
* @param agentName The name to use for the custom agent (must be unique)
|
|
122
|
-
* @param sourcePath Absolute path to the agent YAML file or directory
|
|
123
|
-
* @param metadata Agent metadata (description, author, tags, main config file)
|
|
124
|
-
* @param injectPreferences Whether to inject global preferences into agent config (default: true)
|
|
125
|
-
* @returns Promise resolving to the path of the installed main config file
|
|
126
|
-
*
|
|
127
|
-
* @throws {AgentError} When name conflicts with existing agent or installation fails
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```typescript
|
|
131
|
-
* await Dexto.installCustomAgent('my-coding-agent', '/path/to/agent.yml', {
|
|
132
|
-
* description: 'Custom coding assistant',
|
|
133
|
-
* author: 'John Doe',
|
|
134
|
-
* tags: ['coding', 'custom']
|
|
135
|
-
* });
|
|
136
|
-
* console.log('Custom agent installed successfully');
|
|
137
|
-
* ```
|
|
138
|
-
*/
|
|
139
|
-
static async installCustomAgent(agentName, sourcePath, metadata, injectPreferences = true) {
|
|
140
|
-
const agentRegistry = getAgentRegistry();
|
|
141
|
-
try {
|
|
142
|
-
const mainConfigPath = await agentRegistry.installCustomAgentFromPath(
|
|
143
|
-
agentName,
|
|
144
|
-
sourcePath,
|
|
145
|
-
metadata,
|
|
146
|
-
injectPreferences
|
|
147
|
-
);
|
|
148
|
-
logger.info(`Successfully installed custom agent: ${agentName}`);
|
|
149
|
-
return mainConfigPath;
|
|
150
|
-
} catch (error) {
|
|
151
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
152
|
-
logger.error(`Failed to install custom agent ${agentName}: ${errorMessage}`);
|
|
153
|
-
throw AgentError.apiValidationError(
|
|
154
|
-
`Installation failed for custom agent '${agentName}'`,
|
|
155
|
-
error
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Uninstalls an agent by removing its directory from disk.
|
|
161
|
-
* For custom agents: also removes from user registry.
|
|
162
|
-
* For builtin agents: only removes from disk (can be reinstalled).
|
|
163
|
-
*
|
|
164
|
-
* @param agentName The name of the agent to uninstall
|
|
165
|
-
* @param force Whether to force uninstall even if agent is protected (default: false)
|
|
166
|
-
* @returns Promise that resolves when uninstallation is complete
|
|
167
|
-
*
|
|
168
|
-
* @throws {AgentError} When agent is not installed or uninstallation fails
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* ```typescript
|
|
172
|
-
* await Dexto.uninstallAgent('my-custom-agent');
|
|
173
|
-
* console.log('Agent uninstalled successfully');
|
|
174
|
-
* ```
|
|
175
|
-
*/
|
|
176
|
-
static async uninstallAgent(agentName, force = false) {
|
|
177
|
-
const agentRegistry = getAgentRegistry();
|
|
178
|
-
try {
|
|
179
|
-
await agentRegistry.uninstallAgent(agentName, force);
|
|
180
|
-
logger.info(`Successfully uninstalled agent: ${agentName}`);
|
|
181
|
-
} catch (error) {
|
|
182
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
183
|
-
logger.error(`Failed to uninstall agent ${agentName}: ${errorMessage}`);
|
|
184
|
-
throw AgentError.apiValidationError(
|
|
185
|
-
`Uninstallation failed for agent '${agentName}'`,
|
|
186
|
-
error
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Creates a new agent instance for the specified agent name.
|
|
192
|
-
* This method resolves the agent (installing if needed), loads its configuration,
|
|
193
|
-
* and returns a new DextoAgent instance ready to be started.
|
|
194
|
-
*
|
|
195
|
-
* This is a factory method that doesn't affect any existing agent instances.
|
|
196
|
-
* The caller is responsible for managing the lifecycle of the returned agent.
|
|
197
|
-
*
|
|
198
|
-
* @param agentName The name of the agent to create
|
|
199
|
-
* @returns Promise resolving to a new DextoAgent instance (not started)
|
|
200
|
-
*
|
|
201
|
-
* @throws {AgentError} When agent is not found or creation fails
|
|
202
|
-
*
|
|
203
|
-
* @example
|
|
204
|
-
* ```typescript
|
|
205
|
-
* const newAgent = await Dexto.createAgent('productivity');
|
|
206
|
-
* await newAgent.start();
|
|
207
|
-
* ```
|
|
208
|
-
*/
|
|
209
|
-
static async createAgent(agentName) {
|
|
210
|
-
const agentRegistry = getAgentRegistry();
|
|
211
|
-
try {
|
|
212
|
-
const agentPath = await agentRegistry.resolveAgent(agentName, true, true);
|
|
213
|
-
const config = await loadAgentConfig(agentPath);
|
|
214
|
-
logger.info(`Creating agent: ${agentName}`);
|
|
215
|
-
const newAgent = new DextoAgent(config, agentPath);
|
|
216
|
-
logger.info(`Successfully created agent: ${agentName}`);
|
|
217
|
-
return newAgent;
|
|
218
|
-
} catch (error) {
|
|
219
|
-
logger.error(
|
|
220
|
-
`Failed to create agent '${agentName}': ${error instanceof Error ? error.message : String(error)}`
|
|
221
|
-
);
|
|
222
|
-
throw AgentError.apiValidationError(`Failed to create agent '${agentName}'`, error);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
export {
|
|
227
|
-
Dexto
|
|
228
|
-
};
|