@pinecall/agents 0.9.20

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.
Files changed (292) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +121 -0
  3. package/dist/agent/accepts.d.ts +31 -0
  4. package/dist/agent/accepts.d.ts.map +1 -0
  5. package/dist/agent/accepts.js +27 -0
  6. package/dist/agent/accepts.js.map +1 -0
  7. package/dist/agent/agent.d.ts +151 -0
  8. package/dist/agent/agent.d.ts.map +1 -0
  9. package/dist/agent/agent.js +240 -0
  10. package/dist/agent/agent.js.map +1 -0
  11. package/dist/agent/authors.d.ts +12 -0
  12. package/dist/agent/authors.d.ts.map +1 -0
  13. package/dist/agent/authors.js +26 -0
  14. package/dist/agent/authors.js.map +1 -0
  15. package/dist/agent/decorators.d.ts +16 -0
  16. package/dist/agent/decorators.d.ts.map +1 -0
  17. package/dist/agent/decorators.js +43 -0
  18. package/dist/agent/decorators.js.map +1 -0
  19. package/dist/agent/docstrings.d.ts +35 -0
  20. package/dist/agent/docstrings.d.ts.map +1 -0
  21. package/dist/agent/docstrings.js +301 -0
  22. package/dist/agent/docstrings.js.map +1 -0
  23. package/dist/agent/knowledge.d.ts +9 -0
  24. package/dist/agent/knowledge.d.ts.map +1 -0
  25. package/dist/agent/knowledge.js +3 -0
  26. package/dist/agent/knowledge.js.map +1 -0
  27. package/dist/agent/lifecycle.d.ts +29 -0
  28. package/dist/agent/lifecycle.d.ts.map +1 -0
  29. package/dist/agent/lifecycle.js +9 -0
  30. package/dist/agent/lifecycle.js.map +1 -0
  31. package/dist/agent/searching.d.ts +7 -0
  32. package/dist/agent/searching.d.ts.map +1 -0
  33. package/dist/agent/searching.js +35 -0
  34. package/dist/agent/searching.js.map +1 -0
  35. package/dist/agent/stages.d.ts +23 -0
  36. package/dist/agent/stages.d.ts.map +1 -0
  37. package/dist/agent/stages.js +29 -0
  38. package/dist/agent/stages.js.map +1 -0
  39. package/dist/agent/state.d.ts +36 -0
  40. package/dist/agent/state.d.ts.map +1 -0
  41. package/dist/agent/state.js +93 -0
  42. package/dist/agent/state.js.map +1 -0
  43. package/dist/agent/tools.d.ts +61 -0
  44. package/dist/agent/tools.d.ts.map +1 -0
  45. package/dist/agent/tools.js +145 -0
  46. package/dist/agent/tools.js.map +1 -0
  47. package/dist/agent/view.d.ts +29 -0
  48. package/dist/agent/view.d.ts.map +1 -0
  49. package/dist/agent/view.js +29 -0
  50. package/dist/agent/view.js.map +1 -0
  51. package/dist/agent/visibility.d.ts +32 -0
  52. package/dist/agent/visibility.d.ts.map +1 -0
  53. package/dist/agent/visibility.js +77 -0
  54. package/dist/agent/visibility.js.map +1 -0
  55. package/dist/call/call.d.ts +137 -0
  56. package/dist/call/call.d.ts.map +1 -0
  57. package/dist/call/call.js +228 -0
  58. package/dist/call/call.js.map +1 -0
  59. package/dist/call/history.d.ts +28 -0
  60. package/dist/call/history.d.ts.map +1 -0
  61. package/dist/call/history.js +32 -0
  62. package/dist/call/history.js.map +1 -0
  63. package/dist/call/room.d.ts +56 -0
  64. package/dist/call/room.d.ts.map +1 -0
  65. package/dist/call/room.js +66 -0
  66. package/dist/call/room.js.map +1 -0
  67. package/dist/client/agent.d.ts +93 -0
  68. package/dist/client/agent.d.ts.map +1 -0
  69. package/dist/client/agent.js +230 -0
  70. package/dist/client/agent.js.map +1 -0
  71. package/dist/client/calls.d.ts +87 -0
  72. package/dist/client/calls.d.ts.map +1 -0
  73. package/dist/client/calls.js +180 -0
  74. package/dist/client/calls.js.map +1 -0
  75. package/dist/client/client.d.ts +112 -0
  76. package/dist/client/client.d.ts.map +1 -0
  77. package/dist/client/client.js +284 -0
  78. package/dist/client/client.js.map +1 -0
  79. package/dist/client/connection.d.ts +52 -0
  80. package/dist/client/connection.d.ts.map +1 -0
  81. package/dist/client/connection.js +157 -0
  82. package/dist/client/connection.js.map +1 -0
  83. package/dist/client/endpoints.d.ts +9 -0
  84. package/dist/client/endpoints.d.ts.map +1 -0
  85. package/dist/client/endpoints.js +25 -0
  86. package/dist/client/endpoints.js.map +1 -0
  87. package/dist/client/frames.d.ts +29 -0
  88. package/dist/client/frames.d.ts.map +1 -0
  89. package/dist/client/frames.js +51 -0
  90. package/dist/client/frames.js.map +1 -0
  91. package/dist/client/index.d.ts +18 -0
  92. package/dist/client/index.d.ts.map +1 -0
  93. package/dist/client/index.js +13 -0
  94. package/dist/client/index.js.map +1 -0
  95. package/dist/client/listeners.d.ts +35 -0
  96. package/dist/client/listeners.d.ts.map +1 -0
  97. package/dist/client/listeners.js +60 -0
  98. package/dist/client/listeners.js.map +1 -0
  99. package/dist/client/lost.d.ts +4 -0
  100. package/dist/client/lost.d.ts.map +1 -0
  101. package/dist/client/lost.js +8 -0
  102. package/dist/client/lost.js.map +1 -0
  103. package/dist/client/observe.d.ts +50 -0
  104. package/dist/client/observe.d.ts.map +1 -0
  105. package/dist/client/observe.js +125 -0
  106. package/dist/client/observe.js.map +1 -0
  107. package/dist/client/signed.d.ts +14 -0
  108. package/dist/client/signed.d.ts.map +1 -0
  109. package/dist/client/signed.js +18 -0
  110. package/dist/client/signed.js.map +1 -0
  111. package/dist/client/testing/gateway.d.ts +58 -0
  112. package/dist/client/testing/gateway.d.ts.map +1 -0
  113. package/dist/client/testing/gateway.js +175 -0
  114. package/dist/client/testing/gateway.js.map +1 -0
  115. package/dist/client/testing/index.d.ts +4 -0
  116. package/dist/client/testing/index.d.ts.map +1 -0
  117. package/dist/client/testing/index.js +4 -0
  118. package/dist/client/testing/index.js.map +1 -0
  119. package/dist/client/testing/log.d.ts +24 -0
  120. package/dist/client/testing/log.d.ts.map +1 -0
  121. package/dist/client/testing/log.js +106 -0
  122. package/dist/client/testing/log.js.map +1 -0
  123. package/dist/client/testing/loopback.d.ts +3 -0
  124. package/dist/client/testing/loopback.d.ts.map +1 -0
  125. package/dist/client/testing/loopback.js +3 -0
  126. package/dist/client/testing/loopback.js.map +1 -0
  127. package/dist/index.d.ts +23 -0
  128. package/dist/index.d.ts.map +1 -0
  129. package/dist/index.js +27 -0
  130. package/dist/index.js.map +1 -0
  131. package/dist/runtime/connect.d.ts +42 -0
  132. package/dist/runtime/connect.d.ts.map +1 -0
  133. package/dist/runtime/connect.js +234 -0
  134. package/dist/runtime/connect.js.map +1 -0
  135. package/dist/runtime/dispatch.d.ts +32 -0
  136. package/dist/runtime/dispatch.d.ts.map +1 -0
  137. package/dist/runtime/dispatch.js +46 -0
  138. package/dist/runtime/dispatch.js.map +1 -0
  139. package/dist/runtime/environment.d.ts +7 -0
  140. package/dist/runtime/environment.d.ts.map +1 -0
  141. package/dist/runtime/environment.js +30 -0
  142. package/dist/runtime/environment.js.map +1 -0
  143. package/dist/runtime/recall.d.ts +9 -0
  144. package/dist/runtime/recall.d.ts.map +1 -0
  145. package/dist/runtime/recall.js +13 -0
  146. package/dist/runtime/recall.js.map +1 -0
  147. package/dist/runtime/run-tool.d.ts +18 -0
  148. package/dist/runtime/run-tool.d.ts.map +1 -0
  149. package/dist/runtime/run-tool.js +70 -0
  150. package/dist/runtime/run-tool.js.map +1 -0
  151. package/dist/serve/index.d.ts +5 -0
  152. package/dist/serve/index.d.ts.map +1 -0
  153. package/dist/serve/index.js +50 -0
  154. package/dist/serve/index.js.map +1 -0
  155. package/dist/serve/io.d.ts +14 -0
  156. package/dist/serve/io.d.ts.map +1 -0
  157. package/dist/serve/io.js +6 -0
  158. package/dist/serve/io.js.map +1 -0
  159. package/dist/serve/leaving.d.ts +12 -0
  160. package/dist/serve/leaving.d.ts.map +1 -0
  161. package/dist/serve/leaving.js +61 -0
  162. package/dist/serve/leaving.js.map +1 -0
  163. package/dist/serve/lines.d.ts +7 -0
  164. package/dist/serve/lines.d.ts.map +1 -0
  165. package/dist/serve/lines.js +25 -0
  166. package/dist/serve/lines.js.map +1 -0
  167. package/dist/serve/load.d.ts +26 -0
  168. package/dist/serve/load.d.ts.map +1 -0
  169. package/dist/serve/load.js +61 -0
  170. package/dist/serve/load.js.map +1 -0
  171. package/dist/serve/machine.d.ts +4 -0
  172. package/dist/serve/machine.d.ts.map +1 -0
  173. package/dist/serve/machine.js +33 -0
  174. package/dist/serve/machine.js.map +1 -0
  175. package/dist/serve/prompt.d.ts +7 -0
  176. package/dist/serve/prompt.d.ts.map +1 -0
  177. package/dist/serve/prompt.js +51 -0
  178. package/dist/serve/prompt.js.map +1 -0
  179. package/dist/serve/start.d.ts +7 -0
  180. package/dist/serve/start.d.ts.map +1 -0
  181. package/dist/serve/start.js +95 -0
  182. package/dist/serve/start.js.map +1 -0
  183. package/dist/serve/viewing.d.ts +17 -0
  184. package/dist/serve/viewing.d.ts.map +1 -0
  185. package/dist/serve/viewing.js +42 -0
  186. package/dist/serve/viewing.js.map +1 -0
  187. package/dist/views/built-in-rules.d.ts +9 -0
  188. package/dist/views/built-in-rules.d.ts.map +1 -0
  189. package/dist/views/built-in-rules.js +28 -0
  190. package/dist/views/built-in-rules.js.map +1 -0
  191. package/dist/views/components.d.ts +17 -0
  192. package/dist/views/components.d.ts.map +1 -0
  193. package/dist/views/components.js +33 -0
  194. package/dist/views/components.js.map +1 -0
  195. package/dist/views/jsx-dev-runtime.d.ts +3 -0
  196. package/dist/views/jsx-dev-runtime.d.ts.map +1 -0
  197. package/dist/views/jsx-dev-runtime.js +4 -0
  198. package/dist/views/jsx-dev-runtime.js.map +1 -0
  199. package/dist/views/jsx-runtime.d.ts +46 -0
  200. package/dist/views/jsx-runtime.d.ts.map +1 -0
  201. package/dist/views/jsx-runtime.js +63 -0
  202. package/dist/views/jsx-runtime.js.map +1 -0
  203. package/dist/views/layout.d.ts +19 -0
  204. package/dist/views/layout.d.ts.map +1 -0
  205. package/dist/views/layout.js +58 -0
  206. package/dist/views/layout.js.map +1 -0
  207. package/dist/views/nodes.d.ts +48 -0
  208. package/dist/views/nodes.d.ts.map +1 -0
  209. package/dist/views/nodes.js +45 -0
  210. package/dist/views/nodes.js.map +1 -0
  211. package/dist/views/panels.d.ts +17 -0
  212. package/dist/views/panels.d.ts.map +1 -0
  213. package/dist/views/panels.js +62 -0
  214. package/dist/views/panels.js.map +1 -0
  215. package/dist/views/render.d.ts +11 -0
  216. package/dist/views/render.d.ts.map +1 -0
  217. package/dist/views/render.js +19 -0
  218. package/dist/views/render.js.map +1 -0
  219. package/dist/wire/agent-config.d.ts +213 -0
  220. package/dist/wire/agent-config.d.ts.map +1 -0
  221. package/dist/wire/agent-config.js +126 -0
  222. package/dist/wire/agent-config.js.map +1 -0
  223. package/dist/wire/codec.d.ts +43 -0
  224. package/dist/wire/codec.d.ts.map +1 -0
  225. package/dist/wire/codec.js +51 -0
  226. package/dist/wire/codec.js.map +1 -0
  227. package/dist/wire/commands.d.ts +443 -0
  228. package/dist/wire/commands.d.ts.map +1 -0
  229. package/dist/wire/commands.js +203 -0
  230. package/dist/wire/commands.js.map +1 -0
  231. package/dist/wire/defs.d.ts +373 -0
  232. package/dist/wire/defs.d.ts.map +1 -0
  233. package/dist/wire/defs.js +212 -0
  234. package/dist/wire/defs.js.map +1 -0
  235. package/dist/wire/envelope.d.ts +29 -0
  236. package/dist/wire/envelope.d.ts.map +1 -0
  237. package/dist/wire/envelope.js +27 -0
  238. package/dist/wire/envelope.js.map +1 -0
  239. package/dist/wire/events-call.d.ts +446 -0
  240. package/dist/wire/events-call.d.ts.map +1 -0
  241. package/dist/wire/events-call.js +196 -0
  242. package/dist/wire/events-call.js.map +1 -0
  243. package/dist/wire/events.d.ts +946 -0
  244. package/dist/wire/events.d.ts.map +1 -0
  245. package/dist/wire/events.js +309 -0
  246. package/dist/wire/events.js.map +1 -0
  247. package/dist/wire/index.d.ts +19 -0
  248. package/dist/wire/index.d.ts.map +1 -0
  249. package/dist/wire/index.js +19 -0
  250. package/dist/wire/index.js.map +1 -0
  251. package/dist/wire/metrics.d.ts +366 -0
  252. package/dist/wire/metrics.d.ts.map +1 -0
  253. package/dist/wire/metrics.js +269 -0
  254. package/dist/wire/metrics.js.map +1 -0
  255. package/dist/wire/reduce.d.ts +10 -0
  256. package/dist/wire/reduce.d.ts.map +1 -0
  257. package/dist/wire/reduce.js +367 -0
  258. package/dist/wire/reduce.js.map +1 -0
  259. package/dist/wire/registry.d.ts +1789 -0
  260. package/dist/wire/registry.d.ts.map +1 -0
  261. package/dist/wire/registry.js +118 -0
  262. package/dist/wire/registry.js.map +1 -0
  263. package/dist/wire/rest-data.d.ts +170 -0
  264. package/dist/wire/rest-data.d.ts.map +1 -0
  265. package/dist/wire/rest-data.js +78 -0
  266. package/dist/wire/rest-data.js.map +1 -0
  267. package/dist/wire/rest-hosting.d.ts +74 -0
  268. package/dist/wire/rest-hosting.d.ts.map +1 -0
  269. package/dist/wire/rest-hosting.js +38 -0
  270. package/dist/wire/rest-hosting.js.map +1 -0
  271. package/dist/wire/rest-retrieval.d.ts +214 -0
  272. package/dist/wire/rest-retrieval.d.ts.map +1 -0
  273. package/dist/wire/rest-retrieval.js +161 -0
  274. package/dist/wire/rest-retrieval.js.map +1 -0
  275. package/dist/wire/rest.d.ts +786 -0
  276. package/dist/wire/rest.d.ts.map +1 -0
  277. package/dist/wire/rest.js +238 -0
  278. package/dist/wire/rest.js.map +1 -0
  279. package/dist/wire/room.d.ts +106 -0
  280. package/dist/wire/room.d.ts.map +1 -0
  281. package/dist/wire/room.js +73 -0
  282. package/dist/wire/room.js.map +1 -0
  283. package/dist/wire/state.d.ts +915 -0
  284. package/dist/wire/state.d.ts.map +1 -0
  285. package/dist/wire/state.js +189 -0
  286. package/dist/wire/state.js.map +1 -0
  287. package/dist/wire/verbs.d.ts +73 -0
  288. package/dist/wire/verbs.d.ts.map +1 -0
  289. package/dist/wire/verbs.js +50 -0
  290. package/dist/wire/verbs.js.map +1 -0
  291. package/package.json +74 -0
  292. package/tsconfig.tenant.json +24 -0
@@ -0,0 +1,203 @@
1
+ /** The commands an app sends a call, one schema each. */
2
+ import { z } from "zod";
3
+ import { AgentConfigSchema } from "./agent-config.js";
4
+ import { ContactSchema, RouteSchema, SupervisorSchema, ToolSpecSchema, TransferModeSchema, } from "./defs.js";
5
+ import { VerbSchema } from "./verbs.js";
6
+ /**
7
+ * Declare or change what the agent is: voice, models, greeting, the full tool list. Only
8
+ * the fields sent change.
9
+ */
10
+ export const AgentConfigureSchema = z.strictObject({
11
+ config: AgentConfigSchema,
12
+ });
13
+ /** This socket is leaving, and its calls go on without it. */
14
+ export const AgentDrainSchema = z.strictObject({});
15
+ /**
16
+ * The app's first message: this socket speaks for this agent and answers these doors. The gateway
17
+ * answers agent.registered, or error.
18
+ */
19
+ export const AgentRegisterSchema = z.strictObject({
20
+ routes: z.array(RouteSchema),
21
+ sdk: z.string().nullish(),
22
+ host: z.string().nullish(),
23
+ takes_unclaimed: z.boolean().nullish(),
24
+ /** This socket answers the console's dev verbs for the agent; `view.render` still goes to the one serving the call. */
25
+ answers_dev: z.boolean().nullish(),
26
+ });
27
+ /**
28
+ * Make the model speak now, guided by an instruction it reads and the caller never hears: 'tell
29
+ * them a slot at 10:15 just opened'. On livekit's session.generate_reply; the sibling of
30
+ * agent.say, which speaks verbatim. The reply lands as turn.agent.
31
+ */
32
+ export const AgentReplySchema = z.strictObject({
33
+ instructions: z.string(),
34
+ allow_interruptions: z.boolean().nullish(),
35
+ });
36
+ /**
37
+ * Make the agent say this text now, verbatim, outside the model's turn: a greeting, a read-back, a
38
+ * system notice. The reply lands as turn.agent.
39
+ */
40
+ export const AgentSaySchema = z.strictObject({
41
+ text: z.string(),
42
+ allow_interruptions: z.boolean().nullish(),
43
+ });
44
+ /**
45
+ * Ask for a person without sending the caller anywhere: the call waits on hold until a supervisor
46
+ * takes the line, or until wait_s passes with nobody taking it. attention.answered says which.
47
+ */
48
+ export const CallAttentionSchema = z.strictObject({
49
+ reason: z.string(),
50
+ wait_s: z.number(),
51
+ });
52
+ /**
53
+ * Write down that the caller wants to be called back. Lands as callback.requested with via agent;
54
+ * placing the call is the app's.
55
+ */
56
+ export const CallCallbackSchema = z.strictObject({
57
+ number: z.string(),
58
+ when: z.string().nullish(),
59
+ note: z.string().nullish(),
60
+ });
61
+ /** The caller asked never to be called again: their number joins the org's do-not-call list. */
62
+ export const CallOptOutSchema = z.strictObject({
63
+ note: z.string().max(500).nullish(),
64
+ });
65
+ /** The code the caller said, to bind this call to the page that shows it. */
66
+ export const CallClaimSchema = z.strictObject({
67
+ code: z.string().regex(/^[0-9]{4}$/),
68
+ });
69
+ /**
70
+ * Place an outbound call as this agent. The new call's log opens with call.dialing; call.started
71
+ * follows when the far end answers.
72
+ */
73
+ export const CallDialSchema = z.strictObject({
74
+ to: z.string(),
75
+ from: z.string().nullish(),
76
+ caller: ContactSchema.nullish(),
77
+ metadata: z.record(z.string(), z.unknown()).nullish(),
78
+ });
79
+ /** Send touch tones down the line, for an IVR on the far end. */
80
+ export const CallDtmfSchema = z.strictObject({
81
+ digits: z.string(),
82
+ });
83
+ /**
84
+ * Hand the agent a fact from the tenant's backend: a slot freed, an order shipped, a payment
85
+ * confirmed. Lands as event.received with source app. The agent must have declared the name in its
86
+ * events with app among the senders, or the gateway answers error and nothing touches the log.
87
+ */
88
+ export const CallEventSchema = z.strictObject({
89
+ name: z.string(),
90
+ data: z.record(z.string(), z.unknown()),
91
+ });
92
+ /** End the call from the app's side. call.ended follows with reason agent_hung_up. */
93
+ export const CallHangupSchema = z.strictObject({
94
+ reason: z.string().nullish(),
95
+ });
96
+ /** Put the caller on hold: they hear hold audio, the agent hears nothing. */
97
+ export const CallHoldSchema = z.strictObject({});
98
+ /**
99
+ * Write a line of the app's own into the call's log. It gets a seq like everything else and lands
100
+ * as custom.
101
+ */
102
+ export const CallLogSchema = z.strictObject({
103
+ name: z.string(),
104
+ data: z.record(z.string(), z.unknown()),
105
+ });
106
+ /** Mute the agent: it keeps listening and thinking, produces no audio. */
107
+ export const CallMuteSchema = z.strictObject({});
108
+ /**
109
+ * Send the caller to another number, or bring that number into the call. call.transferred says
110
+ * whether it worked, and which mode it was.
111
+ */
112
+ export const CallTransferSchema = z.strictObject({
113
+ to: z.string(),
114
+ mode: TransferModeSchema.nullish(),
115
+ });
116
+ /** Take the caller off hold. */
117
+ export const CallUnholdSchema = z.strictObject({});
118
+ /** Unmute the agent. */
119
+ export const CallUnmuteSchema = z.strictObject({});
120
+ /**
121
+ * Why the verb did not run, in the words the console shows: the status it travels under, and the
122
+ * sentence.
123
+ */
124
+ export const DevRefusalSchema = z.strictObject({
125
+ status: z.int(),
126
+ detail: z.string(),
127
+ });
128
+ /** What came of one dev.request, named by its id. */
129
+ export const DevAnswerSchema = z.strictObject({
130
+ id: z.string(),
131
+ result: z.record(z.string(), z.unknown()).nullish(),
132
+ refused: DevRefusalSchema.nullish(),
133
+ });
134
+ /**
135
+ * Silence a participant for the rest of the call: their audio leaves the room, for everyone in it.
136
+ * Lands as track.unpublished for their microphone. There is no unmute; a leg that must speak again
137
+ * is invited again.
138
+ */
139
+ export const ParticipantMuteSchema = z.strictObject({
140
+ identity: z.string(),
141
+ });
142
+ /**
143
+ * Put a participant out of the room. Lands as participant.left with reason participant_removed.
144
+ * Removing the caller ends the call.
145
+ */
146
+ export const ParticipantRemoveSchema = z.strictObject({
147
+ identity: z.string(),
148
+ });
149
+ /** Is the socket alive? The gateway answers pong. */
150
+ export const PingSchema = z.strictObject({});
151
+ /**
152
+ * Rewrite one block of the prompt, whole, by name. The name must be one of the agent's declared
153
+ * blocks, or one of the default four; anything else is refused with the name.
154
+ */
155
+ export const PromptSetSchema = z.strictObject({
156
+ name: z.string(),
157
+ text: z.string(),
158
+ });
159
+ /**
160
+ * Bring somebody else into the call's room. A second SIP leg dialed to a number is the warm path:
161
+ * the agent stays on with the caller while the other side answers. Lands as participant.joined
162
+ * when they arrive, or error when they do not.
163
+ */
164
+ export const RoomInviteSchema = z.strictObject({
165
+ to: z.string(),
166
+ kind: z.enum(["sip", "participant"]),
167
+ });
168
+ /**
169
+ * Push a payload to a browser in the room over the DataChannel: a card to render, a form to open.
170
+ * Lands as room.sent with the size, never the payload. The widget listens on pinecall.ui; a topic
171
+ * of the tenant's own reaches the tenant's own page code.
172
+ */
173
+ export const RoomSendSchema = z.strictObject({
174
+ topic: z.string(),
175
+ data: z.record(z.string(), z.unknown()),
176
+ to: z.string().nullish(),
177
+ });
178
+ /**
179
+ * Set up this one call before the first turn: the app's initial state, and any config that differs
180
+ * from the agent's defaults for this caller.
181
+ */
182
+ export const SessionConfigureSchema = z.strictObject({
183
+ state: z.record(z.string(), z.unknown()).nullish(),
184
+ config: AgentConfigSchema.nullish(),
185
+ });
186
+ /** The app's state changed and this is all of it. The platform logs state.changed and re-renders. */
187
+ export const StateSetSchema = z.strictObject({
188
+ state: z.record(z.string(), z.unknown()),
189
+ changed: z.array(z.string()).nullish(),
190
+ });
191
+ /** One supervise verb, from the human the door named. */
192
+ export const SupervisorVerbSchema = z.strictObject({
193
+ by: SupervisorSchema,
194
+ verb: VerbSchema,
195
+ });
196
+ /**
197
+ * The tools the model may see now. The full list was declared in agent.configure; this is the
198
+ * subset whose when allows them in this state.
199
+ */
200
+ export const ToolsSetSchema = z.strictObject({
201
+ tools: z.array(ToolSpecSchema),
202
+ });
203
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/wire/commands.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC;IACjD,MAAM,EAAE,iBAAiB;CAC1B,CAAC,CAAC;AAEH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAEn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,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IAClD,MAAM,EAAE,iBAAiB,CAAC,OAAO,EAAE;CACpC,CAAC,CAAC;AAEH,qGAAqG;AACrG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACvC,CAAC,CAAC;AAEH,yDAAyD;AACzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC;IACjD,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,UAAU;CACjB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;CAC/B,CAAC,CAAC"}
@@ -0,0 +1,373 @@
1
+ /** The shapes the rest of the wire is made of: channels, parts of a turn, tools, memory, costs. */
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 declare const ChannelSchema: z.ZodEnum<{
8
+ phone: "phone";
9
+ web: "web";
10
+ whatsapp: "whatsapp";
11
+ }>;
12
+ export type Channel = z.infer<typeof ChannelSchema>;
13
+ /** How a call is had: spoken (`voice`) or written (`text`). A web call can be either. */
14
+ export declare const MediumSchema: z.ZodEnum<{
15
+ text: "text";
16
+ voice: "voice";
17
+ }>;
18
+ export type Medium = z.infer<typeof MediumSchema>;
19
+ /** Inbound: the public reached the agent. Outbound: the agent reached out (a dial). */
20
+ export declare const DirectionSchema: z.ZodEnum<{
21
+ inbound: "inbound";
22
+ outbound: "outbound";
23
+ }>;
24
+ /**
25
+ * Which of the two worlds a key opens, and so which world an agent is held in and a call ran in. A
26
+ * key is issued into one; an agent registered on it and every call it takes carry that one; a door
27
+ * claimed in one is refused to a key of the other. `sandbox` is where things are written and
28
+ * `production` is what the public reaches — and whether a sandbox agent is one PERSON's copy or
29
+ * the team's shared one is not this field: it is whether the key that registered it names a
30
+ * person. Every key issued before the field existed is production.
31
+ */
32
+ export declare const EnvSchema: z.ZodEnum<{
33
+ production: "production";
34
+ sandbox: "sandbox";
35
+ }>;
36
+ /**
37
+ * What a console may ask of the process standing in the agent's directory, relayed by the gateway:
38
+ * a written call to the class mounted there (chat), a simulated caller put on the class it holds,
39
+ * its goldens and a suite of them, its knowledge folder pushed or its golden asked, its memory
40
+ * goldens, the panel it draws beside a conversation (view), a call promoted to a candidate file,
41
+ * the drift of the last two windows, and the reproductions a broken run left on that disk.
42
+ * Everything else a console needs is a door of the gateway.
43
+ */
44
+ export declare const DevVerbSchema: z.ZodEnum<{
45
+ "chat.end": "chat.end";
46
+ "chat.roster": "chat.roster";
47
+ "chat.say": "chat.say";
48
+ "chat.start": "chat.start";
49
+ "drift.read": "drift.read";
50
+ "goldens.roster": "goldens.roster";
51
+ "goldens.run": "goldens.run";
52
+ "knowledge.eval": "knowledge.eval";
53
+ "knowledge.push": "knowledge.push";
54
+ "knowledge.roster": "knowledge.roster";
55
+ "memory.eval": "memory.eval";
56
+ "memory.extraction": "memory.extraction";
57
+ "memory.roster": "memory.roster";
58
+ "promote.roster": "promote.roster";
59
+ "promote.write": "promote.write";
60
+ "reproductions.read": "reproductions.read";
61
+ "reproductions.roster": "reproductions.roster";
62
+ "simulate.start": "simulate.start";
63
+ "view.render": "view.render";
64
+ }>;
65
+ export type DevVerb = z.infer<typeof DevVerbSchema>;
66
+ /**
67
+ * Why the call is over. Who hung up, what failed before anybody could, drained: the platform took
68
+ * the worker down (a deploy, a stop) with the call still on it, or app_detached: the app holding
69
+ * the agent closed its socket mid-call, so nothing was rendering the prompt or answering a tool —
70
+ * both are nobody's fault and neither is an error.
71
+ */
72
+ export declare const EndReasonSchema: z.ZodEnum<{
73
+ agent_hung_up: "agent_hung_up";
74
+ app_detached: "app_detached";
75
+ busy: "busy";
76
+ caller_hung_up: "caller_hung_up";
77
+ dial_failed: "dial_failed";
78
+ drained: "drained";
79
+ error: "error";
80
+ no_answer: "no_answer";
81
+ supervisor_ended: "supervisor_ended";
82
+ timeout: "timeout";
83
+ transferred: "transferred";
84
+ }>;
85
+ /** Whose action ended the call. platform covers timeouts, errors and a drained worker. */
86
+ export declare const EndedBySchema: z.ZodEnum<{
87
+ agent: "agent";
88
+ caller: "caller";
89
+ platform: "platform";
90
+ supervisor: "supervisor";
91
+ }>;
92
+ /**
93
+ * What one judge answered about a finished call. Held: the rule held. Broken: it did not, and the
94
+ * reason names the evidence. Deferred: the judge was asked and could not settle it. Skipped:
95
+ * nobody asked it — no model was reachable inside the call's judging budget.
96
+ */
97
+ export declare const ScoreVerdictSchema: z.ZodEnum<{
98
+ broken: "broken";
99
+ deferred: "deferred";
100
+ held: "held";
101
+ skipped: "skipped";
102
+ }>;
103
+ /**
104
+ * Cold: the caller is sent on with a REFER on their SIP leg and the call ends here. Warm: the
105
+ * number is dialled into the call's own room, the agent stays on the line until the other side
106
+ * answers and then falls silent; the call ends when either of them hangs up.
107
+ */
108
+ export declare const TransferModeSchema: z.ZodEnum<{
109
+ cold: "cold";
110
+ warm: "warm";
111
+ }>;
112
+ /**
113
+ * Which region of the prompt a block lives in: static, before the history, cached by the provider;
114
+ * or dynamic, after the history, replaced every turn. The append-only history in between is never
115
+ * written by the app.
116
+ */
117
+ export declare const PromptRegionSchema: z.ZodEnum<{
118
+ dynamic: "dynamic";
119
+ static: "static";
120
+ }>;
121
+ export type PromptRegion = z.infer<typeof PromptRegionSchema>;
122
+ /**
123
+ * How the knowledge base reaches the model: retrieved, the platform runs search itself when the
124
+ * caller's turn ends; or tool, the model calls search when it decides to. Either way the chunks
125
+ * arrive as a tool result.
126
+ */
127
+ export declare const DocsModeSchema: z.ZodEnum<{
128
+ retrieved: "retrieved";
129
+ tool: "tool";
130
+ }>;
131
+ /**
132
+ * One named block of the prompt and the region it lives in. The default layout, when an agent
133
+ * declares none, is identity, knowledge and tools (static), then the history, then view (dynamic).
134
+ * A block's text is written per call with prompt.set.
135
+ */
136
+ export declare const PromptBlockSpecSchema: z.ZodObject<{
137
+ name: z.ZodString;
138
+ region: z.ZodEnum<{
139
+ dynamic: "dynamic";
140
+ static: "static";
141
+ }>;
142
+ }, z.core.$strict>;
143
+ export type PromptBlockSpec = z.infer<typeof PromptBlockSpecSchema>;
144
+ /**
145
+ * What the platform believes the person on the line is doing right now. The states are the
146
+ * session's own.
147
+ */
148
+ export declare const UserStateSchema: z.ZodEnum<{
149
+ away: "away";
150
+ listening: "listening";
151
+ speaking: "speaking";
152
+ }>;
153
+ /**
154
+ * What the agent is doing right now, in the session's own words: warming up, waiting, hearing the
155
+ * caller, generating, or playing audio.
156
+ */
157
+ export declare const AgentStateSchema: z.ZodEnum<{
158
+ idle: "idle";
159
+ initializing: "initializing";
160
+ listening: "listening";
161
+ speaking: "speaking";
162
+ thinking: "thinking";
163
+ }>;
164
+ /**
165
+ * Who a participant is to the call: the person the agent serves (over SIP or the widget), the
166
+ * agent itself, a supervisor who took a seat in the room, a listener who only hears, or a second
167
+ * SIP leg that room.invite brought in.
168
+ */
169
+ export declare const ParticipantKindSchema: z.ZodEnum<{
170
+ agent: "agent";
171
+ caller: "caller";
172
+ listener: "listener";
173
+ sip: "sip";
174
+ supervisor: "supervisor";
175
+ }>;
176
+ /** What a track carries: a microphone's audio, a camera's video, or a screen share. */
177
+ export declare const TrackKindSchema: z.ZodEnum<{
178
+ audio: "audio";
179
+ screen: "screen";
180
+ video: "video";
181
+ }>;
182
+ /** Where a track comes from, as livekit's TrackSource names it, in lower case. */
183
+ export declare const TrackSourceSchema: z.ZodEnum<{
184
+ camera: "camera";
185
+ microphone: "microphone";
186
+ screen_share: "screen_share";
187
+ screen_share_audio: "screen_share_audio";
188
+ unknown: "unknown";
189
+ }>;
190
+ /**
191
+ * Where an outside fact came from: the tenant's backend over the app socket (app), or a
192
+ * participant's browser over the DataChannel (participant).
193
+ */
194
+ export declare const EventSourceSchema: z.ZodEnum<{
195
+ app: "app";
196
+ participant: "participant";
197
+ }>;
198
+ /**
199
+ * Who may see a field of the app's state: everyone in the call (public), the tenant's own readers
200
+ * (tenant, the default for a field never declared), or nobody without masking (pii).
201
+ */
202
+ export declare const VisibilitySchema: z.ZodEnum<{
203
+ pii: "pii";
204
+ public: "public";
205
+ tenant: "tenant";
206
+ }>;
207
+ /**
208
+ * Which projection a sink applies before a state or an entry leaves the platform: public for a
209
+ * participant reading its own call, tenant for the tenant's readers. The contract is
210
+ * docs/protocol/projections.md; a client never applies one.
211
+ */
212
+ export declare const ProjectionSchema: z.ZodEnum<{
213
+ public: "public";
214
+ tenant: "tenant";
215
+ }>;
216
+ /**
217
+ * Who is on the line, as far as the platform knows. Everything is optional: a web visitor may be
218
+ * nobody yet.
219
+ */
220
+ export declare const ContactSchema: z.ZodObject<{
221
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
222
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
223
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
224
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ external_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
+ }, z.core.$strict>;
227
+ export type Contact = z.infer<typeof ContactSchema>;
228
+ /**
229
+ * One door to an agent: a channel and, for phone and WhatsApp, the number that answers. A number
230
+ * is a route, never an agent.
231
+ */
232
+ export declare const RouteSchema: z.ZodObject<{
233
+ channel: z.ZodEnum<{
234
+ phone: "phone";
235
+ web: "web";
236
+ whatsapp: "whatsapp";
237
+ }>;
238
+ number: z.ZodNullable<z.ZodString>;
239
+ label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
240
+ }, z.core.$strict>;
241
+ export type Route = z.infer<typeof RouteSchema>;
242
+ /** The human who sent a supervise verb, as the token that let them in names them. */
243
+ export declare const SupervisorSchema: z.ZodObject<{
244
+ id: z.ZodString;
245
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
246
+ }, z.core.$strict>;
247
+ /**
248
+ * What the app declares about one tool: the contract the model sees and the rules the platform
249
+ * enforces before running it.
250
+ */
251
+ export declare const ToolSpecSchema: z.ZodObject<{
252
+ name: z.ZodString;
253
+ description: z.ZodString;
254
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
255
+ side_effect: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
256
+ irreversible: "irreversible";
257
+ read: "read";
258
+ write: "write";
259
+ }>>>;
260
+ confirm: z.ZodOptional<z.ZodNullable<z.ZodString>>;
261
+ pii: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
262
+ timeout_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
263
+ }, z.core.$strict>;
264
+ export type ToolSpec = z.infer<typeof ToolSpecSchema>;
265
+ /**
266
+ * What came back from running a tool in the app's process. Either an output or an error, never
267
+ * both.
268
+ */
269
+ export declare const ToolResultSchema: z.ZodObject<{
270
+ call_id: z.ZodString;
271
+ name: z.ZodString;
272
+ output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
273
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
274
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
275
+ duration_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
276
+ }, z.core.$strict>;
277
+ export type ToolResult = z.infer<typeof ToolResultSchema>;
278
+ /**
279
+ * One thing remembered about a contact: a sentence, where it came from, and how well it matched
280
+ * when recalled.
281
+ */
282
+ export declare const MemoryFactSchema: z.ZodObject<{
283
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
+ text: z.ZodString;
285
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
286
+ score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
287
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
288
+ }, z.core.$strict>;
289
+ /**
290
+ * One operation against the contact's memory: a recall during the turn, a remember at hangup, or a
291
+ * forget on request.
292
+ */
293
+ export declare const MemoryOpSchema: z.ZodObject<{
294
+ op: z.ZodEnum<{
295
+ forget: "forget";
296
+ recall: "recall";
297
+ remember: "remember";
298
+ }>;
299
+ contact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
+ query: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
+ facts: z.ZodArray<z.ZodObject<{
302
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
303
+ text: z.ZodString;
304
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
305
+ score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
306
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
307
+ }, z.core.$strict>>;
308
+ took_ms: z.ZodNumber;
309
+ }, z.core.$strict>;
310
+ /** One chunk of the knowledge base that retrieval put in front of the model for this turn. */
311
+ export declare const DocSourceSchema: z.ZodObject<{
312
+ id: z.ZodString;
313
+ base: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
+ path: z.ZodString;
315
+ heading: z.ZodOptional<z.ZodNullable<z.ZodString>>;
316
+ score: z.ZodNumber;
317
+ excerpt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
318
+ }, z.core.$strict>;
319
+ /** One priced line: a model, what was counted, how much, and what it came to. */
320
+ export declare const CostRowSchema: z.ZodObject<{
321
+ provider: z.ZodString;
322
+ model: z.ZodString;
323
+ unit: z.ZodEnum<{
324
+ audio_seconds: "audio_seconds";
325
+ cache_creation_tokens: "cache_creation_tokens";
326
+ cached_input_tokens: "cached_input_tokens";
327
+ characters: "characters";
328
+ input_tokens: "input_tokens";
329
+ minutes: "minutes";
330
+ output_tokens: "output_tokens";
331
+ requests: "requests";
332
+ session_seconds: "session_seconds";
333
+ }>;
334
+ quantity: z.ZodNumber;
335
+ unit_price_usd: z.ZodNumber;
336
+ usd: z.ZodNumber;
337
+ }, z.core.$strict>;
338
+ /** A usage row the price table does not know. It is listed, never priced at zero. */
339
+ export declare const UnpricedRowSchema: z.ZodObject<{
340
+ provider: z.ZodString;
341
+ model: z.ZodString;
342
+ }, z.core.$strict>;
343
+ /**
344
+ * What the call cost in provider fees, informational, in US dollars, the currency providers price
345
+ * in. The runtime never prices commercially; this is the provider's bill as best we know it.
346
+ */
347
+ export declare const CostSchema: z.ZodObject<{
348
+ usd: z.ZodNumber;
349
+ rows: z.ZodArray<z.ZodObject<{
350
+ provider: z.ZodString;
351
+ model: z.ZodString;
352
+ unit: z.ZodEnum<{
353
+ audio_seconds: "audio_seconds";
354
+ cache_creation_tokens: "cache_creation_tokens";
355
+ cached_input_tokens: "cached_input_tokens";
356
+ characters: "characters";
357
+ input_tokens: "input_tokens";
358
+ minutes: "minutes";
359
+ output_tokens: "output_tokens";
360
+ requests: "requests";
361
+ session_seconds: "session_seconds";
362
+ }>;
363
+ quantity: z.ZodNumber;
364
+ unit_price_usd: z.ZodNumber;
365
+ usd: z.ZodNumber;
366
+ }, z.core.$strict>>;
367
+ unpriced: z.ZodArray<z.ZodObject<{
368
+ provider: z.ZodString;
369
+ model: z.ZodString;
370
+ }, z.core.$strict>>;
371
+ }, z.core.$strict>;
372
+ export type Cost = z.infer<typeof CostSchema>;
373
+ //# sourceMappingURL=defs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../src/wire/defs.ts"],"names":[],"mappings":"AAAA,mGAAmG;AAEnG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;EAAuC,CAAC;AAElE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,yF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