@pinecall/protocol 0.1.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/LICENSE +202 -0
- package/dist/fixtures/call-log-golden.json +127 -0
- package/dist/fixtures/call-log-golden.state.json +39 -0
- package/dist/generated/codec.d.ts +53 -0
- package/dist/generated/codec.js +67 -0
- package/dist/generated/commands.d.ts +423 -0
- package/dist/generated/commands.js +168 -0
- package/dist/generated/defs.d.ts +604 -0
- package/dist/generated/defs.js +328 -0
- package/dist/generated/envelope.d.ts +27 -0
- package/dist/generated/envelope.js +26 -0
- package/dist/generated/events.d.ts +1234 -0
- package/dist/generated/events.js +388 -0
- package/dist/generated/index.d.ts +12 -0
- package/dist/generated/index.js +13 -0
- package/dist/generated/metrics.d.ts +386 -0
- package/dist/generated/metrics.js +268 -0
- package/dist/generated/registry.d.ts +1591 -0
- package/dist/generated/registry.js +130 -0
- package/dist/generated/rest.d.ts +1031 -0
- package/dist/generated/rest.js +291 -0
- package/dist/generated/room.d.ts +111 -0
- package/dist/generated/room.js +72 -0
- package/dist/generated/state.d.ts +902 -0
- package/dist/generated/state.js +179 -0
- package/dist/generated/units.d.ts +2 -0
- package/dist/generated/units.js +80 -0
- package/dist/generated/verbs.d.ts +77 -0
- package/dist/generated/verbs.js +49 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/reduce.d.ts +10 -0
- package/dist/reduce.js +352 -0
- package/package.json +38 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
// Generated from schema/defs.json: the shapes shared across the wire. Never edited by hand.
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/**
|
|
4
|
+
* The door the public came through: a phone call over SIP, the browser widget over WebRTC, or
|
|
5
|
+
* WhatsApp text.
|
|
6
|
+
*/
|
|
7
|
+
export const ChannelSchema = z.enum(["phone", "web", "whatsapp"]);
|
|
8
|
+
/** Inbound: the public reached the agent. Outbound: the agent reached out (a dial). */
|
|
9
|
+
export const DirectionSchema = z.enum(["inbound", "outbound"]);
|
|
10
|
+
/**
|
|
11
|
+
* Which of the two worlds a key opens, and so which world an agent is held in and a call ran in. A
|
|
12
|
+
* key is issued into one; an agent registered on it and every call it takes carry that one; a door
|
|
13
|
+
* claimed in one is refused to a key of the other. `sandbox` is where things are written and
|
|
14
|
+
* `production` is what the public reaches — and whether a sandbox agent is one PERSON's copy or
|
|
15
|
+
* the team's shared one is not this field: it is whether the key that registered it names a
|
|
16
|
+
* person. Every key issued before the field existed is production.
|
|
17
|
+
*/
|
|
18
|
+
export const EnvSchema = z.enum(["production", "sandbox"]);
|
|
19
|
+
/**
|
|
20
|
+
* What a console may ask of the process standing in the agent's directory, relayed by the gateway:
|
|
21
|
+
* a written call to the class mounted there (chat), a simulated caller from its personas, its
|
|
22
|
+
* goldens and a suite of them, its knowledge folder pushed or its golden asked, its memory
|
|
23
|
+
* goldens, a call promoted to a candidate file, the drift of the last two windows, and the
|
|
24
|
+
* reproductions a broken run left on that disk. Everything else a console needs is a door of the
|
|
25
|
+
* gateway.
|
|
26
|
+
*/
|
|
27
|
+
export const DevVerbSchema = z.enum(["chat.roster", "chat.start", "chat.say", "chat.end", "simulate.roster", "simulate.start", "goldens.roster", "goldens.run", "knowledge.roster", "knowledge.push", "knowledge.eval", "memory.roster", "memory.eval", "memory.extraction", "promote.roster", "promote.write", "drift.read", "reproductions.roster", "reproductions.read"]);
|
|
28
|
+
/**
|
|
29
|
+
* Why the call is over. Who hung up, what failed before anybody could, drained: the platform took
|
|
30
|
+
* the worker down (a deploy, a stop) with the call still on it, or app_detached: the app holding
|
|
31
|
+
* the agent closed its socket mid-call, so nothing was rendering the prompt or answering a tool —
|
|
32
|
+
* both are nobody's fault and neither is an error.
|
|
33
|
+
*/
|
|
34
|
+
export const EndReasonSchema = z.enum(["caller_hung_up", "agent_hung_up", "supervisor_ended", "transferred", "no_answer", "busy", "dial_failed", "timeout", "drained", "app_detached", "error"]);
|
|
35
|
+
/** Whose action ended the call. platform covers timeouts, errors and a drained worker. */
|
|
36
|
+
export const EndedBySchema = z.enum(["caller", "agent", "supervisor", "platform"]);
|
|
37
|
+
/**
|
|
38
|
+
* What one judge answered about a finished call. Held: the rule held. Broken: it did not, and the
|
|
39
|
+
* reason names the evidence. Deferred: the judge was asked and could not settle it. Skipped:
|
|
40
|
+
* nobody asked it — no model was reachable inside the call's judging budget.
|
|
41
|
+
*/
|
|
42
|
+
export const ScoreVerdictSchema = z.enum(["held", "broken", "deferred", "skipped"]);
|
|
43
|
+
/**
|
|
44
|
+
* Cold: the caller is sent on and the agent leaves. Warm: the agent stays on the line until the
|
|
45
|
+
* other side answers, then leaves.
|
|
46
|
+
*/
|
|
47
|
+
export const TransferModeSchema = z.enum(["cold", "warm"]);
|
|
48
|
+
/**
|
|
49
|
+
* Which region of the prompt a block lives in: static, before the history, cached by the provider;
|
|
50
|
+
* or dynamic, after the history, replaced every turn. The append-only history in between is never
|
|
51
|
+
* written by the app.
|
|
52
|
+
*/
|
|
53
|
+
export const PromptRegionSchema = z.enum(["static", "dynamic"]);
|
|
54
|
+
/**
|
|
55
|
+
* How the knowledge base reaches the model: retrieved, the platform runs search itself when the
|
|
56
|
+
* caller's turn ends; or tool, the model calls search when it decides to. Either way the chunks
|
|
57
|
+
* arrive as a tool result.
|
|
58
|
+
*/
|
|
59
|
+
export const DocsModeSchema = z.enum(["retrieved", "tool"]);
|
|
60
|
+
/**
|
|
61
|
+
* The two tools the platform runs on the app's behalf: recall reads the contact's facts out of
|
|
62
|
+
* memory, search reads chunks out of the knowledge base. The app declares memory and docs and
|
|
63
|
+
* writes neither method; the platform runs the lookup, and the answer reaches the model as a tool
|
|
64
|
+
* result rather than as part of the prompt.
|
|
65
|
+
*/
|
|
66
|
+
export const PlatformToolSchema = z.enum(["recall", "search"]);
|
|
67
|
+
/**
|
|
68
|
+
* One named block of the prompt and the region it lives in. The default layout, when an agent
|
|
69
|
+
* declares none, is identity, knowledge and tools (static), then the history, then view (dynamic).
|
|
70
|
+
* A block's text is written per call with prompt.set.
|
|
71
|
+
*/
|
|
72
|
+
export const PromptBlockSpecSchema = z.strictObject({
|
|
73
|
+
name: z.string().regex(/^[a-z][a-z0-9_]*$/),
|
|
74
|
+
region: PromptRegionSchema,
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* What the platform believes the person on the line is doing right now. The states are the
|
|
78
|
+
* session's own.
|
|
79
|
+
*/
|
|
80
|
+
export const UserStateSchema = z.enum(["listening", "speaking", "away"]);
|
|
81
|
+
/**
|
|
82
|
+
* What the agent is doing right now, in the session's own words: warming up, waiting, hearing the
|
|
83
|
+
* caller, generating, or playing audio.
|
|
84
|
+
*/
|
|
85
|
+
export const AgentStateSchema = z.enum(["initializing", "idle", "listening", "thinking", "speaking"]);
|
|
86
|
+
/**
|
|
87
|
+
* Who a participant is to the call: the person the agent serves (over SIP or the widget), the
|
|
88
|
+
* agent itself, a supervisor who took a seat in the room, a listener who only hears, or a second
|
|
89
|
+
* SIP leg that room.invite brought in.
|
|
90
|
+
*/
|
|
91
|
+
export const ParticipantKindSchema = z.enum(["caller", "agent", "supervisor", "listener", "sip"]);
|
|
92
|
+
/** What a track carries: a microphone's audio, a camera's video, or a screen share. */
|
|
93
|
+
export const TrackKindSchema = z.enum(["audio", "video", "screen"]);
|
|
94
|
+
/** Where a track comes from, as livekit's TrackSource names it, in lower case. */
|
|
95
|
+
export const TrackSourceSchema = z.enum(["microphone", "camera", "screen_share", "screen_share_audio", "unknown"]);
|
|
96
|
+
/**
|
|
97
|
+
* Where an outside fact came from: the tenant's backend over the app socket (app), or a
|
|
98
|
+
* participant's browser over the DataChannel (participant).
|
|
99
|
+
*/
|
|
100
|
+
export const EventSourceSchema = z.enum(["app", "participant"]);
|
|
101
|
+
/**
|
|
102
|
+
* Who may see a field of the app's state: everyone in the call (public), the tenant's own readers
|
|
103
|
+
* (tenant, the default for a field never declared), or nobody without masking (pii).
|
|
104
|
+
*/
|
|
105
|
+
export const VisibilitySchema = z.enum(["public", "tenant", "pii"]);
|
|
106
|
+
/**
|
|
107
|
+
* Which projection a sink applies before a state or an entry leaves the platform: public for a
|
|
108
|
+
* participant reading its own call, tenant for the tenant's readers. The contract is
|
|
109
|
+
* docs/protocol/projections.md; a client never applies one.
|
|
110
|
+
*/
|
|
111
|
+
export const ProjectionSchema = z.enum(["public", "tenant"]);
|
|
112
|
+
/**
|
|
113
|
+
* Who is on the line, as far as the platform knows. Everything is optional: a web visitor may be
|
|
114
|
+
* nobody yet.
|
|
115
|
+
*/
|
|
116
|
+
export const ContactSchema = z.strictObject({
|
|
117
|
+
id: z.string().nullish(),
|
|
118
|
+
phone: z.string().nullish(),
|
|
119
|
+
name: z.string().nullish(),
|
|
120
|
+
email: z.string().nullish(),
|
|
121
|
+
external_id: z.string().nullish(),
|
|
122
|
+
});
|
|
123
|
+
/**
|
|
124
|
+
* One door to an agent: a channel and, for phone and WhatsApp, the number that answers. A number
|
|
125
|
+
* is a route, never an agent.
|
|
126
|
+
*/
|
|
127
|
+
export const RouteSchema = z.strictObject({
|
|
128
|
+
channel: ChannelSchema,
|
|
129
|
+
number: z.string().nullable(),
|
|
130
|
+
label: z.string().nullish(),
|
|
131
|
+
});
|
|
132
|
+
/** The human who sent a supervise verb, as the token that let them in names them. */
|
|
133
|
+
export const SupervisorSchema = z.strictObject({
|
|
134
|
+
id: z.string(),
|
|
135
|
+
name: z.string().nullish(),
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* What the app declares about one tool: the contract the model sees and the rules the platform
|
|
139
|
+
* enforces before running it.
|
|
140
|
+
*/
|
|
141
|
+
export const ToolSpecSchema = z.strictObject({
|
|
142
|
+
name: z.string(),
|
|
143
|
+
description: z.string(),
|
|
144
|
+
parameters: z.record(z.string(), z.unknown()),
|
|
145
|
+
side_effect: z.enum(["read", "write", "irreversible"]).nullish(),
|
|
146
|
+
confirm: z.string().nullish(),
|
|
147
|
+
pii: z.array(z.string()).nullish(),
|
|
148
|
+
timeout_s: z.number().nullish(),
|
|
149
|
+
});
|
|
150
|
+
/**
|
|
151
|
+
* What came back from running a tool in the app's process. Either an output or an error, never
|
|
152
|
+
* both.
|
|
153
|
+
*/
|
|
154
|
+
export const ToolResultSchema = z.strictObject({
|
|
155
|
+
call_id: z.string(),
|
|
156
|
+
name: z.string(),
|
|
157
|
+
output: z.unknown().nullish(),
|
|
158
|
+
error: z.string().nullish(),
|
|
159
|
+
summary: z.string().nullish(),
|
|
160
|
+
duration_s: z.number().nullish(),
|
|
161
|
+
});
|
|
162
|
+
/**
|
|
163
|
+
* One thing remembered about a contact: a sentence, where it came from, and how well it matched
|
|
164
|
+
* when recalled.
|
|
165
|
+
*/
|
|
166
|
+
export const MemoryFactSchema = z.strictObject({
|
|
167
|
+
id: z.string().nullish(),
|
|
168
|
+
text: z.string(),
|
|
169
|
+
category: z.string().nullish(),
|
|
170
|
+
score: z.number().nullish(),
|
|
171
|
+
source: z.string().nullish(),
|
|
172
|
+
});
|
|
173
|
+
/**
|
|
174
|
+
* One operation against the contact's memory: a recall during the turn, a remember at hangup, or a
|
|
175
|
+
* forget on request.
|
|
176
|
+
*/
|
|
177
|
+
export const MemoryOpSchema = z.strictObject({
|
|
178
|
+
op: z.enum(["recall", "remember", "forget"]),
|
|
179
|
+
contact: z.string().nullish(),
|
|
180
|
+
query: z.string().nullish(),
|
|
181
|
+
facts: z.array(MemoryFactSchema),
|
|
182
|
+
took_ms: z.number(),
|
|
183
|
+
});
|
|
184
|
+
/** One chunk of the knowledge base that retrieval put in front of the model for this turn. */
|
|
185
|
+
export const DocSourceSchema = z.strictObject({
|
|
186
|
+
id: z.string(),
|
|
187
|
+
path: z.string(),
|
|
188
|
+
heading: z.string().nullish(),
|
|
189
|
+
score: z.number(),
|
|
190
|
+
excerpt: z.string().nullish(),
|
|
191
|
+
});
|
|
192
|
+
/** The exchange rate the cost was computed with, stated so the number can be reproduced. */
|
|
193
|
+
export const CostRateSchema = z.strictObject({
|
|
194
|
+
currency: z.literal("EUR"),
|
|
195
|
+
usd_to_eur: z.number(),
|
|
196
|
+
as_of: z.string(),
|
|
197
|
+
});
|
|
198
|
+
/** One priced line: a model, what was counted, how much, and what it came to. */
|
|
199
|
+
export const CostRowSchema = z.strictObject({
|
|
200
|
+
provider: z.string(),
|
|
201
|
+
model: z.string(),
|
|
202
|
+
unit: z.enum(["input_tokens", "cached_input_tokens", "cache_creation_tokens", "output_tokens", "characters", "audio_seconds", "requests", "session_seconds"]),
|
|
203
|
+
quantity: z.number(),
|
|
204
|
+
unit_price_usd: z.number(),
|
|
205
|
+
eur: z.number(),
|
|
206
|
+
});
|
|
207
|
+
/** A usage row the price table does not know. It is listed, never priced at zero. */
|
|
208
|
+
export const UnpricedRowSchema = z.strictObject({
|
|
209
|
+
provider: z.string(),
|
|
210
|
+
model: z.string(),
|
|
211
|
+
});
|
|
212
|
+
/**
|
|
213
|
+
* What the call cost in provider fees, informational, in euros. The runtime never prices
|
|
214
|
+
* commercially; this is the provider's bill as best we know it.
|
|
215
|
+
*/
|
|
216
|
+
export const CostSchema = z.strictObject({
|
|
217
|
+
eur: z.number(),
|
|
218
|
+
rate: CostRateSchema,
|
|
219
|
+
rows: z.array(CostRowSchema),
|
|
220
|
+
unpriced: z.array(UnpricedRowSchema),
|
|
221
|
+
});
|
|
222
|
+
/** Which voice speaks for the agent: the name it was asked for, or the id the provider knows it by. */
|
|
223
|
+
export const VoiceConfigSchema = z.strictObject({
|
|
224
|
+
name: z.string().nullish(),
|
|
225
|
+
provider: z.string().nullish(),
|
|
226
|
+
model: z.string().nullish(),
|
|
227
|
+
voice_id: z.string().nullish(),
|
|
228
|
+
});
|
|
229
|
+
/** Which model does a job (the LLM, or the STT), and the one or two knobs worth turning. */
|
|
230
|
+
export const ModelConfigSchema = z.strictObject({
|
|
231
|
+
provider: z.string(),
|
|
232
|
+
model: z.string(),
|
|
233
|
+
temperature: z.number().nullish(),
|
|
234
|
+
});
|
|
235
|
+
/** How the session decides that the caller has finished, and when the caller may interrupt. */
|
|
236
|
+
export const TurnConfigSchema = z.strictObject({
|
|
237
|
+
min_interruption_words: z.int().nullish(),
|
|
238
|
+
endpointing_ms: z.int().nullish(),
|
|
239
|
+
});
|
|
240
|
+
/** How the voice says one word it would otherwise get wrong: a proper name, a brand, a street. */
|
|
241
|
+
export const PronunciationSchema = z.strictObject({
|
|
242
|
+
word: z.string(),
|
|
243
|
+
spoken: z.string(),
|
|
244
|
+
});
|
|
245
|
+
/**
|
|
246
|
+
* What the app declares about one field of its state: who may see it. A field never declared is
|
|
247
|
+
* tenant.
|
|
248
|
+
*/
|
|
249
|
+
export const StateFieldSpecSchema = z.strictObject({
|
|
250
|
+
name: z.string(),
|
|
251
|
+
visibility: VisibilitySchema,
|
|
252
|
+
});
|
|
253
|
+
/**
|
|
254
|
+
* One outside event the agent accepts, and from whom. An event nobody declared is refused before
|
|
255
|
+
* it touches the log.
|
|
256
|
+
*/
|
|
257
|
+
export const EventSpecSchema = z.strictObject({
|
|
258
|
+
name: z.string(),
|
|
259
|
+
from: z.array(EventSourceSchema),
|
|
260
|
+
});
|
|
261
|
+
/** One file of knowledge, sent whole: its path as the tenant keeps it, and its text. */
|
|
262
|
+
export const KnowledgeFileSchema = z.strictObject({
|
|
263
|
+
path: z.string(),
|
|
264
|
+
text: z.string(),
|
|
265
|
+
});
|
|
266
|
+
/**
|
|
267
|
+
* The knowledge base the agent answers from, and how its chunks reach the model. It is named by
|
|
268
|
+
* the base it was pushed under, with PUT /v1/knowledge/{base}.
|
|
269
|
+
*/
|
|
270
|
+
export const DocsConfigSchema = z.strictObject({
|
|
271
|
+
base: z.string(),
|
|
272
|
+
mode: DocsModeSchema.nullish(),
|
|
273
|
+
k: z.int().nullish(),
|
|
274
|
+
min_score: z.number().nullish(),
|
|
275
|
+
});
|
|
276
|
+
/**
|
|
277
|
+
* How the agent opens a call, before the caller has said anything. Exactly one of the two, because
|
|
278
|
+
* there are only two ways to open one: `say` are the words themselves and `reply` is what the
|
|
279
|
+
* model is told before it finds its own. They are agent.say and agent.reply declared instead of
|
|
280
|
+
* called, so a class that opens every call the same way needs no onCall hook to do it, and an
|
|
281
|
+
* operator can turn the opening at the pipeline door without a deploy. Absent: nobody speaks until
|
|
282
|
+
* the caller does.
|
|
283
|
+
*/
|
|
284
|
+
export const GreetingConfigSchema = z.strictObject({
|
|
285
|
+
say: z.string().nullish(),
|
|
286
|
+
reply: z.string().nullish(),
|
|
287
|
+
allow_interruptions: z.boolean().nullish(),
|
|
288
|
+
});
|
|
289
|
+
/**
|
|
290
|
+
* Whether the model may end the call itself. Declaring this is what puts livekit's own end_call
|
|
291
|
+
* tool in front of the model; a class that says nothing here cannot hang up, and the call ends
|
|
292
|
+
* when the caller does or when a supervisor says so. The tool is hidden while the agent is
|
|
293
|
+
* greeting, because a model that can hang up on its first turn eventually does.
|
|
294
|
+
*/
|
|
295
|
+
export const HangupConfigSchema = z.strictObject({
|
|
296
|
+
when: z.string().nullish(),
|
|
297
|
+
});
|
|
298
|
+
/**
|
|
299
|
+
* What memory keeps about a contact across calls, and what it must never keep. Both lists are in
|
|
300
|
+
* the tenant's own words.
|
|
301
|
+
*/
|
|
302
|
+
export const MemoryConfigSchema = z.strictObject({
|
|
303
|
+
remember: z.array(z.string()).nullish(),
|
|
304
|
+
forget: z.array(z.string()).nullish(),
|
|
305
|
+
});
|
|
306
|
+
/**
|
|
307
|
+
* What an app declares about its agent: the voice, the models, the language, the greeting, the
|
|
308
|
+
* tools, and who may see and send what. Every field is optional so a configure can change one
|
|
309
|
+
* thing.
|
|
310
|
+
*/
|
|
311
|
+
export const AgentConfigSchema = z.strictObject({
|
|
312
|
+
prompt: z.array(PromptBlockSpecSchema).nullish(),
|
|
313
|
+
language: z.string().nullish(),
|
|
314
|
+
greeting: GreetingConfigSchema.nullish(),
|
|
315
|
+
voice: VoiceConfigSchema.nullish(),
|
|
316
|
+
llm: ModelConfigSchema.nullish(),
|
|
317
|
+
stt: ModelConfigSchema.nullish(),
|
|
318
|
+
turn: TurnConfigSchema.nullish(),
|
|
319
|
+
says: z.array(PronunciationSchema).nullish(),
|
|
320
|
+
hears: z.array(z.string()).nullish(),
|
|
321
|
+
knowledge: KnowledgeFileSchema.nullish(),
|
|
322
|
+
docs: DocsConfigSchema.nullish(),
|
|
323
|
+
memory: MemoryConfigSchema.nullish(),
|
|
324
|
+
hangup: HangupConfigSchema.nullish(),
|
|
325
|
+
tools: z.array(ToolSpecSchema).nullish(),
|
|
326
|
+
state_fields: z.array(StateFieldSpecSchema).nullish(),
|
|
327
|
+
events: z.array(EventSpecSchema).nullish(),
|
|
328
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* One line of a call's log, or of an agent's log when call is null. seq is written before control
|
|
4
|
+
* returns, so two readers never disagree about order.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EntrySchema: z.ZodObject<{
|
|
7
|
+
seq: z.ZodInt;
|
|
8
|
+
ts: z.ZodNumber;
|
|
9
|
+
call: z.ZodNullable<z.ZodString>;
|
|
10
|
+
agent: z.ZodString;
|
|
11
|
+
type: z.ZodString;
|
|
12
|
+
ephemeral: z.ZodBoolean;
|
|
13
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type Entry = z.infer<typeof EntrySchema>;
|
|
16
|
+
/**
|
|
17
|
+
* One instruction from an app to the gateway over its WebSocket. The gateway answers with the
|
|
18
|
+
* events the command produces, or with an error naming the command's id.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CommandSchema: z.ZodObject<{
|
|
21
|
+
type: z.ZodString;
|
|
22
|
+
agent: z.ZodString;
|
|
23
|
+
call: z.ZodNullable<z.ZodString>;
|
|
24
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type Command = z.infer<typeof CommandSchema>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Generated from schema/envelope.json: the log entry and the command frame. Never edited by hand.
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/**
|
|
4
|
+
* One line of a call's log, or of an agent's log when call is null. seq is written before control
|
|
5
|
+
* returns, so two readers never disagree about order.
|
|
6
|
+
*/
|
|
7
|
+
export const EntrySchema = z.strictObject({
|
|
8
|
+
seq: z.int(),
|
|
9
|
+
ts: z.number(),
|
|
10
|
+
call: z.string().nullable(),
|
|
11
|
+
agent: z.string(),
|
|
12
|
+
type: z.string(),
|
|
13
|
+
ephemeral: z.boolean(),
|
|
14
|
+
data: z.record(z.string(), z.unknown()),
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* One instruction from an app to the gateway over its WebSocket. The gateway answers with the
|
|
18
|
+
* events the command produces, or with an error naming the command's id.
|
|
19
|
+
*/
|
|
20
|
+
export const CommandSchema = z.strictObject({
|
|
21
|
+
type: z.string(),
|
|
22
|
+
agent: z.string(),
|
|
23
|
+
call: z.string().nullable(),
|
|
24
|
+
id: z.string().nullish(),
|
|
25
|
+
data: z.record(z.string(), z.unknown()),
|
|
26
|
+
});
|