@denizokcu/haze 0.10.0 → 1.0.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 (294) hide show
  1. package/CHANGELOG.md +100 -1
  2. package/README.md +77 -27
  3. package/SECURITY.md +22 -0
  4. package/bin/haze.js +102 -1
  5. package/dist/buildInfo.json +7 -0
  6. package/dist/cli/chat/TaskBar.d.ts +2 -1
  7. package/dist/cli/chat/TaskBar.js +7 -4
  8. package/dist/cli/chat/chatMetrics.d.ts +2 -2
  9. package/dist/cli/chat/chatMetrics.js +1 -1
  10. package/dist/cli/chat/contextReport.js +2 -0
  11. package/dist/cli/chat/fileMentionSuggestions.js +3 -2
  12. package/dist/cli/chat/inputSuggestions.d.ts +8 -16
  13. package/dist/cli/chat/inputSuggestions.js +9 -41
  14. package/dist/cli/chat/liveRegion.d.ts +25 -0
  15. package/dist/cli/chat/liveRegion.js +48 -0
  16. package/dist/cli/chat/messages.d.ts +33 -4
  17. package/dist/cli/chat/messages.js +218 -35
  18. package/dist/cli/chat/sessionLifecycle.d.ts +11 -1
  19. package/dist/cli/chat/sessionLifecycle.js +64 -14
  20. package/dist/cli/chat/sessionRecorder.js +75 -7
  21. package/dist/cli/chat/startupInfo.d.ts +0 -1
  22. package/dist/cli/chat/startupInfo.js +11 -15
  23. package/dist/cli/chat/turnState.d.ts +1 -1
  24. package/dist/cli/chat/wizardDispatch.d.ts +90 -28
  25. package/dist/cli/chat/wizardDispatch.js +349 -133
  26. package/dist/cli/commands/chat.d.ts +5 -0
  27. package/dist/cli/commands/chat.js +216 -172
  28. package/dist/cli/commands/chatModes.d.ts +8 -1
  29. package/dist/cli/commands/chatModes.js +9 -44
  30. package/dist/cli/commands/commands.d.ts +2 -0
  31. package/dist/cli/commands/commands.js +10 -5
  32. package/dist/cli/commands/doctor.d.ts +19 -0
  33. package/dist/cli/commands/doctor.js +76 -0
  34. package/dist/cli/commands/formatters.d.ts +3 -3
  35. package/dist/cli/commands/formatters.js +8 -25
  36. package/dist/cli/commands/ndjsonSink.d.ts +23 -0
  37. package/dist/cli/commands/ndjsonSink.js +38 -0
  38. package/dist/cli/commands/providerWizard.d.ts +9 -2
  39. package/dist/cli/commands/providerWizard.js +39 -7
  40. package/dist/cli/commands/runCommand.d.ts +3 -0
  41. package/dist/cli/commands/runCommand.js +117 -11
  42. package/dist/cli/commands/serverWizard.d.ts +34 -0
  43. package/dist/cli/commands/{mcpWizard.js → serverWizard.js} +44 -2
  44. package/dist/cli/commands/skillsWizard.d.ts +41 -0
  45. package/dist/cli/commands/{skillWizard.js → skillsWizard.js} +33 -11
  46. package/dist/cli/commands/streaming/abortCause.d.ts +25 -0
  47. package/dist/cli/commands/streaming/abortCause.js +16 -0
  48. package/dist/cli/commands/streaming/agentAttempt.d.ts +43 -0
  49. package/dist/cli/commands/streaming/agentAttempt.js +79 -0
  50. package/dist/cli/commands/streaming/assistantText.js +9 -2
  51. package/dist/cli/commands/streaming/attemptLifecycle.d.ts +56 -0
  52. package/dist/cli/commands/streaming/attemptLifecycle.js +110 -0
  53. package/dist/cli/commands/streaming/attemptOutcome.d.ts +96 -0
  54. package/dist/cli/commands/streaming/attemptOutcome.js +206 -0
  55. package/dist/cli/commands/streaming/attemptSetup.d.ts +78 -0
  56. package/dist/cli/commands/streaming/attemptSetup.js +167 -0
  57. package/dist/cli/commands/streaming/goalCheckpoint.d.ts +65 -0
  58. package/dist/cli/commands/streaming/goalCheckpoint.js +23 -0
  59. package/dist/cli/commands/streaming/goalSupervisor.d.ts +64 -0
  60. package/dist/cli/commands/streaming/goalSupervisor.js +130 -0
  61. package/dist/cli/commands/streaming/stallRecovery.d.ts +94 -0
  62. package/dist/cli/commands/streaming/stallRecovery.js +105 -0
  63. package/dist/cli/commands/streaming/streamLoop.d.ts +72 -0
  64. package/dist/cli/commands/streaming/streamLoop.js +448 -0
  65. package/dist/cli/commands/streaming/toolCallRecovery.d.ts +16 -0
  66. package/dist/cli/commands/streaming/toolCallRecovery.js +80 -0
  67. package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +31 -1
  68. package/dist/cli/commands/streaming/toolGroupRenderer.js +50 -4
  69. package/dist/cli/commands/streaming/toolResultState.d.ts +6 -1
  70. package/dist/cli/commands/streaming/toolResultState.js +29 -7
  71. package/dist/cli/commands/streaming/turnRuntime.d.ts +4 -0
  72. package/dist/cli/commands/streaming/turnRuntime.js +6 -0
  73. package/dist/cli/commands/streaming.d.ts +65 -9
  74. package/dist/cli/commands/streaming.js +133 -430
  75. package/dist/cli/commands/wizardFlow.d.ts +334 -0
  76. package/dist/cli/commands/wizardFlow.js +377 -0
  77. package/dist/cli/contextReport.js +3 -0
  78. package/dist/cli/index.js +68 -22
  79. package/dist/cli/terminalTitle.js +1 -1
  80. package/dist/config/contextFiles.js +9 -3
  81. package/dist/config/inputHistory.d.ts +0 -1
  82. package/dist/config/inputHistory.js +1 -1
  83. package/dist/config/modelDiscovery.d.ts +36 -0
  84. package/dist/config/modelDiscovery.js +164 -1
  85. package/dist/config/privateStorage.js +28 -2
  86. package/dist/config/providerAuth.d.ts +14 -0
  87. package/dist/config/providerAuth.js +49 -0
  88. package/dist/config/providerPresets.d.ts +39 -7
  89. package/dist/config/providerPresets.js +371 -100
  90. package/dist/config/providers.js +2 -0
  91. package/dist/config/settings.d.ts +43 -0
  92. package/dist/config/settings.js +12 -0
  93. package/dist/config/skillSettings.js +4 -4
  94. package/dist/config/updateCheck.d.ts +0 -1
  95. package/dist/config/updateCheck.js +1 -1
  96. package/dist/core/agent/budgets.d.ts +73 -1
  97. package/dist/core/agent/budgets.js +94 -1
  98. package/dist/core/agent/compaction.d.ts +38 -0
  99. package/dist/core/agent/compaction.js +92 -17
  100. package/dist/core/agent/completionController.d.ts +224 -0
  101. package/dist/core/agent/completionController.js +296 -0
  102. package/dist/core/agent/contextBudget.d.ts +36 -2
  103. package/dist/core/agent/contextBudget.js +62 -9
  104. package/dist/core/agent/errors.d.ts +0 -1
  105. package/dist/core/agent/errors.js +1 -1
  106. package/dist/core/agent/events.d.ts +78 -0
  107. package/dist/core/agent/goalPolicy.d.ts +47 -0
  108. package/dist/core/agent/goalPolicy.js +106 -0
  109. package/dist/core/agent/reasoningPolicy.d.ts +31 -0
  110. package/dist/core/agent/reasoningPolicy.js +27 -0
  111. package/dist/core/agent/requestAssembly.d.ts +2 -2
  112. package/dist/core/agent/requestAssembly.js +16 -4
  113. package/dist/core/agent/toolCapabilities.d.ts +27 -0
  114. package/dist/core/agent/toolCapabilities.js +58 -0
  115. package/dist/core/agent/toolOutputStore.d.ts +8 -0
  116. package/dist/core/agent/toolOutputStore.js +11 -11
  117. package/dist/core/agent/toolResults.d.ts +12 -0
  118. package/dist/core/agent/toolResults.js +38 -0
  119. package/dist/core/agent/turnPolicy.d.ts +11 -0
  120. package/dist/core/agent/turnPolicy.js +19 -0
  121. package/dist/core/agent/workState.d.ts +81 -3
  122. package/dist/core/agent/workState.js +176 -10
  123. package/dist/core/attachments/imageAttachments.js +90 -42
  124. package/dist/core/deadline.d.ts +27 -0
  125. package/dist/core/deadline.js +74 -0
  126. package/dist/core/io/boundedRead.js +1 -1
  127. package/dist/core/limits.d.ts +51 -0
  128. package/dist/core/limits.js +51 -0
  129. package/dist/core/log/llmLog.js +8 -1
  130. package/dist/core/persistence/orderedFileWriter.d.ts +10 -0
  131. package/dist/core/persistence/orderedFileWriter.js +16 -2
  132. package/dist/core/process/backgroundRegistry.d.ts +2 -3
  133. package/dist/core/process/backgroundRegistry.js +15 -10
  134. package/dist/core/process/runBoundedProcess.d.ts +8 -2
  135. package/dist/core/process/runBoundedProcess.js +15 -6
  136. package/dist/core/process/userShell.d.ts +16 -0
  137. package/dist/core/process/userShell.js +59 -0
  138. package/dist/core/safety/missingExecutable.d.ts +42 -0
  139. package/dist/core/safety/missingExecutable.js +77 -0
  140. package/dist/core/safety/shellClassifier.d.ts +11 -0
  141. package/dist/core/safety/{bashClassifier.js → shellClassifier.js} +5 -3
  142. package/dist/core/safety/urlGuard.d.ts +1 -1
  143. package/dist/core/session/sessionSlimming.d.ts +0 -3
  144. package/dist/core/session/sessionSlimming.js +2 -3
  145. package/dist/core/session/sessionStore.d.ts +38 -0
  146. package/dist/core/session/sessionStore.js +242 -59
  147. package/dist/core/{bashOutput → shellOutput}/lineFilter.js +8 -2
  148. package/dist/core/{bashOutput → shellOutput}/reducers/search.d.ts +0 -1
  149. package/dist/core/{bashOutput → shellOutput}/reducers/search.js +1 -1
  150. package/dist/core/shellOutput/registry.d.ts +2 -0
  151. package/dist/core/{bashOutput → shellOutput}/registry.js +3 -3
  152. package/dist/core/{bashOutput → shellOutput}/types.d.ts +6 -5
  153. package/dist/core/subagent/contracts.d.ts +6 -14
  154. package/dist/core/subagent/contracts.js +4 -3
  155. package/dist/core/subagent/executionProfiles.js +2 -2
  156. package/dist/core/subagent/subagentCoordinator.d.ts +4 -0
  157. package/dist/core/subagent/subagentCoordinator.js +32 -2
  158. package/dist/core/subagent/subagentRunner.js +19 -40
  159. package/dist/core/toolOutput/reduction.d.ts +0 -12
  160. package/dist/core/toolOutput/reduction.js +1 -1
  161. package/dist/core/validation/outputParser.d.ts +2 -2
  162. package/dist/llm/client.d.ts +17 -1
  163. package/dist/llm/client.js +86 -14
  164. package/dist/llm/hazeTools.d.ts +693 -204
  165. package/dist/llm/hazeTools.js +110 -28
  166. package/dist/llm/initPrompt.js +1 -1
  167. package/dist/llm/lsp/client.d.ts +45 -0
  168. package/dist/llm/lsp/client.js +195 -0
  169. package/dist/llm/lsp/pool.d.ts +23 -0
  170. package/dist/llm/lsp/pool.js +86 -0
  171. package/dist/llm/lsp/protocol.d.ts +64 -0
  172. package/dist/llm/lsp/protocol.js +128 -0
  173. package/dist/llm/lsp/requests.d.ts +94 -0
  174. package/dist/llm/lsp/requests.js +119 -0
  175. package/dist/llm/lspTools.d.ts +5653 -33
  176. package/dist/llm/lspTools.js +152 -80
  177. package/dist/llm/openaiCodex.d.ts +1 -0
  178. package/dist/llm/openaiCodex.js +43 -0
  179. package/dist/llm/openaiCodexOAuth.d.ts +51 -0
  180. package/dist/llm/openaiCodexOAuth.js +217 -0
  181. package/dist/llm/requestContext.d.ts +7 -0
  182. package/dist/llm/requestContext.js +30 -4
  183. package/dist/llm/systemPrompt.d.ts +12 -0
  184. package/dist/llm/systemPrompt.js +24 -11
  185. package/dist/llm/toolResultTypes.d.ts +7 -14
  186. package/dist/llm/toolResultTypes.js +1 -4
  187. package/dist/llm/tools/editMatch.d.ts +14 -9
  188. package/dist/llm/tools/editMatch.js +73 -1
  189. package/dist/llm/tools/failures.d.ts +2 -0
  190. package/dist/llm/tools/failures.js +1 -0
  191. package/dist/llm/tools/fetchTool.d.ts +16 -0
  192. package/dist/llm/tools/fetchTool.js +1 -1
  193. package/dist/llm/tools/fileToolShared.d.ts +8 -5
  194. package/dist/llm/tools/fileToolShared.js +22 -23
  195. package/dist/llm/tools/gitIgnore.d.ts +42 -0
  196. package/dist/llm/tools/gitIgnore.js +247 -0
  197. package/dist/llm/tools/grepParse.d.ts +2 -1
  198. package/dist/llm/tools/grepRunner.d.ts +1 -1
  199. package/dist/llm/tools/grepRunner.js +2 -2
  200. package/dist/llm/tools/outputCap.d.ts +2 -7
  201. package/dist/llm/tools/outputCap.js +3 -3
  202. package/dist/llm/tools/processTool.d.ts +16 -16
  203. package/dist/llm/tools/processTool.js +1 -1
  204. package/dist/llm/tools/readRecovery.d.ts +8 -0
  205. package/dist/llm/tools/readRecovery.js +135 -0
  206. package/dist/llm/tools/{bashTool.d.ts → shellTool.d.ts} +171 -123
  207. package/dist/llm/tools/{bashTool.js → shellTool.js} +20 -14
  208. package/dist/llm/tools/toolContext.d.ts +1 -1
  209. package/dist/llm/tools/toolContext.js +66 -37
  210. package/dist/llm/tools/workspaceFile.d.ts +0 -1
  211. package/dist/llm/tools/workspaceFile.js +1 -6
  212. package/dist/llm/webFetch.d.ts +18 -1
  213. package/dist/llm/webFetch.js +64 -97
  214. package/dist/skills/SkillLoader.d.ts +1 -11
  215. package/dist/skills/SkillLoader.js +1 -2
  216. package/dist/skills/types.d.ts +2 -1
  217. package/dist/ui/codeHighlight.d.ts +4 -0
  218. package/dist/ui/codeHighlight.js +31 -0
  219. package/dist/ui/components/Header.d.ts +1 -1
  220. package/dist/ui/components/MarkdownText.d.ts +16 -2
  221. package/dist/ui/components/MarkdownText.js +244 -34
  222. package/dist/ui/components/TextInput.d.ts +8 -1
  223. package/dist/ui/components/TextInput.js +6 -2
  224. package/dist/ui/theme.d.ts +4 -3
  225. package/dist/ui/theme.js +5 -4
  226. package/dist/utils/buildInfo.d.ts +97 -0
  227. package/dist/utils/buildInfo.js +244 -0
  228. package/dist/utils/fs.d.ts +11 -0
  229. package/dist/utils/fs.js +91 -26
  230. package/dist/utils/openPath.d.ts +2 -2
  231. package/dist/utils/openPath.js +19 -6
  232. package/dist/utils/path.d.ts +2 -1
  233. package/dist/utils/path.js +6 -2
  234. package/dist/utils/utf8.d.ts +22 -0
  235. package/dist/utils/utf8.js +54 -0
  236. package/dist/utils/version.d.ts +9 -3
  237. package/dist/utils/version.js +28 -2
  238. package/package.json +28 -21
  239. package/dist/cli/commands/lspWizard.d.ts +0 -14
  240. package/dist/cli/commands/lspWizard.js +0 -44
  241. package/dist/cli/commands/mcpWizard.d.ts +0 -15
  242. package/dist/cli/commands/skillConfirmRemove.d.ts +0 -11
  243. package/dist/cli/commands/skillConfirmRemove.js +0 -20
  244. package/dist/cli/commands/skillCreation.d.ts +0 -12
  245. package/dist/cli/commands/skillCreation.js +0 -14
  246. package/dist/cli/commands/skillWizard.d.ts +0 -17
  247. package/dist/cli/commands/streaming/idleTimer.d.ts +0 -26
  248. package/dist/cli/commands/streaming/idleTimer.js +0 -24
  249. package/dist/cli/commands/streaming/turnOutcome.d.ts +0 -10
  250. package/dist/cli/commands/streaming/turnOutcome.js +0 -13
  251. package/dist/cli/commands/wizardActions.d.ts +0 -46
  252. package/dist/cli/commands/wizardActions.js +0 -46
  253. package/dist/cli/commands/wizardInput.d.ts +0 -4
  254. package/dist/cli/commands/wizardInput.js +0 -19
  255. package/dist/cli/commands/wizardPrompts.d.ts +0 -22
  256. package/dist/cli/commands/wizardPrompts.js +0 -52
  257. package/dist/cli/commands/wizardSuggestions.d.ts +0 -31
  258. package/dist/cli/commands/wizardSuggestions.js +0 -188
  259. package/dist/cli/commands/wizardTransition.d.ts +0 -37
  260. package/dist/cli/commands/wizardTransition.js +0 -43
  261. package/dist/core/bashOutput/ansi.d.ts +0 -1
  262. package/dist/core/bashOutput/ansi.js +0 -7
  263. package/dist/core/bashOutput/registry.d.ts +0 -4
  264. package/dist/core/goal/completionPolicy.d.ts +0 -2
  265. package/dist/core/goal/completionPolicy.js +0 -7
  266. package/dist/core/goal/requestClassifier.d.ts +0 -3
  267. package/dist/core/goal/requestClassifier.js +0 -18
  268. package/dist/core/goal/sessionGoal.d.ts +0 -8
  269. package/dist/core/goal/sessionGoal.js +0 -30
  270. package/dist/core/limits/byteBudgets.d.ts +0 -18
  271. package/dist/core/limits/byteBudgets.js +0 -18
  272. package/dist/core/limits/textBudgets.d.ts +0 -23
  273. package/dist/core/limits/textBudgets.js +0 -23
  274. package/dist/core/safety/bashClassifier.d.ts +0 -10
  275. package/dist/llm/lsp.d.ts +0 -129
  276. package/dist/llm/lsp.js +0 -307
  277. package/dist/ui/components/ErrorView.d.ts +0 -4
  278. package/dist/ui/components/ErrorView.js +0 -7
  279. package/dist/utils/yaml.d.ts +0 -2
  280. package/dist/utils/yaml.js +0 -8
  281. package/examples/skills/files/SKILL.md +0 -16
  282. package/examples/skills/files/examples/file-editing.md +0 -3
  283. /package/dist/core/{bashOutput → shellOutput}/command.d.ts +0 -0
  284. /package/dist/core/{bashOutput → shellOutput}/command.js +0 -0
  285. /package/dist/core/{bashOutput → shellOutput}/lineFilter.d.ts +0 -0
  286. /package/dist/core/{bashOutput → shellOutput}/reducers/content.d.ts +0 -0
  287. /package/dist/core/{bashOutput → shellOutput}/reducers/content.js +0 -0
  288. /package/dist/core/{bashOutput → shellOutput}/reducers/gh.d.ts +0 -0
  289. /package/dist/core/{bashOutput → shellOutput}/reducers/gh.js +0 -0
  290. /package/dist/core/{bashOutput → shellOutput}/reducers/git.d.ts +0 -0
  291. /package/dist/core/{bashOutput → shellOutput}/reducers/git.js +0 -0
  292. /package/dist/core/{bashOutput → shellOutput}/reducers/validation.d.ts +0 -0
  293. /package/dist/core/{bashOutput → shellOutput}/reducers/validation.js +0 -0
  294. /package/dist/core/{bashOutput → shellOutput}/types.js +0 -0
@@ -1,188 +0,0 @@
1
- import { configuredProviders, findProvider, modelSelector, providerImageCapable } from '../../config/providers.js';
2
- import { configuredLspServers, LSP_PRESETS } from '../../config/lspSettings.js';
3
- import { configuredMcpServers, findMcpServer, findMcpPreset, presetIds } from '../../config/mcpSettings.js';
4
- import { isSkillEnabled } from '../../config/skillSettings.js';
5
- import { PROVIDER_PRESETS } from '../../config/providerPresets.js';
6
- import { COMMON_ACTIONS, LSP_ACTIONS, MCP_ACTIONS, MCP_TRANSPORTS, MODEL_CHOICES, PROVIDER_ACTIONS, PROVIDER_CHOICES, SERVER_CHOICES, SKILL_ACTIONS, SKILL_CHOICES } from './wizardActions.js';
7
- import { findSelectedSkill, skillPickerValue } from './skillWizard.js';
8
- /**
9
- * Pure suggestion builders for the chat wizard pickers (provider / model / LSP /
10
- * MCP / skills). Extracted from the React component so they are unit-testable
11
- * and so `ChatScreen` only owns interactive state, not picker content. Each
12
- * function takes its explicit inputs and returns the suggestion list shown for
13
- * the corresponding input mode.
14
- */
15
- export function providerSuggestions(settings) {
16
- return [
17
- ...configuredProviders(settings).map(provider => ({
18
- value: provider.name,
19
- description: `${provider.url} · ${provider.models.length} model${provider.models.length === 1 ? '' : 's'}`,
20
- kind: 'provider',
21
- })),
22
- { value: PROVIDER_CHOICES.addProvider, description: 'Add a new provider (presets available)', kind: 'provider' },
23
- ];
24
- }
25
- export function providerActionSuggestions(settings, selectedProviderName) {
26
- const provider = selectedProviderName ? findProvider(settings, selectedProviderName) : undefined;
27
- return [
28
- { value: PROVIDER_ACTIONS.useProvider, description: 'Set this provider and choose a model', kind: 'provider' },
29
- { value: PROVIDER_ACTIONS.addModels, description: 'Fetch the provider model list and add models', kind: 'provider' },
30
- { value: PROVIDER_ACTIONS.setApiKey, description: provider?.key ? 'Update the saved API key' : 'Add an API key', kind: 'provider' },
31
- provider
32
- ? (providerImageCapable(provider)
33
- ? { value: PROVIDER_ACTIONS.clearImageCapable, description: 'Stop sending attached images to this provider', kind: 'provider' }
34
- : { value: PROVIDER_ACTIONS.markImageCapable, description: 'Allow attached images to be sent to this provider', kind: 'provider' })
35
- : { value: PROVIDER_ACTIONS.markImageCapable, description: 'Allow attached images to be sent to this provider', kind: 'provider' },
36
- ...(provider?.models?.length ? [{ value: PROVIDER_ACTIONS.removeModels, description: 'Remove models from this provider', kind: 'provider' }] : []),
37
- { value: PROVIDER_ACTIONS.removeProvider, description: 'Delete this provider from settings', kind: 'provider' },
38
- ];
39
- }
40
- export function presetSuggestions() {
41
- const cloudPresets = PROVIDER_PRESETS.filter(p => p.category === 'cloud');
42
- const localPresets = PROVIDER_PRESETS.filter(p => p.category === 'local');
43
- return [
44
- ...cloudPresets.map(preset => ({
45
- value: preset.id,
46
- description: `${preset.baseUrl}${preset.suggestedModels?.length ? ' · e.g. ' + preset.suggestedModels.slice(0, 2).join(', ') : ''}`,
47
- kind: 'provider',
48
- })),
49
- ...localPresets.map(preset => ({
50
- value: preset.id,
51
- description: `${preset.baseUrl} · local, no API key needed`,
52
- kind: 'provider',
53
- })),
54
- { value: PROVIDER_CHOICES.custom, description: 'Enter provider name, URL, and API key manually', kind: 'provider' },
55
- ];
56
- }
57
- export function modelSuggestions(settings, modelProviderFilter) {
58
- const providers = configuredProviders(settings).filter(provider => !modelProviderFilter || provider.name === modelProviderFilter);
59
- return [
60
- ...providers.flatMap(provider => provider.models.map(model => ({
61
- value: modelProviderFilter ? model : modelSelector(provider, model),
62
- description: provider.name,
63
- kind: 'model',
64
- }))),
65
- { value: MODEL_CHOICES.addModels, description: modelProviderFilter ? `Add models to ${modelProviderFilter} (fetched from its models endpoint)` : 'Add models to a provider (fetched from its models endpoint)', kind: 'model' },
66
- ];
67
- }
68
- export function modelAddProviderSuggestions(settings) {
69
- return configuredProviders(settings).map(provider => ({
70
- value: provider.name,
71
- description: `${provider.models.length} model${provider.models.length === 1 ? '' : 's'} configured`,
72
- kind: 'provider',
73
- }));
74
- }
75
- /**
76
- * Model picker fed by live /models discovery. Curated `suggestedModels`
77
- * (from provider presets) are pinned atop the discovered list when the
78
- * endpoint actually serves them — stale curation entries simply don't pin.
79
- */
80
- export function modelPickSuggestions(settings, providerName, discoveredModels, suggestedModels = []) {
81
- const provider = providerName ? findProvider(settings, providerName) : undefined;
82
- const configured = new Set(provider?.models ?? []);
83
- const available = discoveredModels.filter(model => !configured.has(model));
84
- const availableSet = new Set(available);
85
- const pinned = suggestedModels.filter(model => availableSet.has(model));
86
- const pinnedSet = new Set(pinned);
87
- return [
88
- ...pinned.map(model => ({
89
- value: model,
90
- description: 'suggested',
91
- kind: 'model',
92
- })),
93
- ...available.filter(model => !pinnedSet.has(model)).map(model => ({
94
- value: model,
95
- description: providerName,
96
- kind: 'model',
97
- })),
98
- { value: MODEL_CHOICES.enterModelNames, description: 'Type comma-separated model names instead', kind: 'model' },
99
- ];
100
- }
101
- export function lspSuggestions(settings) {
102
- const servers = configuredLspServers(settings);
103
- return [{ value: SERVER_CHOICES.addServer, description: 'add an LSP server (presets available)', kind: 'lsp' },
104
- ...servers.map(server => ({
105
- value: server.name,
106
- description: `${server.command}${(server.args ?? []).length ? ` ${(server.args ?? []).join(' ')}` : ''} · ${server.enabled === false ? 'disabled' : 'enabled'}`,
107
- kind: 'lsp',
108
- }))];
109
- }
110
- export function lspActionSuggestions(settings, selectedLspName) {
111
- const server = selectedLspName ? configuredLspServers(settings).find(s => s.name === selectedLspName) : undefined;
112
- const result = [];
113
- if (server)
114
- result.push({ value: server.enabled === false ? COMMON_ACTIONS.enable : COMMON_ACTIONS.disable, description: `${server.enabled === false ? COMMON_ACTIONS.enable : COMMON_ACTIONS.disable} this server`, kind: 'lsp' });
115
- result.push({ value: LSP_ACTIONS.removeServer, description: 'remove this server', kind: 'lsp' });
116
- return result;
117
- }
118
- export function lspPresetSuggestions() {
119
- return [
120
- ...Object.values(LSP_PRESETS).map(preset => ({
121
- value: preset.name,
122
- description: `${preset.command} ${(preset.args ?? []).join(' ')} [${(preset.extensions ?? []).join(', ')}]`,
123
- kind: 'lsp',
124
- })),
125
- { value: SERVER_CHOICES.custom, description: 'enter a name and command manually', kind: 'lsp' },
126
- ];
127
- }
128
- export function mcpSuggestions(settings) {
129
- const servers = configuredMcpServers(settings);
130
- return [{ value: SERVER_CHOICES.addServer, description: 'add an MCP server (presets available)', kind: 'mcp' },
131
- ...servers.map(server => {
132
- const location = server.url ?? (server.command ? `${server.command} ${(server.args ?? []).join(' ')}`.trim() : '');
133
- return { value: server.name, description: `${server.transport}${location ? ` ${location}` : ''} · ${server.enabled === false ? 'disabled' : 'enabled'}`, kind: 'mcp' };
134
- })];
135
- }
136
- export function mcpActionSuggestions(settings, selectedMcpName) {
137
- const server = selectedMcpName ? findMcpServer(settings, selectedMcpName) : undefined;
138
- const result = [];
139
- if (server) {
140
- result.push({ value: server.enabled === false ? COMMON_ACTIONS.enable : COMMON_ACTIONS.disable, description: `${server.enabled === false ? COMMON_ACTIONS.enable : COMMON_ACTIONS.disable} this server`, kind: 'mcp' });
141
- if (server.transport !== 'stdio')
142
- result.push({ value: MCP_ACTIONS.setApiKey, description: server.headers?.length ? 'update the saved API key' : 'add an API key', kind: 'mcp' });
143
- }
144
- result.push({ value: MCP_ACTIONS.removeServer, description: 'remove this server', kind: 'mcp' });
145
- return result;
146
- }
147
- export function mcpPresetSuggestions() {
148
- return [
149
- ...presetIds().map(presetId => {
150
- const preset = findMcpPreset(presetId);
151
- return { value: presetId, description: preset.description ?? `${preset.transport} server`, kind: 'mcp' };
152
- }),
153
- { value: SERVER_CHOICES.custom, description: 'enter name, transport, and URL or command manually', kind: 'mcp' },
154
- ];
155
- }
156
- export function mcpTransportSuggestions() {
157
- return [
158
- { value: MCP_TRANSPORTS.http, description: 'Streamable HTTP (remote)', kind: 'mcp' },
159
- { value: MCP_TRANSPORTS.sse, description: 'Server-Sent Events (remote)', kind: 'mcp' },
160
- { value: MCP_TRANSPORTS.stdio, description: 'local process', kind: 'mcp' },
161
- ];
162
- }
163
- export function skillsSuggestions(settings, skills) {
164
- return [{ value: SKILL_CHOICES.addSkill, description: 'describe a new skill for haze to generate', kind: 'skill' },
165
- ...skills.map(skill => ({
166
- value: skills.some(candidate => candidate !== skill && candidate.name === skill.name) ? skillPickerValue(skill) : skill.name,
167
- description: `${skill.description} · ${skill.source}${isSkillEnabled(settings, skill.name, skill.source) ? '' : ' · disabled'}`,
168
- kind: 'skill',
169
- }))];
170
- }
171
- export function skillScopeSuggestions() {
172
- return [
173
- { value: 'this project', description: 'create .haze/skills/<name>/SKILL.md for this repository', kind: 'skill' },
174
- { value: 'global', description: 'create ~/.haze/skills/<name>/SKILL.md for your user', kind: 'skill' },
175
- ];
176
- }
177
- export function skillsActionSuggestions(settings, skills, selectedSkillName) {
178
- const skill = findSelectedSkill(skills, selectedSkillName);
179
- const result = [];
180
- if (skill) {
181
- const enabled = isSkillEnabled(settings, skill.name, skill.source);
182
- result.push({ value: enabled ? COMMON_ACTIONS.disable : COMMON_ACTIONS.enable, description: `${enabled ? COMMON_ACTIONS.disable : COMMON_ACTIONS.enable} this skill`, kind: 'skill' });
183
- result.push({ value: SKILL_ACTIONS.showInfo, description: 'show description, references, and path', kind: 'skill' });
184
- result.push({ value: SKILL_ACTIONS.validate, description: 're-load and validate SKILL.md', kind: 'skill' });
185
- }
186
- result.push({ value: SKILL_ACTIONS.removeSkill, description: 'delete this skill directory', kind: 'skill' });
187
- return result;
188
- }
@@ -1,37 +0,0 @@
1
- import type { HazeSettings, HazeMcpServer, HazeProviderSettings } from '../../config/settings.js';
2
- import type { Mode } from './chatModes.js';
3
- type SharedWizardEffect = {
4
- type: 'message';
5
- text?: string;
6
- } | {
7
- type: 'mode';
8
- mode: Mode;
9
- };
10
- export type ProviderWizardEffect = SharedWizardEffect | {
11
- type: 'provider-draft';
12
- patch: Partial<HazeProviderSettings>;
13
- replace?: boolean;
14
- } | {
15
- type: 'discover-provider-models';
16
- draft: Partial<HazeProviderSettings>;
17
- };
18
- export type McpWizardEffect = SharedWizardEffect | {
19
- type: 'mcp-draft';
20
- patch: Partial<HazeMcpServer>;
21
- } | {
22
- type: 'finish-mcp-stdio';
23
- draft: Partial<HazeMcpServer>;
24
- };
25
- export declare function transitionProviderField(input: {
26
- mode: Mode;
27
- value: string;
28
- settings: HazeSettings;
29
- draft: Partial<HazeProviderSettings>;
30
- }): ProviderWizardEffect[] | undefined;
31
- export declare function transitionMcpField(input: {
32
- mode: Mode;
33
- value: string;
34
- settings: HazeSettings;
35
- draft: Partial<HazeMcpServer>;
36
- }): McpWizardEffect[] | undefined;
37
- export {};
@@ -1,43 +0,0 @@
1
- import { captureMcpCommand, captureMcpName, captureMcpTransport, captureMcpUrl, captureProviderName, captureProviderUrl } from './wizardPrompts.js';
2
- export function transitionProviderField(input) {
3
- if (input.mode === 'providerAddKey') {
4
- const key = input.value.trim();
5
- return [
6
- { type: 'provider-draft', patch: key ? { key } : {} },
7
- { type: 'discover-provider-models', draft: { ...input.draft, ...(key ? { key } : {}) } },
8
- ];
9
- }
10
- const result = input.mode === 'providerAddName' ? captureProviderName(input.settings, input.value)
11
- : input.mode === 'providerAddUrl' ? captureProviderUrl(input.value)
12
- : undefined;
13
- if (!result)
14
- return undefined;
15
- if (result.message)
16
- return [{ type: 'message', text: result.message }];
17
- const patch = result.draft ?? {};
18
- return [
19
- ...(Object.keys(patch).length ? [{ type: 'provider-draft', patch, replace: input.mode === 'providerAddName' }] : []),
20
- ...(result.nextMode ? [{ type: 'mode', mode: result.nextMode }] : []),
21
- { type: 'message', text: result.systemMessage },
22
- ];
23
- }
24
- export function transitionMcpField(input) {
25
- const result = input.mode === 'mcpAddName' ? captureMcpName(input.settings, input.value)
26
- : input.mode === 'mcpAddTransport' ? captureMcpTransport(input.value)
27
- : input.mode === 'mcpAddUrl' ? captureMcpUrl(input.value)
28
- : input.mode === 'mcpAddCommand' ? captureMcpCommand(input.value)
29
- : undefined;
30
- if (!result)
31
- return undefined;
32
- if (result.message)
33
- return [{ type: 'message', text: result.message }];
34
- const patch = result.draft ?? {};
35
- const nextDraft = { ...input.draft, ...patch };
36
- if (result.nextMode === 'chat' && input.mode === 'mcpAddCommand')
37
- return [{ type: 'finish-mcp-stdio', draft: nextDraft }];
38
- return [
39
- ...(Object.keys(patch).length ? [{ type: 'mcp-draft', patch }] : []),
40
- ...(result.nextMode ? [{ type: 'mode', mode: result.nextMode }] : []),
41
- { type: 'message', text: result.systemMessage },
42
- ];
43
- }
@@ -1 +0,0 @@
1
- export declare function stripAnsi(text: string): string;
@@ -1,7 +0,0 @@
1
- /* eslint-disable no-control-regex */
2
- export function stripAnsi(text) {
3
- // Covers common CSI/OSC escape sequences emitted by CLIs.
4
- return text
5
- .replace(/\u001B\][^\u0007]*(?:\u0007|\u001B\\)/g, '')
6
- .replace(/[\u001B\u009B][[\]()#;?]*(?:(?:(?:[a-zA-Z\d]*(?:;[a-zA-Z\d]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))/g, '');
7
- }
@@ -1,4 +0,0 @@
1
- import type { BashOutputFilterInput, BashOutputFilterResult } from './types.js';
2
- import type { LineFilterDefinition } from './lineFilter.js';
3
- export declare const builtInLineFilters: LineFilterDefinition[];
4
- export declare function filterBashOutput(input: BashOutputFilterInput): BashOutputFilterResult;
@@ -1,2 +0,0 @@
1
- export declare function toolLoopBudgetPrompt(): string;
2
- export declare function repeatedToolCallPrompt(toolNames: string[]): string;
@@ -1,7 +0,0 @@
1
- export function toolLoopBudgetPrompt() {
2
- return 'Tool slice reached for this model step — tools are no longer callable in this turn. Stop attempting to describe or announce tool calls (e.g. "Let me install", "Now I\'ll run", "Let me X"); those phrases imply tool use you cannot perform. Answer once: either the final status template (current-turn changes + validation evidence) or, if incomplete, a single short line stating the next concrete unfinished action so haze can continue in a fresh tool slice. Do not repeat yourself, do not loop, do not emit XML/JSON tool-call syntax.';
3
- }
4
- export function repeatedToolCallPrompt(toolNames) {
5
- const names = [...new Set(toolNames)].join(', ');
6
- return `You already called ${names || 'a tool'} with identical input in this turn. Do not call the same tool again with the same arguments. Use the existing tool result already in the conversation, choose a different concrete tool/input if genuinely needed, or give the final/blocked status now.`;
7
- }
@@ -1,3 +0,0 @@
1
- export type RequestIntent = 'implement' | 'fix' | 'test' | 'review' | 'plan' | 'answer' | 'unknown';
2
- export declare function isPlanOnlyRequest(value: string): boolean;
3
- export declare function classifyRequestIntent(value: string): RequestIntent;
@@ -1,18 +0,0 @@
1
- export function isPlanOnlyRequest(value) {
2
- return /\b(create|make|write|draft|outline)\s+(?:a\s+)?plan\b|\bplan\s+(?:for|to)\b/i.test(value) && !/\bimplement|execute|do\b/i.test(value);
3
- }
4
- export function classifyRequestIntent(value) {
5
- if (isPlanOnlyRequest(value))
6
- return 'plan';
7
- if (/\b(review|audit|inspect|analy[sz]e|compare)\b/i.test(value))
8
- return 'review';
9
- if (/\b(fix|repair|resolve|debug)\b/i.test(value))
10
- return 'fix';
11
- if (/\b(run|verify|check|validate)\b/i.test(value) || /\btests?\b/i.test(value) && !/\b(add|create|write)\b/i.test(value))
12
- return 'test';
13
- if (/\b(add|create|write|implement|update|change|support|wire|document|docs|documentation)\b/i.test(value))
14
- return 'implement';
15
- if (/\b(what|why|how|explain|tell me)\b/i.test(value))
16
- return 'answer';
17
- return 'unknown';
18
- }
@@ -1,8 +0,0 @@
1
- import { observeWorkToolEvent, type WorkState, type WorkStatus, type WorkValidationStatus } from '../agent/workState.js';
2
- export type SessionGoalStatus = WorkStatus;
3
- export type ValidationStatus = WorkValidationStatus;
4
- export type SessionGoal = WorkState;
5
- export type GoalToolEvent = Parameters<typeof observeWorkToolEvent>[1];
6
- export declare function createSessionGoal(request: string, now?: number): SessionGoal;
7
- export declare function observeGoalToolEvent(goal: SessionGoal, event: GoalToolEvent, now?: number): WorkState;
8
- export declare function formatGoalStatus(goal: SessionGoal): string;
@@ -1,30 +0,0 @@
1
- import { classifyRequestIntent } from './requestClassifier.js';
2
- import { createWorkState, observeWorkToolEvent } from '../agent/workState.js';
3
- function shortRequest(value) {
4
- return value.replace(/\s+/g, ' ').trim().slice(0, 160) || 'current request';
5
- }
6
- export function createSessionGoal(request, now = Date.now()) {
7
- const intent = classifyRequestIntent(request);
8
- const successCriteria = intent === 'plan'
9
- ? ['Create or update the requested plan artifact/answer', 'Do not implement source changes unless asked']
10
- : intent === 'test'
11
- ? ['Run the requested validation or closest relevant check', 'Report pass/fail accurately']
12
- : intent === 'review'
13
- ? ['Inspect the relevant current project state', 'Return evidence-based findings with file paths']
14
- : intent === 'answer'
15
- ? ['Answer the user using current project context when needed']
16
- : ['Inspect the relevant files', 'Make the requested change when needed', 'Validate the change when practical', 'Summarize only current-task changes and validation'];
17
- return createWorkState(request, intent, successCriteria, now);
18
- }
19
- export function observeGoalToolEvent(goal, event, now = Date.now()) {
20
- return observeWorkToolEvent(goal, event, now);
21
- }
22
- export function formatGoalStatus(goal) {
23
- const action = goal.phase === 'starting' ? 'starting'
24
- : goal.phase === 'inspecting' ? 'inspecting'
25
- : goal.phase === 'editing' ? `${goal.touchedFiles.length} file${goal.touchedFiles.length === 1 ? '' : 's'} changed`
26
- : goal.phase === 'validating' ? `validation ${goal.validationCommands.at(-1)?.status ?? 'running'}`
27
- : goal.phase === 'summarizing' ? 'summarizing'
28
- : 'done';
29
- return `Goal: ${shortRequest(goal.originalUserRequest)} · ${action}`;
30
- }
@@ -1,18 +0,0 @@
1
- export declare const BASH_STREAM_BYTES: number;
2
- export declare const BACKGROUND_PROCESS_OUTPUT_BYTES: number;
3
- export declare const GREP_STREAM_BYTES: number;
4
- export declare const PROCESS_STDERR_BYTES: number;
5
- export declare const TOOL_OUTPUT_ENTRY_BYTES: number;
6
- export declare const TOOL_OUTPUT_TOTAL_BYTES: number;
7
- export declare const LSP_DOCUMENT_BYTES: number;
8
- export declare const LSP_HEADER_BYTES: number;
9
- export declare const LSP_FRAME_BYTES: number;
10
- export declare const LSP_BUFFER_BYTES: number;
11
- export declare const SKILL_MARKDOWN_BYTES: number;
12
- export declare const EXACT_MUTATION_BYTES: number;
13
- export declare const JSONL_LINE_BYTES: number;
14
- export declare const TEXT_LINE_BYTES: number;
15
- /** Maximum size of one user-attached image (checked before the read). */
16
- export declare const IMAGE_ATTACHMENT_BYTES: number;
17
- /** Maximum number of image attachments in a single user message. */
18
- export declare const IMAGE_ATTACHMENTS_PER_MESSAGE = 4;
@@ -1,18 +0,0 @@
1
- export const BASH_STREAM_BYTES = 2 * 1024 * 1024;
2
- export const BACKGROUND_PROCESS_OUTPUT_BYTES = 256 * 1024;
3
- export const GREP_STREAM_BYTES = 8 * 1024 * 1024;
4
- export const PROCESS_STDERR_BYTES = 64 * 1024;
5
- export const TOOL_OUTPUT_ENTRY_BYTES = 2 * 1024 * 1024;
6
- export const TOOL_OUTPUT_TOTAL_BYTES = 16 * 1024 * 1024;
7
- export const LSP_DOCUMENT_BYTES = 2 * 1024 * 1024;
8
- export const LSP_HEADER_BYTES = 16 * 1024;
9
- export const LSP_FRAME_BYTES = 8 * 1024 * 1024;
10
- export const LSP_BUFFER_BYTES = LSP_FRAME_BYTES + LSP_HEADER_BYTES;
11
- export const SKILL_MARKDOWN_BYTES = 256 * 1024;
12
- export const EXACT_MUTATION_BYTES = 8 * 1024 * 1024;
13
- export const JSONL_LINE_BYTES = 4 * 1024 * 1024;
14
- export const TEXT_LINE_BYTES = 1024 * 1024;
15
- /** Maximum size of one user-attached image (checked before the read). */
16
- export const IMAGE_ATTACHMENT_BYTES = 5 * 1024 * 1024;
17
- /** Maximum number of image attachments in a single user message. */
18
- export const IMAGE_ATTACHMENTS_PER_MESSAGE = 4;
@@ -1,23 +0,0 @@
1
- /**
2
- * Model-facing text caps (characters). Byte budgets live in `byteBudgets.ts`;
3
- * these bound the text returned to the model or persisted in previews so
4
- * callers cite a named constant instead of a magic number (CR-014).
5
- */
6
- /** Per-page cap for numbered file content returned by readFile/listFiles-style tools. */
7
- export declare const MAX_OUTPUT_CHARS = 50000;
8
- /** Default compact cap for stored bash output shown to the model. */
9
- export declare const COMPACT_COMMAND_CHARS = 12000;
10
- /** Compact cap for passing-validation summaries. */
11
- export declare const SHORT_VALIDATION_CHARS = 2000;
12
- /** Total rendered size cap for grep match output. */
13
- export declare const GREP_MAX_OUTPUT_CHARS = 30000;
14
- /** Per-line cap for rendered grep matches. */
15
- export declare const GREP_MAX_LINE_CHARS = 500;
16
- /** Bounded excerpt of older messages kept by /compact-style compaction. */
17
- export declare const COMPACTION_OLDER_CHARS = 8000;
18
- /** Session JSONL values up to this size stay inline; larger ones become previews. */
19
- export declare const SESSION_INLINE_VALUE_BYTES: number;
20
- /** Preview length for slimmed session values. */
21
- export declare const SESSION_PREVIEW_CHARS: number;
22
- /** Strings longer than this are truncated in session snapshots. */
23
- export declare const SESSION_LARGE_STRING_CHARS: number;
@@ -1,23 +0,0 @@
1
- /**
2
- * Model-facing text caps (characters). Byte budgets live in `byteBudgets.ts`;
3
- * these bound the text returned to the model or persisted in previews so
4
- * callers cite a named constant instead of a magic number (CR-014).
5
- */
6
- /** Per-page cap for numbered file content returned by readFile/listFiles-style tools. */
7
- export const MAX_OUTPUT_CHARS = 50_000;
8
- /** Default compact cap for stored bash output shown to the model. */
9
- export const COMPACT_COMMAND_CHARS = 12_000;
10
- /** Compact cap for passing-validation summaries. */
11
- export const SHORT_VALIDATION_CHARS = 2_000;
12
- /** Total rendered size cap for grep match output. */
13
- export const GREP_MAX_OUTPUT_CHARS = 30_000;
14
- /** Per-line cap for rendered grep matches. */
15
- export const GREP_MAX_LINE_CHARS = 500;
16
- /** Bounded excerpt of older messages kept by /compact-style compaction. */
17
- export const COMPACTION_OLDER_CHARS = 8_000;
18
- /** Session JSONL values up to this size stay inline; larger ones become previews. */
19
- export const SESSION_INLINE_VALUE_BYTES = 32 * 1024;
20
- /** Preview length for slimmed session values. */
21
- export const SESSION_PREVIEW_CHARS = 4 * 1024;
22
- /** Strings longer than this are truncated in session snapshots. */
23
- export const SESSION_LARGE_STRING_CHARS = 8 * 1024;
@@ -1,10 +0,0 @@
1
- export type BashRiskLevel = 'read_only' | 'mutating' | 'destructive' | 'network' | 'unknown';
2
- export type BashTrait = 'reads_files' | 'writes_files' | 'deletes_files' | 'installs_dependencies' | 'runs_tests' | 'runs_build' | 'uses_network' | 'changes_git_state' | 'changes_permissions';
3
- export type BashClassification = {
4
- riskLevel: BashRiskLevel;
5
- traits: BashTrait[];
6
- confidence: 'high' | 'medium' | 'low';
7
- reason: string;
8
- };
9
- export declare function classifyBashCommand(command: string): BashClassification;
10
- export declare function isValidationClassification(classification: BashClassification): boolean;
package/dist/llm/lsp.d.ts DELETED
@@ -1,129 +0,0 @@
1
- import { type ChildProcessWithoutNullStreams } from 'node:child_process';
2
- import type { HazeLspServer } from '../config/lspSettings.js';
3
- type Json = null | boolean | number | string | Json[] | {
4
- [key: string]: Json;
5
- };
6
- export declare class LspError extends Error {
7
- constructor(message: string);
8
- }
9
- export declare function languageId(filePath: string): string;
10
- export declare function toUri(absolutePath: string): string;
11
- export declare function fromUri(uri: string): string;
12
- export declare function isObject(value: unknown): value is Record<string, unknown>;
13
- export declare function asRange(value: unknown): {
14
- start: {
15
- line: number;
16
- character: number;
17
- };
18
- end: {
19
- line: number;
20
- character: number;
21
- };
22
- } | undefined;
23
- export declare function locationToResult(value: unknown): {
24
- external?: boolean | undefined;
25
- path: string;
26
- range: {
27
- start: {
28
- line: number;
29
- character: number;
30
- };
31
- end: {
32
- line: number;
33
- character: number;
34
- };
35
- };
36
- } | undefined;
37
- export declare function locationToWorkspaceResult(value: unknown): Promise<{
38
- external?: boolean | undefined;
39
- path: string;
40
- range: {
41
- start: {
42
- line: number;
43
- character: number;
44
- };
45
- end: {
46
- line: number;
47
- character: number;
48
- };
49
- };
50
- } | undefined>;
51
- export declare function flattenSymbols(symbols: unknown[], filePath: string, limit: number): {
52
- name: string;
53
- kind?: number;
54
- path: string;
55
- range?: ReturnType<typeof asRange>;
56
- selectionRange?: ReturnType<typeof asRange>;
57
- }[];
58
- export declare function pickLspServer(servers: HazeLspServer[], filePath: string): HazeLspServer | undefined;
59
- export declare class StdioLspClient {
60
- private server;
61
- private child;
62
- private id;
63
- private buffer;
64
- private pending;
65
- private terminating;
66
- constructor(server: HazeLspServer, child: ChildProcessWithoutNullStreams);
67
- static start(server: HazeLspServer): StdioLspClient;
68
- private rejectAll;
69
- private terminate;
70
- private onData;
71
- private send;
72
- request(method: string, params?: Json, timeoutMs?: number): Promise<unknown>;
73
- notify(method: string, params?: Json): void;
74
- initialize(): Promise<void>;
75
- openDocument(absolutePath: string): Promise<void>;
76
- close(): Promise<void>;
77
- }
78
- export declare function lspDocumentSymbols(server: HazeLspServer, filePath: string, limit: number): Promise<{
79
- name: string;
80
- kind?: number;
81
- path: string;
82
- range?: ReturnType<typeof asRange>;
83
- selectionRange?: ReturnType<typeof asRange>;
84
- }[]>;
85
- export declare function lspDefinition(server: HazeLspServer, filePath: string, line: number, character: number, limit: number): Promise<{
86
- external?: boolean | undefined;
87
- path: string;
88
- range: {
89
- start: {
90
- line: number;
91
- character: number;
92
- };
93
- end: {
94
- line: number;
95
- character: number;
96
- };
97
- };
98
- }[]>;
99
- export declare function lspReferences(server: HazeLspServer, filePath: string, line: number, character: number, limit: number): Promise<{
100
- external?: boolean | undefined;
101
- path: string;
102
- range: {
103
- start: {
104
- line: number;
105
- character: number;
106
- };
107
- end: {
108
- line: number;
109
- character: number;
110
- };
111
- };
112
- }[]>;
113
- export declare function lspWorkspaceSymbols(server: HazeLspServer, query: string, limit: number): Promise<{
114
- external?: boolean | undefined;
115
- path: string;
116
- range: {
117
- start: {
118
- line: number;
119
- character: number;
120
- };
121
- end: {
122
- line: number;
123
- character: number;
124
- };
125
- };
126
- name: string;
127
- kind: number | undefined;
128
- }[]>;
129
- export {};