@accomplish_ai/agent-core 0.0.0-pr-353-20260205225158
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/LICENSE +21 -0
- package/dist/browser/detection.d.ts +4 -0
- package/dist/browser/detection.d.ts.map +1 -0
- package/dist/browser/detection.js +43 -0
- package/dist/browser/detection.js.map +1 -0
- package/dist/browser/index.d.ts +3 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +3 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/server.d.ts +19 -0
- package/dist/browser/server.d.ts.map +1 -0
- package/dist/browser/server.js +204 -0
- package/dist/browser/server.js.map +1 -0
- package/dist/common/constants/model-display.d.ts +7 -0
- package/dist/common/constants/model-display.d.ts.map +1 -0
- package/dist/common/constants/model-display.js +105 -0
- package/dist/common/constants/model-display.js.map +1 -0
- package/dist/common/constants.d.ts +12 -0
- package/dist/common/constants.d.ts.map +1 -0
- package/dist/common/constants.js +13 -0
- package/dist/common/constants.js.map +1 -0
- package/dist/common/index.d.ts +21 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +15 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/schemas/index.d.ts +2 -0
- package/dist/common/schemas/index.d.ts.map +1 -0
- package/dist/common/schemas/index.js +2 -0
- package/dist/common/schemas/index.js.map +1 -0
- package/dist/common/schemas/validation.d.ts +69 -0
- package/dist/common/schemas/validation.d.ts.map +1 -0
- package/dist/common/schemas/validation.js +34 -0
- package/dist/common/schemas/validation.js.map +1 -0
- package/dist/common/types/auth.d.ts +28 -0
- package/dist/common/types/auth.d.ts.map +1 -0
- package/dist/common/types/auth.js +2 -0
- package/dist/common/types/auth.js.map +1 -0
- package/dist/common/types/index.d.ts +11 -0
- package/dist/common/types/index.d.ts.map +1 -0
- package/dist/common/types/index.js +11 -0
- package/dist/common/types/index.js.map +1 -0
- package/dist/common/types/logging.d.ts +15 -0
- package/dist/common/types/logging.d.ts.map +1 -0
- package/dist/common/types/logging.js +5 -0
- package/dist/common/types/logging.js.map +1 -0
- package/dist/common/types/opencode.d.ts +108 -0
- package/dist/common/types/opencode.d.ts.map +1 -0
- package/dist/common/types/opencode.js +2 -0
- package/dist/common/types/opencode.js.map +1 -0
- package/dist/common/types/permission.d.ts +35 -0
- package/dist/common/types/permission.d.ts.map +1 -0
- package/dist/common/types/permission.js +4 -0
- package/dist/common/types/permission.js.map +1 -0
- package/dist/common/types/provider.d.ts +83 -0
- package/dist/common/types/provider.d.ts.map +1 -0
- package/dist/common/types/provider.js +305 -0
- package/dist/common/types/provider.js.map +1 -0
- package/dist/common/types/providerSettings.d.ts +89 -0
- package/dist/common/types/providerSettings.d.ts.map +1 -0
- package/dist/common/types/providerSettings.js +63 -0
- package/dist/common/types/providerSettings.js.map +1 -0
- package/dist/common/types/skills.d.ts +22 -0
- package/dist/common/types/skills.d.ts.map +1 -0
- package/dist/common/types/skills.js +2 -0
- package/dist/common/types/skills.js.map +1 -0
- package/dist/common/types/task.d.ts +70 -0
- package/dist/common/types/task.d.ts.map +1 -0
- package/dist/common/types/task.js +14 -0
- package/dist/common/types/task.js.map +1 -0
- package/dist/common/types/thought-stream.d.ts +21 -0
- package/dist/common/types/thought-stream.d.ts.map +1 -0
- package/dist/common/types/thought-stream.js +6 -0
- package/dist/common/types/thought-stream.js.map +1 -0
- package/dist/common/types/todo.d.ts +7 -0
- package/dist/common/types/todo.d.ts.map +1 -0
- package/dist/common/types/todo.js +2 -0
- package/dist/common/types/todo.js.map +1 -0
- package/dist/common/utils/id.d.ts +7 -0
- package/dist/common/utils/id.d.ts.map +1 -0
- package/dist/common/utils/id.js +20 -0
- package/dist/common/utils/id.js.map +1 -0
- package/dist/common/utils/index.d.ts +4 -0
- package/dist/common/utils/index.d.ts.map +1 -0
- package/dist/common/utils/index.js +4 -0
- package/dist/common/utils/index.js.map +1 -0
- package/dist/common/utils/log-source-detector.d.ts +9 -0
- package/dist/common/utils/log-source-detector.d.ts.map +1 -0
- package/dist/common/utils/log-source-detector.js +22 -0
- package/dist/common/utils/log-source-detector.js.map +1 -0
- package/dist/common/utils/waiting-detection.d.ts +7 -0
- package/dist/common/utils/waiting-detection.d.ts.map +1 -0
- package/dist/common/utils/waiting-detection.js +62 -0
- package/dist/common/utils/waiting-detection.js.map +1 -0
- package/dist/common.d.ts +21 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +20 -0
- package/dist/common.js.map +1 -0
- package/dist/factories/index.d.ts +8 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories/index.js +8 -0
- package/dist/factories/index.js.map +1 -0
- package/dist/factories/log-writer.d.ts +3 -0
- package/dist/factories/log-writer.d.ts.map +1 -0
- package/dist/factories/log-writer.js +45 -0
- package/dist/factories/log-writer.js.map +1 -0
- package/dist/factories/permission-handler.d.ts +3 -0
- package/dist/factories/permission-handler.d.ts.map +1 -0
- package/dist/factories/permission-handler.js +6 -0
- package/dist/factories/permission-handler.js.map +1 -0
- package/dist/factories/skills-manager.d.ts +3 -0
- package/dist/factories/skills-manager.d.ts.map +1 -0
- package/dist/factories/skills-manager.js +10 -0
- package/dist/factories/skills-manager.js.map +1 -0
- package/dist/factories/speech.d.ts +3 -0
- package/dist/factories/speech.d.ts.map +1 -0
- package/dist/factories/speech.js +6 -0
- package/dist/factories/speech.js.map +1 -0
- package/dist/factories/storage.d.ts +4 -0
- package/dist/factories/storage.d.ts.map +1 -0
- package/dist/factories/storage.js +192 -0
- package/dist/factories/storage.js.map +1 -0
- package/dist/factories/task-manager.d.ts +4 -0
- package/dist/factories/task-manager.d.ts.map +1 -0
- package/dist/factories/task-manager.js +61 -0
- package/dist/factories/task-manager.js.map +1 -0
- package/dist/factories/thought-stream.d.ts +3 -0
- package/dist/factories/thought-stream.d.ts.map +1 -0
- package/dist/factories/thought-stream.js +6 -0
- package/dist/factories/thought-stream.js.map +1 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/classes/CompletionEnforcer.d.ts +27 -0
- package/dist/internal/classes/CompletionEnforcer.d.ts.map +1 -0
- package/dist/internal/classes/CompletionEnforcer.js +109 -0
- package/dist/internal/classes/CompletionEnforcer.js.map +1 -0
- package/dist/internal/classes/LogCollector.d.ts +28 -0
- package/dist/internal/classes/LogCollector.d.ts.map +1 -0
- package/dist/internal/classes/LogCollector.js +100 -0
- package/dist/internal/classes/LogCollector.js.map +1 -0
- package/dist/internal/classes/LogFileWriter.d.ts +21 -0
- package/dist/internal/classes/LogFileWriter.d.ts.map +1 -0
- package/dist/internal/classes/LogFileWriter.js +140 -0
- package/dist/internal/classes/LogFileWriter.js.map +1 -0
- package/dist/internal/classes/OpenCodeAdapter.d.ts +94 -0
- package/dist/internal/classes/OpenCodeAdapter.d.ts.map +1 -0
- package/dist/internal/classes/OpenCodeAdapter.js +653 -0
- package/dist/internal/classes/OpenCodeAdapter.js.map +1 -0
- package/dist/internal/classes/OpenCodeLogWatcher.d.ts +36 -0
- package/dist/internal/classes/OpenCodeLogWatcher.d.ts.map +1 -0
- package/dist/internal/classes/OpenCodeLogWatcher.js +257 -0
- package/dist/internal/classes/OpenCodeLogWatcher.js.map +1 -0
- package/dist/internal/classes/PermissionRequestHandler.d.ts +57 -0
- package/dist/internal/classes/PermissionRequestHandler.d.ts.map +1 -0
- package/dist/internal/classes/PermissionRequestHandler.js +132 -0
- package/dist/internal/classes/PermissionRequestHandler.js.map +1 -0
- package/dist/internal/classes/SecureStorage.d.ts +44 -0
- package/dist/internal/classes/SecureStorage.d.ts.map +1 -0
- package/dist/internal/classes/SecureStorage.js +231 -0
- package/dist/internal/classes/SecureStorage.js.map +1 -0
- package/dist/internal/classes/SkillsManager.d.ts +33 -0
- package/dist/internal/classes/SkillsManager.d.ts.map +1 -0
- package/dist/internal/classes/SkillsManager.js +340 -0
- package/dist/internal/classes/SkillsManager.js.map +1 -0
- package/dist/internal/classes/SpeechService.d.ts +30 -0
- package/dist/internal/classes/SpeechService.d.ts.map +1 -0
- package/dist/internal/classes/SpeechService.js +216 -0
- package/dist/internal/classes/SpeechService.js.map +1 -0
- package/dist/internal/classes/StreamParser.d.ts +18 -0
- package/dist/internal/classes/StreamParser.d.ts.map +1 -0
- package/dist/internal/classes/StreamParser.js +117 -0
- package/dist/internal/classes/StreamParser.js.map +1 -0
- package/dist/internal/classes/TaskManager.d.ts +72 -0
- package/dist/internal/classes/TaskManager.d.ts.map +1 -0
- package/dist/internal/classes/TaskManager.js +283 -0
- package/dist/internal/classes/TaskManager.js.map +1 -0
- package/dist/internal/classes/ThoughtStreamHandler.d.ts +15 -0
- package/dist/internal/classes/ThoughtStreamHandler.d.ts.map +1 -0
- package/dist/internal/classes/ThoughtStreamHandler.js +60 -0
- package/dist/internal/classes/ThoughtStreamHandler.js.map +1 -0
- package/dist/opencode/adapter.d.ts +93 -0
- package/dist/opencode/adapter.d.ts.map +1 -0
- package/dist/opencode/adapter.js +650 -0
- package/dist/opencode/adapter.js.map +1 -0
- package/dist/opencode/auth.d.ts +12 -0
- package/dist/opencode/auth.d.ts.map +1 -0
- package/dist/opencode/auth.js +65 -0
- package/dist/opencode/auth.js.map +1 -0
- package/dist/opencode/cli-resolver.d.ts +5 -0
- package/dist/opencode/cli-resolver.d.ts.map +1 -0
- package/dist/opencode/cli-resolver.js +148 -0
- package/dist/opencode/cli-resolver.js.map +1 -0
- package/dist/opencode/completion/completion-enforcer.d.ts +27 -0
- package/dist/opencode/completion/completion-enforcer.d.ts.map +1 -0
- package/dist/opencode/completion/completion-enforcer.js +109 -0
- package/dist/opencode/completion/completion-enforcer.js.map +1 -0
- package/dist/opencode/completion/completion-state.d.ts +36 -0
- package/dist/opencode/completion/completion-state.d.ts.map +1 -0
- package/dist/opencode/completion/completion-state.js +97 -0
- package/dist/opencode/completion/completion-state.js.map +1 -0
- package/dist/opencode/completion/index.d.ts +6 -0
- package/dist/opencode/completion/index.d.ts.map +1 -0
- package/dist/opencode/completion/index.js +4 -0
- package/dist/opencode/completion/index.js.map +1 -0
- package/dist/opencode/completion/prompts.d.ts +4 -0
- package/dist/opencode/completion/prompts.d.ts.map +1 -0
- package/dist/opencode/completion/prompts.js +58 -0
- package/dist/opencode/completion/prompts.js.map +1 -0
- package/dist/opencode/config-builder.d.ts +61 -0
- package/dist/opencode/config-builder.d.ts.map +1 -0
- package/dist/opencode/config-builder.js +395 -0
- package/dist/opencode/config-builder.js.map +1 -0
- package/dist/opencode/config-generator.d.ts +86 -0
- package/dist/opencode/config-generator.d.ts.map +1 -0
- package/dist/opencode/config-generator.js +407 -0
- package/dist/opencode/config-generator.js.map +1 -0
- package/dist/opencode/environment.d.ts +46 -0
- package/dist/opencode/environment.d.ts.map +1 -0
- package/dist/opencode/environment.js +102 -0
- package/dist/opencode/environment.js.map +1 -0
- package/dist/opencode/index.d.ts +23 -0
- package/dist/opencode/index.d.ts.map +1 -0
- package/dist/opencode/index.js +13 -0
- package/dist/opencode/index.js.map +1 -0
- package/dist/opencode/log-watcher.d.ts +36 -0
- package/dist/opencode/log-watcher.d.ts.map +1 -0
- package/dist/opencode/log-watcher.js +257 -0
- package/dist/opencode/log-watcher.js.map +1 -0
- package/dist/opencode/message-processor.d.ts +69 -0
- package/dist/opencode/message-processor.d.ts.map +1 -0
- package/dist/opencode/message-processor.js +193 -0
- package/dist/opencode/message-processor.js.map +1 -0
- package/dist/opencode/proxies/azure-foundry-proxy.d.ts +10 -0
- package/dist/opencode/proxies/azure-foundry-proxy.d.ts.map +1 -0
- package/dist/opencode/proxies/azure-foundry-proxy.js +216 -0
- package/dist/opencode/proxies/azure-foundry-proxy.js.map +1 -0
- package/dist/opencode/proxies/azure-token-manager.d.ts +11 -0
- package/dist/opencode/proxies/azure-token-manager.d.ts.map +1 -0
- package/dist/opencode/proxies/azure-token-manager.js +58 -0
- package/dist/opencode/proxies/azure-token-manager.js.map +1 -0
- package/dist/opencode/proxies/index.d.ts +6 -0
- package/dist/opencode/proxies/index.d.ts.map +1 -0
- package/dist/opencode/proxies/index.js +4 -0
- package/dist/opencode/proxies/index.js.map +1 -0
- package/dist/opencode/proxies/moonshot-proxy.d.ts +10 -0
- package/dist/opencode/proxies/moonshot-proxy.d.ts.map +1 -0
- package/dist/opencode/proxies/moonshot-proxy.js +416 -0
- package/dist/opencode/proxies/moonshot-proxy.js.map +1 -0
- package/dist/opencode/stream-parser.d.ts +18 -0
- package/dist/opencode/stream-parser.d.ts.map +1 -0
- package/dist/opencode/stream-parser.js +117 -0
- package/dist/opencode/stream-parser.js.map +1 -0
- package/dist/opencode/task-manager.d.ts +72 -0
- package/dist/opencode/task-manager.d.ts.map +1 -0
- package/dist/opencode/task-manager.js +283 -0
- package/dist/opencode/task-manager.js.map +1 -0
- package/dist/providers/azure-foundry.d.ts +48 -0
- package/dist/providers/azure-foundry.d.ts.map +1 -0
- package/dist/providers/azure-foundry.js +193 -0
- package/dist/providers/azure-foundry.js.map +1 -0
- package/dist/providers/bedrock.d.ts +34 -0
- package/dist/providers/bedrock.d.ts.map +1 -0
- package/dist/providers/bedrock.js +162 -0
- package/dist/providers/bedrock.js.map +1 -0
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +10 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/litellm.d.ts +28 -0
- package/dist/providers/litellm.d.ts.map +1 -0
- package/dist/providers/litellm.js +110 -0
- package/dist/providers/litellm.js.map +1 -0
- package/dist/providers/lmstudio.d.ts +58 -0
- package/dist/providers/lmstudio.d.ts.map +1 -0
- package/dist/providers/lmstudio.js +153 -0
- package/dist/providers/lmstudio.js.map +1 -0
- package/dist/providers/models.d.ts +10 -0
- package/dist/providers/models.d.ts.map +1 -0
- package/dist/providers/models.js +35 -0
- package/dist/providers/models.js.map +1 -0
- package/dist/providers/ollama.d.ts +31 -0
- package/dist/providers/ollama.d.ts.map +1 -0
- package/dist/providers/ollama.js +56 -0
- package/dist/providers/ollama.js.map +1 -0
- package/dist/providers/openrouter.d.ts +20 -0
- package/dist/providers/openrouter.d.ts.map +1 -0
- package/dist/providers/openrouter.js +49 -0
- package/dist/providers/openrouter.js.map +1 -0
- package/dist/providers/tool-support-testing.d.ts +42 -0
- package/dist/providers/tool-support-testing.d.ts.map +1 -0
- package/dist/providers/tool-support-testing.js +114 -0
- package/dist/providers/tool-support-testing.js.map +1 -0
- package/dist/providers/validation.d.ts +13 -0
- package/dist/providers/validation.d.ts.map +1 -0
- package/dist/providers/validation.js +136 -0
- package/dist/providers/validation.js.map +1 -0
- package/dist/services/index.d.ts +5 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +5 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/permission-handler.d.ts +145 -0
- package/dist/services/permission-handler.d.ts.map +1 -0
- package/dist/services/permission-handler.js +207 -0
- package/dist/services/permission-handler.js.map +1 -0
- package/dist/services/speech.d.ts +63 -0
- package/dist/services/speech.d.ts.map +1 -0
- package/dist/services/speech.js +253 -0
- package/dist/services/speech.js.map +1 -0
- package/dist/services/summarizer.d.ts +19 -0
- package/dist/services/summarizer.d.ts.map +1 -0
- package/dist/services/summarizer.js +177 -0
- package/dist/services/summarizer.js.map +1 -0
- package/dist/services/thought-stream-handler.d.ts +54 -0
- package/dist/services/thought-stream-handler.d.ts.map +1 -0
- package/dist/services/thought-stream-handler.js +107 -0
- package/dist/services/thought-stream-handler.js.map +1 -0
- package/dist/skills/index.d.ts +2 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +2 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/skills-manager.d.ts +33 -0
- package/dist/skills/skills-manager.d.ts.map +1 -0
- package/dist/skills/skills-manager.js +340 -0
- package/dist/skills/skills-manager.js.map +1 -0
- package/dist/storage/database.d.ts +14 -0
- package/dist/storage/database.d.ts.map +1 -0
- package/dist/storage/database.js +72 -0
- package/dist/storage/database.js.map +1 -0
- package/dist/storage/index.d.ts +6 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +6 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/migrations/errors.d.ts +17 -0
- package/dist/storage/migrations/errors.d.ts.map +1 -0
- package/dist/storage/migrations/errors.js +27 -0
- package/dist/storage/migrations/errors.js.map +1 -0
- package/dist/storage/migrations/index.d.ts +13 -0
- package/dist/storage/migrations/index.d.ts.map +1 -0
- package/dist/storage/migrations/index.js +69 -0
- package/dist/storage/migrations/index.js.map +1 -0
- package/dist/storage/migrations/v001-initial.d.ts +3 -0
- package/dist/storage/migrations/v001-initial.d.ts.map +1 -0
- package/dist/storage/migrations/v001-initial.js +77 -0
- package/dist/storage/migrations/v001-initial.js.map +1 -0
- package/dist/storage/migrations/v002-azure-foundry.d.ts +3 -0
- package/dist/storage/migrations/v002-azure-foundry.d.ts.map +1 -0
- package/dist/storage/migrations/v002-azure-foundry.js +18 -0
- package/dist/storage/migrations/v002-azure-foundry.js.map +1 -0
- package/dist/storage/migrations/v003-lmstudio.d.ts +3 -0
- package/dist/storage/migrations/v003-lmstudio.d.ts.map +1 -0
- package/dist/storage/migrations/v003-lmstudio.js +18 -0
- package/dist/storage/migrations/v003-lmstudio.js.map +1 -0
- package/dist/storage/migrations/v004-openai-base-url.d.ts +3 -0
- package/dist/storage/migrations/v004-openai-base-url.d.ts.map +1 -0
- package/dist/storage/migrations/v004-openai-base-url.js +9 -0
- package/dist/storage/migrations/v004-openai-base-url.js.map +1 -0
- package/dist/storage/migrations/v005-task-todos.d.ts +3 -0
- package/dist/storage/migrations/v005-task-todos.d.ts.map +1 -0
- package/dist/storage/migrations/v005-task-todos.js +19 -0
- package/dist/storage/migrations/v005-task-todos.js.map +1 -0
- package/dist/storage/migrations/v006-skills.d.ts +3 -0
- package/dist/storage/migrations/v006-skills.d.ts.map +1 -0
- package/dist/storage/migrations/v006-skills.js +23 -0
- package/dist/storage/migrations/v006-skills.js.map +1 -0
- package/dist/storage/repositories/appSettings.d.ts +30 -0
- package/dist/storage/repositories/appSettings.d.ts.map +1 -0
- package/dist/storage/repositories/appSettings.js +130 -0
- package/dist/storage/repositories/appSettings.js.map +1 -0
- package/dist/storage/repositories/index.d.ts +5 -0
- package/dist/storage/repositories/index.d.ts.map +1 -0
- package/dist/storage/repositories/index.js +5 -0
- package/dist/storage/repositories/index.js.map +1 -0
- package/dist/storage/repositories/providerSettings.d.ts +19 -0
- package/dist/storage/repositories/providerSettings.d.ts.map +1 -0
- package/dist/storage/repositories/providerSettings.js +114 -0
- package/dist/storage/repositories/providerSettings.js.map +1 -0
- package/dist/storage/repositories/skills.d.ts +9 -0
- package/dist/storage/repositories/skills.d.ts.map +1 -0
- package/dist/storage/repositories/skills.js +63 -0
- package/dist/storage/repositories/skills.js.map +1 -0
- package/dist/storage/repositories/taskHistory.d.ts +29 -0
- package/dist/storage/repositories/taskHistory.d.ts.map +1 -0
- package/dist/storage/repositories/taskHistory.js +159 -0
- package/dist/storage/repositories/taskHistory.js.map +1 -0
- package/dist/storage/secure-storage.d.ts +44 -0
- package/dist/storage/secure-storage.d.ts.map +1 -0
- package/dist/storage/secure-storage.js +227 -0
- package/dist/storage/secure-storage.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/log-writer.d.ts +26 -0
- package/dist/types/log-writer.d.ts.map +1 -0
- package/dist/types/log-writer.js +2 -0
- package/dist/types/log-writer.js.map +1 -0
- package/dist/types/permission-handler.d.ts +51 -0
- package/dist/types/permission-handler.d.ts.map +1 -0
- package/dist/types/permission-handler.js +2 -0
- package/dist/types/permission-handler.js.map +1 -0
- package/dist/types/skills-manager.d.ts +25 -0
- package/dist/types/skills-manager.d.ts.map +1 -0
- package/dist/types/skills-manager.js +2 -0
- package/dist/types/skills-manager.js.map +1 -0
- package/dist/types/speech.d.ts +32 -0
- package/dist/types/speech.d.ts.map +1 -0
- package/dist/types/speech.js +2 -0
- package/dist/types/speech.js.map +1 -0
- package/dist/types/storage.d.ts +95 -0
- package/dist/types/storage.d.ts.map +1 -0
- package/dist/types/storage.js +2 -0
- package/dist/types/storage.js.map +1 -0
- package/dist/types/task-manager.d.ts +69 -0
- package/dist/types/task-manager.d.ts.map +1 -0
- package/dist/types/task-manager.js +2 -0
- package/dist/types/task-manager.js.map +1 -0
- package/dist/types/thought-stream.d.ts +28 -0
- package/dist/types/thought-stream.d.ts.map +1 -0
- package/dist/types/thought-stream.js +2 -0
- package/dist/types/thought-stream.js.map +1 -0
- package/dist/types.d.ts +43 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/bundled-node.d.ts +11 -0
- package/dist/utils/bundled-node.d.ts.map +1 -0
- package/dist/utils/bundled-node.js +73 -0
- package/dist/utils/bundled-node.js.map +1 -0
- package/dist/utils/fetch.d.ts +2 -0
- package/dist/utils/fetch.d.ts.map +1 -0
- package/dist/utils/fetch.js +15 -0
- package/dist/utils/fetch.js.map +1 -0
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +14 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/json.d.ts +10 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +17 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/log-collector.d.ts +20 -0
- package/dist/utils/log-collector.d.ts.map +1 -0
- package/dist/utils/log-collector.js +100 -0
- package/dist/utils/log-collector.js.map +1 -0
- package/dist/utils/log-file-writer.d.ts +26 -0
- package/dist/utils/log-file-writer.d.ts.map +1 -0
- package/dist/utils/log-file-writer.js +144 -0
- package/dist/utils/log-file-writer.js.map +1 -0
- package/dist/utils/logging.d.ts +26 -0
- package/dist/utils/logging.d.ts.map +1 -0
- package/dist/utils/logging.js +91 -0
- package/dist/utils/logging.js.map +1 -0
- package/dist/utils/network.d.ts +14 -0
- package/dist/utils/network.d.ts.map +1 -0
- package/dist/utils/network.js +38 -0
- package/dist/utils/network.js.map +1 -0
- package/dist/utils/paths.d.ts +9 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +47 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/redact.d.ts +2 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +20 -0
- package/dist/utils/redact.js.map +1 -0
- package/dist/utils/sanitize.d.ts +3 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/sanitize.js +21 -0
- package/dist/utils/sanitize.js.map +1 -0
- package/dist/utils/shell.d.ts +26 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +60 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/system-path.d.ts +3 -0
- package/dist/utils/system-path.d.ts.map +1 -0
- package/dist/utils/system-path.js +142 -0
- package/dist/utils/system-path.js.map +1 -0
- package/dist/utils/task-status.d.ts +7 -0
- package/dist/utils/task-status.d.ts.map +1 -0
- package/dist/utils/task-status.js +12 -0
- package/dist/utils/task-status.js.map +1 -0
- package/dist/utils/task-validation.d.ts +10 -0
- package/dist/utils/task-validation.d.ts.map +1 -0
- package/dist/utils/task-validation.js +35 -0
- package/dist/utils/task-validation.js.map +1 -0
- package/dist/utils/url.d.ts +3 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +19 -0
- package/dist/utils/url.js.map +1 -0
- package/mcp-tools/ask-user-question/SKILL.md +133 -0
- package/mcp-tools/ask-user-question/dist/index.mjs +20794 -0
- package/mcp-tools/ask-user-question/package.json +17 -0
- package/mcp-tools/ask-user-question/src/index.ts +183 -0
- package/mcp-tools/ask-user-question/tsconfig.json +12 -0
- package/mcp-tools/complete-task/SKILL.md +17 -0
- package/mcp-tools/complete-task/dist/index.mjs +20722 -0
- package/mcp-tools/complete-task/package.json +12 -0
- package/mcp-tools/complete-task/src/index.ts +92 -0
- package/mcp-tools/dev-browser/SKILL.md +384 -0
- package/mcp-tools/dev-browser/dist/start-relay.mjs +6878 -0
- package/mcp-tools/dev-browser/dist/start-server.mjs +23369 -0
- package/mcp-tools/dev-browser/package.json +31 -0
- package/mcp-tools/dev-browser/src/index.ts +290 -0
- package/mcp-tools/dev-browser/src/relay.ts +652 -0
- package/mcp-tools/dev-browser/src/types.ts +31 -0
- package/mcp-tools/dev-browser/tsconfig.json +36 -0
- package/mcp-tools/dev-browser-mcp/README.md +42 -0
- package/mcp-tools/dev-browser-mcp/dist/index.mjs +24398 -0
- package/mcp-tools/dev-browser-mcp/package.json +17 -0
- package/mcp-tools/dev-browser-mcp/src/index.ts +3940 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/compactor.test.ts +86 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/compactor.ts +31 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/differ.test.ts +178 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/differ.ts +167 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/index.ts +19 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/manager.test.ts +247 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/manager.ts +131 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/parser.test.ts +94 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/parser.ts +81 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/priority.test.ts +104 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/priority.ts +84 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/tokens.test.ts +64 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/tokens.ts +36 -0
- package/mcp-tools/dev-browser-mcp/src/snapshot/types.ts +89 -0
- package/mcp-tools/dev-browser-mcp/tsconfig.json +15 -0
- package/mcp-tools/file-permission/dist/index.mjs +20752 -0
- package/mcp-tools/file-permission/package.json +17 -0
- package/mcp-tools/file-permission/src/index.ts +125 -0
- package/mcp-tools/file-permission/tsconfig.json +17 -0
- package/mcp-tools/package.json +13 -0
- package/mcp-tools/report-checkpoint/src/index.ts +127 -0
- package/mcp-tools/report-checkpoint/tsconfig.json +12 -0
- package/mcp-tools/report-thought/src/index.ts +109 -0
- package/mcp-tools/report-thought/tsconfig.json +12 -0
- package/mcp-tools/safe-file-deletion/SKILL.md +50 -0
- package/mcp-tools/start-task/dist/index.mjs +20719 -0
- package/mcp-tools/start-task/package.json +12 -0
- package/mcp-tools/start-task/src/index.ts +86 -0
- package/package.json +65 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const DEFAULT_MAX_LENGTH = 8000;
|
|
2
|
+
export function sanitizeString(input, fieldName, maxLength = DEFAULT_MAX_LENGTH) {
|
|
3
|
+
if (typeof input !== 'string') {
|
|
4
|
+
throw new Error(`${fieldName} must be a string`);
|
|
5
|
+
}
|
|
6
|
+
const trimmed = input.trim();
|
|
7
|
+
if (!trimmed) {
|
|
8
|
+
throw new Error(`${fieldName} is required`);
|
|
9
|
+
}
|
|
10
|
+
if (trimmed.length > maxLength) {
|
|
11
|
+
throw new Error(`${fieldName} exceeds maximum length of ${maxLength}`);
|
|
12
|
+
}
|
|
13
|
+
return trimmed;
|
|
14
|
+
}
|
|
15
|
+
export function sanitizeOptionalString(input, fieldName, maxLength = DEFAULT_MAX_LENGTH) {
|
|
16
|
+
if (input === null || input === undefined) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return sanitizeString(input, fieldName, maxLength);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=sanitize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitize.js","sourceRoot":"","sources":["../../src/utils/sanitize.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,MAAM,UAAU,cAAc,CAC5B,KAAc,EACd,SAAiB,EACjB,SAAS,GAAG,kBAAkB;IAE9B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,mBAAmB,CAAC,CAAC;IACnD,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,cAAc,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,8BAA8B,SAAS,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAc,EACd,SAAiB,EACjB,SAAS,GAAG,kBAAkB;IAE9B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strips ANSI escape codes from a string.
|
|
3
|
+
* @param input - The string potentially containing ANSI escape codes
|
|
4
|
+
* @returns The string with all ANSI escape codes removed
|
|
5
|
+
*/
|
|
6
|
+
export declare function stripAnsi(input: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Quotes an argument for safe use in shell commands.
|
|
9
|
+
* Handles platform-specific quoting requirements.
|
|
10
|
+
* @param arg - The argument to quote
|
|
11
|
+
* @returns The properly quoted argument
|
|
12
|
+
*/
|
|
13
|
+
export declare function quoteForShell(arg: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the appropriate shell for the current platform.
|
|
16
|
+
* @param isPackaged - Whether the app is running in packaged mode (optional)
|
|
17
|
+
* @returns The path to the shell executable
|
|
18
|
+
*/
|
|
19
|
+
export declare function getPlatformShell(isPackaged?: boolean): string;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the shell arguments needed to execute a command.
|
|
22
|
+
* @param command - The command to execute
|
|
23
|
+
* @returns Array of shell arguments
|
|
24
|
+
*/
|
|
25
|
+
export declare function getShellArgs(command: string): string[];
|
|
26
|
+
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/utils/shell.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAWjD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAY7D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAKtD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
/**
|
|
3
|
+
* Strips ANSI escape codes from a string.
|
|
4
|
+
* @param input - The string potentially containing ANSI escape codes
|
|
5
|
+
* @returns The string with all ANSI escape codes removed
|
|
6
|
+
*/
|
|
7
|
+
export function stripAnsi(input) {
|
|
8
|
+
return input.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, '');
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Quotes an argument for safe use in shell commands.
|
|
12
|
+
* Handles platform-specific quoting requirements.
|
|
13
|
+
* @param arg - The argument to quote
|
|
14
|
+
* @returns The properly quoted argument
|
|
15
|
+
*/
|
|
16
|
+
export function quoteForShell(arg) {
|
|
17
|
+
if (process.platform === 'win32') {
|
|
18
|
+
if (arg.includes(' ') || arg.includes('"')) {
|
|
19
|
+
return `"${arg.replace(/"/g, '\\"')}"`;
|
|
20
|
+
}
|
|
21
|
+
return arg;
|
|
22
|
+
}
|
|
23
|
+
if (arg.includes("'") || arg.includes(' ') || arg.includes('"')) {
|
|
24
|
+
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
25
|
+
}
|
|
26
|
+
return arg;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the appropriate shell for the current platform.
|
|
30
|
+
* @param isPackaged - Whether the app is running in packaged mode (optional)
|
|
31
|
+
* @returns The path to the shell executable
|
|
32
|
+
*/
|
|
33
|
+
export function getPlatformShell(isPackaged) {
|
|
34
|
+
if (process.platform === 'win32') {
|
|
35
|
+
return 'powershell.exe';
|
|
36
|
+
}
|
|
37
|
+
if (isPackaged && process.platform === 'darwin') {
|
|
38
|
+
return '/bin/sh';
|
|
39
|
+
}
|
|
40
|
+
const userShell = process.env.SHELL;
|
|
41
|
+
if (userShell)
|
|
42
|
+
return userShell;
|
|
43
|
+
if (fs.existsSync('/bin/bash'))
|
|
44
|
+
return '/bin/bash';
|
|
45
|
+
if (fs.existsSync('/bin/zsh'))
|
|
46
|
+
return '/bin/zsh';
|
|
47
|
+
return '/bin/sh';
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns the shell arguments needed to execute a command.
|
|
51
|
+
* @param command - The command to execute
|
|
52
|
+
* @returns Array of shell arguments
|
|
53
|
+
*/
|
|
54
|
+
export function getShellArgs(command) {
|
|
55
|
+
if (process.platform === 'win32') {
|
|
56
|
+
return ['-NoProfile', '-Command', command];
|
|
57
|
+
}
|
|
58
|
+
return ['-c', command];
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/utils/shell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,KAAK,CAA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AAY,CAAC,OAAe;IAC1C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-path.d.ts","sourceRoot":"","sources":["../../src/utils/system-path.ts"],"names":[],"mappings":"AAiGA,wBAAgB,mBAAmB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAgC7D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA2BpF"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
function getNvmNodePaths() {
|
|
5
|
+
const home = process.env.HOME || '';
|
|
6
|
+
const nvmVersionsDir = path.join(home, '.nvm', 'versions', 'node');
|
|
7
|
+
if (!fs.existsSync(nvmVersionsDir)) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
const versions = fs.readdirSync(nvmVersionsDir)
|
|
12
|
+
.filter(name => name.startsWith('v'))
|
|
13
|
+
.sort((a, b) => {
|
|
14
|
+
const parseVersion = (v) => {
|
|
15
|
+
const parts = v.replace('v', '').split('.').map(Number);
|
|
16
|
+
return parts[0] * 10000 + (parts[1] || 0) * 100 + (parts[2] || 0);
|
|
17
|
+
};
|
|
18
|
+
return parseVersion(b) - parseVersion(a);
|
|
19
|
+
});
|
|
20
|
+
return versions.map(v => path.join(nvmVersionsDir, v, 'bin'));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function getFnmNodePaths() {
|
|
27
|
+
const home = process.env.HOME || '';
|
|
28
|
+
const fnmVersionsDir = path.join(home, '.fnm', 'node-versions');
|
|
29
|
+
if (!fs.existsSync(fnmVersionsDir)) {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const versions = fs.readdirSync(fnmVersionsDir)
|
|
34
|
+
.filter(name => name.startsWith('v'))
|
|
35
|
+
.sort((a, b) => {
|
|
36
|
+
const parseVersion = (v) => {
|
|
37
|
+
const parts = v.replace('v', '').split('.').map(Number);
|
|
38
|
+
return parts[0] * 10000 + (parts[1] || 0) * 100 + (parts[2] || 0);
|
|
39
|
+
};
|
|
40
|
+
return parseVersion(b) - parseVersion(a);
|
|
41
|
+
});
|
|
42
|
+
return versions.map(v => path.join(fnmVersionsDir, v, 'installation', 'bin'));
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function getCommonNodePaths() {
|
|
49
|
+
const home = process.env.HOME || '';
|
|
50
|
+
const nvmPaths = getNvmNodePaths();
|
|
51
|
+
const fnmPaths = getFnmNodePaths();
|
|
52
|
+
return [
|
|
53
|
+
...nvmPaths,
|
|
54
|
+
...fnmPaths,
|
|
55
|
+
'/opt/homebrew/bin',
|
|
56
|
+
'/usr/local/bin',
|
|
57
|
+
`${home}/.nvm/current/bin`,
|
|
58
|
+
`${home}/.volta/bin`,
|
|
59
|
+
`${home}/.asdf/shims`,
|
|
60
|
+
`${home}/.fnm/current/bin`,
|
|
61
|
+
`${home}/.nodenv/shims`,
|
|
62
|
+
'/usr/local/opt/node/bin',
|
|
63
|
+
'/opt/local/bin',
|
|
64
|
+
`${home}/.local/bin`,
|
|
65
|
+
].filter(p => p && !p.includes('undefined'));
|
|
66
|
+
}
|
|
67
|
+
function getSystemPathFromPathHelper() {
|
|
68
|
+
if (process.platform !== 'darwin') {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
const output = execSync('/usr/libexec/path_helper -s', {
|
|
73
|
+
encoding: 'utf-8',
|
|
74
|
+
timeout: 5000,
|
|
75
|
+
});
|
|
76
|
+
const match = output.match(/PATH="([^"]+)"/);
|
|
77
|
+
if (match && match[1]) {
|
|
78
|
+
return match[1];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
console.warn('[SystemPath] path_helper failed:', err);
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
export function getExtendedNodePath(basePath) {
|
|
87
|
+
const base = basePath || process.env.PATH || '';
|
|
88
|
+
if (process.platform !== 'darwin') {
|
|
89
|
+
return base;
|
|
90
|
+
}
|
|
91
|
+
const nodePaths = getCommonNodePaths();
|
|
92
|
+
const systemPath = getSystemPathFromPathHelper();
|
|
93
|
+
const pathParts = [];
|
|
94
|
+
for (const p of nodePaths) {
|
|
95
|
+
if (fs.existsSync(p) && !pathParts.includes(p)) {
|
|
96
|
+
pathParts.push(p);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (systemPath) {
|
|
100
|
+
for (const p of systemPath.split(':')) {
|
|
101
|
+
if (p && !pathParts.includes(p)) {
|
|
102
|
+
pathParts.push(p);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
for (const p of base.split(':')) {
|
|
107
|
+
if (p && !pathParts.includes(p)) {
|
|
108
|
+
pathParts.push(p);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return pathParts.join(':');
|
|
112
|
+
}
|
|
113
|
+
export function findCommandInPath(command, searchPath) {
|
|
114
|
+
const delimiter = process.platform === 'win32' ? ';' : ':';
|
|
115
|
+
for (const dir of searchPath.split(delimiter)) {
|
|
116
|
+
if (!dir)
|
|
117
|
+
continue;
|
|
118
|
+
const fullPath = path.join(dir, command);
|
|
119
|
+
try {
|
|
120
|
+
if (fs.existsSync(fullPath)) {
|
|
121
|
+
const stats = fs.statSync(fullPath);
|
|
122
|
+
if (stats.isFile()) {
|
|
123
|
+
if (process.platform !== 'win32') {
|
|
124
|
+
try {
|
|
125
|
+
fs.accessSync(fullPath, fs.constants.X_OK);
|
|
126
|
+
return fullPath;
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
return fullPath;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=system-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-path.js","sourceRoot":"","sources":["../../src/utils/system-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,SAAS,eAAe;IACtB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;IACpC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAEnE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC;aAC5C,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACb,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE;gBACjC,MAAM,KA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Q,CAAC;oBAClB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;QACT,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TaskStatus, TaskResult } from '../common/types/task.js';
|
|
2
|
+
/**
|
|
3
|
+
* Maps a TaskResult status to a TaskStatus.
|
|
4
|
+
* Used when a task completes to determine the final task status.
|
|
5
|
+
*/
|
|
6
|
+
export declare function mapResultToStatus(result: TaskResult): TaskStatus;
|
|
7
|
+
//# sourceMappingURL=task-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-status.d.ts","sourceRoot":"","sources":["../../src/utils/task-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEtE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAIhE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a TaskResult status to a TaskStatus.
|
|
3
|
+
* Used when a task completes to determine the final task status.
|
|
4
|
+
*/
|
|
5
|
+
export function mapResultToStatus(result) {
|
|
6
|
+
if (result.status === 'success')
|
|
7
|
+
return 'completed';
|
|
8
|
+
if (result.status === 'interrupted')
|
|
9
|
+
return 'interrupted';
|
|
10
|
+
return 'failed';
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=task-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-status.js","sourceRoot":"","sources":["../../src/utils/task-status.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAkB;IAClD,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IACpD,IAAI,MAAM,CAAC,MAAM,KAAK,aAAa;QAAE,OAAO,aAAa,CAAC;IAC1D,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TaskConfig } from '../common/types/task.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validates and sanitizes a TaskConfig object.
|
|
4
|
+
* Ensures all fields are properly typed, trimmed, and within length limits.
|
|
5
|
+
*
|
|
6
|
+
* @param config - The task configuration to validate
|
|
7
|
+
* @returns A sanitized TaskConfig with all fields validated
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateTaskConfig(config: TaskConfig): TaskConfig;
|
|
10
|
+
//# sourceMappingURL=task-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-validation.d.ts","sourceRoot":"","sources":["../../src/utils/task-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CA8BjE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { sanitizeString } from './sanitize.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validates and sanitizes a TaskConfig object.
|
|
4
|
+
* Ensures all fields are properly typed, trimmed, and within length limits.
|
|
5
|
+
*
|
|
6
|
+
* @param config - The task configuration to validate
|
|
7
|
+
* @returns A sanitized TaskConfig with all fields validated
|
|
8
|
+
*/
|
|
9
|
+
export function validateTaskConfig(config) {
|
|
10
|
+
const prompt = sanitizeString(config.prompt, 'prompt');
|
|
11
|
+
const validated = { prompt };
|
|
12
|
+
if (config.taskId) {
|
|
13
|
+
validated.taskId = sanitizeString(config.taskId, 'taskId', 128);
|
|
14
|
+
}
|
|
15
|
+
if (config.sessionId) {
|
|
16
|
+
validated.sessionId = sanitizeString(config.sessionId, 'sessionId', 128);
|
|
17
|
+
}
|
|
18
|
+
if (config.workingDirectory) {
|
|
19
|
+
validated.workingDirectory = sanitizeString(config.workingDirectory, 'workingDirectory', 1024);
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(config.allowedTools)) {
|
|
22
|
+
validated.allowedTools = config.allowedTools
|
|
23
|
+
.filter((tool) => typeof tool === 'string')
|
|
24
|
+
.map((tool) => sanitizeString(tool, 'allowedTools', 64))
|
|
25
|
+
.slice(0, 20);
|
|
26
|
+
}
|
|
27
|
+
if (config.systemPromptAppend) {
|
|
28
|
+
validated.systemPromptAppend = sanitizeString(config.systemPromptAppend, 'systemPromptAppend');
|
|
29
|
+
}
|
|
30
|
+
if (config.outputSchema && typeof config.outputSchema === 'object') {
|
|
31
|
+
validated.outputSchema = config.outputSchema;
|
|
32
|
+
}
|
|
33
|
+
return validated;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=task-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-validation.js","sourceRoot":"","sources":["../../src/utils/task-validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAkB;IACnD,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvD,MAAM,SAAS,GAAe,EAAE,MAAM,EAAE,CAAC;IAEzC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,SAAS,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,SAAS,CAAC,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC5B,SAAS,CAAC,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;IACjG,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;QACvC,SAAS,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY;aACzC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC;aAC1D,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;aACvD,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC9B,SAAS,CAAC,kBAAkB,GAAG,cAAc,CAC3C,MAAM,CAAC,kBAAkB,EACzB,oBAAoB,CACrB,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,YAAY,IAAI,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;QACnE,SAAS,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IAC/C,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,SAAQ,GAAG,GAAG,CAazE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function validateHttpUrl(urlString, fieldName = 'URL') {
|
|
2
|
+
try {
|
|
3
|
+
const parsed = new URL(urlString);
|
|
4
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
5
|
+
throw new Error(`${fieldName} must use http or https protocol`);
|
|
6
|
+
}
|
|
7
|
+
return parsed;
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (error instanceof Error && error.message.includes('protocol')) {
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
throw new Error(`${fieldName} is not a valid URL`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function normalizeBaseUrl(baseUrl) {
|
|
17
|
+
return baseUrl.replace(/\/+$/, '');
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAE,SAAS,GAAG,KAAK;IAClE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;QAClC,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAChE,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,kCAAkC,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACjE,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,qBAAqB,CAAC,CAAC;IACrD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ask-user-question
|
|
3
|
+
description: Ask users questions via the UI. Use when you need clarification, user preferences, or confirmation before proceeding. The user CANNOT see CLI output - this tool is the ONLY way to communicate with them.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ask User Question
|
|
7
|
+
|
|
8
|
+
Use this MCP tool to ask users questions and get their responses. This is the **ONLY** way to communicate with the user - they cannot see CLI/terminal output.
|
|
9
|
+
|
|
10
|
+
## Critical Rule
|
|
11
|
+
|
|
12
|
+
The user **CANNOT** see your text output or CLI prompts!
|
|
13
|
+
|
|
14
|
+
If you write "Let me ask you..." and then just output text - **THE USER WILL NOT SEE IT**.
|
|
15
|
+
You MUST call this tool to display a modal in the UI.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- Clarifying questions before starting ambiguous tasks
|
|
20
|
+
- Asking user preferences (e.g., "How would you like files organized?")
|
|
21
|
+
- Confirming actions before executing (especially destructive/irreversible ones)
|
|
22
|
+
- Getting approval for sensitive actions (financial, messaging, deletion, etc.)
|
|
23
|
+
- Any situation where you need user input to proceed
|
|
24
|
+
|
|
25
|
+
## Parameters
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"questions": [{
|
|
30
|
+
"question": "Your question to the user",
|
|
31
|
+
"header": "Short label (max 12 chars)",
|
|
32
|
+
"options": [
|
|
33
|
+
{ "label": "Option 1", "description": "What this does" },
|
|
34
|
+
{ "label": "Option 2", "description": "What this does" }
|
|
35
|
+
],
|
|
36
|
+
"multiSelect": false
|
|
37
|
+
}]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- `question` (required): The question text to display
|
|
42
|
+
- `header` (optional): Short category label, shown as modal title (max 12 chars)
|
|
43
|
+
- `options` (optional): Array of selectable choices (2-4 recommended)
|
|
44
|
+
- `multiSelect` (optional): Allow selecting multiple options (default: false)
|
|
45
|
+
|
|
46
|
+
**Custom text input:** To allow users to type their own response, include an option with label "Other" (case-insensitive). When selected, the UI shows a text input field.
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{ "label": "Other", "description": "Type your own response" }
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Important:** When "Other" is selected, the response will be `User responded: [their text]` instead of `User selected: Other`. You must wait for and handle this text response - do NOT proceed as if they selected a predefined option.
|
|
53
|
+
|
|
54
|
+
## Examples
|
|
55
|
+
|
|
56
|
+
### Asking about organization preferences
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
AskUserQuestion({
|
|
60
|
+
"questions": [{
|
|
61
|
+
"question": "How would you like to organize your Downloads folder?",
|
|
62
|
+
"header": "Organize",
|
|
63
|
+
"options": [
|
|
64
|
+
{ "label": "By file type", "description": "Group into Documents, Images, Videos, etc." },
|
|
65
|
+
{ "label": "By date", "description": "Group by month/year" },
|
|
66
|
+
{ "label": "By project", "description": "You'll help me name project folders" }
|
|
67
|
+
]
|
|
68
|
+
}]
|
|
69
|
+
})
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Confirming a destructive action
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
AskUserQuestion({
|
|
76
|
+
"questions": [{
|
|
77
|
+
"question": "Delete these 15 duplicate files?",
|
|
78
|
+
"header": "Confirm",
|
|
79
|
+
"options": [
|
|
80
|
+
{ "label": "Delete all", "description": "Remove all 15 duplicates" },
|
|
81
|
+
{ "label": "Review first", "description": "Show me the list before deleting" },
|
|
82
|
+
{ "label": "Cancel", "description": "Don't delete anything" }
|
|
83
|
+
]
|
|
84
|
+
}]
|
|
85
|
+
})
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Simple yes/no confirmation
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
AskUserQuestion({
|
|
92
|
+
"questions": [{
|
|
93
|
+
"question": "Should I proceed with sending this email?",
|
|
94
|
+
"header": "Send email",
|
|
95
|
+
"options": [
|
|
96
|
+
{ "label": "Send", "description": "Send the email now" },
|
|
97
|
+
{ "label": "Cancel", "description": "Don't send" }
|
|
98
|
+
]
|
|
99
|
+
}]
|
|
100
|
+
})
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Response Format
|
|
104
|
+
|
|
105
|
+
The tool returns the user's selection:
|
|
106
|
+
- `User selected: By file type` - Single selection
|
|
107
|
+
- `User selected: Option A, Option B` - Multiple selections (if multiSelect: true)
|
|
108
|
+
- `User responded: [custom text]` - If user typed a custom response
|
|
109
|
+
- `User declined to answer the question.` - If user dismissed the modal
|
|
110
|
+
|
|
111
|
+
## Wrong vs Correct
|
|
112
|
+
|
|
113
|
+
**WRONG** (user won't see this):
|
|
114
|
+
```
|
|
115
|
+
I'll help organize your files. How would you like them organized?
|
|
116
|
+
- By type
|
|
117
|
+
- By date
|
|
118
|
+
- By project
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**CORRECT** (user will see a modal):
|
|
122
|
+
```
|
|
123
|
+
AskUserQuestion({
|
|
124
|
+
"questions": [{
|
|
125
|
+
"question": "How would you like your files organized?",
|
|
126
|
+
"options": [
|
|
127
|
+
{ "label": "By type" },
|
|
128
|
+
{ "label": "By date" },
|
|
129
|
+
{ "label": "By project" }
|
|
130
|
+
]
|
|
131
|
+
}]
|
|
132
|
+
})
|
|
133
|
+
```
|