@within-7/minto 0.3.6 → 0.3.10

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.
Files changed (238) hide show
  1. package/{cli.js → cli.cjs} +25 -23
  2. package/dist/commands/agents/AgentsCommand.js +459 -655
  3. package/dist/commands/agents/AgentsCommand.js.map +2 -2
  4. package/dist/commands/agents/types.js +1 -0
  5. package/dist/commands/agents/types.js.map +2 -2
  6. package/dist/commands/agents/utils/fileOperations.js +96 -36
  7. package/dist/commands/agents/utils/fileOperations.js.map +3 -3
  8. package/dist/commands/agents/utils/index.js +3 -1
  9. package/dist/commands/agents/utils/index.js.map +2 -2
  10. package/dist/commands/context.js +54 -23
  11. package/dist/commands/context.js.map +2 -2
  12. package/dist/commands/export.js +673 -93
  13. package/dist/commands/export.js.map +2 -2
  14. package/dist/commands/language.js +110 -0
  15. package/dist/commands/language.js.map +7 -0
  16. package/dist/commands/mcp-interactive.js +419 -217
  17. package/dist/commands/mcp-interactive.js.map +2 -2
  18. package/dist/commands/model.js +415 -66
  19. package/dist/commands/model.js.map +2 -2
  20. package/dist/commands/new.js +56 -0
  21. package/dist/commands/new.js.map +7 -0
  22. package/dist/commands/permissions.js +75 -49
  23. package/dist/commands/permissions.js.map +2 -2
  24. package/dist/commands/plugin.js +882 -185
  25. package/dist/commands/plugin.js.map +3 -3
  26. package/dist/commands/resume.js +251 -16
  27. package/dist/commands/resume.js.map +2 -2
  28. package/dist/commands/sandbox.js +168 -70
  29. package/dist/commands/sandbox.js.map +2 -2
  30. package/dist/commands/sessions.js +224 -0
  31. package/dist/commands/sessions.js.map +7 -0
  32. package/dist/commands/setup.js +596 -109
  33. package/dist/commands/setup.js.map +2 -2
  34. package/dist/commands/stats.js +292 -0
  35. package/dist/commands/stats.js.map +7 -0
  36. package/dist/commands/status.js +75 -7
  37. package/dist/commands/status.js.map +2 -2
  38. package/dist/commands/undo.js +154 -180
  39. package/dist/commands/undo.js.map +2 -2
  40. package/dist/commands.js +6 -0
  41. package/dist/commands.js.map +2 -2
  42. package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js +3 -2
  43. package/dist/components/AskUserQuestionDialog/AskUserQuestionDialog.js.map +2 -2
  44. package/dist/components/Config.js +9 -8
  45. package/dist/components/Config.js.map +2 -2
  46. package/dist/components/HeaderBar.js +2 -1
  47. package/dist/components/HeaderBar.js.map +2 -2
  48. package/dist/components/Help.js +166 -32
  49. package/dist/components/Help.js.map +2 -2
  50. package/dist/components/HotkeyHelpPanel.js +46 -44
  51. package/dist/components/HotkeyHelpPanel.js.map +2 -2
  52. package/dist/components/InfoPanel/InfoPanel.js +123 -0
  53. package/dist/components/InfoPanel/InfoPanel.js.map +7 -0
  54. package/dist/components/InfoPanel/index.js +5 -0
  55. package/dist/components/InfoPanel/index.js.map +7 -0
  56. package/dist/components/InfoPanel/types.js +1 -0
  57. package/dist/components/InfoPanel/types.js.map +7 -0
  58. package/dist/components/Logo.js +5 -2
  59. package/dist/components/Logo.js.map +2 -2
  60. package/dist/components/MCPServerApprovalDialog.js +6 -5
  61. package/dist/components/MCPServerApprovalDialog.js.map +2 -2
  62. package/dist/components/MCPServerMultiselectDialog.js +5 -4
  63. package/dist/components/MCPServerMultiselectDialog.js.map +2 -2
  64. package/dist/components/MessageSelector.js +4 -3
  65. package/dist/components/MessageSelector.js.map +2 -2
  66. package/dist/components/ModelConfig.js +13 -12
  67. package/dist/components/ModelConfig.js.map +2 -2
  68. package/dist/components/ModelListManager.js +4 -3
  69. package/dist/components/ModelListManager.js.map +2 -2
  70. package/dist/components/ModelSelector/BrandTextInput.js +43 -0
  71. package/dist/components/ModelSelector/BrandTextInput.js.map +7 -0
  72. package/dist/components/ModelSelector/ModelSelector.js +419 -501
  73. package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
  74. package/dist/components/ModelSelector/WizardContainer.js +45 -0
  75. package/dist/components/ModelSelector/WizardContainer.js.map +7 -0
  76. package/dist/components/ModelSelector/index.js +1 -3
  77. package/dist/components/ModelSelector/index.js.map +2 -2
  78. package/dist/components/PromptInput.js +77 -44
  79. package/dist/components/PromptInput.js.map +2 -2
  80. package/dist/components/SensitiveFileWarning.js +12 -8
  81. package/dist/components/SensitiveFileWarning.js.map +2 -2
  82. package/dist/components/SimpleSelector/SimpleSelector.js +154 -0
  83. package/dist/components/SimpleSelector/SimpleSelector.js.map +7 -0
  84. package/dist/components/SimpleSelector/index.js +5 -0
  85. package/dist/components/SimpleSelector/index.js.map +7 -0
  86. package/dist/components/SimpleSelector/types.js +1 -0
  87. package/dist/components/SimpleSelector/types.js.map +7 -0
  88. package/dist/components/StatusOverlayContent.js +21 -0
  89. package/dist/components/StatusOverlayContent.js.map +7 -0
  90. package/dist/components/TabbedListView/ScrollableList.js +117 -0
  91. package/dist/components/TabbedListView/ScrollableList.js.map +7 -0
  92. package/dist/components/TabbedListView/SearchInput.js +23 -0
  93. package/dist/components/TabbedListView/SearchInput.js.map +7 -0
  94. package/dist/components/TabbedListView/TabBar.js +20 -0
  95. package/dist/components/TabbedListView/TabBar.js.map +7 -0
  96. package/dist/components/TabbedListView/TabbedListView.js +246 -0
  97. package/dist/components/TabbedListView/TabbedListView.js.map +7 -0
  98. package/dist/components/TabbedListView/index.js +11 -0
  99. package/dist/components/TabbedListView/index.js.map +7 -0
  100. package/dist/components/TabbedListView/types.js +1 -0
  101. package/dist/components/TabbedListView/types.js.map +7 -0
  102. package/dist/components/TodoChangeBlock.js +6 -5
  103. package/dist/components/TodoChangeBlock.js.map +3 -3
  104. package/dist/components/TodoPanel.js +6 -3
  105. package/dist/components/TodoPanel.js.map +3 -3
  106. package/dist/components/TrustDialog.js +6 -5
  107. package/dist/components/TrustDialog.js.map +2 -2
  108. package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js +2 -1
  109. package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js.map +2 -2
  110. package/dist/constants/macros.js +1 -1
  111. package/dist/constants/macros.js.map +1 -1
  112. package/dist/constants/product.js +2 -2
  113. package/dist/constants/product.js.map +1 -1
  114. package/dist/constants/prompts.js +17 -0
  115. package/dist/constants/prompts.js.map +2 -2
  116. package/dist/constants/toolInputExamples.js +5 -1
  117. package/dist/constants/toolInputExamples.js.map +2 -2
  118. package/dist/core/backupHook.js +29 -0
  119. package/dist/core/backupHook.js.map +7 -0
  120. package/dist/core/config/defaults.js +8 -2
  121. package/dist/core/config/defaults.js.map +2 -2
  122. package/dist/core/config/schema.js +14 -2
  123. package/dist/core/config/schema.js.map +2 -2
  124. package/dist/core/costTracker.js +0 -16
  125. package/dist/core/costTracker.js.map +2 -2
  126. package/dist/core/tokenStatsManager.js +5 -0
  127. package/dist/core/tokenStatsManager.js.map +2 -2
  128. package/dist/cost-tracker.js +0 -16
  129. package/dist/cost-tracker.js.map +2 -2
  130. package/dist/entrypoints/bootstrap.js +56 -0
  131. package/dist/entrypoints/bootstrap.js.map +7 -0
  132. package/dist/entrypoints/cli.js +164 -23
  133. package/dist/entrypoints/cli.js.map +3 -3
  134. package/dist/history.js +75 -15
  135. package/dist/history.js.map +2 -2
  136. package/dist/i18n/index.js +2 -2
  137. package/dist/i18n/index.js.map +2 -2
  138. package/dist/i18n/locales/en.js +582 -1
  139. package/dist/i18n/locales/en.js.map +2 -2
  140. package/dist/i18n/locales/zh-CN.js +582 -1
  141. package/dist/i18n/locales/zh-CN.js.map +2 -2
  142. package/dist/i18n/types.js.map +1 -1
  143. package/dist/index.js +1 -1
  144. package/dist/index.js.map +2 -2
  145. package/dist/messages.js +11 -0
  146. package/dist/messages.js.map +2 -2
  147. package/dist/permissions.js.map +2 -2
  148. package/dist/query.js +9 -0
  149. package/dist/query.js.map +2 -2
  150. package/dist/screens/REPL.js +45 -7
  151. package/dist/screens/REPL.js.map +2 -2
  152. package/dist/services/customCommands.js +44 -16
  153. package/dist/services/customCommands.js.map +2 -2
  154. package/dist/services/plugins/lspServers.js +1 -1
  155. package/dist/services/plugins/lspServers.js.map +2 -2
  156. package/dist/services/plugins/pluginRuntime.js +2 -1
  157. package/dist/services/plugins/pluginRuntime.js.map +2 -2
  158. package/dist/services/plugins/pluginValidation.js +10 -3
  159. package/dist/services/plugins/pluginValidation.js.map +2 -2
  160. package/dist/services/plugins/skillMarketplace.js +16 -8
  161. package/dist/services/plugins/skillMarketplace.js.map +2 -2
  162. package/dist/services/systemReminder.js +17 -6
  163. package/dist/services/systemReminder.js.map +2 -2
  164. package/dist/tools/FileEditTool/FileEditTool.js +7 -0
  165. package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
  166. package/dist/tools/FileWriteTool/FileWriteTool.js +7 -0
  167. package/dist/tools/FileWriteTool/FileWriteTool.js.map +2 -2
  168. package/dist/tools/MultiEditTool/MultiEditTool.js +7 -0
  169. package/dist/tools/MultiEditTool/MultiEditTool.js.map +2 -2
  170. package/dist/tools/NotebookEditTool/NotebookEditTool.js +2 -0
  171. package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +2 -2
  172. package/dist/tools/TaskTool/TaskTool.js +179 -1
  173. package/dist/tools/TaskTool/TaskTool.js.map +2 -2
  174. package/dist/tools/TodoWriteTool/prompt.js +21 -0
  175. package/dist/tools/TodoWriteTool/prompt.js.map +2 -2
  176. package/dist/tools/URLFetcherTool/prompt.js +14 -9
  177. package/dist/tools/URLFetcherTool/prompt.js.map +2 -2
  178. package/dist/tools/WebSearchTool/prompt.js +12 -6
  179. package/dist/tools/WebSearchTool/prompt.js.map +2 -2
  180. package/dist/types/PermissionMode.js +30 -1
  181. package/dist/types/PermissionMode.js.map +2 -2
  182. package/dist/types/plugin.js +2 -4
  183. package/dist/types/plugin.js.map +2 -2
  184. package/dist/utils/agentHookExecutor.js +103 -0
  185. package/dist/utils/agentHookExecutor.js.map +7 -0
  186. package/dist/utils/agentLoader.js +272 -32
  187. package/dist/utils/agentLoader.js.map +2 -2
  188. package/dist/utils/agentMemory.js +134 -0
  189. package/dist/utils/agentMemory.js.map +7 -0
  190. package/dist/utils/claudeCodeSync.js +439 -0
  191. package/dist/utils/claudeCodeSync.js.map +7 -0
  192. package/dist/utils/config.js +52 -24
  193. package/dist/utils/config.js.map +2 -2
  194. package/dist/utils/configPaths.js +199 -0
  195. package/dist/utils/configPaths.js.map +7 -0
  196. package/dist/utils/execFileNoThrow.js +2 -1
  197. package/dist/utils/execFileNoThrow.js.map +2 -2
  198. package/dist/utils/historyManager.js +234 -0
  199. package/dist/utils/historyManager.js.map +7 -0
  200. package/dist/utils/marketplaceManager.js +80 -43
  201. package/dist/utils/marketplaceManager.js.map +2 -2
  202. package/dist/utils/messages.js +13 -8
  203. package/dist/utils/messages.js.map +2 -2
  204. package/dist/utils/migration/index.js +37 -0
  205. package/dist/utils/migration/index.js.map +7 -0
  206. package/dist/utils/migration/migrateHistory.js +273 -0
  207. package/dist/utils/migration/migrateHistory.js.map +7 -0
  208. package/dist/utils/migration/migrateTodos.js +323 -0
  209. package/dist/utils/migration/migrateTodos.js.map +7 -0
  210. package/dist/utils/pasteCache.js +309 -0
  211. package/dist/utils/pasteCache.js.map +7 -0
  212. package/dist/utils/pluginInstaller.js +34 -24
  213. package/dist/utils/pluginInstaller.js.map +2 -2
  214. package/dist/utils/pluginLoader.js +54 -28
  215. package/dist/utils/pluginLoader.js.map +2 -2
  216. package/dist/utils/repoFetcher.js +110 -0
  217. package/dist/utils/repoFetcher.js.map +7 -0
  218. package/dist/utils/sessionIndex.js +192 -0
  219. package/dist/utils/sessionIndex.js.map +7 -0
  220. package/dist/utils/sessionTracker.js +170 -0
  221. package/dist/utils/sessionTracker.js.map +7 -0
  222. package/dist/utils/skillLoader.js +103 -5
  223. package/dist/utils/skillLoader.js.map +2 -2
  224. package/dist/utils/stats.js +417 -0
  225. package/dist/utils/stats.js.map +7 -0
  226. package/dist/utils/stringSubstitution.js +106 -0
  227. package/dist/utils/stringSubstitution.js.map +7 -0
  228. package/dist/utils/teamConfig.js +156 -14
  229. package/dist/utils/teamConfig.js.map +2 -2
  230. package/dist/utils/terminal.js +1 -1
  231. package/dist/utils/terminal.js.map +2 -2
  232. package/dist/utils/todoStorage.js +51 -19
  233. package/dist/utils/todoStorage.js.map +2 -2
  234. package/dist/utils/tooling/safeRender.js.map +2 -2
  235. package/dist/version.js +2 -2
  236. package/dist/version.js.map +1 -1
  237. package/package.json +71 -28
  238. package/scripts/{postinstall.js → postinstall.cjs} +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/tools/TaskTool/TaskTool.tsx"],
4
- "sourcesContent": ["import { TextBlock } from '@anthropic-ai/sdk/resources/index.mjs'\nimport chalk from 'chalk'\nimport { last, memoize } from 'lodash-es'\nimport { EOL } from 'os'\nimport React, { useState, useEffect } from 'react'\nimport { Box, Text } from 'ink'\nimport { z } from 'zod'\nimport { Tool, ValidationResult } from '@tool'\nimport { FallbackToolUseRejectedMessage } from '@components/FallbackToolUseRejectedMessage'\nimport { getAgentPrompt } from '@constants/prompts'\nimport { getContext } from '@context'\nimport { hasPermissionsToUseTool } from '@permissions'\nimport { AssistantMessage, Message as MessageType, query } from '@query'\nimport { formatDuration, formatNumber } from '@utils/format'\nimport {\n getMessagesPath,\n getNextAvailableLogSidechainNumber,\n overwriteLog,\n logError,\n} from '@utils/log'\nimport { applyMarkdown } from '@utils/markdown'\nimport {\n createAssistantMessage,\n createUserMessage,\n getLastAssistantMessageId,\n INTERRUPT_MESSAGE,\n normalizeMessages,\n} from '@utils/messages'\nimport { getModelManager } from '@utils/model'\nimport { getMaxThinkingTokens } from '@utils/thinking'\nimport { getTheme } from '@utils/theme'\nimport { generateAgentId } from '@utils/agentStorage'\nimport { debug as debugLogger } from '@utils/debugLogger'\nimport { getTaskTools, getPrompt } from './prompt'\nimport { TOOL_NAME } from './constants'\nimport {\n getActiveAgents,\n getAgentByType,\n getAvailableAgentTypes,\n} from '@utils/agentLoader'\nimport {\n createAgentTranscript,\n getAgentTranscript,\n getResumableTranscript,\n appendMessageToTranscript,\n updateAgentTranscript,\n completeAgentTranscript,\n failAgentTranscript,\n interruptAgentTranscript,\n canResumeTranscript,\n registerToolUseAgent,\n type AgentTranscript,\n} from '@utils/agentTranscripts'\n// Background agent imports removed - run_in_background feature deprecated\nimport { UserFriendlyError, formatErrorForUser } from '@utils/userFriendlyError'\nimport {\n pushAgentContext,\n popAgentContext,\n cleanupAgentStreamingState,\n} from '@components/Spinner'\n\nconst inputSchema = z.object({\n description: z\n .string()\n .describe('A short (3-5 word) description of the task'),\n prompt: z.string().describe('The task for the agent to perform'),\n model_name: z\n .string()\n .optional()\n .describe(\n 'Optional: Specific model name to use for this task. If not provided, uses the default task model pointer.',\n ),\n model: z\n .enum(['sonnet', 'opus', 'haiku'])\n .optional()\n .describe(\n 'Optional model hint for this agent. Maps to configured model pointers: sonnet\u2192main, opus\u2192reasoning, haiku\u2192quick. If not specified, uses the task model pointer. Prefer haiku for quick, straightforward tasks.',\n ),\n subagent_type: z\n .string()\n .optional()\n .describe(\n 'The specialized agent type to use. MUST be an exact name from the available agents list in the tool description. Defaults to \"general-purpose\" if not specified.',\n ),\n resume: z\n .string()\n .optional()\n .describe(\n 'Optional agent ID to resume from. If provided, the agent will continue from the previous execution transcript.',\n ),\n max_turns: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Maximum number of agentic turns (API round-trips) before stopping. Used internally for warmup.',\n ),\n // run_in_background parameter removed - concurrent execution is automatic\n})\n\nexport const TaskTool = {\n async prompt({ safeMode }) {\n return await getPrompt(safeMode)\n },\n name: TOOL_NAME,\n async description() {\n // Dynamically load available agent types from plugins\n const availableTypes = await getAvailableAgentTypes()\n const typesList = availableTypes.join(', ')\n return `Launch a specialized agent to handle tasks autonomously. You MUST use an exact agent type name from this list: ${typesList}. Default to \"general-purpose\" if unsure.`\n },\n inputSchema,\n\n async *call(\n {\n description,\n prompt,\n model_name,\n model,\n subagent_type,\n resume,\n max_turns,\n },\n {\n abortController,\n options: { safeMode = false, forkNumber, messageLogName, verbose },\n readFileTimestamps,\n toolUseId,\n },\n ): AsyncGenerator<\n | { type: 'result'; data: TextBlock[]; resultForAssistant?: string }\n | {\n type: 'progress'\n content: any\n normalizedMessages?: any[]\n tools?: any[]\n },\n void,\n unknown\n > {\n const startTime = Date.now()\n\n // Default to general-purpose if no subagent_type specified\n const agentType = subagent_type || 'general-purpose'\n\n // Handle resume: check if we're resuming from a previous transcript\n let resumedTranscript: AgentTranscript | null = null\n let agentId: string\n\n if (resume) {\n resumedTranscript = getResumableTranscript(resume)\n if (!resumedTranscript) {\n yield {\n type: 'result',\n data: [\n {\n type: 'text',\n text: `Cannot resume agent '${resume}': transcript not found or not resumable (status must be 'running' or 'interrupted')`,\n },\n ] as TextBlock[],\n resultForAssistant: `Cannot resume agent '${resume}': transcript not found or not resumable`,\n }\n return\n }\n agentId = resume\n debugLogger.info('TASK_AGENT_RESUMING', {\n agentId,\n agentType: resumedTranscript.agentType,\n messageCount: resumedTranscript.messages.length,\n previousStatus: resumedTranscript.status,\n })\n } else {\n agentId = generateAgentId()\n }\n\n // Register toolUseId -> agentId mapping for UI association\n if (toolUseId) {\n registerToolUseAgent(toolUseId, agentId)\n }\n\n // \uD83D\uDD27 CRITICAL FIX: Track whether we've yielded a result to prevent UI stuck state\n let hasYieldedResult = false\n\n // Apply subagent configuration\n let effectivePrompt = prompt\n let effectiveModel = model_name || 'task'\n let toolFilter = null\n let temperature = undefined\n\n // Load agent configuration dynamically\n if (agentType) {\n const agentConfig = await getAgentByType(agentType)\n\n if (!agentConfig) {\n // If agent type not found, return helpful message instead of throwing\n const availableTypes = await getAvailableAgentTypes()\n const helpMessage = `Agent type '${agentType}' not found.\\n\\nAvailable agents:\\n${availableTypes.map(t => ` \u2022 ${t}`).join('\\n')}\\n\\nUse /agents command to manage agent configurations.`\n\n yield {\n type: 'result',\n data: [{ type: 'text', text: helpMessage }] as TextBlock[],\n resultForAssistant: helpMessage,\n }\n hasYieldedResult = true\n return\n }\n\n // Apply system prompt if configured\n if (agentConfig.systemPrompt) {\n effectivePrompt = `${agentConfig.systemPrompt}\\n\\n${prompt}`\n }\n\n // Apply model if not overridden by model_name parameter\n if (!model_name && agentConfig.model_name) {\n // Support inherit: keep pointer-based default\n if (agentConfig.model_name !== 'inherit') {\n effectiveModel = agentConfig.model_name as string\n }\n }\n\n // Store tool filter for later application\n toolFilter = agentConfig.tools\n\n // Note: temperature is not currently in our agent configs\n // but could be added in the future\n }\n\n // Apply model resolution with intelligent fallback\n // Priority: model_name (explicit) > model (alias) > agent config > task pointer > main model\n if (model) {\n // Model aliases are semantic hints, not hardcoded model names\n // Map to Minto's model pointer system for proper resolution\n const modelPointerMap: Record<string, string> = {\n sonnet: 'main', // Use main model for standard tasks\n opus: 'reasoning', // Use reasoning model for complex tasks\n haiku: 'quick', // Use quick model for fast tasks\n }\n\n const pointerType = modelPointerMap[model] || 'task'\n const modelManager = getModelManager()\n const resolvedModelName = modelManager.getModelName(pointerType as any)\n\n if (resolvedModelName) {\n effectiveModel = resolvedModelName\n }\n // If resolution fails, keep the previous effectiveModel (from agent config or 'task' default)\n }\n\n // Initialize messages: either resume from transcript or start fresh\n const messages: MessageType[] = resumedTranscript\n ? [...resumedTranscript.messages]\n : [createUserMessage(effectivePrompt)]\n\n let tools = await getTaskTools(safeMode)\n\n // Apply tool filtering if specified by subagent config\n if (toolFilter) {\n // Back-compat: ['*'] means all tools\n const isAllArray =\n Array.isArray(toolFilter) &&\n toolFilter.length === 1 &&\n toolFilter[0] === '*'\n if (toolFilter === '*' || isAllArray) {\n // no-op, keep all tools\n } else if (Array.isArray(toolFilter)) {\n tools = tools.filter(tool => toolFilter.includes(tool.name))\n }\n }\n\n // Model already resolved in effectiveModel variable above\n const modelToUse = effectiveModel\n\n // Display initial task information with separate progress lines\n if (resumedTranscript) {\n yield {\n type: 'progress',\n content: createAssistantMessage(\n `Resuming agent: ${agentType} (${agentId})`,\n ),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n\n yield {\n type: 'progress',\n content: createAssistantMessage(\n `Restored ${resumedTranscript.messages.length} messages, ${resumedTranscript.toolUseCount} tool uses`,\n ),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n } else {\n yield {\n type: 'progress',\n content: createAssistantMessage(`Starting agent: ${agentType}`),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n }\n\n yield {\n type: 'progress',\n content: createAssistantMessage(`Using model: ${modelToUse}`),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n\n yield {\n type: 'progress',\n content: createAssistantMessage(`Task: ${description}`),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n\n yield {\n type: 'progress',\n content: createAssistantMessage(\n `Prompt: ${prompt.length > 150 ? prompt.substring(0, 150) + '...' : prompt}`,\n ),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n\n const [taskPrompt, context, maxThinkingTokens] = await Promise.all([\n getAgentPrompt(),\n getContext(),\n getMaxThinkingTokens(messages),\n ])\n\n // Inject model context to prevent self-referential expert consultations\n taskPrompt.push(\n `\\nIMPORTANT: You are currently running as ${modelToUse}. You do not need to consult ${modelToUse} via AskExpertModel since you ARE ${modelToUse}. Complete tasks directly using your capabilities.`,\n )\n\n // Initialize tool use count (restore from transcript if resuming)\n let toolUseCount = resumedTranscript?.toolUseCount || 0\n\n const getSidechainNumber = memoize(() =>\n getNextAvailableLogSidechainNumber(messageLogName, forkNumber),\n )\n\n // Create or update transcript for this agent execution\n if (!resumedTranscript) {\n createAgentTranscript({\n agentId,\n agentType,\n toolUseId, // Include toolUseId for event-driven UI updates\n description,\n prompt,\n model: modelToUse,\n forkNumber,\n messageLogName,\n messages: [...messages],\n toolUseCount: 0,\n })\n } else {\n // Update transcript status to running when resuming\n appendMessageToTranscript(\n agentId,\n createUserMessage(`[Resumed] ${prompt}`),\n )\n }\n\n // Build query options, adding temperature if specified\n const queryOptions = {\n safeMode,\n forkNumber,\n messageLogName,\n tools,\n commands: [],\n verbose,\n maxThinkingTokens,\n model: modelToUse,\n }\n\n // Add temperature if specified by subagent config\n if (temperature !== undefined) {\n queryOptions['temperature'] = temperature\n }\n\n // \uD83D\uDD27 CRITICAL FIX: Wrap entire query execution in try-catch-finally\n // This ensures we ALWAYS yield a result, even if query() throws an error\n\n // Push agent context so streaming state is isolated for this subagent\n pushAgentContext(agentId)\n\n // Track turn count for max_turns limit\n let turnCount = 0\n\n try {\n for await (const message of query(\n messages,\n taskPrompt,\n context,\n hasPermissionsToUseTool,\n {\n abortController,\n options: queryOptions,\n messageId: getLastAssistantMessageId(messages),\n agentId,\n readFileTimestamps,\n setToolJSX: () => {}, // No-op implementation for TaskTool\n },\n )) {\n messages.push(message)\n\n // Persist message to transcript for resume capability\n appendMessageToTranscript(agentId, message)\n\n overwriteLog(\n getMessagesPath(messageLogName, forkNumber, getSidechainNumber()),\n messages.filter(_ => _.type !== 'progress'),\n )\n\n if (message.type !== 'assistant') {\n continue\n }\n\n // Increment turn count for each assistant message (API round-trip)\n turnCount++\n\n // Check max_turns limit\n if (max_turns && turnCount >= max_turns) {\n debugLogger.info('TASK_AGENT_MAX_TURNS_REACHED', {\n agentId,\n turnCount,\n max_turns,\n })\n // Break out of the query loop - will proceed to normal completion handling\n break\n }\n\n // Real-time token usage update for running task display\n if (message.message.usage) {\n updateAgentTranscript(agentId, {\n tokenUsage: {\n inputTokens: message.message.usage.input_tokens,\n outputTokens: message.message.usage.output_tokens,\n cacheReadTokens: message.message.usage.cache_read_input_tokens,\n cacheCreationTokens:\n message.message.usage.cache_creation_input_tokens,\n },\n })\n }\n\n const normalizedMessages = normalizeMessages(messages)\n\n // Process tool uses and text content for better visibility\n for (const content of message.message.content) {\n if (\n content.type === 'text' &&\n content.text &&\n content.text !== INTERRUPT_MESSAGE\n ) {\n // Show agent's reasoning/responses\n const preview =\n content.text.length > 200\n ? content.text.substring(0, 200) + '...'\n : content.text\n yield {\n type: 'progress',\n content: createAssistantMessage(`${preview}`),\n normalizedMessages,\n tools,\n }\n } else if (content.type === 'tool_use') {\n toolUseCount++\n\n // Show which tool is being used with agent context\n const toolMessage = normalizedMessages.find(\n _ =>\n _.type === 'assistant' &&\n _.message.content[0]?.type === 'tool_use' &&\n _.message.content[0].id === content.id,\n ) as AssistantMessage\n\n if (toolMessage) {\n // Clone and modify the message to show agent context\n const modifiedMessage = {\n ...toolMessage,\n message: {\n ...toolMessage.message,\n content: toolMessage.message.content.map(c => {\n if (c.type === 'tool_use' && c.id === content.id) {\n // Add agent context to tool name display\n return {\n ...c,\n name: c.name, // Keep original name, UI will handle display\n }\n }\n return c\n }),\n },\n }\n\n yield {\n type: 'progress',\n content: modifiedMessage,\n normalizedMessages,\n tools,\n }\n }\n }\n }\n }\n\n const normalizedMessages = normalizeMessages(messages)\n const lastMessage = last(messages)\n if (lastMessage?.type !== 'assistant') {\n throw new Error('Last message was not an assistant message')\n }\n\n // Calculate token usage for transcript\n const tokenUsage = {\n inputTokens: lastMessage.message.usage.input_tokens,\n outputTokens: lastMessage.message.usage.output_tokens,\n cacheReadTokens: lastMessage.message.usage.cache_read_input_tokens,\n cacheCreationTokens:\n lastMessage.message.usage.cache_creation_input_tokens,\n }\n\n // Check for interrupt\n const isInterrupted = lastMessage.message.content.some(\n _ => _.type === 'text' && _.text === INTERRUPT_MESSAGE,\n )\n\n if (isInterrupted) {\n // Mark transcript as interrupted (can be resumed later)\n interruptAgentTranscript(agentId)\n debugLogger.info('TASK_AGENT_INTERRUPTED', { agentId, toolUseCount })\n } else {\n // Mark transcript as completed\n completeAgentTranscript(agentId, tokenUsage)\n debugLogger.info('TASK_AGENT_COMPLETED', { agentId, toolUseCount })\n\n const result = [\n toolUseCount === 1 ? '1 tool use' : `${toolUseCount} tool uses`,\n formatNumber(\n (lastMessage.message.usage.cache_creation_input_tokens ?? 0) +\n (lastMessage.message.usage.cache_read_input_tokens ?? 0) +\n lastMessage.message.usage.input_tokens +\n lastMessage.message.usage.output_tokens,\n ) + ' tokens',\n formatDuration(Date.now() - startTime),\n ]\n yield {\n type: 'progress',\n content: createAssistantMessage(`Done (${result.join(' \u00B7 ')})`),\n normalizedMessages,\n tools,\n }\n }\n\n // Output is an AssistantMessage, but since TaskTool is a tool, it needs\n // to serialize its response to UserMessage-compatible content.\n const data = lastMessage.message.content.filter(_ => _.type === 'text')\n\n // Include agentId in result for potential resume\n const resultWithAgentId = isInterrupted\n ? `[Interrupted - Agent ID: ${agentId}]\\n${this.renderResultForAssistant(data)}`\n : this.renderResultForAssistant(data)\n\n yield {\n type: 'result',\n data,\n resultForAssistant: resultWithAgentId,\n }\n hasYieldedResult = true\n } catch (error) {\n // \uD83D\uDD27 CRITICAL: On error, we MUST yield a result to clear UI state\n const errorMessage =\n error instanceof Error ? error.message : String(error)\n\n // \uD83D\uDD27 FIX: Check if this is an AbortError (ESC interrupt)\n // AbortError indicates user interrupted, should mark as 'interrupted' not 'failed'\n const isAbortError =\n error instanceof Error &&\n (error.name === 'AbortError' ||\n error.message.includes('aborted') ||\n error.message.includes('abort'))\n\n if (isAbortError) {\n // Mark transcript as interrupted (can be resumed later)\n interruptAgentTranscript(agentId)\n debugLogger.info('TASK_AGENT_INTERRUPTED_BY_ABORT', {\n agentId,\n toolUseCount,\n })\n\n yield {\n type: 'result',\n data: [\n {\n type: 'text',\n text: `Task [${agentType}] interrupted\\n[Agent ID: ${agentId}]`,\n },\n ] as TextBlock[],\n resultForAssistant: `Task [${agentType}] interrupted by user\\n[Agent ID: ${agentId} - can be resumed]`,\n }\n } else {\n // Convert to user-friendly error for better UX\n const friendlyError =\n error instanceof UserFriendlyError\n ? error\n : new UserFriendlyError(error, {\n operation: 'agent task',\n model: agentType,\n })\n const friendlyMessage = friendlyError.getUserMessage()\n\n logError(`TaskTool [${agentType}] error: ${errorMessage}`)\n\n // Mark transcript as failed with friendly message\n failAgentTranscript(agentId, friendlyMessage)\n debugLogger.error('TASK_AGENT_FAILED', {\n agentId,\n error: errorMessage,\n errorId: friendlyError.id,\n })\n\n yield {\n type: 'result',\n data: [\n {\n type: 'text',\n text: `${friendlyMessage}\\n[Agent ID: ${agentId}]`,\n },\n ] as TextBlock[],\n resultForAssistant: `Task [${agentType}] failed: ${errorMessage}\\n[Agent ID: ${agentId} - can be resumed]`,\n }\n }\n hasYieldedResult = true\n } finally {\n // Pop agent context and clean up streaming state\n popAgentContext()\n cleanupAgentStreamingState(agentId)\n\n // \uD83D\uDD27 SAFETY NET: Ensure we always yield a result even in unexpected scenarios\n if (!hasYieldedResult) {\n // Mark as interrupted if we haven't yielded a result\n interruptAgentTranscript(agentId)\n\n yield {\n type: 'result',\n data: [\n {\n type: 'text',\n text: `Task [${agentType}] terminated unexpectedly\\n[Agent ID: ${agentId}]`,\n },\n ] as TextBlock[],\n resultForAssistant: `Task [${agentType}] terminated unexpectedly\\n[Agent ID: ${agentId} - can be resumed]`,\n }\n }\n }\n },\n\n isReadOnly() {\n return true // for now...\n },\n isConcurrencySafe() {\n return true // Task tool supports concurrent execution in official implementation\n },\n async validateInput(input, context) {\n if (!input.description || typeof input.description !== 'string') {\n return {\n result: false,\n message: 'Description is required and must be a string',\n }\n }\n if (!input.prompt || typeof input.prompt !== 'string') {\n return {\n result: false,\n message: 'Prompt is required and must be a string',\n }\n }\n\n // Model validation - similar to Edit tool error handling\n if (input.model_name) {\n const modelManager = getModelManager()\n const availableModels = modelManager.getAllAvailableModelNames()\n\n if (!availableModels.includes(input.model_name)) {\n return {\n result: false,\n message: `Model '${input.model_name}' does not exist. Available models: ${availableModels.join(', ')}`,\n meta: {\n model_name: input.model_name,\n availableModels,\n },\n }\n }\n }\n\n // Validate subagent_type if provided\n if (input.subagent_type) {\n const availableTypes = await getAvailableAgentTypes()\n if (!availableTypes.includes(input.subagent_type)) {\n return {\n result: false,\n message: `Agent type '${input.subagent_type}' does not exist. Available types: ${availableTypes.join(', ')}`,\n meta: {\n subagent_type: input.subagent_type,\n availableTypes,\n },\n }\n }\n }\n\n // Validate resume parameter if provided\n if (input.resume) {\n if (!canResumeTranscript(input.resume)) {\n return {\n result: false,\n message: `Cannot resume agent '${input.resume}': transcript not found or not resumable (status must be 'running' or 'interrupted')`,\n meta: {\n resume: input.resume,\n },\n }\n }\n }\n\n return { result: true }\n },\n async isEnabled() {\n return true\n },\n userFacingName(input?: any) {\n // Return agent name with proper prefix\n const agentType = input?.subagent_type || 'general-purpose'\n return `agent-${agentType}`\n },\n needsPermissions() {\n return false\n },\n renderResultForAssistant(data: TextBlock[]) {\n return data\n .map(block => (block.type === 'text' ? block.text : ''))\n .join('\\n')\n },\n renderToolUseMessage(\n { description, prompt, model_name, subagent_type },\n { verbose },\n ) {\n if (!description || !prompt) return null\n\n const modelManager = getModelManager()\n const defaultTaskModel = modelManager.getModelName('task')\n const actualModel = model_name || defaultTaskModel\n const agentType = subagent_type || 'general-purpose'\n const promptPreview =\n prompt.length > 80 ? prompt.substring(0, 80) + '...' : prompt\n\n const theme = getTheme()\n\n if (verbose) {\n return (\n <Box flexDirection=\"column\">\n <Text>\n [{agentType}] {actualModel}: {description}\n </Text>\n <Box\n paddingLeft={2}\n borderLeftStyle=\"single\"\n borderLeftColor={theme.secondaryBorder}\n >\n <Text color={theme.secondaryText}>{promptPreview}</Text>\n </Box>\n </Box>\n )\n }\n\n // Simple display: agent type, model and description\n return `[${agentType}] ${actualModel}: ${description}`\n },\n renderToolUseRejectedMessage() {\n return <FallbackToolUseRejectedMessage />\n },\n renderToolResultMessage(content, options?: { verbose?: boolean }) {\n const theme = getTheme()\n const verbose = options?.verbose ?? false\n\n // Guard against undefined or null content\n if (!content) {\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={theme.success}>Done</Text>\n </Box>\n )\n }\n\n if (Array.isArray(content)) {\n const textBlocks = content.filter(\n (block): block is { type: 'text'; text: string } =>\n block && block.type === 'text',\n )\n const totalLength = textBlocks.reduce(\n (sum, block) => sum + (block.text?.length || 0),\n 0,\n )\n // Use exact match for interrupt detection\n const isInterrupted = content.some(\n block =>\n block && block.type === 'text' && block.text === INTERRUPT_MESSAGE,\n )\n\n if (isInterrupted) {\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={theme.error}>Interrupted by user</Text>\n </Box>\n )\n }\n\n // Extract output content for display based on verbosity\n const outputText = textBlocks.map(b => b.text).join('\\n')\n\n // Determine how much content to show based on displayMode\n // minimal/compact (verbose=false): Just show \"Task completed (X characters)\"\n // detailed (verbose=true): Show preview of the actual output\n const getOutputPreview = () => {\n if (!verbose || !outputText) return null\n const maxLen = 500\n if (outputText.length <= maxLen) return outputText\n return outputText.substring(0, maxLen) + '...'\n }\n\n const outputPreview = getOutputPreview()\n\n return (\n <Box flexDirection=\"column\">\n <Box justifyContent=\"space-between\" width=\"100%\">\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={theme.success}>Done</Text>\n {textBlocks.length > 0 && verbose && (\n <Text color={theme.secondaryText}> ({totalLength} chars)</Text>\n )}\n </Box>\n </Box>\n {outputPreview && (\n <Box marginTop={1} paddingLeft={4}>\n <Text color={theme.mutedText}>{outputPreview}</Text>\n </Box>\n )}\n </Box>\n )\n }\n\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={theme.success}>Done</Text>\n </Box>\n )\n },\n} satisfies Tool<typeof inputSchema, TextBlock[]>\n"],
5
- "mappings": "AAEA,SAAS,MAAM,eAAe;AAE9B,OAAO,WAAoC;AAC3C,SAAS,KAAK,YAAY;AAC1B,SAAS,SAAS;AAElB,SAAS,sCAAsC;AAC/C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,+BAA+B;AACxC,SAAmD,aAAa;AAChE,SAAS,gBAAgB,oBAAoB;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,g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;AAEA,WACE,oCAAC,OAAI,eAAc,SACjB,oCAAC,YAAK,qBAAoB,GAC1B,oCAAC,QAAK,OAAO,MAAM,WAAS,MAAI,CAClC;AAAA,EAEJ;AACF;",
4
+ "sourcesContent": ["import { TextBlock } from '@anthropic-ai/sdk/resources/index.mjs'\nimport chalk from 'chalk'\nimport { last, memoize } from 'lodash-es'\nimport { EOL } from 'os'\nimport React, { useState, useEffect } from 'react'\nimport { Box, Text } from 'ink'\nimport { z } from 'zod'\nimport { Tool, ValidationResult } from '@tool'\nimport { FallbackToolUseRejectedMessage } from '@components/FallbackToolUseRejectedMessage'\nimport { getAgentPrompt } from '@constants/prompts'\nimport { getContext } from '@context'\nimport { hasPermissionsToUseTool } from '@permissions'\nimport { AssistantMessage, Message as MessageType, query } from '@query'\nimport { formatDuration, formatNumber } from '@utils/format'\nimport {\n getMessagesPath,\n getNextAvailableLogSidechainNumber,\n overwriteLog,\n logError,\n} from '@utils/log'\nimport { applyMarkdown } from '@utils/markdown'\nimport {\n createAssistantMessage,\n createUserMessage,\n getLastAssistantMessageId,\n INTERRUPT_MESSAGE,\n normalizeMessages,\n} from '@utils/messages'\nimport { getModelManager } from '@utils/model'\nimport { getMaxThinkingTokens } from '@utils/thinking'\nimport { getTheme } from '@utils/theme'\nimport { generateAgentId } from '@utils/agentStorage'\nimport { debug as debugLogger } from '@utils/debugLogger'\nimport { getTaskTools, getPrompt } from './prompt'\nimport { TOOL_NAME } from './constants'\nimport {\n getActiveAgents,\n getAgentByType,\n getAvailableAgentTypes,\n} from '@utils/agentLoader'\nimport {\n createAgentTranscript,\n getAgentTranscript,\n getResumableTranscript,\n appendMessageToTranscript,\n updateAgentTranscript,\n completeAgentTranscript,\n failAgentTranscript,\n interruptAgentTranscript,\n canResumeTranscript,\n registerToolUseAgent,\n type AgentTranscript,\n} from '@utils/agentTranscripts'\n// Background agent imports removed - run_in_background feature deprecated\nimport { UserFriendlyError, formatErrorForUser } from '@utils/userFriendlyError'\nimport {\n pushAgentContext,\n popAgentContext,\n cleanupAgentStreamingState,\n} from '@components/Spinner'\nimport {\n validateAgentPermission,\n MODE_CONFIGS,\n type PermissionMode,\n} from '@minto-types/PermissionMode'\nimport { executeAgentHooks, createHookContext } from '@utils/agentHookExecutor'\nimport {\n loadAgentMemory,\n saveAgentMemory,\n formatMemoryForPrompt,\n} from '@utils/agentMemory'\nimport { getSkill, loadSkillContent } from '@utils/skillLoader'\nimport { substituteVariables } from '@utils/stringSubstitution'\n\nconst inputSchema = z.object({\n description: z\n .string()\n .describe('A short (3-5 word) description of the task'),\n prompt: z.string().describe('The task for the agent to perform'),\n model_name: z\n .string()\n .optional()\n .describe(\n 'Optional: Specific model name to use for this task. If not provided, uses the default task model pointer.',\n ),\n model: z\n .enum(['sonnet', 'opus', 'haiku'])\n .optional()\n .describe(\n 'Optional model hint for this agent. Maps to configured model pointers: sonnet\u2192main, opus\u2192reasoning, haiku\u2192quick. If not specified, uses the task model pointer. Prefer haiku for quick, straightforward tasks.',\n ),\n subagent_type: z\n .string()\n .optional()\n .describe(\n 'The specialized agent type to use. MUST be an exact name from the available agents list in the tool description. Defaults to \"general-purpose\" if not specified.',\n ),\n resume: z\n .string()\n .optional()\n .describe(\n 'Optional agent ID to resume from. If provided, the agent will continue from the previous execution transcript.',\n ),\n max_turns: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'Maximum number of agentic turns (API round-trips) before stopping. Used internally for warmup.',\n ),\n // run_in_background parameter removed - concurrent execution is automatic\n})\n\nexport const TaskTool = {\n async prompt({ safeMode }) {\n return await getPrompt(safeMode)\n },\n name: TOOL_NAME,\n async description() {\n // Dynamically load available agent types from plugins\n const availableTypes = await getAvailableAgentTypes()\n const typesList = availableTypes.join(', ')\n return `Launch a specialized agent to handle tasks autonomously. You MUST use an exact agent type name from this list: ${typesList}. Default to \"general-purpose\" if unsure.`\n },\n inputSchema,\n\n async *call(\n {\n description,\n prompt,\n model_name,\n model,\n subagent_type,\n resume,\n max_turns,\n },\n {\n abortController,\n options: { safeMode = false, forkNumber, messageLogName, verbose },\n readFileTimestamps,\n toolUseId,\n },\n ): AsyncGenerator<\n | { type: 'result'; data: TextBlock[]; resultForAssistant?: string }\n | {\n type: 'progress'\n content: any\n normalizedMessages?: any[]\n tools?: any[]\n },\n void,\n unknown\n > {\n const startTime = Date.now()\n\n // Default to general-purpose if no subagent_type specified\n const agentType = subagent_type || 'general-purpose'\n\n // Handle resume: check if we're resuming from a previous transcript\n let resumedTranscript: AgentTranscript | null = null\n let agentId: string\n\n if (resume) {\n resumedTranscript = getResumableTranscript(resume)\n if (!resumedTranscript) {\n yield {\n type: 'result',\n data: [\n {\n type: 'text',\n text: `Cannot resume agent '${resume}': transcript not found or not resumable (status must be 'running' or 'interrupted')`,\n },\n ] as TextBlock[],\n resultForAssistant: `Cannot resume agent '${resume}': transcript not found or not resumable`,\n }\n return\n }\n agentId = resume\n debugLogger.info('TASK_AGENT_RESUMING', {\n agentId,\n agentType: resumedTranscript.agentType,\n messageCount: resumedTranscript.messages.length,\n previousStatus: resumedTranscript.status,\n })\n } else {\n agentId = generateAgentId()\n }\n\n // Register toolUseId -> agentId mapping for UI association\n if (toolUseId) {\n registerToolUseAgent(toolUseId, agentId)\n }\n\n // \uD83D\uDD27 CRITICAL FIX: Track whether we've yielded a result to prevent UI stuck state\n let hasYieldedResult = false\n\n // Apply subagent configuration\n let effectivePrompt = prompt\n let effectiveModel = model_name || 'task'\n let toolFilter = null\n let disallowedToolFilter: string[] | null = null // Claude Code spec: disallowedTools denylist\n let temperature = undefined\n let agentMaxThinkingTokens: number | undefined = undefined\n let effectivePermissionMode: PermissionMode = 'default'\n let loadedAgentConfig: Awaited<ReturnType<typeof getAgentByType>> = null\n\n // Load agent configuration dynamically\n if (agentType) {\n const agentConfig = await getAgentByType(agentType)\n\n if (!agentConfig) {\n // If agent type not found, return helpful message instead of throwing\n const availableTypes = await getAvailableAgentTypes()\n const helpMessage = `Agent type '${agentType}' not found.\\n\\nAvailable agents:\\n${availableTypes.map(t => ` \u2022 ${t}`).join('\\n')}\\n\\nUse /agents command to manage agent configurations.`\n\n yield {\n type: 'result',\n data: [{ type: 'text', text: helpMessage }] as TextBlock[],\n resultForAssistant: helpMessage,\n }\n hasYieldedResult = true\n return\n }\n\n // Store config for later use (hooks, memory, etc.)\n loadedAgentConfig = agentConfig\n\n // Apply system prompt if configured\n if (agentConfig.systemPrompt) {\n effectivePrompt = `${agentConfig.systemPrompt}\\n\\n${prompt}`\n }\n\n // Apply model if not overridden by model_name parameter\n if (!model_name && agentConfig.model_name) {\n // Support inherit: keep pointer-based default\n if (agentConfig.model_name !== 'inherit') {\n effectiveModel = agentConfig.model_name as string\n }\n }\n\n // Store tool filter for later application\n toolFilter = agentConfig.tools\n\n // Store disallowed tools filter for later application (Claude Code spec compliance)\n if (agentConfig.disallowedTools?.length) {\n disallowedToolFilter = agentConfig.disallowedTools\n }\n\n // Apply maxThinkingTokens if configured (Claude Code spec)\n if (agentConfig.maxThinkingTokens) {\n agentMaxThinkingTokens = agentConfig.maxThinkingTokens\n }\n\n // Validate and apply permission mode (Claude Code spec)\n // Agent permission cannot exceed session permission level\n if (agentConfig.permissionMode) {\n const sessionMode: PermissionMode = safeMode ? 'plan' : 'default'\n effectivePermissionMode = validateAgentPermission(\n agentConfig.permissionMode,\n sessionMode,\n )\n }\n\n // Load agent memory if configured (Claude Code spec)\n if (agentConfig.memory) {\n try {\n const memoryContent = await loadAgentMemory(\n agentConfig.agentType,\n agentConfig.memory,\n )\n if (memoryContent) {\n // Inject memory into system prompt\n effectivePrompt =\n formatMemoryForPrompt(memoryContent, agentConfig.agentType) +\n '\\n' +\n effectivePrompt\n }\n } catch (error) {\n debugLogger.warn('TASK_AGENT_MEMORY_LOAD_FAILED', {\n agentId,\n agentType,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n }\n\n // Preload skills if configured (Claude Code spec)\n if (agentConfig.skills?.length) {\n for (const skillName of agentConfig.skills) {\n try {\n const skill = getSkill(skillName)\n if (skill) {\n const skillContent = await loadSkillContent(skill)\n // Apply string substitution for skill content\n const substitutedContent = await substituteVariables(\n skillContent,\n '', // No arguments for preloaded skills\n { sessionId: agentId, cwd: process.cwd() },\n )\n effectivePrompt += `\\n\\n<preloaded-skill name=\"${skillName}\">\\n${substitutedContent}\\n</preloaded-skill>`\n }\n } catch (error) {\n debugLogger.warn('TASK_AGENT_SKILL_PRELOAD_FAILED', {\n agentId,\n skillName,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n }\n }\n\n // Execute onStart hooks if configured (Claude Code spec)\n if (agentConfig.hooks?.onStart?.length) {\n try {\n const hookContext = createHookContext({\n sessionId: agentId,\n agentId,\n agentType,\n })\n const hookResult = await executeAgentHooks(\n 'onStart',\n agentConfig,\n hookContext,\n )\n if (!hookResult.continue) {\n yield {\n type: 'result',\n data: [\n {\n type: 'text',\n text: `Agent ${agentType} blocked by onStart hook: ${hookResult.reason || 'Hook requested stop'}`,\n },\n ] as TextBlock[],\n resultForAssistant: `Agent blocked by onStart hook: ${hookResult.reason}`,\n }\n hasYieldedResult = true\n return\n }\n } catch (error) {\n debugLogger.warn('TASK_AGENT_ONSTART_HOOK_FAILED', {\n agentId,\n agentType,\n error: error instanceof Error ? error.message : String(error),\n })\n }\n }\n\n // Note: temperature is not currently in our agent configs\n // but could be added in the future\n }\n\n // Apply model resolution with intelligent fallback\n // Priority: model_name (explicit) > model (alias) > agent config > task pointer > main model\n if (model) {\n // Model aliases are semantic hints, not hardcoded model names\n // Map to Minto's model pointer system for proper resolution\n const modelPointerMap: Record<string, string> = {\n sonnet: 'main', // Use main model for standard tasks\n opus: 'reasoning', // Use reasoning model for complex tasks\n haiku: 'quick', // Use quick model for fast tasks\n }\n\n const pointerType = modelPointerMap[model] || 'task'\n const modelManager = getModelManager()\n const resolvedModelName = modelManager.getModelName(pointerType as any)\n\n if (resolvedModelName) {\n effectiveModel = resolvedModelName\n }\n // If resolution fails, keep the previous effectiveModel (from agent config or 'task' default)\n }\n\n // Initialize messages: either resume from transcript or start fresh\n const messages: MessageType[] = resumedTranscript\n ? [...resumedTranscript.messages]\n : [createUserMessage(effectivePrompt)]\n\n let tools = await getTaskTools(safeMode)\n\n // Apply tool filtering if specified by subagent config\n // Claude Code spec: tools (allowlist) + disallowedTools (denylist) combination\n // Priority: disallowedTools always takes precedence over tools\n if (toolFilter) {\n // Back-compat: ['*'] means all tools\n const isAllArray =\n Array.isArray(toolFilter) &&\n toolFilter.length === 1 &&\n toolFilter[0] === '*'\n if (toolFilter === '*' || isAllArray) {\n // no-op, keep all tools (allowlist permits all)\n } else if (Array.isArray(toolFilter)) {\n tools = tools.filter(tool => toolFilter.includes(tool.name))\n }\n }\n\n // Apply disallowedTools filter (denylist takes precedence over allowlist)\n if (disallowedToolFilter?.length) {\n tools = tools.filter(tool => !disallowedToolFilter!.includes(tool.name))\n }\n\n // Apply permission mode tool restrictions (Claude Code spec)\n // Some permission modes only allow specific tools\n if (effectivePermissionMode !== 'default') {\n const modeConfig = MODE_CONFIGS[effectivePermissionMode]\n if (modeConfig && modeConfig.allowedTools[0] !== '*') {\n tools = tools.filter(tool =>\n modeConfig.allowedTools.includes(tool.name),\n )\n }\n }\n\n // Model already resolved in effectiveModel variable above\n const modelToUse = effectiveModel\n\n // Display initial task information with separate progress lines\n if (resumedTranscript) {\n yield {\n type: 'progress',\n content: createAssistantMessage(\n `Resuming agent: ${agentType} (${agentId})`,\n ),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n\n yield {\n type: 'progress',\n content: createAssistantMessage(\n `Restored ${resumedTranscript.messages.length} messages, ${resumedTranscript.toolUseCount} tool uses`,\n ),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n } else {\n yield {\n type: 'progress',\n content: createAssistantMessage(`Starting agent: ${agentType}`),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n }\n\n yield {\n type: 'progress',\n content: createAssistantMessage(`Using model: ${modelToUse}`),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n\n yield {\n type: 'progress',\n content: createAssistantMessage(`Task: ${description}`),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n\n yield {\n type: 'progress',\n content: createAssistantMessage(\n `Prompt: ${prompt.length > 150 ? prompt.substring(0, 150) + '...' : prompt}`,\n ),\n normalizedMessages: normalizeMessages(messages),\n tools,\n }\n\n const [taskPrompt, context, maxThinkingTokens] = await Promise.all([\n getAgentPrompt(),\n getContext(),\n getMaxThinkingTokens(messages),\n ])\n\n // Inject model context to prevent self-referential expert consultations\n taskPrompt.push(\n `\\nIMPORTANT: You are currently running as ${modelToUse}. You do not need to consult ${modelToUse} via AskExpertModel since you ARE ${modelToUse}. Complete tasks directly using your capabilities.`,\n )\n\n // Initialize tool use count (restore from transcript if resuming)\n let toolUseCount = resumedTranscript?.toolUseCount || 0\n\n const getSidechainNumber = memoize(() =>\n getNextAvailableLogSidechainNumber(messageLogName, forkNumber),\n )\n\n // Create or update transcript for this agent execution\n if (!resumedTranscript) {\n createAgentTranscript({\n agentId,\n agentType,\n toolUseId, // Include toolUseId for event-driven UI updates\n description,\n prompt,\n model: modelToUse,\n forkNumber,\n messageLogName,\n messages: [...messages],\n toolUseCount: 0,\n })\n } else {\n // Update transcript status to running when resuming\n appendMessageToTranscript(\n agentId,\n createUserMessage(`[Resumed] ${prompt}`),\n )\n }\n\n // Build query options, adding temperature if specified\n // Use agent-configured maxThinkingTokens if available, otherwise use default\n const effectiveMaxThinkingTokens =\n agentMaxThinkingTokens ?? maxThinkingTokens\n const queryOptions = {\n safeMode,\n forkNumber,\n messageLogName,\n tools,\n commands: [],\n verbose,\n maxThinkingTokens: effectiveMaxThinkingTokens,\n model: modelToUse,\n }\n\n // Add temperature if specified by subagent config\n if (temperature !== undefined) {\n queryOptions['temperature'] = temperature\n }\n\n // \uD83D\uDD27 CRITICAL FIX: Wrap entire query execution in try-catch-finally\n // This ensures we ALWAYS yield a result, even if query() throws an error\n\n // Push agent context so streaming state is isolated for this subagent\n pushAgentContext(agentId)\n\n // Track turn count for max_turns limit\n let turnCount = 0\n\n try {\n for await (const message of query(\n messages,\n taskPrompt,\n context,\n hasPermissionsToUseTool,\n {\n abortController,\n options: queryOptions,\n messageId: getLastAssistantMessageId(messages),\n agentId,\n readFileTimestamps,\n setToolJSX: () => {}, // No-op implementation for TaskTool\n },\n )) {\n messages.push(message)\n\n // Persist message to transcript for resume capability\n appendMessageToTranscript(agentId, message)\n\n overwriteLog(\n getMessagesPath(messageLogName, forkNumber, getSidechainNumber()),\n messages.filter(_ => _.type !== 'progress'),\n )\n\n if (message.type !== 'assistant') {\n continue\n }\n\n // Increment turn count for each assistant message (API round-trip)\n turnCount++\n\n // Check max_turns limit\n if (max_turns && turnCount >= max_turns) {\n debugLogger.info('TASK_AGENT_MAX_TURNS_REACHED', {\n agentId,\n turnCount,\n max_turns,\n })\n // Break out of the query loop - will proceed to normal completion handling\n break\n }\n\n // Real-time token usage update for running task display\n if (message.message.usage) {\n updateAgentTranscript(agentId, {\n tokenUsage: {\n inputTokens: message.message.usage.input_tokens,\n outputTokens: message.message.usage.output_tokens,\n cacheReadTokens: message.message.usage.cache_read_input_tokens,\n cacheCreationTokens:\n message.message.usage.cache_creation_input_tokens,\n },\n })\n }\n\n const normalizedMessages = normalizeMessages(messages)\n\n // Process tool uses and text content for better visibility\n for (const content of message.message.content) {\n if (\n content.type === 'text' &&\n content.text &&\n content.text !== INTERRUPT_MESSAGE\n ) {\n // Show agent's reasoning/responses\n const preview =\n content.text.length > 200\n ? content.text.substring(0, 200) + '...'\n : content.text\n yield {\n type: 'progress',\n content: createAssistantMessage(`${preview}`),\n normalizedMessages,\n tools,\n }\n } else if (content.type === 'tool_use') {\n toolUseCount++\n\n // Show which tool is being used with agent context\n const toolMessage = normalizedMessages.find(\n _ =>\n _.type === 'assistant' &&\n _.message.content[0]?.type === 'tool_use' &&\n _.message.content[0].id === content.id,\n ) as AssistantMessage\n\n if (toolMessage) {\n // Clone and modify the message to show agent context\n const modifiedMessage = {\n ...toolMessage,\n message: {\n ...toolMessage.message,\n content: toolMessage.message.content.map(c => {\n if (c.type === 'tool_use' && c.id === content.id) {\n // Add agent context to tool name display\n return {\n ...c,\n name: c.name, // Keep original name, UI will handle display\n }\n }\n return c\n }),\n },\n }\n\n yield {\n type: 'progress',\n content: modifiedMessage,\n normalizedMessages,\n tools,\n }\n }\n }\n }\n }\n\n const normalizedMessages = normalizeMessages(messages)\n const lastMessage = last(messages)\n if (lastMessage?.type !== 'assistant') {\n throw new Error('Last message was not an assistant message')\n }\n\n // Calculate token usage for transcript\n const tokenUsage = {\n inputTokens: lastMessage.message.usage.input_tokens,\n outputTokens: lastMessage.message.usage.output_tokens,\n cacheReadTokens: lastMessage.message.usage.cache_read_input_tokens,\n cacheCreationTokens:\n lastMessage.message.usage.cache_creation_input_tokens,\n }\n\n // Check for interrupt\n const isInterrupted = lastMessage.message.content.some(\n _ => _.type === 'text' && _.text === INTERRUPT_MESSAGE,\n )\n\n if (isInterrupted) {\n // Mark transcript as interrupted (can be resumed later)\n interruptAgentTranscript(agentId)\n debugLogger.info('TASK_AGENT_INTERRUPTED', { agentId, toolUseCount })\n } else {\n // Mark transcript as completed\n completeAgentTranscript(agentId, tokenUsage)\n debugLogger.info('TASK_AGENT_COMPLETED', { agentId, toolUseCount })\n\n // Execute onComplete hooks if configured (Claude Code spec)\n if (loadedAgentConfig?.hooks?.onComplete?.length) {\n try {\n const hookContext = createHookContext({\n sessionId: agentId,\n agentId,\n agentType,\n result: this.renderResultForAssistant(\n lastMessage.message.content.filter(_ => _.type === 'text'),\n ),\n })\n await executeAgentHooks(\n 'onComplete',\n loadedAgentConfig,\n hookContext,\n )\n } catch (hookError) {\n debugLogger.warn('TASK_AGENT_ONCOMPLETE_HOOK_FAILED', {\n agentId,\n agentType,\n error:\n hookError instanceof Error\n ? hookError.message\n : String(hookError),\n })\n }\n }\n\n // Save agent memory if configured (Claude Code spec)\n if (loadedAgentConfig?.memory) {\n try {\n // Save the agent's final response as memory\n const finalResponse = lastMessage.message.content\n .filter(_ => _.type === 'text')\n .map(_ => (_ as { type: 'text'; text: string }).text)\n .join('\\n')\n if (finalResponse.trim()) {\n await saveAgentMemory(\n agentType,\n loadedAgentConfig.memory,\n finalResponse,\n )\n }\n } catch (memoryError) {\n debugLogger.warn('TASK_AGENT_MEMORY_SAVE_FAILED', {\n agentId,\n agentType,\n error:\n memoryError instanceof Error\n ? memoryError.message\n : String(memoryError),\n })\n }\n }\n\n const result = [\n toolUseCount === 1 ? '1 tool use' : `${toolUseCount} tool uses`,\n formatNumber(\n (lastMessage.message.usage.cache_creation_input_tokens ?? 0) +\n (lastMessage.message.usage.cache_read_input_tokens ?? 0) +\n lastMessage.message.usage.input_tokens +\n lastMessage.message.usage.output_tokens,\n ) + ' tokens',\n formatDuration(Date.now() - startTime),\n ]\n yield {\n type: 'progress',\n content: createAssistantMessage(`Done (${result.join(' \u00B7 ')})`),\n normalizedMessages,\n tools,\n }\n }\n\n // Output is an AssistantMessage, but since TaskTool is a tool, it needs\n // to serialize its response to UserMessage-compatible content.\n const data = lastMessage.message.content.filter(_ => _.type === 'text')\n\n // Include agentId in result for potential resume\n const resultWithAgentId = isInterrupted\n ? `[Interrupted - Agent ID: ${agentId}]\\n${this.renderResultForAssistant(data)}`\n : this.renderResultForAssistant(data)\n\n yield {\n type: 'result',\n data,\n resultForAssistant: resultWithAgentId,\n }\n hasYieldedResult = true\n } catch (error) {\n // \uD83D\uDD27 CRITICAL: On error, we MUST yield a result to clear UI state\n const errorMessage =\n error instanceof Error ? error.message : String(error)\n\n // \uD83D\uDD27 FIX: Check if this is an AbortError (ESC interrupt)\n // AbortError indicates user interrupted, should mark as 'interrupted' not 'failed'\n const isAbortError =\n error instanceof Error &&\n (error.name === 'AbortError' ||\n error.message.includes('aborted') ||\n error.message.includes('abort'))\n\n if (isAbortError) {\n // Mark transcript as interrupted (can be resumed later)\n interruptAgentTranscript(agentId)\n debugLogger.info('TASK_AGENT_INTERRUPTED_BY_ABORT', {\n agentId,\n toolUseCount,\n })\n\n yield {\n type: 'result',\n data: [\n {\n type: 'text',\n text: `Task [${agentType}] interrupted\\n[Agent ID: ${agentId}]`,\n },\n ] as TextBlock[],\n resultForAssistant: `Task [${agentType}] interrupted by user\\n[Agent ID: ${agentId} - can be resumed]`,\n }\n } else {\n // Convert to user-friendly error for better UX\n const friendlyError =\n error instanceof UserFriendlyError\n ? error\n : new UserFriendlyError(error, {\n operation: 'agent task',\n model: agentType,\n })\n const friendlyMessage = friendlyError.getUserMessage()\n\n logError(`TaskTool [${agentType}] error: ${errorMessage}`)\n\n // Mark transcript as failed with friendly message\n failAgentTranscript(agentId, friendlyMessage)\n debugLogger.error('TASK_AGENT_FAILED', {\n agentId,\n error: errorMessage,\n errorId: friendlyError.id,\n })\n\n // Execute onError hooks if configured (Claude Code spec)\n if (loadedAgentConfig?.hooks?.onError?.length) {\n try {\n const hookContext = createHookContext({\n sessionId: agentId,\n agentId,\n agentType,\n error: error instanceof Error ? error : new Error(String(error)),\n })\n await executeAgentHooks('onError', loadedAgentConfig, hookContext)\n } catch (hookError) {\n debugLogger.warn('TASK_AGENT_ONERROR_HOOK_FAILED', {\n agentId,\n agentType,\n error:\n hookError instanceof Error\n ? hookError.message\n : String(hookError),\n })\n }\n }\n\n yield {\n type: 'result',\n data: [\n {\n type: 'text',\n text: `${friendlyMessage}\\n[Agent ID: ${agentId}]`,\n },\n ] as TextBlock[],\n resultForAssistant: `Task [${agentType}] failed: ${errorMessage}\\n[Agent ID: ${agentId} - can be resumed]`,\n }\n }\n hasYieldedResult = true\n } finally {\n // Pop agent context and clean up streaming state\n popAgentContext()\n cleanupAgentStreamingState(agentId)\n\n // \uD83D\uDD27 SAFETY NET: Ensure we always yield a result even in unexpected scenarios\n if (!hasYieldedResult) {\n // Mark as interrupted if we haven't yielded a result\n interruptAgentTranscript(agentId)\n\n yield {\n type: 'result',\n data: [\n {\n type: 'text',\n text: `Task [${agentType}] terminated unexpectedly\\n[Agent ID: ${agentId}]`,\n },\n ] as TextBlock[],\n resultForAssistant: `Task [${agentType}] terminated unexpectedly\\n[Agent ID: ${agentId} - can be resumed]`,\n }\n }\n }\n },\n\n isReadOnly() {\n return true // for now...\n },\n isConcurrencySafe() {\n return true // Task tool supports concurrent execution in official implementation\n },\n async validateInput(input, context) {\n if (!input.description || typeof input.description !== 'string') {\n return {\n result: false,\n message: 'Description is required and must be a string',\n }\n }\n if (!input.prompt || typeof input.prompt !== 'string') {\n return {\n result: false,\n message: 'Prompt is required and must be a string',\n }\n }\n\n // Model validation - similar to Edit tool error handling\n if (input.model_name) {\n const modelManager = getModelManager()\n const availableModels = modelManager.getAllAvailableModelNames()\n\n if (!availableModels.includes(input.model_name)) {\n return {\n result: false,\n message: `Model '${input.model_name}' does not exist. Available models: ${availableModels.join(', ')}`,\n meta: {\n model_name: input.model_name,\n availableModels,\n },\n }\n }\n }\n\n // Validate subagent_type if provided\n if (input.subagent_type) {\n const availableTypes = await getAvailableAgentTypes()\n if (!availableTypes.includes(input.subagent_type)) {\n return {\n result: false,\n message: `Agent type '${input.subagent_type}' does not exist. Available types: ${availableTypes.join(', ')}`,\n meta: {\n subagent_type: input.subagent_type,\n availableTypes,\n },\n }\n }\n }\n\n // Validate resume parameter if provided\n if (input.resume) {\n if (!canResumeTranscript(input.resume)) {\n return {\n result: false,\n message: `Cannot resume agent '${input.resume}': transcript not found or not resumable (status must be 'running' or 'interrupted')`,\n meta: {\n resume: input.resume,\n },\n }\n }\n }\n\n return { result: true }\n },\n async isEnabled() {\n return true\n },\n userFacingName(input?: any) {\n // Return agent name with proper prefix\n const agentType = input?.subagent_type || 'general-purpose'\n return `agent-${agentType}`\n },\n needsPermissions() {\n return false\n },\n renderResultForAssistant(data: TextBlock[]) {\n return data\n .map(block => (block.type === 'text' ? block.text : ''))\n .join('\\n')\n },\n renderToolUseMessage(\n { description, prompt, model_name, subagent_type },\n { verbose },\n ) {\n if (!description || !prompt) return null\n\n const modelManager = getModelManager()\n const defaultTaskModel = modelManager.getModelName('task')\n const actualModel = model_name || defaultTaskModel\n const agentType = subagent_type || 'general-purpose'\n const promptPreview =\n prompt.length > 80 ? prompt.substring(0, 80) + '...' : prompt\n\n const theme = getTheme()\n\n if (verbose) {\n return (\n <Box flexDirection=\"column\">\n <Text>\n [{agentType}] {actualModel}: {description}\n </Text>\n <Box\n paddingLeft={2}\n borderLeftStyle=\"single\"\n borderLeftColor={theme.secondaryBorder}\n >\n <Text color={theme.secondaryText}>{promptPreview}</Text>\n </Box>\n </Box>\n )\n }\n\n // Simple display: agent type, model and description\n return `[${agentType}] ${actualModel}: ${description}`\n },\n renderToolUseRejectedMessage() {\n return <FallbackToolUseRejectedMessage />\n },\n renderToolResultMessage(content, options?: { verbose?: boolean }) {\n const theme = getTheme()\n const verbose = options?.verbose ?? false\n\n // Guard against undefined or null content\n if (!content) {\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={theme.success}>Done</Text>\n </Box>\n )\n }\n\n if (Array.isArray(content)) {\n const textBlocks = content.filter(\n (block): block is { type: 'text'; text: string } =>\n block && block.type === 'text',\n )\n const totalLength = textBlocks.reduce(\n (sum, block) => sum + (block.text?.length || 0),\n 0,\n )\n // Use exact match for interrupt detection\n const isInterrupted = content.some(\n block =>\n block && block.type === 'text' && block.text === INTERRUPT_MESSAGE,\n )\n\n if (isInterrupted) {\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={theme.error}>Interrupted by user</Text>\n </Box>\n )\n }\n\n // Extract output content for display based on verbosity\n const outputText = textBlocks.map(b => b.text).join('\\n')\n\n // Determine how much content to show based on displayMode\n // minimal/compact (verbose=false): Just show \"Task completed (X characters)\"\n // detailed (verbose=true): Show preview of the actual output\n const getOutputPreview = () => {\n if (!verbose || !outputText) return null\n const maxLen = 500\n if (outputText.length <= maxLen) return outputText\n return outputText.substring(0, maxLen) + '...'\n }\n\n const outputPreview = getOutputPreview()\n\n return (\n <Box flexDirection=\"column\">\n <Box justifyContent=\"space-between\" width=\"100%\">\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={theme.success}>Done</Text>\n {textBlocks.length > 0 && verbose && (\n <Text color={theme.secondaryText}> ({totalLength} chars)</Text>\n )}\n </Box>\n </Box>\n {outputPreview && (\n <Box marginTop={1} paddingLeft={4}>\n <Text color={theme.mutedText}>{outputPreview}</Text>\n </Box>\n )}\n </Box>\n )\n }\n\n return (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={theme.success}>Done</Text>\n </Box>\n )\n },\n} satisfies Tool<typeof inputSchema, TextBlock[]>\n"],
5
+ "mappings": "AAEA,SAAS,MAAM,eAAe;AAE9B,OAAO,WAAoC;AAC3C,SAAS,KAAK,YAAY;AAC1B,SAAS,SAAS;AAElB,SAAS,sCAAsC;AAC/C,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,+BAA+B;AACxC,SAAmD,aAAa;AAChE,SAAS,gBAAgB,oBAAoB;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc,iBAAiB;AACxC,SAAS,iBAAiB;AAC1B;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,yBAA6C;AACtD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,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,MAAM,MAAM,UAAU;AAAA,QAC7C;AAAA,MACF;AAEA,YAAM,gBAAgB,QAAQ;AAAA,QAC5B,WACE,SAAS,MAAM,SAAS,UAAU,MAAM,SAAS;AAAA,MACrD;AAEA,UAAI,eAAe;AACjB,eACE,oCAAC,OAAI,eAAc,SACjB,oCAAC,YAAK,qBAAoB,GAC1B,oCAAC,QAAK,OAAO,MAAM,SAAO,qBAAmB,CAC/C;AAAA,MAEJ;AAGA,YAAM,aAAa,WAAW,IAAI,OAAK,EAAE,IAAI,EAAE,KAAK,IAAI;AAKxD,YAAM,mBAAmB,MAAM;AAC7B,YAAI,CAAC,WAAW,CAAC,WAAY,QAAO;AACpC,cAAM,SAAS;AACf,YAAI,WAAW,UAAU,OAAQ,QAAO;AACxC,eAAO,WAAW,UAAU,GAAG,MAAM,IAAI;AAAA,MAC3C;AAEA,YAAM,gBAAgB,iBAAiB;AAEvC,aACE,oCAAC,OAAI,eAAc,YACjB,oCAAC,OAAI,gBAAe,iBAAgB,OAAM,UACxC,oCAAC,OAAI,eAAc,SACjB,oCAAC,YAAK,qBAAoB,GAC1B,oCAAC,QAAK,OAAO,MAAM,WAAS,MAAI,GAC/B,WAAW,SAAS,KAAK,WACxB,oCAAC,QAAK,OAAO,MAAM,iBAAe,MAAG,aAAY,SAAO,CAE5D,CACF,GACC,iBACC,oCAAC,OAAI,WAAW,GAAG,aAAa,KAC9B,oCAAC,QAAK,OAAO,MAAM,aAAY,aAAc,CAC/C,CAEJ;AAAA,IAEJ;AAEA,WACE,oCAAC,OAAI,eAAc,SACjB,oCAAC,YAAK,qBAAoB,GAC1B,oCAAC,QAAK,OAAO,MAAM,WAAS,MAAI,CAClC;AAAA,EAEJ;AACF;",
6
6
  "names": ["normalizedMessages"]
7
7
  }
@@ -58,6 +58,27 @@ Skip using this tool when:
58
58
  - **Batch operations**: Update multiple todos in a single operation
59
59
  - **Clear all todos**: Reset the entire todo list
60
60
 
61
+ ## Required Parameters
62
+
63
+ Each todo item MUST include these fields:
64
+ - **content** (string, required): Task description
65
+ - **status** (enum, required): "pending" | "in_progress" | "completed"
66
+ - **priority** (enum, required): "high" | "medium" | "low"
67
+ - **id** (string, optional): Unique identifier (auto-generated if not provided)
68
+ - **activeForm** (string, optional): Present continuous form shown when in_progress (e.g., "Running tests")
69
+
70
+ ## Example
71
+
72
+ \`\`\`json
73
+ {
74
+ "todos": [
75
+ {"content": "Analyze requirements", "status": "completed", "priority": "high"},
76
+ {"content": "Implement feature", "status": "in_progress", "priority": "high"},
77
+ {"content": "Write tests", "status": "pending", "priority": "medium"}
78
+ ]
79
+ }
80
+ \`\`\`
81
+
61
82
  When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.`;
62
83
  export {
63
84
  DESCRIPTION,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/tools/TodoWriteTool/prompt.ts"],
4
- "sourcesContent": ["export const DESCRIPTION =\n 'Creates and manages todo items for task tracking and progress management in the current session.'\n\nexport const PROMPT = `Use this tool to create and manage todo items for tracking tasks and progress. This tool provides comprehensive todo management:\n\n## When to Use This Tool\n\nUse this tool proactively in these scenarios:\n\n1. **Complex multi-step tasks** - When a task requires 3 or more distinct steps or actions\n2. **Non-trivial and complex tasks** - Tasks that require careful planning or multiple operations\n3. **User explicitly requests todo list** - When the user directly asks you to use the todo list\n4. **User provides multiple tasks** - When users provide a list of things to be done (numbered or comma-separated)\n5. **After receiving new instructions** - Immediately capture user requirements as todos\n6. **When you start working on a task** - Mark it as in_progress BEFORE beginning work. Ideally you should only have one todo as in_progress at a time\n7. **After completing a task** - Mark it as completed and add any new follow-up tasks discovered during implementation\n\n## When NOT to Use This Tool\n\nSkip using this tool when:\n1. There is only a single, straightforward task\n2. The task is trivial and tracking it provides no organizational benefit\n3. The task can be completed in less than 3 trivial steps\n4. The task is purely conversational or informational\n\n## Task States and Management\n\n1. **Task States**: Use these states to track progress:\n - pending: Task not yet started\n - in_progress: Currently working on (limit to ONE task at a time)\n - completed: Task finished successfully\n\n2. **Task Management**:\n - Update task status in real-time as you work\n - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n - Only have ONE task in_progress at any time\n - Complete current tasks before starting new ones\n - Remove tasks that are no longer relevant from the list entirely\n\n3. **Task Completion Requirements**:\n - ONLY mark a task as completed when you have FULLY accomplished it\n - If you encounter errors, blockers, or cannot finish, keep the task as in_progress\n - When blocked, create a new task describing what needs to be resolved\n - Never mark a task as completed if:\n - Tests are failing\n - Implementation is partial\n - You encountered unresolved errors\n - You couldn't find necessary files or dependencies\n\n4. **Task Breakdown**:\n - Create specific, actionable items\n - Break complex tasks into smaller, manageable steps\n - Use clear, descriptive task names\n\n## Tool Capabilities\n\n- **Create new todos**: Add tasks with content, priority, and status\n- **Update existing todos**: Modify any aspect of a todo (status, priority, content)\n- **Delete todos**: Remove completed or irrelevant tasks\n- **Batch operations**: Update multiple todos in a single operation\n- **Clear all todos**: Reset the entire todo list\n\nWhen in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.`\n"],
5
- "mappings": "AAAO,MAAM,cACX;AAEK,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
4
+ "sourcesContent": ["export const DESCRIPTION =\n 'Creates and manages todo items for task tracking and progress management in the current session.'\n\nexport const PROMPT = `Use this tool to create and manage todo items for tracking tasks and progress. This tool provides comprehensive todo management:\n\n## When to Use This Tool\n\nUse this tool proactively in these scenarios:\n\n1. **Complex multi-step tasks** - When a task requires 3 or more distinct steps or actions\n2. **Non-trivial and complex tasks** - Tasks that require careful planning or multiple operations\n3. **User explicitly requests todo list** - When the user directly asks you to use the todo list\n4. **User provides multiple tasks** - When users provide a list of things to be done (numbered or comma-separated)\n5. **After receiving new instructions** - Immediately capture user requirements as todos\n6. **When you start working on a task** - Mark it as in_progress BEFORE beginning work. Ideally you should only have one todo as in_progress at a time\n7. **After completing a task** - Mark it as completed and add any new follow-up tasks discovered during implementation\n\n## When NOT to Use This Tool\n\nSkip using this tool when:\n1. There is only a single, straightforward task\n2. The task is trivial and tracking it provides no organizational benefit\n3. The task can be completed in less than 3 trivial steps\n4. The task is purely conversational or informational\n\n## Task States and Management\n\n1. **Task States**: Use these states to track progress:\n - pending: Task not yet started\n - in_progress: Currently working on (limit to ONE task at a time)\n - completed: Task finished successfully\n\n2. **Task Management**:\n - Update task status in real-time as you work\n - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n - Only have ONE task in_progress at any time\n - Complete current tasks before starting new ones\n - Remove tasks that are no longer relevant from the list entirely\n\n3. **Task Completion Requirements**:\n - ONLY mark a task as completed when you have FULLY accomplished it\n - If you encounter errors, blockers, or cannot finish, keep the task as in_progress\n - When blocked, create a new task describing what needs to be resolved\n - Never mark a task as completed if:\n - Tests are failing\n - Implementation is partial\n - You encountered unresolved errors\n - You couldn't find necessary files or dependencies\n\n4. **Task Breakdown**:\n - Create specific, actionable items\n - Break complex tasks into smaller, manageable steps\n - Use clear, descriptive task names\n\n## Tool Capabilities\n\n- **Create new todos**: Add tasks with content, priority, and status\n- **Update existing todos**: Modify any aspect of a todo (status, priority, content)\n- **Delete todos**: Remove completed or irrelevant tasks\n- **Batch operations**: Update multiple todos in a single operation\n- **Clear all todos**: Reset the entire todo list\n\n## Required Parameters\n\nEach todo item MUST include these fields:\n- **content** (string, required): Task description\n- **status** (enum, required): \"pending\" | \"in_progress\" | \"completed\"\n- **priority** (enum, required): \"high\" | \"medium\" | \"low\"\n- **id** (string, optional): Unique identifier (auto-generated if not provided)\n- **activeForm** (string, optional): Present continuous form shown when in_progress (e.g., \"Running tests\")\n\n## Example\n\n\\`\\`\\`json\n{\n \"todos\": [\n {\"content\": \"Analyze requirements\", \"status\": \"completed\", \"priority\": \"high\"},\n {\"content\": \"Implement feature\", \"status\": \"in_progress\", \"priority\": \"high\"},\n {\"content\": \"Write tests\", \"status\": \"pending\", \"priority\": \"medium\"}\n ]\n}\n\\`\\`\\`\n\nWhen in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.`\n"],
5
+ "mappings": "AAAO,MAAM,cACX;AAEK,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,20 +1,25 @@
1
1
  const TOOL_NAME_FOR_PROMPT = "WebFetch";
2
- const DESCRIPTION = `- Fetches content from a specified URL and processes it using an AI model
2
+ const DESCRIPTION = `- Built-in URL fetcher that retrieves and analyzes web content
3
3
  - Takes a URL and a prompt as input
4
4
  - Fetches the URL content, converts HTML to markdown
5
5
  - Processes the content with the prompt using a small, fast model
6
- - Returns the model's response about the content
7
- - Use this tool when you need to retrieve and analyze web content
6
+
7
+ Capabilities:
8
+ - Fetch and analyze public web pages
9
+ - Extract specific information based on prompt
10
+ - Automatic redirect handling
11
+ - 15-minute cache for repeated access
12
+
13
+ Limitations:
14
+ - Cannot bypass bot detection or CAPTCHAs on protected sites
15
+ - May fail on sites with aggressive anti-scraping measures
16
+ - Cannot access authenticated/private content
8
17
 
9
18
  Usage notes:
10
- - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions. All MCP-provided tools start with "mcp__".
11
19
  - The URL must be a fully-formed valid URL (e.g., https://example.com)
12
20
  - HTTP URLs will be automatically upgraded to HTTPS
13
- - The prompt should describe what information you want to extract from the page
14
- - This tool is read-only and does not modify any files
15
- - Results may be summarized if the content is very large
16
- - Includes a self-cleaning 15-minute cache for faster responses when repeatedly accessing the same URL
17
- - When a URL redirects, the tool will inform you and provide the redirect URL in a special format. You should then make a new URLFetcher request with the redirect URL to fetch the content.`;
21
+ - The prompt should describe what information you want to extract
22
+ - If this tool fails due to access restrictions, consider trying MCP scraping tools (mcp__*__scrape_*) which may have better success`;
18
23
  export {
19
24
  DESCRIPTION,
20
25
  TOOL_NAME_FOR_PROMPT
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/tools/URLFetcherTool/prompt.ts"],
4
- "sourcesContent": ["export const TOOL_NAME_FOR_PROMPT = 'WebFetch'\nexport const DESCRIPTION = `- Fetches content from a specified URL and processes it using an AI model\n- Takes a URL and a prompt as input\n- Fetches the URL content, converts HTML to markdown\n- Processes the content with the prompt using a small, fast model\n- Returns the model's response about the content\n- Use this tool when you need to retrieve and analyze web content\n\nUsage notes:\n- IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions. All MCP-provided tools start with \"mcp__\".\n- The URL must be a fully-formed valid URL (e.g., https://example.com)\n- HTTP URLs will be automatically upgraded to HTTPS\n- The prompt should describe what information you want to extract from the page\n- This tool is read-only and does not modify any files\n- Results may be summarized if the content is very large\n- Includes a self-cleaning 15-minute cache for faster responses when repeatedly accessing the same URL\n- When a URL redirects, the tool will inform you and provide the redirect URL in a special format. You should then make a new URLFetcher request with the redirect URL to fetch the content.`\n"],
5
- "mappings": "AAAO,MAAM,uBAAuB;AAC7B,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
4
+ "sourcesContent": ["export const TOOL_NAME_FOR_PROMPT = 'WebFetch'\nexport const DESCRIPTION = `- Built-in URL fetcher that retrieves and analyzes web content\n- Takes a URL and a prompt as input\n- Fetches the URL content, converts HTML to markdown\n- Processes the content with the prompt using a small, fast model\n\nCapabilities:\n- Fetch and analyze public web pages\n- Extract specific information based on prompt\n- Automatic redirect handling\n- 15-minute cache for repeated access\n\nLimitations:\n- Cannot bypass bot detection or CAPTCHAs on protected sites\n- May fail on sites with aggressive anti-scraping measures\n- Cannot access authenticated/private content\n\nUsage notes:\n- The URL must be a fully-formed valid URL (e.g., https://example.com)\n- HTTP URLs will be automatically upgraded to HTTPS\n- The prompt should describe what information you want to extract\n- If this tool fails due to access restrictions, consider trying MCP scraping tools (mcp__*__scrape_*) which may have better success`\n"],
5
+ "mappings": "AAAO,MAAM,uBAAuB;AAC7B,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,15 +1,21 @@
1
1
  const TOOL_NAME_FOR_PROMPT = "WebSearch";
2
- const DESCRIPTION = `- Allows Minto to search the web and use the results to inform responses
2
+ const DESCRIPTION = `- Built-in web search using DuckDuckGo
3
3
  - Provides up-to-date information for current events and recent data
4
4
  - Returns search result information formatted as search result blocks
5
- - Use this tool for accessing information beyond the Minto's knowledge cutoff
6
- - Searches are performed automatically within a single API call using DuckDuckGo
5
+
6
+ Capabilities:
7
+ - Quick searches for general information
8
+ - Current events, news, and real-time data
9
+ - No authentication required
10
+
11
+ Limitations:
12
+ - Uses DuckDuckGo which may have limited results for some queries
13
+ - May not work well for region-specific or non-English content
14
+ - Cannot bypass bot detection on restricted sites
7
15
 
8
16
  Usage notes:
9
- - Use when you need current information not in training data
10
- - Effective for recent news, current events, product updates, or real-time data
11
17
  - Search queries should be specific and well-targeted for best results
12
- - Results include both title and snippet content for context`;
18
+ - If this tool returns no results or fails, consider trying MCP search tools (mcp__*) which may have broader coverage`;
13
19
  export {
14
20
  DESCRIPTION,
15
21
  TOOL_NAME_FOR_PROMPT
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/tools/WebSearchTool/prompt.ts"],
4
- "sourcesContent": ["export const TOOL_NAME_FOR_PROMPT = 'WebSearch'\nexport const DESCRIPTION = `- Allows Minto to search the web and use the results to inform responses\n- Provides up-to-date information for current events and recent data\n- Returns search result information formatted as search result blocks\n- Use this tool for accessing information beyond the Minto's knowledge cutoff\n- Searches are performed automatically within a single API call using DuckDuckGo\n\nUsage notes:\n- Use when you need current information not in training data\n- Effective for recent news, current events, product updates, or real-time data\n- Search queries should be specific and well-targeted for best results\n- Results include both title and snippet content for context`\n"],
5
- "mappings": "AAAO,MAAM,uBAAuB;AAC7B,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
4
+ "sourcesContent": ["export const TOOL_NAME_FOR_PROMPT = 'WebSearch'\nexport const DESCRIPTION = `- Built-in web search using DuckDuckGo\n- Provides up-to-date information for current events and recent data\n- Returns search result information formatted as search result blocks\n\nCapabilities:\n- Quick searches for general information\n- Current events, news, and real-time data\n- No authentication required\n\nLimitations:\n- Uses DuckDuckGo which may have limited results for some queries\n- May not work well for region-specific or non-English content\n- Cannot bypass bot detection on restricted sites\n\nUsage notes:\n- Search queries should be specific and well-targeted for best results\n- If this tool returns no results or fails, consider trying MCP search tools (mcp__*) which may have broader coverage`\n"],
5
+ "mappings": "AAAO,MAAM,uBAAuB;AAC7B,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,15 @@
1
+ const PERMISSION_LEVELS = {
2
+ plan: 0,
3
+ default: 1,
4
+ acceptEdits: 2,
5
+ dontAsk: 3,
6
+ bypassPermissions: 4
7
+ };
8
+ function validateAgentPermission(agentMode, sessionMode) {
9
+ const agentLevel = PERMISSION_LEVELS[agentMode] ?? 1;
10
+ const sessionLevel = PERMISSION_LEVELS[sessionMode] ?? 1;
11
+ return agentLevel <= sessionLevel ? agentMode : sessionMode;
12
+ }
1
13
  const MODE_CONFIGS = {
2
14
  default: {
3
15
  name: "default",
@@ -25,6 +37,19 @@ const MODE_CONFIGS = {
25
37
  bypassValidation: false
26
38
  }
27
39
  },
40
+ dontAsk: {
41
+ name: "dontAsk",
42
+ label: "DONT ASK",
43
+ icon: "\u{1F92B}",
44
+ color: "cyan",
45
+ description: "Trust agent - no permission prompts (Claude Code spec)",
46
+ allowedTools: ["*"],
47
+ restrictions: {
48
+ readOnly: false,
49
+ requireConfirmation: false,
50
+ bypassValidation: false
51
+ }
52
+ },
28
53
  plan: {
29
54
  name: "plan",
30
55
  label: "PLAN MODE",
@@ -66,6 +91,8 @@ function getNextPermissionMode(currentMode, isBypassAvailable = true) {
66
91
  case "default":
67
92
  return "acceptEdits";
68
93
  case "acceptEdits":
94
+ return "dontAsk";
95
+ case "dontAsk":
69
96
  return "plan";
70
97
  case "plan":
71
98
  return isBypassAvailable ? "bypassPermissions" : "default";
@@ -77,6 +104,8 @@ function getNextPermissionMode(currentMode, isBypassAvailable = true) {
77
104
  }
78
105
  export {
79
106
  MODE_CONFIGS,
80
- getNextPermissionMode
107
+ PERMISSION_LEVELS,
108
+ getNextPermissionMode,
109
+ validateAgentPermission
81
110
  };
82
111
  //# sourceMappingURL=PermissionMode.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/types/PermissionMode.ts"],
4
- "sourcesContent": ["// Permission mode types retained for compatibility with earlier agent implementations\nexport type PermissionMode =\n | 'default'\n | 'acceptEdits'\n | 'plan'\n | 'bypassPermissions'\n\nexport interface PermissionContext {\n mode: PermissionMode\n allowedTools: string[]\n allowedPaths: string[]\n restrictions: {\n readOnly: boolean\n requireConfirmation: boolean\n bypassValidation: boolean\n }\n metadata: {\n activatedAt?: string\n previousMode?: PermissionMode\n transitionCount: number\n }\n}\n\nexport interface ModeConfig {\n name: PermissionMode\n label: string\n icon: string\n color: string\n description: string\n allowedTools: string[]\n restrictions: {\n readOnly: boolean\n requireConfirmation: boolean\n bypassValidation: boolean\n }\n}\n\n// Mode configuration preserved for Claude Code parity\nexport const MODE_CONFIGS: Record<PermissionMode, ModeConfig> = {\n default: {\n name: 'default',\n label: 'DEFAULT',\n icon: '\uD83D\uDD12',\n color: 'blue',\n description: 'Standard permission checking',\n allowedTools: ['*'],\n restrictions: {\n readOnly: false,\n requireConfirmation: true,\n bypassValidation: false,\n },\n },\n acceptEdits: {\n name: 'acceptEdits',\n label: 'ACCEPT EDITS',\n icon: '\u2705',\n color: 'green',\n description: 'Auto-approve edit operations',\n allowedTools: ['*'],\n restrictions: {\n readOnly: false,\n requireConfirmation: false,\n bypassValidation: false,\n },\n },\n plan: {\n name: 'plan',\n label: 'PLAN MODE',\n icon: '\uD83D\uDCDD',\n color: 'yellow',\n description: 'Research and planning - read-only tools only',\n allowedTools: [\n 'Read',\n 'Grep',\n 'Glob',\n 'LS',\n 'WebSearch',\n 'WebFetch',\n 'NotebookRead',\n 'exit_plan_mode',\n ],\n restrictions: {\n readOnly: true,\n requireConfirmation: true,\n bypassValidation: false,\n },\n },\n bypassPermissions: {\n name: 'bypassPermissions',\n label: 'BYPASS PERMISSIONS',\n icon: '\uD83D\uDD13',\n color: 'red',\n description: 'All permissions bypassed',\n allowedTools: ['*'],\n restrictions: {\n readOnly: false,\n requireConfirmation: false,\n bypassValidation: true,\n },\n },\n}\n\n// Mode cycling function preserved from the Claude Code workflow\nexport function getNextPermissionMode(\n currentMode: PermissionMode,\n isBypassAvailable: boolean = true,\n): PermissionMode {\n switch (currentMode) {\n case 'default':\n return 'acceptEdits'\n case 'acceptEdits':\n return 'plan'\n case 'plan':\n return isBypassAvailable ? 'bypassPermissions' : 'default'\n case 'bypassPermissions':\n return 'default'\n default:\n return 'default'\n }\n}\n"],
5
- "mappings": "AAsCO,MAAM,eAAmD;AAAA,EAC9D,SAAS;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc,CAAC,GAAG;AAAA,IAClB,cAAc;AAAA,MACZ,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc,CAAC,GAAG;AAAA,IAClB,cAAc;AAAA,MACZ,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc,CAAC,GAAG;AAAA,IAClB,cAAc;AAAA,MACZ,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,IACpB;AAAA,EACF;AACF;AAGO,SAAS,sBACd,aACA,oBAA6B,MACb;AAChB,UAAQ,aAAa;AAAA,IACnB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO,oBAAoB,sBAAsB;AAAA,IACnD,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;",
4
+ "sourcesContent": ["// Permission mode types retained for compatibility with earlier agent implementations\n// Extended for Claude Code specification compliance\nexport type PermissionMode =\n | 'default' // Normal permission checking\n | 'acceptEdits' // Auto-approve file edit operations\n | 'dontAsk' // Trust agent, no permission prompts (Claude Code spec)\n | 'plan' // Read-only research and planning mode\n | 'bypassPermissions' // All permissions bypassed (dangerous)\n\n// Permission level hierarchy for validation\n// Lower number = more restrictive\nexport const PERMISSION_LEVELS: Record<PermissionMode, number> = {\n plan: 0,\n default: 1,\n acceptEdits: 2,\n dontAsk: 3,\n bypassPermissions: 4,\n}\n\n/**\n * Validate that agent permission mode does not exceed session permission level\n * Returns the effective permission mode (capped at session level)\n */\nexport function validateAgentPermission(\n agentMode: PermissionMode,\n sessionMode: PermissionMode,\n): PermissionMode {\n const agentLevel = PERMISSION_LEVELS[agentMode] ?? 1\n const sessionLevel = PERMISSION_LEVELS[sessionMode] ?? 1\n return agentLevel <= sessionLevel ? agentMode : sessionMode\n}\n\nexport interface PermissionContext {\n mode: PermissionMode\n allowedTools: string[]\n allowedPaths: string[]\n restrictions: {\n readOnly: boolean\n requireConfirmation: boolean\n bypassValidation: boolean\n }\n metadata: {\n activatedAt?: string\n previousMode?: PermissionMode\n transitionCount: number\n }\n}\n\nexport interface ModeConfig {\n name: PermissionMode\n label: string\n icon: string\n color: string\n description: string\n allowedTools: string[]\n restrictions: {\n readOnly: boolean\n requireConfirmation: boolean\n bypassValidation: boolean\n }\n}\n\n// Mode configuration preserved for Claude Code parity\nexport const MODE_CONFIGS: Record<PermissionMode, ModeConfig> = {\n default: {\n name: 'default',\n label: 'DEFAULT',\n icon: '\uD83D\uDD12',\n color: 'blue',\n description: 'Standard permission checking',\n allowedTools: ['*'],\n restrictions: {\n readOnly: false,\n requireConfirmation: true,\n bypassValidation: false,\n },\n },\n acceptEdits: {\n name: 'acceptEdits',\n label: 'ACCEPT EDITS',\n icon: '\u2705',\n color: 'green',\n description: 'Auto-approve edit operations',\n allowedTools: ['*'],\n restrictions: {\n readOnly: false,\n requireConfirmation: false,\n bypassValidation: false,\n },\n },\n dontAsk: {\n name: 'dontAsk',\n label: 'DONT ASK',\n icon: '\uD83E\uDD2B',\n color: 'cyan',\n description: 'Trust agent - no permission prompts (Claude Code spec)',\n allowedTools: ['*'],\n restrictions: {\n readOnly: false,\n requireConfirmation: false,\n bypassValidation: false,\n },\n },\n plan: {\n name: 'plan',\n label: 'PLAN MODE',\n icon: '\uD83D\uDCDD',\n color: 'yellow',\n description: 'Research and planning - read-only tools only',\n allowedTools: [\n 'Read',\n 'Grep',\n 'Glob',\n 'LS',\n 'WebSearch',\n 'WebFetch',\n 'NotebookRead',\n 'exit_plan_mode',\n ],\n restrictions: {\n readOnly: true,\n requireConfirmation: true,\n bypassValidation: false,\n },\n },\n bypassPermissions: {\n name: 'bypassPermissions',\n label: 'BYPASS PERMISSIONS',\n icon: '\uD83D\uDD13',\n color: 'red',\n description: 'All permissions bypassed',\n allowedTools: ['*'],\n restrictions: {\n readOnly: false,\n requireConfirmation: false,\n bypassValidation: true,\n },\n },\n}\n\n// Mode cycling function preserved from the Claude Code workflow\nexport function getNextPermissionMode(\n currentMode: PermissionMode,\n isBypassAvailable: boolean = true,\n): PermissionMode {\n switch (currentMode) {\n case 'default':\n return 'acceptEdits'\n case 'acceptEdits':\n return 'dontAsk'\n case 'dontAsk':\n return 'plan'\n case 'plan':\n return isBypassAvailable ? 'bypassPermissions' : 'default'\n case 'bypassPermissions':\n return 'default'\n default:\n return 'default'\n }\n}\n"],
5
+ "mappings": "AAWO,MAAM,oBAAoD;AAAA,EAC/D,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,EACT,mBAAmB;AACrB;AAMO,SAAS,wBACd,WACA,aACgB;AAChB,QAAM,aAAa,kBAAkB,SAAS,KAAK;AACnD,QAAM,eAAe,kBAAkB,WAAW,KAAK;AACvD,SAAO,cAAc,eAAe,YAAY;AAClD;AAiCO,MAAM,eAAmD;AAAA,EAC9D,SAAS;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc,CAAC,GAAG;AAAA,IAClB,cAAc;AAAA,MACZ,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc,CAAC,GAAG;AAAA,IAClB,cAAc;AAAA,MACZ,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc,CAAC,GAAG;AAAA,IAClB,cAAc;AAAA,MACZ,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,IACpB;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc,CAAC,GAAG;AAAA,IAClB,cAAc;AAAA,MACZ,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,IACpB;AAAA,EACF;AACF;AAGO,SAAS,sBACd,aACA,oBAA6B,MACb;AAChB,UAAQ,aAAa;AAAA,IACnB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO,oBAAoB,sBAAsB;AAAA,IACnD,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;",
6
6
  "names": []
7
7
  }
@@ -24,10 +24,8 @@ const PluginManifestSchema = z.object({
24
24
  /^[a-z0-9-]+$/,
25
25
  "Plugin name must be lowercase alphanumeric with hyphens"
26
26
  ),
27
- version: z.string().regex(
28
- /^\d+\.\d+\.\d+$/,
29
- "Version must follow semver format (e.g., 1.0.0)"
30
- ),
27
+ version: z.string().min(1),
28
+ // Supports semver and commit hashes (for CC sync)
31
29
  description: z.string().min(1),
32
30
  // Optional metadata
33
31
  displayName: z.string().optional(),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/types/plugin.ts"],
4
- "sourcesContent": ["/**\n * Plugin System Type Definitions\n */\n\nimport { z } from 'zod'\n\n/**\n * Author information (can be string or object)\n */\nexport const AuthorSchema = z.union([\n z.string(),\n z.object({\n name: z.string(),\n email: z.string().email().optional(),\n url: z.string().url().optional(),\n }),\n])\n\n/**\n * MCP Server Configuration Schema\n * Compatible with Claude Code CLI's .mcp.json format\n */\nexport const MCPServerConfigSchema = z.object({\n // Command-based (stdio) servers\n command: z.string().optional(),\n args: z.array(z.string()).optional().default([]),\n env: z.record(z.string()).optional().default({}),\n timeout: z.number().optional(),\n\n // HTTP/SSE servers\n type: z.enum(['stdio', 'http', 'sse']).optional().default('stdio'),\n url: z.string().optional(),\n headers: z.record(z.string()).optional(),\n})\n\nexport type MCPServerConfig = z.infer<typeof MCPServerConfigSchema>\n\n/**\n * Plugin Manifest Schema (plugin.json)\n * This is the source of truth for plugin metadata\n */\nexport const PluginManifestSchema = z.object({\n // Required fields\n name: z\n .string()\n .min(1)\n .regex(\n /^[a-z0-9-]+$/,\n 'Plugin name must be lowercase alphanumeric with hyphens',\n ),\n version: z\n .string()\n .regex(\n /^\\d+\\.\\d+\\.\\d+$/,\n 'Version must follow semver format (e.g., 1.0.0)',\n ),\n description: z.string().min(1),\n\n // Optional metadata\n displayName: z.string().optional(),\n author: AuthorSchema.optional(),\n homepage: z.string().url().optional(),\n repository: z.string().url().optional(),\n license: z.string().optional(),\n\n // Plugin components (relative paths from plugin root)\n agents: z.array(z.string()).optional().default([]),\n commands: z.array(z.string()).optional().default([]),\n skills: z.array(z.string()).optional().default([]),\n hooks: z.array(z.string()).optional().default([]),\n\n // MCP servers support both:\n // - Array of file paths: [\"mcp-servers/server1.json\"]\n // - Object with inline configs: { \"server1\": { command: \"...\" } }\n mcpServers: z\n .union([z.array(z.string()), z.record(MCPServerConfigSchema)])\n .optional()\n .default([]),\n\n // Dependencies\n dependencies: z.record(z.string()).optional().default({}),\n\n // Minto/Claude Code version requirements\n engines: z\n .object({\n minto: z.string().optional(),\n 'claude-code': z.string().optional(),\n node: z.string().optional(),\n })\n .optional(),\n\n // Plugin-specific configuration schema\n configSchema: z.record(z.any()).optional(),\n})\n\nexport type PluginManifest = z.infer<typeof PluginManifestSchema>\n\n/**\n * Loaded Plugin (runtime representation)\n */\nexport interface LoadedPlugin {\n name: string\n manifest: PluginManifest\n location: string // Absolute path to plugin directory\n source: PluginSource\n agents: LoadedAgent[]\n commands: LoadedCommand[]\n skills: LoadedSkill[]\n hooks: LoadedHook[]\n mcpServers: LoadedMCPServer[]\n enabled: boolean\n config?: Record<string, any>\n}\n\n/**\n * Plugin source types\n */\nexport type PluginSource =\n | { type: 'local'; path: string }\n | { type: 'git'; repo: string; ref?: string }\n | { type: 'npm'; package: string; version?: string }\n | { type: 'marketplace'; marketplace: string; name: string }\n\n/**\n * Agent component (from plugin)\n */\nexport interface LoadedAgent {\n name: string\n filePath: string\n config: {\n name: string\n description: string\n tools?: string | string[]\n model?: string\n content: string\n }\n pluginName: string\n}\n\n/**\n * Command component (from plugin)\n */\nexport interface LoadedCommand {\n name: string\n filePath: string\n config: {\n name: string\n description?: string\n aliases?: string[]\n enabled?: boolean\n hidden?: boolean\n progressMessage?: string\n argNames?: string[]\n 'allowed-tools'?: string[]\n content: string\n }\n pluginName: string\n}\n\n/**\n * Skill component (from plugin)\n */\nexport interface LoadedSkill {\n name: string\n filePath: string\n config: {\n name: string\n description: string\n content: string\n }\n pluginName: string\n}\n\n/**\n * Hook component (from plugin)\n */\nexport interface LoadedHook {\n name: string\n filePath: string\n config: {\n event: HookEvent\n matcher?: string\n type: 'command' | 'message' | 'notification'\n command?: string\n message?: string\n blocking?: boolean\n timeout?: number\n }\n pluginName: string\n event: HookEvent // Also store event at root level for easier access\n matcher?: string // Also store matcher at root level\n}\n\n/**\n * Hook lifecycle events\n */\nexport type HookEvent =\n | 'PreToolUse'\n | 'PostToolUse'\n | 'UserPromptSubmit'\n | 'SessionStart'\n | 'SessionEnd'\n | 'Stop'\n | 'SubagentStop'\n | 'Notification'\n | 'PreCompact'\n\n/**\n * MCP Server component (from plugin)\n */\nexport interface LoadedMCPServer {\n name: string\n filePath: string\n config: {\n command: string\n args?: string[]\n env?: Record<string, string>\n timeout?: number\n }\n pluginName: string\n}\n\n/**\n * Plugin installation options\n */\nexport interface PluginInstallOptions {\n source: PluginSource\n global?: boolean // Install globally vs project-level\n enable?: boolean // Auto-enable after install\n config?: Record<string, any> // Plugin-specific config\n}\n\n/**\n * Plugin marketplace configuration\n */\nexport interface PluginMarketplace {\n name: string\n source: PluginSource\n plugins: PluginManifest[]\n}\n\n/**\n * Plugin error types\n */\nexport class PluginError extends Error {\n constructor(\n message: string,\n public code: PluginErrorCode,\n public pluginName?: string,\n public details?: any,\n ) {\n super(message)\n this.name = 'PluginError'\n }\n}\n\nexport enum PluginErrorCode {\n MANIFEST_INVALID = 'MANIFEST_INVALID',\n MANIFEST_NOT_FOUND = 'MANIFEST_NOT_FOUND',\n VERSION_MISMATCH = 'VERSION_MISMATCH',\n DEPENDENCY_MISSING = 'DEPENDENCY_MISSING',\n COMPONENT_NOT_FOUND = 'COMPONENT_NOT_FOUND',\n COMPONENT_INVALID = 'COMPONENT_INVALID',\n ALREADY_INSTALLED = 'ALREADY_INSTALLED',\n NOT_INSTALLED = 'NOT_INSTALLED',\n PERMISSION_DENIED = 'PERMISSION_DENIED',\n}\n\n// ============================================================================\n// Session Plugin Types (Claude Code CLI Compatible)\n// ============================================================================\n\n/**\n * A loaded plugin in the current session\n * Compatible with Claude Code CLI session plugins\n */\nexport interface SessionPlugin {\n /** Plugin name from manifest */\n name: string\n /** Root directory of the plugin */\n rootDir: string\n /** Path to the manifest file */\n manifestPath: string\n /** Raw manifest data */\n manifest: unknown\n /** Directories containing custom commands */\n commandsDirs: string[]\n /** Directories containing skills */\n skillsDirs: string[]\n /** Directories containing agents */\n agentsDirs: string[]\n /** Paths to hooks configuration files */\n hooksFiles: string[]\n /** Directories containing output styles */\n outputStylesDirs: string[]\n /** Paths to MCP server configuration files */\n mcpConfigFiles: string[]\n /** Paths to LSP server configuration files (Claude Code CLI specific) */\n lspConfigFiles: string[]\n}\n\n/**\n * Plugin scope - where the plugin is installed/activated\n */\nexport type PluginScope = 'user' | 'project' | 'local'\n\n/**\n * Installed skill plugin record\n */\nexport interface InstalledSkillPlugin {\n plugin: string\n marketplace: string\n scope: PluginScope\n kind?: 'skill-pack' | 'plugin-pack'\n isEnabled?: boolean\n projectPath?: string\n installedAt: string\n pluginRoot?: string\n skills: string[]\n commands: string[]\n sourceMarketplacePath: string\n}\n"],
5
- "mappings": "AAIA,SAAS,SAAS;AAKX,MAAM,eAAe,EAAE,MAAM;AAAA,EAClC,EAAE,OAAO;AAAA,EACT,EAAE,OAAO;AAAA,IACP,MAAM,EAAE,OAAO;AAAA,IACf,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS;AAAA,IACnC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACjC,CAAC;AACH,CAAC;AAMM,MAAM,wBAAwB,EAAE,OAAO;AAAA;AAAA,EAE5C,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAAA,EAC/C,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAAA,EAC/C,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAG7B,MAAM,EAAE,KAAK,CAAC,SAAS,QAAQ,KAAK,CAAC,EAAE,SAAS,EAAE,QAAQ,OAAO;AAAA,EACjE,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,EACzB,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,SAAS;AACzC,CAAC;AAQM,MAAM,uBAAuB,EAAE,OAAO;AAAA;AAAA,EAE3C,MAAM,EACH,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,IACA;AAAA,EACF;AAAA,EACF,SAAS,EACN,OAAO,EACP;AAAA,IACC;AAAA,IACA;AAAA,EACF;AAAA,EACF,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA;AAAA,EAG7B,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,QAAQ,aAAa,SAAS;A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iBAAA,wBAAqB;AACrB,EAAAA,iBAAA,sBAAmB;AACnB,EAAAA,iBAAA,wBAAqB;AACrB,EAAAA,iBAAA,yBAAsB;AACtB,EAAAA,iBAAA,uBAAoB;AACpB,EAAAA,iBAAA,uBAAoB;AACpB,EAAAA,iBAAA,mBAAgB;AAChB,EAAAA,iBAAA,uBAAoB;AATV,SAAAA;AAAA,GAAA;",
4
+ "sourcesContent": ["/**\n * Plugin System Type Definitions\n */\n\nimport { z } from 'zod'\n\n/**\n * Author information (can be string or object)\n */\nexport const AuthorSchema = z.union([\n z.string(),\n z.object({\n name: z.string(),\n email: z.string().email().optional(),\n url: z.string().url().optional(),\n }),\n])\n\n/**\n * MCP Server Configuration Schema\n * Compatible with Claude Code CLI's .mcp.json format\n */\nexport const MCPServerConfigSchema = z.object({\n // Command-based (stdio) servers\n command: z.string().optional(),\n args: z.array(z.string()).optional().default([]),\n env: z.record(z.string()).optional().default({}),\n timeout: z.number().optional(),\n\n // HTTP/SSE servers\n type: z.enum(['stdio', 'http', 'sse']).optional().default('stdio'),\n url: z.string().optional(),\n headers: z.record(z.string()).optional(),\n})\n\nexport type MCPServerConfig = z.infer<typeof MCPServerConfigSchema>\n\n/**\n * Plugin Manifest Schema (plugin.json)\n * This is the source of truth for plugin metadata\n */\nexport const PluginManifestSchema = z.object({\n // Required fields\n name: z\n .string()\n .min(1)\n .regex(\n /^[a-z0-9-]+$/,\n 'Plugin name must be lowercase alphanumeric with hyphens',\n ),\n version: z.string().min(1), // Supports semver and commit hashes (for CC sync)\n description: z.string().min(1),\n\n // Optional metadata\n displayName: z.string().optional(),\n author: AuthorSchema.optional(),\n homepage: z.string().url().optional(),\n repository: z.string().url().optional(),\n license: z.string().optional(),\n\n // Plugin components (relative paths from plugin root)\n agents: z.array(z.string()).optional().default([]),\n commands: z.array(z.string()).optional().default([]),\n skills: z.array(z.string()).optional().default([]),\n hooks: z.array(z.string()).optional().default([]),\n\n // MCP servers support both:\n // - Array of file paths: [\"mcp-servers/server1.json\"]\n // - Object with inline configs: { \"server1\": { command: \"...\" } }\n mcpServers: z\n .union([z.array(z.string()), z.record(MCPServerConfigSchema)])\n .optional()\n .default([]),\n\n // Dependencies\n dependencies: z.record(z.string()).optional().default({}),\n\n // Minto/Claude Code version requirements\n engines: z\n .object({\n minto: z.string().optional(),\n 'claude-code': z.string().optional(),\n node: z.string().optional(),\n })\n .optional(),\n\n // Plugin-specific configuration schema\n configSchema: z.record(z.any()).optional(),\n})\n\nexport type PluginManifest = z.infer<typeof PluginManifestSchema>\n\n/**\n * Loaded Plugin (runtime representation)\n */\nexport interface LoadedPlugin {\n name: string\n manifest: PluginManifest\n location: string // Absolute path to plugin directory\n source: PluginSource\n agents: LoadedAgent[]\n commands: LoadedCommand[]\n skills: LoadedSkill[]\n hooks: LoadedHook[]\n mcpServers: LoadedMCPServer[]\n enabled: boolean\n config?: Record<string, any>\n}\n\n/**\n * Plugin source types\n */\nexport type PluginSource =\n | { type: 'local'; path: string }\n | { type: 'git'; repo: string; ref?: string }\n | { type: 'npm'; package: string; version?: string }\n | { type: 'marketplace'; marketplace: string; name: string }\n | { type: 'claude-code'; marketplace: string; name: string }\n\n/**\n * Agent component (from plugin)\n */\nexport interface LoadedAgent {\n name: string\n filePath: string\n config: {\n name: string\n description: string\n tools?: string | string[]\n model?: string\n content: string\n }\n pluginName: string\n}\n\n/**\n * Command component (from plugin)\n */\nexport interface LoadedCommand {\n name: string\n filePath: string\n config: {\n name: string\n description?: string\n aliases?: string[]\n enabled?: boolean\n hidden?: boolean\n progressMessage?: string\n argNames?: string[]\n 'allowed-tools'?: string[]\n content: string\n }\n pluginName: string\n}\n\n/**\n * Skill configuration (Claude Code specification compliant)\n */\nexport interface SkillConfig {\n // Identity\n name: string\n description: string\n argumentHint?: string // Hint for expected arguments\n\n // Invocation control (Claude Code spec)\n disableModelInvocation?: boolean // If true, model cannot auto-invoke (user-only)\n userInvocable?: boolean // If true, user can invoke via /command (default: true)\n\n // Execution configuration\n allowedTools?: string[] // Tools the skill can use\n model?: 'sonnet' | 'opus' | 'haiku' | 'inherit' // Model to use\n\n // Fork context (Claude Code spec)\n context?: 'fork' // Execute in isolated context\n agent?: string // Agent type to use for fork execution\n\n // Content\n content: string\n}\n\n/**\n * Skill component (from plugin or standalone)\n */\nexport interface LoadedSkill {\n name: string\n filePath: string\n config: SkillConfig\n pluginName: string // 'standalone' for standalone skills\n source: 'plugin' | 'user' | 'project' // Where the skill was loaded from\n}\n\n/**\n * Hook component (from plugin)\n */\nexport interface LoadedHook {\n name: string\n filePath: string\n config: {\n event: HookEvent\n matcher?: string\n type: 'command' | 'message' | 'notification'\n command?: string\n message?: string\n blocking?: boolean\n timeout?: number\n }\n pluginName: string\n event: HookEvent // Also store event at root level for easier access\n matcher?: string // Also store matcher at root level\n}\n\n/**\n * Hook lifecycle events\n */\nexport type HookEvent =\n | 'PreToolUse'\n | 'PostToolUse'\n | 'UserPromptSubmit'\n | 'SessionStart'\n | 'SessionEnd'\n | 'Stop'\n | 'SubagentStop'\n | 'Notification'\n | 'PreCompact'\n\n/**\n * MCP Server component (from plugin)\n */\nexport interface LoadedMCPServer {\n name: string\n filePath: string\n config: {\n command: string\n args?: string[]\n env?: Record<string, string>\n timeout?: number\n }\n pluginName: string\n}\n\n/**\n * Plugin installation options\n */\nexport interface PluginInstallOptions {\n source: PluginSource\n global?: boolean // Install globally vs project-level\n enable?: boolean // Auto-enable after install\n config?: Record<string, any> // Plugin-specific config\n}\n\n/**\n * Plugin marketplace configuration\n */\nexport interface PluginMarketplace {\n name: string\n source: PluginSource\n plugins: PluginManifest[]\n}\n\n/**\n * Plugin error types\n */\nexport class PluginError extends Error {\n constructor(\n message: string,\n public code: PluginErrorCode,\n public pluginName?: string,\n public details?: any,\n ) {\n super(message)\n this.name = 'PluginError'\n }\n}\n\nexport enum PluginErrorCode {\n MANIFEST_INVALID = 'MANIFEST_INVALID',\n MANIFEST_NOT_FOUND = 'MANIFEST_NOT_FOUND',\n VERSION_MISMATCH = 'VERSION_MISMATCH',\n DEPENDENCY_MISSING = 'DEPENDENCY_MISSING',\n COMPONENT_NOT_FOUND = 'COMPONENT_NOT_FOUND',\n COMPONENT_INVALID = 'COMPONENT_INVALID',\n ALREADY_INSTALLED = 'ALREADY_INSTALLED',\n NOT_INSTALLED = 'NOT_INSTALLED',\n PERMISSION_DENIED = 'PERMISSION_DENIED',\n}\n\n// ============================================================================\n// Session Plugin Types (Claude Code CLI Compatible)\n// ============================================================================\n\n/**\n * A loaded plugin in the current session\n * Compatible with Claude Code CLI session plugins\n */\nexport interface SessionPlugin {\n /** Plugin name from manifest */\n name: string\n /** Root directory of the plugin */\n rootDir: string\n /** Path to the manifest file */\n manifestPath: string\n /** Raw manifest data */\n manifest: unknown\n /** Directories containing custom commands */\n commandsDirs: string[]\n /** Directories containing skills */\n skillsDirs: string[]\n /** Directories containing agents */\n agentsDirs: string[]\n /** Paths to hooks configuration files */\n hooksFiles: string[]\n /** Directories containing output styles */\n outputStylesDirs: string[]\n /** Paths to MCP server configuration files */\n mcpConfigFiles: string[]\n /** Paths to LSP server configuration files (Claude Code CLI specific) */\n lspConfigFiles: string[]\n}\n\n/**\n * Plugin scope - where the plugin is installed/activated\n */\nexport type PluginScope = 'user' | 'project' | 'local'\n\n/**\n * Installed skill plugin record\n */\nexport interface InstalledSkillPlugin {\n plugin: string\n marketplace: string\n scope: PluginScope\n kind?: 'skill-pack' | 'plugin-pack'\n isEnabled?: boolean\n projectPath?: string\n installedAt: string\n pluginRoot?: string\n skills: string[]\n commands: string[]\n sourceMarketplacePath: string\n}\n"],
5
+ "mappings": "AAIA,SAAS,SAAS;AAKX,MAAM,eAAe,EAAE,MAAM;AAAA,EAClC,EAAE,OAAO;AAAA,EACT,EAAE,OAAO;AAAA,IACP,MAAM,EAAE,OAAO;AAAA,IACf,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS;AAAA,IACnC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACjC,CA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