takt 0.1.0
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/README.md +307 -0
- package/bin/takt +27 -0
- package/dist/agents/index.d.ts +5 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +5 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/runner.d.ts +26 -0
- package/dist/agents/runner.d.ts.map +1 -0
- package/dist/agents/runner.js +144 -0
- package/dist/agents/runner.js.map +1 -0
- package/dist/claude/client.d.ts +43 -0
- package/dist/claude/client.d.ts.map +1 -0
- package/dist/claude/client.js +143 -0
- package/dist/claude/client.js.map +1 -0
- package/dist/claude/executor.d.ts +29 -0
- package/dist/claude/executor.d.ts.map +1 -0
- package/dist/claude/executor.js +169 -0
- package/dist/claude/executor.js.map +1 -0
- package/dist/claude/index.d.ts +14 -0
- package/dist/claude/index.d.ts.map +1 -0
- package/dist/claude/index.js +18 -0
- package/dist/claude/index.js.map +1 -0
- package/dist/claude/options-builder.d.ts +40 -0
- package/dist/claude/options-builder.d.ts.map +1 -0
- package/dist/claude/options-builder.js +90 -0
- package/dist/claude/options-builder.js.map +1 -0
- package/dist/claude/process.d.ts +57 -0
- package/dist/claude/process.d.ts.map +1 -0
- package/dist/claude/process.js +57 -0
- package/dist/claude/process.js.map +1 -0
- package/dist/claude/query-manager.d.ts +35 -0
- package/dist/claude/query-manager.d.ts.map +1 -0
- package/dist/claude/query-manager.js +74 -0
- package/dist/claude/query-manager.js.map +1 -0
- package/dist/claude/stream-converter.d.ts +19 -0
- package/dist/claude/stream-converter.d.ts.map +1 -0
- package/dist/claude/stream-converter.js +166 -0
- package/dist/claude/stream-converter.js.map +1 -0
- package/dist/claude/types.d.ts +99 -0
- package/dist/claude/types.d.ts.map +1 -0
- package/dist/claude/types.js +8 -0
- package/dist/claude/types.js.map +1 -0
- package/dist/cli/agentExecution.d.ts +16 -0
- package/dist/cli/agentExecution.d.ts.map +1 -0
- package/dist/cli/agentExecution.js +40 -0
- package/dist/cli/agentExecution.js.map +1 -0
- package/dist/cli/help.d.ts +8 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +46 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +8 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/taskBatch.d.ts +8 -0
- package/dist/cli/taskBatch.d.ts.map +1 -0
- package/dist/cli/taskBatch.js +69 -0
- package/dist/cli/taskBatch.js.map +1 -0
- package/dist/cli/workflowExecution.d.ts +18 -0
- package/dist/cli/workflowExecution.d.ts.map +1 -0
- package/dist/cli/workflowExecution.js +112 -0
- package/dist/cli/workflowExecution.js.map +1 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +122 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/agentExecution.d.ts +8 -0
- package/dist/commands/agentExecution.d.ts.map +1 -0
- package/dist/commands/agentExecution.js +44 -0
- package/dist/commands/agentExecution.js.map +1 -0
- package/dist/commands/help.d.ts +8 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +39 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +9 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/session.d.ts +10 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +18 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/taskExecution.d.ts +20 -0
- package/dist/commands/taskExecution.d.ts.map +1 -0
- package/dist/commands/taskExecution.js +103 -0
- package/dist/commands/taskExecution.js.map +1 -0
- package/dist/commands/workflow.d.ts +9 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +51 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/commands/workflowExecution.d.ts +21 -0
- package/dist/commands/workflowExecution.d.ts.map +1 -0
- package/dist/commands/workflowExecution.js +95 -0
- package/dist/commands/workflowExecution.js.map +1 -0
- package/dist/config/agentLoader.d.ts +25 -0
- package/dist/config/agentLoader.d.ts.map +1 -0
- package/dist/config/agentLoader.js +96 -0
- package/dist/config/agentLoader.js.map +1 -0
- package/dist/config/globalConfig.d.ts +23 -0
- package/dist/config/globalConfig.d.ts.map +1 -0
- package/dist/config/globalConfig.js +117 -0
- package/dist/config/globalConfig.js.map +1 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/initialization.d.ts +23 -0
- package/dist/config/initialization.d.ts.map +1 -0
- package/dist/config/initialization.js +55 -0
- package/dist/config/initialization.js.map +1 -0
- package/dist/config/loader.d.ts +9 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +12 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/paths.d.ts +33 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +66 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/projectConfig.d.ts +41 -0
- package/dist/config/projectConfig.d.ts.map +1 -0
- package/dist/config/projectConfig.js +85 -0
- package/dist/config/projectConfig.js.map +1 -0
- package/dist/config/sessionStore.d.ts +44 -0
- package/dist/config/sessionStore.d.ts.map +1 -0
- package/dist/config/sessionStore.js +194 -0
- package/dist/config/sessionStore.js.map +1 -0
- package/dist/config/workflowLoader.d.ts +23 -0
- package/dist/config/workflowLoader.d.ts.map +1 -0
- package/dist/config/workflowLoader.js +142 -0
- package/dist/config/workflowLoader.js.map +1 -0
- package/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/interactive/commands/agent.d.ts +7 -0
- package/dist/interactive/commands/agent.d.ts.map +1 -0
- package/dist/interactive/commands/agent.js +65 -0
- package/dist/interactive/commands/agent.js.map +1 -0
- package/dist/interactive/commands/basic.d.ts +7 -0
- package/dist/interactive/commands/basic.d.ts.map +1 -0
- package/dist/interactive/commands/basic.js +81 -0
- package/dist/interactive/commands/basic.js.map +1 -0
- package/dist/interactive/commands/index.d.ts +12 -0
- package/dist/interactive/commands/index.d.ts.map +1 -0
- package/dist/interactive/commands/index.js +14 -0
- package/dist/interactive/commands/index.js.map +1 -0
- package/dist/interactive/commands/registry.d.ts +41 -0
- package/dist/interactive/commands/registry.d.ts.map +1 -0
- package/dist/interactive/commands/registry.js +37 -0
- package/dist/interactive/commands/registry.js.map +1 -0
- package/dist/interactive/commands/session.d.ts +7 -0
- package/dist/interactive/commands/session.d.ts.map +1 -0
- package/dist/interactive/commands/session.js +75 -0
- package/dist/interactive/commands/session.js.map +1 -0
- package/dist/interactive/commands/task.d.ts +7 -0
- package/dist/interactive/commands/task.d.ts.map +1 -0
- package/dist/interactive/commands/task.js +156 -0
- package/dist/interactive/commands/task.js.map +1 -0
- package/dist/interactive/commands/workflow.d.ts +7 -0
- package/dist/interactive/commands/workflow.d.ts.map +1 -0
- package/dist/interactive/commands/workflow.js +56 -0
- package/dist/interactive/commands/workflow.js.map +1 -0
- package/dist/interactive/escape-tracker.d.ts +37 -0
- package/dist/interactive/escape-tracker.d.ts.map +1 -0
- package/dist/interactive/escape-tracker.js +52 -0
- package/dist/interactive/escape-tracker.js.map +1 -0
- package/dist/interactive/handlers.d.ts +24 -0
- package/dist/interactive/handlers.d.ts.map +1 -0
- package/dist/interactive/handlers.js +191 -0
- package/dist/interactive/handlers.js.map +1 -0
- package/dist/interactive/history-manager.d.ts +45 -0
- package/dist/interactive/history-manager.d.ts.map +1 -0
- package/dist/interactive/history-manager.js +91 -0
- package/dist/interactive/history-manager.js.map +1 -0
- package/dist/interactive/index.d.ts +8 -0
- package/dist/interactive/index.d.ts.map +1 -0
- package/dist/interactive/index.js +8 -0
- package/dist/interactive/index.js.map +1 -0
- package/dist/interactive/ink/components/App.d.ts +16 -0
- package/dist/interactive/ink/components/App.d.ts.map +1 -0
- package/dist/interactive/ink/components/App.js +123 -0
- package/dist/interactive/ink/components/App.js.map +1 -0
- package/dist/interactive/ink/components/AskUserQuestion.d.ts +16 -0
- package/dist/interactive/ink/components/AskUserQuestion.d.ts.map +1 -0
- package/dist/interactive/ink/components/AskUserQuestion.js +139 -0
- package/dist/interactive/ink/components/AskUserQuestion.js.map +1 -0
- package/dist/interactive/ink/components/Header.d.ts +20 -0
- package/dist/interactive/ink/components/Header.d.ts.map +1 -0
- package/dist/interactive/ink/components/Header.js +7 -0
- package/dist/interactive/ink/components/Header.js.map +1 -0
- package/dist/interactive/ink/components/HelpView.d.ts +13 -0
- package/dist/interactive/ink/components/HelpView.d.ts.map +1 -0
- package/dist/interactive/ink/components/HelpView.js +45 -0
- package/dist/interactive/ink/components/HelpView.js.map +1 -0
- package/dist/interactive/ink/components/IterationLimit.d.ts +19 -0
- package/dist/interactive/ink/components/IterationLimit.d.ts.map +1 -0
- package/dist/interactive/ink/components/IterationLimit.js +59 -0
- package/dist/interactive/ink/components/IterationLimit.js.map +1 -0
- package/dist/interactive/ink/components/ModalRouter.d.ts +11 -0
- package/dist/interactive/ink/components/ModalRouter.d.ts.map +1 -0
- package/dist/interactive/ink/components/ModalRouter.js +71 -0
- package/dist/interactive/ink/components/ModalRouter.js.map +1 -0
- package/dist/interactive/ink/components/PermissionPrompt.d.ts +17 -0
- package/dist/interactive/ink/components/PermissionPrompt.d.ts.map +1 -0
- package/dist/interactive/ink/components/PermissionPrompt.js +102 -0
- package/dist/interactive/ink/components/PermissionPrompt.js.map +1 -0
- package/dist/interactive/ink/components/PromptInput.d.ts +26 -0
- package/dist/interactive/ink/components/PromptInput.d.ts.map +1 -0
- package/dist/interactive/ink/components/PromptInput.js +70 -0
- package/dist/interactive/ink/components/PromptInput.js.map +1 -0
- package/dist/interactive/ink/components/Spinner.d.ts +14 -0
- package/dist/interactive/ink/components/Spinner.d.ts.map +1 -0
- package/dist/interactive/ink/components/Spinner.js +8 -0
- package/dist/interactive/ink/components/Spinner.js.map +1 -0
- package/dist/interactive/ink/components/StreamingOutput.d.ts +25 -0
- package/dist/interactive/ink/components/StreamingOutput.d.ts.map +1 -0
- package/dist/interactive/ink/components/StreamingOutput.js +8 -0
- package/dist/interactive/ink/components/StreamingOutput.js.map +1 -0
- package/dist/interactive/ink/components/UserInputPrompt.d.ts +18 -0
- package/dist/interactive/ink/components/UserInputPrompt.d.ts.map +1 -0
- package/dist/interactive/ink/components/UserInputPrompt.js +30 -0
- package/dist/interactive/ink/components/UserInputPrompt.js.map +1 -0
- package/dist/interactive/ink/components/WorkflowSelector.d.ts +18 -0
- package/dist/interactive/ink/components/WorkflowSelector.d.ts.map +1 -0
- package/dist/interactive/ink/components/WorkflowSelector.js +65 -0
- package/dist/interactive/ink/components/WorkflowSelector.js.map +1 -0
- package/dist/interactive/ink/constants.d.ts +8 -0
- package/dist/interactive/ink/constants.d.ts.map +1 -0
- package/dist/interactive/ink/constants.js +8 -0
- package/dist/interactive/ink/constants.js.map +1 -0
- package/dist/interactive/ink/context/AppContext.d.ts +26 -0
- package/dist/interactive/ink/context/AppContext.d.ts.map +1 -0
- package/dist/interactive/ink/context/AppContext.js +30 -0
- package/dist/interactive/ink/context/AppContext.js.map +1 -0
- package/dist/interactive/ink/context/appReducer.d.ts +13 -0
- package/dist/interactive/ink/context/appReducer.d.ts.map +1 -0
- package/dist/interactive/ink/context/appReducer.js +183 -0
- package/dist/interactive/ink/context/appReducer.js.map +1 -0
- package/dist/interactive/ink/context/types.d.ts +144 -0
- package/dist/interactive/ink/context/types.d.ts.map +1 -0
- package/dist/interactive/ink/context/types.js +5 -0
- package/dist/interactive/ink/context/types.js.map +1 -0
- package/dist/interactive/ink/hooks/keyDetection.d.ts +116 -0
- package/dist/interactive/ink/hooks/keyDetection.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/keyDetection.js +183 -0
- package/dist/interactive/ink/hooks/keyDetection.js.map +1 -0
- package/dist/interactive/ink/hooks/multilineInputLogic.d.ts +50 -0
- package/dist/interactive/ink/hooks/multilineInputLogic.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/multilineInputLogic.js +150 -0
- package/dist/interactive/ink/hooks/multilineInputLogic.js.map +1 -0
- package/dist/interactive/ink/hooks/useCommands.d.ts +20 -0
- package/dist/interactive/ink/hooks/useCommands.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useCommands.js +129 -0
- package/dist/interactive/ink/hooks/useCommands.js.map +1 -0
- package/dist/interactive/ink/hooks/useHistory.d.ts +28 -0
- package/dist/interactive/ink/hooks/useHistory.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useHistory.js +59 -0
- package/dist/interactive/ink/hooks/useHistory.js.map +1 -0
- package/dist/interactive/ink/hooks/useMultilineInput.d.ts +49 -0
- package/dist/interactive/ink/hooks/useMultilineInput.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useMultilineInput.js +106 -0
- package/dist/interactive/ink/hooks/useMultilineInput.js.map +1 -0
- package/dist/interactive/ink/hooks/usePermissionHandlers.d.ts +16 -0
- package/dist/interactive/ink/hooks/usePermissionHandlers.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/usePermissionHandlers.js +172 -0
- package/dist/interactive/ink/hooks/usePermissionHandlers.js.map +1 -0
- package/dist/interactive/ink/hooks/useRawKeypress.d.ts +41 -0
- package/dist/interactive/ink/hooks/useRawKeypress.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useRawKeypress.js +79 -0
- package/dist/interactive/ink/hooks/useRawKeypress.js.map +1 -0
- package/dist/interactive/ink/hooks/useTaskQueue.d.ts +32 -0
- package/dist/interactive/ink/hooks/useTaskQueue.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useTaskQueue.js +68 -0
- package/dist/interactive/ink/hooks/useTaskQueue.js.map +1 -0
- package/dist/interactive/ink/hooks/useWorkflow.d.ts +45 -0
- package/dist/interactive/ink/hooks/useWorkflow.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useWorkflow.js +93 -0
- package/dist/interactive/ink/hooks/useWorkflow.js.map +1 -0
- package/dist/interactive/ink/hooks/useWorkflowExecution.d.ts +14 -0
- package/dist/interactive/ink/hooks/useWorkflowExecution.d.ts.map +1 -0
- package/dist/interactive/ink/hooks/useWorkflowExecution.js +144 -0
- package/dist/interactive/ink/hooks/useWorkflowExecution.js.map +1 -0
- package/dist/interactive/ink/index.d.ts +30 -0
- package/dist/interactive/ink/index.d.ts.map +1 -0
- package/dist/interactive/ink/index.js +33 -0
- package/dist/interactive/ink/index.js.map +1 -0
- package/dist/interactive/ink/utils/workflow.d.ts +11 -0
- package/dist/interactive/ink/utils/workflow.d.ts.map +1 -0
- package/dist/interactive/ink/utils/workflow.js +19 -0
- package/dist/interactive/ink/utils/workflow.js.map +1 -0
- package/dist/interactive/input-buffer.d.ts +67 -0
- package/dist/interactive/input-buffer.d.ts.map +1 -0
- package/dist/interactive/input-buffer.js +162 -0
- package/dist/interactive/input-buffer.js.map +1 -0
- package/dist/interactive/input-handlers.d.ts +50 -0
- package/dist/interactive/input-handlers.d.ts.map +1 -0
- package/dist/interactive/input-handlers.js +170 -0
- package/dist/interactive/input-handlers.js.map +1 -0
- package/dist/interactive/input.d.ts +43 -0
- package/dist/interactive/input.d.ts.map +1 -0
- package/dist/interactive/input.js +74 -0
- package/dist/interactive/input.js.map +1 -0
- package/dist/interactive/keyDetection.d.ts +85 -0
- package/dist/interactive/keyDetection.d.ts.map +1 -0
- package/dist/interactive/keyDetection.js +167 -0
- package/dist/interactive/keyDetection.js.map +1 -0
- package/dist/interactive/multilineInputLogic.d.ts +30 -0
- package/dist/interactive/multilineInputLogic.d.ts.map +1 -0
- package/dist/interactive/multilineInputLogic.js +143 -0
- package/dist/interactive/multilineInputLogic.js.map +1 -0
- package/dist/interactive/passthrough.d.ts +30 -0
- package/dist/interactive/passthrough.d.ts.map +1 -0
- package/dist/interactive/passthrough.js +94 -0
- package/dist/interactive/passthrough.js.map +1 -0
- package/dist/interactive/permission.d.ts +33 -0
- package/dist/interactive/permission.d.ts.map +1 -0
- package/dist/interactive/permission.js +231 -0
- package/dist/interactive/permission.js.map +1 -0
- package/dist/interactive/prompt.d.ts +33 -0
- package/dist/interactive/prompt.d.ts.map +1 -0
- package/dist/interactive/prompt.js +132 -0
- package/dist/interactive/prompt.js.map +1 -0
- package/dist/interactive/repl.d.ts +13 -0
- package/dist/interactive/repl.d.ts.map +1 -0
- package/dist/interactive/repl.js +202 -0
- package/dist/interactive/repl.js.map +1 -0
- package/dist/interactive/types.d.ts +35 -0
- package/dist/interactive/types.d.ts.map +1 -0
- package/dist/interactive/types.js +5 -0
- package/dist/interactive/types.js.map +1 -0
- package/dist/interactive/ui.d.ts +16 -0
- package/dist/interactive/ui.d.ts.map +1 -0
- package/dist/interactive/ui.js +122 -0
- package/dist/interactive/ui.js.map +1 -0
- package/dist/interactive/user-input.d.ts +26 -0
- package/dist/interactive/user-input.d.ts.map +1 -0
- package/dist/interactive/user-input.js +115 -0
- package/dist/interactive/user-input.js.map +1 -0
- package/dist/interactive/workflow-executor.d.ts +20 -0
- package/dist/interactive/workflow-executor.d.ts.map +1 -0
- package/dist/interactive/workflow-executor.js +200 -0
- package/dist/interactive/workflow-executor.js.map +1 -0
- package/dist/models/agent.d.ts +37 -0
- package/dist/models/agent.d.ts.map +1 -0
- package/dist/models/agent.js +11 -0
- package/dist/models/agent.js.map +1 -0
- package/dist/models/config.d.ts +19 -0
- package/dist/models/config.d.ts.map +1 -0
- package/dist/models/config.js +25 -0
- package/dist/models/config.js.map +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +11 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/schemas.d.ts +161 -0
- package/dist/models/schemas.d.ts.map +1 -0
- package/dist/models/schemas.js +137 -0
- package/dist/models/schemas.js.map +1 -0
- package/dist/models/session.d.ts +50 -0
- package/dist/models/session.d.ts.map +1 -0
- package/dist/models/session.js +45 -0
- package/dist/models/session.js.map +1 -0
- package/dist/models/types.d.ts +117 -0
- package/dist/models/types.d.ts.map +1 -0
- package/dist/models/types.js +5 -0
- package/dist/models/types.js.map +1 -0
- package/dist/models/workflow.d.ts +58 -0
- package/dist/models/workflow.d.ts.map +1 -0
- package/dist/models/workflow.js +19 -0
- package/dist/models/workflow.js.map +1 -0
- package/dist/resources/index.d.ts +38 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +108 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/task/display.d.ts +11 -0
- package/dist/task/display.d.ts.map +1 -0
- package/dist/task/display.js +41 -0
- package/dist/task/display.js.map +1 -0
- package/dist/task/index.d.ts +6 -0
- package/dist/task/index.d.ts.map +1 -0
- package/dist/task/index.js +6 -0
- package/dist/task/index.js.map +1 -0
- package/dist/task/runner.d.ts +68 -0
- package/dist/task/runner.d.ts.map +1 -0
- package/dist/task/runner.js +172 -0
- package/dist/task/runner.js.map +1 -0
- package/dist/utils/debug.d.ts +32 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/debug.js +135 -0
- package/dist/utils/debug.js.map +1 -0
- package/dist/utils/error.d.ts +8 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +10 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/notification.d.ts +63 -0
- package/dist/utils/notification.d.ts.map +1 -0
- package/dist/utils/notification.js +170 -0
- package/dist/utils/notification.js.map +1 -0
- package/dist/utils/session.d.ts +38 -0
- package/dist/utils/session.d.ts.map +1 -0
- package/dist/utils/session.js +97 -0
- package/dist/utils/session.js.map +1 -0
- package/dist/utils/ui.d.ts +91 -0
- package/dist/utils/ui.d.ts.map +1 -0
- package/dist/utils/ui.js +330 -0
- package/dist/utils/ui.js.map +1 -0
- package/dist/workflow/blocked-handler.d.ts +27 -0
- package/dist/workflow/blocked-handler.d.ts.map +1 -0
- package/dist/workflow/blocked-handler.js +40 -0
- package/dist/workflow/blocked-handler.js.map +1 -0
- package/dist/workflow/constants.d.ts +20 -0
- package/dist/workflow/constants.d.ts.map +1 -0
- package/dist/workflow/constants.js +20 -0
- package/dist/workflow/constants.js.map +1 -0
- package/dist/workflow/engine.d.ts +42 -0
- package/dist/workflow/engine.d.ts.map +1 -0
- package/dist/workflow/engine.js +207 -0
- package/dist/workflow/engine.js.map +1 -0
- package/dist/workflow/index.d.ts +15 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +21 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/instruction-builder.d.ts +37 -0
- package/dist/workflow/instruction-builder.d.ts.map +1 -0
- package/dist/workflow/instruction-builder.js +49 -0
- package/dist/workflow/instruction-builder.js.map +1 -0
- package/dist/workflow/loop-detector.d.ts +31 -0
- package/dist/workflow/loop-detector.d.ts.map +1 -0
- package/dist/workflow/loop-detector.js +61 -0
- package/dist/workflow/loop-detector.js.map +1 -0
- package/dist/workflow/state-manager.d.ts +25 -0
- package/dist/workflow/state-manager.d.ts.map +1 -0
- package/dist/workflow/state-manager.js +59 -0
- package/dist/workflow/state-manager.js.map +1 -0
- package/dist/workflow/transitions.d.ts +25 -0
- package/dist/workflow/transitions.d.ts.map +1 -0
- package/dist/workflow/transitions.js +106 -0
- package/dist/workflow/transitions.js.map +1 -0
- package/dist/workflow/types.d.ts +74 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/types.js +8 -0
- package/dist/workflow/types.js.map +1 -0
- package/package.json +67 -0
- package/resources/global/en/agents/default/architect.md +292 -0
- package/resources/global/en/agents/default/coder.md +169 -0
- package/resources/global/en/agents/default/security.md +206 -0
- package/resources/global/en/agents/default/supervisor.md +153 -0
- package/resources/global/en/agents/magi/balthasar.md +75 -0
- package/resources/global/en/agents/magi/casper.md +100 -0
- package/resources/global/en/agents/magi/melchior.md +74 -0
- package/resources/global/en/agents/research/digger.md +134 -0
- package/resources/global/en/agents/research/planner.md +125 -0
- package/resources/global/en/agents/research/supervisor.md +86 -0
- package/resources/global/en/config.yaml +19 -0
- package/resources/global/en/workflows/default.yaml +177 -0
- package/resources/global/en/workflows/magi.yaml +96 -0
- package/resources/global/en/workflows/research.yaml +112 -0
- package/resources/global/ja/agents/default/architect.md +292 -0
- package/resources/global/ja/agents/default/coder.md +170 -0
- package/resources/global/ja/agents/default/security.md +206 -0
- package/resources/global/ja/agents/default/supervisor.md +153 -0
- package/resources/global/ja/agents/magi/balthasar.md +75 -0
- package/resources/global/ja/agents/magi/casper.md +100 -0
- package/resources/global/ja/agents/magi/melchior.md +74 -0
- package/resources/global/ja/agents/research/digger.md +134 -0
- package/resources/global/ja/agents/research/planner.md +125 -0
- package/resources/global/ja/agents/research/supervisor.md +86 -0
- package/resources/global/ja/config.yaml +19 -0
- package/resources/global/ja/workflows/default.yaml +177 -0
- package/resources/global/ja/workflows/magi.yaml +96 -0
- package/resources/global/ja/workflows/research.yaml +112 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialization module for first-time setup
|
|
3
|
+
*
|
|
4
|
+
* Handles language selection and initial resource setup.
|
|
5
|
+
* Separated from paths.ts to avoid UI dependencies in utility modules.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync } from 'node:fs';
|
|
8
|
+
import { DEFAULT_LANGUAGE } from '../constants.js';
|
|
9
|
+
import { selectOptionWithDefault } from '../interactive/prompt.js';
|
|
10
|
+
import { getGlobalConfigDir, getGlobalAgentsDir, getGlobalWorkflowsDir, getGlobalLogsDir, ensureDir, } from './paths.js';
|
|
11
|
+
import { copyGlobalResourcesToDir, copyLanguageResourcesToDir, } from '../resources/index.js';
|
|
12
|
+
import { setLanguage } from './globalConfig.js';
|
|
13
|
+
/**
|
|
14
|
+
* Check if language-specific resources need to be initialized.
|
|
15
|
+
* Returns true if agents or workflows directories don't exist.
|
|
16
|
+
*/
|
|
17
|
+
export function needsLanguageSetup() {
|
|
18
|
+
const agentsDir = getGlobalAgentsDir();
|
|
19
|
+
const workflowsDir = getGlobalWorkflowsDir();
|
|
20
|
+
return !existsSync(agentsDir) || !existsSync(workflowsDir);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Prompt user to select language for resources.
|
|
24
|
+
* Returns 'en' for English (default), 'ja' for Japanese.
|
|
25
|
+
*/
|
|
26
|
+
export async function promptLanguageSelection() {
|
|
27
|
+
const options = [
|
|
28
|
+
{ label: 'English', value: 'en' },
|
|
29
|
+
{ label: '日本語 (Japanese)', value: 'ja' },
|
|
30
|
+
];
|
|
31
|
+
return await selectOptionWithDefault('Select language for default agents and workflows / デフォルトのエージェントとワークフローの言語を選択してください:', options, DEFAULT_LANGUAGE);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Initialize global takt directory structure with language selection.
|
|
35
|
+
* If agents/workflows don't exist, prompts user for language preference.
|
|
36
|
+
*/
|
|
37
|
+
export async function initGlobalDirs() {
|
|
38
|
+
ensureDir(getGlobalConfigDir());
|
|
39
|
+
ensureDir(getGlobalLogsDir());
|
|
40
|
+
// Check if we need to set up language-specific resources
|
|
41
|
+
const needsSetup = needsLanguageSetup();
|
|
42
|
+
if (needsSetup) {
|
|
43
|
+
// Ask user for language preference
|
|
44
|
+
const lang = await promptLanguageSelection();
|
|
45
|
+
// Copy language-specific resources (agents, workflows, config.yaml)
|
|
46
|
+
copyLanguageResourcesToDir(getGlobalConfigDir(), lang);
|
|
47
|
+
// Explicitly save the selected language (handles case where config.yaml existed)
|
|
48
|
+
setLanguage(lang);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// Just copy base global resources (won't overwrite existing)
|
|
52
|
+
copyGlobalResourcesToDir(getGlobalConfigDir());
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=initialization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialization.js","sourceRoot":"","sources":["../../src/config/initialization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IACvC,MAAM,YAAY,GAAG,qBAAqB,EAAE,CAAC;IAC7C,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAC3C,MAAM,OAAO,GAAyC;QACpD,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE;QACjC,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE;KACzC,CAAC;IAEF,OAAO,MAAM,uBAAuB,CAClC,qFAAqF,EACrF,OAAO,EACP,gBAAgB,CACjB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,SAAS,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAChC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE9B,yDAAyD;IACzD,MAAM,UAAU,GAAG,kBAAkB,EAAE,CAAC;IAExC,IAAI,UAAU,EAAE,CAAC;QACf,mCAAmC;QACnC,MAAM,IAAI,GAAG,MAAM,uBAAuB,EAAE,CAAC;QAE7C,oEAAoE;QACpE,0BAA0B,CAAC,kBAAkB,EAAE,EAAE,IAAI,CAAC,CAAC;QAEvD,iFAAiF;QACjF,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,6DAA6D;QAC7D,wBAAwB,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration loader for takt
|
|
3
|
+
*
|
|
4
|
+
* Re-exports from specialized loaders for backward compatibility.
|
|
5
|
+
*/
|
|
6
|
+
export { getBuiltinWorkflow, loadWorkflowFromFile, loadWorkflow, loadAllWorkflows, listWorkflows, } from './workflowLoader.js';
|
|
7
|
+
export { loadAgentsFromDir, loadCustomAgents, listCustomAgents, loadAgentPrompt, loadAgentPromptFromPath, } from './agentLoader.js';
|
|
8
|
+
export { loadGlobalConfig, saveGlobalConfig, addTrustedDirectory, isDirectoryTrusted, loadProjectDebugConfig, getEffectiveDebugConfig, } from './globalConfig.js';
|
|
9
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration loader for takt
|
|
3
|
+
*
|
|
4
|
+
* Re-exports from specialized loaders for backward compatibility.
|
|
5
|
+
*/
|
|
6
|
+
// Workflow loading
|
|
7
|
+
export { getBuiltinWorkflow, loadWorkflowFromFile, loadWorkflow, loadAllWorkflows, listWorkflows, } from './workflowLoader.js';
|
|
8
|
+
// Agent loading
|
|
9
|
+
export { loadAgentsFromDir, loadCustomAgents, listCustomAgents, loadAgentPrompt, loadAgentPromptFromPath, } from './agentLoader.js';
|
|
10
|
+
// Global configuration
|
|
11
|
+
export { loadGlobalConfig, saveGlobalConfig, addTrustedDirectory, isDirectoryTrusted, loadProjectDebugConfig, getEffectiveDebugConfig, } from './globalConfig.js';
|
|
12
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mBAAmB;AACnB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,gBAAgB;AAChB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,uBAAuB;AACvB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path utilities for takt configuration
|
|
3
|
+
*
|
|
4
|
+
* This module provides pure path utilities without UI dependencies.
|
|
5
|
+
* For initialization with language selection, use initialization.ts.
|
|
6
|
+
*/
|
|
7
|
+
/** Get takt global config directory (~/.takt) */
|
|
8
|
+
export declare function getGlobalConfigDir(): string;
|
|
9
|
+
/** Get takt global agents directory (~/.takt/agents) */
|
|
10
|
+
export declare function getGlobalAgentsDir(): string;
|
|
11
|
+
/** Get takt global workflows directory (~/.takt/workflows) */
|
|
12
|
+
export declare function getGlobalWorkflowsDir(): string;
|
|
13
|
+
/** Get takt global logs directory */
|
|
14
|
+
export declare function getGlobalLogsDir(): string;
|
|
15
|
+
/** Get takt global config file path */
|
|
16
|
+
export declare function getGlobalConfigPath(): string;
|
|
17
|
+
/** Get project takt config directory (.takt in project) */
|
|
18
|
+
export declare function getProjectConfigDir(projectDir: string): string;
|
|
19
|
+
/** Get project config file path */
|
|
20
|
+
export declare function getProjectConfigPath(projectDir: string): string;
|
|
21
|
+
/** Get project tasks directory */
|
|
22
|
+
export declare function getProjectTasksDir(projectDir: string): string;
|
|
23
|
+
/** Get project completed tasks directory */
|
|
24
|
+
export declare function getProjectCompletedDir(projectDir: string): string;
|
|
25
|
+
/** Get project logs directory */
|
|
26
|
+
export declare function getProjectLogsDir(projectDir: string): string;
|
|
27
|
+
/** Ensure a directory exists, create if not */
|
|
28
|
+
export declare function ensureDir(dirPath: string): void;
|
|
29
|
+
/** Validate path is safe (no directory traversal) */
|
|
30
|
+
export declare function isPathSafe(basePath: string, targetPath: string): boolean;
|
|
31
|
+
export { loadProjectConfig, saveProjectConfig, updateProjectConfig, getCurrentWorkflow, setCurrentWorkflow, isVerboseMode, type ProjectLocalConfig, } from './projectConfig.js';
|
|
32
|
+
export { getInputHistoryPath, MAX_INPUT_HISTORY, loadInputHistory, saveInputHistory, addToInputHistory, type AgentSessionData, getAgentSessionsPath, loadAgentSessions, saveAgentSessions, updateAgentSession, clearAgentSessions, } from './sessionStore.js';
|
|
33
|
+
//# sourceMappingURL=paths.d.ts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,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path utilities for takt configuration
|
|
3
|
+
*
|
|
4
|
+
* This module provides pure path utilities without UI dependencies.
|
|
5
|
+
* For initialization with language selection, use initialization.ts.
|
|
6
|
+
*/
|
|
7
|
+
import { homedir } from 'node:os';
|
|
8
|
+
import { join, resolve } from 'node:path';
|
|
9
|
+
import { existsSync, mkdirSync } from 'node:fs';
|
|
10
|
+
/** Get takt global config directory (~/.takt) */
|
|
11
|
+
export function getGlobalConfigDir() {
|
|
12
|
+
return join(homedir(), '.takt');
|
|
13
|
+
}
|
|
14
|
+
/** Get takt global agents directory (~/.takt/agents) */
|
|
15
|
+
export function getGlobalAgentsDir() {
|
|
16
|
+
return join(getGlobalConfigDir(), 'agents');
|
|
17
|
+
}
|
|
18
|
+
/** Get takt global workflows directory (~/.takt/workflows) */
|
|
19
|
+
export function getGlobalWorkflowsDir() {
|
|
20
|
+
return join(getGlobalConfigDir(), 'workflows');
|
|
21
|
+
}
|
|
22
|
+
/** Get takt global logs directory */
|
|
23
|
+
export function getGlobalLogsDir() {
|
|
24
|
+
return join(getGlobalConfigDir(), 'logs');
|
|
25
|
+
}
|
|
26
|
+
/** Get takt global config file path */
|
|
27
|
+
export function getGlobalConfigPath() {
|
|
28
|
+
return join(getGlobalConfigDir(), 'config.yaml');
|
|
29
|
+
}
|
|
30
|
+
/** Get project takt config directory (.takt in project) */
|
|
31
|
+
export function getProjectConfigDir(projectDir) {
|
|
32
|
+
return join(resolve(projectDir), '.takt');
|
|
33
|
+
}
|
|
34
|
+
/** Get project config file path */
|
|
35
|
+
export function getProjectConfigPath(projectDir) {
|
|
36
|
+
return join(getProjectConfigDir(projectDir), 'config.yaml');
|
|
37
|
+
}
|
|
38
|
+
/** Get project tasks directory */
|
|
39
|
+
export function getProjectTasksDir(projectDir) {
|
|
40
|
+
return join(getProjectConfigDir(projectDir), 'tasks');
|
|
41
|
+
}
|
|
42
|
+
/** Get project completed tasks directory */
|
|
43
|
+
export function getProjectCompletedDir(projectDir) {
|
|
44
|
+
return join(getProjectConfigDir(projectDir), 'completed');
|
|
45
|
+
}
|
|
46
|
+
/** Get project logs directory */
|
|
47
|
+
export function getProjectLogsDir(projectDir) {
|
|
48
|
+
return join(getProjectConfigDir(projectDir), 'logs');
|
|
49
|
+
}
|
|
50
|
+
/** Ensure a directory exists, create if not */
|
|
51
|
+
export function ensureDir(dirPath) {
|
|
52
|
+
if (!existsSync(dirPath)) {
|
|
53
|
+
mkdirSync(dirPath, { recursive: true });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Validate path is safe (no directory traversal) */
|
|
57
|
+
export function isPathSafe(basePath, targetPath) {
|
|
58
|
+
const resolvedBase = resolve(basePath);
|
|
59
|
+
const resolvedTarget = resolve(targetPath);
|
|
60
|
+
return resolvedTarget.startsWith(resolvedBase);
|
|
61
|
+
}
|
|
62
|
+
// Re-export project config functions
|
|
63
|
+
export { loadProjectConfig, saveProjectConfig, updateProjectConfig, getCurrentWorkflow, setCurrentWorkflow, isVerboseMode, } from './projectConfig.js';
|
|
64
|
+
// Re-export session storage functions for backward compatibility
|
|
65
|
+
export { getInputHistoryPath, MAX_INPUT_HISTORY, loadInputHistory, saveInputHistory, addToInputHistory, getAgentSessionsPath, loadAgentSessions, saveAgentSessions, updateAgentSession, clearAgentSessions, } from './sessionStore.js';
|
|
66
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/config/paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,U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;IAClD,OAAO,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,UAAkB;IAC7D,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3C,OAAO,cAAc,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjD,CAAC;AAED,qCAAqC;AACrC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,GAEd,MAAM,oBAAoB,CAAC;AAE5B,iEAAiE;AACjE,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAEjB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-level configuration management
|
|
3
|
+
*
|
|
4
|
+
* Manages .takt/config.yaml for project-specific settings.
|
|
5
|
+
*/
|
|
6
|
+
/** Project configuration stored in .takt/config.yaml */
|
|
7
|
+
export interface ProjectLocalConfig {
|
|
8
|
+
/** Current workflow name */
|
|
9
|
+
workflow?: string;
|
|
10
|
+
/** Auto-approve all permissions in this project */
|
|
11
|
+
sacrificeMode?: boolean;
|
|
12
|
+
/** Verbose output mode */
|
|
13
|
+
verbose?: boolean;
|
|
14
|
+
/** Custom settings */
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Load project configuration from .takt/config.yaml
|
|
19
|
+
*/
|
|
20
|
+
export declare function loadProjectConfig(projectDir: string): ProjectLocalConfig;
|
|
21
|
+
/**
|
|
22
|
+
* Save project configuration to .takt/config.yaml
|
|
23
|
+
*/
|
|
24
|
+
export declare function saveProjectConfig(projectDir: string, config: ProjectLocalConfig): void;
|
|
25
|
+
/**
|
|
26
|
+
* Update a single field in project configuration
|
|
27
|
+
*/
|
|
28
|
+
export declare function updateProjectConfig<K extends keyof ProjectLocalConfig>(projectDir: string, key: K, value: ProjectLocalConfig[K]): void;
|
|
29
|
+
/**
|
|
30
|
+
* Get current workflow from project config
|
|
31
|
+
*/
|
|
32
|
+
export declare function getCurrentWorkflow(projectDir: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Set current workflow in project config
|
|
35
|
+
*/
|
|
36
|
+
export declare function setCurrentWorkflow(projectDir: string, workflow: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Get verbose mode from project config
|
|
39
|
+
*/
|
|
40
|
+
export declare function isVerboseMode(projectDir: string): boolean;
|
|
41
|
+
//# sourceMappingURL=projectConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectConfig.d.ts","sourceRoot":"","sources":["../../src/config/projectConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sBAAsB;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAuBD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,CAcxE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAWtF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,kBAAkB,EACpE,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC3B,IAAI,CAIN;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAE7E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAGzD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-level configuration management
|
|
3
|
+
*
|
|
4
|
+
* Manages .takt/config.yaml for project-specific settings.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
7
|
+
import { join, resolve } from 'node:path';
|
|
8
|
+
import { parse, stringify } from 'yaml';
|
|
9
|
+
/** Default project configuration */
|
|
10
|
+
const DEFAULT_PROJECT_CONFIG = {
|
|
11
|
+
workflow: 'default',
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Get project takt config directory (.takt in project)
|
|
15
|
+
* Note: Defined locally to avoid circular dependency with paths.ts
|
|
16
|
+
*/
|
|
17
|
+
function getConfigDir(projectDir) {
|
|
18
|
+
return join(resolve(projectDir), '.takt');
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get project config file path
|
|
22
|
+
* Note: Defined locally to avoid circular dependency with paths.ts
|
|
23
|
+
*/
|
|
24
|
+
function getConfigPath(projectDir) {
|
|
25
|
+
return join(getConfigDir(projectDir), 'config.yaml');
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Load project configuration from .takt/config.yaml
|
|
29
|
+
*/
|
|
30
|
+
export function loadProjectConfig(projectDir) {
|
|
31
|
+
const configPath = getConfigPath(projectDir);
|
|
32
|
+
if (!existsSync(configPath)) {
|
|
33
|
+
return { ...DEFAULT_PROJECT_CONFIG };
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
37
|
+
const parsed = parse(content);
|
|
38
|
+
return { ...DEFAULT_PROJECT_CONFIG, ...parsed };
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return { ...DEFAULT_PROJECT_CONFIG };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Save project configuration to .takt/config.yaml
|
|
46
|
+
*/
|
|
47
|
+
export function saveProjectConfig(projectDir, config) {
|
|
48
|
+
const configDir = getConfigDir(projectDir);
|
|
49
|
+
const configPath = getConfigPath(projectDir);
|
|
50
|
+
// Ensure directory exists
|
|
51
|
+
if (!existsSync(configDir)) {
|
|
52
|
+
mkdirSync(configDir, { recursive: true });
|
|
53
|
+
}
|
|
54
|
+
const content = stringify(config, { indent: 2 });
|
|
55
|
+
writeFileSync(configPath, content, 'utf-8');
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Update a single field in project configuration
|
|
59
|
+
*/
|
|
60
|
+
export function updateProjectConfig(projectDir, key, value) {
|
|
61
|
+
const config = loadProjectConfig(projectDir);
|
|
62
|
+
config[key] = value;
|
|
63
|
+
saveProjectConfig(projectDir, config);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get current workflow from project config
|
|
67
|
+
*/
|
|
68
|
+
export function getCurrentWorkflow(projectDir) {
|
|
69
|
+
const config = loadProjectConfig(projectDir);
|
|
70
|
+
return config.workflow || 'default';
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Set current workflow in project config
|
|
74
|
+
*/
|
|
75
|
+
export function setCurrentWorkflow(projectDir, workflow) {
|
|
76
|
+
updateProjectConfig(projectDir, 'workflow', workflow);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Get verbose mode from project config
|
|
80
|
+
*/
|
|
81
|
+
export function isVerboseMode(projectDir) {
|
|
82
|
+
const config = loadProjectConfig(projectDir);
|
|
83
|
+
return config.verbose === true;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=projectConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectConfig.js","sourceRoot":"","sources":["../../src/config/projectConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAcxC,oCAAoC;AACpC,MAAM,sBAAsB,GAAuB;IACjD,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF;;;GAGG;AACH,SAAS,YAAY,CAAC,UAAkB;IACtC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,SAAS,aAAa,CAAC,UAAkB;IACvC,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IAClD,MAAM,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IAE7C,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,GAAG,sBAAsB,EAAE,CAAC;IACvC,CAAC;IAED,IAAI,CAAC;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UAAkB,EAAE,QAAgB;IACrE,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,MAAM,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session storage for takt
|
|
3
|
+
*
|
|
4
|
+
* Manages agent sessions and input history persistence.
|
|
5
|
+
*/
|
|
6
|
+
/** Get path for storing input history */
|
|
7
|
+
export declare function getInputHistoryPath(projectDir: string): string;
|
|
8
|
+
/** Maximum number of input history entries to keep */
|
|
9
|
+
export declare const MAX_INPUT_HISTORY = 100;
|
|
10
|
+
/** Load input history */
|
|
11
|
+
export declare function loadInputHistory(projectDir: string): string[];
|
|
12
|
+
/** Save input history (atomic write) */
|
|
13
|
+
export declare function saveInputHistory(projectDir: string, history: string[]): void;
|
|
14
|
+
/** Add an entry to input history */
|
|
15
|
+
export declare function addToInputHistory(projectDir: string, input: string): void;
|
|
16
|
+
/** Agent session data for persistence */
|
|
17
|
+
export interface AgentSessionData {
|
|
18
|
+
agentSessions: Record<string, string>;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
/** Get path for storing agent sessions */
|
|
22
|
+
export declare function getAgentSessionsPath(projectDir: string): string;
|
|
23
|
+
/** Load saved agent sessions */
|
|
24
|
+
export declare function loadAgentSessions(projectDir: string): Record<string, string>;
|
|
25
|
+
/** Save agent sessions (atomic write) */
|
|
26
|
+
export declare function saveAgentSessions(projectDir: string, sessions: Record<string, string>): void;
|
|
27
|
+
/**
|
|
28
|
+
* Update a single agent session atomically.
|
|
29
|
+
* Uses read-modify-write with atomic file operations.
|
|
30
|
+
*/
|
|
31
|
+
export declare function updateAgentSession(projectDir: string, agentName: string, sessionId: string): void;
|
|
32
|
+
/** Clear all saved agent sessions */
|
|
33
|
+
export declare function clearAgentSessions(projectDir: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Get the Claude CLI project session directory path.
|
|
36
|
+
* Claude CLI stores sessions in ~/.claude/projects/{encoded-project-path}/
|
|
37
|
+
*/
|
|
38
|
+
export declare function getClaudeProjectSessionsDir(projectDir: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Clear Claude CLI project sessions.
|
|
41
|
+
* Removes all session files (*.jsonl) from the project's session directory.
|
|
42
|
+
*/
|
|
43
|
+
export declare function clearClaudeProjectSessions(projectDir: string): void;
|
|
44
|
+
//# sourceMappingURL=sessionStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionStore.d.ts","sourceRoot":"","sources":["../../src/config/sessionStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8BH,yCAAyC;AACzC,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,sDAAsD;AACtD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,yBAAyB;AACzB,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAqB7D;AAED,wCAAwC;AACxC,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAM5E;AAED,oCAAoC;AACpC,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAMzE;AAID,yCAAyC;AACzC,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,0CAA0C;AAC1C,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,gCAAgC;AAChC,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAY5E;AAED,yCAAyC;AACzC,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,IAAI,CAsBN;AAED,qCAAqC;AACrC,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAW3D;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAMtE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAkCnE"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session storage for takt
|
|
3
|
+
*
|
|
4
|
+
* Manages agent sessions and input history persistence.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, readFileSync, writeFileSync, renameSync, unlinkSync, readdirSync, rmSync } from 'node:fs';
|
|
7
|
+
import { join, resolve } from 'node:path';
|
|
8
|
+
import { homedir } from 'node:os';
|
|
9
|
+
import { getProjectConfigDir, ensureDir } from './paths.js';
|
|
10
|
+
/**
|
|
11
|
+
* Write file atomically using temp file + rename.
|
|
12
|
+
* This prevents corruption when multiple processes write simultaneously.
|
|
13
|
+
*/
|
|
14
|
+
function writeFileAtomic(filePath, content) {
|
|
15
|
+
const tempPath = `${filePath}.${process.pid}.${Date.now()}.tmp`;
|
|
16
|
+
try {
|
|
17
|
+
writeFileSync(tempPath, content, 'utf-8');
|
|
18
|
+
renameSync(tempPath, filePath);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
try {
|
|
22
|
+
if (existsSync(tempPath)) {
|
|
23
|
+
unlinkSync(tempPath);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// Ignore cleanup errors
|
|
28
|
+
}
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// ============ Input History ============
|
|
33
|
+
/** Get path for storing input history */
|
|
34
|
+
export function getInputHistoryPath(projectDir) {
|
|
35
|
+
return join(getProjectConfigDir(projectDir), 'input_history');
|
|
36
|
+
}
|
|
37
|
+
/** Maximum number of input history entries to keep */
|
|
38
|
+
export const MAX_INPUT_HISTORY = 100;
|
|
39
|
+
/** Load input history */
|
|
40
|
+
export function loadInputHistory(projectDir) {
|
|
41
|
+
const path = getInputHistoryPath(projectDir);
|
|
42
|
+
if (existsSync(path)) {
|
|
43
|
+
try {
|
|
44
|
+
const content = readFileSync(path, 'utf-8');
|
|
45
|
+
return content
|
|
46
|
+
.split('\n')
|
|
47
|
+
.filter((line) => line.trim())
|
|
48
|
+
.map((line) => {
|
|
49
|
+
try {
|
|
50
|
+
return JSON.parse(line);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
.filter((entry) => entry !== null);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
/** Save input history (atomic write) */
|
|
65
|
+
export function saveInputHistory(projectDir, history) {
|
|
66
|
+
const path = getInputHistoryPath(projectDir);
|
|
67
|
+
ensureDir(getProjectConfigDir(projectDir));
|
|
68
|
+
const trimmed = history.slice(-MAX_INPUT_HISTORY);
|
|
69
|
+
const content = trimmed.map((entry) => JSON.stringify(entry)).join('\n');
|
|
70
|
+
writeFileAtomic(path, content);
|
|
71
|
+
}
|
|
72
|
+
/** Add an entry to input history */
|
|
73
|
+
export function addToInputHistory(projectDir, input) {
|
|
74
|
+
const history = loadInputHistory(projectDir);
|
|
75
|
+
if (history[history.length - 1] !== input) {
|
|
76
|
+
history.push(input);
|
|
77
|
+
}
|
|
78
|
+
saveInputHistory(projectDir, history);
|
|
79
|
+
}
|
|
80
|
+
/** Get path for storing agent sessions */
|
|
81
|
+
export function getAgentSessionsPath(projectDir) {
|
|
82
|
+
return join(getProjectConfigDir(projectDir), 'agent_sessions.json');
|
|
83
|
+
}
|
|
84
|
+
/** Load saved agent sessions */
|
|
85
|
+
export function loadAgentSessions(projectDir) {
|
|
86
|
+
const path = getAgentSessionsPath(projectDir);
|
|
87
|
+
if (existsSync(path)) {
|
|
88
|
+
try {
|
|
89
|
+
const content = readFileSync(path, 'utf-8');
|
|
90
|
+
const data = JSON.parse(content);
|
|
91
|
+
return data.agentSessions || {};
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return {};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {};
|
|
98
|
+
}
|
|
99
|
+
/** Save agent sessions (atomic write) */
|
|
100
|
+
export function saveAgentSessions(projectDir, sessions) {
|
|
101
|
+
const path = getAgentSessionsPath(projectDir);
|
|
102
|
+
ensureDir(getProjectConfigDir(projectDir));
|
|
103
|
+
const data = {
|
|
104
|
+
agentSessions: sessions,
|
|
105
|
+
updatedAt: new Date().toISOString(),
|
|
106
|
+
};
|
|
107
|
+
writeFileAtomic(path, JSON.stringify(data, null, 2));
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Update a single agent session atomically.
|
|
111
|
+
* Uses read-modify-write with atomic file operations.
|
|
112
|
+
*/
|
|
113
|
+
export function updateAgentSession(projectDir, agentName, sessionId) {
|
|
114
|
+
const path = getAgentSessionsPath(projectDir);
|
|
115
|
+
ensureDir(getProjectConfigDir(projectDir));
|
|
116
|
+
let sessions = {};
|
|
117
|
+
if (existsSync(path)) {
|
|
118
|
+
try {
|
|
119
|
+
const content = readFileSync(path, 'utf-8');
|
|
120
|
+
const data = JSON.parse(content);
|
|
121
|
+
sessions = data.agentSessions || {};
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
sessions = {};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
sessions[agentName] = sessionId;
|
|
128
|
+
const data = {
|
|
129
|
+
agentSessions: sessions,
|
|
130
|
+
updatedAt: new Date().toISOString(),
|
|
131
|
+
};
|
|
132
|
+
writeFileAtomic(path, JSON.stringify(data, null, 2));
|
|
133
|
+
}
|
|
134
|
+
/** Clear all saved agent sessions */
|
|
135
|
+
export function clearAgentSessions(projectDir) {
|
|
136
|
+
const path = getAgentSessionsPath(projectDir);
|
|
137
|
+
ensureDir(getProjectConfigDir(projectDir));
|
|
138
|
+
const data = {
|
|
139
|
+
agentSessions: {},
|
|
140
|
+
updatedAt: new Date().toISOString(),
|
|
141
|
+
};
|
|
142
|
+
writeFileAtomic(path, JSON.stringify(data, null, 2));
|
|
143
|
+
// Also clear Claude CLI project sessions
|
|
144
|
+
clearClaudeProjectSessions(projectDir);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get the Claude CLI project session directory path.
|
|
148
|
+
* Claude CLI stores sessions in ~/.claude/projects/{encoded-project-path}/
|
|
149
|
+
*/
|
|
150
|
+
export function getClaudeProjectSessionsDir(projectDir) {
|
|
151
|
+
const resolvedPath = resolve(projectDir);
|
|
152
|
+
// Claude CLI encodes the path by replacing '/' and other special chars with '-'
|
|
153
|
+
// Based on observed behavior: /Users/takt -> -Users-takt
|
|
154
|
+
const encodedPath = resolvedPath.replace(/[/\\_ ]/g, '-');
|
|
155
|
+
return join(homedir(), '.claude', 'projects', encodedPath);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Clear Claude CLI project sessions.
|
|
159
|
+
* Removes all session files (*.jsonl) from the project's session directory.
|
|
160
|
+
*/
|
|
161
|
+
export function clearClaudeProjectSessions(projectDir) {
|
|
162
|
+
const sessionDir = getClaudeProjectSessionsDir(projectDir);
|
|
163
|
+
if (!existsSync(sessionDir)) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
try {
|
|
167
|
+
const entries = readdirSync(sessionDir, { withFileTypes: true });
|
|
168
|
+
for (const entry of entries) {
|
|
169
|
+
const fullPath = join(sessionDir, entry.name);
|
|
170
|
+
// Remove .jsonl session files and sessions-index.json
|
|
171
|
+
if (entry.isFile() && (entry.name.endsWith('.jsonl') || entry.name === 'sessions-index.json')) {
|
|
172
|
+
try {
|
|
173
|
+
unlinkSync(fullPath);
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
// Ignore individual file deletion errors
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Remove session subdirectories (some sessions have associated directories)
|
|
180
|
+
if (entry.isDirectory()) {
|
|
181
|
+
try {
|
|
182
|
+
rmSync(fullPath, { recursive: true, force: true });
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
// Ignore directory deletion errors
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
// Ignore errors if we can't read the directory
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=sessionStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionStore.js","sourceRoot":"","sources":["../../src/config/sessionStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC/G,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5D;;;GAGG;AACH,SAAS,eAAe,CAAC,QAAgB,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,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAAkB;IAC3D,MAAM,UAAU,GAAG,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAE3D,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,WAAW,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAEjE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAE9C,sDAAsD;YACtD,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,qBAAqB,CAAC,EAAE,CAAC;gBAC9F,IAAI,CAAC;oBACH,UAAU,CAAC,QAAQ,CAAC,CAAC;gBACvB,CAAC;gBAAC,MAAM,CAAC;oBACP,yCAAyC;gBAC3C,CAAC;YACH,CAAC;YAED,4EAA4E;YAC5E,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,IAAI,CAAC;oBACH,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;gBACrD,CAAC;gBAAC,MAAM,CAAC;oBACP,mCAAmC;gBACrC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,+CAA+C;IACjD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow configuration loader
|
|
3
|
+
*
|
|
4
|
+
* Loads workflows from ~/.takt/workflows/ directory only.
|
|
5
|
+
*/
|
|
6
|
+
import type { WorkflowConfig } from '../models/types.js';
|
|
7
|
+
/** Get builtin workflow by name */
|
|
8
|
+
export declare function getBuiltinWorkflow(name: string): WorkflowConfig | null;
|
|
9
|
+
/**
|
|
10
|
+
* Load a workflow from a YAML file.
|
|
11
|
+
* @param filePath Path to the workflow YAML file
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadWorkflowFromFile(filePath: string): WorkflowConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Load workflow by name from global directory.
|
|
16
|
+
* Looks for ~/.takt/workflows/{name}.yaml
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadWorkflow(name: string): WorkflowConfig | null;
|
|
19
|
+
/** Load all workflows with descriptions (for switch command) */
|
|
20
|
+
export declare function loadAllWorkflows(): Map<string, WorkflowConfig>;
|
|
21
|
+
/** List available workflows from global directory (~/.takt/workflows/) */
|
|
22
|
+
export declare function listWorkflows(): string[];
|
|
23
|
+
//# sourceMappingURL=workflowLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowLoader.d.ts","sourceRoot":"","sources":["../../src/config/workflowLoader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,oBAAoB,CAAC;AAGvE,mCAAmC;AACnC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAItE;AAqED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAQrE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAQhE;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,IAAI,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAuB9D;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAiBxC"}
|