@voltro/ai 0.84.0 → 0.85.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.
- package/CHANGELOG.md +549 -0
- package/THIRD-PARTY-NOTICES.md +1 -119
- package/dist/agent.d.ts +34 -41
- package/dist/agent.js +1 -1
- package/dist/{agentDescriptor-DuxvWGDi.js → agentDescriptor-DhoiXVqO.js} +5 -5
- package/dist/agentEvent-Bl4egdM5.js +211 -0
- package/dist/events.d.ts +167 -168
- package/dist/events.js +1 -1
- package/dist/index.d.ts +317 -326
- package/dist/index.js +745 -576
- package/dist/{inferenceQueue-BmtEm3YI.js → inferenceQueue-DcEulZep.js} +200 -184
- package/dist/workflow.d.ts +10 -10
- package/dist/workflow.js +8 -8
- package/package.json +6 -6
- package/dist/agentEvent-BuXA7sRt.js +0 -152
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -5,7 +5,7 @@ property of its respective copyright holders and is used under the terms of
|
|
|
5
5
|
its license. This file is provided for attribution; it grants no rights in
|
|
6
6
|
@voltro/ai itself, which is proprietary (see LICENSE).
|
|
7
7
|
|
|
8
|
-
Generated from the resolved runtime dependency closure (
|
|
8
|
+
Generated from the resolved runtime dependency closure (32 packages).
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -75,118 +75,6 @@ License: Apache-2.0
|
|
|
75
75
|
|
|
76
76
|
_(no bundled license text found in the package; see its npm page.)_
|
|
77
77
|
|
|
78
|
-
## @effect/cluster@0.60.2
|
|
79
|
-
|
|
80
|
-
License: MIT
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
MIT License
|
|
84
|
-
|
|
85
|
-
Copyright (c) 2023-present The Contributors
|
|
86
|
-
|
|
87
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
88
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
89
|
-
in the Software without restriction, including without limitation the rights
|
|
90
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
91
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
92
|
-
furnished to do so, subject to the following conditions:
|
|
93
|
-
|
|
94
|
-
The above copyright notice and this permission notice shall be included in all
|
|
95
|
-
copies or substantial portions of the Software.
|
|
96
|
-
|
|
97
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
98
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
99
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
100
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
101
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
102
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
103
|
-
SOFTWARE.
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## @effect/experimental@0.61.1
|
|
107
|
-
|
|
108
|
-
License: MIT
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
MIT License
|
|
112
|
-
|
|
113
|
-
Copyright (c) 2023-present The Contributors
|
|
114
|
-
|
|
115
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
116
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
117
|
-
in the Software without restriction, including without limitation the rights
|
|
118
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
119
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
120
|
-
furnished to do so, subject to the following conditions:
|
|
121
|
-
|
|
122
|
-
The above copyright notice and this permission notice shall be included in all
|
|
123
|
-
copies or substantial portions of the Software.
|
|
124
|
-
|
|
125
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
126
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
127
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
128
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
129
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
130
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
131
|
-
SOFTWARE.
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## @effect/sql@0.52.1
|
|
135
|
-
|
|
136
|
-
License: MIT
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
MIT License
|
|
140
|
-
|
|
141
|
-
Copyright (c) 2023-present The Contributors
|
|
142
|
-
|
|
143
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
144
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
145
|
-
in the Software without restriction, including without limitation the rights
|
|
146
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
147
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
148
|
-
furnished to do so, subject to the following conditions:
|
|
149
|
-
|
|
150
|
-
The above copyright notice and this permission notice shall be included in all
|
|
151
|
-
copies or substantial portions of the Software.
|
|
152
|
-
|
|
153
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
154
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
155
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
156
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
157
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
158
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
159
|
-
SOFTWARE.
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## @effect/workflow@0.19.1
|
|
163
|
-
|
|
164
|
-
License: MIT
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
MIT License
|
|
168
|
-
|
|
169
|
-
Copyright (c) 2023-present The Contributors
|
|
170
|
-
|
|
171
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
172
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
173
|
-
in the Software without restriction, including without limitation the rights
|
|
174
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
175
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
176
|
-
furnished to do so, subject to the following conditions:
|
|
177
|
-
|
|
178
|
-
The above copyright notice and this permission notice shall be included in all
|
|
179
|
-
copies or substantial portions of the Software.
|
|
180
|
-
|
|
181
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
182
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
183
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
184
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
185
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
186
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
187
|
-
SOFTWARE.
|
|
188
|
-
```
|
|
189
|
-
|
|
190
78
|
## @ioredis/commands@1.10.0
|
|
191
79
|
|
|
192
80
|
License: MIT
|
|
@@ -971,12 +859,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
971
859
|
SOFTWARE.
|
|
972
860
|
```
|
|
973
861
|
|
|
974
|
-
## kubernetes-types@1.30.0
|
|
975
|
-
|
|
976
|
-
License: Apache-2.0
|
|
977
|
-
|
|
978
|
-
_(no bundled license text found in the package; see its npm page.)_
|
|
979
|
-
|
|
980
862
|
## layerr@3.0.0
|
|
981
863
|
|
|
982
864
|
License: MIT
|
package/dist/agent.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ActionProcedureDescriptor } from '@voltro/protocol';
|
|
|
2
2
|
import { Guards } from '@voltro/protocol';
|
|
3
3
|
import { QueryProcedureDescriptor } from '@voltro/protocol';
|
|
4
4
|
import { Schema } from 'effect';
|
|
5
|
+
import { YieldableError } from 'effect/Cause';
|
|
5
6
|
|
|
6
7
|
declare const AGENT_DESCRIPTOR_BRAND: "@voltro/ai/AgentDescriptor";
|
|
7
8
|
|
|
@@ -30,7 +31,7 @@ export declare interface AgentAccessOptions {
|
|
|
30
31
|
readonly openAccess?: string;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
export declare interface AgentDescriptor<S extends Schema.
|
|
34
|
+
export declare interface AgentDescriptor<S extends Schema.Top = DefaultAgentInputSchema> {
|
|
34
35
|
readonly _brand: typeof AGENT_DESCRIPTOR_BRAND;
|
|
35
36
|
/** Wire id → rpc tags `<name>.send` / `<name>.messages`. */
|
|
36
37
|
readonly name: string;
|
|
@@ -43,25 +44,22 @@ export declare interface AgentDescriptor<S extends Schema.Schema.Any = DefaultAg
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
/** The decoded input an agent's executor sees, derived from its schema. */
|
|
46
|
-
export declare type AgentInput<S extends Schema.
|
|
47
|
+
export declare type AgentInput<S extends Schema.Top> = Schema.Schema.Type<S>;
|
|
47
48
|
|
|
48
49
|
/** The agent's input schema (default `{ prompt: string }`). */
|
|
49
|
-
export declare const agentInputSchema: (desc: AnyAgentDescriptor) => Schema.
|
|
50
|
+
export declare const agentInputSchema: (desc: AnyAgentDescriptor) => Schema.Top;
|
|
50
51
|
|
|
51
52
|
export declare const agentMessageSchema: Schema.Struct<{
|
|
52
|
-
id:
|
|
53
|
-
threadId:
|
|
54
|
-
role:
|
|
55
|
-
content:
|
|
56
|
-
streaming:
|
|
57
|
-
order:
|
|
58
|
-
stepOrder:
|
|
59
|
-
parts: Schema
|
|
60
|
-
type:
|
|
61
|
-
}
|
|
62
|
-
readonly key: typeof Schema.String;
|
|
63
|
-
readonly value: typeof Schema.Unknown;
|
|
64
|
-
}]>>;
|
|
53
|
+
readonly id: Schema.String;
|
|
54
|
+
readonly threadId: Schema.String;
|
|
55
|
+
readonly role: Schema.String;
|
|
56
|
+
readonly content: Schema.String;
|
|
57
|
+
readonly streaming: Schema.Boolean;
|
|
58
|
+
readonly order: Schema.Number;
|
|
59
|
+
readonly stepOrder: Schema.Number;
|
|
60
|
+
readonly parts: Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
61
|
+
readonly type: Schema.String;
|
|
62
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
65
63
|
}>;
|
|
66
64
|
|
|
67
65
|
/**
|
|
@@ -70,25 +68,22 @@ export declare const agentMessageSchema: Schema.Struct<{
|
|
|
70
68
|
* so "what the server serves" and "what the client is typed for" can't drift.
|
|
71
69
|
*/
|
|
72
70
|
export declare const agentRouteDescriptors: (desc: AnyAgentDescriptor) => {
|
|
73
|
-
send: ActionProcedureDescriptor<`${string}.send`, Schema.
|
|
74
|
-
text:
|
|
71
|
+
send: ActionProcedureDescriptor<`${string}.send`, Schema.Top, Schema.Struct<{
|
|
72
|
+
readonly text: Schema.String;
|
|
75
73
|
}>, typeof AgentThreadAccessDenied>;
|
|
76
74
|
messages: QueryProcedureDescriptor<`${string}.messages`, Schema.Struct<{
|
|
77
|
-
threadId:
|
|
78
|
-
}>, Schema
|
|
79
|
-
id:
|
|
80
|
-
threadId:
|
|
81
|
-
role:
|
|
82
|
-
content:
|
|
83
|
-
streaming:
|
|
84
|
-
order:
|
|
85
|
-
stepOrder:
|
|
86
|
-
parts: Schema
|
|
87
|
-
type:
|
|
88
|
-
}
|
|
89
|
-
readonly key: typeof Schema.String;
|
|
90
|
-
readonly value: typeof Schema.Unknown;
|
|
91
|
-
}]>>;
|
|
75
|
+
readonly threadId: Schema.String;
|
|
76
|
+
}>, Schema.$Array<Schema.Struct<{
|
|
77
|
+
readonly id: Schema.String;
|
|
78
|
+
readonly threadId: Schema.String;
|
|
79
|
+
readonly role: Schema.String;
|
|
80
|
+
readonly content: Schema.String;
|
|
81
|
+
readonly streaming: Schema.Boolean;
|
|
82
|
+
readonly order: Schema.Number;
|
|
83
|
+
readonly stepOrder: Schema.Number;
|
|
84
|
+
readonly parts: Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
85
|
+
readonly type: Schema.String;
|
|
86
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
92
87
|
}>>, typeof AgentThreadAccessDenied>;
|
|
93
88
|
};
|
|
94
89
|
|
|
@@ -108,17 +103,15 @@ export declare class AgentThreadAccessDenied extends AgentThreadAccessDenied_bas
|
|
|
108
103
|
get message(): string;
|
|
109
104
|
}
|
|
110
105
|
|
|
111
|
-
declare const AgentThreadAccessDenied_base: Schema.
|
|
112
|
-
readonly
|
|
113
|
-
}
|
|
114
|
-
threadId: typeof Schema.String;
|
|
115
|
-
}>;
|
|
106
|
+
declare const AgentThreadAccessDenied_base: Schema.Class<AgentThreadAccessDenied, Schema.TaggedStruct<"AgentThreadAccessDenied", {
|
|
107
|
+
readonly threadId: Schema.String;
|
|
108
|
+
}>, YieldableError>;
|
|
116
109
|
|
|
117
110
|
/** A descriptor of any input shape — for the type-erased runtime helpers. */
|
|
118
|
-
export declare type AnyAgentDescriptor = AgentDescriptor<Schema.
|
|
111
|
+
export declare type AnyAgentDescriptor = AgentDescriptor<Schema.Top>;
|
|
119
112
|
|
|
120
113
|
declare const DEFAULT_INPUT: Schema.Struct<{
|
|
121
|
-
prompt:
|
|
114
|
+
readonly prompt: Schema.String;
|
|
122
115
|
}>;
|
|
123
116
|
|
|
124
117
|
/** Default input schema type when `input` is omitted (`{ prompt: string }`). */
|
|
@@ -138,7 +131,7 @@ export declare type DefaultAgentInputSchema = typeof DEFAULT_INPUT;
|
|
|
138
131
|
* })
|
|
139
132
|
* ```
|
|
140
133
|
*/
|
|
141
|
-
export declare const defineAgent: <S extends Schema.
|
|
134
|
+
export declare const defineAgent: <S extends Schema.Top = DefaultAgentInputSchema>(config: {
|
|
142
135
|
readonly name: string;
|
|
143
136
|
readonly input?: S;
|
|
144
137
|
} & AgentAccessOptions) => AgentDescriptor<S>;
|
package/dist/agent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "./agentDescriptor-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "./agentDescriptor-DhoiXVqO.js";
|
|
2
2
|
export { a as AgentThreadAccessDenied, n as agentInputSchema, i as agentMessageSchema, t as agentRouteDescriptors, e as defineAgent, r as isAgentDescriptor };
|
|
@@ -17,10 +17,7 @@ var r = "_voltro_agent_threads", i = "_voltro_agent_messages", a = e.Struct({ pr
|
|
|
17
17
|
...e.guards === void 0 ? {} : { guards: e.guards },
|
|
18
18
|
...e.openAccess === void 0 ? {} : { openAccess: e.openAccess }
|
|
19
19
|
};
|
|
20
|
-
}, l = (e) => typeof e == "object" && !!e && e._brand === o, u = (e) => e.input ?? a, d = e.Struct({ type: e.String }, {
|
|
21
|
-
key: e.String,
|
|
22
|
-
value: e.Unknown
|
|
23
|
-
}), f = e.Struct({
|
|
20
|
+
}, l = (e) => typeof e == "object" && !!e && e._brand === o, u = (e) => e.input ?? a, d = e.StructWithRest(e.Struct({ type: e.String }), [e.Record(e.String, e.Unknown)]), f = e.Struct({
|
|
24
21
|
id: e.String,
|
|
25
22
|
threadId: e.String,
|
|
26
23
|
role: e.String,
|
|
@@ -35,7 +32,10 @@ var r = "_voltro_agent_threads", i = "_voltro_agent_messages", a = e.Struct({ pr
|
|
|
35
32
|
order: e.Number
|
|
36
33
|
});
|
|
37
34
|
try {
|
|
38
|
-
return e.
|
|
35
|
+
return e.Struct({
|
|
36
|
+
...n.fields,
|
|
37
|
+
...r.fields
|
|
38
|
+
});
|
|
39
39
|
} catch {
|
|
40
40
|
return r;
|
|
41
41
|
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { Schema as e } from "effect";
|
|
2
|
+
//#region src/transcriptionEvent.ts
|
|
3
|
+
var t = class extends e.TaggedError()("TranscriptionStreamError", {
|
|
4
|
+
reason: e.Literals([
|
|
5
|
+
"input",
|
|
6
|
+
"unsupported",
|
|
7
|
+
"provider",
|
|
8
|
+
"cancelled"
|
|
9
|
+
]),
|
|
10
|
+
message: e.String
|
|
11
|
+
}) {}, n = e.Struct({
|
|
12
|
+
text: e.String,
|
|
13
|
+
start: e.Number,
|
|
14
|
+
end: e.Number
|
|
15
|
+
}), r = { id: e.optional(e.String) }, i = e.Union([
|
|
16
|
+
e.Struct({
|
|
17
|
+
type: e.Literal("transcript-delta"),
|
|
18
|
+
...r,
|
|
19
|
+
delta: e.String
|
|
20
|
+
}),
|
|
21
|
+
e.Struct({
|
|
22
|
+
type: e.Literal("transcript-partial"),
|
|
23
|
+
...r,
|
|
24
|
+
text: e.String,
|
|
25
|
+
startSecond: e.optional(e.Number),
|
|
26
|
+
durationInSeconds: e.optional(e.Number),
|
|
27
|
+
channelIndex: e.optional(e.Number)
|
|
28
|
+
}),
|
|
29
|
+
e.Struct({
|
|
30
|
+
type: e.Literal("transcript-final"),
|
|
31
|
+
...r,
|
|
32
|
+
text: e.String,
|
|
33
|
+
startSecond: e.optional(e.Number),
|
|
34
|
+
endSecond: e.optional(e.Number),
|
|
35
|
+
channelIndex: e.optional(e.Number)
|
|
36
|
+
}),
|
|
37
|
+
e.Struct({
|
|
38
|
+
type: e.Literal("finish"),
|
|
39
|
+
text: e.String,
|
|
40
|
+
segments: e.Array(n),
|
|
41
|
+
language: e.optional(e.String),
|
|
42
|
+
durationSec: e.optional(e.Number)
|
|
43
|
+
})
|
|
44
|
+
]), a = e.String.pipe(e.check(e.isPattern(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/))), o = e.Number.pipe(e.check(e.isFinite()), e.check(e.isGreaterThanOrEqualTo(0))), s = e.Union([
|
|
45
|
+
e.Struct({
|
|
46
|
+
type: e.Literal("input-audio-append"),
|
|
47
|
+
audio: a
|
|
48
|
+
}),
|
|
49
|
+
e.Struct({ type: e.Literals([
|
|
50
|
+
"input-audio-commit",
|
|
51
|
+
"input-audio-clear",
|
|
52
|
+
"response-create",
|
|
53
|
+
"response-cancel"
|
|
54
|
+
]) }),
|
|
55
|
+
e.Struct({
|
|
56
|
+
type: e.Literal("conversation-item-create"),
|
|
57
|
+
item: e.Struct({
|
|
58
|
+
type: e.Literal("text-message"),
|
|
59
|
+
role: e.Literal("user"),
|
|
60
|
+
text: e.String
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
e.Struct({
|
|
64
|
+
type: e.Literal("conversation-item-truncate"),
|
|
65
|
+
itemId: e.String,
|
|
66
|
+
contentIndex: o.pipe(e.check(e.isInt())),
|
|
67
|
+
audioEndMs: o
|
|
68
|
+
})
|
|
69
|
+
]), c = { itemId: e.String }, l = {
|
|
70
|
+
responseId: e.String,
|
|
71
|
+
...c
|
|
72
|
+
}, u = e.Union([
|
|
73
|
+
e.Struct({ type: e.Literal("ready") }),
|
|
74
|
+
e.Struct({
|
|
75
|
+
type: e.Literal("session-created"),
|
|
76
|
+
sessionId: e.optional(e.String)
|
|
77
|
+
}),
|
|
78
|
+
e.Struct({ type: e.Literal("session-updated") }),
|
|
79
|
+
e.Struct({
|
|
80
|
+
type: e.Literals(["speech-started", "speech-stopped"]),
|
|
81
|
+
itemId: e.optional(e.String)
|
|
82
|
+
}),
|
|
83
|
+
e.Struct({
|
|
84
|
+
type: e.Literal("audio-committed"),
|
|
85
|
+
itemId: e.optional(e.String),
|
|
86
|
+
previousItemId: e.optional(e.String)
|
|
87
|
+
}),
|
|
88
|
+
e.Struct({
|
|
89
|
+
type: e.Literal("conversation-item-added"),
|
|
90
|
+
...c
|
|
91
|
+
}),
|
|
92
|
+
e.Struct({
|
|
93
|
+
type: e.Literal("input-transcription-completed"),
|
|
94
|
+
...c,
|
|
95
|
+
transcript: e.String
|
|
96
|
+
}),
|
|
97
|
+
e.Struct({
|
|
98
|
+
type: e.Literal("response-created"),
|
|
99
|
+
responseId: e.String
|
|
100
|
+
}),
|
|
101
|
+
e.Struct({
|
|
102
|
+
type: e.Literal("response-done"),
|
|
103
|
+
responseId: e.String,
|
|
104
|
+
status: e.String
|
|
105
|
+
}),
|
|
106
|
+
e.Struct({
|
|
107
|
+
type: e.Literals([
|
|
108
|
+
"output-item-added",
|
|
109
|
+
"output-item-done",
|
|
110
|
+
"content-part-added",
|
|
111
|
+
"content-part-done",
|
|
112
|
+
"audio-done"
|
|
113
|
+
]),
|
|
114
|
+
...l
|
|
115
|
+
}),
|
|
116
|
+
e.Struct({
|
|
117
|
+
type: e.Literal("audio-delta"),
|
|
118
|
+
...l,
|
|
119
|
+
delta: a
|
|
120
|
+
}),
|
|
121
|
+
e.Struct({
|
|
122
|
+
type: e.Literals(["text-delta", "audio-transcript-delta"]),
|
|
123
|
+
...l,
|
|
124
|
+
delta: e.String
|
|
125
|
+
}),
|
|
126
|
+
e.Struct({
|
|
127
|
+
type: e.Literal("text-done"),
|
|
128
|
+
...l,
|
|
129
|
+
text: e.optional(e.String)
|
|
130
|
+
}),
|
|
131
|
+
e.Struct({
|
|
132
|
+
type: e.Literal("audio-transcript-done"),
|
|
133
|
+
...l,
|
|
134
|
+
transcript: e.optional(e.String)
|
|
135
|
+
})
|
|
136
|
+
]), d = e.Literals([
|
|
137
|
+
"provider",
|
|
138
|
+
"tool",
|
|
139
|
+
"timeout",
|
|
140
|
+
"cancelled",
|
|
141
|
+
"decode",
|
|
142
|
+
"internal"
|
|
143
|
+
]), f = e.Struct({
|
|
144
|
+
inputTokens: e.optional(e.Number),
|
|
145
|
+
outputTokens: e.optional(e.Number),
|
|
146
|
+
totalTokens: e.optional(e.Number)
|
|
147
|
+
}), p = e.Union([
|
|
148
|
+
e.Struct({
|
|
149
|
+
_tag: e.Literal("token"),
|
|
150
|
+
text: e.String
|
|
151
|
+
}),
|
|
152
|
+
e.Struct({
|
|
153
|
+
_tag: e.Literal("reasoning"),
|
|
154
|
+
text: e.String
|
|
155
|
+
}),
|
|
156
|
+
e.Struct({
|
|
157
|
+
_tag: e.Literal("toolCall"),
|
|
158
|
+
id: e.String,
|
|
159
|
+
name: e.String,
|
|
160
|
+
input: e.Unknown
|
|
161
|
+
}),
|
|
162
|
+
e.Struct({
|
|
163
|
+
_tag: e.Literal("toolResult"),
|
|
164
|
+
id: e.String,
|
|
165
|
+
name: e.String,
|
|
166
|
+
output: e.optional(e.Unknown),
|
|
167
|
+
error: e.optional(e.String)
|
|
168
|
+
}),
|
|
169
|
+
e.Struct({
|
|
170
|
+
_tag: e.Literal("source"),
|
|
171
|
+
sourceType: e.Literals(["url", "document"]),
|
|
172
|
+
id: e.String,
|
|
173
|
+
url: e.optional(e.String),
|
|
174
|
+
title: e.optional(e.String),
|
|
175
|
+
mediaType: e.optional(e.String),
|
|
176
|
+
filename: e.optional(e.String),
|
|
177
|
+
providerMetadata: e.optional(e.Unknown)
|
|
178
|
+
}),
|
|
179
|
+
e.Struct({
|
|
180
|
+
_tag: e.Literal("file"),
|
|
181
|
+
mediaType: e.String,
|
|
182
|
+
data: e.String,
|
|
183
|
+
providerMetadata: e.optional(e.Unknown)
|
|
184
|
+
}),
|
|
185
|
+
e.Struct({
|
|
186
|
+
_tag: e.Literal("stepMetadata"),
|
|
187
|
+
step: e.Int.pipe(e.check(e.isGreaterThanOrEqualTo(0))),
|
|
188
|
+
providerMetadata: e.Unknown
|
|
189
|
+
}),
|
|
190
|
+
e.Struct({
|
|
191
|
+
_tag: e.Literal("message"),
|
|
192
|
+
role: e.String,
|
|
193
|
+
content: e.String
|
|
194
|
+
}),
|
|
195
|
+
e.Struct({
|
|
196
|
+
_tag: e.Literal("error"),
|
|
197
|
+
code: d,
|
|
198
|
+
message: e.String,
|
|
199
|
+
retryable: e.Boolean
|
|
200
|
+
}),
|
|
201
|
+
e.Struct({
|
|
202
|
+
_tag: e.Literal("done"),
|
|
203
|
+
finishReason: e.String,
|
|
204
|
+
usage: f
|
|
205
|
+
})
|
|
206
|
+
]), m = e.Struct({
|
|
207
|
+
seq: e.Number,
|
|
208
|
+
event: p
|
|
209
|
+
});
|
|
210
|
+
//#endregion
|
|
211
|
+
export { u as a, s as i, p as n, t as o, m as r, i as s, d as t };
|