erosolar-cli 1.0.2 → 1.0.3
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/Agents.md +411 -200
- package/README.md +77 -44
- package/dist/adapters/browser/index.d.ts +12 -0
- package/dist/adapters/browser/index.d.ts.map +1 -0
- package/dist/adapters/browser/index.js +1 -0
- package/dist/adapters/browser/index.js.map +1 -0
- package/dist/adapters/node/index.d.ts +17 -0
- package/dist/adapters/node/index.d.ts.map +1 -0
- package/dist/adapters/node/index.js +1 -0
- package/dist/adapters/node/index.js.map +1 -0
- package/dist/adapters/remote/index.d.ts +13 -0
- package/dist/adapters/remote/index.d.ts.map +1 -0
- package/dist/adapters/remote/index.js +1 -0
- package/dist/adapters/remote/index.js.map +1 -0
- package/dist/adapters/types.d.ts +14 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +1 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/bin/erosolar.d.ts +3 -0
- package/dist/bin/erosolar.d.ts.map +1 -0
- package/dist/bin/erosolar.js +1 -0
- package/dist/bin/erosolar.js.map +1 -0
- package/dist/capabilities/bashCapability.d.ts +13 -0
- package/dist/capabilities/bashCapability.d.ts.map +1 -0
- package/dist/capabilities/bashCapability.js +1 -0
- package/dist/capabilities/bashCapability.js.map +1 -0
- package/dist/capabilities/codeAnalysisCapability.d.ts +13 -0
- package/dist/capabilities/codeAnalysisCapability.d.ts.map +1 -0
- package/dist/capabilities/codeAnalysisCapability.js +24 -0
- package/dist/capabilities/codeAnalysisCapability.js.map +1 -0
- package/dist/capabilities/codeGenerationCapability.d.ts +13 -0
- package/dist/capabilities/codeGenerationCapability.d.ts.map +1 -0
- package/dist/capabilities/codeGenerationCapability.js +25 -0
- package/dist/capabilities/codeGenerationCapability.js.map +1 -0
- package/dist/capabilities/codeQualityCapability.d.ts +13 -0
- package/dist/capabilities/codeQualityCapability.d.ts.map +1 -0
- package/dist/capabilities/codeQualityCapability.js +25 -0
- package/dist/capabilities/codeQualityCapability.js.map +1 -0
- package/dist/capabilities/dependencySecurityCapability.d.ts +13 -0
- package/dist/capabilities/dependencySecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/dependencySecurityCapability.js +24 -0
- package/dist/capabilities/dependencySecurityCapability.js.map +1 -0
- package/dist/capabilities/devCapability.d.ts +13 -0
- package/dist/capabilities/devCapability.d.ts.map +1 -0
- package/dist/capabilities/devCapability.js +24 -0
- package/dist/capabilities/devCapability.js.map +1 -0
- package/dist/capabilities/filesystemCapability.d.ts +13 -0
- package/dist/capabilities/filesystemCapability.d.ts.map +1 -0
- package/dist/capabilities/filesystemCapability.js +1 -0
- package/dist/capabilities/filesystemCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +10 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +7 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/refactoringCapability.d.ts +13 -0
- package/dist/capabilities/refactoringCapability.d.ts.map +1 -0
- package/dist/capabilities/refactoringCapability.js +25 -0
- package/dist/capabilities/refactoringCapability.js.map +1 -0
- package/dist/capabilities/repoChecksCapability.d.ts +10 -0
- package/dist/capabilities/repoChecksCapability.d.ts.map +1 -0
- package/dist/capabilities/repoChecksCapability.js +24 -0
- package/dist/capabilities/repoChecksCapability.js.map +1 -0
- package/dist/capabilities/searchCapability.d.ts +13 -0
- package/dist/capabilities/searchCapability.d.ts.map +1 -0
- package/dist/capabilities/searchCapability.js +1 -0
- package/dist/capabilities/searchCapability.js.map +1 -0
- package/dist/capabilities/testingCapability.d.ts +13 -0
- package/dist/capabilities/testingCapability.d.ts.map +1 -0
- package/dist/capabilities/testingCapability.js +25 -0
- package/dist/capabilities/testingCapability.js.map +1 -0
- package/dist/capabilities/toolManifest.d.ts +3 -0
- package/dist/capabilities/toolManifest.d.ts.map +1 -0
- package/dist/capabilities/toolManifest.js +160 -0
- package/dist/capabilities/toolManifest.js.map +1 -0
- package/dist/capabilities/toolRegistry.d.ts +22 -0
- package/dist/capabilities/toolRegistry.d.ts.map +1 -0
- package/dist/capabilities/toolRegistry.js +49 -32
- package/dist/capabilities/toolRegistry.js.map +1 -0
- package/dist/config.d.ts +28 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +98 -23
- package/dist/config.js.map +1 -0
- package/dist/contracts/agent-profiles.schema.json +43 -0
- package/dist/contracts/agent-schema.snapshot.json +437 -0
- package/dist/contracts/schemas/agent-profile.schema.json +157 -0
- package/dist/contracts/schemas/agent-rules.schema.json +238 -0
- package/dist/contracts/schemas/agent.schema.json +89 -0
- package/dist/contracts/schemas/tool-selection.schema.json +174 -0
- package/dist/contracts/tools.schema.json +100 -0
- package/dist/contracts/v1/agent.d.ts +147 -0
- package/dist/contracts/v1/agent.d.ts.map +1 -0
- package/dist/contracts/v1/agent.js +1 -0
- package/dist/contracts/v1/agent.js.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts +52 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.js +9 -0
- package/dist/contracts/v1/agentProfileManifest.js.map +1 -0
- package/dist/contracts/v1/agentRules.d.ts +60 -0
- package/dist/contracts/v1/agentRules.d.ts.map +1 -0
- package/dist/contracts/v1/agentRules.js +10 -0
- package/dist/contracts/v1/agentRules.js.map +1 -0
- package/dist/contracts/v1/provider.d.ts +149 -0
- package/dist/contracts/v1/provider.d.ts.map +1 -0
- package/dist/contracts/v1/provider.js +1 -0
- package/dist/contracts/v1/provider.js.map +1 -0
- package/dist/contracts/v1/tool.d.ts +136 -0
- package/dist/contracts/v1/tool.d.ts.map +1 -0
- package/dist/contracts/v1/tool.js +1 -0
- package/dist/contracts/v1/tool.js.map +1 -0
- package/dist/contracts/v1/toolAccess.d.ts +43 -0
- package/dist/contracts/v1/toolAccess.d.ts.map +1 -0
- package/dist/contracts/v1/toolAccess.js +9 -0
- package/dist/contracts/v1/toolAccess.js.map +1 -0
- package/dist/core/agent.d.ts +35 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +17 -9
- package/dist/core/agent.js.map +1 -0
- package/dist/core/agentProfileManifest.d.ts +3 -0
- package/dist/core/agentProfileManifest.d.ts.map +1 -0
- package/dist/core/agentProfileManifest.js +176 -0
- package/dist/core/agentProfileManifest.js.map +1 -0
- package/dist/core/agentProfiles.d.ts +22 -0
- package/dist/core/agentProfiles.d.ts.map +1 -0
- package/dist/core/agentProfiles.js +1 -0
- package/dist/core/agentProfiles.js.map +1 -0
- package/dist/core/agentRulebook.d.ts +10 -0
- package/dist/core/agentRulebook.d.ts.map +1 -0
- package/dist/core/agentRulebook.js +153 -0
- package/dist/core/agentRulebook.js.map +1 -0
- package/dist/core/agentSchemaSnapshot.d.ts +14 -0
- package/dist/core/agentSchemaSnapshot.d.ts.map +1 -0
- package/dist/core/agentSchemaSnapshot.js +38 -0
- package/dist/core/agentSchemaSnapshot.js.map +1 -0
- package/dist/core/agentsDocument.d.ts +4 -0
- package/dist/core/agentsDocument.d.ts.map +1 -0
- package/dist/core/agentsDocument.js +70 -0
- package/dist/core/agentsDocument.js.map +1 -0
- package/dist/core/contextWindow.d.ts +6 -0
- package/dist/core/contextWindow.d.ts.map +1 -0
- package/dist/core/contextWindow.js +1 -0
- package/dist/core/contextWindow.js.map +1 -0
- package/dist/core/errors/apiKeyErrors.d.ts +11 -0
- package/dist/core/errors/apiKeyErrors.d.ts.map +1 -0
- package/dist/core/errors/apiKeyErrors.js +1 -0
- package/dist/core/errors/apiKeyErrors.js.map +1 -0
- package/dist/core/errors.d.ts +4 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +33 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/preferences.d.ts +21 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +13 -7
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/schemaValidator.d.ts +6 -0
- package/dist/core/schemaValidator.d.ts.map +1 -0
- package/dist/core/schemaValidator.js +93 -0
- package/dist/core/schemaValidator.js.map +1 -0
- package/dist/core/secretStore.d.ts +20 -0
- package/dist/core/secretStore.d.ts.map +1 -0
- package/dist/core/secretStore.js +3 -8
- package/dist/core/secretStore.js.map +1 -0
- package/dist/core/toolRuntime.d.ts +48 -0
- package/dist/core/toolRuntime.d.ts.map +1 -0
- package/dist/core/toolRuntime.js +34 -11
- package/dist/core/toolRuntime.js.map +1 -0
- package/dist/core/types.d.ts +86 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +1 -0
- package/dist/core/types.js.map +1 -0
- package/dist/plugins/providers/anthropic/index.d.ts +2 -0
- package/dist/plugins/providers/anthropic/index.d.ts.map +1 -0
- package/dist/plugins/providers/anthropic/index.js +6 -4
- package/dist/plugins/providers/anthropic/index.js.map +1 -0
- package/dist/plugins/providers/deepseek/index.d.ts +2 -0
- package/dist/plugins/providers/deepseek/index.d.ts.map +1 -0
- package/dist/plugins/providers/deepseek/index.js +1 -0
- package/dist/plugins/providers/deepseek/index.js.map +1 -0
- package/dist/plugins/providers/google/index.d.ts +2 -0
- package/dist/plugins/providers/google/index.d.ts.map +1 -0
- package/dist/plugins/providers/google/index.js +6 -4
- package/dist/plugins/providers/google/index.js.map +1 -0
- package/dist/plugins/providers/index.d.ts +2 -0
- package/dist/plugins/providers/index.d.ts.map +1 -0
- package/dist/plugins/providers/index.js +1 -0
- package/dist/plugins/providers/index.js.map +1 -0
- package/dist/plugins/providers/openai/index.d.ts +3 -0
- package/dist/plugins/providers/openai/index.d.ts.map +1 -0
- package/dist/plugins/providers/openai/index.js +6 -4
- package/dist/plugins/providers/openai/index.js.map +1 -0
- package/dist/plugins/providers/xai/index.d.ts +2 -0
- package/dist/plugins/providers/xai/index.d.ts.map +1 -0
- package/dist/plugins/providers/xai/index.js +1 -0
- package/dist/plugins/providers/xai/index.js.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts +3 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.js +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.js.map +1 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +3 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js +14 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +1 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +3 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +14 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +1 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +3 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +14 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +1 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +3 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.js +12 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.js.map +1 -0
- package/dist/plugins/tools/development/devPlugin.d.ts +3 -0
- package/dist/plugins/tools/development/devPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/development/devPlugin.js +14 -0
- package/dist/plugins/tools/development/devPlugin.js.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +3 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +1 -0
- package/dist/plugins/tools/index.d.ts +3 -0
- package/dist/plugins/tools/index.d.ts.map +1 -0
- package/dist/plugins/tools/index.js +1 -0
- package/dist/plugins/tools/index.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +2 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
- package/dist/plugins/tools/nodeDefaults.js +15 -2
- package/dist/plugins/tools/nodeDefaults.js.map +1 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +3 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.js +12 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +1 -0
- package/dist/plugins/tools/registry.d.ts +22 -0
- package/dist/plugins/tools/registry.d.ts.map +1 -0
- package/dist/plugins/tools/registry.js +1 -0
- package/dist/plugins/tools/registry.js.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts +3 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.js +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.js.map +1 -0
- package/dist/plugins/tools/testing/testingPlugin.d.ts +3 -0
- package/dist/plugins/tools/testing/testingPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/testing/testingPlugin.js +12 -0
- package/dist/plugins/tools/testing/testingPlugin.js.map +1 -0
- package/dist/providers/anthropicProvider.d.ts +23 -0
- package/dist/providers/anthropicProvider.d.ts.map +1 -0
- package/dist/providers/anthropicProvider.js +3 -2
- package/dist/providers/anthropicProvider.js.map +1 -0
- package/dist/providers/googleProvider.d.ts +19 -0
- package/dist/providers/googleProvider.d.ts.map +1 -0
- package/dist/providers/googleProvider.js +1 -1
- package/dist/providers/googleProvider.js.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts +16 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js.map +1 -0
- package/dist/providers/openaiResponsesProvider.d.ts +20 -0
- package/dist/providers/openaiResponsesProvider.d.ts.map +1 -0
- package/dist/providers/openaiResponsesProvider.js +1 -0
- package/dist/providers/openaiResponsesProvider.js.map +1 -0
- package/dist/providers/providerFactory.d.ts +18 -0
- package/dist/providers/providerFactory.d.ts.map +1 -0
- package/dist/providers/providerFactory.js +5 -1
- package/dist/providers/providerFactory.js.map +1 -0
- package/dist/runtime/agentHost.d.ts +61 -0
- package/dist/runtime/agentHost.d.ts.map +1 -0
- package/dist/runtime/agentHost.js +5 -1
- package/dist/runtime/agentHost.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +32 -0
- package/dist/runtime/agentSession.d.ts.map +1 -0
- package/dist/runtime/agentSession.js +23 -1
- package/dist/runtime/agentSession.js.map +1 -0
- package/dist/runtime/browser.d.ts +7 -0
- package/dist/runtime/browser.d.ts.map +1 -0
- package/dist/runtime/browser.js +1 -0
- package/dist/runtime/browser.js.map +1 -0
- package/dist/runtime/cloud.d.ts +7 -0
- package/dist/runtime/cloud.d.ts.map +1 -0
- package/dist/runtime/cloud.js +1 -0
- package/dist/runtime/cloud.js.map +1 -0
- package/dist/runtime/node.d.ts +8 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +1 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/runtime/universal.d.ts +21 -0
- package/dist/runtime/universal.d.ts.map +1 -0
- package/dist/runtime/universal.js +1 -0
- package/dist/runtime/universal.js.map +1 -0
- package/dist/shell/bracketedPasteManager.d.ts +23 -0
- package/dist/shell/bracketedPasteManager.d.ts.map +1 -0
- package/dist/shell/bracketedPasteManager.js +1 -0
- package/dist/shell/bracketedPasteManager.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +128 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -0
- package/dist/shell/interactiveShell.js +264 -146
- package/dist/shell/interactiveShell.js.map +1 -0
- package/dist/shell/liveStatus.d.ts +33 -0
- package/dist/shell/liveStatus.d.ts.map +1 -0
- package/dist/shell/liveStatus.js +89 -0
- package/dist/shell/liveStatus.js.map +1 -0
- package/dist/shell/promptSkin.d.ts +50 -0
- package/dist/shell/promptSkin.d.ts.map +1 -0
- package/dist/shell/promptSkin.js +380 -0
- package/dist/shell/promptSkin.js.map +1 -0
- package/dist/shell/shellApp.d.ts +10 -0
- package/dist/shell/shellApp.d.ts.map +1 -0
- package/dist/shell/shellApp.js +155 -78
- package/dist/shell/shellApp.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts +3 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -0
- package/dist/shell/systemPrompt.js +64 -0
- package/dist/shell/systemPrompt.js.map +1 -0
- package/dist/shell/updateManager.d.ts +2 -0
- package/dist/shell/updateManager.d.ts.map +1 -0
- package/dist/shell/updateManager.js +109 -0
- package/dist/shell/updateManager.js.map +1 -0
- package/dist/tools/bashTools.d.ts +8 -0
- package/dist/tools/bashTools.d.ts.map +1 -0
- package/dist/tools/bashTools.js +18 -15
- package/dist/tools/bashTools.js.map +1 -0
- package/dist/tools/codeAnalysisTools.d.ts +74 -0
- package/dist/tools/codeAnalysisTools.d.ts.map +1 -0
- package/dist/tools/codeAnalysisTools.js +642 -0
- package/dist/tools/codeAnalysisTools.js.map +1 -0
- package/dist/tools/codeGenerationTools.d.ts +3 -0
- package/dist/tools/codeGenerationTools.d.ts.map +1 -0
- package/dist/tools/codeGenerationTools.js +369 -0
- package/dist/tools/codeGenerationTools.js.map +1 -0
- package/dist/tools/codeQualityTools.d.ts +3 -0
- package/dist/tools/codeQualityTools.d.ts.map +1 -0
- package/dist/tools/codeQualityTools.js +295 -0
- package/dist/tools/codeQualityTools.js.map +1 -0
- package/dist/tools/dependencyTools.d.ts +3 -0
- package/dist/tools/dependencyTools.d.ts.map +1 -0
- package/dist/tools/dependencyTools.js +283 -0
- package/dist/tools/dependencyTools.js.map +1 -0
- package/dist/tools/devTools.d.ts +10 -0
- package/dist/tools/devTools.d.ts.map +1 -0
- package/dist/tools/devTools.js +239 -0
- package/dist/tools/devTools.js.map +1 -0
- package/dist/tools/diffUtils.d.ts +8 -0
- package/dist/tools/diffUtils.d.ts.map +1 -0
- package/dist/tools/diffUtils.js +2 -1
- package/dist/tools/diffUtils.js.map +1 -0
- package/dist/tools/fileTools.d.ts +3 -0
- package/dist/tools/fileTools.d.ts.map +1 -0
- package/dist/tools/fileTools.js +72 -21
- package/dist/tools/fileTools.js.map +1 -0
- package/dist/tools/refactoringTools.d.ts +3 -0
- package/dist/tools/refactoringTools.d.ts.map +1 -0
- package/dist/tools/refactoringTools.js +294 -0
- package/dist/tools/refactoringTools.js.map +1 -0
- package/dist/tools/repoChecksTools.d.ts +3 -0
- package/dist/tools/repoChecksTools.d.ts.map +1 -0
- package/dist/tools/repoChecksTools.js +161 -0
- package/dist/tools/repoChecksTools.js.map +1 -0
- package/dist/tools/searchTools.d.ts +3 -0
- package/dist/tools/searchTools.d.ts.map +1 -0
- package/dist/tools/searchTools.js +50 -22
- package/dist/tools/searchTools.js.map +1 -0
- package/dist/tools/testingTools.d.ts +3 -0
- package/dist/tools/testingTools.d.ts.map +1 -0
- package/dist/tools/testingTools.js +233 -0
- package/dist/tools/testingTools.js.map +1 -0
- package/dist/ui/codeHighlighter.d.ts +6 -0
- package/dist/ui/codeHighlighter.d.ts.map +1 -0
- package/dist/ui/codeHighlighter.js +41 -29
- package/dist/ui/codeHighlighter.js.map +1 -0
- package/dist/ui/designSystem.d.ts +26 -0
- package/dist/ui/designSystem.d.ts.map +1 -0
- package/dist/ui/designSystem.js +1 -0
- package/dist/ui/designSystem.js.map +1 -0
- package/dist/ui/display.d.ts +78 -0
- package/dist/ui/display.d.ts.map +1 -0
- package/dist/ui/display.js +211 -153
- package/dist/ui/display.js.map +1 -0
- package/dist/ui/layout.d.ts +17 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +12 -7
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/richText.d.ts +6 -0
- package/dist/ui/richText.d.ts.map +1 -0
- package/dist/ui/richText.js +13 -4
- package/dist/ui/richText.js.map +1 -0
- package/dist/ui/theme.d.ts +77 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +19 -6
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/unified/UIEventBus.d.ts +93 -0
- package/dist/ui/unified/UIEventBus.d.ts.map +1 -0
- package/dist/ui/unified/UIEventBus.js +124 -0
- package/dist/ui/unified/UIEventBus.js.map +1 -0
- package/dist/ui/unified/UIState.d.ts +123 -0
- package/dist/ui/unified/UIState.d.ts.map +1 -0
- package/dist/ui/unified/UIState.js +188 -0
- package/dist/ui/unified/UIState.js.map +1 -0
- package/dist/utils/errorUtils.d.ts +16 -0
- package/dist/utils/errorUtils.d.ts.map +1 -0
- package/dist/utils/errorUtils.js +68 -0
- package/dist/utils/errorUtils.js.map +1 -0
- package/dist/utils/nodeVersion.d.ts +3 -0
- package/dist/utils/nodeVersion.d.ts.map +1 -0
- package/dist/utils/nodeVersion.js +51 -0
- package/dist/utils/nodeVersion.js.map +1 -0
- package/dist/workspace.d.ts +8 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +63 -11
- package/dist/workspace.js.map +1 -0
- package/package.json +27 -14
- package/scripts/health-check.mjs +179 -0
- package/ARCHITECTURE.json +0 -157
- package/SOURCE_OF_TRUTH.json +0 -103
- package/dist/capabilities/tavilyCapability.js +0 -26
- package/dist/plugins/tools/tavily/tavilyPlugin.js +0 -16
- package/dist/shell/__tests__/bracketedPasteManager.test.js +0 -35
- package/dist/tools/tavilyTools.js +0 -176
- package/dist/ui/__tests__/richText.test.js +0 -36
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Contract v1.0
|
|
3
|
+
*
|
|
4
|
+
* Stable interface for tool registration and execution.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TOOL_CONTRACT_VERSION = "1.0.0";
|
|
7
|
+
/**
|
|
8
|
+
* JSON Schema type definitions
|
|
9
|
+
*/
|
|
10
|
+
export interface JSONSchemaProperty {
|
|
11
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
12
|
+
description?: string;
|
|
13
|
+
enum?: string[];
|
|
14
|
+
items?: JSONSchemaProperty;
|
|
15
|
+
properties?: Record<string, JSONSchemaProperty>;
|
|
16
|
+
}
|
|
17
|
+
export interface JSONSchemaObject {
|
|
18
|
+
type: 'object';
|
|
19
|
+
description?: string;
|
|
20
|
+
properties?: Record<string, JSONSchemaProperty>;
|
|
21
|
+
required?: string[];
|
|
22
|
+
additionalProperties?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Tool definition
|
|
26
|
+
*/
|
|
27
|
+
export interface IToolDefinition {
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
parameters?: JSONSchemaObject;
|
|
31
|
+
category?: string;
|
|
32
|
+
metadata?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Tool execution request
|
|
36
|
+
*/
|
|
37
|
+
export interface ToolExecutionRequest {
|
|
38
|
+
toolName: string;
|
|
39
|
+
executionId: string;
|
|
40
|
+
parameters: Record<string, unknown>;
|
|
41
|
+
context?: ToolExecutionContext;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Tool execution response
|
|
45
|
+
*/
|
|
46
|
+
export interface ToolExecutionResponse {
|
|
47
|
+
executionId: string;
|
|
48
|
+
success: boolean;
|
|
49
|
+
result?: string;
|
|
50
|
+
error?: {
|
|
51
|
+
message: string;
|
|
52
|
+
code?: string;
|
|
53
|
+
details?: unknown;
|
|
54
|
+
};
|
|
55
|
+
metadata?: {
|
|
56
|
+
elapsedMs?: number;
|
|
57
|
+
cached?: boolean;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Tool execution context
|
|
62
|
+
*/
|
|
63
|
+
export interface ToolExecutionContext {
|
|
64
|
+
workingDirectory?: string;
|
|
65
|
+
environment?: Record<string, string>;
|
|
66
|
+
user?: {
|
|
67
|
+
id: string;
|
|
68
|
+
permissions?: string[];
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Tool suite definition
|
|
73
|
+
*/
|
|
74
|
+
export interface IToolSuite {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
version?: string;
|
|
79
|
+
tools: IToolDefinition[];
|
|
80
|
+
metadata?: Record<string, unknown>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Tool handler function
|
|
84
|
+
*/
|
|
85
|
+
export type ToolHandler = (parameters: Record<string, unknown>, context?: ToolExecutionContext) => Promise<string> | string;
|
|
86
|
+
/**
|
|
87
|
+
* Tool executor interface
|
|
88
|
+
*/
|
|
89
|
+
export interface IToolExecutor {
|
|
90
|
+
/**
|
|
91
|
+
* Execute a tool
|
|
92
|
+
*/
|
|
93
|
+
execute(request: ToolExecutionRequest): Promise<ToolExecutionResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* Check if a tool is available
|
|
96
|
+
*/
|
|
97
|
+
hasToolAvailable(toolName: string): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* List all available tools
|
|
100
|
+
*/
|
|
101
|
+
listTools(): IToolDefinition[];
|
|
102
|
+
/**
|
|
103
|
+
* Get tool definition
|
|
104
|
+
*/
|
|
105
|
+
getToolDefinition(toolName: string): IToolDefinition | null;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Tool registry interface
|
|
109
|
+
*/
|
|
110
|
+
export interface IToolRegistry {
|
|
111
|
+
/**
|
|
112
|
+
* Register a tool suite
|
|
113
|
+
*/
|
|
114
|
+
registerSuite(suite: IToolSuite): void;
|
|
115
|
+
/**
|
|
116
|
+
* Unregister a tool suite
|
|
117
|
+
*/
|
|
118
|
+
unregisterSuite(suiteId: string): void;
|
|
119
|
+
/**
|
|
120
|
+
* Register a single tool
|
|
121
|
+
*/
|
|
122
|
+
registerTool(suiteId: string, definition: IToolDefinition, handler: ToolHandler): void;
|
|
123
|
+
/**
|
|
124
|
+
* Unregister a single tool
|
|
125
|
+
*/
|
|
126
|
+
unregisterTool(toolName: string): void;
|
|
127
|
+
/**
|
|
128
|
+
* Get all registered suites
|
|
129
|
+
*/
|
|
130
|
+
getSuites(): IToolSuite[];
|
|
131
|
+
/**
|
|
132
|
+
* Get a specific suite
|
|
133
|
+
*/
|
|
134
|
+
getSuite(suiteId: string): IToolSuite | null;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/contracts/v1/tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,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|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Selection Contract v1.0
|
|
3
|
+
*
|
|
4
|
+
* Enumerates the toggleable tool suites that can be surfaced to the agent at
|
|
5
|
+
* runtime plus optional presets that frontends can expose as one-click
|
|
6
|
+
* configurations.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TOOL_SELECTION_CONTRACT_VERSION = "1.0.0";
|
|
9
|
+
export type ToolPermissionScope = 'filesystem:read' | 'filesystem:write' | 'process:exec' | 'network:web' | 'network:api' | 'analysis:code' | 'analysis:quality' | 'analysis:dependency' | 'analysis:testing' | 'analysis:security' | 'planning:refactor' | 'external:web-search';
|
|
10
|
+
export type ToolSelectionTarget = 'cli' | 'browser' | 'http' | 'worker' | 'service';
|
|
11
|
+
export interface ToolAvailabilityOption {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
category?: string;
|
|
16
|
+
defaultEnabled: boolean;
|
|
17
|
+
pluginIds: string[];
|
|
18
|
+
requiresSecret?: string;
|
|
19
|
+
scopes?: ToolPermissionScope[];
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
export interface ToolSelectionPreset {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
enabled?: string[];
|
|
27
|
+
disabled?: string[];
|
|
28
|
+
locked?: string[];
|
|
29
|
+
appliesTo?: ToolSelectionTarget[];
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
31
|
+
notes?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ToolSelectionManifest {
|
|
34
|
+
contractVersion: string;
|
|
35
|
+
profile: string;
|
|
36
|
+
version: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
options: ToolAvailabilityOption[];
|
|
40
|
+
presets?: ToolSelectionPreset[];
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingUR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AAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Selection Contract v1.0
|
|
3
|
+
*
|
|
4
|
+
* Enumerates the toggleable tool suites that can be surfaced to the agent at
|
|
5
|
+
* runtime plus optional presets that frontends can expose as one-click
|
|
6
|
+
* configurations.
|
|
7
|
+
*/
|
|
8
|
+
export const TOOL_SELECTION_CONTRACT_VERSION = '1.0.0';
|
|
9
|
+
//# sourceMappingURL=toolAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolAccess.js","sourceRoot":"","sources":["../../../src/contracts/v1/toolAccess.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ToolRuntime } from './toolRuntime.js';
|
|
2
|
+
import { type ConversationMessage, type LLMProvider, type ProviderUsage } from './types.js';
|
|
3
|
+
export interface AgentCallbacks {
|
|
4
|
+
onAssistantMessage?(content: string, metadata: AssistantMessageMetadata): void;
|
|
5
|
+
}
|
|
6
|
+
export interface AssistantMessageMetadata {
|
|
7
|
+
isFinal: boolean;
|
|
8
|
+
elapsedMs?: number;
|
|
9
|
+
usage?: ProviderUsage | null;
|
|
10
|
+
}
|
|
11
|
+
interface AgentOptions {
|
|
12
|
+
provider: LLMProvider;
|
|
13
|
+
toolRuntime: ToolRuntime;
|
|
14
|
+
systemPrompt: string;
|
|
15
|
+
callbacks?: AgentCallbacks;
|
|
16
|
+
}
|
|
17
|
+
export declare class AgentRuntime {
|
|
18
|
+
private readonly messages;
|
|
19
|
+
private readonly provider;
|
|
20
|
+
private readonly toolRuntime;
|
|
21
|
+
private readonly callbacks;
|
|
22
|
+
private activeRun;
|
|
23
|
+
private readonly baseSystemPrompt;
|
|
24
|
+
constructor(options: AgentOptions);
|
|
25
|
+
send(text: string): Promise<string>;
|
|
26
|
+
private processConversation;
|
|
27
|
+
private resolveToolCalls;
|
|
28
|
+
private get providerTools();
|
|
29
|
+
private emitAssistantMessage;
|
|
30
|
+
getHistory(): ConversationMessage[];
|
|
31
|
+
loadHistory(history: ConversationMessage[]): void;
|
|
32
|
+
clearHistory(): void;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/core/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAGhB,KAAK,aAAa,EACnB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC7B,kBAAkB,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAChF;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAC9B;AAED,UAAU,YAAY;IACpB,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiB;IAC3C,OAAO,CAAC,SAAS,CAAsC;IACvD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAgB;gBAErC,OAAO,EAAE,YAAY;IAY3B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAkB3B,mBAAmB;YAgCnB,gBAAgB;IAY9B,OAAO,KAAK,aAAa,GAExB;IAED,OAAO,CAAC,oBAAoB;IAY5B,UAAU,IAAI,mBAAmB,EAAE;IAInC,WAAW,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG,IAAI;IAajD,YAAY,IAAI,IAAI;CAMrB"}
|
package/dist/core/agent.js
CHANGED
|
@@ -41,11 +41,14 @@ export class AgentRuntime {
|
|
|
41
41
|
if (narration) {
|
|
42
42
|
this.emitAssistantMessage(narration, { isFinal: false, usage });
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
const assistantMessage = {
|
|
45
45
|
role: 'assistant',
|
|
46
46
|
content: response.content ?? '',
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
};
|
|
48
|
+
if (response.toolCalls?.length) {
|
|
49
|
+
assistantMessage.toolCalls = response.toolCalls;
|
|
50
|
+
}
|
|
51
|
+
this.messages.push(assistantMessage);
|
|
49
52
|
await this.resolveToolCalls(response.toolCalls);
|
|
50
53
|
continue;
|
|
51
54
|
}
|
|
@@ -77,10 +80,11 @@ export class AgentRuntime {
|
|
|
77
80
|
return;
|
|
78
81
|
}
|
|
79
82
|
const elapsedMs = this.activeRun ? Date.now() - this.activeRun.startedAt : undefined;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
elapsedMs
|
|
83
|
-
}
|
|
83
|
+
const payload = { ...metadata };
|
|
84
|
+
if (typeof elapsedMs === 'number') {
|
|
85
|
+
payload.elapsedMs = elapsedMs;
|
|
86
|
+
}
|
|
87
|
+
this.callbacks.onAssistantMessage?.(content, payload);
|
|
84
88
|
}
|
|
85
89
|
getHistory() {
|
|
86
90
|
return this.messages.map(cloneMessage);
|
|
@@ -107,11 +111,14 @@ export class AgentRuntime {
|
|
|
107
111
|
function cloneMessage(message) {
|
|
108
112
|
switch (message.role) {
|
|
109
113
|
case 'assistant':
|
|
110
|
-
|
|
114
|
+
const clone = {
|
|
111
115
|
role: 'assistant',
|
|
112
116
|
content: message.content,
|
|
113
|
-
toolCalls: message.toolCalls?.map(cloneToolCall),
|
|
114
117
|
};
|
|
118
|
+
if (message.toolCalls) {
|
|
119
|
+
clone.toolCalls = message.toolCalls.map(cloneToolCall);
|
|
120
|
+
}
|
|
121
|
+
return clone;
|
|
115
122
|
case 'tool':
|
|
116
123
|
return {
|
|
117
124
|
role: 'tool',
|
|
@@ -133,3 +140,4 @@ function cloneToolCall(call) {
|
|
|
133
140
|
arguments: { ...(call.arguments ?? {}) },
|
|
134
141
|
};
|
|
135
142
|
}
|
|
143
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/core/agent.ts"],"names":[],"mappings":"AA0BA,MAAM,OAAO,YAAY;IACN,QAAQ,GAA0B,EAAE,CAAC;IACrC,QAAQ,CAAc;IACtB,WAAW,CAAc;IACzB,SAAS,CAAiB;IACnC,SAAS,GAAiC,IAAI,CAAC;IACtC,gBAAgB,CAAgB;IAEjD,YAAY,OAAqB;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAA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AE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentProfileManifest.d.ts","sourceRoot":"","sources":["../../src/core/agentProfileManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EAKrB,MAAM,yCAAyC,CAAC;AAQjD,wBAAgB,uBAAuB,IAAI,oBAAoB,CAE9D"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { getAgentsManifestSource } from './agentsDocument.js';
|
|
2
|
+
const manifest = normalizeManifest(getAgentsManifestSource());
|
|
3
|
+
export function getAgentProfileManifest() {
|
|
4
|
+
return manifest;
|
|
5
|
+
}
|
|
6
|
+
function normalizeManifest(raw) {
|
|
7
|
+
if (!isRecord(raw)) {
|
|
8
|
+
throw new Error('Agent profile manifest is malformed: expected an object.');
|
|
9
|
+
}
|
|
10
|
+
const profiles = Array.isArray(raw.profiles) ? raw.profiles.map(normalizeProfileEntry) : null;
|
|
11
|
+
if (!profiles?.length) {
|
|
12
|
+
throw new Error('Agent profile manifest must include at least one profile entry.');
|
|
13
|
+
}
|
|
14
|
+
const seen = new Set();
|
|
15
|
+
for (const entry of profiles) {
|
|
16
|
+
if (seen.has(entry.name)) {
|
|
17
|
+
throw new Error(`Agent profile manifest contains duplicate profile id "${entry.name}".`);
|
|
18
|
+
}
|
|
19
|
+
seen.add(entry.name);
|
|
20
|
+
}
|
|
21
|
+
const manifest = {
|
|
22
|
+
contractVersion: requireString(raw.contractVersion, 'contractVersion'),
|
|
23
|
+
version: requireString(raw.version, 'version'),
|
|
24
|
+
profiles,
|
|
25
|
+
};
|
|
26
|
+
const label = optionalString(raw.label);
|
|
27
|
+
if (label) {
|
|
28
|
+
manifest.label = label;
|
|
29
|
+
}
|
|
30
|
+
const description = optionalString(raw.description);
|
|
31
|
+
if (description) {
|
|
32
|
+
manifest.description = description;
|
|
33
|
+
}
|
|
34
|
+
const metadata = normalizeRecord(raw.metadata);
|
|
35
|
+
if (metadata) {
|
|
36
|
+
manifest.metadata = metadata;
|
|
37
|
+
}
|
|
38
|
+
return manifest;
|
|
39
|
+
}
|
|
40
|
+
function normalizeProfileEntry(raw) {
|
|
41
|
+
const name = requireString(raw.name, 'profile.name');
|
|
42
|
+
const profile = {
|
|
43
|
+
name,
|
|
44
|
+
label: requireString(raw.label, `profiles["${name}"].label`),
|
|
45
|
+
defaultProvider: requireProvider(raw.defaultProvider, name),
|
|
46
|
+
defaultModel: requireString(raw.defaultModel, `profiles["${name}"].defaultModel`),
|
|
47
|
+
systemPrompt: normalizePrompt(raw.systemPrompt, name),
|
|
48
|
+
rulebook: normalizeRulebook(raw.rulebook, name),
|
|
49
|
+
};
|
|
50
|
+
const description = optionalString(raw.description);
|
|
51
|
+
if (description) {
|
|
52
|
+
profile.description = description;
|
|
53
|
+
}
|
|
54
|
+
const temperature = optionalNumber(raw.temperature, `profiles["${name}"].temperature`);
|
|
55
|
+
if (typeof temperature === 'number') {
|
|
56
|
+
profile.temperature = temperature;
|
|
57
|
+
}
|
|
58
|
+
const maxTokens = optionalInteger(raw.maxTokens, `profiles["${name}"].maxTokens`);
|
|
59
|
+
if (typeof maxTokens === 'number') {
|
|
60
|
+
profile.maxTokens = maxTokens;
|
|
61
|
+
}
|
|
62
|
+
const metadata = normalizeRecord(raw.metadata);
|
|
63
|
+
if (metadata) {
|
|
64
|
+
profile.metadata = metadata;
|
|
65
|
+
}
|
|
66
|
+
return profile;
|
|
67
|
+
}
|
|
68
|
+
function normalizePrompt(raw, profile) {
|
|
69
|
+
if (!isRecord(raw)) {
|
|
70
|
+
throw new Error(`Profile "${profile}" is missing a valid systemPrompt definition.`);
|
|
71
|
+
}
|
|
72
|
+
if (raw.type === 'literal') {
|
|
73
|
+
return normalizeLiteralPrompt(raw, profile);
|
|
74
|
+
}
|
|
75
|
+
if (raw.type === 'rulebook') {
|
|
76
|
+
return normalizeRulebookPrompt(raw, profile);
|
|
77
|
+
}
|
|
78
|
+
throw new Error(`Profile "${profile}" has an unsupported systemPrompt type.`);
|
|
79
|
+
}
|
|
80
|
+
function normalizeLiteralPrompt(raw, profile) {
|
|
81
|
+
const prompt = {
|
|
82
|
+
type: 'literal',
|
|
83
|
+
content: requireString(raw.content, `profiles["${profile}"].systemPrompt.content`),
|
|
84
|
+
};
|
|
85
|
+
const metadata = normalizeRecord(raw.metadata);
|
|
86
|
+
if (metadata) {
|
|
87
|
+
prompt.metadata = metadata;
|
|
88
|
+
}
|
|
89
|
+
return prompt;
|
|
90
|
+
}
|
|
91
|
+
function normalizeRulebookPrompt(raw, _profile) {
|
|
92
|
+
const prompt = { type: 'rulebook' };
|
|
93
|
+
const template = optionalString(raw.template);
|
|
94
|
+
if (template) {
|
|
95
|
+
prompt.template = template;
|
|
96
|
+
}
|
|
97
|
+
const metadata = normalizeRecord(raw.metadata);
|
|
98
|
+
if (metadata) {
|
|
99
|
+
prompt.metadata = metadata;
|
|
100
|
+
}
|
|
101
|
+
return prompt;
|
|
102
|
+
}
|
|
103
|
+
function normalizeRulebook(raw, profile) {
|
|
104
|
+
if (!isRecord(raw)) {
|
|
105
|
+
throw new Error(`Profile "${profile}" is missing a valid rulebook reference.`);
|
|
106
|
+
}
|
|
107
|
+
const reference = {
|
|
108
|
+
file: requireString(raw.file, `profiles["${profile}"].rulebook.file`),
|
|
109
|
+
};
|
|
110
|
+
const version = optionalString(raw.version);
|
|
111
|
+
if (version) {
|
|
112
|
+
reference.version = version;
|
|
113
|
+
}
|
|
114
|
+
const contractVersion = optionalString(raw.contractVersion);
|
|
115
|
+
if (contractVersion) {
|
|
116
|
+
reference.contractVersion = contractVersion;
|
|
117
|
+
}
|
|
118
|
+
const description = optionalString(raw.description);
|
|
119
|
+
if (description) {
|
|
120
|
+
reference.description = description;
|
|
121
|
+
}
|
|
122
|
+
const metadata = normalizeRecord(raw.metadata);
|
|
123
|
+
if (metadata) {
|
|
124
|
+
reference.metadata = metadata;
|
|
125
|
+
}
|
|
126
|
+
return reference;
|
|
127
|
+
}
|
|
128
|
+
function requireProvider(value, profile) {
|
|
129
|
+
const resolved = requireString(value, `profiles["${profile}"].defaultProvider`);
|
|
130
|
+
return resolved;
|
|
131
|
+
}
|
|
132
|
+
function requireString(value, field) {
|
|
133
|
+
if (typeof value !== 'string') {
|
|
134
|
+
throw new Error(`Agent profile manifest is missing required field "${field}".`);
|
|
135
|
+
}
|
|
136
|
+
const trimmed = value.trim();
|
|
137
|
+
if (!trimmed) {
|
|
138
|
+
throw new Error(`Agent profile manifest field "${field}" cannot be blank.`);
|
|
139
|
+
}
|
|
140
|
+
return trimmed;
|
|
141
|
+
}
|
|
142
|
+
function optionalString(value) {
|
|
143
|
+
if (typeof value !== 'string') {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
const trimmed = value.trim();
|
|
147
|
+
return trimmed.length ? trimmed : undefined;
|
|
148
|
+
}
|
|
149
|
+
function optionalNumber(value, field) {
|
|
150
|
+
if (value === undefined) {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
154
|
+
throw new Error(`Agent profile manifest field "${field}" must be a finite number when provided.`);
|
|
155
|
+
}
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
function optionalInteger(value, field) {
|
|
159
|
+
if (value === undefined) {
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
if (typeof value !== 'number' || !Number.isInteger(value) || value <= 0) {
|
|
163
|
+
throw new Error(`Agent profile manifest field "${field}" must be a positive integer when provided.`);
|
|
164
|
+
}
|
|
165
|
+
return value;
|
|
166
|
+
}
|
|
167
|
+
function normalizeRecord(record) {
|
|
168
|
+
if (!isRecord(record)) {
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
return { ...record };
|
|
172
|
+
}
|
|
173
|
+
function isRecord(value) {
|
|
174
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=agentProfileManifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentProfileManifest.js","sourceRoot":"","sources":["../../src/core/agentProfileManifest.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAI9D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,uBAAuB,EAAiC,CAAC,CAAC;AAE7F,MAAM,UAAU,uBAAuB;IACrC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAgC;IACzD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9F,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACrF,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,yDAAyD,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;QAC3F,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,QAAQ,GAAyB;QACrC,eAAe,EAAE,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,CAAC;AAC9C,CAAC;AAED,SAAS,cAAc,CAAC,KAAc,EAAE,KAAa;IACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,0CAA0C,CAAC,CAAC;IACpG,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,eAAe,CAAC,KAAc,EAAE,KAAa;IACpD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,6CAA6C,CAAC,CAAC;IACvG,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,eAAe,CAAC,MAAe;IACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC;AACvB,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AgentPromptConfig, AgentRulebookReference } from '../contracts/v1/agentProfileManifest.js';
|
|
2
|
+
import type { ProviderId } from './types.js';
|
|
3
|
+
export type ProfileName = string;
|
|
4
|
+
export interface AgentProfileBlueprint {
|
|
5
|
+
name: ProfileName;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
defaultProvider: ProviderId;
|
|
9
|
+
defaultModel: string;
|
|
10
|
+
systemPromptConfig: AgentPromptConfig;
|
|
11
|
+
defaultSystemPrompt: string;
|
|
12
|
+
temperature?: number;
|
|
13
|
+
maxTokens?: number;
|
|
14
|
+
rulebook: AgentRulebookReference;
|
|
15
|
+
manifestVersion: string;
|
|
16
|
+
manifestContractVersion: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function registerAgentProfile(blueprint: AgentProfileBlueprint): void;
|
|
19
|
+
export declare function hasAgentProfile(name: ProfileName): boolean;
|
|
20
|
+
export declare function getAgentProfile(name: ProfileName): AgentProfileBlueprint;
|
|
21
|
+
export declare function listAgentProfiles(): AgentProfileBlueprint[];
|
|
22
|
+
//# sourceMappingURL=agentProfiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentProfiles.d.ts","sourceRoot":"","sources":["../../src/core/agentProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACzG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,UAAU,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,MAAM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,IAAI,EAAE,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,iBAAiB,EAAE;aAC9B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;aAC1B,IAAI,EAAE;aACN,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,2BAA2B,KAAK,IAAI,MAAM,GAAG,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AgentRulesetManifest } from '../contracts/v1/agentRules.js';
|
|
2
|
+
import type { ProfileName } from './agentProfiles.js';
|
|
3
|
+
export interface LoadRulebookOptions {
|
|
4
|
+
root?: string;
|
|
5
|
+
file?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function loadAgentRulebook(profile: ProfileName, options?: LoadRulebookOptions): AgentRulesetManifest;
|
|
8
|
+
export declare function buildAgentRulebookPrompt(profile: ProfileName, options?: LoadRulebookOptions): string;
|
|
9
|
+
export declare function formatAgentRulebook(manifest: AgentRulesetManifest): string;
|
|
10
|
+
//# sourceMappingURL=agentRulebook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentRulebook.d.ts","sourceRoot":"","sources":["../../src/core/agentRulebook.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAsC,MAAM,+BAA+B,CAAC;AAC9G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAStD,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,mBAAwB,GAAG,oBAAoB,CAa/G;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAYxG;AA+CD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,CAkC1E"}
|