@pinecall/protocol 0.5.0 → 0.6.1

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.
@@ -428,15 +428,13 @@ export const KnowledgeScoreSchema = z.strictObject({
428
428
  misses: z.array(GoldenMissSchema),
429
429
  });
430
430
  /**
431
- * PUT /v1/knowledge/{base}, the answer: which base, how many chunks it became, how long that took,
432
- * and what its whole files weigh on every call.
431
+ * PUT /v1/knowledge/{base}, the answer: which base, how many chunks it became, and how long that
432
+ * took.
433
433
  */
434
434
  export const KnowledgePushedSchema = z.strictObject({
435
435
  base: z.string(),
436
436
  chunks: z.int(),
437
437
  took_ms: z.number(),
438
- whole_tokens: z.int().nullish(),
439
- notice: z.string().nullable().nullish(),
440
438
  });
441
439
  /** One knowledge base as the list draws it: its name, its size, and when it was last pushed. */
442
440
  export const KnowledgeBaseSchema = z.strictObject({
@@ -660,9 +658,8 @@ export const OutboundProvisionedSchema = z.strictObject({
660
658
  address: z.string().nullish(),
661
659
  });
662
660
  /**
663
- * An agent's tuning: what the org set over what the app declared, per world and per corner. Every
664
- * field is optional; one left out is not set, and what the app declared or the runtime's own
665
- * default — stands for it.
661
+ * An agent's settings: what the org set, per world and per corner. Every field is optional; one
662
+ * left out is not set, and the runtime's own default stands for it.
666
663
  */
667
664
  export const TuningBodySchema = z.strictObject({
668
665
  voice: z.string().nullish(),
@@ -674,7 +671,8 @@ export const TuningBodySchema = z.strictObject({
674
671
  hangup: HangupConfigSchema.nullish(),
675
672
  turn: TurnConfigSchema.nullish(),
676
673
  memory: MemoryConfigSchema.nullish(),
677
- knowledge: z.array(DocsConfigSchema).nullish(),
674
+ knowledge: z.string().nullish(),
675
+ bases: z.array(DocsConfigSchema).nullish(),
678
676
  });
679
677
  /**
680
678
  * One kept version of an agent's tuning: whose corner, which version, who set it and when, and
@@ -781,6 +779,46 @@ export const CallTuningSchema = z.strictObject({
781
779
  config: TuningRowSchema.nullable(),
782
780
  lexicon: LexiconRowSchema.nullable(),
783
781
  });
782
+ /** One file of a base as the list draws it. */
783
+ export const KnowledgeFileRowSchema = z.strictObject({
784
+ path: z.string(),
785
+ chars: z.int(),
786
+ chunks: z.int(),
787
+ pushed_at: z.number(),
788
+ });
789
+ /**
790
+ * GET /v1/knowledge/{base}: every file of the base, by path, with its size and what it became.
791
+ * Never the text: one file is read at a time.
792
+ */
793
+ export const KnowledgeFilesSchema = z.strictObject({
794
+ base: z.string(),
795
+ kept: z.boolean(),
796
+ files: z.array(KnowledgeFileRowSchema),
797
+ });
798
+ /** GET /v1/knowledge/{base}/files/{path}: one file, text and all. */
799
+ export const KnowledgeFileReadSchema = z.strictObject({
800
+ path: z.string(),
801
+ text: z.string(),
802
+ chunks: z.int(),
803
+ pushed_at: z.number(),
804
+ });
805
+ /**
806
+ * PUT /v1/knowledge/{base}/files/{path}, the body: the file's whole text. New under that path, or
807
+ * replaced in place; the base is begun when there is none.
808
+ */
809
+ export const KnowledgeFilePutSchema = z.strictObject({
810
+ text: z.string(),
811
+ });
812
+ /**
813
+ * PUT /v1/knowledge/{base}/files/{path}, the answer: which file, how many chunks it became, and
814
+ * how long that took.
815
+ */
816
+ export const KnowledgeFilePushedSchema = z.strictObject({
817
+ base: z.string(),
818
+ path: z.string(),
819
+ chunks: z.int(),
820
+ took_ms: z.number(),
821
+ });
784
822
  /** One base and the agents whose settings attach it. */
785
823
  export const KnowledgeUseSchema = z.strictObject({
786
824
  base: z.string(),
@@ -793,3 +831,34 @@ export const KnowledgeUseSchema = z.strictObject({
793
831
  export const KnowledgeUsesSchema = z.strictObject({
794
832
  bases: z.array(KnowledgeUseSchema),
795
833
  });
834
+ /**
835
+ * One synthetic caller of an agent, kept by the gateway: what they want, how they talk, and what
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.
838
+ */
839
+ export const PersonaSchema = z.strictObject({
840
+ name: z.string(),
841
+ about: z.string(),
842
+ goal: z.string(),
843
+ style: z.string(),
844
+ facts: z.record(z.string(), z.string()),
845
+ state: z.record(z.string(), z.unknown()),
846
+ author: z.string(),
847
+ set_at: z.number(),
848
+ });
849
+ /** GET /v1/agents/{slug}/personas: every caller written for this agent, by name. */
850
+ export const PersonaListSchema = z.strictObject({
851
+ personas: z.array(PersonaSchema),
852
+ });
853
+ /**
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.
856
+ */
857
+ export const PersonaPutSchema = z.strictObject({
858
+ about: z.string().nullish(),
859
+ goal: z.string(),
860
+ style: z.string(),
861
+ facts: z.record(z.string(), z.string()).nullish(),
862
+ state: z.record(z.string(), z.unknown()).nullish(),
863
+ was: z.string().nullish(),
864
+ });
@@ -23,9 +23,9 @@ export declare const ParticipantJoinedSchema: z.ZodObject<{
23
23
  kind: z.ZodEnum<{
24
24
  agent: "agent";
25
25
  caller: "caller";
26
- supervisor: "supervisor";
27
26
  listener: "listener";
28
27
  sip: "sip";
28
+ supervisor: "supervisor";
29
29
  }>;
30
30
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
31
31
  attributes: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -51,15 +51,15 @@ export declare const TrackPublishedSchema: z.ZodObject<{
51
51
  identity: z.ZodString;
52
52
  kind: z.ZodEnum<{
53
53
  audio: "audio";
54
- video: "video";
55
54
  screen: "screen";
55
+ video: "video";
56
56
  }>;
57
57
  source: z.ZodEnum<{
58
- unknown: "unknown";
59
- microphone: "microphone";
60
58
  camera: "camera";
59
+ microphone: "microphone";
61
60
  screen_share: "screen_share";
62
61
  screen_share_audio: "screen_share_audio";
62
+ unknown: "unknown";
63
63
  }>;
64
64
  }, z.core.$strict>;
65
65
  export type TrackPublished = z.infer<typeof TrackPublishedSchema>;
@@ -71,15 +71,15 @@ export declare const TrackUnpublishedSchema: z.ZodObject<{
71
71
  identity: z.ZodString;
72
72
  kind: z.ZodEnum<{
73
73
  audio: "audio";
74
- video: "video";
75
74
  screen: "screen";
75
+ video: "video";
76
76
  }>;
77
77
  source: z.ZodEnum<{
78
- unknown: "unknown";
79
- microphone: "microphone";
80
78
  camera: "camera";
79
+ microphone: "microphone";
81
80
  screen_share: "screen_share";
82
81
  screen_share_audio: "screen_share_audio";
82
+ unknown: "unknown";
83
83
  }>;
84
84
  }, z.core.$strict>;
85
85
  export type TrackUnpublished = z.infer<typeof TrackUnpublishedSchema>;
@@ -4,11 +4,11 @@ import { z } from "zod";
4
4
  * looks like.
5
5
  */
6
6
  export declare const CallStatusSchema: z.ZodEnum<{
7
- idle: "idle";
8
- ringing: "ringing";
9
- dialing: "dialing";
10
7
  active: "active";
8
+ dialing: "dialing";
11
9
  ended: "ended";
10
+ idle: "idle";
11
+ ringing: "ringing";
12
12
  }>;
13
13
  export type CallStatus = z.infer<typeof CallStatusSchema>;
14
14
  /** One finished turn of the caller, with what the session measured about it. */
@@ -277,9 +277,9 @@ export declare const ToolRunSchema: z.ZodObject<{
277
277
  arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
278
278
  speech_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
279
  status: z.ZodEnum<{
280
- running: "running";
281
280
  done: "done";
282
281
  failed: "failed";
282
+ running: "running";
283
283
  }>;
284
284
  output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
285
285
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -312,9 +312,9 @@ export declare const ConfirmSchema: z.ZodObject<{
312
312
  audience: z.ZodString;
313
313
  phrase: z.ZodString;
314
314
  status: z.ZodEnum<{
315
- pending: "pending";
316
- granted: "granted";
317
315
  declined: "declined";
316
+ granted: "granted";
317
+ pending: "pending";
318
318
  }>;
319
319
  said: z.ZodOptional<z.ZodNullable<z.ZodString>>;
320
320
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -372,9 +372,9 @@ export declare const ParticipantSchema: z.ZodObject<{
372
372
  kind: z.ZodEnum<{
373
373
  agent: "agent";
374
374
  caller: "caller";
375
- supervisor: "supervisor";
376
375
  listener: "listener";
377
376
  sip: "sip";
377
+ supervisor: "supervisor";
378
378
  }>;
379
379
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
380
380
  joined_at: z.ZodNumber;
@@ -391,9 +391,9 @@ export declare const RoomSchema: z.ZodObject<{
391
391
  kind: z.ZodEnum<{
392
392
  agent: "agent";
393
393
  caller: "caller";
394
- supervisor: "supervisor";
395
394
  listener: "listener";
396
395
  sip: "sip";
396
+ supervisor: "supervisor";
397
397
  }>;
398
398
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
399
399
  joined_at: z.ZodNumber;
@@ -430,11 +430,11 @@ export declare const StateSchema: z.ZodObject<{
430
430
  agent: z.ZodString;
431
431
  call: z.ZodNullable<z.ZodString>;
432
432
  status: z.ZodEnum<{
433
- idle: "idle";
434
- ringing: "ringing";
435
- dialing: "dialing";
436
433
  active: "active";
434
+ dialing: "dialing";
437
435
  ended: "ended";
436
+ idle: "idle";
437
+ ringing: "ringing";
438
438
  }>;
439
439
  channel: z.ZodNullable<z.ZodEnum<{
440
440
  phone: "phone";
@@ -462,9 +462,9 @@ export declare const StateSchema: z.ZodObject<{
462
462
  kind: z.ZodEnum<{
463
463
  agent: "agent";
464
464
  caller: "caller";
465
- supervisor: "supervisor";
466
465
  listener: "listener";
467
466
  sip: "sip";
467
+ supervisor: "supervisor";
468
468
  }>;
469
469
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
470
470
  joined_at: z.ZodNumber;
@@ -476,29 +476,29 @@ export declare const StateSchema: z.ZodObject<{
476
476
  started_at: z.ZodNullable<z.ZodNumber>;
477
477
  ended_at: z.ZodNullable<z.ZodNumber>;
478
478
  end_reason: z.ZodNullable<z.ZodEnum<{
479
- caller_hung_up: "caller_hung_up";
480
479
  agent_hung_up: "agent_hung_up";
481
- supervisor_ended: "supervisor_ended";
482
- transferred: "transferred";
483
- no_answer: "no_answer";
480
+ app_detached: "app_detached";
484
481
  busy: "busy";
482
+ caller_hung_up: "caller_hung_up";
485
483
  dial_failed: "dial_failed";
486
- timeout: "timeout";
487
484
  drained: "drained";
488
- app_detached: "app_detached";
489
485
  error: "error";
486
+ no_answer: "no_answer";
487
+ supervisor_ended: "supervisor_ended";
488
+ timeout: "timeout";
489
+ transferred: "transferred";
490
490
  }>>;
491
491
  outcome: z.ZodNullable<z.ZodString>;
492
492
  user_state: z.ZodNullable<z.ZodEnum<{
493
+ away: "away";
493
494
  listening: "listening";
494
495
  speaking: "speaking";
495
- away: "away";
496
496
  }>>;
497
497
  agent_state: z.ZodNullable<z.ZodEnum<{
498
+ idle: "idle";
499
+ initializing: "initializing";
498
500
  listening: "listening";
499
501
  speaking: "speaking";
500
- initializing: "initializing";
501
- idle: "idle";
502
502
  thinking: "thinking";
503
503
  }>>;
504
504
  live: z.ZodObject<{
@@ -714,9 +714,9 @@ export declare const StateSchema: z.ZodObject<{
714
714
  arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
715
715
  speech_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
716
716
  status: z.ZodEnum<{
717
- running: "running";
718
717
  done: "done";
719
718
  failed: "failed";
719
+ running: "running";
720
720
  }>;
721
721
  output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
722
722
  error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -746,18 +746,18 @@ export declare const StateSchema: z.ZodObject<{
746
746
  audience: z.ZodString;
747
747
  phrase: z.ZodString;
748
748
  status: z.ZodEnum<{
749
- pending: "pending";
750
- granted: "granted";
751
749
  declined: "declined";
750
+ granted: "granted";
751
+ pending: "pending";
752
752
  }>;
753
753
  said: z.ZodOptional<z.ZodNullable<z.ZodString>>;
754
754
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
755
755
  }, z.core.$strict>>;
756
756
  memory: z.ZodArray<z.ZodObject<{
757
757
  op: z.ZodEnum<{
758
+ forget: "forget";
758
759
  recall: "recall";
759
760
  remember: "remember";
760
- forget: "forget";
761
761
  }>;
762
762
  contact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
763
763
  query: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -857,12 +857,12 @@ export declare const StateSchema: z.ZodObject<{
857
857
  provider: z.ZodString;
858
858
  model: z.ZodString;
859
859
  unit: z.ZodEnum<{
860
- input_tokens: "input_tokens";
861
- cached_input_tokens: "cached_input_tokens";
860
+ audio_seconds: "audio_seconds";
862
861
  cache_creation_tokens: "cache_creation_tokens";
863
- output_tokens: "output_tokens";
862
+ cached_input_tokens: "cached_input_tokens";
864
863
  characters: "characters";
865
- audio_seconds: "audio_seconds";
864
+ input_tokens: "input_tokens";
865
+ output_tokens: "output_tokens";
866
866
  requests: "requests";
867
867
  session_seconds: "session_seconds";
868
868
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinecall/protocol",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
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>",