@denizokcu/haze 0.9.0 → 0.10.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 (158) hide show
  1. package/CHANGELOG.md +57 -17
  2. package/README.md +119 -64
  3. package/dist/cli/chat/chatMetrics.d.ts +17 -1
  4. package/dist/cli/chat/chatMetrics.js +22 -5
  5. package/dist/cli/chat/contextReport.d.ts +11 -0
  6. package/dist/cli/chat/contextReport.js +44 -0
  7. package/dist/cli/chat/fileMentionSuggestions.d.ts +29 -0
  8. package/dist/cli/chat/fileMentionSuggestions.js +91 -0
  9. package/dist/cli/chat/inputSuggestions.d.ts +5 -0
  10. package/dist/cli/chat/inputSuggestions.js +17 -3
  11. package/dist/cli/chat/sessionLifecycle.d.ts +58 -0
  12. package/dist/cli/chat/sessionLifecycle.js +155 -0
  13. package/dist/cli/chat/sessionRecorder.js +7 -9
  14. package/dist/cli/chat/startupInfo.d.ts +1 -0
  15. package/dist/cli/chat/startupInfo.js +11 -0
  16. package/dist/cli/chat/tips.d.ts +21 -0
  17. package/dist/cli/chat/tips.js +43 -0
  18. package/dist/cli/chat/wizardDispatch.d.ts +64 -0
  19. package/dist/cli/chat/wizardDispatch.js +645 -0
  20. package/dist/cli/commands/chat.d.ts +1 -0
  21. package/dist/cli/commands/chat.js +181 -700
  22. package/dist/cli/commands/chatModes.d.ts +1 -1
  23. package/dist/cli/commands/chatModes.js +7 -2
  24. package/dist/cli/commands/commandHelp.js +5 -3
  25. package/dist/cli/commands/commands.d.ts +3 -2
  26. package/dist/cli/commands/commands.js +12 -13
  27. package/dist/cli/commands/fleetCommand.d.ts +14 -0
  28. package/dist/cli/commands/fleetCommand.js +46 -0
  29. package/dist/cli/commands/formatters.d.ts +5 -0
  30. package/dist/cli/commands/formatters.js +33 -6
  31. package/dist/cli/commands/logsCommand.js +1 -7
  32. package/dist/cli/commands/modelCommand.js +1 -1
  33. package/dist/cli/commands/providerWizard.d.ts +1 -0
  34. package/dist/cli/commands/providerWizard.js +13 -0
  35. package/dist/cli/commands/runCommand.d.ts +1 -0
  36. package/dist/cli/commands/runCommand.js +25 -5
  37. package/dist/cli/commands/sessionPicker.d.ts +9 -0
  38. package/dist/cli/commands/sessionPicker.js +29 -0
  39. package/dist/cli/commands/settingsSummary.js +6 -4
  40. package/dist/cli/commands/skillConfirmRemove.js +4 -3
  41. package/dist/cli/commands/skillWizard.d.ts +2 -0
  42. package/dist/cli/commands/skillWizard.js +16 -6
  43. package/dist/cli/commands/streaming/idleTimer.d.ts +26 -0
  44. package/dist/cli/commands/streaming/idleTimer.js +24 -0
  45. package/dist/cli/commands/streaming/toolGroupRenderer.d.ts +2 -0
  46. package/dist/cli/commands/streaming/toolGroupRenderer.js +4 -2
  47. package/dist/cli/commands/streaming/turnRuntime.js +6 -4
  48. package/dist/cli/commands/streaming.d.ts +13 -1
  49. package/dist/cli/commands/streaming.js +42 -19
  50. package/dist/cli/commands/wizardActions.d.ts +6 -0
  51. package/dist/cli/commands/wizardActions.js +6 -0
  52. package/dist/cli/commands/wizardSuggestions.d.ts +8 -0
  53. package/dist/cli/commands/wizardSuggestions.js +60 -12
  54. package/dist/cli/commands/wizardTransition.d.ts +4 -0
  55. package/dist/cli/commands/wizardTransition.js +1 -2
  56. package/dist/cli/index.js +17 -3
  57. package/dist/cli/terminalTitle.d.ts +6 -0
  58. package/dist/cli/terminalTitle.js +36 -0
  59. package/dist/config/inputHistory.d.ts +3 -3
  60. package/dist/config/inputHistory.js +12 -18
  61. package/dist/config/modelDiscovery.d.ts +20 -0
  62. package/dist/config/modelDiscovery.js +51 -0
  63. package/dist/config/providerPresets.d.ts +16 -4
  64. package/dist/config/providerPresets.js +263 -34
  65. package/dist/config/providers.d.ts +2 -0
  66. package/dist/config/providers.js +7 -0
  67. package/dist/config/settings.d.ts +22 -0
  68. package/dist/config/settings.js +29 -1
  69. package/dist/config/skillSettings.d.ts +6 -13
  70. package/dist/config/skillSettings.js +20 -19
  71. package/dist/core/agent/budgets.d.ts +26 -0
  72. package/dist/core/agent/budgets.js +34 -0
  73. package/dist/core/agent/compaction.js +17 -3
  74. package/dist/core/agent/contextBudget.d.ts +8 -0
  75. package/dist/core/agent/contextBudget.js +29 -0
  76. package/dist/core/agent/errors.js +6 -2
  77. package/dist/core/agent/events.d.ts +12 -0
  78. package/dist/core/agent/toolOutputStore.d.ts +5 -0
  79. package/dist/core/agent/toolOutputStore.js +18 -1
  80. package/dist/core/agent/workState.d.ts +1 -1
  81. package/dist/core/agent/workState.js +0 -4
  82. package/dist/core/attachments/imageAttachments.d.ts +90 -0
  83. package/dist/core/attachments/imageAttachments.js +245 -0
  84. package/dist/core/attachments/readBlessings.d.ts +37 -0
  85. package/dist/core/attachments/readBlessings.js +79 -0
  86. package/dist/core/goal/requestClassifier.d.ts +0 -3
  87. package/dist/core/goal/requestClassifier.js +0 -13
  88. package/dist/core/io/boundedRead.js +76 -29
  89. package/dist/core/limits/byteBudgets.d.ts +5 -0
  90. package/dist/core/limits/byteBudgets.js +5 -0
  91. package/dist/core/limits/textBudgets.d.ts +23 -0
  92. package/dist/core/limits/textBudgets.js +23 -0
  93. package/dist/core/process/backgroundRegistry.d.ts +35 -0
  94. package/dist/core/process/backgroundRegistry.js +194 -0
  95. package/dist/core/process/runBoundedProcess.d.ts +3 -0
  96. package/dist/core/process/runBoundedProcess.js +65 -29
  97. package/dist/core/safety/urlGuard.d.ts +2 -1
  98. package/dist/core/safety/urlGuard.js +3 -2
  99. package/dist/core/session/sessionSlimming.js +47 -4
  100. package/dist/core/session/sessionStore.d.ts +37 -0
  101. package/dist/core/session/sessionStore.js +95 -9
  102. package/dist/core/subagent/contracts.d.ts +116 -0
  103. package/dist/core/subagent/contracts.js +54 -0
  104. package/dist/core/subagent/executionProfiles.d.ts +28 -0
  105. package/dist/core/subagent/executionProfiles.js +45 -0
  106. package/dist/core/subagent/subagentCoordinator.d.ts +74 -0
  107. package/dist/core/subagent/subagentCoordinator.js +134 -0
  108. package/dist/core/subagent/subagentRunner.d.ts +211 -145
  109. package/dist/core/subagent/subagentRunner.js +228 -98
  110. package/dist/core/subagent/workspaceMutationPolicy.d.ts +11 -0
  111. package/dist/core/subagent/workspaceMutationPolicy.js +52 -0
  112. package/dist/core/tasks/taskStorage.js +12 -1
  113. package/dist/llm/client.d.ts +20 -29
  114. package/dist/llm/client.js +29 -28
  115. package/dist/llm/hazeTools.d.ts +2013 -78
  116. package/dist/llm/hazeTools.js +16 -7
  117. package/dist/llm/lsp.d.ts +2 -0
  118. package/dist/llm/lsp.js +18 -3
  119. package/dist/llm/requestContext.d.ts +22 -1
  120. package/dist/llm/requestContext.js +45 -5
  121. package/dist/llm/systemPrompt.d.ts +4 -1
  122. package/dist/llm/systemPrompt.js +14 -4
  123. package/dist/llm/toolResultTypes.d.ts +1 -1
  124. package/dist/llm/tools/bashTool.d.ts +874 -32
  125. package/dist/llm/tools/bashTool.js +25 -4
  126. package/dist/llm/tools/fetchTool.d.ts +26 -26
  127. package/dist/llm/tools/fetchTool.js +1 -1
  128. package/dist/llm/tools/fileToolShared.d.ts +2 -1
  129. package/dist/llm/tools/fileToolShared.js +5 -5
  130. package/dist/llm/tools/grepRunner.d.ts +5 -0
  131. package/dist/llm/tools/grepRunner.js +52 -71
  132. package/dist/llm/tools/outputCap.d.ts +2 -6
  133. package/dist/llm/tools/outputCap.js +2 -6
  134. package/dist/llm/tools/processTool.d.ts +1077 -0
  135. package/dist/llm/tools/processTool.js +41 -0
  136. package/dist/llm/tools/toolContext.d.ts +8 -0
  137. package/dist/llm/tools/toolContext.js +22 -11
  138. package/dist/llm/tools/workspaceFile.d.ts +9 -1
  139. package/dist/llm/tools/workspaceFile.js +33 -4
  140. package/dist/llm/webFetch.js +24 -11
  141. package/dist/llm/workerContext.d.ts +18 -0
  142. package/dist/llm/workerContext.js +55 -0
  143. package/dist/skills/SkillLoader.d.ts +2 -2
  144. package/dist/skills/SkillRegistry.d.ts +3 -2
  145. package/dist/skills/SkillRegistry.js +43 -13
  146. package/dist/skills/builder/SkillBuilder.d.ts +3 -0
  147. package/dist/skills/builder/SkillBuilder.js +23 -5
  148. package/dist/skills/skillTools.js +11 -4
  149. package/dist/skills/types.d.ts +6 -1
  150. package/dist/ui/components/TextInput.d.ts +5 -2
  151. package/dist/ui/components/TextInput.js +76 -8
  152. package/dist/utils/format.d.ts +2 -0
  153. package/dist/utils/format.js +8 -0
  154. package/dist/utils/fs.d.ts +0 -1
  155. package/dist/utils/fs.js +0 -4
  156. package/dist/utils/openPath.d.ts +2 -0
  157. package/dist/utils/openPath.js +9 -0
  158. package/package.json +1 -1
@@ -5,35 +5,29 @@ import { tightenPrivateFile, writePrivateJsonAtomic } from './privateStorage.js'
5
5
  const HISTORY_DIR = path.join(HAZE_DIR, 'history');
6
6
  export const INPUT_HISTORY_FILE = path.join(HISTORY_DIR, 'input-history.json');
7
7
  const MAX_HISTORY_ITEMS = 500;
8
- const DISABLE_PERSISTENT_HISTORY = process.env.VITEST === 'true' || process.env.NODE_ENV === 'test';
9
- let testHistory = [];
10
8
  function normalizeHistory(value) {
11
9
  if (!Array.isArray(value))
12
10
  return [];
13
11
  return value.filter((item) => typeof item === 'string' && item.trim().length > 0);
14
12
  }
15
- export async function readInputHistory() {
16
- if (DISABLE_PERSISTENT_HISTORY)
17
- return testHistory.slice(-MAX_HISTORY_ITEMS);
18
- if (await fs.pathExists(INPUT_HISTORY_FILE))
19
- await tightenPrivateFile(INPUT_HISTORY_FILE);
20
- const data = await fs.readJson(INPUT_HISTORY_FILE).catch(() => []);
13
+ // The storage path is injectable so tests isolate via temp files instead of
14
+ // production switches on test-env globals (CR-011).
15
+ export async function readInputHistory(file = INPUT_HISTORY_FILE) {
16
+ if (await fs.pathExists(file))
17
+ await tightenPrivateFile(file);
18
+ const data = await fs.readJson(file).catch(() => []);
21
19
  return normalizeHistory(data).slice(-MAX_HISTORY_ITEMS);
22
20
  }
23
- export async function writeInputHistory(history) {
21
+ export async function writeInputHistory(history, file = INPUT_HISTORY_FILE) {
24
22
  const normalized = normalizeHistory(history).slice(-MAX_HISTORY_ITEMS);
25
- if (DISABLE_PERSISTENT_HISTORY) {
26
- testHistory = normalized;
27
- return;
28
- }
29
- await writePrivateJsonAtomic(INPUT_HISTORY_FILE, normalized);
23
+ await writePrivateJsonAtomic(file, normalized);
30
24
  }
31
- export async function addInputHistoryItem(item) {
25
+ export async function addInputHistoryItem(item, file = INPUT_HISTORY_FILE) {
32
26
  const trimmed = item.trim();
33
27
  if (!trimmed)
34
- return readInputHistory();
35
- const current = await readInputHistory();
28
+ return readInputHistory(file);
29
+ const current = await readInputHistory(file);
36
30
  const next = current[current.length - 1] === trimmed ? current : [...current, trimmed];
37
- await writeInputHistory(next);
31
+ await writeInputHistory(next, file);
38
32
  return next.slice(-MAX_HISTORY_ITEMS);
39
33
  }
@@ -0,0 +1,20 @@
1
+ import type { HazeProviderSettings } from './settings.js';
2
+ /**
3
+ * Model discovery against the OpenAI-compatible `/models` endpoint every
4
+ * provider in haze exposes. Used to turn "add models" from a memorize-and-type
5
+ * step into a pick-from-list step; callers fall back to manual input when the
6
+ * endpoint is unavailable.
7
+ */
8
+ export type ModelDiscoveryResult = {
9
+ status: 'ok';
10
+ models: string[];
11
+ } | {
12
+ status: 'failed';
13
+ error: string;
14
+ };
15
+ export declare function modelsEndpointUrl(baseUrl: string): string;
16
+ export declare function parseModelsBody(body: unknown): string[];
17
+ export declare function discoverProviderModels(provider: Pick<HazeProviderSettings, 'url' | 'key'>, options?: {
18
+ timeoutMs?: number;
19
+ fetchImpl?: typeof fetch;
20
+ }): Promise<ModelDiscoveryResult>;
@@ -0,0 +1,51 @@
1
+ const DEFAULT_TIMEOUT_MS = 5000;
2
+ /** Discovery feeds a type-filtered picker; cap the stored list, not the UX. */
3
+ const MAX_DISCOVERED_MODELS = 500;
4
+ export function modelsEndpointUrl(baseUrl) {
5
+ return `${baseUrl.trim().replace(/\/+$/, '')}/models`;
6
+ }
7
+ export function parseModelsBody(body) {
8
+ const data = body?.data;
9
+ if (!Array.isArray(data))
10
+ return [];
11
+ const ids = data
12
+ .map(item => item?.id)
13
+ .filter((id) => typeof id === 'string' && id.trim().length > 0)
14
+ .map(id => id.trim());
15
+ return [...new Set(ids)].sort((a, b) => a.localeCompare(b)).slice(0, MAX_DISCOVERED_MODELS);
16
+ }
17
+ function describeFetchError(error) {
18
+ if (error instanceof Error) {
19
+ if (error.name === 'TimeoutError' || error.name === 'AbortError')
20
+ return 'timed out';
21
+ return error.message;
22
+ }
23
+ return String(error);
24
+ }
25
+ export async function discoverProviderModels(provider, options = {}) {
26
+ const fetchImpl = options.fetchImpl ?? fetch;
27
+ const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
28
+ let response;
29
+ try {
30
+ response = await fetchImpl(modelsEndpointUrl(provider.url), {
31
+ headers: { accept: 'application/json', ...(provider.key ? { authorization: `Bearer ${provider.key}` } : {}) },
32
+ signal: AbortSignal.timeout(timeoutMs),
33
+ });
34
+ }
35
+ catch (error) {
36
+ return { status: 'failed', error: describeFetchError(error) };
37
+ }
38
+ if (!response.ok)
39
+ return { status: 'failed', error: `endpoint returned HTTP ${response.status}` };
40
+ let body;
41
+ try {
42
+ body = await response.json();
43
+ }
44
+ catch {
45
+ return { status: 'failed', error: 'endpoint returned no JSON' };
46
+ }
47
+ const models = parseModelsBody(body);
48
+ if (models.length === 0)
49
+ return { status: 'failed', error: 'endpoint returned no models' };
50
+ return { status: 'ok', models };
51
+ }
@@ -1,7 +1,10 @@
1
1
  /**
2
- * Known provider presets derived from community conventions (nanocoder, OpenRouter docs, etc.).
3
- * Each preset carries a pre-configured base URL so users only need to supply an API key and model names.
4
- * Local/keyless providers have sensible localhost defaults.
2
+ * Known provider presets derived from community conventions (nanocoder, OpenRouter docs, etc.),
3
+ * enriched from Pi's built-in provider registry and generated model catalog
4
+ * (https://github.com/earendil-works/pi, `packages/ai` — provider ids, base URLs,
5
+ * API-key env var conventions, and current model ids).
6
+ * Each preset carries a pre-configured OpenAI-compatible base URL so users only need to supply
7
+ * an API key and model names. Local/keyless providers have sensible localhost defaults.
5
8
  */
6
9
  export interface ProviderPreset {
7
10
  /** Unique identifier used as the selection value. */
@@ -14,7 +17,16 @@ export interface ProviderPreset {
14
17
  needsApiKey: boolean;
15
18
  /** Hint shown when prompting for the API key. */
16
19
  apiKeyHint?: string;
17
- /** Optional suggested default model(s). */
20
+ /**
21
+ * Conventional environment variable holding this provider's API key (from Pi's
22
+ * auth registry). Informational only — haze never reads provider env vars itself.
23
+ */
24
+ apiKeyEnvVar?: string;
25
+ /**
26
+ * Curated model ids. Pinned atop the live /models discovery picker when the
27
+ * endpoint actually serves them (stale entries simply don't pin), and shown
28
+ * as type-in examples when discovery fails.
29
+ */
18
30
  suggestedModels?: string[];
19
31
  /** Category for grouping in the picker. */
20
32
  category: 'cloud' | 'local';
@@ -1,7 +1,10 @@
1
1
  /**
2
- * Known provider presets derived from community conventions (nanocoder, OpenRouter docs, etc.).
3
- * Each preset carries a pre-configured base URL so users only need to supply an API key and model names.
4
- * Local/keyless providers have sensible localhost defaults.
2
+ * Known provider presets derived from community conventions (nanocoder, OpenRouter docs, etc.),
3
+ * enriched from Pi's built-in provider registry and generated model catalog
4
+ * (https://github.com/earendil-works/pi, `packages/ai` — provider ids, base URLs,
5
+ * API-key env var conventions, and current model ids).
6
+ * Each preset carries a pre-configured OpenAI-compatible base URL so users only need to supply
7
+ * an API key and model names. Local/keyless providers have sensible localhost defaults.
5
8
  */
6
9
  export const PROVIDER_PRESETS = [
7
10
  // ── Cloud providers (API key required) ──────────────────────────────
@@ -10,12 +13,14 @@ export const PROVIDER_PRESETS = [
10
13
  name: 'OpenRouter',
11
14
  baseUrl: 'https://openrouter.ai/api/v1',
12
15
  needsApiKey: true,
16
+ apiKeyEnvVar: 'OPENROUTER_API_KEY',
13
17
  suggestedModels: [
14
18
  // SOTA
15
19
  'anthropic/claude-opus-4.8',
16
- 'openai/gpt-5.4',
17
- 'google/gemini-3.1-pro',
20
+ 'openai/gpt-5.5',
21
+ 'google/gemini-3.1-pro-preview',
18
22
  // Fast
23
+ 'anthropic/claude-sonnet-5',
19
24
  'anthropic/claude-sonnet-4.6',
20
25
  'openai/gpt-5.4-mini',
21
26
  'google/gemini-3.5-flash',
@@ -28,9 +33,12 @@ export const PROVIDER_PRESETS = [
28
33
  name: 'OpenAI',
29
34
  baseUrl: 'https://api.openai.com/v1',
30
35
  needsApiKey: true,
36
+ apiKeyEnvVar: 'OPENAI_API_KEY',
31
37
  suggestedModels: [
32
38
  // SOTA
33
39
  'gpt-5.5',
40
+ 'gpt-5.6-sol',
41
+ 'gpt-5.6-terra',
34
42
  'o3',
35
43
  // Fast
36
44
  'gpt-5.4',
@@ -44,11 +52,14 @@ export const PROVIDER_PRESETS = [
44
52
  name: 'Anthropic Claude',
45
53
  baseUrl: 'https://api.anthropic.com/v1',
46
54
  needsApiKey: true,
55
+ apiKeyEnvVar: 'ANTHROPIC_API_KEY',
47
56
  suggestedModels: [
48
57
  // SOTA
58
+ 'claude-opus-5',
49
59
  'claude-opus-4-8',
50
60
  'claude-fable-5',
51
61
  // Fast
62
+ 'claude-sonnet-5',
52
63
  'claude-sonnet-4-6',
53
64
  'claude-haiku-4-5',
54
65
  ],
@@ -60,11 +71,13 @@ export const PROVIDER_PRESETS = [
60
71
  baseUrl: 'https://generativelanguage.googleapis.com/v1beta',
61
72
  needsApiKey: true,
62
73
  apiKeyHint: 'API Key (from https://aistudio.google.com/apikey)',
74
+ apiKeyEnvVar: 'GEMINI_API_KEY',
63
75
  suggestedModels: [
64
76
  // SOTA
77
+ 'gemini-3.1-pro-preview',
65
78
  'gemini-3.5-flash',
66
- 'gemini-3.1-pro',
67
79
  // Fast
80
+ 'gemini-3.6-flash',
68
81
  'gemini-3.1-flash-lite',
69
82
  'gemini-2.5-flash',
70
83
  'gemini-2.5-pro',
@@ -76,6 +89,7 @@ export const PROVIDER_PRESETS = [
76
89
  name: 'Mistral AI',
77
90
  baseUrl: 'https://api.mistral.ai/v1',
78
91
  needsApiKey: true,
92
+ apiKeyEnvVar: 'MISTRAL_API_KEY',
79
93
  suggestedModels: [
80
94
  // SOTA
81
95
  'mistral-large-2512',
@@ -83,6 +97,36 @@ export const PROVIDER_PRESETS = [
83
97
  // Fast
84
98
  'mistral-small-2603',
85
99
  'codestral-2508',
100
+ 'devstral-2512',
101
+ ],
102
+ category: 'cloud',
103
+ },
104
+ {
105
+ id: 'deepseek',
106
+ name: 'DeepSeek',
107
+ baseUrl: 'https://api.deepseek.com/v1',
108
+ needsApiKey: true,
109
+ apiKeyEnvVar: 'DEEPSEEK_API_KEY',
110
+ suggestedModels: [
111
+ // SOTA
112
+ 'deepseek-v4-pro',
113
+ // Fast
114
+ 'deepseek-v4-flash',
115
+ ],
116
+ category: 'cloud',
117
+ },
118
+ {
119
+ id: 'xai',
120
+ name: 'xAI Grok',
121
+ baseUrl: 'https://api.x.ai/v1',
122
+ needsApiKey: true,
123
+ apiKeyEnvVar: 'XAI_API_KEY',
124
+ suggestedModels: [
125
+ // SOTA
126
+ 'grok-4.5',
127
+ 'grok-4.3',
128
+ // Fast
129
+ 'grok-build-0.1',
86
130
  ],
87
131
  category: 'cloud',
88
132
  },
@@ -91,9 +135,11 @@ export const PROVIDER_PRESETS = [
91
135
  name: 'Z.ai',
92
136
  baseUrl: 'https://api.z.ai/api/paas/v4/',
93
137
  needsApiKey: true,
138
+ apiKeyEnvVar: 'ZAI_API_KEY',
94
139
  suggestedModels: [
140
+ 'glm-5.2',
95
141
  'glm-5.1',
96
- 'glm-5.1-fw',
142
+ 'glm-5-turbo',
97
143
  ],
98
144
  category: 'cloud',
99
145
  },
@@ -102,9 +148,208 @@ export const PROVIDER_PRESETS = [
102
148
  name: 'Z.ai Coding Subscription',
103
149
  baseUrl: 'https://api.z.ai/api/coding/paas/v4/',
104
150
  needsApiKey: true,
151
+ apiKeyEnvVar: 'ZAI_API_KEY',
105
152
  suggestedModels: [
153
+ 'glm-5.2',
106
154
  'glm-5.1',
107
- 'glm-5.1-fw',
155
+ 'glm-5v-turbo',
156
+ ],
157
+ category: 'cloud',
158
+ },
159
+ {
160
+ id: 'kimi-code',
161
+ name: 'Kimi Code',
162
+ baseUrl: 'https://api.kimi.com/coding/v1',
163
+ needsApiKey: true,
164
+ apiKeyEnvVar: 'KIMI_API_KEY',
165
+ suggestedModels: [
166
+ 'kimi-for-coding',
167
+ 'k3',
168
+ ],
169
+ category: 'cloud',
170
+ },
171
+ {
172
+ id: 'moonshot',
173
+ name: 'Moonshot AI (Kimi API)',
174
+ baseUrl: 'https://api.moonshot.ai/v1',
175
+ needsApiKey: true,
176
+ apiKeyEnvVar: 'MOONSHOT_API_KEY',
177
+ suggestedModels: [
178
+ // SOTA
179
+ 'kimi-k3',
180
+ 'kimi-k2.7-code',
181
+ // Fast
182
+ 'kimi-k2.6',
183
+ 'kimi-k2.5',
184
+ ],
185
+ category: 'cloud',
186
+ },
187
+ {
188
+ id: 'minimax-coding',
189
+ name: 'MiniMax Coding Plan',
190
+ baseUrl: 'https://api.minimax.io/anthropic/v1',
191
+ needsApiKey: true,
192
+ apiKeyEnvVar: 'MINIMAX_API_KEY',
193
+ suggestedModels: [
194
+ // SOTA
195
+ 'MiniMax-M3',
196
+ // Fast
197
+ 'MiniMax-M2.7',
198
+ 'MiniMax-M2.7-highspeed',
199
+ ],
200
+ category: 'cloud',
201
+ },
202
+ {
203
+ id: 'groq',
204
+ name: 'Groq',
205
+ baseUrl: 'https://api.groq.com/openai/v1',
206
+ needsApiKey: true,
207
+ apiKeyEnvVar: 'GROQ_API_KEY',
208
+ suggestedModels: [
209
+ 'openai/gpt-oss-120b',
210
+ 'qwen/qwen3-32b',
211
+ 'llama-3.3-70b-versatile',
212
+ ],
213
+ category: 'cloud',
214
+ },
215
+ {
216
+ id: 'cerebras',
217
+ name: 'Cerebras',
218
+ baseUrl: 'https://api.cerebras.ai/v1',
219
+ needsApiKey: true,
220
+ apiKeyEnvVar: 'CEREBRAS_API_KEY',
221
+ suggestedModels: [
222
+ 'gpt-oss-120b',
223
+ 'zai-glm-4.7',
224
+ ],
225
+ category: 'cloud',
226
+ },
227
+ {
228
+ id: 'together',
229
+ name: 'Together AI',
230
+ baseUrl: 'https://api.together.ai/v1',
231
+ needsApiKey: true,
232
+ apiKeyEnvVar: 'TOGETHER_API_KEY',
233
+ suggestedModels: [
234
+ // SOTA
235
+ 'moonshotai/Kimi-K3',
236
+ 'deepseek-ai/DeepSeek-V4-Pro',
237
+ // Fast
238
+ 'moonshotai/Kimi-K2.7-Code',
239
+ 'zai-org/GLM-5.2',
240
+ ],
241
+ category: 'cloud',
242
+ },
243
+ {
244
+ id: 'fireworks',
245
+ name: 'Fireworks AI',
246
+ baseUrl: 'https://api.fireworks.ai/inference/v1',
247
+ needsApiKey: true,
248
+ apiKeyEnvVar: 'FIREWORKS_API_KEY',
249
+ suggestedModels: [
250
+ // SOTA
251
+ 'accounts/fireworks/models/kimi-k3',
252
+ 'accounts/fireworks/models/glm-5p2',
253
+ // Fast
254
+ 'accounts/fireworks/routers/kimi-k3-fast',
255
+ 'accounts/fireworks/models/minimax-m3',
256
+ ],
257
+ category: 'cloud',
258
+ },
259
+ {
260
+ id: 'huggingface',
261
+ name: 'Hugging Face Router',
262
+ baseUrl: 'https://router.huggingface.co/v1',
263
+ needsApiKey: true,
264
+ apiKeyHint: 'Hugging Face token (from https://huggingface.co/settings/tokens)',
265
+ apiKeyEnvVar: 'HF_TOKEN',
266
+ suggestedModels: [
267
+ // SOTA
268
+ 'moonshotai/Kimi-K3',
269
+ 'zai-org/GLM-5.2',
270
+ // Fast
271
+ 'deepseek-ai/DeepSeek-V4-Flash',
272
+ 'Qwen/Qwen3-Coder-Next',
273
+ ],
274
+ category: 'cloud',
275
+ },
276
+ {
277
+ id: 'nvidia',
278
+ name: 'NVIDIA NIM',
279
+ baseUrl: 'https://integrate.api.nvidia.com/v1',
280
+ needsApiKey: true,
281
+ apiKeyEnvVar: 'NVIDIA_API_KEY',
282
+ suggestedModels: [
283
+ 'nvidia/nemotron-3-ultra-550b-a55b',
284
+ 'nvidia/nemotron-3-super-120b-a12b',
285
+ 'minimaxai/minimax-m3',
286
+ ],
287
+ category: 'cloud',
288
+ },
289
+ {
290
+ id: 'qwen-token-plan',
291
+ name: 'Qwen Token Plan',
292
+ baseUrl: 'https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1',
293
+ needsApiKey: true,
294
+ apiKeyHint: 'Alibaba Cloud Model Studio API key with a token plan',
295
+ apiKeyEnvVar: 'QWEN_TOKEN_PLAN_API_KEY',
296
+ suggestedModels: [
297
+ // SOTA
298
+ 'qwen3.7-max',
299
+ 'glm-5.2',
300
+ // Fast
301
+ 'qwen3.7-plus',
302
+ 'kimi-k2.7-code',
303
+ ],
304
+ category: 'cloud',
305
+ },
306
+ {
307
+ id: 'opencode-zen',
308
+ name: 'OpenCode Zen',
309
+ baseUrl: 'https://opencode.ai/zen/v1',
310
+ needsApiKey: true,
311
+ apiKeyEnvVar: 'OPENCODE_API_KEY',
312
+ suggestedModels: [
313
+ // SOTA
314
+ 'claude-opus-4-8',
315
+ 'gpt-5.5',
316
+ // Fast
317
+ 'claude-sonnet-4-6',
318
+ 'kimi-k3',
319
+ 'minimax-m3',
320
+ ],
321
+ category: 'cloud',
322
+ },
323
+ {
324
+ id: 'requesty',
325
+ name: 'Requesty',
326
+ baseUrl: 'https://router.requesty.ai/v1',
327
+ needsApiKey: true,
328
+ apiKeyHint: 'API Key (from https://app.requesty.ai/api-keys)',
329
+ suggestedModels: [
330
+ 'openai/gpt-4o-mini',
331
+ ],
332
+ category: 'cloud',
333
+ },
334
+ {
335
+ id: 'thesean',
336
+ name: 'Thesean AI',
337
+ baseUrl: 'https://api.thesean.ai',
338
+ needsApiKey: true,
339
+ apiKeyHint: 'API Key (from https://app.thesean.ai/)',
340
+ suggestedModels: [
341
+ 'ship-like/claude-opus-4-8',
342
+ ],
343
+ category: 'cloud',
344
+ },
345
+ {
346
+ id: 'atlas-cloud',
347
+ name: 'Atlas Cloud',
348
+ baseUrl: 'https://api.atlascloud.ai/v1',
349
+ needsApiKey: true,
350
+ apiKeyHint: 'API Key (from atlascloud.ai/developer)',
351
+ suggestedModels: [
352
+ 'gpt-5.6-sol',
108
353
  ],
109
354
  category: 'cloud',
110
355
  },
@@ -114,6 +359,7 @@ export const PROVIDER_PRESETS = [
114
359
  baseUrl: 'https://models.github.ai/inference',
115
360
  needsApiKey: true,
116
361
  apiKeyHint: 'GitHub Token (PAT with models:read scope)',
362
+ apiKeyEnvVar: 'GITHUB_TOKEN',
117
363
  suggestedModels: [
118
364
  'gpt-5.4',
119
365
  'gpt-5.4-mini',
@@ -125,14 +371,17 @@ export const PROVIDER_PRESETS = [
125
371
  {
126
372
  id: 'github-copilot',
127
373
  name: 'GitHub Copilot',
128
- baseUrl: 'https://api.githubcopilot.com',
374
+ baseUrl: 'https://api.individual.githubcopilot.com',
129
375
  needsApiKey: true,
130
376
  apiKeyHint: 'GitHub Copilot token (OAuth)',
377
+ apiKeyEnvVar: 'COPILOT_GITHUB_TOKEN',
131
378
  suggestedModels: [
379
+ 'gpt-5.6-sol',
380
+ 'gpt-5.5',
132
381
  'gpt-5.4',
133
382
  'claude-fable-5',
134
383
  'claude-sonnet-4-6',
135
- 'gemini-3.1-pro',
384
+ 'gemini-3.1-pro-preview',
136
385
  ],
137
386
  category: 'cloud',
138
387
  },
@@ -143,31 +392,10 @@ export const PROVIDER_PRESETS = [
143
392
  needsApiKey: true,
144
393
  apiKeyHint: 'ChatGPT session token (OAuth)',
145
394
  suggestedModels: [
395
+ 'gpt-5.5',
146
396
  'gpt-5.4',
147
- 'o4-mini',
148
- ],
149
- category: 'cloud',
150
- },
151
- {
152
- id: 'kimi-code',
153
- name: 'Kimi Code',
154
- baseUrl: 'https://api.kimi.com/coding/v1',
155
- needsApiKey: true,
156
- suggestedModels: [
157
- 'kimi-for-coding',
158
- ],
159
- category: 'cloud',
160
- },
161
- {
162
- id: 'minimax-coding',
163
- name: 'MiniMax Coding Plan',
164
- baseUrl: 'https://api.minimax.io/anthropic/v1',
165
- needsApiKey: true,
166
- suggestedModels: [
167
- // SOTA
168
- 'MiniMax-M3',
169
- // Fast
170
- 'MiniMax-M2.7',
397
+ 'gpt-5.3-codex',
398
+ 'gpt-5.3-codex-spark',
171
399
  ],
172
400
  category: 'cloud',
173
401
  },
@@ -180,6 +408,7 @@ export const PROVIDER_PRESETS = [
180
408
  suggestedModels: [
181
409
  // SOTA
182
410
  'claude-opus-4.8',
411
+ 'gpt-5.6-sol',
183
412
  'gpt-5.5',
184
413
  'gemini-3.5-flash',
185
414
  // Fast
@@ -21,3 +21,5 @@ export declare function resolveModelSelector(settings: HazeSettings, selector: s
21
21
  export declare function modelSelector(provider: HazeProviderSettings, model: string): string;
22
22
  export declare function upsertProvider(settings: HazeSettings, provider: HazeProviderSettings): HazeProviderSettings[];
23
23
  export declare function providerHasKey(settings: HazeSettings, provider: HazeProviderSettings): boolean;
24
+ /** Image input is explicit-only (F03): never inferred from URL or model name. */
25
+ export declare function providerImageCapable(provider: HazeProviderSettings): boolean;
@@ -19,10 +19,13 @@ function normalizeProvider(provider, fallbackModel) {
19
19
  if (!name || !url)
20
20
  return undefined;
21
21
  const key = provider.key?.trim();
22
+ // Capabilities are explicit only: an absent/false flag means "not capable".
23
+ const capabilities = provider.capabilities ?? undefined;
22
24
  return {
23
25
  name,
24
26
  url,
25
27
  ...(key ? { key } : {}),
28
+ ...(capabilities ? { capabilities } : {}),
26
29
  models: normalizeModels(provider.models, fallbackModel),
27
30
  };
28
31
  }
@@ -86,3 +89,7 @@ export function upsertProvider(settings, provider) {
86
89
  export function providerHasKey(settings, provider) {
87
90
  return Boolean(provider.key ?? (provider.name === 'openrouter' ? settings.apiKey : undefined));
88
91
  }
92
+ /** Image input is explicit-only (F03): never inferred from URL or model name. */
93
+ export function providerImageCapable(provider) {
94
+ return provider.capabilities?.images === true;
95
+ }
@@ -3,6 +3,13 @@ export interface HazeProviderSettings {
3
3
  url: string;
4
4
  key?: string;
5
5
  models: string[];
6
+ /**
7
+ * Explicit endpoint capabilities. Never inferred: images are only sent to
8
+ * providers the user marked image-capable (F03).
9
+ */
10
+ capabilities?: {
11
+ images?: boolean;
12
+ };
6
13
  }
7
14
  export interface HazeLspServerSettings {
8
15
  name: string;
@@ -33,8 +40,16 @@ export interface HazeMcpServer {
33
40
  */
34
41
  export interface HazeSkillSetting {
35
42
  name: string;
43
+ /** Omitted by older settings and interpreted as global. */
44
+ scope?: 'global' | 'project';
36
45
  enabled?: boolean;
37
46
  }
47
+ export interface HazeSubagentSettings {
48
+ workerModel?: string;
49
+ defaultProfile?: string;
50
+ profiles?: Record<string, Record<string, unknown>>;
51
+ [key: string]: unknown;
52
+ }
38
53
  export interface HazeSettings {
39
54
  provider?: string;
40
55
  model?: string;
@@ -42,6 +57,11 @@ export interface HazeSettings {
42
57
  lspServers?: HazeLspServerSettings[];
43
58
  mcpServers?: HazeMcpServer[];
44
59
  skills?: HazeSkillSetting[];
60
+ subagents?: HazeSubagentSettings;
61
+ /** UI tweaks: rotating tips under the busy label, etc. Default enabled. */
62
+ tips?: {
63
+ enabled?: boolean;
64
+ };
45
65
  apiKey?: string;
46
66
  baseURL?: string;
47
67
  [key: string]: unknown;
@@ -50,3 +70,5 @@ export declare const SETTINGS_FILE: string;
50
70
  export declare function readSettings(): Promise<HazeSettings>;
51
71
  export declare function writeSettings(settings: HazeSettings): Promise<void>;
52
72
  export declare function updateSettings(patch: HazeSettings): Promise<HazeSettings>;
73
+ /** Patch subagent settings without dropping unknown nested/profile fields. */
74
+ export declare function updateSubagentSettings(patch: HazeSubagentSettings): Promise<HazeSettings>;