@denizokcu/haze 0.7.0 → 0.8.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 (48) hide show
  1. package/CHANGELOG.md +24 -8
  2. package/README.md +31 -31
  3. package/dist/cli/chat/inputSuggestions.js +2 -2
  4. package/dist/cli/commands/chat.js +46 -20
  5. package/dist/cli/commands/chatModes.js +1 -1
  6. package/dist/cli/commands/commandHelp.js +2 -2
  7. package/dist/cli/commands/formatters.d.ts +6 -0
  8. package/dist/cli/commands/formatters.js +38 -0
  9. package/dist/cli/commands/streaming.js +34 -23
  10. package/dist/cli/commands/wizardSuggestions.js +1 -1
  11. package/dist/config/providers.js +5 -9
  12. package/dist/config/settings.d.ts +1 -0
  13. package/dist/config/settings.js +54 -2
  14. package/dist/core/agent/compaction.js +2 -2
  15. package/dist/core/agent/errors.js +1 -1
  16. package/dist/core/agent/requestAssembly.d.ts +1 -0
  17. package/dist/core/agent/requestAssembly.js +13 -0
  18. package/dist/core/bashOutput/registry.js +11 -9
  19. package/dist/core/goal/completionPolicy.js +1 -1
  20. package/dist/core/subagent/subagentRunner.d.ts +252 -9
  21. package/dist/core/subagent/subagentRunner.js +13 -18
  22. package/dist/core/toolOutput/reduction.d.ts +2 -0
  23. package/dist/core/toolOutput/reduction.js +12 -0
  24. package/dist/core/validation/outputParser.js +5 -3
  25. package/dist/llm/client.d.ts +2 -2
  26. package/dist/llm/client.js +15 -2
  27. package/dist/llm/hazeTools.d.ts +7709 -364
  28. package/dist/llm/hazeTools.js +7 -1
  29. package/dist/llm/initPrompt.js +1 -1
  30. package/dist/llm/lsp.js +10 -1
  31. package/dist/llm/lspTools.d.ts +2310 -101
  32. package/dist/llm/systemPrompt.js +2 -2
  33. package/dist/llm/tools/bashTool.d.ts +251 -5
  34. package/dist/llm/tools/bashTool.js +4 -3
  35. package/dist/llm/tools/fetchTool.d.ts +1201 -65
  36. package/dist/llm/tools/fetchTool.js +2 -1
  37. package/dist/llm/tools/storedOutputTool.d.ts +351 -10
  38. package/dist/llm/tools/taskTool.d.ts +629 -28
  39. package/dist/llm/tools/toolContext.d.ts +7 -2
  40. package/dist/llm/tools/toolContext.js +11 -2
  41. package/dist/llm/webFetch.js +31 -21
  42. package/dist/skills/builder/SkillBuilder.js +7 -7
  43. package/dist/ui/components/TextInput.d.ts +7 -0
  44. package/dist/ui/components/TextInput.js +10 -0
  45. package/dist/utils/modelName.d.ts +2 -0
  46. package/dist/utils/modelName.js +15 -0
  47. package/examples/skills/files/SKILL.md +1 -1
  48. package/package.json +14 -14
@@ -1,28 +1,629 @@
1
- export declare const writeTasksTool: import("ai").Tool<{
2
- tasks: {
3
- title: string;
4
- status?: "pending" | "in_progress" | "completed" | undefined;
5
- }[];
6
- }, {
7
- ok: boolean;
8
- error: string;
9
- taskCount?: undefined;
10
- summary?: undefined;
11
- counts?: undefined;
12
- } | {
13
- ok: boolean;
14
- taskCount: number;
15
- summary: string;
16
- error?: undefined;
17
- counts?: undefined;
18
- } | {
19
- ok: boolean;
20
- taskCount: number;
21
- counts: {
22
- pending: number;
23
- in_progress: number;
24
- completed: number;
25
- };
26
- summary: string;
27
- error?: undefined;
28
- }>;
1
+ export declare const writeTasksTool: ({
2
+ title?: string;
3
+ providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
4
+ metadata?: import("@ai-sdk/provider").JSONObject;
5
+ inputSchema: import("ai").FlexibleSchema<{
6
+ tasks: {
7
+ title: string;
8
+ status?: "pending" | "in_progress" | "completed" | undefined;
9
+ }[];
10
+ }>;
11
+ contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
12
+ needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
13
+ tasks: {
14
+ title: string;
15
+ status?: "pending" | "in_progress" | "completed" | undefined;
16
+ }[];
17
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
18
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
19
+ onInputDelta?: ((options: {
20
+ inputTextDelta: string;
21
+ } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
22
+ onInputAvailable?: ((options: {
23
+ input: {
24
+ tasks: {
25
+ title: string;
26
+ status?: "pending" | "in_progress" | "completed" | undefined;
27
+ }[];
28
+ };
29
+ } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
30
+ toModelOutput?: ((options: {
31
+ toolCallId: string;
32
+ input: {
33
+ tasks: {
34
+ title: string;
35
+ status?: "pending" | "in_progress" | "completed" | undefined;
36
+ }[];
37
+ };
38
+ output: NoInfer<{
39
+ ok: boolean;
40
+ error: string;
41
+ taskCount?: undefined;
42
+ summary?: undefined;
43
+ counts?: undefined;
44
+ } | {
45
+ ok: boolean;
46
+ taskCount: number;
47
+ summary: string;
48
+ error?: undefined;
49
+ counts?: undefined;
50
+ } | {
51
+ ok: boolean;
52
+ taskCount: number;
53
+ counts: {
54
+ pending: number;
55
+ in_progress: number;
56
+ completed: number;
57
+ };
58
+ summary: string;
59
+ error?: undefined;
60
+ }>;
61
+ }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
62
+ } & {
63
+ outputSchema?: import("ai").FlexibleSchema<{
64
+ ok: boolean;
65
+ error: string;
66
+ taskCount?: undefined;
67
+ summary?: undefined;
68
+ counts?: undefined;
69
+ } | {
70
+ ok: boolean;
71
+ taskCount: number;
72
+ summary: string;
73
+ error?: undefined;
74
+ counts?: undefined;
75
+ } | {
76
+ ok: boolean;
77
+ taskCount: number;
78
+ counts: {
79
+ pending: number;
80
+ in_progress: number;
81
+ completed: number;
82
+ };
83
+ summary: string;
84
+ error?: undefined;
85
+ }> | undefined;
86
+ execute: import("ai").ToolExecuteFunction<{
87
+ tasks: {
88
+ title: string;
89
+ status?: "pending" | "in_progress" | "completed" | undefined;
90
+ }[];
91
+ }, {
92
+ ok: boolean;
93
+ error: string;
94
+ taskCount?: undefined;
95
+ summary?: undefined;
96
+ counts?: undefined;
97
+ } | {
98
+ ok: boolean;
99
+ taskCount: number;
100
+ summary: string;
101
+ error?: undefined;
102
+ counts?: undefined;
103
+ } | {
104
+ ok: boolean;
105
+ taskCount: number;
106
+ counts: {
107
+ pending: number;
108
+ in_progress: number;
109
+ completed: number;
110
+ };
111
+ summary: string;
112
+ error?: undefined;
113
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>>;
114
+ } & {
115
+ description?: string | ((options: {
116
+ context: NoInfer<import("@ai-sdk/provider-utils").Context>;
117
+ experimental_sandbox?: import("ai").Experimental_SandboxSession;
118
+ }) => string) | undefined;
119
+ strict?: boolean;
120
+ inputExamples?: {
121
+ input: NoInfer<{
122
+ tasks: {
123
+ title: string;
124
+ status?: "pending" | "in_progress" | "completed" | undefined;
125
+ }[];
126
+ }>;
127
+ }[] | undefined;
128
+ id?: never;
129
+ isProviderExecuted?: never;
130
+ args?: never;
131
+ supportsDeferredResults?: never;
132
+ } & {
133
+ type?: undefined | "function";
134
+ } & {
135
+ execute: import("ai").ToolExecuteFunction<{
136
+ tasks: {
137
+ title: string;
138
+ status?: "pending" | "in_progress" | "completed" | undefined;
139
+ }[];
140
+ }, {
141
+ ok: boolean;
142
+ error: string;
143
+ taskCount?: undefined;
144
+ summary?: undefined;
145
+ counts?: undefined;
146
+ } | {
147
+ ok: boolean;
148
+ taskCount: number;
149
+ summary: string;
150
+ error?: undefined;
151
+ counts?: undefined;
152
+ } | {
153
+ ok: boolean;
154
+ taskCount: number;
155
+ counts: {
156
+ pending: number;
157
+ in_progress: number;
158
+ completed: number;
159
+ };
160
+ summary: string;
161
+ error?: undefined;
162
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>>;
163
+ }) | ({
164
+ title?: string;
165
+ providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
166
+ metadata?: import("@ai-sdk/provider").JSONObject;
167
+ inputSchema: import("ai").FlexibleSchema<{
168
+ tasks: {
169
+ title: string;
170
+ status?: "pending" | "in_progress" | "completed" | undefined;
171
+ }[];
172
+ }>;
173
+ contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
174
+ needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
175
+ tasks: {
176
+ title: string;
177
+ status?: "pending" | "in_progress" | "completed" | undefined;
178
+ }[];
179
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
180
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
181
+ onInputDelta?: ((options: {
182
+ inputTextDelta: string;
183
+ } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
184
+ onInputAvailable?: ((options: {
185
+ input: {
186
+ tasks: {
187
+ title: string;
188
+ status?: "pending" | "in_progress" | "completed" | undefined;
189
+ }[];
190
+ };
191
+ } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
192
+ toModelOutput?: ((options: {
193
+ toolCallId: string;
194
+ input: {
195
+ tasks: {
196
+ title: string;
197
+ status?: "pending" | "in_progress" | "completed" | undefined;
198
+ }[];
199
+ };
200
+ output: NoInfer<{
201
+ ok: boolean;
202
+ error: string;
203
+ taskCount?: undefined;
204
+ summary?: undefined;
205
+ counts?: undefined;
206
+ } | {
207
+ ok: boolean;
208
+ taskCount: number;
209
+ summary: string;
210
+ error?: undefined;
211
+ counts?: undefined;
212
+ } | {
213
+ ok: boolean;
214
+ taskCount: number;
215
+ counts: {
216
+ pending: number;
217
+ in_progress: number;
218
+ completed: number;
219
+ };
220
+ summary: string;
221
+ error?: undefined;
222
+ }>;
223
+ }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
224
+ } & {
225
+ outputSchema?: import("ai").FlexibleSchema<{
226
+ ok: boolean;
227
+ error: string;
228
+ taskCount?: undefined;
229
+ summary?: undefined;
230
+ counts?: undefined;
231
+ } | {
232
+ ok: boolean;
233
+ taskCount: number;
234
+ summary: string;
235
+ error?: undefined;
236
+ counts?: undefined;
237
+ } | {
238
+ ok: boolean;
239
+ taskCount: number;
240
+ counts: {
241
+ pending: number;
242
+ in_progress: number;
243
+ completed: number;
244
+ };
245
+ summary: string;
246
+ error?: undefined;
247
+ }> | undefined;
248
+ execute: import("ai").ToolExecuteFunction<{
249
+ tasks: {
250
+ title: string;
251
+ status?: "pending" | "in_progress" | "completed" | undefined;
252
+ }[];
253
+ }, {
254
+ ok: boolean;
255
+ error: string;
256
+ taskCount?: undefined;
257
+ summary?: undefined;
258
+ counts?: undefined;
259
+ } | {
260
+ ok: boolean;
261
+ taskCount: number;
262
+ summary: string;
263
+ error?: undefined;
264
+ counts?: undefined;
265
+ } | {
266
+ ok: boolean;
267
+ taskCount: number;
268
+ counts: {
269
+ pending: number;
270
+ in_progress: number;
271
+ completed: number;
272
+ };
273
+ summary: string;
274
+ error?: undefined;
275
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>>;
276
+ } & {
277
+ description?: string | ((options: {
278
+ context: NoInfer<import("@ai-sdk/provider-utils").Context>;
279
+ experimental_sandbox?: import("ai").Experimental_SandboxSession;
280
+ }) => string) | undefined;
281
+ strict?: boolean;
282
+ inputExamples?: {
283
+ input: NoInfer<{
284
+ tasks: {
285
+ title: string;
286
+ status?: "pending" | "in_progress" | "completed" | undefined;
287
+ }[];
288
+ }>;
289
+ }[] | undefined;
290
+ id?: never;
291
+ isProviderExecuted?: never;
292
+ args?: never;
293
+ supportsDeferredResults?: never;
294
+ } & {
295
+ type: "dynamic";
296
+ } & {
297
+ execute: import("ai").ToolExecuteFunction<{
298
+ tasks: {
299
+ title: string;
300
+ status?: "pending" | "in_progress" | "completed" | undefined;
301
+ }[];
302
+ }, {
303
+ ok: boolean;
304
+ error: string;
305
+ taskCount?: undefined;
306
+ summary?: undefined;
307
+ counts?: undefined;
308
+ } | {
309
+ ok: boolean;
310
+ taskCount: number;
311
+ summary: string;
312
+ error?: undefined;
313
+ counts?: undefined;
314
+ } | {
315
+ ok: boolean;
316
+ taskCount: number;
317
+ counts: {
318
+ pending: number;
319
+ in_progress: number;
320
+ completed: number;
321
+ };
322
+ summary: string;
323
+ error?: undefined;
324
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>>;
325
+ }) | ({
326
+ title?: string;
327
+ providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
328
+ metadata?: import("@ai-sdk/provider").JSONObject;
329
+ inputSchema: import("ai").FlexibleSchema<{
330
+ tasks: {
331
+ title: string;
332
+ status?: "pending" | "in_progress" | "completed" | undefined;
333
+ }[];
334
+ }>;
335
+ contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
336
+ needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
337
+ tasks: {
338
+ title: string;
339
+ status?: "pending" | "in_progress" | "completed" | undefined;
340
+ }[];
341
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
342
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
343
+ onInputDelta?: ((options: {
344
+ inputTextDelta: string;
345
+ } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
346
+ onInputAvailable?: ((options: {
347
+ input: {
348
+ tasks: {
349
+ title: string;
350
+ status?: "pending" | "in_progress" | "completed" | undefined;
351
+ }[];
352
+ };
353
+ } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
354
+ toModelOutput?: ((options: {
355
+ toolCallId: string;
356
+ input: {
357
+ tasks: {
358
+ title: string;
359
+ status?: "pending" | "in_progress" | "completed" | undefined;
360
+ }[];
361
+ };
362
+ output: NoInfer<{
363
+ ok: boolean;
364
+ error: string;
365
+ taskCount?: undefined;
366
+ summary?: undefined;
367
+ counts?: undefined;
368
+ } | {
369
+ ok: boolean;
370
+ taskCount: number;
371
+ summary: string;
372
+ error?: undefined;
373
+ counts?: undefined;
374
+ } | {
375
+ ok: boolean;
376
+ taskCount: number;
377
+ counts: {
378
+ pending: number;
379
+ in_progress: number;
380
+ completed: number;
381
+ };
382
+ summary: string;
383
+ error?: undefined;
384
+ }>;
385
+ }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
386
+ } & {
387
+ outputSchema?: import("ai").FlexibleSchema<{
388
+ ok: boolean;
389
+ error: string;
390
+ taskCount?: undefined;
391
+ summary?: undefined;
392
+ counts?: undefined;
393
+ } | {
394
+ ok: boolean;
395
+ taskCount: number;
396
+ summary: string;
397
+ error?: undefined;
398
+ counts?: undefined;
399
+ } | {
400
+ ok: boolean;
401
+ taskCount: number;
402
+ counts: {
403
+ pending: number;
404
+ in_progress: number;
405
+ completed: number;
406
+ };
407
+ summary: string;
408
+ error?: undefined;
409
+ }> | undefined;
410
+ execute: import("ai").ToolExecuteFunction<{
411
+ tasks: {
412
+ title: string;
413
+ status?: "pending" | "in_progress" | "completed" | undefined;
414
+ }[];
415
+ }, {
416
+ ok: boolean;
417
+ error: string;
418
+ taskCount?: undefined;
419
+ summary?: undefined;
420
+ counts?: undefined;
421
+ } | {
422
+ ok: boolean;
423
+ taskCount: number;
424
+ summary: string;
425
+ error?: undefined;
426
+ counts?: undefined;
427
+ } | {
428
+ ok: boolean;
429
+ taskCount: number;
430
+ counts: {
431
+ pending: number;
432
+ in_progress: number;
433
+ completed: number;
434
+ };
435
+ summary: string;
436
+ error?: undefined;
437
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>>;
438
+ } & {
439
+ type: "provider";
440
+ id: `${string}.${string}`;
441
+ args: Record<string, unknown>;
442
+ description?: never;
443
+ strict?: never;
444
+ inputExamples?: never;
445
+ } & {
446
+ isProviderExecuted: false;
447
+ supportsDeferredResults?: never;
448
+ } & {
449
+ execute: import("ai").ToolExecuteFunction<{
450
+ tasks: {
451
+ title: string;
452
+ status?: "pending" | "in_progress" | "completed" | undefined;
453
+ }[];
454
+ }, {
455
+ ok: boolean;
456
+ error: string;
457
+ taskCount?: undefined;
458
+ summary?: undefined;
459
+ counts?: undefined;
460
+ } | {
461
+ ok: boolean;
462
+ taskCount: number;
463
+ summary: string;
464
+ error?: undefined;
465
+ counts?: undefined;
466
+ } | {
467
+ ok: boolean;
468
+ taskCount: number;
469
+ counts: {
470
+ pending: number;
471
+ in_progress: number;
472
+ completed: number;
473
+ };
474
+ summary: string;
475
+ error?: undefined;
476
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>>;
477
+ }) | ({
478
+ title?: string;
479
+ providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
480
+ metadata?: import("@ai-sdk/provider").JSONObject;
481
+ inputSchema: import("ai").FlexibleSchema<{
482
+ tasks: {
483
+ title: string;
484
+ status?: "pending" | "in_progress" | "completed" | undefined;
485
+ }[];
486
+ }>;
487
+ contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
488
+ needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
489
+ tasks: {
490
+ title: string;
491
+ status?: "pending" | "in_progress" | "completed" | undefined;
492
+ }[];
493
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
494
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
495
+ onInputDelta?: ((options: {
496
+ inputTextDelta: string;
497
+ } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
498
+ onInputAvailable?: ((options: {
499
+ input: {
500
+ tasks: {
501
+ title: string;
502
+ status?: "pending" | "in_progress" | "completed" | undefined;
503
+ }[];
504
+ };
505
+ } & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
506
+ toModelOutput?: ((options: {
507
+ toolCallId: string;
508
+ input: {
509
+ tasks: {
510
+ title: string;
511
+ status?: "pending" | "in_progress" | "completed" | undefined;
512
+ }[];
513
+ };
514
+ output: NoInfer<{
515
+ ok: boolean;
516
+ error: string;
517
+ taskCount?: undefined;
518
+ summary?: undefined;
519
+ counts?: undefined;
520
+ } | {
521
+ ok: boolean;
522
+ taskCount: number;
523
+ summary: string;
524
+ error?: undefined;
525
+ counts?: undefined;
526
+ } | {
527
+ ok: boolean;
528
+ taskCount: number;
529
+ counts: {
530
+ pending: number;
531
+ in_progress: number;
532
+ completed: number;
533
+ };
534
+ summary: string;
535
+ error?: undefined;
536
+ }>;
537
+ }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
538
+ } & {
539
+ outputSchema?: import("ai").FlexibleSchema<{
540
+ ok: boolean;
541
+ error: string;
542
+ taskCount?: undefined;
543
+ summary?: undefined;
544
+ counts?: undefined;
545
+ } | {
546
+ ok: boolean;
547
+ taskCount: number;
548
+ summary: string;
549
+ error?: undefined;
550
+ counts?: undefined;
551
+ } | {
552
+ ok: boolean;
553
+ taskCount: number;
554
+ counts: {
555
+ pending: number;
556
+ in_progress: number;
557
+ completed: number;
558
+ };
559
+ summary: string;
560
+ error?: undefined;
561
+ }> | undefined;
562
+ execute: import("ai").ToolExecuteFunction<{
563
+ tasks: {
564
+ title: string;
565
+ status?: "pending" | "in_progress" | "completed" | undefined;
566
+ }[];
567
+ }, {
568
+ ok: boolean;
569
+ error: string;
570
+ taskCount?: undefined;
571
+ summary?: undefined;
572
+ counts?: undefined;
573
+ } | {
574
+ ok: boolean;
575
+ taskCount: number;
576
+ summary: string;
577
+ error?: undefined;
578
+ counts?: undefined;
579
+ } | {
580
+ ok: boolean;
581
+ taskCount: number;
582
+ counts: {
583
+ pending: number;
584
+ in_progress: number;
585
+ completed: number;
586
+ };
587
+ summary: string;
588
+ error?: undefined;
589
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>>;
590
+ } & {
591
+ type: "provider";
592
+ id: `${string}.${string}`;
593
+ args: Record<string, unknown>;
594
+ description?: never;
595
+ strict?: never;
596
+ inputExamples?: never;
597
+ } & {
598
+ isProviderExecuted: true;
599
+ supportsDeferredResults?: boolean;
600
+ } & {
601
+ execute: import("ai").ToolExecuteFunction<{
602
+ tasks: {
603
+ title: string;
604
+ status?: "pending" | "in_progress" | "completed" | undefined;
605
+ }[];
606
+ }, {
607
+ ok: boolean;
608
+ error: string;
609
+ taskCount?: undefined;
610
+ summary?: undefined;
611
+ counts?: undefined;
612
+ } | {
613
+ ok: boolean;
614
+ taskCount: number;
615
+ summary: string;
616
+ error?: undefined;
617
+ counts?: undefined;
618
+ } | {
619
+ ok: boolean;
620
+ taskCount: number;
621
+ counts: {
622
+ pending: number;
623
+ in_progress: number;
624
+ completed: number;
625
+ };
626
+ summary: string;
627
+ error?: undefined;
628
+ }, NoInfer<import("@ai-sdk/provider-utils").Context>>;
629
+ });
@@ -1,3 +1,4 @@
1
+ import { z } from 'zod';
1
2
  import type { ToolFailureReasonCode } from '../toolResultTypes.js';
2
3
  import { type ContextFile } from '../../config/contextFiles.js';
3
4
  /**
@@ -6,11 +7,13 @@ import { type ContextFile } from '../../config/contextFiles.js';
6
7
  * caches after writes, edit-recovery gating, and lazy discovery of scoped
7
8
  * project instructions (CLAUDE.md / AGENTS.md below the cwd).
8
9
  *
9
- * All state lives on `experimental_context`, which the agent turn owns and
10
- * passes to the AI SDK. Nothing here is persisted.
10
+ * All state lives on per-tool `context` values, which the agent turn owns and
11
+ * passes to the AI SDK. Tests and older callers may still provide the legacy
12
+ * `experimental_context` shape. Nothing here is persisted.
11
13
  */
12
14
  export type ToolExecutionContext = {
13
15
  abortSignal?: AbortSignal;
16
+ context?: unknown;
14
17
  experimental_context?: unknown;
15
18
  };
16
19
  export type HazeToolContext = {
@@ -27,7 +30,9 @@ export type HazeToolContext = {
27
30
  scopedContextDiscovery?: Promise<void>;
28
31
  onContextFileRead?: (path: string) => void;
29
32
  };
33
+ export declare const hazeToolContextSchema: z.ZodCustom<HazeToolContext, HazeToolContext>;
30
34
  export declare function hazeContext(context: ToolExecutionContext): HazeToolContext | undefined;
35
+ export declare function toolsContextFor<T extends Record<string, unknown>>(tools: T, context: HazeToolContext): Partial<Record<keyof T, HazeToolContext>>;
31
36
  /**
32
37
  * Lazily load scoped CLAUDE.md/AGENTS.md files that apply to `filePath` and
33
38
  * have not been surfaced yet this turn. Mutates the context's loaded-set so