pinecall 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.
Files changed (431) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +134 -0
  3. package/dist/agent/accepts.d.ts +32 -0
  4. package/dist/agent/accepts.d.ts.map +1 -0
  5. package/dist/agent/accepts.js +28 -0
  6. package/dist/agent/accepts.js.map +1 -0
  7. package/dist/agent/agent.d.ts +189 -0
  8. package/dist/agent/agent.d.ts.map +1 -0
  9. package/dist/agent/agent.js +262 -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 +28 -0
  14. package/dist/agent/authors.js.map +1 -0
  15. package/dist/agent/decorators.d.ts +22 -0
  16. package/dist/agent/decorators.d.ts.map +1 -0
  17. package/dist/agent/decorators.js +49 -0
  18. package/dist/agent/decorators.js.map +1 -0
  19. package/dist/agent/docstrings.d.ts +43 -0
  20. package/dist/agent/docstrings.d.ts.map +1 -0
  21. package/dist/agent/docstrings.js +311 -0
  22. package/dist/agent/docstrings.js.map +1 -0
  23. package/dist/agent/lifecycle.d.ts +29 -0
  24. package/dist/agent/lifecycle.d.ts.map +1 -0
  25. package/dist/agent/lifecycle.js +11 -0
  26. package/dist/agent/lifecycle.js.map +1 -0
  27. package/dist/agent/stages.d.ts +28 -0
  28. package/dist/agent/stages.d.ts.map +1 -0
  29. package/dist/agent/stages.js +32 -0
  30. package/dist/agent/stages.js.map +1 -0
  31. package/dist/agent/state.d.ts +43 -0
  32. package/dist/agent/state.d.ts.map +1 -0
  33. package/dist/agent/state.js +104 -0
  34. package/dist/agent/state.js.map +1 -0
  35. package/dist/agent/tools.d.ts +66 -0
  36. package/dist/agent/tools.d.ts.map +1 -0
  37. package/dist/agent/tools.js +148 -0
  38. package/dist/agent/tools.js.map +1 -0
  39. package/dist/agent/visibility.d.ts +40 -0
  40. package/dist/agent/visibility.d.ts.map +1 -0
  41. package/dist/agent/visibility.js +89 -0
  42. package/dist/agent/visibility.js.map +1 -0
  43. package/dist/call/call.d.ts +55 -0
  44. package/dist/call/call.d.ts.map +1 -0
  45. package/dist/call/call.js +108 -0
  46. package/dist/call/call.js.map +1 -0
  47. package/dist/call/history.d.ts +34 -0
  48. package/dist/call/history.d.ts.map +1 -0
  49. package/dist/call/history.js +38 -0
  50. package/dist/call/history.js.map +1 -0
  51. package/dist/call/room.d.ts +58 -0
  52. package/dist/call/room.d.ts.map +1 -0
  53. package/dist/call/room.js +68 -0
  54. package/dist/call/room.js.map +1 -0
  55. package/dist/cli/browser.d.ts +8 -0
  56. package/dist/cli/browser.d.ts.map +1 -0
  57. package/dist/cli/browser.js +27 -0
  58. package/dist/cli/browser.js.map +1 -0
  59. package/dist/cli/callbacks.d.ts +26 -0
  60. package/dist/cli/callbacks.d.ts.map +1 -0
  61. package/dist/cli/callbacks.js +68 -0
  62. package/dist/cli/callbacks.js.map +1 -0
  63. package/dist/cli/chat.d.ts +21 -0
  64. package/dist/cli/chat.d.ts.map +1 -0
  65. package/dist/cli/chat.js +214 -0
  66. package/dist/cli/chat.js.map +1 -0
  67. package/dist/cli/config.d.ts +16 -0
  68. package/dist/cli/config.d.ts.map +1 -0
  69. package/dist/cli/config.js +94 -0
  70. package/dist/cli/config.js.map +1 -0
  71. package/dist/cli/connected.d.ts +30 -0
  72. package/dist/cli/connected.d.ts.map +1 -0
  73. package/dist/cli/connected.js +32 -0
  74. package/dist/cli/connected.js.map +1 -0
  75. package/dist/cli/credentials.d.ts +41 -0
  76. package/dist/cli/credentials.d.ts.map +1 -0
  77. package/dist/cli/credentials.js +98 -0
  78. package/dist/cli/credentials.js.map +1 -0
  79. package/dist/cli/ear.d.ts +3 -0
  80. package/dist/cli/ear.d.ts.map +1 -0
  81. package/dist/cli/ear.js +59 -0
  82. package/dist/cli/ear.js.map +1 -0
  83. package/dist/cli/env.d.ts +40 -0
  84. package/dist/cli/env.d.ts.map +1 -0
  85. package/dist/cli/env.js +45 -0
  86. package/dist/cli/env.js.map +1 -0
  87. package/dist/cli/eval.d.ts +37 -0
  88. package/dist/cli/eval.d.ts.map +1 -0
  89. package/dist/cli/eval.js +83 -0
  90. package/dist/cli/eval.js.map +1 -0
  91. package/dist/cli/groups.d.ts +17 -0
  92. package/dist/cli/groups.d.ts.map +1 -0
  93. package/dist/cli/groups.js +38 -0
  94. package/dist/cli/groups.js.map +1 -0
  95. package/dist/cli/index.d.ts +16 -0
  96. package/dist/cli/index.d.ts.map +1 -0
  97. package/dist/cli/index.js +169 -0
  98. package/dist/cli/index.js.map +1 -0
  99. package/dist/cli/keys.d.ts +28 -0
  100. package/dist/cli/keys.d.ts.map +1 -0
  101. package/dist/cli/keys.js +137 -0
  102. package/dist/cli/keys.js.map +1 -0
  103. package/dist/cli/knowledge.d.ts +35 -0
  104. package/dist/cli/knowledge.d.ts.map +1 -0
  105. package/dist/cli/knowledge.js +174 -0
  106. package/dist/cli/knowledge.js.map +1 -0
  107. package/dist/cli/line.d.ts +33 -0
  108. package/dist/cli/line.d.ts.map +1 -0
  109. package/dist/cli/line.js +134 -0
  110. package/dist/cli/line.js.map +1 -0
  111. package/dist/cli/listening.d.ts +38 -0
  112. package/dist/cli/listening.d.ts.map +1 -0
  113. package/dist/cli/listening.js +124 -0
  114. package/dist/cli/listening.js.map +1 -0
  115. package/dist/cli/load.d.ts +38 -0
  116. package/dist/cli/load.d.ts.map +1 -0
  117. package/dist/cli/load.js +99 -0
  118. package/dist/cli/load.js.map +1 -0
  119. package/dist/cli/login.d.ts +30 -0
  120. package/dist/cli/login.d.ts.map +1 -0
  121. package/dist/cli/login.js +158 -0
  122. package/dist/cli/login.js.map +1 -0
  123. package/dist/cli/machine.d.ts +8 -0
  124. package/dist/cli/machine.d.ts.map +1 -0
  125. package/dist/cli/machine.js +41 -0
  126. package/dist/cli/machine.js.map +1 -0
  127. package/dist/cli/memory.d.ts +26 -0
  128. package/dist/cli/memory.d.ts.map +1 -0
  129. package/dist/cli/memory.js +148 -0
  130. package/dist/cli/memory.js.map +1 -0
  131. package/dist/cli/numbers.d.ts +25 -0
  132. package/dist/cli/numbers.d.ts.map +1 -0
  133. package/dist/cli/numbers.js +132 -0
  134. package/dist/cli/numbers.js.map +1 -0
  135. package/dist/cli/personas.d.ts +5 -0
  136. package/dist/cli/personas.d.ts.map +1 -0
  137. package/dist/cli/personas.js +94 -0
  138. package/dist/cli/personas.js.map +1 -0
  139. package/dist/cli/pipeline.d.ts +52 -0
  140. package/dist/cli/pipeline.d.ts.map +1 -0
  141. package/dist/cli/pipeline.js +184 -0
  142. package/dist/cli/pipeline.js.map +1 -0
  143. package/dist/cli/profiles.d.ts +70 -0
  144. package/dist/cli/profiles.d.ts.map +1 -0
  145. package/dist/cli/profiles.js +210 -0
  146. package/dist/cli/profiles.js.map +1 -0
  147. package/dist/cli/prompt.d.ts +20 -0
  148. package/dist/cli/prompt.d.ts.map +1 -0
  149. package/dist/cli/prompt.js +58 -0
  150. package/dist/cli/prompt.js.map +1 -0
  151. package/dist/cli/providers.d.ts +14 -0
  152. package/dist/cli/providers.d.ts.map +1 -0
  153. package/dist/cli/providers.js +116 -0
  154. package/dist/cli/providers.js.map +1 -0
  155. package/dist/cli/remember.d.ts +29 -0
  156. package/dist/cli/remember.d.ts.map +1 -0
  157. package/dist/cli/remember.js +112 -0
  158. package/dist/cli/remember.js.map +1 -0
  159. package/dist/cli/run.d.ts +20 -0
  160. package/dist/cli/run.d.ts.map +1 -0
  161. package/dist/cli/run.js +347 -0
  162. package/dist/cli/run.js.map +1 -0
  163. package/dist/cli/runs/candidate.d.ts +51 -0
  164. package/dist/cli/runs/candidate.d.ts.map +1 -0
  165. package/dist/cli/runs/candidate.js +127 -0
  166. package/dist/cli/runs/candidate.js.map +1 -0
  167. package/dist/cli/runs/drift.d.ts +75 -0
  168. package/dist/cli/runs/drift.d.ts.map +1 -0
  169. package/dist/cli/runs/drift.js +151 -0
  170. package/dist/cli/runs/drift.js.map +1 -0
  171. package/dist/cli/runs/index.d.ts +5 -0
  172. package/dist/cli/runs/index.d.ts.map +1 -0
  173. package/dist/cli/runs/index.js +99 -0
  174. package/dist/cli/runs/index.js.map +1 -0
  175. package/dist/cli/runs/suites.d.ts +16 -0
  176. package/dist/cli/runs/suites.d.ts.map +1 -0
  177. package/dist/cli/runs/suites.js +63 -0
  178. package/dist/cli/runs/suites.js.map +1 -0
  179. package/dist/cli/secret.d.ts +18 -0
  180. package/dist/cli/secret.d.ts.map +1 -0
  181. package/dist/cli/secret.js +41 -0
  182. package/dist/cli/secret.js.map +1 -0
  183. package/dist/cli/sessions.d.ts +21 -0
  184. package/dist/cli/sessions.d.ts.map +1 -0
  185. package/dist/cli/sessions.js +174 -0
  186. package/dist/cli/sessions.js.map +1 -0
  187. package/dist/cli/signup.d.ts +25 -0
  188. package/dist/cli/signup.d.ts.map +1 -0
  189. package/dist/cli/signup.js +122 -0
  190. package/dist/cli/signup.js.map +1 -0
  191. package/dist/cli/simulate.d.ts +45 -0
  192. package/dist/cli/simulate.d.ts.map +1 -0
  193. package/dist/cli/simulate.js +320 -0
  194. package/dist/cli/simulate.js.map +1 -0
  195. package/dist/cli/supervise.d.ts +18 -0
  196. package/dist/cli/supervise.d.ts.map +1 -0
  197. package/dist/cli/supervise.js +134 -0
  198. package/dist/cli/supervise.js.map +1 -0
  199. package/dist/cli/test.d.ts +12 -0
  200. package/dist/cli/test.d.ts.map +1 -0
  201. package/dist/cli/test.js +128 -0
  202. package/dist/cli/test.js.map +1 -0
  203. package/dist/cli/testing/caller.d.ts +28 -0
  204. package/dist/cli/testing/caller.d.ts.map +1 -0
  205. package/dist/cli/testing/caller.js +30 -0
  206. package/dist/cli/testing/caller.js.map +1 -0
  207. package/dist/cli/testing/gateway.d.ts +172 -0
  208. package/dist/cli/testing/gateway.d.ts.map +1 -0
  209. package/dist/cli/testing/gateway.js +96 -0
  210. package/dist/cli/testing/gateway.js.map +1 -0
  211. package/dist/cli/testing/goldens.d.ts +61 -0
  212. package/dist/cli/testing/goldens.d.ts.map +1 -0
  213. package/dist/cli/testing/goldens.js +54 -0
  214. package/dist/cli/testing/goldens.js.map +1 -0
  215. package/dist/cli/testing/latency.d.ts +15 -0
  216. package/dist/cli/testing/latency.d.ts.map +1 -0
  217. package/dist/cli/testing/latency.js +44 -0
  218. package/dist/cli/testing/latency.js.map +1 -0
  219. package/dist/cli/testing/matrix.d.ts +12 -0
  220. package/dist/cli/testing/matrix.d.ts.map +1 -0
  221. package/dist/cli/testing/matrix.js +103 -0
  222. package/dist/cli/testing/matrix.js.map +1 -0
  223. package/dist/cli/testing/progress.d.ts +26 -0
  224. package/dist/cli/testing/progress.d.ts.map +1 -0
  225. package/dist/cli/testing/progress.js +185 -0
  226. package/dist/cli/testing/progress.js.map +1 -0
  227. package/dist/cli/testing/reproduction.d.ts +19 -0
  228. package/dist/cli/testing/reproduction.d.ts.map +1 -0
  229. package/dist/cli/testing/reproduction.js +65 -0
  230. package/dist/cli/testing/reproduction.js.map +1 -0
  231. package/dist/cli/testing/score.d.ts +11 -0
  232. package/dist/cli/testing/score.d.ts.map +1 -0
  233. package/dist/cli/testing/score.js +54 -0
  234. package/dist/cli/testing/score.js.map +1 -0
  235. package/dist/cli/testing/seeding.d.ts +32 -0
  236. package/dist/cli/testing/seeding.d.ts.map +1 -0
  237. package/dist/cli/testing/seeding.js +44 -0
  238. package/dist/cli/testing/seeding.js.map +1 -0
  239. package/dist/cli/testing/suite.d.ts +40 -0
  240. package/dist/cli/testing/suite.d.ts.map +1 -0
  241. package/dist/cli/testing/suite.js +103 -0
  242. package/dist/cli/testing/suite.js.map +1 -0
  243. package/dist/cli/testing/voice.d.ts +37 -0
  244. package/dist/cli/testing/voice.d.ts.map +1 -0
  245. package/dist/cli/testing/voice.js +53 -0
  246. package/dist/cli/testing/voice.js.map +1 -0
  247. package/dist/cli/ui/admin/assets/index-C3WMXdfL.css +1 -0
  248. package/dist/cli/ui/admin/assets/index-DR1mxoAh.js +58 -0
  249. package/dist/cli/ui/admin/index.html +20 -0
  250. package/dist/cli/ui/asked.d.ts +16 -0
  251. package/dist/cli/ui/asked.d.ts.map +1 -0
  252. package/dist/cli/ui/asked.js +53 -0
  253. package/dist/cli/ui/asked.js.map +1 -0
  254. package/dist/cli/ui/browser.d.ts +10 -0
  255. package/dist/cli/ui/browser.d.ts.map +1 -0
  256. package/dist/cli/ui/browser.js +30 -0
  257. package/dist/cli/ui/browser.js.map +1 -0
  258. package/dist/cli/ui/chatting.d.ts +62 -0
  259. package/dist/cli/ui/chatting.d.ts.map +1 -0
  260. package/dist/cli/ui/chatting.js +171 -0
  261. package/dist/cli/ui/chatting.js.map +1 -0
  262. package/dist/cli/ui/console/assets/index-DCTnou52.css +1 -0
  263. package/dist/cli/ui/console/assets/index-dOcE4usU.js +99 -0
  264. package/dist/cli/ui/console/index.html +20 -0
  265. package/dist/cli/ui/console/logo-mark.png +0 -0
  266. package/dist/cli/ui/doors.d.ts +37 -0
  267. package/dist/cli/ui/doors.d.ts.map +1 -0
  268. package/dist/cli/ui/doors.js +70 -0
  269. package/dist/cli/ui/doors.js.map +1 -0
  270. package/dist/cli/ui/drifting.d.ts +23 -0
  271. package/dist/cli/ui/drifting.d.ts.map +1 -0
  272. package/dist/cli/ui/drifting.js +33 -0
  273. package/dist/cli/ui/drifting.js.map +1 -0
  274. package/dist/cli/ui/index.d.ts +15 -0
  275. package/dist/cli/ui/index.d.ts.map +1 -0
  276. package/dist/cli/ui/index.js +117 -0
  277. package/dist/cli/ui/index.js.map +1 -0
  278. package/dist/cli/ui/knowing.d.ts +36 -0
  279. package/dist/cli/ui/knowing.d.ts.map +1 -0
  280. package/dist/cli/ui/knowing.js +86 -0
  281. package/dist/cli/ui/knowing.js.map +1 -0
  282. package/dist/cli/ui/promoting.d.ts +26 -0
  283. package/dist/cli/ui/promoting.d.ts.map +1 -0
  284. package/dist/cli/ui/promoting.js +44 -0
  285. package/dist/cli/ui/promoting.js.map +1 -0
  286. package/dist/cli/ui/refusal.d.ts +18 -0
  287. package/dist/cli/ui/refusal.d.ts.map +1 -0
  288. package/dist/cli/ui/refusal.js +26 -0
  289. package/dist/cli/ui/refusal.js.map +1 -0
  290. package/dist/cli/ui/refused.d.ts +8 -0
  291. package/dist/cli/ui/refused.d.ts.map +1 -0
  292. package/dist/cli/ui/refused.js +11 -0
  293. package/dist/cli/ui/refused.js.map +1 -0
  294. package/dist/cli/ui/remembering.d.ts +38 -0
  295. package/dist/cli/ui/remembering.d.ts.map +1 -0
  296. package/dist/cli/ui/remembering.js +87 -0
  297. package/dist/cli/ui/remembering.js.map +1 -0
  298. package/dist/cli/ui/reproducing.d.ts +23 -0
  299. package/dist/cli/ui/reproducing.d.ts.map +1 -0
  300. package/dist/cli/ui/reproducing.js +52 -0
  301. package/dist/cli/ui/reproducing.js.map +1 -0
  302. package/dist/cli/ui/server.d.ts +22 -0
  303. package/dist/cli/ui/server.d.ts.map +1 -0
  304. package/dist/cli/ui/server.js +211 -0
  305. package/dist/cli/ui/server.js.map +1 -0
  306. package/dist/cli/ui/simulating.d.ts +47 -0
  307. package/dist/cli/ui/simulating.d.ts.map +1 -0
  308. package/dist/cli/ui/simulating.js +86 -0
  309. package/dist/cli/ui/simulating.js.map +1 -0
  310. package/dist/cli/ui/testing.d.ts +49 -0
  311. package/dist/cli/ui/testing.d.ts.map +1 -0
  312. package/dist/cli/ui/testing.js +104 -0
  313. package/dist/cli/ui/testing.js.map +1 -0
  314. package/dist/cli/view.d.ts +43 -0
  315. package/dist/cli/view.d.ts.map +1 -0
  316. package/dist/cli/view.js +137 -0
  317. package/dist/cli/view.js.map +1 -0
  318. package/dist/cli/whoami.d.ts +37 -0
  319. package/dist/cli/whoami.d.ts.map +1 -0
  320. package/dist/cli/whoami.js +78 -0
  321. package/dist/cli/whoami.js.map +1 -0
  322. package/dist/cli/world.d.ts +33 -0
  323. package/dist/cli/world.d.ts.map +1 -0
  324. package/dist/cli/world.js +48 -0
  325. package/dist/cli/world.js.map +1 -0
  326. package/dist/client/agent.d.ts +87 -0
  327. package/dist/client/agent.d.ts.map +1 -0
  328. package/dist/client/agent.js +209 -0
  329. package/dist/client/agent.js.map +1 -0
  330. package/dist/client/calls.d.ts +77 -0
  331. package/dist/client/calls.d.ts.map +1 -0
  332. package/dist/client/calls.js +153 -0
  333. package/dist/client/calls.js.map +1 -0
  334. package/dist/client/client.d.ts +58 -0
  335. package/dist/client/client.d.ts.map +1 -0
  336. package/dist/client/client.js +146 -0
  337. package/dist/client/client.js.map +1 -0
  338. package/dist/client/connection.d.ts +47 -0
  339. package/dist/client/connection.d.ts.map +1 -0
  340. package/dist/client/connection.js +141 -0
  341. package/dist/client/connection.js.map +1 -0
  342. package/dist/client/endpoints.d.ts +7 -0
  343. package/dist/client/endpoints.d.ts.map +1 -0
  344. package/dist/client/endpoints.js +21 -0
  345. package/dist/client/endpoints.js.map +1 -0
  346. package/dist/client/frames.d.ts +24 -0
  347. package/dist/client/frames.d.ts.map +1 -0
  348. package/dist/client/frames.js +49 -0
  349. package/dist/client/frames.js.map +1 -0
  350. package/dist/client/index.d.ts +15 -0
  351. package/dist/client/index.d.ts.map +1 -0
  352. package/dist/client/index.js +14 -0
  353. package/dist/client/index.js.map +1 -0
  354. package/dist/client/listeners.d.ts +36 -0
  355. package/dist/client/listeners.d.ts.map +1 -0
  356. package/dist/client/listeners.js +61 -0
  357. package/dist/client/listeners.js.map +1 -0
  358. package/dist/client/observe.d.ts +44 -0
  359. package/dist/client/observe.d.ts.map +1 -0
  360. package/dist/client/observe.js +122 -0
  361. package/dist/client/observe.js.map +1 -0
  362. package/dist/client/testing/gateway.d.ts +39 -0
  363. package/dist/client/testing/gateway.d.ts.map +1 -0
  364. package/dist/client/testing/gateway.js +129 -0
  365. package/dist/client/testing/gateway.js.map +1 -0
  366. package/dist/client/testing/index.d.ts +4 -0
  367. package/dist/client/testing/index.d.ts.map +1 -0
  368. package/dist/client/testing/index.js +4 -0
  369. package/dist/client/testing/index.js.map +1 -0
  370. package/dist/client/testing/log.d.ts +26 -0
  371. package/dist/client/testing/log.d.ts.map +1 -0
  372. package/dist/client/testing/log.js +111 -0
  373. package/dist/client/testing/log.js.map +1 -0
  374. package/dist/client/testing/loopback.d.ts +3 -0
  375. package/dist/client/testing/loopback.d.ts.map +1 -0
  376. package/dist/client/testing/loopback.js +3 -0
  377. package/dist/client/testing/loopback.js.map +1 -0
  378. package/dist/index.d.ts +22 -0
  379. package/dist/index.d.ts.map +1 -0
  380. package/dist/index.js +35 -0
  381. package/dist/index.js.map +1 -0
  382. package/dist/runtime/channels.d.ts +16 -0
  383. package/dist/runtime/channels.d.ts.map +1 -0
  384. package/dist/runtime/channels.js +30 -0
  385. package/dist/runtime/channels.js.map +1 -0
  386. package/dist/runtime/connect.d.ts +51 -0
  387. package/dist/runtime/connect.d.ts.map +1 -0
  388. package/dist/runtime/connect.js +284 -0
  389. package/dist/runtime/connect.js.map +1 -0
  390. package/dist/runtime/dispatch.d.ts +37 -0
  391. package/dist/runtime/dispatch.d.ts.map +1 -0
  392. package/dist/runtime/dispatch.js +52 -0
  393. package/dist/runtime/dispatch.js.map +1 -0
  394. package/dist/runtime/grounding.d.ts +15 -0
  395. package/dist/runtime/grounding.d.ts.map +1 -0
  396. package/dist/runtime/grounding.js +72 -0
  397. package/dist/runtime/grounding.js.map +1 -0
  398. package/dist/runtime/recall.d.ts +10 -0
  399. package/dist/runtime/recall.d.ts.map +1 -0
  400. package/dist/runtime/recall.js +13 -0
  401. package/dist/runtime/recall.js.map +1 -0
  402. package/dist/runtime/run-tool.d.ts +26 -0
  403. package/dist/runtime/run-tool.d.ts.map +1 -0
  404. package/dist/runtime/run-tool.js +82 -0
  405. package/dist/runtime/run-tool.js.map +1 -0
  406. package/dist/views/components.d.ts +17 -0
  407. package/dist/views/components.d.ts.map +1 -0
  408. package/dist/views/components.js +33 -0
  409. package/dist/views/components.js.map +1 -0
  410. package/dist/views/jsx-dev-runtime.d.ts +3 -0
  411. package/dist/views/jsx-dev-runtime.d.ts.map +1 -0
  412. package/dist/views/jsx-dev-runtime.js +5 -0
  413. package/dist/views/jsx-dev-runtime.js.map +1 -0
  414. package/dist/views/jsx-runtime.d.ts +49 -0
  415. package/dist/views/jsx-runtime.d.ts.map +1 -0
  416. package/dist/views/jsx-runtime.js +67 -0
  417. package/dist/views/jsx-runtime.js.map +1 -0
  418. package/dist/views/lang.d.ts +17 -0
  419. package/dist/views/lang.d.ts.map +1 -0
  420. package/dist/views/lang.js +46 -0
  421. package/dist/views/lang.js.map +1 -0
  422. package/dist/views/layout.d.ts +19 -0
  423. package/dist/views/layout.d.ts.map +1 -0
  424. package/dist/views/layout.js +62 -0
  425. package/dist/views/layout.js.map +1 -0
  426. package/dist/views/render.d.ts +19 -0
  427. package/dist/views/render.d.ts.map +1 -0
  428. package/dist/views/render.js +26 -0
  429. package/dist/views/render.js.map +1 -0
  430. package/package.json +76 -0
  431. package/tsconfig.tenant.json +24 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Pinecall
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # pinecall
2
+
3
+ Write an agent as a class. Its fields are what it remembers, its `@tool` methods are what the
4
+ model may do, its docstrings are the prompt, and its `render()` is what it says about right now.
5
+
6
+ ```tsx
7
+ export default class ClinicaNorte extends Agent {
8
+ phone = "+34910000000";
9
+ language = "es";
10
+
11
+ stage: Stages<"identify" | "choose" | "book"> = "identify";
12
+ patient?: Patient;
13
+ slot?: Slot;
14
+
15
+ /** Busca al paciente por nombre y teléfono. Pide los dos antes de llamarla. */
16
+ @tool({ stage: "identify" })
17
+ async findPatient(name: string, phone: string): Promise<Patient | null> {
18
+ this.patient = await agenda.find(name, phone);
19
+ if (this.patient) this.stage = "choose";
20
+ return this.patient;
21
+ }
22
+
23
+ /** El prompt como función del estado: lo único que cambia entre dos turnos. */
24
+ render() {
25
+ return (
26
+ <>
27
+ {this.stage === "identify" && <p>Saluda y pide nombre y teléfono.</p>}
28
+ {this.patient && <p>Hablas con {this.patient.name}, ya en la ficha.</p>}
29
+ </>
30
+ );
31
+ }
32
+ }
33
+ ```
34
+
35
+ One class, three doors: the same agent answers the web, WhatsApp and the telephone, and
36
+ remembers the customer across them. What does the real time — the audio, the rooms, the log,
37
+ the tenants — is `pinecall/runtime`, a Python distribution this package never imports and only
38
+ ever talks to over a socket.
39
+
40
+ ```
41
+ npm install pinecall
42
+ ```
43
+
44
+ ## Five minutes
45
+
46
+ ```
47
+ pnpm install nothing to build: the checkout runs from its sources
48
+ cd examples/clinica-norte
49
+ pnpm exec pinecall chat the agent in this terminal, and a prompt against it
50
+ pnpm exec pinecall prompt --state test/prompts/states.json the exact prompt a state produces
51
+ pnpm exec pinecall run the app: the process you deploy
52
+ pnpm exec pinecall knowledge push ./knowledge/docs to the gateway, under the agent's name
53
+ pnpm exec pinecall test ring 1: the goldens, through the app in this process
54
+ `run` prints the console's URL: the gateway serves the page,
55
+ and the code in the URL signs this browser in, once
56
+ ```
57
+
58
+ A tenant that installed `pinecall` from npm has it on the PATH and writes `pinecall run`.
59
+
60
+ Working on the framework itself:
61
+
62
+ ```
63
+ pnpm test the framework and the console, in two vitest projects, from the sources
64
+ pnpm lint tsc over src and test, then over the console against the DOM
65
+ scripts/build what is published: dist/, and the console bundle inside it
66
+ scripts/check build, then lint, then test — what CI runs
67
+ ```
68
+
69
+ `package.json` exports point at `src/`, and `publishConfig` swaps them for `dist/` at publish
70
+ time. So a checkout — this one, and every example in it — imports the framework's sources
71
+ through `node_modules` like any package, and there is no build between a change and a test.
72
+
73
+ ## The map
74
+
75
+ `src/` is the package. Six directories, and the import table in `test/the-imports.test.ts` is
76
+ what keeps them apart — a directory earns its place there by having a line. What each one is,
77
+ file by file, is [ARCHITECTURE.md](ARCHITECTURE.md).
78
+
79
+ | directory | what it is |
80
+ |---|---|
81
+ | `agent/` | the class a tenant extends: the Proxy, `@tool`, `@render`, `@state`, the stages, the hooks |
82
+ | `views/` | the JSX-to-text runtime, and the prompt as named blocks in two regions |
83
+ | `call/` | the live call as a value: the room, the turns, the verbs. Reduced from entries |
84
+ | `client/` | `pinecall/client` — the socket, and nothing above it. Knows only the wire |
85
+ | `runtime/` | the bridge: what the class does, become what the wire sees |
86
+ | `cli/` | `pinecall <verb>`, and under `cli/ui/console/` the page one of them serves |
87
+
88
+ Beside it:
89
+
90
+ | | |
91
+ |---|---|
92
+ | `examples/` | `clinica-norte` and `tienda-sur`: two tenants, written as a customer writes one |
93
+ | `test/` | mirrors `src/`, plus the three that pin the shape: the tree, the imports, the surface |
94
+
95
+ ## The three doors out of this package
96
+
97
+ - `pinecall` — the framework: the class, the JSX-to-text runtime, the call, and `mount()`.
98
+ - `pinecall/client` — the socket alone, for an app that decides for itself what to answer.
99
+ - `pinecall/tsconfig.tenant.json` — the compiler flags an agent needs, so a tenant writes none.
100
+
101
+ `test/index.test.ts` and `test/client/index.test.ts` pin the first two by name. Adding an export
102
+ means editing a list on purpose, which is the point.
103
+
104
+ ## Where the rest is
105
+
106
+ | | |
107
+ |---|---|
108
+ | [ARCHITECTURE.md](ARCHITECTURE.md) | what this package is, file by file: the entities, the bridge, the CLI, the console, the import table, and where LiveKit is and is not |
109
+ | the runtime's `docs/from-zero.md` | **self-hosting**: a runtime of your own, from nothing, through to this clinic answering — every command run, every output what came back |
110
+ | [docs/tutorial.md](docs/tutorial.md) | from an empty directory to an agent that answers from your documents and remembers who called |
111
+ | [docs/writing-an-agent.md](docs/writing-an-agent.md) | the class: state, tools, stages, channels, knowledge · docs · memory, hooks, events |
112
+ | [docs/the-prompt.md](docs/the-prompt.md) | the prompt: named blocks in two regions, `render()`, where what a lookup found lands, and where a rule belongs |
113
+ | [docs/testing-an-agent.md](docs/testing-an-agent.md) | the five rings: unit tests, goldens, personas, one call replayed, the score every call gets |
114
+ | [docs/testing-memory-and-knowledge.md](docs/testing-memory-and-knowledge.md) | memory's own goldens, the index's, and why a call has no retrieval score |
115
+ | [docs/the-cli.md](docs/the-cli.md) | every verb, what it needs, and where its key comes from |
116
+ | [docs/worlds-and-teams.md](docs/worlds-and-teams.md) | from the sign-up to the deploy: the two worlds, what is yours and what is the org's, the team and its seats |
117
+ | [CHANGELOG.md](CHANGELOG.md) · [CLAUDE.md](CLAUDE.md) | what changed · the working agreement |
118
+
119
+ ## The wire
120
+
121
+ `@pinecall/protocol` is generated from JSON Schema in `pinecall/protocol` and committed there,
122
+ so nothing here runs a generator. `pnpm-workspace.yaml` names that checkout as a workspace
123
+ package until it is published, and that package exports its sources the same way. The golden call log comes from the same package, which is how a
124
+ log folded here and a log folded in Python are proved to be the same log.
125
+
126
+ ## License
127
+
128
+ [Apache-2.0](LICENSE). Use it, change it, run it in production, sell what you build with it —
129
+ commercially or not, on your own box or somebody else's. The licence carries an explicit patent
130
+ grant, which is why it is the one this stack uses (LiveKit's is the same). There is no NOTICE
131
+ file, so nothing has to be reproduced downstream beyond the licence itself, and there is no CLA:
132
+ a patch is yours and stays under the same terms.
133
+
134
+ `pinecall` on npm, `pinecall/client` beside it. `@pinecall/protocol` is Apache-2.0 too.
@@ -0,0 +1,32 @@
1
+ /** `static events`: the outside facts this class accepts, and from whom. */
2
+ /** Where an outside fact came from: the tenant's backend, or a participant's browser. */
3
+ export type EventSource = "app" | "participant";
4
+ /** One event the class accepts. `from` is who may send it; nobody else ever reaches the hook. */
5
+ export interface EventDecl {
6
+ from: EventSource[];
7
+ }
8
+ /** The class's declaration, as the tenant writes it: `{ "cart.changed": { from: ["app"] } }`. */
9
+ export type EventDeclarations = Record<string, EventDecl>;
10
+ /** One declaration in the shape AgentConfig.events carries it. */
11
+ export interface EventSpec {
12
+ name: string;
13
+ from: EventSource[];
14
+ }
15
+ /** What arrived with an event: who sent it, which participant if any, and its place in the log. */
16
+ export interface EventMeta {
17
+ source: EventSource;
18
+ identity?: string;
19
+ seq: number;
20
+ }
21
+ /**
22
+ * Every event this class declares, parents first — a subclass adding one keeps the parent's, and
23
+ * redeclaring a name replaces it whole rather than merging two lists of senders.
24
+ */
25
+ export declare function eventsOf(ctor: Function): EventSpec[];
26
+ /**
27
+ * Whether this class accepts `name` from `source`. The gateway asks the same question before the
28
+ * event touches the log; the runtime asks it again because a log can be replayed and a hook that
29
+ * runs on an undeclared name is a hook the tenant never agreed to.
30
+ */
31
+ export declare function accepts(ctor: Function, name: string, source: EventSource): boolean;
32
+ //# sourceMappingURL=accepts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accepts.d.ts","sourceRoot":"","sources":["../../src/agent/accepts.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,yFAAyF;AACzF,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,aAAa,CAAC;AAEhD,iGAAiG;AACjG,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,WAAW,EAAE,CAAC;CACrB;AAED,iGAAiG;AACjG,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE1D,kEAAkE;AAClE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,EAAE,CAAC;CACrB;AAED,mGAAmG;AACnG,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,CAWpD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAGlF"}
@@ -0,0 +1,28 @@
1
+ /** `static events`: the outside facts this class accepts, and from whom. */
2
+ /**
3
+ * Every event this class declares, parents first — a subclass adding one keeps the parent's, and
4
+ * redeclaring a name replaces it whole rather than merging two lists of senders.
5
+ */
6
+ export function eventsOf(ctor) {
7
+ const merged = new Map();
8
+ const chain = [];
9
+ for (let step = ctor; typeof step === "function"; step = Object.getPrototypeOf(step)) {
10
+ chain.unshift(step);
11
+ }
12
+ for (const step of chain) {
13
+ const own = Object.getOwnPropertyDescriptor(step, "events")?.value;
14
+ for (const [name, decl] of Object.entries(own ?? {}))
15
+ merged.set(name, [...decl.from]);
16
+ }
17
+ return [...merged].map(([name, from]) => ({ name, from }));
18
+ }
19
+ /**
20
+ * Whether this class accepts `name` from `source`. The gateway asks the same question before the
21
+ * event touches the log; the runtime asks it again because a log can be replayed and a hook that
22
+ * runs on an undeclared name is a hook the tenant never agreed to.
23
+ */
24
+ export function accepts(ctor, name, source) {
25
+ const declared = eventsOf(ctor).find((spec) => spec.name === name);
26
+ return declared !== undefined && declared.from.includes(source);
27
+ }
28
+ //# sourceMappingURL=accepts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accepts.js","sourceRoot":"","sources":["../../src/agent/accepts.ts"],"names":[],"mappings":"AAAA,4EAA4E;AA0B5E;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAc;IACrC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;IAChD,MAAM,KAAK,GAAe,EAAE,CAAC;IAC7B,KAAK,IAAI,IAAI,GAAoB,IAAI,EAAE,OAAO,IAAI,KAAK,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAoB,EAAE,CAAC;QACzH,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,KAAsC,CAAC;QACpG,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,IAAc,EAAE,IAAY,EAAE,MAAmB;IACvE,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACnE,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,189 @@
1
+ /** The Agent base class: its fields are the state, and every assignment is a change with an author. */
2
+ import type { DocsMode } from "@pinecall/protocol";
3
+ import { type ToolSpec } from "./tools.js";
4
+ import type { Child } from "../views/jsx-runtime.js";
5
+ import type { CallWorld } from "../call/call.js";
6
+ import type { EventDeclarations, EventMeta } from "./accepts.js";
7
+ import { type Visibility } from "./visibility.js";
8
+ import type { Call, MemoryOp } from "./lifecycle.js";
9
+ import { type LastCall, type Snapshot } from "./state.js";
10
+ export declare const CONFIG_FIELDS: readonly ["phone", "whatsapp", "web", "voice", "greeting", "says", "hears", "llm", "language", "knowledge", "docs", "memory", "hangup"];
11
+ /** One field assignment, as the log and the console read it. */
12
+ export interface Change {
13
+ seq: number;
14
+ field: string;
15
+ prev: unknown;
16
+ next: unknown;
17
+ author: string;
18
+ at: number;
19
+ }
20
+ export type ChangeListener = (change: Change) => void;
21
+ /** One named fact the agent put in the call's log. */
22
+ export interface LogEntry {
23
+ seq: number;
24
+ name: string;
25
+ data?: unknown;
26
+ at: number;
27
+ }
28
+ export type LogListener = (entry: LogEntry) => void;
29
+ /** One outside fact, as an in-process observer reads it after the hook has had it. */
30
+ export interface EventHeard {
31
+ name: string;
32
+ data: Record<string, unknown>;
33
+ meta: EventMeta;
34
+ }
35
+ export type EventListener = (heard: EventHeard) => void;
36
+ /**
37
+ * What `docs` says: the knowledge base the agent answers from, by the name it was pushed under
38
+ * (`pinecall knowledge push --base <name>`), and how its chunks reach the model. The bare string
39
+ * form `docs = "clinica-norte"` is the base alone, with every other setting the runtime's.
40
+ */
41
+ export interface DocsDeclaration {
42
+ base: string;
43
+ mode?: DocsMode;
44
+ k?: number;
45
+ minScore?: number;
46
+ }
47
+ /**
48
+ * What `greeting` says: how the agent opens a call, before the caller has said anything. Exactly
49
+ * one of the two, because there are only two ways to open one — `say` are the words themselves,
50
+ * read out as written, and `reply` is what the model is told before it finds its own. The bare
51
+ * string form `greeting = "Clínica Norte, buenos días."` is the words. A class that declares
52
+ * nothing waits for the caller.
53
+ */
54
+ export interface GreetingDeclaration {
55
+ say?: string;
56
+ reply?: string;
57
+ allowInterruptions?: boolean;
58
+ }
59
+ /**
60
+ * What `hangup` says: that the model may end the call itself, and when, in your own words. A class
61
+ * that declares nothing cannot hang up — only the caller and a supervisor end a call. The tool is
62
+ * livekit's own `end_call`, and it is hidden while the agent is greeting.
63
+ */
64
+ export interface HangupDeclaration {
65
+ when?: string;
66
+ }
67
+ /** What `memory` says: what to keep about a contact across calls, in the tenant's words, and what never to. */
68
+ export interface MemoryDeclaration {
69
+ remember?: string[];
70
+ forget?: string[];
71
+ }
72
+ /** Everything the framework knows about one live agent, kept off the instance's own fields. */
73
+ export interface Internals {
74
+ changes: Change[];
75
+ log: LogEntry[];
76
+ logListeners: Set<LogListener>;
77
+ listeners: Set<ChangeListener>;
78
+ eventListeners: Set<EventListener>;
79
+ seq: number;
80
+ sealed: boolean;
81
+ target: object;
82
+ /** The call this instance is serving, set by the bridge at start() and never by the app. */
83
+ call: CallWorld | null;
84
+ /** Where `last(contact)` reads from: `mount({ last })`, per mounted agent and never a global. */
85
+ last: LastCall | null;
86
+ /** What memory has recalled about this caller so far, as `remembers(text)` reads it. Per call. */
87
+ recalled: string[];
88
+ }
89
+ /**
90
+ * The base every app agent extends. The constructor hands back a Proxy, so a plain
91
+ * `this.patient = row` inside a tool is the whole state API: one change, one author, one seq.
92
+ */
93
+ export declare class Agent {
94
+ constructor();
95
+ /** The class docstring, when the app prefers to say it out loud instead of in a JSDoc. */
96
+ static doc?: string;
97
+ /** The outside facts this class accepts, and from whom: `static events = {...}`. */
98
+ static events?: EventDeclarations;
99
+ /** Who may see a field, for a class that would rather write a map than a `@state`. */
100
+ static visibility?: Record<string, Visibility>;
101
+ /** What this agent is, as the model reads it: the class's own docstring. */
102
+ doc(): string | undefined;
103
+ /**
104
+ * The prompt as a function of the state: what to do about THIS turn, in the class's own words.
105
+ * It is the whole dynamic region and the last thing the model reads. The base renders nothing,
106
+ * so a class that says nothing about the turn sends an empty block.
107
+ */
108
+ render(): Child;
109
+ /**
110
+ * Whether memory has already told this call something about the caller under those words — the
111
+ * word a fact was filed under, or the fact itself. The runtime supplies the facts; before it has
112
+ * recalled anything this answers false, which is exactly what a caller nobody has met looks like.
113
+ */
114
+ remembers(text: string): boolean;
115
+ /** Every tool this agent declares, whether or not the current state shows it. */
116
+ tools(): ToolSpec[];
117
+ /** The tools a model may call right now: the ones whose `when(state)` holds. */
118
+ visibleTools(): ToolSpec[];
119
+ /** Drop the change log and keep one sentence in its place; the state itself stays. */
120
+ collapse(summary: string): void;
121
+ /** Put the agent back to a snapshot — the move `onCall` makes when a caller comes back. */
122
+ restore(state: Snapshot): void;
123
+ /**
124
+ * Start the agent in the state a case describes: the fields it names, written over the ones the
125
+ * agent already has — on a fresh instance, the ones the class gave itself. A goldens case names
126
+ * what it is about and nothing else, so `restore` is the wrong door for it: a snapshot is a
127
+ * WHOLE state, and restoring one clears every field it leaves out.
128
+ */
129
+ startIn(state: Snapshot): void;
130
+ /** What this contact left behind last time. Wired per mount: `mount(Class, { pc, last })`. */
131
+ last(contact: string): Promise<Snapshot | null>;
132
+ /** Put a named fact in the call's log, for the console and for whatever reads it after. */
133
+ log(name: string, data?: unknown): void;
134
+ /**
135
+ * The call being served right now. It is a getter on the base class, not a field, so it never
136
+ * looks like state and never reaches a snapshot; a class that declares its own `call` field is
137
+ * refused at the first write, because there is only one thing that name can mean here.
138
+ */
139
+ get call(): CallWorld;
140
+ /** Say this, word for word, now. Resolves true when the turn it lands as arrived. */
141
+ say(text: string, options?: {
142
+ allowInterruptions?: boolean;
143
+ }): Promise<boolean>;
144
+ /** Make the model speak now, guided by words the caller never hears. Resolves like `say`. */
145
+ reply(instructions: string, options?: {
146
+ allowInterruptions?: boolean;
147
+ }): Promise<boolean>;
148
+ /** Watch this agent from inside the tenant's own process: every state change, or every event. */
149
+ on(type: "state", listener: ChangeListener): () => void;
150
+ on(type: "event", listener: EventListener): () => void;
151
+ /** An outside fact the class declared arrived. Override it; writes here are authored by it. */
152
+ onEvent(_name: string, _data: Record<string, unknown>, _meta: EventMeta): unknown;
153
+ /** A call started. Override it; assigning state here is authored by the hook, not by nobody. */
154
+ onCall(_call: Call): unknown;
155
+ /** The call ended. Override it to write anything the call is worth writing. */
156
+ onEnd(_call: Call): unknown;
157
+ /** Memory was written. Override it to send the ops wherever the tenant keeps them. */
158
+ onMemory(_ops: MemoryOp[], _call: Call): unknown;
159
+ }
160
+ /** The framework's bookkeeping for one agent, or a clear error if this is not an agent. */
161
+ export declare function internalsOf(agent: object): Internals;
162
+ /**
163
+ * Close the declaration and start recording. Everything assigned before this — the field
164
+ * initializers that give the state its shape — is the baseline, not a change.
165
+ */
166
+ export declare function seal<T extends object>(agent: T): T;
167
+ /** Every change this agent has recorded, oldest first. */
168
+ export declare function changes(agent: object): readonly Change[];
169
+ /** Hear every field assignment as it happens; the returned function stops listening. */
170
+ export declare function onChange(agent: object, listener: ChangeListener): () => void;
171
+ /** Everything this agent logged, oldest first. */
172
+ export declare function logOf(agent: object): readonly LogEntry[];
173
+ /** Hear every logged fact as it happens; the returned function stops listening. */
174
+ export declare function onLog(agent: object, listener: LogListener): () => void;
175
+ /** Whether a name is one of CONFIG_FIELDS rather than a piece of state. */
176
+ export declare function isConfigField(name: string): boolean;
177
+ /** Hand this instance the store its `last(contact)` reads. The bridge does this at start(). */
178
+ export declare function setLast(agent: object, source: LastCall | null): void;
179
+ /** Hand this instance the call it is serving. The bridge does this once, at start(). */
180
+ export declare function setCall(agent: object, call: CallWorld | null): void;
181
+ /**
182
+ * Hand this instance what memory has recalled about the caller: every fact, and the word it was
183
+ * filed under. The bridge does this from the call's own `memory.ops` entries, so `remembers(text)`
184
+ * answers with what the runtime actually found and never with a guess.
185
+ */
186
+ export declare function recalled(agent: object, words: readonly string[]): void;
187
+ /** Tell the in-process observers about an event the hook has just been given. */
188
+ export declare function emitEvent(agent: object, heard: EventHeard): void;
189
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/agent/agent.ts"],"names":[],"mappings":"AAAA,uGAAuG;AAIvG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAA+B,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKvF,eAAO,MAAM,aAAa,YACxB,OA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