@opencode-ai/ai 0.0.0-dev-18142 → 0.0.0-dev-18146
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.
- package/dist/llm.d.ts +2 -1
- package/dist/protocols/open-responses.d.ts +2 -1
- package/dist/protocols/utils/tool-stream.d.ts +6 -3
- package/dist/protocols/utils/tool-stream.js +12 -6
- package/dist/route/client.d.ts +2 -1
- package/dist/schema/events.d.ts +48 -18
- package/dist/schema/events.js +2 -0
- package/dist/testing.d.ts +16 -8
- package/package.json +3 -3
package/dist/llm.d.ts
CHANGED
|
@@ -86,10 +86,11 @@ export declare class GenerateObjectResponse<T> {
|
|
|
86
86
|
} | undefined;
|
|
87
87
|
readonly providerExecuted?: boolean | undefined;
|
|
88
88
|
} | {
|
|
89
|
-
readonly type: "tool-input-delta";
|
|
90
89
|
readonly id: string;
|
|
90
|
+
readonly type: "tool-input-delta";
|
|
91
91
|
readonly name: string;
|
|
92
92
|
readonly text: string;
|
|
93
|
+
readonly input?: unknown;
|
|
93
94
|
} | {
|
|
94
95
|
readonly id: string;
|
|
95
96
|
readonly type: "tool-input-end";
|
|
@@ -719,10 +719,11 @@ export declare const step: (state: ParserState, event: Event) => AIError | Effec
|
|
|
719
719
|
} | undefined;
|
|
720
720
|
readonly providerExecuted?: boolean | undefined;
|
|
721
721
|
} | {
|
|
722
|
-
readonly type: "tool-input-delta";
|
|
723
722
|
readonly id: string;
|
|
723
|
+
readonly type: "tool-input-delta";
|
|
724
724
|
readonly name: string;
|
|
725
725
|
readonly text: string;
|
|
726
|
+
readonly input?: unknown;
|
|
726
727
|
} | {
|
|
727
728
|
readonly id: string;
|
|
728
729
|
readonly type: "tool-input-end";
|
|
@@ -134,10 +134,11 @@ export declare const finish: <K extends StreamKey>(route: string, tools: State<K
|
|
|
134
134
|
} | undefined;
|
|
135
135
|
readonly providerExecuted?: boolean | undefined;
|
|
136
136
|
} | {
|
|
137
|
-
readonly type: "tool-input-delta";
|
|
138
137
|
readonly id: string;
|
|
138
|
+
readonly type: "tool-input-delta";
|
|
139
139
|
readonly name: string;
|
|
140
140
|
readonly text: string;
|
|
141
|
+
readonly input?: unknown;
|
|
141
142
|
} | {
|
|
142
143
|
readonly id: string;
|
|
143
144
|
readonly type: "tool-input-end";
|
|
@@ -327,10 +328,11 @@ export declare const finishWithInput: <K extends StreamKey>(route: string, tools
|
|
|
327
328
|
} | undefined;
|
|
328
329
|
readonly providerExecuted?: boolean | undefined;
|
|
329
330
|
} | {
|
|
330
|
-
readonly type: "tool-input-delta";
|
|
331
331
|
readonly id: string;
|
|
332
|
+
readonly type: "tool-input-delta";
|
|
332
333
|
readonly name: string;
|
|
333
334
|
readonly text: string;
|
|
335
|
+
readonly input?: unknown;
|
|
334
336
|
} | {
|
|
335
337
|
readonly id: string;
|
|
336
338
|
readonly type: "tool-input-end";
|
|
@@ -517,10 +519,11 @@ export declare const finishAll: <K extends StreamKey>(route: string, tools: Stat
|
|
|
517
519
|
} | undefined;
|
|
518
520
|
readonly providerExecuted?: boolean | undefined;
|
|
519
521
|
} | {
|
|
520
|
-
readonly type: "tool-input-delta";
|
|
521
522
|
readonly id: string;
|
|
523
|
+
readonly type: "tool-input-delta";
|
|
522
524
|
readonly name: string;
|
|
523
525
|
readonly text: string;
|
|
526
|
+
readonly input?: unknown;
|
|
524
527
|
} | {
|
|
525
528
|
readonly id: string;
|
|
526
529
|
readonly type: "tool-input-end";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
1
|
+
import { Effect, Option } from "effect";
|
|
2
2
|
import { AIError, LLMEvent } from "../../schema/index.js";
|
|
3
3
|
import { eventError, parseToolInput } from "../shared.js";
|
|
4
|
+
import { parse } from "./partial-json.js";
|
|
5
|
+
const parsePartialInput = Option.liftThrowable(parse);
|
|
4
6
|
/** Create empty accumulator state for one provider stream. */
|
|
5
7
|
export const empty = () => ({});
|
|
6
8
|
const withTool = (tools, key, tool) => {
|
|
@@ -17,11 +19,15 @@ const inputStart = (tool) => LLMEvent.toolInputStart({
|
|
|
17
19
|
providerExecuted: tool.providerExecuted ? true : undefined,
|
|
18
20
|
providerMetadata: tool.providerMetadata,
|
|
19
21
|
});
|
|
20
|
-
const inputDelta = (tool, text) =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const inputDelta = (tool, text) => {
|
|
23
|
+
const input = parsePartialInput(tool.input);
|
|
24
|
+
return LLMEvent.toolInputDelta({
|
|
25
|
+
id: tool.id,
|
|
26
|
+
name: tool.name,
|
|
27
|
+
text,
|
|
28
|
+
...(Option.isSome(input) ? { input: input.value } : {}),
|
|
29
|
+
});
|
|
30
|
+
};
|
|
25
31
|
const toolCall = (route, tool, inputOverride) => {
|
|
26
32
|
const raw = inputOverride ?? tool.input;
|
|
27
33
|
return parseToolInput(route, tool.name, raw).pipe(Effect.map((input) => LLMEvent.toolCall({
|
package/dist/route/client.d.ts
CHANGED
|
@@ -213,10 +213,11 @@ export declare const streamRequest: (request: LLMRequest, options?: StreamOption
|
|
|
213
213
|
} | undefined;
|
|
214
214
|
readonly providerExecuted?: boolean | undefined;
|
|
215
215
|
} | {
|
|
216
|
-
readonly type: "tool-input-delta";
|
|
217
216
|
readonly id: string;
|
|
217
|
+
readonly type: "tool-input-delta";
|
|
218
218
|
readonly name: string;
|
|
219
219
|
readonly text: string;
|
|
220
|
+
readonly input?: unknown;
|
|
220
221
|
} | {
|
|
221
222
|
readonly id: string;
|
|
222
223
|
readonly type: "tool-input-end";
|
package/dist/schema/events.d.ts
CHANGED
|
@@ -126,6 +126,8 @@ export declare const ToolInputDelta: Schema.Struct<{
|
|
|
126
126
|
readonly id: Schema.String;
|
|
127
127
|
readonly name: Schema.String;
|
|
128
128
|
readonly text: Schema.String;
|
|
129
|
+
/** Best-effort parse of all input fragments received through this delta. */
|
|
130
|
+
readonly input: Schema.optional<Schema.Unknown>;
|
|
129
131
|
}>;
|
|
130
132
|
export type ToolInputDelta = Schema.Schema.Type<typeof ToolInputDelta>;
|
|
131
133
|
export declare const ToolInputEnd: Schema.Struct<{
|
|
@@ -282,6 +284,8 @@ declare const llmEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.Stru
|
|
|
282
284
|
readonly id: Schema.String;
|
|
283
285
|
readonly name: Schema.String;
|
|
284
286
|
readonly text: Schema.String;
|
|
287
|
+
/** Best-effort parse of all input fragments received through this delta. */
|
|
288
|
+
readonly input: Schema.optional<Schema.Unknown>;
|
|
285
289
|
}>, Schema.Struct<{
|
|
286
290
|
readonly type: Schema.tag<"tool-input-end">;
|
|
287
291
|
readonly id: Schema.String;
|
|
@@ -430,6 +434,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
430
434
|
readonly id: Schema.String;
|
|
431
435
|
readonly name: Schema.String;
|
|
432
436
|
readonly text: Schema.String;
|
|
437
|
+
/** Best-effort parse of all input fragments received through this delta. */
|
|
438
|
+
readonly input: Schema.optional<Schema.Unknown>;
|
|
433
439
|
}>, Schema.Struct<{
|
|
434
440
|
readonly type: Schema.tag<"tool-input-end">;
|
|
435
441
|
readonly id: Schema.String;
|
|
@@ -573,6 +579,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
573
579
|
readonly id: Schema.String;
|
|
574
580
|
readonly name: Schema.String;
|
|
575
581
|
readonly text: Schema.String;
|
|
582
|
+
/** Best-effort parse of all input fragments received through this delta. */
|
|
583
|
+
readonly input: Schema.optional<Schema.Unknown>;
|
|
576
584
|
}>;
|
|
577
585
|
"tool-input-end": Schema.Struct<{
|
|
578
586
|
readonly type: Schema.tag<"tool-input-end">;
|
|
@@ -739,10 +747,11 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
739
747
|
} | undefined;
|
|
740
748
|
readonly providerExecuted?: boolean | undefined;
|
|
741
749
|
} | {
|
|
742
|
-
readonly type: "tool-input-delta";
|
|
743
750
|
readonly id: string;
|
|
751
|
+
readonly type: "tool-input-delta";
|
|
744
752
|
readonly name: string;
|
|
745
753
|
readonly text: string;
|
|
754
|
+
readonly input?: unknown;
|
|
746
755
|
} | {
|
|
747
756
|
readonly id: string;
|
|
748
757
|
readonly type: "tool-input-end";
|
|
@@ -936,10 +945,11 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
936
945
|
}, {
|
|
937
946
|
readonly type: Keys;
|
|
938
947
|
}> | Extract<{
|
|
939
|
-
readonly type: "tool-input-delta";
|
|
940
948
|
readonly id: string;
|
|
949
|
+
readonly type: "tool-input-delta";
|
|
941
950
|
readonly name: string;
|
|
942
951
|
readonly text: string;
|
|
952
|
+
readonly input?: unknown;
|
|
943
953
|
}, {
|
|
944
954
|
readonly type: Keys;
|
|
945
955
|
}> | Extract<{
|
|
@@ -1145,10 +1155,11 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1145
1155
|
readonly providerExecuted?: boolean | undefined;
|
|
1146
1156
|
};
|
|
1147
1157
|
"tool-input-delta": (u: unknown) => u is {
|
|
1148
|
-
readonly type: "tool-input-delta";
|
|
1149
1158
|
readonly id: string;
|
|
1159
|
+
readonly type: "tool-input-delta";
|
|
1150
1160
|
readonly name: string;
|
|
1151
1161
|
readonly text: string;
|
|
1162
|
+
readonly input?: unknown;
|
|
1152
1163
|
};
|
|
1153
1164
|
"tool-input-end": (u: unknown) => u is {
|
|
1154
1165
|
readonly id: string;
|
|
@@ -1346,10 +1357,11 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1346
1357
|
readonly providerExecuted?: boolean | undefined;
|
|
1347
1358
|
}) => any;
|
|
1348
1359
|
"tool-input-delta": (value: {
|
|
1349
|
-
readonly type: "tool-input-delta";
|
|
1350
1360
|
readonly id: string;
|
|
1361
|
+
readonly type: "tool-input-delta";
|
|
1351
1362
|
readonly name: string;
|
|
1352
1363
|
readonly text: string;
|
|
1364
|
+
readonly input?: unknown;
|
|
1353
1365
|
}) => any;
|
|
1354
1366
|
"tool-input-end": (value: {
|
|
1355
1367
|
readonly id: string;
|
|
@@ -1536,10 +1548,11 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1536
1548
|
} | undefined;
|
|
1537
1549
|
readonly providerExecuted?: boolean | undefined;
|
|
1538
1550
|
} | {
|
|
1539
|
-
readonly type: "tool-input-delta";
|
|
1540
1551
|
readonly id: string;
|
|
1552
|
+
readonly type: "tool-input-delta";
|
|
1541
1553
|
readonly name: string;
|
|
1542
1554
|
readonly text: string;
|
|
1555
|
+
readonly input?: unknown;
|
|
1543
1556
|
} | {
|
|
1544
1557
|
readonly id: string;
|
|
1545
1558
|
readonly type: "tool-input-end";
|
|
@@ -1727,10 +1740,11 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1727
1740
|
readonly providerExecuted?: boolean | undefined;
|
|
1728
1741
|
}) => any;
|
|
1729
1742
|
"tool-input-delta": (value: {
|
|
1730
|
-
readonly type: "tool-input-delta";
|
|
1731
1743
|
readonly id: string;
|
|
1744
|
+
readonly type: "tool-input-delta";
|
|
1732
1745
|
readonly name: string;
|
|
1733
1746
|
readonly text: string;
|
|
1747
|
+
readonly input?: unknown;
|
|
1734
1748
|
}) => any;
|
|
1735
1749
|
"tool-input-end": (value: {
|
|
1736
1750
|
readonly id: string;
|
|
@@ -1917,10 +1931,11 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1917
1931
|
} | undefined;
|
|
1918
1932
|
readonly providerExecuted?: boolean | undefined;
|
|
1919
1933
|
} | {
|
|
1920
|
-
readonly type: "tool-input-delta";
|
|
1921
1934
|
readonly id: string;
|
|
1935
|
+
readonly type: "tool-input-delta";
|
|
1922
1936
|
readonly name: string;
|
|
1923
1937
|
readonly text: string;
|
|
1938
|
+
readonly input?: unknown;
|
|
1924
1939
|
} | {
|
|
1925
1940
|
readonly id: string;
|
|
1926
1941
|
readonly type: "tool-input-end";
|
|
@@ -2112,10 +2127,11 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
2112
2127
|
readonly providerExecuted?: boolean | undefined;
|
|
2113
2128
|
};
|
|
2114
2129
|
toolInputDelta: (input: WithID<ToolInputDelta, ToolCallID>) => {
|
|
2115
|
-
readonly type: "tool-input-delta";
|
|
2116
2130
|
readonly id: string;
|
|
2131
|
+
readonly type: "tool-input-delta";
|
|
2117
2132
|
readonly name: string;
|
|
2118
2133
|
readonly text: string;
|
|
2134
|
+
readonly input?: unknown;
|
|
2119
2135
|
};
|
|
2120
2136
|
toolInputEnd: (input: WithID<ToolInputEnd, ToolCallID>) => {
|
|
2121
2137
|
readonly id: string;
|
|
@@ -2320,10 +2336,11 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
2320
2336
|
readonly providerExecuted?: boolean | undefined;
|
|
2321
2337
|
};
|
|
2322
2338
|
toolInputDelta: (u: unknown) => u is {
|
|
2323
|
-
readonly type: "tool-input-delta";
|
|
2324
2339
|
readonly id: string;
|
|
2340
|
+
readonly type: "tool-input-delta";
|
|
2325
2341
|
readonly name: string;
|
|
2326
2342
|
readonly text: string;
|
|
2343
|
+
readonly input?: unknown;
|
|
2327
2344
|
};
|
|
2328
2345
|
toolInputEnd: (u: unknown) => u is {
|
|
2329
2346
|
readonly id: string;
|
|
@@ -2510,6 +2527,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
2510
2527
|
readonly id: Schema.String;
|
|
2511
2528
|
readonly name: Schema.String;
|
|
2512
2529
|
readonly text: Schema.String;
|
|
2530
|
+
/** Best-effort parse of all input fragments received through this delta. */
|
|
2531
|
+
readonly input: Schema.optional<Schema.Unknown>;
|
|
2513
2532
|
}>, Schema.Struct<{
|
|
2514
2533
|
readonly type: Schema.tag<"tool-input-end">;
|
|
2515
2534
|
readonly id: Schema.String;
|
|
@@ -2653,6 +2672,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
2653
2672
|
readonly id: Schema.String;
|
|
2654
2673
|
readonly name: Schema.String;
|
|
2655
2674
|
readonly text: Schema.String;
|
|
2675
|
+
/** Best-effort parse of all input fragments received through this delta. */
|
|
2676
|
+
readonly input: Schema.optional<Schema.Unknown>;
|
|
2656
2677
|
}>;
|
|
2657
2678
|
"tool-input-end": Schema.Struct<{
|
|
2658
2679
|
readonly type: Schema.tag<"tool-input-end">;
|
|
@@ -2819,10 +2840,11 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
2819
2840
|
} | undefined;
|
|
2820
2841
|
readonly providerExecuted?: boolean | undefined;
|
|
2821
2842
|
} | {
|
|
2822
|
-
readonly type: "tool-input-delta";
|
|
2823
2843
|
readonly id: string;
|
|
2844
|
+
readonly type: "tool-input-delta";
|
|
2824
2845
|
readonly name: string;
|
|
2825
2846
|
readonly text: string;
|
|
2847
|
+
readonly input?: unknown;
|
|
2826
2848
|
} | {
|
|
2827
2849
|
readonly id: string;
|
|
2828
2850
|
readonly type: "tool-input-end";
|
|
@@ -3016,10 +3038,11 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
3016
3038
|
}, {
|
|
3017
3039
|
readonly type: Keys;
|
|
3018
3040
|
}> | Extract<{
|
|
3019
|
-
readonly type: "tool-input-delta";
|
|
3020
3041
|
readonly id: string;
|
|
3042
|
+
readonly type: "tool-input-delta";
|
|
3021
3043
|
readonly name: string;
|
|
3022
3044
|
readonly text: string;
|
|
3045
|
+
readonly input?: unknown;
|
|
3023
3046
|
}, {
|
|
3024
3047
|
readonly type: Keys;
|
|
3025
3048
|
}> | Extract<{
|
|
@@ -3225,10 +3248,11 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
3225
3248
|
readonly providerExecuted?: boolean | undefined;
|
|
3226
3249
|
};
|
|
3227
3250
|
"tool-input-delta": (u: unknown) => u is {
|
|
3228
|
-
readonly type: "tool-input-delta";
|
|
3229
3251
|
readonly id: string;
|
|
3252
|
+
readonly type: "tool-input-delta";
|
|
3230
3253
|
readonly name: string;
|
|
3231
3254
|
readonly text: string;
|
|
3255
|
+
readonly input?: unknown;
|
|
3232
3256
|
};
|
|
3233
3257
|
"tool-input-end": (u: unknown) => u is {
|
|
3234
3258
|
readonly id: string;
|
|
@@ -3426,10 +3450,11 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
3426
3450
|
readonly providerExecuted?: boolean | undefined;
|
|
3427
3451
|
}) => any;
|
|
3428
3452
|
"tool-input-delta": (value: {
|
|
3429
|
-
readonly type: "tool-input-delta";
|
|
3430
3453
|
readonly id: string;
|
|
3454
|
+
readonly type: "tool-input-delta";
|
|
3431
3455
|
readonly name: string;
|
|
3432
3456
|
readonly text: string;
|
|
3457
|
+
readonly input?: unknown;
|
|
3433
3458
|
}) => any;
|
|
3434
3459
|
"tool-input-end": (value: {
|
|
3435
3460
|
readonly id: string;
|
|
@@ -3616,10 +3641,11 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
3616
3641
|
} | undefined;
|
|
3617
3642
|
readonly providerExecuted?: boolean | undefined;
|
|
3618
3643
|
} | {
|
|
3619
|
-
readonly type: "tool-input-delta";
|
|
3620
3644
|
readonly id: string;
|
|
3645
|
+
readonly type: "tool-input-delta";
|
|
3621
3646
|
readonly name: string;
|
|
3622
3647
|
readonly text: string;
|
|
3648
|
+
readonly input?: unknown;
|
|
3623
3649
|
} | {
|
|
3624
3650
|
readonly id: string;
|
|
3625
3651
|
readonly type: "tool-input-end";
|
|
@@ -3807,10 +3833,11 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
3807
3833
|
readonly providerExecuted?: boolean | undefined;
|
|
3808
3834
|
}) => any;
|
|
3809
3835
|
"tool-input-delta": (value: {
|
|
3810
|
-
readonly type: "tool-input-delta";
|
|
3811
3836
|
readonly id: string;
|
|
3837
|
+
readonly type: "tool-input-delta";
|
|
3812
3838
|
readonly name: string;
|
|
3813
3839
|
readonly text: string;
|
|
3840
|
+
readonly input?: unknown;
|
|
3814
3841
|
}) => any;
|
|
3815
3842
|
"tool-input-end": (value: {
|
|
3816
3843
|
readonly id: string;
|
|
@@ -3997,10 +4024,11 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
3997
4024
|
} | undefined;
|
|
3998
4025
|
readonly providerExecuted?: boolean | undefined;
|
|
3999
4026
|
} | {
|
|
4000
|
-
readonly type: "tool-input-delta";
|
|
4001
4027
|
readonly id: string;
|
|
4028
|
+
readonly type: "tool-input-delta";
|
|
4002
4029
|
readonly name: string;
|
|
4003
4030
|
readonly text: string;
|
|
4031
|
+
readonly input?: unknown;
|
|
4004
4032
|
} | {
|
|
4005
4033
|
readonly id: string;
|
|
4006
4034
|
readonly type: "tool-input-end";
|
|
@@ -4192,10 +4220,11 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
4192
4220
|
readonly providerExecuted?: boolean | undefined;
|
|
4193
4221
|
};
|
|
4194
4222
|
toolInputDelta: (input: WithID<ToolInputDelta, ToolCallID>) => {
|
|
4195
|
-
readonly type: "tool-input-delta";
|
|
4196
4223
|
readonly id: string;
|
|
4224
|
+
readonly type: "tool-input-delta";
|
|
4197
4225
|
readonly name: string;
|
|
4198
4226
|
readonly text: string;
|
|
4227
|
+
readonly input?: unknown;
|
|
4199
4228
|
};
|
|
4200
4229
|
toolInputEnd: (input: WithID<ToolInputEnd, ToolCallID>) => {
|
|
4201
4230
|
readonly id: string;
|
|
@@ -4400,10 +4429,11 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
|
|
|
4400
4429
|
readonly providerExecuted?: boolean | undefined;
|
|
4401
4430
|
};
|
|
4402
4431
|
toolInputDelta: (u: unknown) => u is {
|
|
4403
|
-
readonly type: "tool-input-delta";
|
|
4404
4432
|
readonly id: string;
|
|
4433
|
+
readonly type: "tool-input-delta";
|
|
4405
4434
|
readonly name: string;
|
|
4406
4435
|
readonly text: string;
|
|
4436
|
+
readonly input?: unknown;
|
|
4407
4437
|
};
|
|
4408
4438
|
toolInputEnd: (u: unknown) => u is {
|
|
4409
4439
|
readonly id: string;
|
package/dist/schema/events.js
CHANGED
|
@@ -121,6 +121,8 @@ export const ToolInputDelta = Schema.Struct({
|
|
|
121
121
|
id: ToolCallID,
|
|
122
122
|
name: Schema.String,
|
|
123
123
|
text: Schema.String,
|
|
124
|
+
/** Best-effort parse of all input fragments received through this delta. */
|
|
125
|
+
input: Schema.optional(Schema.Unknown),
|
|
124
126
|
}).annotate({ identifier: "LLM.Event.ToolInputDelta" });
|
|
125
127
|
export const ToolInputEnd = Schema.Struct({
|
|
126
128
|
type: Schema.tag("tool-input-end"),
|
package/dist/testing.d.ts
CHANGED
|
@@ -91,10 +91,11 @@ export declare const complete: (options: {
|
|
|
91
91
|
} | undefined;
|
|
92
92
|
readonly providerExecuted?: boolean | undefined;
|
|
93
93
|
} | {
|
|
94
|
-
readonly type: "tool-input-delta";
|
|
95
94
|
readonly id: string;
|
|
95
|
+
readonly type: "tool-input-delta";
|
|
96
96
|
readonly name: string;
|
|
97
97
|
readonly text: string;
|
|
98
|
+
readonly input?: unknown;
|
|
98
99
|
} | {
|
|
99
100
|
readonly id: string;
|
|
100
101
|
readonly type: "tool-input-end";
|
|
@@ -273,10 +274,11 @@ export declare const stop: (...events: readonly LLMEvent[]) => ({
|
|
|
273
274
|
} | undefined;
|
|
274
275
|
readonly providerExecuted?: boolean | undefined;
|
|
275
276
|
} | {
|
|
276
|
-
readonly type: "tool-input-delta";
|
|
277
277
|
readonly id: string;
|
|
278
|
+
readonly type: "tool-input-delta";
|
|
278
279
|
readonly name: string;
|
|
279
280
|
readonly text: string;
|
|
281
|
+
readonly input?: unknown;
|
|
280
282
|
} | {
|
|
281
283
|
readonly id: string;
|
|
282
284
|
readonly type: "tool-input-end";
|
|
@@ -455,10 +457,11 @@ export declare const toolCalls: (...events: readonly LLMEvent[]) => ({
|
|
|
455
457
|
} | undefined;
|
|
456
458
|
readonly providerExecuted?: boolean | undefined;
|
|
457
459
|
} | {
|
|
458
|
-
readonly type: "tool-input-delta";
|
|
459
460
|
readonly id: string;
|
|
461
|
+
readonly type: "tool-input-delta";
|
|
460
462
|
readonly name: string;
|
|
461
463
|
readonly text: string;
|
|
464
|
+
readonly input?: unknown;
|
|
462
465
|
} | {
|
|
463
466
|
readonly id: string;
|
|
464
467
|
readonly type: "tool-input-end";
|
|
@@ -637,10 +640,11 @@ export declare const text: (value: string, id: string) => ({
|
|
|
637
640
|
} | undefined;
|
|
638
641
|
readonly providerExecuted?: boolean | undefined;
|
|
639
642
|
} | {
|
|
640
|
-
readonly type: "tool-input-delta";
|
|
641
643
|
readonly id: string;
|
|
644
|
+
readonly type: "tool-input-delta";
|
|
642
645
|
readonly name: string;
|
|
643
646
|
readonly text: string;
|
|
647
|
+
readonly input?: unknown;
|
|
644
648
|
} | {
|
|
645
649
|
readonly id: string;
|
|
646
650
|
readonly type: "tool-input-end";
|
|
@@ -819,10 +823,11 @@ export declare const textWithUsage: (value: string, id: string, inputTokens: num
|
|
|
819
823
|
} | undefined;
|
|
820
824
|
readonly providerExecuted?: boolean | undefined;
|
|
821
825
|
} | {
|
|
822
|
-
readonly type: "tool-input-delta";
|
|
823
826
|
readonly id: string;
|
|
827
|
+
readonly type: "tool-input-delta";
|
|
824
828
|
readonly name: string;
|
|
825
829
|
readonly text: string;
|
|
830
|
+
readonly input?: unknown;
|
|
826
831
|
} | {
|
|
827
832
|
readonly id: string;
|
|
828
833
|
readonly type: "tool-input-end";
|
|
@@ -1001,10 +1006,11 @@ export declare const tool: (id: string, name: string, input: unknown) => ({
|
|
|
1001
1006
|
} | undefined;
|
|
1002
1007
|
readonly providerExecuted?: boolean | undefined;
|
|
1003
1008
|
} | {
|
|
1004
|
-
readonly type: "tool-input-delta";
|
|
1005
1009
|
readonly id: string;
|
|
1010
|
+
readonly type: "tool-input-delta";
|
|
1006
1011
|
readonly name: string;
|
|
1007
1012
|
readonly text: string;
|
|
1013
|
+
readonly input?: unknown;
|
|
1008
1014
|
} | {
|
|
1009
1015
|
readonly id: string;
|
|
1010
1016
|
readonly type: "tool-input-end";
|
|
@@ -1183,10 +1189,11 @@ export declare const failAfter: (error: AIError, ...events: readonly LLMEvent[])
|
|
|
1183
1189
|
} | undefined;
|
|
1184
1190
|
readonly providerExecuted?: boolean | undefined;
|
|
1185
1191
|
} | {
|
|
1186
|
-
readonly type: "tool-input-delta";
|
|
1187
1192
|
readonly id: string;
|
|
1193
|
+
readonly type: "tool-input-delta";
|
|
1188
1194
|
readonly name: string;
|
|
1189
1195
|
readonly text: string;
|
|
1196
|
+
readonly input?: unknown;
|
|
1190
1197
|
} | {
|
|
1191
1198
|
readonly id: string;
|
|
1192
1199
|
readonly type: "tool-input-end";
|
|
@@ -1365,10 +1372,11 @@ export declare const hangAfter: (...events: readonly LLMEvent[]) => Stream.Strea
|
|
|
1365
1372
|
} | undefined;
|
|
1366
1373
|
readonly providerExecuted?: boolean | undefined;
|
|
1367
1374
|
} | {
|
|
1368
|
-
readonly type: "tool-input-delta";
|
|
1369
1375
|
readonly id: string;
|
|
1376
|
+
readonly type: "tool-input-delta";
|
|
1370
1377
|
readonly name: string;
|
|
1371
1378
|
readonly text: string;
|
|
1379
|
+
readonly input?: unknown;
|
|
1372
1380
|
} | {
|
|
1373
1381
|
readonly id: string;
|
|
1374
1382
|
readonly type: "tool-input-end";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-18146",
|
|
4
4
|
"name": "@opencode-ai/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
32
32
|
"@effect/platform-node": "4.0.0-rc.111",
|
|
33
|
-
"@opencode-ai/http-recorder": "0.0.0-dev-
|
|
33
|
+
"@opencode-ai/http-recorder": "0.0.0-dev-18146",
|
|
34
34
|
"@tsconfig/bun": "1.0.9",
|
|
35
35
|
"@types/bun": "1.3.13",
|
|
36
36
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@smithy/eventstream-codec": "4.2.14",
|
|
41
41
|
"@smithy/util-utf8": "4.2.2",
|
|
42
|
-
"@opencode-ai/schema": "0.0.0-dev-
|
|
42
|
+
"@opencode-ai/schema": "0.0.0-dev-18146",
|
|
43
43
|
"aws4fetch": "1.0.20",
|
|
44
44
|
"effect": "4.0.0-rc.111",
|
|
45
45
|
"google-auth-library": "10.5.0"
|