@pinecall/protocol 0.6.1 → 0.6.3

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.
@@ -85,6 +85,9 @@ export declare const AgentConfigureSchema: z.ZodObject<{
85
85
  tenant: "tenant";
86
86
  }>;
87
87
  }, z.core.$strict>>>>;
88
+ view: z.ZodOptional<z.ZodNullable<z.ZodObject<{
89
+ name: z.ZodString;
90
+ }, z.core.$strict>>>;
88
91
  events: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
89
92
  name: z.ZodString;
90
93
  from: z.ZodArray<z.ZodEnum<{
@@ -359,6 +362,9 @@ export declare const SessionConfigureSchema: z.ZodObject<{
359
362
  tenant: "tenant";
360
363
  }>;
361
364
  }, z.core.$strict>>>>;
365
+ view: z.ZodOptional<z.ZodNullable<z.ZodObject<{
366
+ name: z.ZodString;
367
+ }, z.core.$strict>>>;
362
368
  events: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
363
369
  name: z.ZodString;
364
370
  from: z.ZodArray<z.ZodEnum<{
@@ -32,9 +32,9 @@ export type Env = z.infer<typeof EnvSchema>;
32
32
  * What a console may ask of the process standing in the agent's directory, relayed by the gateway:
33
33
  * a written call to the class mounted there (chat), a simulated caller put on the class it holds,
34
34
  * its goldens and a suite of them, its knowledge folder pushed or its golden asked, its memory
35
- * goldens, a call promoted to a candidate file, the drift of the last two windows, and the
36
- * reproductions a broken run left on that disk. Everything else a console needs is a door of the
37
- * gateway.
35
+ * goldens, the panel it draws beside a conversation (view), a call promoted to a candidate file,
36
+ * the drift of the last two windows, and the reproductions a broken run left on that disk.
37
+ * Everything else a console needs is a door of the gateway.
38
38
  */
39
39
  export declare const DevVerbSchema: z.ZodEnum<{
40
40
  "chat.end": "chat.end";
@@ -55,6 +55,7 @@ export declare const DevVerbSchema: z.ZodEnum<{
55
55
  "reproductions.read": "reproductions.read";
56
56
  "reproductions.roster": "reproductions.roster";
57
57
  "simulate.start": "simulate.start";
58
+ "view.render": "view.render";
58
59
  }>;
59
60
  export type DevVerb = z.infer<typeof DevVerbSchema>;
60
61
  /**
@@ -330,6 +331,7 @@ export type MemoryOp = z.infer<typeof MemoryOpSchema>;
330
331
  /** One chunk of the knowledge base that retrieval put in front of the model for this turn. */
331
332
  export declare const DocSourceSchema: z.ZodObject<{
332
333
  id: z.ZodString;
334
+ base: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
335
  path: z.ZodString;
334
336
  heading: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
337
  score: z.ZodNumber;
@@ -442,6 +444,16 @@ export declare const StateFieldSpecSchema: z.ZodObject<{
442
444
  }>;
443
445
  }, z.core.$strict>;
444
446
  export type StateFieldSpec = z.infer<typeof StateFieldSpecSchema>;
447
+ /**
448
+ * The panel the agent draws beside a conversation: it is declared here so a console knows the
449
+ * agent has one before it asks for it, and draws its own about the contact when it has not. What
450
+ * the panel CONTAINS never comes this way — it is asked for a conversation at a time, through the
451
+ * view.render dev verb.
452
+ */
453
+ export declare const ViewSpecSchema: z.ZodObject<{
454
+ name: z.ZodString;
455
+ }, z.core.$strict>;
456
+ export type ViewSpec = z.infer<typeof ViewSpecSchema>;
445
457
  /**
446
458
  * One outside event the agent accepts, and from whom. An event nobody declared is refused before
447
459
  * it touches the log.
@@ -595,6 +607,9 @@ export declare const AgentConfigSchema: z.ZodObject<{
595
607
  tenant: "tenant";
596
608
  }>;
597
609
  }, z.core.$strict>>>>;
610
+ view: z.ZodOptional<z.ZodNullable<z.ZodObject<{
611
+ name: z.ZodString;
612
+ }, z.core.$strict>>>;
598
613
  events: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
599
614
  name: z.ZodString;
600
615
  from: z.ZodArray<z.ZodEnum<{
@@ -20,11 +20,11 @@ export const EnvSchema = z.enum(["production", "sandbox"]);
20
20
  * What a console may ask of the process standing in the agent's directory, relayed by the gateway:
21
21
  * a written call to the class mounted there (chat), a simulated caller put on the class it holds,
22
22
  * its 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.
23
+ * goldens, the panel it draws beside a conversation (view), a call promoted to a candidate file,
24
+ * the drift of the last two windows, and the reproductions a broken run left on that disk.
25
+ * Everything else a console needs is a door of the gateway.
26
26
  */
27
- export const DevVerbSchema = z.enum(["chat.roster", "chat.start", "chat.say", "chat.end", "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"]);
27
+ export const DevVerbSchema = z.enum(["chat.roster", "chat.start", "chat.say", "chat.end", "view.render", "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
28
  /**
29
29
  * Why the call is over. Who hung up, what failed before anybody could, drained: the platform took
30
30
  * the worker down (a deploy, a stop) with the call still on it, or app_detached: the app holding
@@ -184,6 +184,7 @@ export const MemoryOpSchema = z.strictObject({
184
184
  /** One chunk of the knowledge base that retrieval put in front of the model for this turn. */
185
185
  export const DocSourceSchema = z.strictObject({
186
186
  id: z.string(),
187
+ base: z.string().nullish(),
187
188
  path: z.string(),
188
189
  heading: z.string().nullish(),
189
190
  score: z.number(),
@@ -250,6 +251,15 @@ export const StateFieldSpecSchema = z.strictObject({
250
251
  name: z.string(),
251
252
  visibility: VisibilitySchema,
252
253
  });
254
+ /**
255
+ * The panel the agent draws beside a conversation: it is declared here so a console knows the
256
+ * agent has one before it asks for it, and draws its own about the contact when it has not. What
257
+ * the panel CONTAINS never comes this way — it is asked for a conversation at a time, through the
258
+ * view.render dev verb.
259
+ */
260
+ export const ViewSpecSchema = z.strictObject({
261
+ name: z.string(),
262
+ });
253
263
  /**
254
264
  * One outside event the agent accepts, and from whom. An event nobody declared is refused before
255
265
  * it touches the log.
@@ -327,5 +337,6 @@ export const AgentConfigSchema = z.strictObject({
327
337
  tools: z.array(ToolSpecSchema).nullish(),
328
338
  uses_knowledge: z.boolean().nullish(),
329
339
  state_fields: z.array(StateFieldSpecSchema).nullish(),
340
+ view: ViewSpecSchema.nullish(),
330
341
  events: z.array(EventSpecSchema).nullish(),
331
342
  });
@@ -228,6 +228,7 @@ export declare const CallStartedSchema: z.ZodObject<{
228
228
  from: z.ZodString;
229
229
  to: z.ZodString;
230
230
  run: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
231
+ persona: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodString>>>;
231
232
  caller: z.ZodNullable<z.ZodObject<{
232
233
  id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
233
234
  phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -466,6 +467,7 @@ export declare const DevRequestSchema: z.ZodObject<{
466
467
  "reproductions.read": "reproductions.read";
467
468
  "reproductions.roster": "reproductions.roster";
468
469
  "simulate.start": "simulate.start";
470
+ "view.render": "view.render";
469
471
  }>;
470
472
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
471
473
  }, z.core.$strict>;
@@ -478,6 +480,7 @@ export declare const DocsSourcesSchema: z.ZodObject<{
478
480
  query: z.ZodString;
479
481
  sources: z.ZodArray<z.ZodObject<{
480
482
  id: z.ZodString;
483
+ base: z.ZodOptional<z.ZodNullable<z.ZodString>>;
481
484
  path: z.ZodString;
482
485
  heading: z.ZodOptional<z.ZodNullable<z.ZodString>>;
483
486
  score: z.ZodNumber;
@@ -877,6 +880,7 @@ export declare const LogGapSchema: z.ZodObject<{
877
880
  }, z.core.$strict>>;
878
881
  sources: z.ZodArray<z.ZodObject<{
879
882
  id: z.ZodString;
883
+ base: z.ZodOptional<z.ZodNullable<z.ZodString>>;
880
884
  path: z.ZodString;
881
885
  heading: z.ZodOptional<z.ZodNullable<z.ZodString>>;
882
886
  score: z.ZodNumber;
@@ -126,6 +126,7 @@ export const CallStartedSchema = z.strictObject({
126
126
  from: z.string(),
127
127
  to: z.string(),
128
128
  run: z.string().nullable().nullish(),
129
+ persona: z.string().nullable().nullish(),
129
130
  caller: ContactSchema.nullable(),
130
131
  started_at: z.number(),
131
132
  env: EnvSchema.nullish(),
@@ -152,6 +152,7 @@ export declare const EVENT_SCHEMAS: {
152
152
  from: import("zod").ZodString;
153
153
  to: import("zod").ZodString;
154
154
  run: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNullable<import("zod").ZodString>>>;
155
+ persona: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNullable<import("zod").ZodString>>>;
155
156
  caller: import("zod").ZodNullable<import("zod").ZodObject<{
156
157
  id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
157
158
  phone: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
@@ -353,6 +354,7 @@ export declare const EVENT_SCHEMAS: {
353
354
  "reproductions.read": "reproductions.read";
354
355
  "reproductions.roster": "reproductions.roster";
355
356
  "simulate.start": "simulate.start";
357
+ "view.render": "view.render";
356
358
  }>;
357
359
  data: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
358
360
  }, import("zod/v4/core").$strict>;
@@ -360,6 +362,7 @@ export declare const EVENT_SCHEMAS: {
360
362
  query: import("zod").ZodString;
361
363
  sources: import("zod").ZodArray<import("zod").ZodObject<{
362
364
  id: import("zod").ZodString;
365
+ base: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
363
366
  path: import("zod").ZodString;
364
367
  heading: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
365
368
  score: import("zod").ZodNumber;
@@ -746,6 +749,7 @@ export declare const EVENT_SCHEMAS: {
746
749
  }, import("zod/v4/core").$strict>>;
747
750
  sources: import("zod").ZodArray<import("zod").ZodObject<{
748
751
  id: import("zod").ZodString;
752
+ base: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
749
753
  path: import("zod").ZodString;
750
754
  heading: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
751
755
  score: import("zod").ZodNumber;
@@ -1343,6 +1347,9 @@ export declare const COMMAND_SCHEMAS: {
1343
1347
  tenant: "tenant";
1344
1348
  }>;
1345
1349
  }, import("zod/v4/core").$strict>>>>;
1350
+ view: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
1351
+ name: import("zod").ZodString;
1352
+ }, import("zod/v4/core").$strict>>>;
1346
1353
  events: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodObject<{
1347
1354
  name: import("zod").ZodString;
1348
1355
  from: import("zod").ZodArray<import("zod").ZodEnum<{
@@ -1525,6 +1532,9 @@ export declare const COMMAND_SCHEMAS: {
1525
1532
  tenant: "tenant";
1526
1533
  }>;
1527
1534
  }, import("zod/v4/core").$strict>>>>;
1535
+ view: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
1536
+ name: import("zod").ZodString;
1537
+ }, import("zod/v4/core").$strict>>>;
1528
1538
  events: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodObject<{
1529
1539
  name: import("zod").ZodString;
1530
1540
  from: import("zod").ZodArray<import("zod").ZodEnum<{
@@ -348,6 +348,7 @@ export declare const CallStateSchema: z.ZodObject<{
348
348
  }, z.core.$strict>>;
349
349
  sources: z.ZodArray<z.ZodObject<{
350
350
  id: z.ZodString;
351
+ base: z.ZodOptional<z.ZodNullable<z.ZodString>>;
351
352
  path: z.ZodString;
352
353
  heading: z.ZodOptional<z.ZodNullable<z.ZodString>>;
353
354
  score: z.ZodNumber;
@@ -857,7 +858,7 @@ export declare const ThreadMessageSchema: z.ZodObject<{
857
858
  whatsapp: "whatsapp";
858
859
  }>;
859
860
  duration_s: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodNumber>>>;
860
- answered: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
861
+ answered: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodBoolean>>>;
861
862
  }, z.core.$strict>;
862
863
  export type ThreadMessage = z.infer<typeof ThreadMessageSchema>;
863
864
  /** GET /v1/agents/{slug}/threads/{contact}: every call of one contact, merged, oldest first. */
@@ -879,7 +880,7 @@ export declare const ThreadSchema: z.ZodObject<{
879
880
  whatsapp: "whatsapp";
880
881
  }>;
881
882
  duration_s: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodNumber>>>;
882
- answered: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
883
+ answered: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodBoolean>>>;
883
884
  }, z.core.$strict>>;
884
885
  }, z.core.$strict>;
885
886
  export type Thread = z.infer<typeof ThreadSchema>;
@@ -1106,10 +1107,10 @@ export declare const HeldAgentSchema: z.ZodObject<{
1106
1107
  web: "web";
1107
1108
  whatsapp: "whatsapp";
1108
1109
  }>>;
1109
- holder: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1110
+ holder: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
1110
1111
  holder: z.ZodNullable<z.ZodString>;
1111
1112
  name: z.ZodNullable<z.ZodString>;
1112
- }, z.core.$strict>>>;
1113
+ }, z.core.$strict>>>>;
1113
1114
  }, z.core.$strict>;
1114
1115
  export type HeldAgent = z.infer<typeof HeldAgentSchema>;
1115
1116
  /** GET /v1/agents: every agent this fleet is holding right now, as the front page lists them. */
@@ -1121,10 +1122,10 @@ export declare const AgentListSchema: z.ZodObject<{
1121
1122
  web: "web";
1122
1123
  whatsapp: "whatsapp";
1123
1124
  }>>;
1124
- holder: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1125
+ holder: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
1125
1126
  holder: z.ZodNullable<z.ZodString>;
1126
1127
  name: z.ZodNullable<z.ZodString>;
1127
- }, z.core.$strict>>>;
1128
+ }, z.core.$strict>>>>;
1128
1129
  }, z.core.$strict>>;
1129
1130
  }, z.core.$strict>;
1130
1131
  export type AgentList = z.infer<typeof AgentListSchema>;
@@ -1192,10 +1193,10 @@ export declare const TheLineSchema: z.ZodObject<{
1192
1193
  sandbox: "sandbox";
1193
1194
  }>;
1194
1195
  held: z.ZodBoolean;
1195
- holding: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1196
+ holding: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
1196
1197
  holder: z.ZodNullable<z.ZodString>;
1197
1198
  name: z.ZodNullable<z.ZodString>;
1198
- }, z.core.$strict>>>;
1199
+ }, z.core.$strict>>>>;
1199
1200
  yours: z.ZodBoolean;
1200
1201
  waiting: z.ZodArray<z.ZodObject<{
1201
1202
  holder: z.ZodNullable<z.ZodString>;
@@ -2243,9 +2244,11 @@ export declare const KnowledgeUsesSchema: z.ZodObject<{
2243
2244
  }, z.core.$strict>;
2244
2245
  export type KnowledgeUses = z.infer<typeof KnowledgeUsesSchema>;
2245
2246
  /**
2246
- * One synthetic caller of an agent, kept by the gateway: what they want, how they talk, and what
2247
+ * One synthetic caller of an ORG, kept by the gateway: what they want, how they talk, and what
2247
2248
  * they may state about themselves. A model plays them turn by turn — there is no script — for
2248
- * `pinecall simulate` and the console's Simulations.
2249
+ * `pinecall simulate` and the console's Simulations. A caller is a person on the phone, so who
2250
+ * they are does not depend on which of the org's agents answers: every agent of the org calls with
2251
+ * the same list.
2249
2252
  */
2250
2253
  export declare const PersonaSchema: z.ZodObject<{
2251
2254
  name: z.ZodString;
@@ -2258,7 +2261,10 @@ export declare const PersonaSchema: z.ZodObject<{
2258
2261
  set_at: z.ZodNumber;
2259
2262
  }, z.core.$strict>;
2260
2263
  export type Persona = z.infer<typeof PersonaSchema>;
2261
- /** GET /v1/agents/{slug}/personas: every caller written for this agent, by name. */
2264
+ /**
2265
+ * GET /v1/personas: every caller the org wrote, by name. The same list for every agent of the org,
2266
+ * and the same one in both worlds.
2267
+ */
2262
2268
  export declare const PersonaListSchema: z.ZodObject<{
2263
2269
  personas: z.ZodArray<z.ZodObject<{
2264
2270
  name: z.ZodString;
@@ -2273,8 +2279,8 @@ export declare const PersonaListSchema: z.ZodObject<{
2273
2279
  }, z.core.$strict>;
2274
2280
  export type PersonaList = z.infer<typeof PersonaListSchema>;
2275
2281
  /**
2276
- * PUT /v1/agents/{slug}/personas/{name}, the body: the caller, written whole. A name that exists
2277
- * is replaced; `was` renames the caller it names.
2282
+ * PUT /v1/personas/{name}, the body: the caller, written whole. A name that exists is replaced;
2283
+ * `was` renames the caller it names.
2278
2284
  */
2279
2285
  export declare const PersonaPutSchema: z.ZodObject<{
2280
2286
  about: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -2285,3 +2291,74 @@ export declare const PersonaPutSchema: z.ZodObject<{
2285
2291
  was: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2286
2292
  }, z.core.$strict>;
2287
2293
  export type PersonaPut = z.infer<typeof PersonaPutSchema>;
2294
+ /**
2295
+ * One simulation this caller has run: the call it was, and what the call came to. Read off the
2296
+ * call index, never off a log — the same row the sessions list is drawn from.
2297
+ */
2298
+ export declare const PersonaRunSchema: z.ZodObject<{
2299
+ call: z.ZodString;
2300
+ agent: z.ZodString;
2301
+ started_at: z.ZodNumber;
2302
+ ended_at: z.ZodNullable<z.ZodNumber>;
2303
+ turns: z.ZodInt;
2304
+ end_reason: z.ZodNullable<z.ZodEnum<{
2305
+ agent_hung_up: "agent_hung_up";
2306
+ app_detached: "app_detached";
2307
+ busy: "busy";
2308
+ caller_hung_up: "caller_hung_up";
2309
+ dial_failed: "dial_failed";
2310
+ drained: "drained";
2311
+ error: "error";
2312
+ no_answer: "no_answer";
2313
+ supervisor_ended: "supervisor_ended";
2314
+ timeout: "timeout";
2315
+ transferred: "transferred";
2316
+ }>>;
2317
+ outcome: z.ZodNullable<z.ZodString>;
2318
+ cost_eur: z.ZodNullable<z.ZodNumber>;
2319
+ score: z.ZodNullable<z.ZodObject<{
2320
+ held: z.ZodInt;
2321
+ judged: z.ZodInt;
2322
+ passed: z.ZodBoolean;
2323
+ reason: z.ZodNullable<z.ZodString>;
2324
+ }, z.core.$strict>>;
2325
+ }, z.core.$strict>;
2326
+ export type PersonaRun = z.infer<typeof PersonaRunSchema>;
2327
+ /**
2328
+ * Every simulation this caller has run, newest first, a page at a time. GET
2329
+ * /v1/personas/{name}/runs, in the key's own world and corner, paged exactly as the sessions list
2330
+ * is.
2331
+ */
2332
+ export declare const PersonaRunListSchema: z.ZodObject<{
2333
+ runs: z.ZodArray<z.ZodObject<{
2334
+ call: z.ZodString;
2335
+ agent: z.ZodString;
2336
+ started_at: z.ZodNumber;
2337
+ ended_at: z.ZodNullable<z.ZodNumber>;
2338
+ turns: z.ZodInt;
2339
+ end_reason: z.ZodNullable<z.ZodEnum<{
2340
+ agent_hung_up: "agent_hung_up";
2341
+ app_detached: "app_detached";
2342
+ busy: "busy";
2343
+ caller_hung_up: "caller_hung_up";
2344
+ dial_failed: "dial_failed";
2345
+ drained: "drained";
2346
+ error: "error";
2347
+ no_answer: "no_answer";
2348
+ supervisor_ended: "supervisor_ended";
2349
+ timeout: "timeout";
2350
+ transferred: "transferred";
2351
+ }>>;
2352
+ outcome: z.ZodNullable<z.ZodString>;
2353
+ cost_eur: z.ZodNullable<z.ZodNumber>;
2354
+ score: z.ZodNullable<z.ZodObject<{
2355
+ held: z.ZodInt;
2356
+ judged: z.ZodInt;
2357
+ passed: z.ZodBoolean;
2358
+ reason: z.ZodNullable<z.ZodString>;
2359
+ }, z.core.$strict>>;
2360
+ }, z.core.$strict>>;
2361
+ total: z.ZodInt;
2362
+ next: z.ZodNullable<z.ZodString>;
2363
+ }, z.core.$strict>;
2364
+ export type PersonaRunList = z.infer<typeof PersonaRunListSchema>;
@@ -144,7 +144,7 @@ export const ThreadMessageSchema = z.strictObject({
144
144
  call: z.string(),
145
145
  channel: ChannelSchema,
146
146
  duration_s: z.number().nullable().nullish(),
147
- answered: z.boolean().nullish(),
147
+ answered: z.boolean().nullable().nullish(),
148
148
  });
149
149
  /** GET /v1/agents/{slug}/threads/{contact}: every call of one contact, merged, oldest first. */
150
150
  export const ThreadSchema = z.strictObject({
@@ -334,7 +334,7 @@ export const LineHolderSchema = z.strictObject({
334
334
  export const HeldAgentSchema = z.strictObject({
335
335
  slug: z.string(),
336
336
  channels: z.array(ChannelSchema),
337
- holder: LineHolderSchema.nullish(),
337
+ holder: LineHolderSchema.nullable().nullish(),
338
338
  });
339
339
  /** GET /v1/agents: every agent this fleet is holding right now, as the front page lists them. */
340
340
  export const AgentListSchema = z.strictObject({
@@ -377,7 +377,7 @@ export const TheLineSchema = z.strictObject({
377
377
  agent: z.string(),
378
378
  env: EnvSchema,
379
379
  held: z.boolean(),
380
- holding: LineHolderSchema.nullish(),
380
+ holding: LineHolderSchema.nullable().nullish(),
381
381
  yours: z.boolean(),
382
382
  waiting: z.array(LineHolderSchema),
383
383
  calling: z.array(z.string()),
@@ -832,9 +832,11 @@ export const KnowledgeUsesSchema = z.strictObject({
832
832
  bases: z.array(KnowledgeUseSchema),
833
833
  });
834
834
  /**
835
- * One synthetic caller of an agent, kept by the gateway: what they want, how they talk, and what
835
+ * One synthetic caller of an ORG, kept by the gateway: what they want, how they talk, and what
836
836
  * they may state about themselves. A model plays them turn by turn — there is no script — for
837
- * `pinecall simulate` and the console's Simulations.
837
+ * `pinecall simulate` and the console's Simulations. A caller is a person on the phone, so who
838
+ * they are does not depend on which of the org's agents answers: every agent of the org calls with
839
+ * the same list.
838
840
  */
839
841
  export const PersonaSchema = z.strictObject({
840
842
  name: z.string(),
@@ -846,13 +848,16 @@ export const PersonaSchema = z.strictObject({
846
848
  author: z.string(),
847
849
  set_at: z.number(),
848
850
  });
849
- /** GET /v1/agents/{slug}/personas: every caller written for this agent, by name. */
851
+ /**
852
+ * GET /v1/personas: every caller the org wrote, by name. The same list for every agent of the org,
853
+ * and the same one in both worlds.
854
+ */
850
855
  export const PersonaListSchema = z.strictObject({
851
856
  personas: z.array(PersonaSchema),
852
857
  });
853
858
  /**
854
- * PUT /v1/agents/{slug}/personas/{name}, the body: the caller, written whole. A name that exists
855
- * is replaced; `was` renames the caller it names.
859
+ * PUT /v1/personas/{name}, the body: the caller, written whole. A name that exists is replaced;
860
+ * `was` renames the caller it names.
856
861
  */
857
862
  export const PersonaPutSchema = z.strictObject({
858
863
  about: z.string().nullish(),
@@ -862,3 +867,28 @@ export const PersonaPutSchema = z.strictObject({
862
867
  state: z.record(z.string(), z.unknown()).nullish(),
863
868
  was: z.string().nullish(),
864
869
  });
870
+ /**
871
+ * One simulation this caller has run: the call it was, and what the call came to. Read off the
872
+ * call index, never off a log — the same row the sessions list is drawn from.
873
+ */
874
+ export const PersonaRunSchema = z.strictObject({
875
+ call: z.string(),
876
+ agent: z.string(),
877
+ started_at: z.number(),
878
+ ended_at: z.number().nullable(),
879
+ turns: z.int(),
880
+ end_reason: EndReasonSchema.nullable(),
881
+ outcome: z.string().nullable(),
882
+ cost_eur: z.number().nullable(),
883
+ score: SessionScoreSchema.nullable(),
884
+ });
885
+ /**
886
+ * Every simulation this caller has run, newest first, a page at a time. GET
887
+ * /v1/personas/{name}/runs, in the key's own world and corner, paged exactly as the sessions list
888
+ * is.
889
+ */
890
+ export const PersonaRunListSchema = z.strictObject({
891
+ runs: z.array(PersonaRunSchema),
892
+ total: z.int(),
893
+ next: z.string().nullable(),
894
+ });
@@ -772,6 +772,7 @@ export declare const StateSchema: z.ZodObject<{
772
772
  }, z.core.$strict>>;
773
773
  sources: z.ZodArray<z.ZodObject<{
774
774
  id: z.ZodString;
775
+ base: z.ZodOptional<z.ZodNullable<z.ZodString>>;
775
776
  path: z.ZodString;
776
777
  heading: z.ZodOptional<z.ZodNullable<z.ZodString>>;
777
778
  score: z.ZodNumber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinecall/protocol",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "The Pinecall wire: zod schemas and types generated from the protocol schema, and the log reducer",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Pinecall <hello@pinecall.io>",