tarsk 0.3.43 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/agent/agent.error-utils.d.ts +14 -0
- package/dist/agent/agent.error-utils.js +52 -0
- package/dist/agent/agent.event-transformer.d.ts +55 -0
- package/dist/agent/agent.event-transformer.js +175 -0
- package/dist/agent/agent.executor.d.ts +26 -0
- package/dist/agent/agent.executor.js +286 -0
- package/dist/agent/agent.model-resolver.d.ts +22 -0
- package/dist/agent/agent.model-resolver.js +67 -0
- package/dist/agent/agent.process-manager.d.ts +57 -0
- package/dist/agent/agent.process-manager.js +262 -0
- package/dist/agent/agent.processing-state-manager.d.ts +74 -0
- package/dist/agent/agent.processing-state-manager.js +87 -0
- package/dist/agent/agent.prompt-loader.d.ts +16 -0
- package/dist/agent/agent.prompt-loader.js +227 -0
- package/dist/agent/agent.subagent-executor.d.ts +35 -0
- package/dist/agent/agent.subagent-executor.js +135 -0
- package/dist/bun/index.d.ts +2 -0
- package/dist/bun/index.js +165 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +22 -0
- package/dist/core/crypto.d.ts +29 -0
- package/dist/core/crypto.js +166 -0
- package/dist/core/dev-server-cache.d.ts +46 -0
- package/dist/core/dev-server-cache.js +59 -0
- package/dist/core/env-manager.d.ts +3 -0
- package/dist/core/env-manager.js +60 -0
- package/dist/core/error-responses.d.ts +61 -0
- package/dist/core/error-responses.js +64 -0
- package/dist/core/logger.d.ts +10 -0
- package/dist/core/logger.js +47 -0
- package/dist/core/paths.d.ts +22 -0
- package/dist/core/paths.js +26 -0
- package/dist/core/random-words.d.ts +18 -0
- package/dist/core/random-words.js +135 -0
- package/dist/core/response-builder.d.ts +50 -0
- package/dist/core/response-builder.js +56 -0
- package/dist/core/route-helpers.d.ts +47 -0
- package/dist/core/route-helpers.js +54 -0
- package/dist/core/run-command-detector.d.ts +26 -0
- package/dist/core/run-command-detector.js +98 -0
- package/dist/core/stream-helper.d.ts +44 -0
- package/dist/core/stream-helper.js +50 -0
- package/dist/core/utils.d.ts +43 -0
- package/dist/core/utils.js +113 -0
- package/dist/core/validation.d.ts +10 -0
- package/dist/core/validation.js +20 -0
- package/dist/database/database.d.ts +40 -0
- package/dist/database/database.encryption.d.ts +33 -0
- package/dist/database/database.encryption.js +62 -0
- package/dist/database/database.js +480 -0
- package/dist/database/database.state.d.ts +52 -0
- package/dist/database/database.state.js +119 -0
- package/dist/database/database.test-utils.d.ts +22 -0
- package/dist/database/database.test-utils.js +39 -0
- package/dist/database/database.types.d.ts +3 -0
- package/dist/database/database.types.js +2 -0
- package/dist/features/agents/agents.manager.d.ts +24 -0
- package/dist/features/agents/agents.manager.js +200 -0
- package/dist/features/ask-user/ask-user.routes.d.ts +9 -0
- package/dist/features/ask-user/ask-user.routes.js +35 -0
- package/dist/features/chat/chat-delete.route.d.ts +15 -0
- package/dist/features/chat/chat-delete.route.js +36 -0
- package/dist/features/chat/chat-post.route.d.ts +11 -0
- package/dist/features/chat/chat-post.route.js +270 -0
- package/dist/features/chat/chat-stop.route.d.ts +21 -0
- package/dist/features/chat/chat-stop.route.js +22 -0
- package/dist/features/chat/chat-subscribe.route.d.ts +9 -0
- package/dist/features/chat/chat-subscribe.route.js +71 -0
- package/dist/features/chat/chat.routes.d.ts +22 -0
- package/dist/features/chat/chat.routes.js +29 -0
- package/dist/features/conversations/conversations-delete.route.d.ts +16 -0
- package/dist/features/conversations/conversations-delete.route.js +34 -0
- package/dist/features/conversations/conversations-get-all.route.d.ts +16 -0
- package/dist/features/conversations/conversations-get-all.route.js +39 -0
- package/dist/features/conversations/conversations-get-by-id.route.d.ts +16 -0
- package/dist/features/conversations/conversations-get-by-id.route.js +38 -0
- package/dist/features/conversations/conversations-get-deleted.route.d.ts +15 -0
- package/dist/features/conversations/conversations-get-deleted.route.js +34 -0
- package/dist/features/conversations/conversations-get-messages.route.d.ts +16 -0
- package/dist/features/conversations/conversations-get-messages.route.js +49 -0
- package/dist/features/conversations/conversations.content.d.ts +28 -0
- package/dist/features/conversations/conversations.content.js +142 -0
- package/dist/features/conversations/conversations.database.d.ts +108 -0
- package/dist/features/conversations/conversations.database.js +373 -0
- package/dist/features/conversations/conversations.manager.d.ts +130 -0
- package/dist/features/conversations/conversations.manager.js +162 -0
- package/dist/features/conversations/conversations.routes.d.ts +21 -0
- package/dist/features/conversations/conversations.routes.js +38 -0
- package/dist/features/conversations/token-usage.route.d.ts +41 -0
- package/dist/features/conversations/token-usage.route.js +419 -0
- package/dist/features/git/git-commit.route.d.ts +12 -0
- package/dist/features/git/git-commit.route.js +39 -0
- package/dist/features/git/git-create-branch.route.d.ts +28 -0
- package/dist/features/git/git-create-branch.route.js +119 -0
- package/dist/features/git/git-create-pr.route.d.ts +13 -0
- package/dist/features/git/git-create-pr.route.js +50 -0
- package/dist/features/git/git-create-repo.route.d.ts +14 -0
- package/dist/features/git/git-create-repo.route.js +108 -0
- package/dist/features/git/git-diff.route.d.ts +30 -0
- package/dist/features/git/git-diff.route.js +189 -0
- package/dist/features/git/git-fetch.route.d.ts +12 -0
- package/dist/features/git/git-fetch.route.js +31 -0
- package/dist/features/git/git-generate-commit-message.route.d.ts +12 -0
- package/dist/features/git/git-generate-commit-message.route.js +76 -0
- package/dist/features/git/git-generate-pr-info.route.d.ts +13 -0
- package/dist/features/git/git-generate-pr-info.route.js +147 -0
- package/dist/features/git/git-github-status.route.d.ts +16 -0
- package/dist/features/git/git-github-status.route.js +68 -0
- package/dist/features/git/git-log.route.d.ts +17 -0
- package/dist/features/git/git-log.route.js +33 -0
- package/dist/features/git/git-pr-status.route.d.ts +15 -0
- package/dist/features/git/git-pr-status.route.js +33 -0
- package/dist/features/git/git-pull.route.d.ts +12 -0
- package/dist/features/git/git-pull.route.js +35 -0
- package/dist/features/git/git-push.route.d.ts +12 -0
- package/dist/features/git/git-push.route.js +46 -0
- package/dist/features/git/git-status-cache.database.d.ts +7 -0
- package/dist/features/git/git-status-cache.database.js +53 -0
- package/dist/features/git/git-status.route.d.ts +15 -0
- package/dist/features/git/git-status.route.js +62 -0
- package/dist/features/git/git-sync-branch.route.d.ts +4 -0
- package/dist/features/git/git-sync-branch.route.js +208 -0
- package/dist/features/git/git-unified-status.route.d.ts +30 -0
- package/dist/features/git/git-unified-status.route.js +165 -0
- package/dist/features/git/git-username.route.d.ts +3 -0
- package/dist/features/git/git-username.route.js +24 -0
- package/dist/features/git/git.manager.d.ts +139 -0
- package/dist/features/git/git.manager.js +352 -0
- package/dist/features/git/git.routes.d.ts +4 -0
- package/dist/features/git/git.routes.js +116 -0
- package/dist/features/git/git.utils.d.ts +82 -0
- package/dist/features/git/git.utils.js +1040 -0
- package/dist/features/mcp/mcp.config.d.ts +27 -0
- package/dist/features/mcp/mcp.config.js +148 -0
- package/dist/features/mcp/mcp.manager.d.ts +61 -0
- package/dist/features/mcp/mcp.manager.js +254 -0
- package/dist/features/mcp/mcp.popular.json +103 -0
- package/dist/features/mcp/mcp.routes.d.ts +13 -0
- package/dist/features/mcp/mcp.routes.js +159 -0
- package/dist/features/mcp/mcp.types.d.ts +80 -0
- package/dist/features/mcp/mcp.types.js +8 -0
- package/dist/features/metadata/metadata.manager.d.ts +126 -0
- package/dist/features/metadata/metadata.manager.js +423 -0
- package/dist/features/models/model-info-aihubmix.d.ts +25 -0
- package/dist/features/models/model-info-aihubmix.js +117 -0
- package/dist/features/models/model-info-openrouter.d.ts +25 -0
- package/dist/features/models/model-info-openrouter.js +104 -0
- package/dist/features/models/model-info.d.ts +37 -0
- package/dist/features/models/model-info.js +39 -0
- package/dist/features/models/models-catalog.d.ts +49 -0
- package/dist/features/models/models-catalog.js +80 -0
- package/dist/features/models/models-catalog.route.d.ts +43 -0
- package/dist/features/models/models-catalog.route.js +15 -0
- package/dist/features/models/models-get-available.route.d.ts +36 -0
- package/dist/features/models/models-get-available.route.js +66 -0
- package/dist/features/models/models-get-enabled.route.d.ts +33 -0
- package/dist/features/models/models-get-enabled.route.js +45 -0
- package/dist/features/models/models-get-model-info.route.d.ts +31 -0
- package/dist/features/models/models-get-model-info.route.js +84 -0
- package/dist/features/models/models-model-disable.route.d.ts +15 -0
- package/dist/features/models/models-model-disable.route.js +20 -0
- package/dist/features/models/models-model-enable.route.d.ts +13 -0
- package/dist/features/models/models-model-enable.route.js +20 -0
- package/dist/features/models/models-provider-refresh.route.d.ts +17 -0
- package/dist/features/models/models-provider-refresh.route.js +20 -0
- package/dist/features/models/models.manager.d.ts +58 -0
- package/dist/features/models/models.manager.js +138 -0
- package/dist/features/models/models.routes.d.ts +18 -0
- package/dist/features/models/models.routes.js +83 -0
- package/dist/features/models/open-router-models.d.ts +38 -0
- package/dist/features/models/open-router-models.js +73 -0
- package/dist/features/models/openai-models.d.ts +63 -0
- package/dist/features/models/openai-models.js +150 -0
- package/dist/features/onboarding/onboarding-get-git-check.route.d.ts +11 -0
- package/dist/features/onboarding/onboarding-get-git-check.route.js +28 -0
- package/dist/features/onboarding/onboarding-get-status.route.d.ts +12 -0
- package/dist/features/onboarding/onboarding-get-status.route.js +15 -0
- package/dist/features/onboarding/onboarding-post-complete.route.d.ts +12 -0
- package/dist/features/onboarding/onboarding-post-complete.route.js +15 -0
- package/dist/features/onboarding/onboarding-post-reset.route.d.ts +12 -0
- package/dist/features/onboarding/onboarding-post-reset.route.js +15 -0
- package/dist/features/onboarding/onboarding.routes.d.ts +18 -0
- package/dist/features/onboarding/onboarding.routes.js +28 -0
- package/dist/features/project-todos/project-todos.database.d.ts +38 -0
- package/dist/features/project-todos/project-todos.database.js +91 -0
- package/dist/features/project-todos/project-todos.routes.d.ts +4 -0
- package/dist/features/project-todos/project-todos.routes.js +94 -0
- package/dist/features/projects/projects-ai-files.route.d.ts +148 -0
- package/dist/features/projects/projects-ai-files.route.js +425 -0
- package/dist/features/projects/projects-commands.route.d.ts +27 -0
- package/dist/features/projects/projects-commands.route.js +39 -0
- package/dist/features/projects/projects-create.route.d.ts +19 -0
- package/dist/features/projects/projects-create.route.js +37 -0
- package/dist/features/projects/projects-delete.route.d.ts +24 -0
- package/dist/features/projects/projects-delete.route.js +34 -0
- package/dist/features/projects/projects-get.route.d.ts +47 -0
- package/dist/features/projects/projects-get.route.js +36 -0
- package/dist/features/projects/projects-list.route.d.ts +58 -0
- package/dist/features/projects/projects-list.route.js +59 -0
- package/dist/features/projects/projects-open-folder.route.d.ts +10 -0
- package/dist/features/projects/projects-open-folder.route.js +11 -0
- package/dist/features/projects/projects-open.route.d.ts +26 -0
- package/dist/features/projects/projects-open.route.js +49 -0
- package/dist/features/projects/projects-package-scripts.route.d.ts +15 -0
- package/dist/features/projects/projects-package-scripts.route.js +96 -0
- package/dist/features/projects/projects-run-command.route.d.ts +8 -0
- package/dist/features/projects/projects-run-command.route.js +21 -0
- package/dist/features/projects/projects-run.route.d.ts +51 -0
- package/dist/features/projects/projects-run.route.js +74 -0
- package/dist/features/projects/projects-update.route.d.ts +24 -0
- package/dist/features/projects/projects-update.route.js +81 -0
- package/dist/features/projects/projects.creator.d.ts +33 -0
- package/dist/features/projects/projects.creator.js +555 -0
- package/dist/features/projects/projects.database.d.ts +61 -0
- package/dist/features/projects/projects.database.js +212 -0
- package/dist/features/projects/projects.manager.d.ts +291 -0
- package/dist/features/projects/projects.manager.js +426 -0
- package/dist/features/projects/projects.open-with.d.ts +27 -0
- package/dist/features/projects/projects.open-with.js +156 -0
- package/dist/features/projects/projects.routes.d.ts +20 -0
- package/dist/features/projects/projects.routes.js +255 -0
- package/dist/features/projects/terminal-session-manager.d.ts +55 -0
- package/dist/features/projects/terminal-session-manager.js +90 -0
- package/dist/features/providers/provider-resolver.d.ts +13 -0
- package/dist/features/providers/provider-resolver.js +22 -0
- package/dist/features/providers/providers-get-credits.route.d.ts +15 -0
- package/dist/features/providers/providers-get-credits.route.js +51 -0
- package/dist/features/providers/providers-get.route.d.ts +16 -0
- package/dist/features/providers/providers-get.route.js +32 -0
- package/dist/features/providers/providers-open-external.route.d.ts +15 -0
- package/dist/features/providers/providers-open-external.route.js +49 -0
- package/dist/features/providers/providers-post-bulk-keys.route.d.ts +14 -0
- package/dist/features/providers/providers-post-bulk-keys.route.js +31 -0
- package/dist/features/providers/providers-post-keys.route.d.ts +14 -0
- package/dist/features/providers/providers-post-keys.route.js +25 -0
- package/dist/features/providers/providers.routes.d.ts +19 -0
- package/dist/features/providers/providers.routes.js +31 -0
- package/dist/features/rules/rules-post.route.d.ts +43 -0
- package/dist/features/rules/rules-post.route.js +89 -0
- package/dist/features/rules/rules.manager.d.ts +36 -0
- package/dist/features/rules/rules.manager.js +203 -0
- package/dist/features/rules/rules.routes.d.ts +12 -0
- package/dist/features/rules/rules.routes.js +13 -0
- package/dist/features/run/run-get-running.route.d.ts +15 -0
- package/dist/features/run/run-get-running.route.js +21 -0
- package/dist/features/run/run-post-start.route.d.ts +8 -0
- package/dist/features/run/run-post-start.route.js +21 -0
- package/dist/features/run/run-post-stop.route.d.ts +15 -0
- package/dist/features/run/run-post-stop.route.js +24 -0
- package/dist/features/run/run-post-suggest.route.d.ts +15 -0
- package/dist/features/run/run-post-suggest.route.js +21 -0
- package/dist/features/run/run-put-command.route.d.ts +15 -0
- package/dist/features/run/run-put-command.route.js +24 -0
- package/dist/features/run/run.routes.d.ts +19 -0
- package/dist/features/run/run.routes.js +31 -0
- package/dist/features/scaffold/index.d.ts +7 -0
- package/dist/features/scaffold/index.js +5 -0
- package/dist/features/scaffold/scaffold-get-templates.route.d.ts +27 -0
- package/dist/features/scaffold/scaffold-get-templates.route.js +17 -0
- package/dist/features/scaffold/scaffold-post.route.d.ts +8 -0
- package/dist/features/scaffold/scaffold-post.route.js +30 -0
- package/dist/features/scaffold/scaffold.routes.d.ts +10 -0
- package/dist/features/scaffold/scaffold.routes.js +16 -0
- package/dist/features/scaffold/scaffold.runner.d.ts +48 -0
- package/dist/features/scaffold/scaffold.runner.js +475 -0
- package/dist/features/scaffold/scaffold.types.d.ts +26 -0
- package/dist/features/scaffold/scaffold.types.js +5 -0
- package/dist/features/skills/skills.activation.d.ts +31 -0
- package/dist/features/skills/skills.activation.js +155 -0
- package/dist/features/skills/skills.manager.d.ts +35 -0
- package/dist/features/skills/skills.manager.js +251 -0
- package/dist/features/slash-commands/slash-commands-delete.route.d.ts +23 -0
- package/dist/features/slash-commands/slash-commands-delete.route.js +36 -0
- package/dist/features/slash-commands/slash-commands-get.route.d.ts +53 -0
- package/dist/features/slash-commands/slash-commands-get.route.js +54 -0
- package/dist/features/slash-commands/slash-commands-post.route.d.ts +39 -0
- package/dist/features/slash-commands/slash-commands-post.route.js +70 -0
- package/dist/features/slash-commands/slash-commands-put.route.d.ts +23 -0
- package/dist/features/slash-commands/slash-commands-put.route.js +36 -0
- package/dist/features/slash-commands/slash-commands.manager.d.ts +46 -0
- package/dist/features/slash-commands/slash-commands.manager.js +265 -0
- package/dist/features/slash-commands/slash-commands.routes.d.ts +13 -0
- package/dist/features/slash-commands/slash-commands.routes.js +20 -0
- package/dist/features/threads/threads-ai-files.route.d.ts +153 -0
- package/dist/features/threads/threads-ai-files.route.js +287 -0
- package/dist/features/threads/threads-conversation-folder-path.route.d.ts +14 -0
- package/dist/features/threads/threads-conversation-folder-path.route.js +23 -0
- package/dist/features/threads/threads-create.route.d.ts +22 -0
- package/dist/features/threads/threads-create.route.js +60 -0
- package/dist/features/threads/threads-delete.route.d.ts +25 -0
- package/dist/features/threads/threads-delete.route.js +35 -0
- package/dist/features/threads/threads-files.route.d.ts +15 -0
- package/dist/features/threads/threads-files.route.js +20 -0
- package/dist/features/threads/threads-fix-comments.route.d.ts +26 -0
- package/dist/features/threads/threads-fix-comments.route.js +45 -0
- package/dist/features/threads/threads-get.route.d.ts +30 -0
- package/dist/features/threads/threads-get.route.js +38 -0
- package/dist/features/threads/threads-list.route.d.ts +56 -0
- package/dist/features/threads/threads-list.route.js +58 -0
- package/dist/features/threads/threads-messages.route.d.ts +28 -0
- package/dist/features/threads/threads-messages.route.js +110 -0
- package/dist/features/threads/threads-open.route.d.ts +26 -0
- package/dist/features/threads/threads-open.route.js +62 -0
- package/dist/features/threads/threads-select.route.d.ts +25 -0
- package/dist/features/threads/threads-select.route.js +35 -0
- package/dist/features/threads/threads-update.route.d.ts +15 -0
- package/dist/features/threads/threads-update.route.js +30 -0
- package/dist/features/threads/threads.database.d.ts +68 -0
- package/dist/features/threads/threads.database.js +215 -0
- package/dist/features/threads/threads.manager.d.ts +204 -0
- package/dist/features/threads/threads.manager.js +505 -0
- package/dist/features/threads/threads.routes.d.ts +20 -0
- package/dist/features/threads/threads.routes.js +230 -0
- package/dist/features/todos/todos.database.d.ts +14 -0
- package/dist/features/todos/todos.database.js +31 -0
- package/dist/features/updates/updates.routes.d.ts +13 -0
- package/dist/features/updates/updates.routes.js +40 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +37 -10022
- package/dist/project-analyzer.d.ts +26 -0
- package/dist/project-analyzer.js +307 -0
- package/dist/public/assets/add-agent-view-B9IQjAwU.js +1 -0
- package/dist/public/assets/add-rule-view-BdZHurB3.js +7 -0
- package/dist/public/assets/add-skill-view-Cuu6Z0fr.js +1 -0
- package/dist/public/assets/add-slash-command-view-uW75Jvbh.js +1 -0
- package/dist/public/assets/conversation-history-view-D0OBxJMC.js +1 -0
- package/dist/public/assets/dialogs-config-DiFQjCeA.js +46 -0
- package/dist/public/assets/diff-view-B5XBM5UZ.js +3 -0
- package/dist/public/assets/file-tree-sidebar-DMX7fHi7.js +1 -0
- package/dist/public/assets/files-view-CUZn7G0o.js +1 -0
- package/dist/public/assets/history-view-B8HM78Wa.js +1 -0
- package/dist/public/assets/index-C-p81QYw.js +17 -0
- package/dist/public/assets/index-DhVMb7D6.css +1 -0
- package/dist/public/assets/mcp-manager-CEm1L3dn.js +1 -0
- package/dist/public/assets/mcp-server-edit-view-BAwMNOAH.js +5 -0
- package/dist/public/assets/mcp-servers-sidebar-Ncxq9Oj5.js +1 -0
- package/dist/public/assets/mcp-view-Cz7nelGQ.js +1 -0
- package/dist/public/assets/monaco-DvsnxTfD.js +11 -0
- package/dist/public/assets/onboarding-CvpvkF3X.js +1 -0
- package/dist/public/assets/onboarding-dialog-CKJw0ULj.js +1 -0
- package/dist/public/assets/project-settings-view-DJ1uvrTL.js +1 -0
- package/dist/public/assets/provider-details-view-CkS6WbnK.js +1 -0
- package/dist/public/assets/providers-sidebar-C4MF6i9d.js +1 -0
- package/dist/public/assets/radio-group-BItFbSTw.js +1 -0
- package/dist/public/assets/react-vendor-DkKo9QGO.js +17 -0
- package/dist/public/assets/rolldown-runtime-Dw2cE7zH.js +1 -0
- package/dist/public/assets/settings-view-C45kmAGH.js +2 -0
- package/dist/public/assets/store-BVVGurzl.js +2 -0
- package/dist/public/assets/use-toast-DEJkXPN4.js +1 -0
- package/dist/public/assets/utils-DY_quHB8.js +1 -0
- package/dist/public/fonts/google-sans.ttf +0 -0
- package/dist/public/fonts/zalando.ttf +0 -0
- package/dist/public/ide/android-studio.svg +1 -0
- package/dist/public/ide/cursor.svg +12 -0
- package/dist/public/ide/kiro.svg +11 -0
- package/dist/public/ide/terminal.svg +7 -0
- package/dist/public/ide/vscode.svg +2 -0
- package/dist/public/ide/windsurf.svg +3 -0
- package/dist/public/ide/xcode.svg +2 -0
- package/dist/public/index.html +13 -9
- package/dist/scaffold-templates.json +3 -12
- package/dist/server.d.ts +12 -0
- package/dist/server.js +142 -0
- package/dist/tools/agent-tool.d.ts +49 -0
- package/dist/tools/agent-tool.js +131 -0
- package/dist/tools/ask-user.d.ts +25 -0
- package/dist/tools/ask-user.js +74 -0
- package/dist/tools/ast-grep.d.ts +28 -0
- package/dist/tools/ast-grep.js +273 -0
- package/dist/tools/bash.d.ts +33 -0
- package/dist/tools/bash.js +186 -0
- package/dist/tools/edit-diff.d.ts +24 -0
- package/dist/tools/edit-diff.js +136 -0
- package/dist/tools/edit.d.ts +28 -0
- package/dist/tools/edit.js +78 -0
- package/dist/tools/find.d.ts +31 -0
- package/dist/tools/find.js +117 -0
- package/dist/tools/grep.d.ts +37 -0
- package/dist/tools/grep.js +231 -0
- package/dist/tools/index.d.ts +93 -0
- package/dist/tools/index.js +110 -0
- package/dist/tools/ls.d.ts +31 -0
- package/dist/tools/ls.js +108 -0
- package/dist/tools/mcp-tools.d.ts +31 -0
- package/dist/tools/mcp-tools.js +59 -0
- package/dist/tools/path-utils.d.ts +14 -0
- package/dist/tools/path-utils.js +87 -0
- package/dist/tools/read.d.ts +27 -0
- package/dist/tools/read.js +86 -0
- package/dist/tools/resolve-bin.d.ts +5 -0
- package/dist/tools/resolve-bin.js +28 -0
- package/dist/tools/shell.d.ts +7 -0
- package/dist/tools/shell.js +143 -0
- package/dist/tools/skill-reference-tool.d.ts +30 -0
- package/dist/tools/skill-reference-tool.js +171 -0
- package/dist/tools/skill-tool.d.ts +33 -0
- package/dist/tools/skill-tool.js +213 -0
- package/dist/tools/todo.d.ts +20 -0
- package/dist/tools/todo.js +168 -0
- package/dist/tools/tool-helpers.d.ts +78 -0
- package/dist/tools/tool-helpers.js +109 -0
- package/dist/tools/truncate.d.ts +31 -0
- package/dist/tools/truncate.js +164 -0
- package/dist/tools/write.d.ts +21 -0
- package/dist/tools/write.js +65 -0
- package/package.json +33 -27
- package/dist/public/assets/index-6jySngUQ.css +0 -1
- package/dist/public/assets/index-BjFpLTSj.js +0 -18
- package/dist/public/assets/monaco-w6PwaWGP.js +0 -11
- package/dist/public/assets/radix-ui-e1yigncZ.js +0 -1
- package/dist/public/assets/react-vendor-B6JfXZmN.js +0 -59
- package/dist/public/assets/ui-styling-CyCIFleB.js +0 -1
- package/dist/public/assets/utils-Dd_itR7L.js +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /api/projects/:id
|
|
3
|
+
* Get project details by ID
|
|
4
|
+
*
|
|
5
|
+
* Response:
|
|
6
|
+
* {
|
|
7
|
+
* "id": "uuid",
|
|
8
|
+
* "name": "project-name",
|
|
9
|
+
* "gitUrl": "https://github.com/user/repo.git",
|
|
10
|
+
* "path": "/path/to/project",
|
|
11
|
+
* "createdAt": "2024-01-01T00:00:00Z",
|
|
12
|
+
* "threads": ["thread-id-1", "thread-id-2"]
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* Requirements:
|
|
16
|
+
* - 6.2 - THE CLI SHALL expose REST API endpoints for Project operations
|
|
17
|
+
*/
|
|
18
|
+
import { errorResponse } from "../../core/route-helpers.js";
|
|
19
|
+
import { ErrorCodes } from "../../core/error-responses.js";
|
|
20
|
+
export async function handleGetProject(c, projectManager) {
|
|
21
|
+
try {
|
|
22
|
+
const projectId = c.req.param("id");
|
|
23
|
+
if (!projectId) {
|
|
24
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Project ID is required", 400);
|
|
25
|
+
}
|
|
26
|
+
const project = await projectManager.getProject(projectId);
|
|
27
|
+
if (!project) {
|
|
28
|
+
return errorResponse(c, ErrorCodes.PROJECT_NOT_FOUND, `Project not found: ${projectId}`, 404);
|
|
29
|
+
}
|
|
30
|
+
return c.json(project);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
return errorResponse(c, ErrorCodes.GET_PROJECT_ERROR, "Failed to get project", 500, error instanceof Error ? error.message : String(error));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=projects-get.route.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /api/projects
|
|
3
|
+
* List all projects with expanded threads
|
|
4
|
+
*
|
|
5
|
+
* Response:
|
|
6
|
+
* [
|
|
7
|
+
* {
|
|
8
|
+
* "projectId": "uuid",
|
|
9
|
+
* "gitUrl": "https://github.com/user/repo.git",
|
|
10
|
+
* "projectPath": "/path/to/project",
|
|
11
|
+
* "threads": [
|
|
12
|
+
* {
|
|
13
|
+
* "threadId": "uuid",
|
|
14
|
+
* "title": "thread-title",
|
|
15
|
+
* "path": "/path/to/thread",
|
|
16
|
+
* "isSelected": false
|
|
17
|
+
* }
|
|
18
|
+
* ]
|
|
19
|
+
* }
|
|
20
|
+
* ]
|
|
21
|
+
*
|
|
22
|
+
* Requirements:
|
|
23
|
+
* - 6.2 - THE CLI SHALL expose REST API endpoints for Project operations
|
|
24
|
+
*/
|
|
25
|
+
import { Context } from "hono";
|
|
26
|
+
import { ProjectManager } from "../projects/projects.manager.js";
|
|
27
|
+
import { ThreadManager } from "../threads/threads.manager.js";
|
|
28
|
+
export declare function handleListProjects(c: Context, projectManager: ProjectManager, threadManager: ThreadManager): Promise<(Response & import("hono").TypedResponse<{
|
|
29
|
+
error: {
|
|
30
|
+
code: string;
|
|
31
|
+
message: string;
|
|
32
|
+
details?: import("hono/utils/types").JSONValue | undefined;
|
|
33
|
+
timestamp: string;
|
|
34
|
+
};
|
|
35
|
+
}, any, "json">) | (Response & import("hono").TypedResponse<{
|
|
36
|
+
projectId: string;
|
|
37
|
+
name: string;
|
|
38
|
+
gitUrl: string;
|
|
39
|
+
projectPath: string;
|
|
40
|
+
openWith: string | undefined;
|
|
41
|
+
commands: {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
icon: string;
|
|
45
|
+
commandLine: string;
|
|
46
|
+
relativeFolder?: string | undefined;
|
|
47
|
+
}[];
|
|
48
|
+
setupScript: string | undefined;
|
|
49
|
+
runCommand: string | undefined;
|
|
50
|
+
commitMethod: import("@tarsk/shared").CommitMethods | undefined;
|
|
51
|
+
threads: {
|
|
52
|
+
threadId: string;
|
|
53
|
+
title: string;
|
|
54
|
+
path: string;
|
|
55
|
+
isSelected: boolean;
|
|
56
|
+
}[];
|
|
57
|
+
}[], import("hono/utils/http-status").ContentfulStatusCode, "json">)>;
|
|
58
|
+
//# sourceMappingURL=projects-list.route.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /api/projects
|
|
3
|
+
* List all projects with expanded threads
|
|
4
|
+
*
|
|
5
|
+
* Response:
|
|
6
|
+
* [
|
|
7
|
+
* {
|
|
8
|
+
* "projectId": "uuid",
|
|
9
|
+
* "gitUrl": "https://github.com/user/repo.git",
|
|
10
|
+
* "projectPath": "/path/to/project",
|
|
11
|
+
* "threads": [
|
|
12
|
+
* {
|
|
13
|
+
* "threadId": "uuid",
|
|
14
|
+
* "title": "thread-title",
|
|
15
|
+
* "path": "/path/to/thread",
|
|
16
|
+
* "isSelected": false
|
|
17
|
+
* }
|
|
18
|
+
* ]
|
|
19
|
+
* }
|
|
20
|
+
* ]
|
|
21
|
+
*
|
|
22
|
+
* Requirements:
|
|
23
|
+
* - 6.2 - THE CLI SHALL expose REST API endpoints for Project operations
|
|
24
|
+
*/
|
|
25
|
+
import { errorResponse } from "../../core/route-helpers.js";
|
|
26
|
+
import { ErrorCodes } from "../../core/error-responses.js";
|
|
27
|
+
export async function handleListProjects(c, projectManager, threadManager) {
|
|
28
|
+
try {
|
|
29
|
+
const projects = await projectManager.listProjects();
|
|
30
|
+
// Get the currently selected thread
|
|
31
|
+
const selectedThreadId = await threadManager.getSelectedThreadId();
|
|
32
|
+
// Expand threads for each project
|
|
33
|
+
const expandedProjects = await Promise.all(projects.map(async (project) => {
|
|
34
|
+
const threads = await threadManager.listThreads(project.id);
|
|
35
|
+
return {
|
|
36
|
+
projectId: project.id,
|
|
37
|
+
name: project.name,
|
|
38
|
+
gitUrl: project.gitUrl,
|
|
39
|
+
projectPath: project.path,
|
|
40
|
+
openWith: project.openWith,
|
|
41
|
+
commands: project.commands ?? [],
|
|
42
|
+
setupScript: project.setupScript,
|
|
43
|
+
runCommand: project.runCommand,
|
|
44
|
+
commitMethod: project.commitMethod,
|
|
45
|
+
threads: threads.map((thread) => ({
|
|
46
|
+
threadId: thread.id,
|
|
47
|
+
title: thread.title,
|
|
48
|
+
path: thread.path,
|
|
49
|
+
isSelected: thread.id === selectedThreadId,
|
|
50
|
+
})),
|
|
51
|
+
};
|
|
52
|
+
}));
|
|
53
|
+
return c.json(expandedProjects);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return errorResponse(c, ErrorCodes.LIST_PROJECTS_ERROR, "Failed to list projects", 500, error instanceof Error ? error.message : String(error));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=projects-list.route.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/projects/open-folder
|
|
3
|
+
* Create a new project by selecting a local folder via native OS dialog
|
|
4
|
+
*
|
|
5
|
+
* Response: Newline-delimited JSON stream of ProjectEvent objects
|
|
6
|
+
*/
|
|
7
|
+
import { Context } from "hono";
|
|
8
|
+
import { ProjectManager } from "../projects/projects.manager.js";
|
|
9
|
+
export declare function handleOpenFolderProject(c: Context, projectManager: ProjectManager): Promise<Response>;
|
|
10
|
+
//# sourceMappingURL=projects-open-folder.route.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/projects/open-folder
|
|
3
|
+
* Create a new project by selecting a local folder via native OS dialog
|
|
4
|
+
*
|
|
5
|
+
* Response: Newline-delimited JSON stream of ProjectEvent objects
|
|
6
|
+
*/
|
|
7
|
+
import { streamAsyncGenerator } from "../../core/stream-helper.js";
|
|
8
|
+
export async function handleOpenFolderProject(c, projectManager) {
|
|
9
|
+
return streamAsyncGenerator(c, projectManager.createProjectFromFolder());
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=projects-open-folder.route.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/projects/:id/open
|
|
3
|
+
* Open a project in the specified program
|
|
4
|
+
*
|
|
5
|
+
* Request body:
|
|
6
|
+
* {
|
|
7
|
+
* "program": "VS Code" | "Cursor" | "Windsurf" | "Xcode" | "Android Studio" | "Kiro"
|
|
8
|
+
* }
|
|
9
|
+
*
|
|
10
|
+
* Response:
|
|
11
|
+
* {
|
|
12
|
+
* "success": true,
|
|
13
|
+
* "message": "Project opened in VS Code"
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
import { Context } from "hono";
|
|
17
|
+
import { ProjectManager } from "../projects/projects.manager.js";
|
|
18
|
+
export declare function handleOpenProject(c: Context, projectManager: ProjectManager): Promise<(Response & import("hono").TypedResponse<{
|
|
19
|
+
error: {
|
|
20
|
+
code: string;
|
|
21
|
+
message: string;
|
|
22
|
+
details?: import("hono/utils/types").JSONValue | undefined;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
};
|
|
25
|
+
}, any, "json">) | (Response & import("hono").TypedResponse<import("hono/utils/types").JSONValue, any, "json">)>;
|
|
26
|
+
//# sourceMappingURL=projects-open.route.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/projects/:id/open
|
|
3
|
+
* Open a project in the specified program
|
|
4
|
+
*
|
|
5
|
+
* Request body:
|
|
6
|
+
* {
|
|
7
|
+
* "program": "VS Code" | "Cursor" | "Windsurf" | "Xcode" | "Android Studio" | "Kiro"
|
|
8
|
+
* }
|
|
9
|
+
*
|
|
10
|
+
* Response:
|
|
11
|
+
* {
|
|
12
|
+
* "success": true,
|
|
13
|
+
* "message": "Project opened in VS Code"
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
import { validateProgram } from "./projects.open-with.js";
|
|
17
|
+
import { errorResponse, successResponse } from "../../core/route-helpers.js";
|
|
18
|
+
import { ErrorCodes } from "../../core/error-responses.js";
|
|
19
|
+
export async function handleOpenProject(c, projectManager) {
|
|
20
|
+
try {
|
|
21
|
+
const projectId = c.req.param("id");
|
|
22
|
+
const body = await c.req.json();
|
|
23
|
+
const { program } = body;
|
|
24
|
+
console.log("[POST /api/projects/:id/open] projectId=%s program=%s", projectId, program);
|
|
25
|
+
if (!projectId) {
|
|
26
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Project ID is required", 400);
|
|
27
|
+
}
|
|
28
|
+
const programError = validateProgram(program ?? "");
|
|
29
|
+
if (programError) {
|
|
30
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, programError, 400);
|
|
31
|
+
}
|
|
32
|
+
const project = await projectManager.getProject(projectId);
|
|
33
|
+
if (!project) {
|
|
34
|
+
return errorResponse(c, ErrorCodes.PROJECT_NOT_FOUND, `Project not found: ${projectId}`, 404);
|
|
35
|
+
}
|
|
36
|
+
console.log("[POST /api/projects/:id/open] Calling projectManager.openWith");
|
|
37
|
+
await projectManager.openWith(projectId, program ?? "");
|
|
38
|
+
console.log("[POST /api/projects/:id/open] openWith completed successfully");
|
|
39
|
+
return successResponse(c, {
|
|
40
|
+
success: true,
|
|
41
|
+
message: `Project opened in ${program ?? "default program"}`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
46
|
+
return errorResponse(c, ErrorCodes.OPEN_PROGRAM_ERROR, errorMessage, 500);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=projects-open.route.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /api/projects/:id/package-scripts
|
|
3
|
+
* Get available npm scripts from package.json files in the project
|
|
4
|
+
*/
|
|
5
|
+
import { Context } from "hono";
|
|
6
|
+
import { ProjectManager } from "../projects/projects.manager.js";
|
|
7
|
+
export declare function handleGetPackageScripts(c: Context, projectManager: ProjectManager): Promise<(Response & import("hono").TypedResponse<{
|
|
8
|
+
error: {
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
details?: import("hono/utils/types").JSONValue | undefined;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
};
|
|
14
|
+
}, any, "json">) | (Response & import("hono").TypedResponse<import("hono/utils/types").JSONValue, any, "json">)>;
|
|
15
|
+
//# sourceMappingURL=projects-package-scripts.route.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /api/projects/:id/package-scripts
|
|
3
|
+
* Get available npm scripts from package.json files in the project
|
|
4
|
+
*/
|
|
5
|
+
import { errorResponse, successResponse } from "../../core/route-helpers.js";
|
|
6
|
+
import { ErrorCodes } from "../../core/error-responses.js";
|
|
7
|
+
import { detectPackageManager } from "../../core/run-command-detector.js";
|
|
8
|
+
import { readFile } from "fs/promises";
|
|
9
|
+
import { join } from "path";
|
|
10
|
+
import { glob } from "glob";
|
|
11
|
+
/**
|
|
12
|
+
* Convert script name to title case
|
|
13
|
+
* Replaces hyphens, colons, and underscores with spaces and capitalizes each word
|
|
14
|
+
*/
|
|
15
|
+
function formatScriptName(scriptName) {
|
|
16
|
+
return scriptName.replace(/[-:_]/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Generate command line based on package manager and script name
|
|
20
|
+
*/
|
|
21
|
+
function generateCommandLine(packageManager, scriptName) {
|
|
22
|
+
switch (packageManager) {
|
|
23
|
+
case "npm":
|
|
24
|
+
case "yarn":
|
|
25
|
+
return `${packageManager} run ${scriptName}`;
|
|
26
|
+
case "pnpm":
|
|
27
|
+
return `pnpm ${scriptName}`;
|
|
28
|
+
case "bun":
|
|
29
|
+
return `bun run ${scriptName}`;
|
|
30
|
+
default:
|
|
31
|
+
return `npm run ${scriptName}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Search for package.json files recursively and extract scripts
|
|
36
|
+
*/
|
|
37
|
+
async function findPackageScripts(projectPath) {
|
|
38
|
+
const scripts = [];
|
|
39
|
+
try {
|
|
40
|
+
// Find all package.json files recursively
|
|
41
|
+
const packageJsonFiles = await glob("**/package.json", {
|
|
42
|
+
cwd: projectPath,
|
|
43
|
+
ignore: ["**/node_modules/**", "**/dist/**", "**/build/**"],
|
|
44
|
+
});
|
|
45
|
+
const packageManager = await detectPackageManager(projectPath);
|
|
46
|
+
for (const filePath of packageJsonFiles) {
|
|
47
|
+
try {
|
|
48
|
+
const fullPath = join(projectPath, filePath);
|
|
49
|
+
const content = await readFile(fullPath, "utf-8");
|
|
50
|
+
const packageJson = JSON.parse(content);
|
|
51
|
+
if (packageJson.scripts) {
|
|
52
|
+
for (const [scriptName] of Object.entries(packageJson.scripts)) {
|
|
53
|
+
// Skip common internal scripts
|
|
54
|
+
if (scriptName.startsWith("pre") || scriptName.startsWith("post")) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
scripts.push({
|
|
58
|
+
name: formatScriptName(scriptName),
|
|
59
|
+
commandLine: generateCommandLine(packageManager, scriptName),
|
|
60
|
+
relativePath: filePath.replace(/\/package\.json$/, ""),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Skip invalid package.json files
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// Return empty array if glob fails
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
return scripts;
|
|
76
|
+
}
|
|
77
|
+
export async function handleGetPackageScripts(c, projectManager) {
|
|
78
|
+
try {
|
|
79
|
+
const projectId = c.req.param("id");
|
|
80
|
+
if (!projectId) {
|
|
81
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Project ID is required", 400);
|
|
82
|
+
}
|
|
83
|
+
// Get project path
|
|
84
|
+
const project = await projectManager.getProject(projectId);
|
|
85
|
+
if (!project?.path) {
|
|
86
|
+
return errorResponse(c, ErrorCodes.PROJECT_NOT_FOUND, "Project not found", 404);
|
|
87
|
+
}
|
|
88
|
+
// Find all package.json scripts
|
|
89
|
+
const scripts = await findPackageScripts(project.path);
|
|
90
|
+
return successResponse(c, { scripts });
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return errorResponse(c, ErrorCodes.GET_PROJECT_ERROR, "Failed to get package scripts", 500, error instanceof Error ? error.message : String(error));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=projects-package-scripts.route.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/projects/:projectId/threads/:threadId/commands/run
|
|
3
|
+
* Run a command in a thread's directory
|
|
4
|
+
*/
|
|
5
|
+
import { Context } from "hono";
|
|
6
|
+
import { ProjectManager } from "../projects/projects.manager.js";
|
|
7
|
+
export declare function handleRunCommand(c: Context, projectManager: ProjectManager): Promise<Response>;
|
|
8
|
+
//# sourceMappingURL=projects-run-command.route.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/projects/:projectId/threads/:threadId/commands/run
|
|
3
|
+
* Run a command in a thread's directory
|
|
4
|
+
*/
|
|
5
|
+
import { streamAsyncGenerator } from "../../core/stream-helper.js";
|
|
6
|
+
import { errorResponse } from "../../core/route-helpers.js";
|
|
7
|
+
import { ErrorCodes } from "../../core/error-responses.js";
|
|
8
|
+
export async function handleRunCommand(c, projectManager) {
|
|
9
|
+
try {
|
|
10
|
+
const threadId = c.req.param("threadId");
|
|
11
|
+
const { commandLine, cwd } = await c.req.json();
|
|
12
|
+
if (!threadId || !commandLine) {
|
|
13
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Thread ID and commandLine are required", 400);
|
|
14
|
+
}
|
|
15
|
+
return streamAsyncGenerator(c, projectManager.runCommand(threadId, commandLine, cwd));
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
return errorResponse(c, ErrorCodes.RUN_COMMAND_ERROR, "Failed to run command", 500, error instanceof Error ? error.message : String(error));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=projects-run-command.route.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/projects/:id/run
|
|
3
|
+
* Start the dev server process for a project
|
|
4
|
+
*/
|
|
5
|
+
import { Context } from "hono";
|
|
6
|
+
import { ProjectManager } from "../projects/projects.manager.js";
|
|
7
|
+
export declare function handleStartRun(c: Context, projectManager: ProjectManager): Promise<Response>;
|
|
8
|
+
/**
|
|
9
|
+
* POST /api/projects/:id/run-suggest
|
|
10
|
+
* Suggest a run command for a project based on package.json
|
|
11
|
+
*/
|
|
12
|
+
export declare function handleSuggestRun(c: Context, projectManager: ProjectManager): Promise<(Response & import("hono").TypedResponse<{
|
|
13
|
+
error: {
|
|
14
|
+
code: string;
|
|
15
|
+
message: string;
|
|
16
|
+
details?: import("hono/utils/types").JSONValue | undefined;
|
|
17
|
+
timestamp: string;
|
|
18
|
+
};
|
|
19
|
+
}, any, "json">) | (Response & import("hono").TypedResponse<{
|
|
20
|
+
runCommand: string | null;
|
|
21
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">)>;
|
|
22
|
+
/**
|
|
23
|
+
* POST /api/projects/:id/stop
|
|
24
|
+
* Stop the dev server process for a project
|
|
25
|
+
*/
|
|
26
|
+
export declare function handleStopRun(c: Context, projectManager: ProjectManager): Promise<(Response & import("hono").TypedResponse<{
|
|
27
|
+
error: {
|
|
28
|
+
code: string;
|
|
29
|
+
message: string;
|
|
30
|
+
details?: import("hono/utils/types").JSONValue | undefined;
|
|
31
|
+
timestamp: string;
|
|
32
|
+
};
|
|
33
|
+
}, any, "json">) | (Response & import("hono").TypedResponse<{
|
|
34
|
+
success: true;
|
|
35
|
+
message: string;
|
|
36
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">)>;
|
|
37
|
+
/**
|
|
38
|
+
* GET /api/projects/:id/running
|
|
39
|
+
* Check if a dev server process is running for a project
|
|
40
|
+
*/
|
|
41
|
+
export declare function handleCheckRunning(c: Context, projectManager: ProjectManager): Promise<(Response & import("hono").TypedResponse<{
|
|
42
|
+
error: {
|
|
43
|
+
code: string;
|
|
44
|
+
message: string;
|
|
45
|
+
details?: import("hono/utils/types").JSONValue | undefined;
|
|
46
|
+
timestamp: string;
|
|
47
|
+
};
|
|
48
|
+
}, any, "json">) | (Response & import("hono").TypedResponse<{
|
|
49
|
+
isRunning: boolean;
|
|
50
|
+
}, import("hono/utils/http-status").ContentfulStatusCode, "json">)>;
|
|
51
|
+
//# sourceMappingURL=projects-run.route.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /api/projects/:id/run
|
|
3
|
+
* Start the dev server process for a project
|
|
4
|
+
*/
|
|
5
|
+
import { streamAsyncGenerator } from "../../core/stream-helper.js";
|
|
6
|
+
import { errorResponse } from "../../core/route-helpers.js";
|
|
7
|
+
import { ErrorCodes } from "../../core/error-responses.js";
|
|
8
|
+
export async function handleStartRun(c, projectManager) {
|
|
9
|
+
try {
|
|
10
|
+
const projectId = c.req.param("id");
|
|
11
|
+
const body = await c.req.json();
|
|
12
|
+
const { threadId } = body;
|
|
13
|
+
console.log("CLI Route: handleStartRun called for project:", projectId, "thread:", threadId);
|
|
14
|
+
if (!projectId) {
|
|
15
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Project ID is required", 400);
|
|
16
|
+
}
|
|
17
|
+
return streamAsyncGenerator(c, projectManager.startRunningProcess(projectId, threadId));
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
return errorResponse(c, ErrorCodes.START_PROCESS_ERROR, "Failed to start dev server", 500, error instanceof Error ? error.message : String(error));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* POST /api/projects/:id/run-suggest
|
|
25
|
+
* Suggest a run command for a project based on package.json
|
|
26
|
+
*/
|
|
27
|
+
export async function handleSuggestRun(c, projectManager) {
|
|
28
|
+
try {
|
|
29
|
+
const projectId = c.req.param("id");
|
|
30
|
+
if (!projectId) {
|
|
31
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Project ID is required", 400);
|
|
32
|
+
}
|
|
33
|
+
const runCommand = await projectManager.suggestRunCommand(projectId);
|
|
34
|
+
return c.json({ runCommand });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return errorResponse(c, ErrorCodes.SUGGEST_RUN_COMMAND_ERROR, "Failed to suggest run command", 500, error instanceof Error ? error.message : String(error));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* POST /api/projects/:id/stop
|
|
42
|
+
* Stop the dev server process for a project
|
|
43
|
+
*/
|
|
44
|
+
export async function handleStopRun(c, projectManager) {
|
|
45
|
+
try {
|
|
46
|
+
const projectId = c.req.param("id");
|
|
47
|
+
if (!projectId) {
|
|
48
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Project ID is required", 400);
|
|
49
|
+
}
|
|
50
|
+
await projectManager.stopRunningProcess(projectId);
|
|
51
|
+
return c.json({ success: true, message: "Dev server stopped" });
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return errorResponse(c, ErrorCodes.STOP_PROCESS_ERROR, "Failed to stop dev server", 500, error instanceof Error ? error.message : String(error));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* GET /api/projects/:id/running
|
|
59
|
+
* Check if a dev server process is running for a project
|
|
60
|
+
*/
|
|
61
|
+
export async function handleCheckRunning(c, projectManager) {
|
|
62
|
+
try {
|
|
63
|
+
const projectId = c.req.param("id");
|
|
64
|
+
if (!projectId) {
|
|
65
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Project ID is required", 400);
|
|
66
|
+
}
|
|
67
|
+
const isRunning = await projectManager.isProcessRunning(projectId);
|
|
68
|
+
return c.json({ isRunning });
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
return errorResponse(c, ErrorCodes.CHECK_PROCESS_ERROR, "Failed to check process status", 500, error instanceof Error ? error.message : String(error));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=projects-run.route.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PUT /api/projects/:id
|
|
3
|
+
* Update project properties (unified endpoint)
|
|
4
|
+
*
|
|
5
|
+
* Request body (all fields optional):
|
|
6
|
+
* {
|
|
7
|
+
* "program": "VS Code" | "Cursor" | "Windsurf" | "Xcode" | "Android Studio" | "Kiro",
|
|
8
|
+
* "setupScript": "npm install" | null,
|
|
9
|
+
* "name": "new-project-name",
|
|
10
|
+
* "runCommand": "npm run dev" | null,
|
|
11
|
+
* "commitMethod": "pull-request" | "direct",
|
|
12
|
+
* "runNow": boolean (optional) - if true, run the setup script in the first thread
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* Response:
|
|
16
|
+
* {
|
|
17
|
+
* "success": true,
|
|
18
|
+
* "message": "Project updated"
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
import { Context } from "hono";
|
|
22
|
+
import { ProjectManager } from "../projects/projects.manager.js";
|
|
23
|
+
export declare function handleUpdateProject(c: Context, projectManager: ProjectManager): Promise<Response>;
|
|
24
|
+
//# sourceMappingURL=projects-update.route.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PUT /api/projects/:id
|
|
3
|
+
* Update project properties (unified endpoint)
|
|
4
|
+
*
|
|
5
|
+
* Request body (all fields optional):
|
|
6
|
+
* {
|
|
7
|
+
* "program": "VS Code" | "Cursor" | "Windsurf" | "Xcode" | "Android Studio" | "Kiro",
|
|
8
|
+
* "setupScript": "npm install" | null,
|
|
9
|
+
* "name": "new-project-name",
|
|
10
|
+
* "runCommand": "npm run dev" | null,
|
|
11
|
+
* "commitMethod": "pull-request" | "direct",
|
|
12
|
+
* "runNow": boolean (optional) - if true, run the setup script in the first thread
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* Response:
|
|
16
|
+
* {
|
|
17
|
+
* "success": true,
|
|
18
|
+
* "message": "Project updated"
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
import { validateProgram } from "./projects.open-with.js";
|
|
22
|
+
import { streamAsyncGenerator } from "../../core/stream-helper.js";
|
|
23
|
+
import { CommitMethods, isValidCommitMethod } from "@tarsk/shared";
|
|
24
|
+
import { errorResponse, successResponse } from "../../core/route-helpers.js";
|
|
25
|
+
import { ErrorCodes } from "../../core/error-responses.js";
|
|
26
|
+
export async function handleUpdateProject(c, projectManager) {
|
|
27
|
+
try {
|
|
28
|
+
const projectId = c.req.param("id");
|
|
29
|
+
const body = await c.req.json();
|
|
30
|
+
const { program, setupScript, name, runCommand, commitMethod, runNow } = body;
|
|
31
|
+
if (!projectId) {
|
|
32
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Project ID is required", 400);
|
|
33
|
+
}
|
|
34
|
+
const project = await projectManager.getProject(projectId);
|
|
35
|
+
if (!project) {
|
|
36
|
+
return errorResponse(c, ErrorCodes.PROJECT_NOT_FOUND, `Project not found: ${projectId}`, 404);
|
|
37
|
+
}
|
|
38
|
+
// Update program (open-with) if provided
|
|
39
|
+
if (program !== undefined) {
|
|
40
|
+
const programError = validateProgram(program ?? "");
|
|
41
|
+
if (programError) {
|
|
42
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, programError, 400);
|
|
43
|
+
}
|
|
44
|
+
await projectManager.updateOpenWith(projectId, program ?? "");
|
|
45
|
+
}
|
|
46
|
+
// Update setup script if provided
|
|
47
|
+
if (setupScript !== undefined) {
|
|
48
|
+
const scriptToSave = setupScript === "" ? null : setupScript;
|
|
49
|
+
await projectManager.updateSetupScript(projectId, scriptToSave);
|
|
50
|
+
if (runNow && scriptToSave && project.threads.length > 0) {
|
|
51
|
+
const firstThreadId = project.threads[0];
|
|
52
|
+
return streamAsyncGenerator(c, projectManager.runCommand(firstThreadId, scriptToSave));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Update run command if provided
|
|
56
|
+
if (runCommand !== undefined) {
|
|
57
|
+
await projectManager.updateRunCommand(projectId, runCommand);
|
|
58
|
+
}
|
|
59
|
+
// Update commit method if provided
|
|
60
|
+
if (commitMethod !== undefined) {
|
|
61
|
+
if (!isValidCommitMethod(commitMethod)) {
|
|
62
|
+
const validMethods = Object.values(CommitMethods).join('", "');
|
|
63
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, `Commit method must be one of: "${validMethods}"`, 400);
|
|
64
|
+
}
|
|
65
|
+
await projectManager.updateCommitMethod(projectId, commitMethod);
|
|
66
|
+
}
|
|
67
|
+
// Update name if provided
|
|
68
|
+
if (name !== undefined) {
|
|
69
|
+
if (!name?.trim()) {
|
|
70
|
+
return errorResponse(c, ErrorCodes.INVALID_REQUEST, "Project name is required", 400);
|
|
71
|
+
}
|
|
72
|
+
await projectManager.updateProjectName(projectId, name);
|
|
73
|
+
}
|
|
74
|
+
return successResponse(c, { success: true, message: "Project updated" });
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
78
|
+
return errorResponse(c, ErrorCodes.UPDATE_PROJECT_ERROR, "Failed to update project", 500, errorMessage);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=projects-update.route.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project creation: create projects from a git URL or from a scaffold template.
|
|
3
|
+
* Contains creation flow logic and helpers (naming, paths, setup script detection).
|
|
4
|
+
*/
|
|
5
|
+
import type { ProjectEvent } from "@tarsk/shared";
|
|
6
|
+
import { CommitMethods } from "@tarsk/shared";
|
|
7
|
+
import type { MetadataManager } from "../metadata/metadata.manager.js";
|
|
8
|
+
import type { GitManager } from "../git/git.manager.js";
|
|
9
|
+
import type { ProcessingStateManager } from "../../agent/agent.processing-state-manager.js";
|
|
10
|
+
export type SuggestRunCommand = (projectId: string) => Promise<string | null>;
|
|
11
|
+
export type UpdateRunCommand = (projectId: string, runCommand: string | null) => Promise<void>;
|
|
12
|
+
export interface ProjectCreatorRunCommandCallbacks {
|
|
13
|
+
suggestRunCommand: SuggestRunCommand;
|
|
14
|
+
updateRunCommand: UpdateRunCommand;
|
|
15
|
+
}
|
|
16
|
+
export declare class ProjectCreator {
|
|
17
|
+
private rootFolder;
|
|
18
|
+
private metadataManager;
|
|
19
|
+
private gitManager;
|
|
20
|
+
private processingStateManager?;
|
|
21
|
+
private runCommandCallbacks?;
|
|
22
|
+
constructor(rootFolder: string, metadataManager: MetadataManager, gitManager: GitManager, processingStateManager?: ProcessingStateManager | undefined, runCommandCallbacks?: ProjectCreatorRunCommandCallbacks | undefined);
|
|
23
|
+
createProject(gitUrl: string, commitMethod?: CommitMethods): AsyncGenerator<ProjectEvent>;
|
|
24
|
+
createProjectFromScaffold(projectName: string, templateId: string, packageManager: string): AsyncGenerator<ProjectEvent>;
|
|
25
|
+
private ensureUniqueProjectName;
|
|
26
|
+
private deriveProjectName;
|
|
27
|
+
private generateThreadPath;
|
|
28
|
+
createProjectFromFolder(): AsyncGenerator<ProjectEvent>;
|
|
29
|
+
private isGitRepository;
|
|
30
|
+
private detectSetupScript;
|
|
31
|
+
private findAllPackageJsonFiles;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=projects.creator.d.ts.map
|