@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.
@@ -0,0 +1,130 @@
1
+ // Generated from schema: every event and command by its wire type. Never edited by hand.
2
+ import { AgentConfigureSchema, AgentRegisterSchema, AgentReplySchema, AgentSaySchema, CallDialSchema, CallDtmfSchema, CallEventSchema, CallHangupSchema, CallHoldSchema, CallLogSchema, CallMuteSchema, CallTransferSchema, CallUnholdSchema, CallUnmuteSchema, DevAnswerSchema, ParticipantMuteSchema, ParticipantRemoveSchema, PingSchema, PromptSetSchema, RoomInviteSchema, RoomSendSchema, SessionConfigureSchema, StateSetSchema, SupervisorVerbSchema, ToolsSetSchema, } from "./commands.js";
3
+ import { ToolResultSchema } from "./defs.js";
4
+ import { AgentConfiguredSchema, AgentDetachedSchema, AgentRegisteredSchema, AgentStateChangedSchema, AgentTranscriptSchema, AgentTurnEndedSchema, CallDialingSchema, CallEndedSchema, CallLineSchema, CallRingingSchema, CallScoreSchema, CallStartedSchema, CallSummarySchema, CallTransferredSchema, CallbackRequestedSchema, ConfirmDeclinedSchema, ConfirmGrantedSchema, ConfirmRequestSchema, CreditsExhaustedSchema, CustomSchema, DevRequestSchema, DocsSourcesSchema, ErrorEventSchema, FleetFullSchema, LogCaughtUpSchema, LogGapSchema, MemoryOpsSchema, PongSchema, PromptChangedSchema, StateChangedSchema, SupervisorEndedSchema, SupervisorReleasedSchema, SupervisorSaidSchema, SupervisorTookOverSchema, SupervisorTransferredSchema, SupervisorWhisperedSchema, ToolCallSchema, ToolsChangedSchema, UserStateChangedSchema, UserTranscriptSchema, UserTurnEndedSchema, } from "./events.js";
5
+ import { AvatarMetricsSchema, EOTInferenceMetricsSchema, EOUMetricsSchema, InterruptionMetricsSchema, LLMMetricsSchema, RealtimeModelMetricsSchema, STTMetricsSchema, TTSMetricsSchema, VADMetricsSchema, } from "./metrics.js";
6
+ import { EventReceivedSchema, ParticipantJoinedSchema, ParticipantLeftSchema, ParticipantSpeakingSchema, RoomOpenedSchema, RoomSentSchema, TrackPublishedSchema, TrackUnpublishedSchema, } from "./room.js";
7
+ /** Every event by its wire type; the codec looks the schema up here. */
8
+ export const EVENT_SCHEMAS = {
9
+ "agent.configured": AgentConfiguredSchema,
10
+ "agent.detached": AgentDetachedSchema,
11
+ "agent.registered": AgentRegisteredSchema,
12
+ "agent.state": AgentStateChangedSchema,
13
+ "agent.transcript": AgentTranscriptSchema,
14
+ "call.dialing": CallDialingSchema,
15
+ "call.ended": CallEndedSchema,
16
+ "call.line": CallLineSchema,
17
+ "call.ringing": CallRingingSchema,
18
+ "call.score": CallScoreSchema,
19
+ "call.started": CallStartedSchema,
20
+ "call.summary": CallSummarySchema,
21
+ "call.transferred": CallTransferredSchema,
22
+ "callback.requested": CallbackRequestedSchema,
23
+ "confirm.declined": ConfirmDeclinedSchema,
24
+ "confirm.granted": ConfirmGrantedSchema,
25
+ "confirm.request": ConfirmRequestSchema,
26
+ "credits.exhausted": CreditsExhaustedSchema,
27
+ "custom": CustomSchema,
28
+ "dev.request": DevRequestSchema,
29
+ "docs.sources": DocsSourcesSchema,
30
+ "error": ErrorEventSchema,
31
+ "event.received": EventReceivedSchema,
32
+ "fleet.full": FleetFullSchema,
33
+ "log.caught_up": LogCaughtUpSchema,
34
+ "log.gap": LogGapSchema,
35
+ "memory.ops": MemoryOpsSchema,
36
+ "metrics.avatar": AvatarMetricsSchema,
37
+ "metrics.eot": EOTInferenceMetricsSchema,
38
+ "metrics.eou": EOUMetricsSchema,
39
+ "metrics.interruption": InterruptionMetricsSchema,
40
+ "metrics.llm": LLMMetricsSchema,
41
+ "metrics.realtime": RealtimeModelMetricsSchema,
42
+ "metrics.stt": STTMetricsSchema,
43
+ "metrics.tts": TTSMetricsSchema,
44
+ "metrics.vad": VADMetricsSchema,
45
+ "participant.joined": ParticipantJoinedSchema,
46
+ "participant.left": ParticipantLeftSchema,
47
+ "participant.speaking": ParticipantSpeakingSchema,
48
+ "pong": PongSchema,
49
+ "prompt.changed": PromptChangedSchema,
50
+ "room.opened": RoomOpenedSchema,
51
+ "room.sent": RoomSentSchema,
52
+ "state.changed": StateChangedSchema,
53
+ "supervisor.ended": SupervisorEndedSchema,
54
+ "supervisor.released": SupervisorReleasedSchema,
55
+ "supervisor.said": SupervisorSaidSchema,
56
+ "supervisor.took_over": SupervisorTookOverSchema,
57
+ "supervisor.transferred": SupervisorTransferredSchema,
58
+ "supervisor.whispered": SupervisorWhisperedSchema,
59
+ "tool.call": ToolCallSchema,
60
+ "tool.result": ToolResultSchema,
61
+ "tools.changed": ToolsChangedSchema,
62
+ "track.published": TrackPublishedSchema,
63
+ "track.unpublished": TrackUnpublishedSchema,
64
+ "turn.agent": AgentTurnEndedSchema,
65
+ "turn.user": UserTurnEndedSchema,
66
+ "user.state": UserStateChangedSchema,
67
+ "user.transcript": UserTranscriptSchema,
68
+ };
69
+ /** Events a store may drop and a slow reader may miss: the entry's ephemeral flag defaults to this. */
70
+ export const EPHEMERAL_EVENTS = new Set(["agent.transcript", "dev.request", "log.caught_up", "log.gap", "metrics.vad", "participant.speaking", "pong", "room.sent", "user.transcript"]);
71
+ /** The one event that ends a call: after it nothing more is true and the log is sealed. */
72
+ export const TERMINAL_EVENT = "call.score";
73
+ /** Every command by its wire type; the codec looks the schema up here. */
74
+ export const COMMAND_SCHEMAS = {
75
+ "agent.configure": AgentConfigureSchema,
76
+ "agent.register": AgentRegisterSchema,
77
+ "agent.reply": AgentReplySchema,
78
+ "agent.say": AgentSaySchema,
79
+ "call.dial": CallDialSchema,
80
+ "call.dtmf": CallDtmfSchema,
81
+ "call.event": CallEventSchema,
82
+ "call.hangup": CallHangupSchema,
83
+ "call.hold": CallHoldSchema,
84
+ "call.log": CallLogSchema,
85
+ "call.mute": CallMuteSchema,
86
+ "call.transfer": CallTransferSchema,
87
+ "call.unhold": CallUnholdSchema,
88
+ "call.unmute": CallUnmuteSchema,
89
+ "dev.answer": DevAnswerSchema,
90
+ "participant.mute": ParticipantMuteSchema,
91
+ "participant.remove": ParticipantRemoveSchema,
92
+ "ping": PingSchema,
93
+ "prompt.set": PromptSetSchema,
94
+ "room.invite": RoomInviteSchema,
95
+ "room.send": RoomSendSchema,
96
+ "session.configure": SessionConfigureSchema,
97
+ "state.set": StateSetSchema,
98
+ "supervisor.verb": SupervisorVerbSchema,
99
+ "tool.result": ToolResultSchema,
100
+ "tools.set": ToolsSetSchema,
101
+ };
102
+ /** Which events a command lands in the log as, so a caller knows what to wait for. */
103
+ export const PRODUCES = {
104
+ "agent.configure": ["agent.configured"],
105
+ "agent.register": ["agent.registered"],
106
+ "agent.reply": ["turn.agent"],
107
+ "agent.say": ["turn.agent"],
108
+ "call.dial": ["call.dialing"],
109
+ "call.dtmf": [],
110
+ "call.event": ["event.received"],
111
+ "call.hangup": ["call.ended"],
112
+ "call.hold": ["call.line"],
113
+ "call.log": ["custom"],
114
+ "call.mute": ["call.line"],
115
+ "call.transfer": ["call.transferred"],
116
+ "call.unhold": ["call.line"],
117
+ "call.unmute": ["call.line"],
118
+ "dev.answer": [],
119
+ "participant.mute": ["track.unpublished"],
120
+ "participant.remove": ["participant.left"],
121
+ "ping": ["pong"],
122
+ "prompt.set": ["prompt.changed"],
123
+ "room.invite": ["participant.joined"],
124
+ "room.send": ["room.sent"],
125
+ "session.configure": ["state.changed", "agent.configured"],
126
+ "state.set": ["state.changed"],
127
+ "supervisor.verb": ["supervisor.said", "supervisor.whispered", "supervisor.took_over", "supervisor.released", "supervisor.transferred", "supervisor.ended"],
128
+ "tool.result": ["tool.result"],
129
+ "tools.set": ["tools.changed"],
130
+ };