@denizokcu/haze 0.11.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +28 -14
  3. package/SECURITY.md +5 -3
  4. package/dist/buildInfo.json +3 -3
  5. package/dist/cli/chat/TaskBar.js +1 -1
  6. package/dist/cli/chat/chatMetrics.d.ts +2 -2
  7. package/dist/cli/chat/chatMetrics.js +1 -1
  8. package/dist/cli/chat/fileMentionSuggestions.js +1 -1
  9. package/dist/cli/chat/inputSuggestions.d.ts +8 -16
  10. package/dist/cli/chat/inputSuggestions.js +10 -41
  11. package/dist/cli/chat/messages.d.ts +0 -2
  12. package/dist/cli/chat/messages.js +5 -5
  13. package/dist/cli/chat/sessionLifecycle.d.ts +2 -1
  14. package/dist/cli/chat/turnState.d.ts +1 -1
  15. package/dist/cli/chat/wizardDispatch.d.ts +90 -28
  16. package/dist/cli/chat/wizardDispatch.js +257 -130
  17. package/dist/cli/commands/chat.js +61 -77
  18. package/dist/cli/commands/chatModes.d.ts +8 -1
  19. package/dist/cli/commands/chatModes.js +9 -44
  20. package/dist/cli/commands/commandHelp.js +2 -0
  21. package/dist/cli/commands/commands.js +2 -0
  22. package/dist/cli/commands/doctor.js +1 -1
  23. package/dist/cli/commands/formatters.d.ts +3 -3
  24. package/dist/cli/commands/formatters.js +12 -25
  25. package/dist/cli/commands/providerWizard.js +2 -3
  26. package/dist/cli/commands/runCommand.js +1 -1
  27. package/dist/cli/commands/serverWizard.d.ts +34 -0
  28. package/dist/cli/commands/{mcpWizard.js → serverWizard.js} +44 -2
  29. package/dist/cli/commands/settingsSummary.js +2 -0
  30. package/dist/cli/commands/skillsWizard.d.ts +41 -0
  31. package/dist/cli/commands/{skillWizard.js → skillsWizard.js} +33 -11
  32. package/dist/cli/commands/streaming/abortCause.d.ts +2 -1
  33. package/dist/cli/commands/streaming/agentAttempt.d.ts +43 -0
  34. package/dist/cli/commands/streaming/agentAttempt.js +79 -0
  35. package/dist/cli/commands/streaming/attemptLifecycle.d.ts +56 -0
  36. package/dist/cli/commands/streaming/attemptLifecycle.js +110 -0
  37. package/dist/cli/commands/streaming/attemptOutcome.d.ts +96 -0
  38. package/dist/cli/commands/streaming/attemptOutcome.js +206 -0
  39. package/dist/cli/commands/streaming/attemptSetup.d.ts +78 -0
  40. package/dist/cli/commands/streaming/attemptSetup.js +167 -0
  41. package/dist/cli/commands/streaming/goalCheckpoint.d.ts +1 -1
  42. package/dist/cli/commands/streaming/goalCheckpoint.js +2 -2
  43. package/dist/cli/commands/streaming/goalSupervisor.js +9 -6
  44. package/dist/cli/commands/streaming/stallRecovery.d.ts +94 -0
  45. package/dist/cli/commands/streaming/stallRecovery.js +105 -0
  46. package/dist/cli/commands/streaming/streamLoop.d.ts +72 -0
  47. package/dist/cli/commands/streaming/streamLoop.js +448 -0
  48. package/dist/cli/commands/streaming/toolCallRecovery.d.ts +14 -0
  49. package/dist/cli/commands/streaming/toolCallRecovery.js +56 -0
  50. package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +2 -1
  51. package/dist/cli/commands/streaming/turnRuntime.d.ts +4 -0
  52. package/dist/cli/commands/streaming/turnRuntime.js +6 -0
  53. package/dist/cli/commands/streaming.d.ts +14 -25
  54. package/dist/cli/commands/streaming.js +43 -754
  55. package/dist/cli/commands/themesCommand.d.ts +17 -0
  56. package/dist/cli/commands/themesCommand.js +24 -0
  57. package/dist/cli/commands/wizardFlow.d.ts +341 -0
  58. package/dist/cli/commands/wizardFlow.js +397 -0
  59. package/dist/cli/contextReport.js +3 -0
  60. package/dist/cli/index.js +1 -1
  61. package/dist/config/contextFiles.js +9 -3
  62. package/dist/config/inputHistory.d.ts +0 -1
  63. package/dist/config/inputHistory.js +1 -1
  64. package/dist/config/modelDiscovery.d.ts +0 -15
  65. package/dist/config/modelDiscovery.js +1 -1
  66. package/dist/config/settings.d.ts +9 -0
  67. package/dist/config/settings.js +4 -0
  68. package/dist/config/skillSettings.js +4 -4
  69. package/dist/config/updateCheck.d.ts +0 -1
  70. package/dist/config/updateCheck.js +1 -1
  71. package/dist/core/agent/budgets.d.ts +63 -1
  72. package/dist/core/agent/budgets.js +84 -1
  73. package/dist/core/agent/compaction.js +1 -1
  74. package/dist/core/agent/completionController.d.ts +7 -13
  75. package/dist/core/agent/completionController.js +17 -8
  76. package/dist/core/agent/contextBudget.d.ts +0 -4
  77. package/dist/core/agent/contextBudget.js +3 -3
  78. package/dist/core/agent/errors.d.ts +0 -1
  79. package/dist/core/agent/errors.js +1 -1
  80. package/dist/core/agent/events.d.ts +5 -1
  81. package/dist/core/{goal/completionPolicy.d.ts → agent/goalPolicy.d.ts} +18 -0
  82. package/dist/core/agent/goalPolicy.js +106 -0
  83. package/dist/core/agent/requestAssembly.d.ts +2 -2
  84. package/dist/core/agent/requestAssembly.js +16 -4
  85. package/dist/core/agent/toolCapabilities.d.ts +2 -2
  86. package/dist/core/agent/toolCapabilities.js +5 -5
  87. package/dist/core/agent/toolOutputStore.js +1 -1
  88. package/dist/core/agent/toolResults.js +1 -1
  89. package/dist/core/agent/workState.d.ts +6 -3
  90. package/dist/core/agent/workState.js +62 -7
  91. package/dist/core/attachments/imageAttachments.js +90 -42
  92. package/dist/core/deadline.d.ts +0 -6
  93. package/dist/core/deadline.js +1 -1
  94. package/dist/core/io/boundedRead.js +1 -1
  95. package/dist/core/limits.d.ts +51 -0
  96. package/dist/core/limits.js +51 -0
  97. package/dist/core/log/llmLog.js +1 -1
  98. package/dist/core/process/backgroundRegistry.d.ts +2 -3
  99. package/dist/core/process/backgroundRegistry.js +10 -6
  100. package/dist/core/process/userShell.d.ts +16 -0
  101. package/dist/core/process/userShell.js +59 -0
  102. package/dist/core/safety/secretPaths.d.ts +18 -0
  103. package/dist/core/safety/secretPaths.js +115 -0
  104. package/dist/core/safety/shellClassifier.d.ts +11 -0
  105. package/dist/core/safety/{bashClassifier.js → shellClassifier.js} +5 -3
  106. package/dist/core/safety/urlGuard.d.ts +1 -1
  107. package/dist/core/session/sessionSlimming.d.ts +0 -3
  108. package/dist/core/session/sessionSlimming.js +2 -3
  109. package/dist/core/session/sessionStore.d.ts +1 -0
  110. package/dist/core/session/sessionStore.js +39 -20
  111. package/dist/core/{bashOutput → shellOutput}/lineFilter.js +8 -2
  112. package/dist/core/{bashOutput → shellOutput}/reducers/search.d.ts +0 -1
  113. package/dist/core/{bashOutput → shellOutput}/reducers/search.js +1 -1
  114. package/dist/core/shellOutput/registry.d.ts +2 -0
  115. package/dist/core/{bashOutput → shellOutput}/registry.js +3 -3
  116. package/dist/core/{bashOutput → shellOutput}/types.d.ts +6 -5
  117. package/dist/core/subagent/contracts.d.ts +2 -14
  118. package/dist/core/subagent/contracts.js +3 -3
  119. package/dist/core/subagent/executionProfiles.js +2 -2
  120. package/dist/core/subagent/subagentRunner.js +3 -4
  121. package/dist/core/toolOutput/reduction.d.ts +0 -12
  122. package/dist/core/toolOutput/reduction.js +1 -1
  123. package/dist/core/validation/outputParser.d.ts +2 -2
  124. package/dist/llm/client.js +5 -1
  125. package/dist/llm/hazeTools.d.ts +139 -124
  126. package/dist/llm/hazeTools.js +20 -11
  127. package/dist/llm/initPrompt.js +1 -1
  128. package/dist/llm/lsp/client.d.ts +45 -0
  129. package/dist/llm/lsp/client.js +195 -0
  130. package/dist/llm/lsp/pool.d.ts +23 -0
  131. package/dist/llm/lsp/pool.js +86 -0
  132. package/dist/llm/lsp/protocol.d.ts +64 -0
  133. package/dist/llm/lsp/protocol.js +128 -0
  134. package/dist/llm/lsp/requests.d.ts +94 -0
  135. package/dist/llm/lsp/requests.js +119 -0
  136. package/dist/llm/lspTools.d.ts +3824 -570
  137. package/dist/llm/lspTools.js +65 -1
  138. package/dist/llm/openaiCodex.d.ts +0 -2
  139. package/dist/llm/openaiCodex.js +0 -4
  140. package/dist/llm/openaiCodexOAuth.d.ts +0 -3
  141. package/dist/llm/openaiCodexOAuth.js +6 -3
  142. package/dist/llm/requestContext.d.ts +5 -1
  143. package/dist/llm/requestContext.js +25 -2
  144. package/dist/llm/systemPrompt.d.ts +1 -0
  145. package/dist/llm/systemPrompt.js +16 -7
  146. package/dist/llm/toolResultTypes.d.ts +1 -15
  147. package/dist/llm/toolResultTypes.js +1 -4
  148. package/dist/llm/tools/editMatch.d.ts +0 -9
  149. package/dist/llm/tools/editMatch.js +1 -1
  150. package/dist/llm/tools/failures.d.ts +6 -0
  151. package/dist/llm/tools/failures.js +8 -2
  152. package/dist/llm/tools/fetchTool.js +1 -1
  153. package/dist/llm/tools/fileToolShared.d.ts +4 -2
  154. package/dist/llm/tools/fileToolShared.js +9 -5
  155. package/dist/llm/tools/gitIgnore.d.ts +25 -32
  156. package/dist/llm/tools/gitIgnore.js +216 -98
  157. package/dist/llm/tools/grepParse.d.ts +2 -1
  158. package/dist/llm/tools/grepRunner.d.ts +1 -1
  159. package/dist/llm/tools/grepRunner.js +2 -2
  160. package/dist/llm/tools/outputCap.d.ts +2 -7
  161. package/dist/llm/tools/outputCap.js +3 -3
  162. package/dist/llm/tools/processTool.d.ts +16 -16
  163. package/dist/llm/tools/processTool.js +1 -1
  164. package/dist/llm/tools/readRecovery.d.ts +0 -2
  165. package/dist/llm/tools/readRecovery.js +4 -2
  166. package/dist/llm/tools/{bashTool.d.ts → shellTool.d.ts} +123 -107
  167. package/dist/llm/tools/{bashTool.js → shellTool.js} +18 -14
  168. package/dist/llm/tools/toolContext.js +5 -5
  169. package/dist/llm/tools/workspaceFile.d.ts +4 -4
  170. package/dist/llm/tools/workspaceFile.js +29 -17
  171. package/dist/llm/webFetch.d.ts +1 -1
  172. package/dist/skills/SkillLoader.d.ts +1 -11
  173. package/dist/skills/SkillLoader.js +1 -2
  174. package/dist/skills/types.d.ts +2 -1
  175. package/dist/ui/components/Header.js +1 -1
  176. package/dist/ui/components/MarkdownText.js +10 -10
  177. package/dist/ui/components/TextInput.d.ts +1 -1
  178. package/dist/ui/components/TextInput.js +2 -2
  179. package/dist/ui/terminalColors.d.ts +29 -0
  180. package/dist/ui/terminalColors.js +47 -0
  181. package/dist/ui/theme.d.ts +105 -10
  182. package/dist/ui/theme.js +126 -15
  183. package/dist/ui/themes/af-magic.d.ts +7 -0
  184. package/dist/ui/themes/af-magic.js +25 -0
  185. package/dist/ui/themes/agnoster.d.ts +10 -0
  186. package/dist/ui/themes/agnoster.js +40 -0
  187. package/dist/ui/themes/bira.d.ts +10 -0
  188. package/dist/ui/themes/bira.js +28 -0
  189. package/dist/ui/themes/bureau.d.ts +10 -0
  190. package/dist/ui/themes/bureau.js +28 -0
  191. package/dist/ui/themes/clean.d.ts +9 -0
  192. package/dist/ui/themes/clean.js +27 -0
  193. package/dist/ui/themes/cloud.d.ts +6 -0
  194. package/dist/ui/themes/cloud.js +24 -0
  195. package/dist/ui/themes/dst.d.ts +10 -0
  196. package/dist/ui/themes/dst.js +28 -0
  197. package/dist/ui/themes/fishy.d.ts +7 -0
  198. package/dist/ui/themes/fishy.js +25 -0
  199. package/dist/ui/themes/index.d.ts +8 -0
  200. package/dist/ui/themes/index.js +36 -0
  201. package/dist/ui/themes/light.d.ts +3 -0
  202. package/dist/ui/themes/light.js +21 -0
  203. package/dist/ui/themes/purple.d.ts +7 -0
  204. package/dist/ui/themes/purple.js +26 -0
  205. package/dist/ui/themes/robbyrussell.d.ts +8 -0
  206. package/dist/ui/themes/robbyrussell.js +26 -0
  207. package/dist/ui/themes/solarized-dark.d.ts +16 -0
  208. package/dist/ui/themes/solarized-dark.js +44 -0
  209. package/dist/ui/themes/solarized-light.d.ts +12 -0
  210. package/dist/ui/themes/solarized-light.js +40 -0
  211. package/dist/ui/themes/steeef.d.ts +11 -0
  212. package/dist/ui/themes/steeef.js +29 -0
  213. package/dist/utils/buildInfo.d.ts +6 -13
  214. package/dist/utils/buildInfo.js +6 -15
  215. package/dist/utils/fs.d.ts +7 -5
  216. package/dist/utils/fs.js +5 -2
  217. package/dist/utils/path.d.ts +0 -1
  218. package/dist/utils/path.js +1 -1
  219. package/package.json +6 -4
  220. package/dist/cli/commands/lspWizard.d.ts +0 -14
  221. package/dist/cli/commands/lspWizard.js +0 -44
  222. package/dist/cli/commands/mcpWizard.d.ts +0 -15
  223. package/dist/cli/commands/skillConfirmRemove.d.ts +0 -11
  224. package/dist/cli/commands/skillConfirmRemove.js +0 -20
  225. package/dist/cli/commands/skillCreation.d.ts +0 -12
  226. package/dist/cli/commands/skillCreation.js +0 -14
  227. package/dist/cli/commands/skillWizard.d.ts +0 -17
  228. package/dist/cli/commands/streaming/idleTimer.d.ts +0 -26
  229. package/dist/cli/commands/streaming/idleTimer.js +0 -24
  230. package/dist/cli/commands/streaming/turnOutcome.d.ts +0 -27
  231. package/dist/cli/commands/streaming/turnOutcome.js +0 -29
  232. package/dist/cli/commands/wizardActions.d.ts +0 -47
  233. package/dist/cli/commands/wizardActions.js +0 -47
  234. package/dist/cli/commands/wizardInput.d.ts +0 -4
  235. package/dist/cli/commands/wizardInput.js +0 -19
  236. package/dist/cli/commands/wizardPrompts.d.ts +0 -22
  237. package/dist/cli/commands/wizardPrompts.js +0 -58
  238. package/dist/cli/commands/wizardSuggestions.d.ts +0 -31
  239. package/dist/cli/commands/wizardSuggestions.js +0 -190
  240. package/dist/cli/commands/wizardTransition.d.ts +0 -37
  241. package/dist/cli/commands/wizardTransition.js +0 -43
  242. package/dist/core/agent/toolExecutionBudget.d.ts +0 -35
  243. package/dist/core/agent/toolExecutionBudget.js +0 -49
  244. package/dist/core/agent/turnBudget.d.ts +0 -35
  245. package/dist/core/agent/turnBudget.js +0 -27
  246. package/dist/core/bashOutput/ansi.d.ts +0 -1
  247. package/dist/core/bashOutput/ansi.js +0 -7
  248. package/dist/core/bashOutput/registry.d.ts +0 -4
  249. package/dist/core/goal/completionPolicy.js +0 -43
  250. package/dist/core/goal/requestClassifier.d.ts +0 -3
  251. package/dist/core/goal/requestClassifier.js +0 -18
  252. package/dist/core/goal/sessionGoal.d.ts +0 -8
  253. package/dist/core/goal/sessionGoal.js +0 -30
  254. package/dist/core/limits/byteBudgets.d.ts +0 -20
  255. package/dist/core/limits/byteBudgets.js +0 -20
  256. package/dist/core/limits/textBudgets.d.ts +0 -25
  257. package/dist/core/limits/textBudgets.js +0 -25
  258. package/dist/core/safety/bashClassifier.d.ts +0 -10
  259. package/dist/llm/lsp.d.ts +0 -149
  260. package/dist/llm/lsp.js +0 -368
  261. package/dist/ui/components/ErrorView.d.ts +0 -4
  262. package/dist/ui/components/ErrorView.js +0 -7
  263. package/dist/utils/yaml.d.ts +0 -2
  264. package/dist/utils/yaml.js +0 -8
  265. package/examples/skills/files/SKILL.md +0 -16
  266. package/examples/skills/files/examples/file-editing.md +0 -3
  267. /package/dist/core/{bashOutput → shellOutput}/command.d.ts +0 -0
  268. /package/dist/core/{bashOutput → shellOutput}/command.js +0 -0
  269. /package/dist/core/{bashOutput → shellOutput}/lineFilter.d.ts +0 -0
  270. /package/dist/core/{bashOutput → shellOutput}/reducers/content.d.ts +0 -0
  271. /package/dist/core/{bashOutput → shellOutput}/reducers/content.js +0 -0
  272. /package/dist/core/{bashOutput → shellOutput}/reducers/gh.d.ts +0 -0
  273. /package/dist/core/{bashOutput → shellOutput}/reducers/gh.js +0 -0
  274. /package/dist/core/{bashOutput → shellOutput}/reducers/git.d.ts +0 -0
  275. /package/dist/core/{bashOutput → shellOutput}/reducers/git.js +0 -0
  276. /package/dist/core/{bashOutput → shellOutput}/reducers/validation.d.ts +0 -0
  277. /package/dist/core/{bashOutput → shellOutput}/reducers/validation.js +0 -0
  278. /package/dist/core/{bashOutput → shellOutput}/types.js +0 -0
@@ -0,0 +1,17 @@
1
+ import type { HazeSettings } from '../../config/settings.js';
2
+ import type { CommandContext, CommandResult } from './commands.js';
3
+ /**
4
+ * `/themes` — theme picker and direct set. The picker is one step in the
5
+ * `wizardFlow.ts` table (mode `themes`); this module holds the pure selection
6
+ * result shared by the slash path and the wizard submit handler, mirroring the
7
+ * other `*Command.ts` / `*Wizard.ts` splits. Applying the resolved theme live
8
+ * is owned by ChatScreen (it re-resolves whenever `settings.theme` changes).
9
+ */
10
+ export interface ThemeSelectionResult {
11
+ /** Present when the name is valid and should be persisted; absent means the message explains the failure. */
12
+ settingsPatch?: HazeSettings;
13
+ message: string;
14
+ }
15
+ /** Validate a theme name against the built-in registry (`resolveTheme` lists the valid names on failure) and shape the persist result. */
16
+ export declare function selectThemeResult(name: string): ThemeSelectionResult;
17
+ export declare function handleThemesCommand(args: string, ctx: CommandContext): Promise<CommandResult>;
@@ -0,0 +1,24 @@
1
+ import { resolveTheme } from '../../ui/theme.js';
2
+ /** Validate a theme name against the built-in registry (`resolveTheme` lists the valid names on failure) and shape the persist result. */
3
+ export function selectThemeResult(name) {
4
+ const trimmed = name.trim();
5
+ try {
6
+ resolveTheme(trimmed);
7
+ }
8
+ catch (error) {
9
+ return { message: error instanceof Error ? error.message : String(error) };
10
+ }
11
+ return { settingsPatch: { theme: trimmed }, message: `Theme set to ${trimmed}. Saved to ~/.haze/settings.json. Text already on screen keeps its old colors.` };
12
+ }
13
+ export async function handleThemesCommand(args, ctx) {
14
+ if (!args) {
15
+ ctx.setMode('themes');
16
+ ctx.addSystemMessage('Choose a theme. Selecting one applies it immediately and saves it to ~/.haze/settings.json.');
17
+ return 'handled';
18
+ }
19
+ const result = selectThemeResult(args);
20
+ if (result.settingsPatch)
21
+ await ctx.updateSettings(result.settingsPatch);
22
+ ctx.addSystemMessage(result.message);
23
+ return 'handled';
24
+ }
@@ -0,0 +1,341 @@
1
+ import type { HazeMcpServer, HazeSettings } from '../../config/settings.js';
2
+ import type { LoadedSkill } from '../../skills/types.js';
3
+ import type { SessionSummary } from '../../core/session/sessionStore.js';
4
+ import type { TextInputSuggestion } from '../../ui/components/TextInput.js';
5
+ /**
6
+ * Wizard flow table (CR-006 successor): the single source of truth for every
7
+ * picker/wizard step. A step's kind, placeholder, suggestion list, and (for
8
+ * field-capture steps) its pure capture function all live in one entry, so
9
+ * adding a wizard step touches one table row — `chatModes.ts` derives the
10
+ * `Mode` union and the picker/masked/empty-submit classification from this
11
+ * table, and `chat/wizardDispatch.ts` drives the submits.
12
+ *
13
+ * Keep this module a leaf: it must not import the per-domain `*Wizard.ts`
14
+ * result modules or `chatModes.ts`, so the dependency graph stays acyclic
15
+ * (domain modules import the shared constants/helpers from here).
16
+ */
17
+ export declare const PROVIDER_CHOICES: {
18
+ readonly addProvider: "add provider";
19
+ readonly custom: "custom";
20
+ };
21
+ export declare const PROVIDER_ACTIONS: {
22
+ readonly useProvider: "use provider";
23
+ readonly addModels: "add models";
24
+ readonly manageAccess: "set API key";
25
+ readonly signInChatGpt: "sign in with ChatGPT";
26
+ readonly markImageCapable: "mark image-capable";
27
+ readonly clearImageCapable: "clear image-capable";
28
+ readonly removeModels: "remove models";
29
+ readonly removeProvider: "remove provider";
30
+ };
31
+ export declare const MODEL_CHOICES: {
32
+ readonly addModels: "add models";
33
+ readonly enterModelNames: "enter model names";
34
+ };
35
+ export declare const SERVER_CHOICES: {
36
+ readonly addServer: "add server";
37
+ readonly custom: "custom";
38
+ };
39
+ export declare const COMMON_ACTIONS: {
40
+ readonly enable: "enable";
41
+ readonly disable: "disable";
42
+ };
43
+ export declare const LSP_ACTIONS: {
44
+ readonly removeServer: "remove server";
45
+ };
46
+ export declare const MCP_ACTIONS: {
47
+ readonly manageAccess: "set API key";
48
+ readonly removeServer: "remove server";
49
+ };
50
+ export declare const MCP_TRANSPORTS: {
51
+ readonly http: "http";
52
+ readonly sse: "sse";
53
+ readonly stdio: "stdio";
54
+ };
55
+ export declare const SKILL_CHOICES: {
56
+ readonly addSkill: "add skill";
57
+ };
58
+ export declare const SKILL_ACTIONS: {
59
+ readonly showInfo: "show info";
60
+ readonly validate: "validate";
61
+ readonly removeSkill: "remove skill";
62
+ };
63
+ export declare function commaList(value: string): string[];
64
+ export declare function commandParts(value: string): string[];
65
+ export declare function isYesConfirmation(value: string): boolean;
66
+ export declare function isValidUrl(value: string): boolean;
67
+ export declare function skillPickerValue(skill: LoadedSkill): string;
68
+ export declare function findSelectedSkill(skills: LoadedSkill[], selection: string | undefined): LoadedSkill | undefined;
69
+ export type NameCaptureResult = {
70
+ nextMode?: string;
71
+ draft?: {
72
+ name?: string;
73
+ };
74
+ message?: string;
75
+ systemMessage?: string;
76
+ };
77
+ export declare function captureProviderName(settings: HazeSettings, value: string): NameCaptureResult;
78
+ export declare function captureLspName(settings: HazeSettings, value: string): NameCaptureResult;
79
+ export declare function captureMcpName(settings: HazeSettings, value: string): NameCaptureResult;
80
+ export type FieldCaptureResult = {
81
+ draft?: Partial<HazeMcpServer>;
82
+ message?: string;
83
+ nextMode?: string;
84
+ systemMessage?: string;
85
+ };
86
+ export declare function captureProviderUrl(value: string): FieldCaptureResult;
87
+ export declare function captureMcpUrl(value: string): FieldCaptureResult;
88
+ export declare function captureMcpTransport(value: string): FieldCaptureResult;
89
+ export declare function captureMcpCommand(value: string): FieldCaptureResult;
90
+ export declare function providerSuggestions(settings: HazeSettings): TextInputSuggestion[];
91
+ export declare function providerActionSuggestions(settings: HazeSettings, selectedProviderName: string | undefined): TextInputSuggestion[];
92
+ export declare function presetSuggestions(): TextInputSuggestion[];
93
+ export declare function modelSuggestions(settings: HazeSettings, modelProviderFilter: string | undefined): TextInputSuggestion[];
94
+ export declare function modelAddProviderSuggestions(settings: HazeSettings): TextInputSuggestion[];
95
+ /**
96
+ * Model picker fed by live /models discovery. Curated `suggestedModels`
97
+ * (from provider presets) are pinned atop the discovered list when the
98
+ * endpoint actually serves them — stale curation entries simply don't pin.
99
+ */
100
+ export declare function modelPickSuggestions(settings: HazeSettings, providerName: string | undefined, discoveredModels: string[], suggestedModels?: string[]): TextInputSuggestion[];
101
+ export declare function lspSuggestions(settings: HazeSettings): TextInputSuggestion[];
102
+ export declare function lspActionSuggestions(settings: HazeSettings, selectedLspName: string | undefined): TextInputSuggestion[];
103
+ export declare function mcpSuggestions(settings: HazeSettings): TextInputSuggestion[];
104
+ export declare function mcpActionSuggestions(settings: HazeSettings, selectedMcpName: string | undefined): TextInputSuggestion[];
105
+ export declare function mcpTransportSuggestions(): TextInputSuggestion[];
106
+ export declare function skillsSuggestions(settings: HazeSettings, skills: LoadedSkill[]): TextInputSuggestion[];
107
+ export declare function skillScopeSuggestions(): TextInputSuggestion[];
108
+ export declare function skillsActionSuggestions(settings: HazeSettings, skills: LoadedSkill[], selectedSkillName: string | undefined): TextInputSuggestion[];
109
+ /** Every built-in theme with its palette brightness and the active one marked (`resolveTheme` validates names). */
110
+ export declare function themeSuggestions(settings: HazeSettings): TextInputSuggestion[];
111
+ type WizardStepKind = 'pick' | 'input' | 'masked-input' | 'confirm';
112
+ /** Inputs available to a step's suggestion builder (mirrors the picker state). */
113
+ export interface WizardSuggestionState {
114
+ settings: HazeSettings;
115
+ skills: LoadedSkill[];
116
+ sessions?: SessionSummary[];
117
+ selectedProviderName?: string;
118
+ modelProviderFilter?: string;
119
+ providerDraftName?: string;
120
+ discoveredModels?: string[];
121
+ suggestedModels?: string[];
122
+ selectedSkillName?: string;
123
+ selectedLspName?: string;
124
+ selectedMcpName?: string;
125
+ }
126
+ /**
127
+ * One wizard step. `kind` drives the input behavior classification that
128
+ * `chatModes.ts` derives (`pick` → always-on suggestion picker, `masked-input`
129
+ * → masked input, `optional` → empty submit allowed, `confirm` → typed
130
+ * "yes" confirmation). Placeholders must stay user-stable.
131
+ */
132
+ export interface WizardStepDef {
133
+ id: string;
134
+ kind: WizardStepKind;
135
+ placeholder: string;
136
+ /** Empty submission is valid (optional steps such as API keys). */
137
+ optional?: boolean;
138
+ suggestions: (state: WizardSuggestionState) => TextInputSuggestion[];
139
+ }
140
+ export declare const WIZARD_STEPS: readonly [{
141
+ readonly id: "sessions";
142
+ readonly kind: "pick";
143
+ readonly placeholder: "Choose a saved session";
144
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
145
+ }, {
146
+ readonly id: "sessionAction";
147
+ readonly kind: "pick";
148
+ readonly placeholder: "Resume or fork this session";
149
+ readonly suggestions: () => TextInputSuggestion[];
150
+ }, {
151
+ readonly id: "provider";
152
+ readonly kind: "pick";
153
+ readonly placeholder: "Choose provider";
154
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
155
+ }, {
156
+ readonly id: "providerAction";
157
+ readonly kind: "pick";
158
+ readonly placeholder: "Choose provider action";
159
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
160
+ }, {
161
+ readonly id: "providerAddPreset";
162
+ readonly kind: "pick";
163
+ readonly placeholder: "Choose a provider preset or custom";
164
+ readonly suggestions: () => TextInputSuggestion[];
165
+ }, {
166
+ readonly id: "providerAddName";
167
+ readonly kind: "input";
168
+ readonly placeholder: "Provider name";
169
+ readonly suggestions: () => never[];
170
+ }, {
171
+ readonly id: "providerAddUrl";
172
+ readonly kind: "input";
173
+ readonly placeholder: "https://example.com/v1";
174
+ readonly suggestions: () => never[];
175
+ }, {
176
+ readonly id: "providerAddKey";
177
+ readonly kind: "masked-input";
178
+ readonly placeholder: "API key, or blank for local";
179
+ readonly optional: true;
180
+ readonly suggestions: () => never[];
181
+ }, {
182
+ readonly id: "providerAddModels";
183
+ readonly kind: "input";
184
+ readonly placeholder: "model-a, model-b";
185
+ readonly suggestions: () => never[];
186
+ }, {
187
+ readonly id: "providerAppendModels";
188
+ readonly kind: "input";
189
+ readonly placeholder: "model-a, model-b";
190
+ readonly suggestions: () => never[];
191
+ }, {
192
+ readonly id: "providerSetKey";
193
+ readonly kind: "masked-input";
194
+ readonly placeholder: "API key";
195
+ readonly suggestions: () => never[];
196
+ }, {
197
+ readonly id: "providerRemoveModels";
198
+ readonly kind: "input";
199
+ readonly placeholder: "model-a, model-b";
200
+ readonly suggestions: () => never[];
201
+ }, {
202
+ readonly id: "providerConfirmRemove";
203
+ readonly kind: "confirm";
204
+ readonly placeholder: "Type \"yes\" to confirm";
205
+ readonly suggestions: () => never[];
206
+ }, {
207
+ readonly id: "model";
208
+ readonly kind: "pick";
209
+ readonly placeholder: "Choose model, or add model";
210
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
211
+ }, {
212
+ readonly id: "modelAddProvider";
213
+ readonly kind: "pick";
214
+ readonly placeholder: "Choose a provider to add models to";
215
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
216
+ }, {
217
+ readonly id: "modelPick";
218
+ readonly kind: "pick";
219
+ readonly placeholder: "Choose a model to add";
220
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
221
+ }, {
222
+ readonly id: "skills";
223
+ readonly kind: "pick";
224
+ readonly placeholder: "Choose a skill or add skill";
225
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
226
+ }, {
227
+ readonly id: "skillsAction";
228
+ readonly kind: "pick";
229
+ readonly placeholder: "show info, enable, disable, validate, or remove";
230
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
231
+ }, {
232
+ readonly id: "skillsAddName";
233
+ readonly kind: "input";
234
+ readonly placeholder: "Skill name (kebab-case, e.g. security-review)";
235
+ readonly suggestions: () => never[];
236
+ }, {
237
+ readonly id: "skillsAddScope";
238
+ readonly kind: "pick";
239
+ readonly placeholder: "Choose this project or global";
240
+ readonly suggestions: () => TextInputSuggestion[];
241
+ }, {
242
+ readonly id: "skillsAddDescription";
243
+ readonly kind: "input";
244
+ readonly placeholder: "Describe what the skill should do";
245
+ readonly suggestions: () => never[];
246
+ }, {
247
+ readonly id: "skillsConfirmRemove";
248
+ readonly kind: "confirm";
249
+ readonly placeholder: "Type \"yes\" to confirm";
250
+ readonly suggestions: () => never[];
251
+ }, {
252
+ readonly id: "lsp";
253
+ readonly kind: "pick";
254
+ readonly placeholder: "Choose LSP server or add server";
255
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
256
+ }, {
257
+ readonly id: "lspAction";
258
+ readonly kind: "pick";
259
+ readonly placeholder: "enable, disable, or remove server";
260
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
261
+ }, {
262
+ readonly id: "lspAddPreset";
263
+ readonly kind: "pick";
264
+ readonly placeholder: "Choose an LSP preset or custom";
265
+ readonly suggestions: () => TextInputSuggestion[];
266
+ }, {
267
+ readonly id: "lspAddName";
268
+ readonly kind: "input";
269
+ readonly placeholder: "LSP server name (e.g. typescript)";
270
+ readonly suggestions: () => never[];
271
+ }, {
272
+ readonly id: "lspAddCommand";
273
+ readonly kind: "input";
274
+ readonly placeholder: "Command (e.g. typescript-language-server --stdio)";
275
+ readonly suggestions: () => never[];
276
+ }, {
277
+ readonly id: "lspConfirmRemove";
278
+ readonly kind: "confirm";
279
+ readonly placeholder: "Type \"yes\" to confirm";
280
+ readonly suggestions: () => never[];
281
+ }, {
282
+ readonly id: "mcp";
283
+ readonly kind: "pick";
284
+ readonly placeholder: "Choose MCP server or add server";
285
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
286
+ }, {
287
+ readonly id: "mcpAction";
288
+ readonly kind: "pick";
289
+ readonly placeholder: "enable, disable, remove, or set key";
290
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
291
+ }, {
292
+ readonly id: "mcpAddPreset";
293
+ readonly kind: "pick";
294
+ readonly placeholder: "Choose an MCP preset or custom";
295
+ readonly suggestions: () => TextInputSuggestion[];
296
+ }, {
297
+ readonly id: "mcpAddName";
298
+ readonly kind: "input";
299
+ readonly placeholder: "MCP server name (e.g. context7)";
300
+ readonly suggestions: () => never[];
301
+ }, {
302
+ readonly id: "mcpAddTransport";
303
+ readonly kind: "pick";
304
+ readonly placeholder: "http, sse, or stdio";
305
+ readonly suggestions: () => TextInputSuggestion[];
306
+ }, {
307
+ readonly id: "mcpAddUrl";
308
+ readonly kind: "input";
309
+ readonly placeholder: "https://mcp.example.com/mcp";
310
+ readonly suggestions: () => never[];
311
+ }, {
312
+ readonly id: "mcpAddCommand";
313
+ readonly kind: "input";
314
+ readonly placeholder: "Command (e.g. npx -y @pkg/server)";
315
+ readonly suggestions: () => never[];
316
+ }, {
317
+ readonly id: "mcpAddKey";
318
+ readonly kind: "masked-input";
319
+ readonly placeholder: "API key, or blank to skip";
320
+ readonly optional: true;
321
+ readonly suggestions: () => never[];
322
+ }, {
323
+ readonly id: "mcpSetKey";
324
+ readonly kind: "masked-input";
325
+ readonly placeholder: "API key";
326
+ readonly suggestions: () => never[];
327
+ }, {
328
+ readonly id: "mcpConfirmRemove";
329
+ readonly kind: "confirm";
330
+ readonly placeholder: "Type \"yes\" to confirm";
331
+ readonly suggestions: () => never[];
332
+ }, {
333
+ readonly id: "themes";
334
+ readonly kind: "pick";
335
+ readonly placeholder: "Choose a theme";
336
+ readonly suggestions: (s: WizardSuggestionState) => TextInputSuggestion[];
337
+ }];
338
+ export type WizardStepId = (typeof WIZARD_STEPS)[number]['id'];
339
+ /** Suggestions for a wizard mode, or undefined when the mode is not a wizard step ('chat'). */
340
+ export declare function wizardSuggestionsFor(mode: string, state: WizardSuggestionState): TextInputSuggestion[] | undefined;
341
+ export {};