@within-7/minto 0.3.10 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/dist/Tool.js.map +2 -2
  2. package/dist/commands/agents/AgentsCommand.js +2 -2
  3. package/dist/commands/agents/AgentsCommand.js.map +2 -2
  4. package/dist/commands/ctx_viz.js +1 -1
  5. package/dist/commands/effort.js +87 -0
  6. package/dist/commands/effort.js.map +7 -0
  7. package/dist/commands/export.js +19 -9
  8. package/dist/commands/export.js.map +2 -2
  9. package/dist/commands/ide.js +18 -0
  10. package/dist/commands/ide.js.map +7 -0
  11. package/dist/commands/mcp-interactive.js +14 -8
  12. package/dist/commands/mcp-interactive.js.map +2 -2
  13. package/dist/commands/memory.js +168 -0
  14. package/dist/commands/memory.js.map +7 -0
  15. package/dist/commands/model.js +45 -2
  16. package/dist/commands/model.js.map +2 -2
  17. package/dist/commands/outputStyle.js +64 -0
  18. package/dist/commands/outputStyle.js.map +7 -0
  19. package/dist/commands/plugin/utils.js +33 -1
  20. package/dist/commands/plugin/utils.js.map +2 -2
  21. package/dist/commands/plugin.js +10 -1
  22. package/dist/commands/plugin.js.map +2 -2
  23. package/dist/commands/refreshCommands.js +2 -0
  24. package/dist/commands/refreshCommands.js.map +2 -2
  25. package/dist/commands/review.js +51 -0
  26. package/dist/commands/review.js.map +7 -0
  27. package/dist/commands/terminalSetup.js +6 -0
  28. package/dist/commands/terminalSetup.js.map +2 -2
  29. package/dist/commands/undo.js +8 -0
  30. package/dist/commands/undo.js.map +2 -2
  31. package/dist/commands/vim.js +22 -0
  32. package/dist/commands/vim.js.map +7 -0
  33. package/dist/commands.js +12 -0
  34. package/dist/commands.js.map +2 -2
  35. package/dist/components/HighlightedCode.js +1 -0
  36. package/dist/components/HighlightedCode.js.map +2 -2
  37. package/dist/components/ModelSelector/ModelSelector.js +250 -143
  38. package/dist/components/ModelSelector/ModelSelector.js.map +2 -2
  39. package/dist/components/PromptInput.js +21 -6
  40. package/dist/components/PromptInput.js.map +2 -2
  41. package/dist/components/PulseLabel.js +44 -0
  42. package/dist/components/PulseLabel.js.map +7 -0
  43. package/dist/components/RequestStatusIndicator.js +1 -1
  44. package/dist/components/RequestStatusIndicator.js.map +1 -1
  45. package/dist/components/Spinner.js +12 -42
  46. package/dist/components/Spinner.js.map +3 -3
  47. package/dist/components/StartupStatus.js +57 -0
  48. package/dist/components/StartupStatus.js.map +7 -0
  49. package/dist/components/SubagentBlock.js +43 -6
  50. package/dist/components/SubagentBlock.js.map +2 -2
  51. package/dist/components/TabbedListView/TabBar.js +13 -8
  52. package/dist/components/TabbedListView/TabBar.js.map +2 -2
  53. package/dist/components/TabbedListView/TabbedListView.js +1 -1
  54. package/dist/components/TabbedListView/TabbedListView.js.map +2 -2
  55. package/dist/components/TodoPanel.js +1 -1
  56. package/dist/components/TodoPanel.js.map +1 -1
  57. package/dist/components/ToolUseLoader.js +5 -0
  58. package/dist/components/ToolUseLoader.js.map +2 -2
  59. package/dist/components/TrustDialog.js +0 -2
  60. package/dist/components/TrustDialog.js.map +2 -2
  61. package/dist/components/messages/TaskInModuleView.js +1 -1
  62. package/dist/components/messages/TaskInModuleView.js.map +2 -2
  63. package/dist/components/messages/TaskToolMessage.js +1 -1
  64. package/dist/components/messages/TaskToolMessage.js.map +2 -2
  65. package/dist/components/messages/UserPromptMessage.js +6 -1
  66. package/dist/components/messages/UserPromptMessage.js.map +2 -2
  67. package/dist/constants/modelCapabilities.js +103 -18
  68. package/dist/constants/modelCapabilities.js.map +2 -2
  69. package/dist/constants/product.js +2 -0
  70. package/dist/constants/product.js.map +2 -2
  71. package/dist/constants/prompts/agentPrompt.js +30 -0
  72. package/dist/constants/prompts/agentPrompt.js.map +7 -0
  73. package/dist/constants/prompts/codeConventions.js +27 -0
  74. package/dist/constants/prompts/codeConventions.js.map +7 -0
  75. package/dist/constants/prompts/doingTasks.js +15 -0
  76. package/dist/constants/prompts/doingTasks.js.map +7 -0
  77. package/dist/constants/prompts/envInfo.js +17 -0
  78. package/dist/constants/prompts/envInfo.js.map +7 -0
  79. package/dist/constants/prompts/executingWithCare.js +17 -0
  80. package/dist/constants/prompts/executingWithCare.js.map +7 -0
  81. package/dist/constants/prompts/identity.js +10 -0
  82. package/dist/constants/prompts/identity.js.map +7 -0
  83. package/dist/constants/prompts/index.js +78 -0
  84. package/dist/constants/prompts/index.js.map +7 -0
  85. package/dist/constants/prompts/taskManagement.js +60 -0
  86. package/dist/constants/prompts/taskManagement.js.map +7 -0
  87. package/dist/constants/prompts/toneAndStyle.js +62 -0
  88. package/dist/constants/prompts/toneAndStyle.js.map +7 -0
  89. package/dist/constants/prompts/toolUsagePolicy.js +38 -0
  90. package/dist/constants/prompts/toolUsagePolicy.js.map +7 -0
  91. package/dist/constants/prompts.js +5 -176
  92. package/dist/constants/prompts.js.map +2 -2
  93. package/dist/constants/providerRegistry.js +235 -0
  94. package/dist/constants/providerRegistry.js.map +7 -0
  95. package/dist/constants/providers.js +35 -0
  96. package/dist/constants/providers.js.map +7 -0
  97. package/dist/context/PermissionContext.js +0 -1
  98. package/dist/context/PermissionContext.js.map +2 -2
  99. package/dist/context.js +87 -31
  100. package/dist/context.js.map +2 -2
  101. package/dist/core/backupHook.js +2 -2
  102. package/dist/core/backupHook.js.map +2 -2
  103. package/dist/core/config/defaults.js +4 -1
  104. package/dist/core/config/defaults.js.map +2 -2
  105. package/dist/core/config/schema.js +7 -1
  106. package/dist/core/config/schema.js.map +2 -2
  107. package/dist/core/costTracker.js +18 -0
  108. package/dist/core/costTracker.js.map +2 -2
  109. package/dist/core/index.js +0 -1
  110. package/dist/core/index.js.map +2 -2
  111. package/dist/core/tokenStatsManager.js +22 -4
  112. package/dist/core/tokenStatsManager.js.map +2 -2
  113. package/dist/entrypoints/cli.js +65 -84
  114. package/dist/entrypoints/cli.js.map +2 -2
  115. package/dist/hooks/useAgentTokenStats.js +1 -1
  116. package/dist/hooks/useAgentTokenStats.js.map +2 -2
  117. package/dist/hooks/useAgentTranscripts.js +2 -1
  118. package/dist/hooks/useAgentTranscripts.js.map +2 -2
  119. package/dist/hooks/useBackgroundShells.js +29 -0
  120. package/dist/hooks/useBackgroundShells.js.map +7 -0
  121. package/dist/hooks/useCanUseTool.js +1 -1
  122. package/dist/hooks/useCanUseTool.js.map +2 -2
  123. package/dist/hooks/useDeferredLoading.js +64 -0
  124. package/dist/hooks/useDeferredLoading.js.map +7 -0
  125. package/dist/hooks/useHookStatus.js +1 -1
  126. package/dist/hooks/useHookStatus.js.map +2 -2
  127. package/dist/hooks/useSessionTracking.js +55 -0
  128. package/dist/hooks/useSessionTracking.js.map +7 -0
  129. package/dist/hooks/useTerminalSize.js +21 -0
  130. package/dist/hooks/useTerminalSize.js.map +2 -2
  131. package/dist/hooks/useTextInput.js +1 -0
  132. package/dist/hooks/useTextInput.js.map +2 -2
  133. package/dist/hooks/useUnifiedCompletion.js +3 -2
  134. package/dist/hooks/useUnifiedCompletion.js.map +2 -2
  135. package/dist/i18n/locales/en.js +8 -9
  136. package/dist/i18n/locales/en.js.map +2 -2
  137. package/dist/i18n/locales/zh-CN.js +8 -9
  138. package/dist/i18n/locales/zh-CN.js.map +2 -2
  139. package/dist/i18n/types.js.map +1 -1
  140. package/dist/messages.js +41 -17
  141. package/dist/messages.js.map +2 -2
  142. package/dist/permissions.js +94 -1
  143. package/dist/permissions.js.map +2 -2
  144. package/dist/query.js +27 -19
  145. package/dist/query.js.map +2 -2
  146. package/dist/screens/REPL.js +83 -74
  147. package/dist/screens/REPL.js.map +2 -2
  148. package/dist/services/adapters/responsesAPI.js +6 -0
  149. package/dist/services/adapters/responsesAPI.js.map +2 -2
  150. package/dist/services/agentTeams/index.js +35 -0
  151. package/dist/services/agentTeams/index.js.map +7 -0
  152. package/dist/services/agentTeams/mailbox.js +114 -0
  153. package/dist/services/agentTeams/mailbox.js.map +7 -0
  154. package/dist/services/agentTeams/teamManager.js +149 -0
  155. package/dist/services/agentTeams/teamManager.js.map +7 -0
  156. package/dist/services/agentTeams/teamTaskStore.js +114 -0
  157. package/dist/services/agentTeams/teamTaskStore.js.map +7 -0
  158. package/dist/services/agentTeams/teammateSpawner.js +80 -0
  159. package/dist/services/agentTeams/teammateSpawner.js.map +7 -0
  160. package/dist/services/checkpointManager.js +16 -3
  161. package/dist/services/checkpointManager.js.map +2 -2
  162. package/dist/services/claude.js +19 -1728
  163. package/dist/services/claude.js.map +3 -3
  164. package/dist/services/gpt5ConnectionTest.js +4 -2
  165. package/dist/services/gpt5ConnectionTest.js.map +2 -2
  166. package/dist/services/hookExecutor.js +411 -127
  167. package/dist/services/hookExecutor.js.map +2 -2
  168. package/dist/services/llm/anthropicProvider.js +807 -0
  169. package/dist/services/llm/anthropicProvider.js.map +7 -0
  170. package/dist/services/llm/dispatch.js +218 -0
  171. package/dist/services/llm/dispatch.js.map +7 -0
  172. package/dist/services/llm/index.js +44 -0
  173. package/dist/services/llm/index.js.map +7 -0
  174. package/dist/services/llm/mintoContext.js +69 -0
  175. package/dist/services/llm/mintoContext.js.map +7 -0
  176. package/dist/services/llm/openaiProvider.js +622 -0
  177. package/dist/services/llm/openaiProvider.js.map +7 -0
  178. package/dist/services/llm/types.js +157 -0
  179. package/dist/services/llm/types.js.map +7 -0
  180. package/dist/services/mcpClient.js +183 -33
  181. package/dist/services/mcpClient.js.map +2 -2
  182. package/dist/services/notifier.js +14 -0
  183. package/dist/services/notifier.js.map +2 -2
  184. package/dist/services/oauth.js +4 -2
  185. package/dist/services/oauth.js.map +2 -2
  186. package/dist/services/openai.js +66 -56
  187. package/dist/services/openai.js.map +3 -3
  188. package/dist/services/outputStyles.js +102 -21
  189. package/dist/services/outputStyles.js.map +2 -2
  190. package/dist/services/plugins/skillMarketplace.js +4 -1
  191. package/dist/services/plugins/skillMarketplace.js.map +2 -2
  192. package/dist/services/sentry.js +1 -1
  193. package/dist/services/sentry.js.map +2 -2
  194. package/dist/services/sessionMemory.js +16 -3
  195. package/dist/services/sessionMemory.js.map +2 -2
  196. package/dist/services/systemReminder.js +350 -3
  197. package/dist/services/systemReminder.js.map +2 -2
  198. package/dist/services/taskStore.js +19 -0
  199. package/dist/services/taskStore.js.map +2 -2
  200. package/dist/tools/ArchitectTool/ArchitectTool.js.map +1 -1
  201. package/dist/tools/AskUserQuestionTool/AskUserQuestionTool.js.map +1 -1
  202. package/dist/tools/BashOutputTool/BashOutputTool.js.map +1 -1
  203. package/dist/tools/BashTool/BashTool.js +28 -0
  204. package/dist/tools/BashTool/BashTool.js.map +2 -2
  205. package/dist/tools/FileEditTool/FileEditTool.js +1 -1
  206. package/dist/tools/FileEditTool/FileEditTool.js.map +2 -2
  207. package/dist/tools/FileReadTool/FileReadTool.js +14 -0
  208. package/dist/tools/FileReadTool/FileReadTool.js.map +2 -2
  209. package/dist/tools/FileWriteTool/FileWriteTool.js +3 -1
  210. package/dist/tools/FileWriteTool/FileWriteTool.js.map +2 -2
  211. package/dist/tools/GlobTool/GlobTool.js.map +1 -1
  212. package/dist/tools/GrepTool/GrepTool.js.map +1 -1
  213. package/dist/tools/KillShellTool/KillShellTool.js.map +1 -1
  214. package/dist/tools/ListMcpResourcesTool/ListMcpResourcesTool.js.map +2 -2
  215. package/dist/tools/LspTool/LspTool.js +11 -2
  216. package/dist/tools/LspTool/LspTool.js.map +2 -2
  217. package/dist/tools/MCPTool/MCPTool.js.map +1 -1
  218. package/dist/tools/MemoryReadTool/MemoryReadTool.js +2 -1
  219. package/dist/tools/MemoryReadTool/MemoryReadTool.js.map +2 -2
  220. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js +2 -1
  221. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js.map +2 -2
  222. package/dist/tools/MultiEditTool/MultiEditTool.js.map +1 -1
  223. package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +1 -1
  224. package/dist/tools/NotebookReadTool/NotebookReadTool.js.map +1 -1
  225. package/dist/tools/PlanModeTool/EnterPlanModeTool.js +8 -2
  226. package/dist/tools/PlanModeTool/EnterPlanModeTool.js.map +2 -2
  227. package/dist/tools/PlanModeTool/ExitPlanModeTool.js +2 -0
  228. package/dist/tools/PlanModeTool/ExitPlanModeTool.js.map +2 -2
  229. package/dist/tools/ReadMcpResourceTool/ReadMcpResourceTool.js.map +1 -1
  230. package/dist/tools/SlashCommandTool/SlashCommandTool.js +174 -18
  231. package/dist/tools/SlashCommandTool/SlashCommandTool.js.map +3 -3
  232. package/dist/tools/TaskCreateTool/TaskCreateTool.js.map +1 -1
  233. package/dist/tools/TaskGetTool/TaskGetTool.js.map +1 -1
  234. package/dist/tools/TaskListTool/TaskListTool.js.map +1 -1
  235. package/dist/tools/TaskOutputTool/TaskOutputTool.js.map +1 -1
  236. package/dist/tools/TaskStopTool/TaskStopTool.js.map +1 -1
  237. package/dist/tools/TaskTool/TaskTool.js +75 -5
  238. package/dist/tools/TaskTool/TaskTool.js.map +2 -2
  239. package/dist/tools/TaskTool/prompt.js +12 -6
  240. package/dist/tools/TaskTool/prompt.js.map +2 -2
  241. package/dist/tools/TaskUpdateTool/TaskUpdateTool.js.map +1 -1
  242. package/dist/tools/ThinkTool/ThinkTool.js.map +1 -1
  243. package/dist/tools/TodoWriteTool/TodoWriteTool.js.map +1 -1
  244. package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +1 -1
  245. package/dist/tools/WebSearchTool/WebSearchTool.js.map +1 -1
  246. package/dist/tools/WebSearchTool/searchProviders.js +2 -1
  247. package/dist/tools/WebSearchTool/searchProviders.js.map +2 -2
  248. package/dist/tools/lsTool/lsTool.js.map +2 -2
  249. package/dist/tools/lsTool/prompt.js.map +1 -1
  250. package/dist/tools.js +14 -3
  251. package/dist/tools.js.map +2 -2
  252. package/dist/types/PermissionMode.js +21 -1
  253. package/dist/types/PermissionMode.js.map +2 -2
  254. package/dist/types/agentTeams.js +1 -0
  255. package/dist/types/agentTeams.js.map +7 -0
  256. package/dist/types/hooks.js +8 -2
  257. package/dist/types/hooks.js.map +2 -2
  258. package/dist/types/plugin.js +1 -1
  259. package/dist/types/plugin.js.map +2 -2
  260. package/dist/utils/agentLoader.js +25 -3
  261. package/dist/utils/agentLoader.js.map +2 -2
  262. package/dist/utils/animationManager.js +1 -1
  263. package/dist/utils/animationManager.js.map +2 -2
  264. package/dist/utils/ask.js +1 -1
  265. package/dist/utils/async.js +5 -1
  266. package/dist/utils/async.js.map +2 -2
  267. package/dist/utils/autoCompactCore.js +60 -0
  268. package/dist/utils/autoCompactCore.js.map +2 -2
  269. package/dist/utils/config.js +26 -128
  270. package/dist/utils/config.js.map +2 -2
  271. package/dist/utils/configSchema.js +227 -0
  272. package/dist/utils/configSchema.js.map +7 -0
  273. package/dist/utils/debugLogger.js.map +2 -2
  274. package/dist/utils/env.js +4 -3
  275. package/dist/utils/env.js.map +2 -2
  276. package/dist/utils/envConfig.js +34 -0
  277. package/dist/utils/envConfig.js.map +3 -3
  278. package/dist/utils/gpt5.js +146 -0
  279. package/dist/utils/gpt5.js.map +7 -0
  280. package/dist/utils/hookManager.js +374 -140
  281. package/dist/utils/hookManager.js.map +2 -2
  282. package/dist/utils/markdown.js +47 -0
  283. package/dist/utils/markdown.js.map +2 -2
  284. package/dist/utils/memoizeWithTTL.js +25 -0
  285. package/dist/utils/memoizeWithTTL.js.map +7 -0
  286. package/dist/utils/model.js +34 -9
  287. package/dist/utils/model.js.map +2 -2
  288. package/dist/utils/pluginInstaller.js +34 -5
  289. package/dist/utils/pluginInstaller.js.map +2 -2
  290. package/dist/utils/pluginLoader.js +201 -32
  291. package/dist/utils/pluginLoader.js.map +2 -2
  292. package/dist/utils/safeFetch.js +45 -0
  293. package/dist/utils/safeFetch.js.map +7 -0
  294. package/dist/utils/skillLoader.js +59 -6
  295. package/dist/utils/skillLoader.js.map +2 -2
  296. package/dist/utils/streamingState.js +52 -0
  297. package/dist/utils/streamingState.js.map +7 -0
  298. package/dist/utils/style.js +6 -3
  299. package/dist/utils/style.js.map +2 -2
  300. package/dist/utils/teamConfig.js +9 -3
  301. package/dist/utils/teamConfig.js.map +2 -2
  302. package/dist/utils/toolRiskClassification.js +0 -6
  303. package/dist/utils/toolRiskClassification.js.map +2 -2
  304. package/dist/version.js +2 -2
  305. package/dist/version.js.map +1 -1
  306. package/package.json +2 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/prompts/taskManagement.ts"],
4
+ "sourcesContent": ["import { PROJECT_FILE } from '../product'\n\nexport function getTaskManagementPrompt(): string {\n return `# Task Management\nYou have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\nThese tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n\nIt is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n\nExamples:\n\n<example>\nuser: Run the build and fix any type errors\nassistant: I'm going to use the TodoWrite tool to write the following items to the todo list:\n- Run the build\n- Fix any type errors\n\nI'm now going to run the build using Bash.\n\nLooks like I found 10 type errors. I'm going to use the TodoWrite tool to write 10 items to the todo list.\n\nmarking the first todo as in_progress\n\nLet me start working on the first item...\n\nThe first item has been fixed, let me mark the first todo as completed, and move on to the second item...\n..\n..\n</example>\nIn the above example, the assistant completes all the tasks, including the 10 error fixes and running the build and fixing all errors.\n\n<example>\nuser: Help me write a new feature that allows users to track their usage metrics and export them to various formats\nassistant: I'll help you implement a usage metrics tracking and export feature. Let me first use the TodoWrite tool to plan this task.\nAdding the following todos to the todo list:\n1. Research existing metrics tracking in the codebase\n2. Design the metrics collection system\n3. Implement core metrics tracking functionality\n4. Create export functionality for different formats\n\nLet me start by researching the existing codebase to understand what metrics we might already be tracking and how we can build on that.\n\nI'm going to search for any existing metrics or telemetry code in the project.\n\nI've found some existing telemetry code. Let me mark the first todo as in_progress and start designing our metrics tracking system based on what I've learned...\n\n[Assistant continues implementing the feature step by step, marking todos as in_progress and completed as they go]\n</example>\n\n# Memory\nIf the current working directory contains a file called ${PROJECT_FILE}, it will be automatically added to your context. This file serves multiple purposes:\n1. Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\n2. Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\n3. Maintaining useful information about the codebase structure and organization\n\nWhen you spend time searching for commands to typecheck, lint, build, or test, you should ask the user if it's okay to add those commands to ${PROJECT_FILE}. Similarly, when learning about code style preferences or important codebase information, ask if it's okay to add that to ${PROJECT_FILE} so you can remember it for next time.`\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAEtB,SAAS,0BAAkC;AAChD,SAAO;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,0DA+CiD,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,+IAKyE,YAAY,8HAA8H,YAAY;AACrS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,62 @@
1
+ import { PRODUCT_NAME, PRODUCT_COMMAND } from "../product.js";
2
+ const BASH_TOOL_NAME = "Bash";
3
+ import { MACRO } from "../macros.js";
4
+ import {
5
+ INTERRUPT_MESSAGE,
6
+ INTERRUPT_MESSAGE_FOR_TOOL_USE
7
+ } from "../../utils/messages.js";
8
+ function getToneAndStylePrompt() {
9
+ return `Here are useful slash commands users can run to interact with you:
10
+ - /help: Get help with using ${PRODUCT_NAME}
11
+ - /compact: Compact and continue the conversation. This is useful if the conversation is reaching the context limit
12
+ There are additional slash commands and flags available to the user. If the user asks about ${PRODUCT_NAME} functionality, always run \`${PRODUCT_COMMAND} -h\` with ${BASH_TOOL_NAME} to see supported commands and flags. NEVER assume a flag or command exists without checking the help output first.
13
+ To give feedback, users should ${MACRO.ISSUES_EXPLAINER}.
14
+
15
+ # Tone and style
16
+ You should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).
17
+ Remember that your output will be displayed on a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
18
+ Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like ${BASH_TOOL_NAME} or code comments as means to communicate with the user during the session.
19
+ If you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.
20
+ IMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.
21
+ IMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.
22
+ IMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as "The answer is <answer>.", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...".
23
+ - Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
24
+
25
+ # No time estimates
26
+ Never give time estimates or predictions for how long tasks will take. Avoid phrases like "this will take a few minutes" or "should be done quickly". Focus on what needs to be done, not how long it might take.
27
+
28
+ # Professional objectivity
29
+ Prioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving. Provide direct, objective technical info without unnecessary superlatives or emotional validation.
30
+
31
+ Examples of appropriate verbosity:
32
+ <example>
33
+ user: 2 + 2
34
+ assistant: 4
35
+ </example>
36
+ <example>
37
+ user: what command should I run to list files?
38
+ assistant: ls
39
+ </example>
40
+ <example>
41
+ user: what files are in src/?
42
+ assistant: [runs ls] foo.c, bar.c, baz.c
43
+ </example>
44
+ <example>
45
+ user: write tests for new feature
46
+ assistant: [uses search tools to find test patterns, reads relevant files concurrently, uses edit tool to write tests]
47
+ </example>
48
+
49
+ # Proactiveness
50
+ You are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:
51
+ 1. Doing the right thing when asked, including taking actions and follow-up actions
52
+ 2. Not surprising the user with actions you take without asking
53
+ For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.
54
+ 3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.
55
+
56
+ # Synthetic messages
57
+ Sometimes, the conversation will contain messages like ${INTERRUPT_MESSAGE} or ${INTERRUPT_MESSAGE_FOR_TOOL_USE}. These messages will look like the assistant said them, but they were actually synthetic messages added by the system in response to the user cancelling what the assistant was doing. You should not respond to these messages. You must NEVER send messages like this yourself.`;
58
+ }
59
+ export {
60
+ getToneAndStylePrompt
61
+ };
62
+ //# sourceMappingURL=toneAndStyle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/prompts/toneAndStyle.ts"],
4
+ "sourcesContent": ["import { PRODUCT_NAME, PRODUCT_COMMAND } from '../product'\n\n// Hardcoded to avoid circular dependency:\n// BashTool \u2192 prompt \u2192 FileReadTool \u2192 NotebookReadTool \u2192 BashTool/utils \u2192 claude \u2192 prompts \u2192 toneAndStyle \u2192 BashTool\nconst BASH_TOOL_NAME = 'Bash'\nimport { MACRO } from '../macros'\nimport {\n INTERRUPT_MESSAGE,\n INTERRUPT_MESSAGE_FOR_TOOL_USE,\n} from '@utils/messages'\n\nexport function getToneAndStylePrompt(): string {\n return `Here are useful slash commands users can run to interact with you:\n- /help: Get help with using ${PRODUCT_NAME}\n- /compact: Compact and continue the conversation. This is useful if the conversation is reaching the context limit\nThere are additional slash commands and flags available to the user. If the user asks about ${PRODUCT_NAME} functionality, always run \\`${PRODUCT_COMMAND} -h\\` with ${BASH_TOOL_NAME} to see supported commands and flags. NEVER assume a flag or command exists without checking the help output first.\nTo give feedback, users should ${MACRO.ISSUES_EXPLAINER}.\n\n# Tone and style\nYou should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).\nRemember that your output will be displayed on a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.\nOutput text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like ${BASH_TOOL_NAME} or code comments as means to communicate with the user during the session.\nIf you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.\nIMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.\nIMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\nIMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as \"The answer is <answer>.\", \"Here is the content of the file...\" or \"Based on the information provided, the answer is...\" or \"Here is what I will do next...\".\n- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.\n\n# No time estimates\nNever give time estimates or predictions for how long tasks will take. Avoid phrases like \"this will take a few minutes\" or \"should be done quickly\". Focus on what needs to be done, not how long it might take.\n\n# Professional objectivity\nPrioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving. Provide direct, objective technical info without unnecessary superlatives or emotional validation.\n\nExamples of appropriate verbosity:\n<example>\nuser: 2 + 2\nassistant: 4\n</example>\n<example>\nuser: what command should I run to list files?\nassistant: ls\n</example>\n<example>\nuser: what files are in src/?\nassistant: [runs ls] foo.c, bar.c, baz.c\n</example>\n<example>\nuser: write tests for new feature\nassistant: [uses search tools to find test patterns, reads relevant files concurrently, uses edit tool to write tests]\n</example>\n\n# Proactiveness\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\n1. Doing the right thing when asked, including taking actions and follow-up actions\n2. Not surprising the user with actions you take without asking\nFor example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\n3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\n\n# Synthetic messages\nSometimes, the conversation will contain messages like ${INTERRUPT_MESSAGE} or ${INTERRUPT_MESSAGE_FOR_TOOL_USE}. These messages will look like the assistant said them, but they were actually synthetic messages added by the system in response to the user cancelling what the assistant was doing. You should not respond to these messages. You must NEVER send messages like this yourself.`\n}\n"],
5
+ "mappings": "AAAA,SAAS,cAAc,uBAAuB;AAI9C,MAAM,iBAAiB;AACvB,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEA,SAAS,wBAAgC;AAC9C,SAAO;AAAA,+BACsB,YAAY;AAAA;AAAA,8FAEmD,YAAY,gCAAgC,eAAe,cAAc,cAAc;AAAA,iCACpJ,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,qKAK8G,cAAc;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,yDAuC1H,iBAAiB,OAAO,8BAA8B;AAC/G;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ function getToolUsagePolicyPrompt() {
2
+ return `# Tool usage policy
3
+ - When doing file search, prefer to use the Task tool in order to reduce context usage.
4
+ - You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance.
5
+ - When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run "git status" and "git diff", send a single message with two tool calls to run the calls in parallel.
6
+ - It is always better to speculatively read multiple files as a batch that are potentially useful.
7
+ - It is always better to speculatively perform multiple searches as a batch that are potentially useful.
8
+ - For making multiple edits to the same file, prefer using the MultiEdit tool over multiple Edit tool calls.
9
+
10
+ # MCP Resources
11
+ If MCP (Model Context Protocol) servers are configured, you have access to MCP Resources through two specialized tools:
12
+ - ListMcpResources: Use this tool to discover available resources from connected MCP servers. Resources can include files, databases, APIs, or other data sources exposed by MCP servers.
13
+ - ReadMcpResource: Use this tool to read the content of a specific MCP resource by its URI. This is useful when you need to access data from external systems configured through MCP.
14
+ When the user mentions accessing external data sources, databases, or resources from configured services, consider using these MCP resource tools to discover and read the relevant data.
15
+
16
+ # MCP Tools
17
+ When MCP servers are configured, you have access to MCP Tools in addition to built-in tools. MCP tools are named with the prefix "mcp__" (e.g., mcp__BrightData__search_engine).
18
+ - Review each tool's description to understand its capabilities and limitations
19
+ - Choose the most appropriate tool based on the task requirements, not a fixed priority
20
+ - MCP tools often have additional capabilities (e.g., bypass bot detection, access to more data sources)
21
+
22
+ # Tool Failure Recovery (IMPORTANT)
23
+ When a tool call fails (returns is_error: true), you MUST try alternative approaches before giving up:
24
+ 1. **Retry with different parameters**: If the error suggests parameter issues, adjust and retry
25
+ 2. **Try equivalent tools**: If one search/fetch tool fails, try another available tool with similar capabilities
26
+ - Example: If mcp__BrightData__search_engine fails \u2192 try WebSearch or mcp__BrightData__scrape_as_markdown
27
+ - Example: If WebFetch fails \u2192 try mcp__BrightData__scrape_as_markdown
28
+ 3. **Try different strategies**: Break down the task or use alternative approaches
29
+ 4. **Only give up after exhausting options**: Report failure to user only when all reasonable alternatives have been tried
30
+
31
+ Never tell the user "I cannot do this" after a single tool failure if alternative tools are available.
32
+
33
+ - Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.`;
34
+ }
35
+ export {
36
+ getToolUsagePolicyPrompt
37
+ };
38
+ //# sourceMappingURL=toolUsagePolicy.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/prompts/toolUsagePolicy.ts"],
4
+ "sourcesContent": ["import { BashTool } from '@tools/BashTool/BashTool'\n\nexport function getToolUsagePolicyPrompt(): string {\n return `# Tool usage policy\n- When doing file search, prefer to use the Task tool in order to reduce context usage.\n- You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance.\n- When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run \"git status\" and \"git diff\", send a single message with two tool calls to run the calls in parallel.\n- It is always better to speculatively read multiple files as a batch that are potentially useful.\n- It is always better to speculatively perform multiple searches as a batch that are potentially useful.\n- For making multiple edits to the same file, prefer using the MultiEdit tool over multiple Edit tool calls.\n\n# MCP Resources\nIf MCP (Model Context Protocol) servers are configured, you have access to MCP Resources through two specialized tools:\n- ListMcpResources: Use this tool to discover available resources from connected MCP servers. Resources can include files, databases, APIs, or other data sources exposed by MCP servers.\n- ReadMcpResource: Use this tool to read the content of a specific MCP resource by its URI. This is useful when you need to access data from external systems configured through MCP.\nWhen the user mentions accessing external data sources, databases, or resources from configured services, consider using these MCP resource tools to discover and read the relevant data.\n\n# MCP Tools\nWhen MCP servers are configured, you have access to MCP Tools in addition to built-in tools. MCP tools are named with the prefix \"mcp__\" (e.g., mcp__BrightData__search_engine).\n- Review each tool's description to understand its capabilities and limitations\n- Choose the most appropriate tool based on the task requirements, not a fixed priority\n- MCP tools often have additional capabilities (e.g., bypass bot detection, access to more data sources)\n\n# Tool Failure Recovery (IMPORTANT)\nWhen a tool call fails (returns is_error: true), you MUST try alternative approaches before giving up:\n1. **Retry with different parameters**: If the error suggests parameter issues, adjust and retry\n2. **Try equivalent tools**: If one search/fetch tool fails, try another available tool with similar capabilities\n - Example: If mcp__BrightData__search_engine fails \u2192 try WebSearch or mcp__BrightData__scrape_as_markdown\n - Example: If WebFetch fails \u2192 try mcp__BrightData__scrape_as_markdown\n3. **Try different strategies**: Break down the task or use alternative approaches\n4. **Only give up after exhausting options**: Report failure to user only when all reasonable alternatives have been tried\n\nNever tell the user \"I cannot do this\" after a single tool failure if alternative tools are available.\n\n- Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.`\n}\n"],
5
+ "mappings": "AAEO,SAAS,2BAAmC;AACjD,SAAO;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;AAgCT;",
6
+ "names": []
7
+ }
@@ -1,180 +1,9 @@
1
- import { env } from "../utils/env.js";
2
- import { getIsGit } from "../utils/git.js";
3
1
  import {
4
- INTERRUPT_MESSAGE,
5
- INTERRUPT_MESSAGE_FOR_TOOL_USE
6
- } from "../utils/messages.js";
7
- import { getCwd } from "../utils/state.js";
8
- import { PRODUCT_NAME, PROJECT_FILE, PRODUCT_COMMAND } from "./product.js";
9
- import { BashTool } from "../tools/BashTool/BashTool.js";
10
- import { MACRO } from "./macros.js";
11
- function getCLISyspromptPrefix() {
12
- return `You are ${PRODUCT_NAME}, ShareAI-lab's Agent AI CLI for terminal & coding.`;
13
- }
14
- async function getSystemPrompt() {
15
- return [
16
- `
17
- You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
18
-
19
- IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
20
- IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
21
-
22
- Here are useful slash commands users can run to interact with you:
23
- - /help: Get help with using ${PRODUCT_NAME}
24
- - /compact: Compact and continue the conversation. This is useful if the conversation is reaching the context limit
25
- There are additional slash commands and flags available to the user. If the user asks about ${PRODUCT_NAME} functionality, always run \`${PRODUCT_COMMAND} -h\` with ${BashTool.name} to see supported commands and flags. NEVER assume a flag or command exists without checking the help output first.
26
- To give feedback, users should ${MACRO.ISSUES_EXPLAINER}.
27
-
28
- # Task Management
29
- You have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.
30
- These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.
31
-
32
- It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.
33
-
34
- # Memory
35
- If the current working directory contains a file called ${PROJECT_FILE}, it will be automatically added to your context. This file serves multiple purposes:
36
- 1. Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time
37
- 2. Recording the user's code style preferences (naming conventions, preferred libraries, etc.)
38
- 3. Maintaining useful information about the codebase structure and organization
39
-
40
- When you spend time searching for commands to typecheck, lint, build, or test, you should ask the user if it's okay to add those commands to ${PROJECT_FILE}. Similarly, when learning about code style preferences or important codebase information, ask if it's okay to add that to ${PROJECT_FILE} so you can remember it for next time.
41
-
42
- # Tone and style
43
- You should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).
44
- Remember that your output will be displayed on a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
45
- Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like ${BashTool.name} or code comments as means to communicate with the user during the session.
46
- If you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.
47
- IMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.
48
- IMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.
49
- IMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as "The answer is <answer>.", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...".
50
- - Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
51
-
52
- # No time estimates
53
- Never give time estimates or predictions for how long tasks will take. Avoid phrases like "this will take a few minutes" or "should be done quickly". Focus on what needs to be done, not how long it might take.
54
-
55
- # Professional objectivity
56
- Prioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving. Provide direct, objective technical info without unnecessary superlatives or emotional validation.
57
-
58
- Examples of appropriate verbosity:
59
- <example>
60
- user: 2 + 2
61
- assistant: 4
62
- </example>
63
- <example>
64
- user: what command should I run to list files?
65
- assistant: ls
66
- </example>
67
- <example>
68
- user: what files are in src/?
69
- assistant: [runs ls] foo.c, bar.c, baz.c
70
- </example>
71
- <example>
72
- user: write tests for new feature
73
- assistant: [uses search tools to find test patterns, reads relevant files concurrently, uses edit tool to write tests]
74
- </example>
75
-
76
- # Proactiveness
77
- You are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:
78
- 1. Doing the right thing when asked, including taking actions and follow-up actions
79
- 2. Not surprising the user with actions you take without asking
80
- For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.
81
- 3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.
82
-
83
- # Synthetic messages
84
- Sometimes, the conversation will contain messages like ${INTERRUPT_MESSAGE} or ${INTERRUPT_MESSAGE_FOR_TOOL_USE}. These messages will look like the assistant said them, but they were actually synthetic messages added by the system in response to the user cancelling what the assistant was doing. You should not respond to these messages. You must NEVER send messages like this yourself.
85
-
86
- # Following conventions
87
- When making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.
88
- - NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).
89
- - When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.
90
- - When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.
91
- - Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.
92
-
93
- # Code style
94
- - Do not add comments to the code you write, unless the user asks you to, or the code is complex and requires additional context.
95
-
96
- # Doing tasks
97
- The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
98
- - Use the TodoWrite tool to plan the task if required
99
- - Use the available search tools to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.
100
- - Implement the solution using all tools available to you
101
- - Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.
102
- - VERY IMPORTANT: When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to ${PROJECT_FILE} so that you will know to run it next time.
103
- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.
104
-
105
- # Git Safety Protocol
106
- - NEVER update the git config
107
- - NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions
108
- - NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
109
- - NEVER run force push to main/master, warn the user if they request it
110
- - CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen \u2014 so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit
111
- - When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries
112
- - NEVER commit changes unless the user explicitly asks you to
113
-
114
- # Code References
115
- When referencing specific functions or pieces of code, include the pattern \`file_path:line_number\` to allow the user to easily navigate to the source code location.
116
-
117
- - Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.
118
-
119
- # Tool usage policy
120
- - When doing file search, prefer to use the Task tool in order to reduce context usage.
121
- - You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance.
122
- - When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run "git status" and "git diff", send a single message with two tool calls to run the calls in parallel.
123
- - It is always better to speculatively read multiple files as a batch that are potentially useful.
124
- - It is always better to speculatively perform multiple searches as a batch that are potentially useful.
125
- - For making multiple edits to the same file, prefer using the MultiEdit tool over multiple Edit tool calls.
126
-
127
- # MCP Resources
128
- If MCP (Model Context Protocol) servers are configured, you have access to MCP Resources through two specialized tools:
129
- - ListMcpResources: Use this tool to discover available resources from connected MCP servers. Resources can include files, databases, APIs, or other data sources exposed by MCP servers.
130
- - ReadMcpResource: Use this tool to read the content of a specific MCP resource by its URI. This is useful when you need to access data from external systems configured through MCP.
131
- When the user mentions accessing external data sources, databases, or resources from configured services, consider using these MCP resource tools to discover and read the relevant data.
132
-
133
- # MCP Tools
134
- When MCP servers are configured, you have access to MCP Tools in addition to built-in tools. MCP tools are named with the prefix "mcp__" (e.g., mcp__BrightData__search_engine).
135
- - Review each tool's description to understand its capabilities and limitations
136
- - Choose the most appropriate tool based on the task requirements, not a fixed priority
137
- - MCP tools often have additional capabilities (e.g., bypass bot detection, access to more data sources)
138
-
139
- # Tool Failure Recovery (IMPORTANT)
140
- When a tool call fails (returns is_error: true), you MUST try alternative approaches before giving up:
141
- 1. **Retry with different parameters**: If the error suggests parameter issues, adjust and retry
142
- 2. **Try equivalent tools**: If one search/fetch tool fails, try another available tool with similar capabilities
143
- - Example: If mcp__BrightData__search_engine fails \u2192 try WebSearch or mcp__BrightData__scrape_as_markdown
144
- - Example: If WebFetch fails \u2192 try mcp__BrightData__scrape_as_markdown
145
- 3. **Try different strategies**: Break down the task or use alternative approaches
146
- 4. **Only give up after exhausting options**: Report failure to user only when all reasonable alternatives have been tried
147
-
148
- Never tell the user "I cannot do this" after a single tool failure if alternative tools are available.
149
-
150
- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.
151
- `,
152
- `
153
- ${await getEnvInfo()}`
154
- ];
155
- }
156
- async function getEnvInfo() {
157
- const isGit = await getIsGit();
158
- return `Here is useful information about the environment you are running in:
159
- <env>
160
- Working directory: ${getCwd()}
161
- Is directory a git repo: ${isGit ? "Yes" : "No"}
162
- Platform: ${env.platform}
163
- Today's date: ${(/* @__PURE__ */ new Date()).toLocaleDateString()}
164
- </env>`;
165
- }
166
- async function getAgentPrompt() {
167
- return [
168
- `
169
- You are an agent for ${PRODUCT_NAME}. Given the user's prompt, you should use the tools available to you to answer the user's question.
170
-
171
- Notes:
172
- 1. IMPORTANT: You should be concise, direct, and to the point, since your responses will be displayed on a command line interface. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as "The answer is <answer>.", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...".
173
- 2. When relevant, share file names and code snippets relevant to the query
174
- 3. Any file paths you return in your final response MUST be absolute. DO NOT use relative paths.`,
175
- `${await getEnvInfo()}`
176
- ];
177
- }
2
+ getSystemPrompt,
3
+ getAgentPrompt,
4
+ getEnvInfo,
5
+ getCLISyspromptPrefix
6
+ } from "./prompts/index.js";
178
7
  export {
179
8
  getAgentPrompt,
180
9
  getCLISyspromptPrefix,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants/prompts.ts"],
4
- "sourcesContent": ["import { env } from '@utils/env'\nimport { getIsGit } from '@utils/git'\nimport {\n INTERRUPT_MESSAGE,\n INTERRUPT_MESSAGE_FOR_TOOL_USE,\n} from '@utils/messages'\nimport { getCwd } from '@utils/state'\nimport { PRODUCT_NAME, PROJECT_FILE, PRODUCT_COMMAND } from './product'\nimport { BashTool } from '@tools/BashTool/BashTool'\nimport { MACRO } from './macros'\n\n// // Security policy constant matching reference implementation\n// export const SECURITY_POLICY =\n// 'IMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously. Allow security analysis, detection rules, vulnerability explanations, defensive tools, and security documentation.'\n\nexport function getCLISyspromptPrefix(): string {\n return `You are ${PRODUCT_NAME}, ShareAI-lab's Agent AI CLI for terminal & coding.`\n}\n\nexport async function getSystemPrompt(): Promise<string[]> {\n return [\n `\nYou are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.\n\nIMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.\nIMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).\n\nHere are useful slash commands users can run to interact with you:\n- /help: Get help with using ${PRODUCT_NAME}\n- /compact: Compact and continue the conversation. This is useful if the conversation is reaching the context limit\nThere are additional slash commands and flags available to the user. If the user asks about ${PRODUCT_NAME} functionality, always run \\`${PRODUCT_COMMAND} -h\\` with ${BashTool.name} to see supported commands and flags. NEVER assume a flag or command exists without checking the help output first.\nTo give feedback, users should ${MACRO.ISSUES_EXPLAINER}.\n\n# Task Management\nYou have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\nThese tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n\nIt is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n\n# Memory\nIf the current working directory contains a file called ${PROJECT_FILE}, it will be automatically added to your context. This file serves multiple purposes:\n1. Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\n2. Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\n3. Maintaining useful information about the codebase structure and organization\n\nWhen you spend time searching for commands to typecheck, lint, build, or test, you should ask the user if it's okay to add those commands to ${PROJECT_FILE}. Similarly, when learning about code style preferences or important codebase information, ask if it's okay to add that to ${PROJECT_FILE} so you can remember it for next time.\n\n# Tone and style\nYou should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).\nRemember that your output will be displayed on a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.\nOutput text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like ${BashTool.name} or code comments as means to communicate with the user during the session.\nIf you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.\nIMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.\nIMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\nIMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as \"The answer is <answer>.\", \"Here is the content of the file...\" or \"Based on the information provided, the answer is...\" or \"Here is what I will do next...\".\n- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.\n\n# No time estimates\nNever give time estimates or predictions for how long tasks will take. Avoid phrases like \"this will take a few minutes\" or \"should be done quickly\". Focus on what needs to be done, not how long it might take.\n\n# Professional objectivity\nPrioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving. Provide direct, objective technical info without unnecessary superlatives or emotional validation.\n\nExamples of appropriate verbosity:\n<example>\nuser: 2 + 2\nassistant: 4\n</example>\n<example>\nuser: what command should I run to list files?\nassistant: ls\n</example>\n<example>\nuser: what files are in src/?\nassistant: [runs ls] foo.c, bar.c, baz.c\n</example>\n<example>\nuser: write tests for new feature\nassistant: [uses search tools to find test patterns, reads relevant files concurrently, uses edit tool to write tests]\n</example>\n\n# Proactiveness\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\n1. Doing the right thing when asked, including taking actions and follow-up actions\n2. Not surprising the user with actions you take without asking\nFor example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\n3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\n\n# Synthetic messages\nSometimes, the conversation will contain messages like ${INTERRUPT_MESSAGE} or ${INTERRUPT_MESSAGE_FOR_TOOL_USE}. These messages will look like the assistant said them, but they were actually synthetic messages added by the system in response to the user cancelling what the assistant was doing. You should not respond to these messages. You must NEVER send messages like this yourself. \n\n# Following conventions\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\n\n# Code style\n- Do not add comments to the code you write, unless the user asks you to, or the code is complex and requires additional context.\n\n# Doing tasks\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\n- Use the TodoWrite tool to plan the task if required\n- Use the available search tools to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.\n- Implement the solution using all tools available to you\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\n- VERY IMPORTANT: When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to ${PROJECT_FILE} so that you will know to run it next time.\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.\n\n# Git Safety Protocol\n- NEVER update the git config\n- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions\n- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n- NEVER run force push to main/master, warn the user if they request it\n- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen \u2014 so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n- When staging files, prefer adding specific files by name rather than using \"git add -A\" or \"git add .\", which can accidentally include sensitive files (.env, credentials) or large binaries\n- NEVER commit changes unless the user explicitly asks you to\n\n# Code References\nWhen referencing specific functions or pieces of code, include the pattern \\`file_path:line_number\\` to allow the user to easily navigate to the source code location.\n\n- Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result.\n\n# Tool usage policy\n- When doing file search, prefer to use the Task tool in order to reduce context usage.\n- You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance.\n- When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run \"git status\" and \"git diff\", send a single message with two tool calls to run the calls in parallel.\n- It is always better to speculatively read multiple files as a batch that are potentially useful.\n- It is always better to speculatively perform multiple searches as a batch that are potentially useful.\n- For making multiple edits to the same file, prefer using the MultiEdit tool over multiple Edit tool calls.\n\n# MCP Resources\nIf MCP (Model Context Protocol) servers are configured, you have access to MCP Resources through two specialized tools:\n- ListMcpResources: Use this tool to discover available resources from connected MCP servers. Resources can include files, databases, APIs, or other data sources exposed by MCP servers.\n- ReadMcpResource: Use this tool to read the content of a specific MCP resource by its URI. This is useful when you need to access data from external systems configured through MCP.\nWhen the user mentions accessing external data sources, databases, or resources from configured services, consider using these MCP resource tools to discover and read the relevant data.\n\n# MCP Tools\nWhen MCP servers are configured, you have access to MCP Tools in addition to built-in tools. MCP tools are named with the prefix \"mcp__\" (e.g., mcp__BrightData__search_engine).\n- Review each tool's description to understand its capabilities and limitations\n- Choose the most appropriate tool based on the task requirements, not a fixed priority\n- MCP tools often have additional capabilities (e.g., bypass bot detection, access to more data sources)\n\n# Tool Failure Recovery (IMPORTANT)\nWhen a tool call fails (returns is_error: true), you MUST try alternative approaches before giving up:\n1. **Retry with different parameters**: If the error suggests parameter issues, adjust and retry\n2. **Try equivalent tools**: If one search/fetch tool fails, try another available tool with similar capabilities\n - Example: If mcp__BrightData__search_engine fails \u2192 try WebSearch or mcp__BrightData__scrape_as_markdown\n - Example: If WebFetch fails \u2192 try mcp__BrightData__scrape_as_markdown\n3. **Try different strategies**: Break down the task or use alternative approaches\n4. **Only give up after exhausting options**: Report failure to user only when all reasonable alternatives have been tried\n\nNever tell the user \"I cannot do this\" after a single tool failure if alternative tools are available.\n\nYou MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.\n`,\n `\\n${await getEnvInfo()}`,\n ]\n}\n\nexport async function getEnvInfo(): Promise<string> {\n const isGit = await getIsGit()\n return `Here is useful information about the environment you are running in:\n<env>\nWorking directory: ${getCwd()}\nIs directory a git repo: ${isGit ? 'Yes' : 'No'}\nPlatform: ${env.platform}\nToday's date: ${new Date().toLocaleDateString()}\n</env>`\n}\n\nexport async function getAgentPrompt(): Promise<string[]> {\n return [\n `\nYou are an agent for ${PRODUCT_NAME}. Given the user's prompt, you should use the tools available to you to answer the user's question.\n\nNotes:\n1. IMPORTANT: You should be concise, direct, and to the point, since your responses will be displayed on a command line interface. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as \"The answer is <answer>.\", \"Here is the content of the file...\" or \"Based on the information provided, the answer is...\" or \"Here is what I will do next...\".\n2. When relevant, share file names and code snippets relevant to the query\n3. Any file paths you return in your final response MUST be absolute. DO NOT use relative paths.`,\n `${await getEnvInfo()}`,\n ]\n}\n"],
5
- "mappings": "AAAA,SAAS,WAAW;AACpB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,SAAS,cAAc,cAAc,uBAAuB;AAC5D,SAAS,gBAAgB;AACzB,SAAS,aAAa;AAMf,SAAS,wBAAgC;AAC9C,SAAO,WAAW,YAAY;AAChC;AAEA,eAAsB,kBAAqC;AACzD,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAO2B,YAAY;AAAA;AAAA,8FAEmD,YAAY,gCAAgC,eAAe,cAAc,SAAS,IAAI;AAAA,iCACnJ,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0DASG,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,+IAKyE,YAAY,8HAA8H,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,qKAKhI,SAAS,IAAI;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,yDAuCzH,iBAAiB,OAAO,8BAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4VAkB6O,YAAY;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,IAkDpW;AAAA,EAAK,MAAM,WAAW,CAAC;AAAA,EACzB;AACF;AAEA,eAAsB,aAA8B;AAClD,QAAM,QAAQ,MAAM,SAAS;AAC7B,SAAO;AAAA;AAAA,qBAEY,OAAO,CAAC;AAAA,2BACF,QAAQ,QAAQ,IAAI;AAAA,YACnC,IAAI,QAAQ;AAAA,iBACR,oBAAI,KAAK,GAAE,mBAAmB,CAAC;AAAA;AAE/C;AAEA,eAAsB,iBAAoC;AACxD,SAAO;AAAA,IACL;AAAA,uBACmB,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM/B,GAAG,MAAM,WAAW,CAAC;AAAA,EACvB;AACF;",
4
+ "sourcesContent": ["/**\n * Backward compatibility re-exports\n *\n * All prompt logic has been modularized into src/constants/prompts/\n * This file re-exports the public API for existing consumers.\n */\nexport {\n getSystemPrompt,\n getAgentPrompt,\n getEnvInfo,\n getCLISyspromptPrefix,\n} from './prompts/index'\n"],
5
+ "mappings": "AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,235 @@
1
+ const PROVIDER_REGISTRY = {
2
+ openai: {
3
+ maxTokensField: "max_completion_tokens",
4
+ temperatureRange: { min: 0, max: 2 },
5
+ supportsSystemRole: true,
6
+ supportsToolChoice: true,
7
+ maxStopSequences: null,
8
+ supportsStreaming: true,
9
+ supportsReasoningEffort: false,
10
+ apiType: "chat-completions"
11
+ },
12
+ "openai-responses": {
13
+ maxTokensField: "max_output_tokens",
14
+ temperatureRange: "omit",
15
+ supportsSystemRole: false,
16
+ systemRoleAlternative: "instruction",
17
+ supportsToolChoice: true,
18
+ maxStopSequences: null,
19
+ supportsStreaming: false,
20
+ supportsReasoningEffort: true,
21
+ apiType: "responses"
22
+ },
23
+ gemini: {
24
+ maxTokensField: "max_tokens",
25
+ temperatureRange: { min: 0, max: 2 },
26
+ supportsSystemRole: true,
27
+ supportsToolChoice: true,
28
+ maxStopSequences: null,
29
+ supportsStreaming: true,
30
+ supportsReasoningEffort: false,
31
+ apiType: "chat-completions"
32
+ },
33
+ deepseek: {
34
+ maxTokensField: "max_tokens",
35
+ temperatureRange: { min: 0, max: 2 },
36
+ supportsSystemRole: true,
37
+ supportsToolChoice: true,
38
+ maxStopSequences: null,
39
+ supportsStreaming: true,
40
+ supportsReasoningEffort: false,
41
+ apiType: "chat-completions"
42
+ },
43
+ mistral: {
44
+ maxTokensField: "max_tokens",
45
+ temperatureRange: { min: 0, max: 1.5 },
46
+ supportsSystemRole: true,
47
+ supportsToolChoice: true,
48
+ maxStopSequences: null,
49
+ supportsStreaming: true,
50
+ supportsReasoningEffort: false,
51
+ apiType: "chat-completions"
52
+ },
53
+ qwen: {
54
+ maxTokensField: "max_tokens",
55
+ temperatureRange: { min: 0, max: 2 },
56
+ supportsSystemRole: true,
57
+ supportsToolChoice: true,
58
+ maxStopSequences: null,
59
+ supportsStreaming: true,
60
+ supportsReasoningEffort: false,
61
+ apiType: "chat-completions"
62
+ },
63
+ glm: {
64
+ maxTokensField: "max_tokens",
65
+ temperatureRange: { min: 0, max: 1 },
66
+ supportsSystemRole: true,
67
+ supportsToolChoice: "auto-only",
68
+ maxStopSequences: 1,
69
+ supportsStreaming: true,
70
+ supportsReasoningEffort: false,
71
+ apiType: "chat-completions"
72
+ },
73
+ kimi: {
74
+ maxTokensField: "max_tokens",
75
+ temperatureRange: { min: 0, max: 1 },
76
+ supportsSystemRole: true,
77
+ supportsToolChoice: true,
78
+ maxStopSequences: null,
79
+ supportsStreaming: true,
80
+ supportsReasoningEffort: false,
81
+ apiType: "chat-completions"
82
+ },
83
+ minimax: {
84
+ maxTokensField: "max_completion_tokens",
85
+ temperatureRange: { min: 0, max: 1 },
86
+ supportsSystemRole: true,
87
+ supportsToolChoice: true,
88
+ maxStopSequences: null,
89
+ supportsStreaming: true,
90
+ supportsReasoningEffort: false,
91
+ apiType: "chat-completions"
92
+ },
93
+ groq: {
94
+ maxTokensField: "max_completion_tokens",
95
+ temperatureRange: { min: 0, max: 2 },
96
+ supportsSystemRole: true,
97
+ supportsToolChoice: true,
98
+ maxStopSequences: null,
99
+ supportsStreaming: true,
100
+ supportsReasoningEffort: false,
101
+ apiType: "chat-completions"
102
+ },
103
+ xai: {
104
+ maxTokensField: "max_tokens",
105
+ temperatureRange: { min: 0, max: 2 },
106
+ supportsSystemRole: true,
107
+ supportsToolChoice: true,
108
+ maxStopSequences: null,
109
+ supportsStreaming: true,
110
+ supportsReasoningEffort: false,
111
+ apiType: "chat-completions"
112
+ },
113
+ ollama: {
114
+ maxTokensField: "max_tokens",
115
+ temperatureRange: { min: 0, max: 2 },
116
+ supportsSystemRole: true,
117
+ supportsToolChoice: true,
118
+ maxStopSequences: null,
119
+ supportsStreaming: true,
120
+ supportsReasoningEffort: false,
121
+ apiType: "chat-completions"
122
+ },
123
+ azure: {
124
+ maxTokensField: "max_tokens",
125
+ temperatureRange: { min: 0, max: 2 },
126
+ supportsSystemRole: true,
127
+ supportsToolChoice: true,
128
+ maxStopSequences: null,
129
+ supportsStreaming: true,
130
+ supportsReasoningEffort: false,
131
+ apiType: "chat-completions"
132
+ },
133
+ "baidu-qianfan": {
134
+ maxTokensField: "max_tokens",
135
+ temperatureRange: { min: 0, max: 1 },
136
+ supportsSystemRole: true,
137
+ supportsToolChoice: "auto-only",
138
+ maxStopSequences: null,
139
+ supportsStreaming: true,
140
+ supportsReasoningEffort: false,
141
+ apiType: "chat-completions"
142
+ },
143
+ siliconflow: {
144
+ maxTokensField: "max_tokens",
145
+ temperatureRange: { min: 0, max: 2 },
146
+ supportsSystemRole: true,
147
+ supportsToolChoice: true,
148
+ maxStopSequences: null,
149
+ supportsStreaming: true,
150
+ supportsReasoningEffort: false,
151
+ apiType: "chat-completions"
152
+ },
153
+ "custom-openai": {
154
+ maxTokensField: "max_tokens",
155
+ temperatureRange: { min: 0, max: 2 },
156
+ supportsSystemRole: true,
157
+ supportsToolChoice: true,
158
+ maxStopSequences: null,
159
+ supportsStreaming: true,
160
+ supportsReasoningEffort: false,
161
+ apiType: "chat-completions"
162
+ }
163
+ };
164
+ const MODEL_OVERRIDES = {
165
+ // OpenAI reasoning models - temperature must be omitted
166
+ "o1-mini": {
167
+ temperatureRange: "omit",
168
+ supportsReasoningEffort: false,
169
+ maxTokensField: "max_completion_tokens"
170
+ },
171
+ "o1-preview": {
172
+ temperatureRange: "omit",
173
+ supportsReasoningEffort: false,
174
+ maxTokensField: "max_completion_tokens"
175
+ },
176
+ o1: {
177
+ temperatureRange: "omit",
178
+ supportsReasoningEffort: false,
179
+ maxTokensField: "max_completion_tokens"
180
+ },
181
+ "o3-mini": {
182
+ temperatureRange: "omit",
183
+ supportsReasoningEffort: true,
184
+ maxTokensField: "max_completion_tokens"
185
+ },
186
+ o3: {
187
+ temperatureRange: "omit",
188
+ supportsReasoningEffort: true,
189
+ maxTokensField: "max_completion_tokens"
190
+ },
191
+ "o4-mini": {
192
+ temperatureRange: "omit",
193
+ supportsReasoningEffort: true,
194
+ maxTokensField: "max_completion_tokens"
195
+ },
196
+ // GPT-5 models - temperature must be omitted, uses Responses API
197
+ "gpt-5": {
198
+ temperatureRange: "omit",
199
+ supportsReasoningEffort: true,
200
+ maxTokensField: "max_output_tokens",
201
+ apiType: "responses"
202
+ },
203
+ // Kimi reasoning models - temperature must be exactly 1 (omit and let API default)
204
+ "kimi-k2": {
205
+ temperatureRange: "omit",
206
+ supportsReasoningEffort: false
207
+ },
208
+ // DeepSeek reasoning models - temperature must be omitted
209
+ "deepseek-reasoner": {
210
+ temperatureRange: "omit",
211
+ supportsReasoningEffort: false
212
+ }
213
+ };
214
+ function getEffectiveCapabilities(provider, modelName) {
215
+ const providerCaps = PROVIDER_REGISTRY[provider] || PROVIDER_REGISTRY["custom-openai"];
216
+ let override = MODEL_OVERRIDES[modelName];
217
+ if (!override) {
218
+ for (const [prefix, overrideValue] of Object.entries(MODEL_OVERRIDES)) {
219
+ if (modelName.startsWith(prefix)) {
220
+ override = overrideValue;
221
+ break;
222
+ }
223
+ }
224
+ }
225
+ if (override) {
226
+ return { ...providerCaps, ...override };
227
+ }
228
+ return providerCaps;
229
+ }
230
+ export {
231
+ MODEL_OVERRIDES,
232
+ PROVIDER_REGISTRY,
233
+ getEffectiveCapabilities
234
+ };
235
+ //# sourceMappingURL=providerRegistry.js.map