@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
@@ -1,93 +1,112 @@
1
- import { streamText } from 'ai';
2
- import { type PromptSession } from '../../llm/systemPrompt.js';
3
- import { toolOnlyStepCount } from '../agent/turnPolicy.js';
4
1
  import type { ContextFile } from '../../config/contextFiles.js';
5
- export interface SubagentResult {
6
- status: 'ok' | 'error' | 'timeout' | 'cancelled';
7
- summary: string;
8
- toolCalls: Array<{
9
- name: string;
10
- summary: string;
11
- durationMs: number;
12
- }>;
13
- toolCallCount: number;
14
- tokens: {
15
- in: number;
16
- out: number;
17
- };
18
- durationMs: number;
19
- error?: string;
20
- }
21
- declare function toolSummary(output: unknown): string;
22
- export declare const internals: {
23
- toolSummary: typeof toolSummary;
24
- toolOnlyStepCount: typeof toolOnlyStepCount;
2
+ import { toolOnlyStepCount } from '../agent/turnPolicy.js';
3
+ import { type WorkerContextBundle } from '../../llm/workerContext.js';
4
+ import type { PromptSession } from '../../llm/systemPrompt.js';
5
+ import { type HazeToolContext } from '../../llm/tools/toolContext.js';
6
+ import { type SubagentExecutionResult, type SubagentTaskCapsule, type WorkerRuntime } from './contracts.js';
7
+ import { type SubagentExecutionProfile } from './executionProfiles.js';
8
+ import { SubagentCoordinator } from './subagentCoordinator.js';
9
+ import { WorkspaceMutationPolicy } from './workspaceMutationPolicy.js';
10
+ type SubagentStep = {
11
+ toolCalls: unknown[];
12
+ text: string;
25
13
  };
26
- export declare function runSubagent(task: string, options: {
27
- model: Parameters<typeof streamText>[0]['model'];
28
- contextFiles: ContextFile[];
14
+ declare function toolSummary(output: unknown): string;
15
+ declare function shouldForceSynthesis(steps: SubagentStep[], maxSteps: number, maxToolCalls?: number): boolean;
16
+ declare function validationFromOutput(name: string, output: unknown): {
17
+ command: string;
18
+ ok: boolean;
19
+ } | undefined;
20
+ export type SubagentResult = SubagentExecutionResult;
21
+ export declare function runSubagent(taskInput: string | SubagentTaskCapsule, options: {
22
+ model?: WorkerRuntime['model'];
23
+ runtime?: WorkerRuntime;
24
+ profile?: SubagentExecutionProfile;
25
+ contextFiles?: ContextFile[];
26
+ contextBundle?: WorkerContextBundle;
29
27
  allowedTools?: readonly string[];
30
28
  maxSteps?: number;
31
29
  abortSignal?: AbortSignal;
30
+ deadlineExpired?: () => boolean;
31
+ queueMs?: number;
32
32
  session?: PromptSession;
33
- }): Promise<SubagentResult>;
33
+ mutationPolicy?: WorkspaceMutationPolicy;
34
+ }): Promise<SubagentExecutionResult>;
34
35
  export declare function createSubagentTool(options: {
35
- model: Parameters<typeof streamText>[0]['model'];
36
- contextFiles: ContextFile[];
36
+ model?: WorkerRuntime['model'];
37
+ runtime?: WorkerRuntime;
38
+ profile?: SubagentExecutionProfile;
39
+ coordinator?: SubagentCoordinator;
40
+ mutationPolicy?: WorkspaceMutationPolicy;
41
+ blockedReason?: string;
42
+ forceMode?: 'inspect';
43
+ contextFiles?: ContextFile[];
37
44
  session?: PromptSession;
38
45
  }): ({
39
46
  title?: string;
40
47
  providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
41
48
  metadata?: import("@ai-sdk/provider").JSONObject;
42
49
  inputSchema: import("ai").FlexibleSchema<{
43
- task: string;
44
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
45
- maxSteps?: number | undefined;
50
+ objective: string;
51
+ deliverable: string;
52
+ mode: "inspect" | "research" | "implement" | "validate";
53
+ scope?: string[] | undefined;
54
+ acceptanceCriteria?: string[] | undefined;
46
55
  }>;
47
- contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
56
+ contextSchema?: import("ai").FlexibleSchema<HazeToolContext> | undefined;
48
57
  needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
49
- task: string;
50
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
51
- maxSteps?: number | undefined;
52
- }, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
53
- onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
58
+ objective: string;
59
+ deliverable: string;
60
+ mode: "inspect" | "research" | "implement" | "validate";
61
+ scope?: string[] | undefined;
62
+ acceptanceCriteria?: string[] | undefined;
63
+ }, NoInfer<HazeToolContext>> | undefined;
64
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
54
65
  onInputDelta?: ((options: {
55
66
  inputTextDelta: string;
56
- } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
67
+ } & import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
57
68
  onInputAvailable?: ((options: {
58
69
  input: {
59
- task: string;
60
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
61
- maxSteps?: number | undefined;
70
+ objective: string;
71
+ deliverable: string;
72
+ mode: "inspect" | "research" | "implement" | "validate";
73
+ scope?: string[] | undefined;
74
+ acceptanceCriteria?: string[] | undefined;
62
75
  };
63
- } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
76
+ } & import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
64
77
  toModelOutput?: ((options: {
65
78
  toolCallId: string;
66
79
  input: {
67
- task: string;
68
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
69
- maxSteps?: number | undefined;
80
+ objective: string;
81
+ deliverable: string;
82
+ mode: "inspect" | "research" | "implement" | "validate";
83
+ scope?: string[] | undefined;
84
+ acceptanceCriteria?: string[] | undefined;
70
85
  };
71
- output: NoInfer<SubagentResult>;
86
+ output: NoInfer<SubagentExecutionResult>;
72
87
  }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
73
88
  } & {
74
- outputSchema?: import("ai").FlexibleSchema<SubagentResult> | undefined;
89
+ outputSchema?: import("ai").FlexibleSchema<SubagentExecutionResult> | undefined;
75
90
  execute: import("ai").ToolExecuteFunction<{
76
- task: string;
77
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
78
- maxSteps?: number | undefined;
79
- }, SubagentResult, NoInfer<import("@ai-sdk/provider-utils").Context>>;
91
+ objective: string;
92
+ deliverable: string;
93
+ mode: "inspect" | "research" | "implement" | "validate";
94
+ scope?: string[] | undefined;
95
+ acceptanceCriteria?: string[] | undefined;
96
+ }, SubagentExecutionResult, NoInfer<HazeToolContext>>;
80
97
  } & {
81
98
  description?: string | ((options: {
82
- context: NoInfer<import("@ai-sdk/provider-utils").Context>;
99
+ context: NoInfer<HazeToolContext>;
83
100
  experimental_sandbox?: import("ai").Experimental_SandboxSession;
84
101
  }) => string) | undefined;
85
102
  strict?: boolean;
86
103
  inputExamples?: {
87
104
  input: NoInfer<{
88
- task: string;
89
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
90
- maxSteps?: number | undefined;
105
+ objective: string;
106
+ deliverable: string;
107
+ mode: "inspect" | "research" | "implement" | "validate";
108
+ scope?: string[] | undefined;
109
+ acceptanceCriteria?: string[] | undefined;
91
110
  }>;
92
111
  }[] | undefined;
93
112
  id?: never;
@@ -98,63 +117,77 @@ export declare function createSubagentTool(options: {
98
117
  type?: undefined | "function";
99
118
  } & {
100
119
  execute: import("ai").ToolExecuteFunction<{
101
- task: string;
102
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
103
- maxSteps?: number | undefined;
104
- }, SubagentResult, NoInfer<import("@ai-sdk/provider-utils").Context>>;
120
+ objective: string;
121
+ deliverable: string;
122
+ mode: "inspect" | "research" | "implement" | "validate";
123
+ scope?: string[] | undefined;
124
+ acceptanceCriteria?: string[] | undefined;
125
+ }, SubagentExecutionResult, NoInfer<HazeToolContext>>;
105
126
  }) | ({
106
127
  title?: string;
107
128
  providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
108
129
  metadata?: import("@ai-sdk/provider").JSONObject;
109
130
  inputSchema: import("ai").FlexibleSchema<{
110
- task: string;
111
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
112
- maxSteps?: number | undefined;
131
+ objective: string;
132
+ deliverable: string;
133
+ mode: "inspect" | "research" | "implement" | "validate";
134
+ scope?: string[] | undefined;
135
+ acceptanceCriteria?: string[] | undefined;
113
136
  }>;
114
- contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
137
+ contextSchema?: import("ai").FlexibleSchema<HazeToolContext> | undefined;
115
138
  needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
116
- task: string;
117
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
118
- maxSteps?: number | undefined;
119
- }, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
120
- onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
139
+ objective: string;
140
+ deliverable: string;
141
+ mode: "inspect" | "research" | "implement" | "validate";
142
+ scope?: string[] | undefined;
143
+ acceptanceCriteria?: string[] | undefined;
144
+ }, NoInfer<HazeToolContext>> | undefined;
145
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
121
146
  onInputDelta?: ((options: {
122
147
  inputTextDelta: string;
123
- } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
148
+ } & import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
124
149
  onInputAvailable?: ((options: {
125
150
  input: {
126
- task: string;
127
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
128
- maxSteps?: number | undefined;
151
+ objective: string;
152
+ deliverable: string;
153
+ mode: "inspect" | "research" | "implement" | "validate";
154
+ scope?: string[] | undefined;
155
+ acceptanceCriteria?: string[] | undefined;
129
156
  };
130
- } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
157
+ } & import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
131
158
  toModelOutput?: ((options: {
132
159
  toolCallId: string;
133
160
  input: {
134
- task: string;
135
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
136
- maxSteps?: number | undefined;
161
+ objective: string;
162
+ deliverable: string;
163
+ mode: "inspect" | "research" | "implement" | "validate";
164
+ scope?: string[] | undefined;
165
+ acceptanceCriteria?: string[] | undefined;
137
166
  };
138
- output: NoInfer<SubagentResult>;
167
+ output: NoInfer<SubagentExecutionResult>;
139
168
  }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
140
169
  } & {
141
- outputSchema?: import("ai").FlexibleSchema<SubagentResult> | undefined;
170
+ outputSchema?: import("ai").FlexibleSchema<SubagentExecutionResult> | undefined;
142
171
  execute: import("ai").ToolExecuteFunction<{
143
- task: string;
144
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
145
- maxSteps?: number | undefined;
146
- }, SubagentResult, NoInfer<import("@ai-sdk/provider-utils").Context>>;
172
+ objective: string;
173
+ deliverable: string;
174
+ mode: "inspect" | "research" | "implement" | "validate";
175
+ scope?: string[] | undefined;
176
+ acceptanceCriteria?: string[] | undefined;
177
+ }, SubagentExecutionResult, NoInfer<HazeToolContext>>;
147
178
  } & {
148
179
  description?: string | ((options: {
149
- context: NoInfer<import("@ai-sdk/provider-utils").Context>;
180
+ context: NoInfer<HazeToolContext>;
150
181
  experimental_sandbox?: import("ai").Experimental_SandboxSession;
151
182
  }) => string) | undefined;
152
183
  strict?: boolean;
153
184
  inputExamples?: {
154
185
  input: NoInfer<{
155
- task: string;
156
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
157
- maxSteps?: number | undefined;
186
+ objective: string;
187
+ deliverable: string;
188
+ mode: "inspect" | "research" | "implement" | "validate";
189
+ scope?: string[] | undefined;
190
+ acceptanceCriteria?: string[] | undefined;
158
191
  }>;
159
192
  }[] | undefined;
160
193
  id?: never;
@@ -165,52 +198,64 @@ export declare function createSubagentTool(options: {
165
198
  type: "dynamic";
166
199
  } & {
167
200
  execute: import("ai").ToolExecuteFunction<{
168
- task: string;
169
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
170
- maxSteps?: number | undefined;
171
- }, SubagentResult, NoInfer<import("@ai-sdk/provider-utils").Context>>;
201
+ objective: string;
202
+ deliverable: string;
203
+ mode: "inspect" | "research" | "implement" | "validate";
204
+ scope?: string[] | undefined;
205
+ acceptanceCriteria?: string[] | undefined;
206
+ }, SubagentExecutionResult, NoInfer<HazeToolContext>>;
172
207
  }) | ({
173
208
  title?: string;
174
209
  providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
175
210
  metadata?: import("@ai-sdk/provider").JSONObject;
176
211
  inputSchema: import("ai").FlexibleSchema<{
177
- task: string;
178
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
179
- maxSteps?: number | undefined;
212
+ objective: string;
213
+ deliverable: string;
214
+ mode: "inspect" | "research" | "implement" | "validate";
215
+ scope?: string[] | undefined;
216
+ acceptanceCriteria?: string[] | undefined;
180
217
  }>;
181
- contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
218
+ contextSchema?: import("ai").FlexibleSchema<HazeToolContext> | undefined;
182
219
  needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
183
- task: string;
184
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
185
- maxSteps?: number | undefined;
186
- }, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
187
- onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
220
+ objective: string;
221
+ deliverable: string;
222
+ mode: "inspect" | "research" | "implement" | "validate";
223
+ scope?: string[] | undefined;
224
+ acceptanceCriteria?: string[] | undefined;
225
+ }, NoInfer<HazeToolContext>> | undefined;
226
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
188
227
  onInputDelta?: ((options: {
189
228
  inputTextDelta: string;
190
- } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
229
+ } & import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
191
230
  onInputAvailable?: ((options: {
192
231
  input: {
193
- task: string;
194
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
195
- maxSteps?: number | undefined;
232
+ objective: string;
233
+ deliverable: string;
234
+ mode: "inspect" | "research" | "implement" | "validate";
235
+ scope?: string[] | undefined;
236
+ acceptanceCriteria?: string[] | undefined;
196
237
  };
197
- } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
238
+ } & import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
198
239
  toModelOutput?: ((options: {
199
240
  toolCallId: string;
200
241
  input: {
201
- task: string;
202
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
203
- maxSteps?: number | undefined;
242
+ objective: string;
243
+ deliverable: string;
244
+ mode: "inspect" | "research" | "implement" | "validate";
245
+ scope?: string[] | undefined;
246
+ acceptanceCriteria?: string[] | undefined;
204
247
  };
205
- output: NoInfer<SubagentResult>;
248
+ output: NoInfer<SubagentExecutionResult>;
206
249
  }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
207
250
  } & {
208
- outputSchema?: import("ai").FlexibleSchema<SubagentResult> | undefined;
251
+ outputSchema?: import("ai").FlexibleSchema<SubagentExecutionResult> | undefined;
209
252
  execute: import("ai").ToolExecuteFunction<{
210
- task: string;
211
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
212
- maxSteps?: number | undefined;
213
- }, SubagentResult, NoInfer<import("@ai-sdk/provider-utils").Context>>;
253
+ objective: string;
254
+ deliverable: string;
255
+ mode: "inspect" | "research" | "implement" | "validate";
256
+ scope?: string[] | undefined;
257
+ acceptanceCriteria?: string[] | undefined;
258
+ }, SubagentExecutionResult, NoInfer<HazeToolContext>>;
214
259
  } & {
215
260
  type: "provider";
216
261
  id: `${string}.${string}`;
@@ -223,52 +268,64 @@ export declare function createSubagentTool(options: {
223
268
  supportsDeferredResults?: never;
224
269
  } & {
225
270
  execute: import("ai").ToolExecuteFunction<{
226
- task: string;
227
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
228
- maxSteps?: number | undefined;
229
- }, SubagentResult, NoInfer<import("@ai-sdk/provider-utils").Context>>;
271
+ objective: string;
272
+ deliverable: string;
273
+ mode: "inspect" | "research" | "implement" | "validate";
274
+ scope?: string[] | undefined;
275
+ acceptanceCriteria?: string[] | undefined;
276
+ }, SubagentExecutionResult, NoInfer<HazeToolContext>>;
230
277
  }) | ({
231
278
  title?: string;
232
279
  providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
233
280
  metadata?: import("@ai-sdk/provider").JSONObject;
234
281
  inputSchema: import("ai").FlexibleSchema<{
235
- task: string;
236
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
237
- maxSteps?: number | undefined;
282
+ objective: string;
283
+ deliverable: string;
284
+ mode: "inspect" | "research" | "implement" | "validate";
285
+ scope?: string[] | undefined;
286
+ acceptanceCriteria?: string[] | undefined;
238
287
  }>;
239
- contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
288
+ contextSchema?: import("ai").FlexibleSchema<HazeToolContext> | undefined;
240
289
  needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
241
- task: string;
242
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
243
- maxSteps?: number | undefined;
244
- }, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
245
- onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
290
+ objective: string;
291
+ deliverable: string;
292
+ mode: "inspect" | "research" | "implement" | "validate";
293
+ scope?: string[] | undefined;
294
+ acceptanceCriteria?: string[] | undefined;
295
+ }, NoInfer<HazeToolContext>> | undefined;
296
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
246
297
  onInputDelta?: ((options: {
247
298
  inputTextDelta: string;
248
- } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
299
+ } & import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
249
300
  onInputAvailable?: ((options: {
250
301
  input: {
251
- task: string;
252
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
253
- maxSteps?: number | undefined;
302
+ objective: string;
303
+ deliverable: string;
304
+ mode: "inspect" | "research" | "implement" | "validate";
305
+ scope?: string[] | undefined;
306
+ acceptanceCriteria?: string[] | undefined;
254
307
  };
255
- } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
308
+ } & import("ai").ToolExecutionOptions<NoInfer<HazeToolContext>>) => void | PromiseLike<void>) | undefined;
256
309
  toModelOutput?: ((options: {
257
310
  toolCallId: string;
258
311
  input: {
259
- task: string;
260
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
261
- maxSteps?: number | undefined;
312
+ objective: string;
313
+ deliverable: string;
314
+ mode: "inspect" | "research" | "implement" | "validate";
315
+ scope?: string[] | undefined;
316
+ acceptanceCriteria?: string[] | undefined;
262
317
  };
263
- output: NoInfer<SubagentResult>;
318
+ output: NoInfer<SubagentExecutionResult>;
264
319
  }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
265
320
  } & {
266
- outputSchema?: import("ai").FlexibleSchema<SubagentResult> | undefined;
321
+ outputSchema?: import("ai").FlexibleSchema<SubagentExecutionResult> | undefined;
267
322
  execute: import("ai").ToolExecuteFunction<{
268
- task: string;
269
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
270
- maxSteps?: number | undefined;
271
- }, SubagentResult, NoInfer<import("@ai-sdk/provider-utils").Context>>;
323
+ objective: string;
324
+ deliverable: string;
325
+ mode: "inspect" | "research" | "implement" | "validate";
326
+ scope?: string[] | undefined;
327
+ acceptanceCriteria?: string[] | undefined;
328
+ }, SubagentExecutionResult, NoInfer<HazeToolContext>>;
272
329
  } & {
273
330
  type: "provider";
274
331
  id: `${string}.${string}`;
@@ -281,9 +338,18 @@ export declare function createSubagentTool(options: {
281
338
  supportsDeferredResults?: boolean;
282
339
  } & {
283
340
  execute: import("ai").ToolExecuteFunction<{
284
- task: string;
285
- tools?: ("listFiles" | "readFile" | "grep" | "replaceLines" | "writeFile" | "editFile" | "bash" | "fetch" | "readToolOutput")[] | undefined;
286
- maxSteps?: number | undefined;
287
- }, SubagentResult, NoInfer<import("@ai-sdk/provider-utils").Context>>;
341
+ objective: string;
342
+ deliverable: string;
343
+ mode: "inspect" | "research" | "implement" | "validate";
344
+ scope?: string[] | undefined;
345
+ acceptanceCriteria?: string[] | undefined;
346
+ }, SubagentExecutionResult, NoInfer<HazeToolContext>>;
288
347
  });
348
+ export declare const internals: {
349
+ toolSummary: typeof toolSummary;
350
+ toolOnlyStepCount: typeof toolOnlyStepCount;
351
+ shouldForceSynthesis: typeof shouldForceSynthesis;
352
+ validationFromOutput: typeof validationFromOutput;
353
+ SYNTHESIS_DIRECTIVE: string;
354
+ };
289
355
  export {};