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
@@ -0,0 +1,128 @@
1
+ /** `pinecall test [paths]`: the goldens, through the app this terminal is holding, scored by the runtime. */
2
+ import { existsSync, watch } from "node:fs";
3
+ import { parseArgs } from "node:util";
4
+ import { Pinecall } from "../client/index.js";
5
+ import { modelOf } from "../runtime/connect.js";
6
+ import { theDoor } from "./env.js";
7
+ import { load } from "./load.js";
8
+ import { GOLDENS, goldensIn, matching, NO_GOLDENS } from "./testing/goldens.js";
9
+ import { mountedForASuite, ranSuite } from "./testing/suite.js";
10
+ const USAGE = "usage: pinecall test [paths] [--file agent.tsx] [--model m]… [--grep x] [--watch] [--json]\n" +
11
+ " pinecall test --voice [--background-noise dB] [--packet-loss 0.05]\n";
12
+ export const group = {
13
+ purpose: "the goldens, run through the app in this terminal's own process",
14
+ usage: `${USAGE}
15
+ Ring 1: every golden of test/goldens through the class this terminal holds, scored by the
16
+ gateway's judges, printed as a matrix. Exits 1 when a golden did not hold, and writes every
17
+ broken one to .pinecall/evals/<run>/ with the requests the model answered.
18
+
19
+ [paths] files or directories of goldens; the whole of test/goldens when none
20
+ --file agent.tsx which class to mount, when the directory holds more than one
21
+ --model m a column of the matrix: vendor/model, repeatable
22
+ --grep x only the goldens whose name matches
23
+ --watch run again whenever a file changes
24
+ --json the run as one JSON document instead of the matrix
25
+ --voice ring 2: the same goldens said out loud on a real line
26
+ --background-noise dB under the caller, on a spoken run: a television behind them
27
+ --packet-loss the share of the caller's packets that never arrive, 0 to 1`,
28
+ run,
29
+ };
30
+ // Ring 2: the same goldens, said out loud. Only the three fields a spoken run adds travel — a
31
+ // written run must not carry a `voice: false` that reads as a decision somebody made.
32
+ function aLine(values) {
33
+ if (values.voice !== true)
34
+ return {};
35
+ const noise = numberOf(values["background-noise"]);
36
+ const loss = numberOf(values["packet-loss"]);
37
+ return {
38
+ voice: true,
39
+ ...(noise === undefined ? {} : { interferer_db: noise }),
40
+ ...(loss === undefined ? {} : { packet_loss: loss }),
41
+ };
42
+ }
43
+ /** A flag that must be a number to mean anything: anything else is left out rather than sent as NaN. */
44
+ function numberOf(said) {
45
+ if (said === undefined)
46
+ return undefined;
47
+ const value = Number(said);
48
+ return Number.isFinite(value) ? value : undefined;
49
+ }
50
+ // How long a change waits before the suite runs again: two saves of the same file in an editor
51
+ // are one change to a person, and a run costs real calls.
52
+ const SETTLE_MS = 150;
53
+ /**
54
+ * The class is mounted HERE, in this process, exactly as `pinecall chat` mounts it: the tenant's
55
+ * @tool bodies run against the tenant's own database and a breakpoint in one is reachable. The
56
+ * gateway drives the conversations and scores them, because the judge, the keys and the log are
57
+ * its — see docs/decisions/pinecall-test.md. The suite itself is `testing/suite.ts`, which the
58
+ * console runs too.
59
+ */
60
+ export async function run(argv, out = process.stdout) {
61
+ const { values, positionals } = parseArgs({
62
+ args: argv,
63
+ allowPositionals: true,
64
+ options: {
65
+ file: { type: "string" },
66
+ model: { type: "string", multiple: true },
67
+ grep: { type: "string" },
68
+ watch: { type: "boolean", default: false },
69
+ json: { type: "boolean", default: false },
70
+ voice: { type: "boolean", default: false },
71
+ "background-noise": { type: "string" },
72
+ "packet-loss": { type: "string" },
73
+ },
74
+ });
75
+ const door = theDoor();
76
+ if (door === undefined)
77
+ return 2;
78
+ if (positionals.length === 0 && !existsSync(GOLDENS)) {
79
+ process.stderr.write(`${NO_GOLDENS}\n${USAGE}`);
80
+ return 2;
81
+ }
82
+ const loaded = await load(values.file);
83
+ const pc = new Pinecall({ url: door.url, apiKey: door.apiKey });
84
+ const held = mountedForASuite(loaded, pc);
85
+ const models = (values.model ?? []).map(modelOf).filter((model) => model !== undefined);
86
+ try {
87
+ await pc.connect();
88
+ const suite = async () => {
89
+ const goldens = matching(await goldensIn(positionals), values.grep);
90
+ if (goldens.length === 0) {
91
+ process.stderr.write(`no golden matched${values.grep === undefined ? "" : ` --grep ${values.grep}`}\n`);
92
+ return 2;
93
+ }
94
+ return await ranSuite({ door, loaded, held, goldens, models, line: aLine(values), out, json: values.json === true });
95
+ };
96
+ const code = await suite();
97
+ if (values.watch !== true)
98
+ return code;
99
+ return await watching(positionals, suite, out);
100
+ }
101
+ finally {
102
+ pc.close();
103
+ }
104
+ }
105
+ // A change to a golden re-runs the suite; a change to the class does not, because the class is
106
+ // already imported into this process and node will not import it twice. The line says so, so that
107
+ // nobody watches a stale agent answer a fresh golden.
108
+ async function watching(paths, suite, out) {
109
+ const watched = paths.length > 0 ? paths : [GOLDENS];
110
+ out.write(`watching ${watched.join(" ")} — restart to pick up a change to the class\n`);
111
+ let running = false;
112
+ let pending;
113
+ for (const path of watched) {
114
+ watch(path, { recursive: true }, () => {
115
+ if (pending !== undefined)
116
+ clearTimeout(pending);
117
+ pending = setTimeout(() => {
118
+ if (running)
119
+ return;
120
+ running = true;
121
+ void suite().finally(() => (running = false));
122
+ }, SETTLE_MS);
123
+ });
124
+ }
125
+ // The watchers hold the process; a person ends it with the same ctrl-C that ends `run`.
126
+ return await new Promise(() => { });
127
+ }
128
+ //# sourceMappingURL=test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.js","sourceRoot":"","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L,CAAC;IACD,wFAAwF;IACxF,OAAO,MAAM,IAAI,OAAO,CAAS,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,28 @@
1
+ /** A synthetic caller: who is on the phone, what they want, and the words they use to get it. */
2
+ /**
3
+ * One persona, written by the tenant in `test/personas/<name>.ts` and default-exported.
4
+ *
5
+ * A persona is not a script: `goal` and `style` are what the model playing the caller is told it
6
+ * is, and `facts` is everything that caller knows about themselves and may state. The model
7
+ * improvises every turn from those three — see docs/decisions/simulate.md.
8
+ */
9
+ export interface Persona {
10
+ name: string;
11
+ /** What this caller is after, in one line. */
12
+ goal: string;
13
+ /** How they talk: hurried, switching into English mid-sentence, hard of hearing. */
14
+ style: string;
15
+ /** Their name, their phone, the appointment they are calling about: what they may never invent. */
16
+ facts?: Record<string, unknown>;
17
+ /** The state the call starts in, when this caller is somebody the business already knows. */
18
+ state?: Record<string, unknown>;
19
+ }
20
+ /** Where the tenant's personas live: one file per caller, beside the goldens they are run with. */
21
+ export declare const PERSONAS = "test/personas";
22
+ /** What to say when there are none: the directory, and that a persona is one file in it. */
23
+ export declare const NO_PERSONAS = "no personas at test/personas: one file per caller, default-exporting one";
24
+ /** Every persona in that directory, in the order `ls` prints them. */
25
+ export declare function personasIn(folder?: string): Promise<Persona[]>;
26
+ /** One persona by the name of its file, or undefined when nobody wrote that caller. */
27
+ export declare function personaNamed(wanted: string, folder?: string): Promise<Persona | undefined>;
28
+ //# sourceMappingURL=caller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caller.d.ts","sourceRoot":"","sources":["../../../src/cli/testing/caller.ts"],"names":[],"mappings":"AAAA,iGAAiG;AAQjG;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,mGAAmG;IACnG,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,6FAA6F;IAC7F,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,mGAAmG;AACnG,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AAExC,4FAA4F;AAC5F,eAAO,MAAM,WAAW,6EAA2E,CAAC;AAEpG,sEAAsE;AACtE,wBAAsB,UAAU,CAAC,MAAM,GAAE,MAAiB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAI9E;AAED,uFAAuF;AACvF,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAAiB,GACxB,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAE9B"}
@@ -0,0 +1,30 @@
1
+ /** A synthetic caller: who is on the phone, what they want, and the words they use to get it. */
2
+ import { readdir } from "node:fs/promises";
3
+ import { basename, extname, join, resolve } from "node:path";
4
+ import { pathToFileURL } from "node:url";
5
+ import { useTypeScript } from "../load.js";
6
+ /** Where the tenant's personas live: one file per caller, beside the goldens they are run with. */
7
+ export const PERSONAS = "test/personas";
8
+ /** What to say when there are none: the directory, and that a persona is one file in it. */
9
+ export const NO_PERSONAS = `no personas at ${PERSONAS}: one file per caller, default-exporting one`;
10
+ /** Every persona in that directory, in the order `ls` prints them. */
11
+ export async function personasIn(folder = PERSONAS) {
12
+ const names = await readdir(resolve(folder)).catch(() => []);
13
+ const files = names.filter((name) => extname(name) === ".ts").sort();
14
+ return await Promise.all(files.map((name) => personaOf(join(resolve(folder), name))));
15
+ }
16
+ /** One persona by the name of its file, or undefined when nobody wrote that caller. */
17
+ export async function personaNamed(wanted, folder = PERSONAS) {
18
+ return (await personasIn(folder)).find((persona) => persona.name === wanted);
19
+ }
20
+ /** One file's persona. The file's own name is the caller's, so a directory listing is the roster. */
21
+ async function personaOf(file) {
22
+ await useTypeScript();
23
+ const module_ = (await import(pathToFileURL(file).href));
24
+ const written = module_.default;
25
+ if (typeof written !== "object" || written === null) {
26
+ throw new Error(`${file} has no default-exported persona`);
27
+ }
28
+ return { ...written, name: basename(file, extname(file)) };
29
+ }
30
+ //# sourceMappingURL=caller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caller.js","sourceRoot":"","sources":["../../../src/cli/testing/caller.ts"],"names":[],"mappings":"AAAA,iGAAiG;AAEjG,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAqB3C,mGAAmG;AACnG,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;AAExC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,QAAQ,8CAA8C,CAAC;AAEpG,sEAAsE;AACtE,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAM,GAAW,QAAQ;IACxD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IACrE,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAc,EACd,MAAM,GAAW,QAAQ;IAEzB,OAAO,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;AAC/E,CAAC;AAED,qGAAqG;AACrG,KAAK,UAAU,SAAS,CAAC,IAAY;IACnC,MAAM,aAAa,EAAE,CAAC;IACtB,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAA0B,CAAC;IAClF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,kCAAkC,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,EAAE,GAAI,OAAmB,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,172 @@
1
+ /** The gateway's eval doors, as this CLI knocks at them: run a suite, read a run, read a log. */
2
+ import type { Camel, ModelConfig, SessionLine } from "@pinecall/protocol";
3
+ import type { Golden } from "./goldens.js";
4
+ /** What one judge answered about one golden: the number, the sentence, and what it asked. */
5
+ export interface Score {
6
+ metric: string;
7
+ score: number;
8
+ passed: boolean;
9
+ /** The judgment's own reasoning. A hard policy writes the seqs for free; a model is asked. */
10
+ reason: string;
11
+ /** The question that was answered, as livekit hangs it on every judgment it makes. */
12
+ criteria: string;
13
+ /** How many questions this judgment put to a model. Zero for a policy that answers by code. */
14
+ judge_calls: number;
15
+ }
16
+ /** One request as the provider received it: the system blocks apart, then the messages in order. */
17
+ export interface Asked {
18
+ /** One string per static block — identity, knowledge, tools — for the vendor that keeps them
19
+ * apart. Empty for a vendor whose system text travels inside `messages`. */
20
+ system: string[];
21
+ /** Every tool the request carried, as a JSON schema — the list the model actually had. */
22
+ tools: Record<string, unknown>[];
23
+ messages: Record<string, unknown>[];
24
+ }
25
+ /** One cell of the matrix: a golden under a model, every judge's answer, and the call's summary. */
26
+ export interface Cell {
27
+ model: string;
28
+ golden: string;
29
+ scores: Score[];
30
+ summary: Summary | null;
31
+ /** Every request this golden's call made, present only on a cell where something broke: the
32
+ * prompt is not in the log, and a broken golden is the one thing a person has to reproduce.
33
+ * Null when the run kept no requests — a spoken run builds them in the worker process. */
34
+ asked?: Asked[] | null;
35
+ }
36
+ /** `call.summary` as the log wrote it. Nothing here is recomputed by anybody who reads it. */
37
+ export interface Summary {
38
+ duration_s: number;
39
+ turns: number;
40
+ cost?: {
41
+ eur: number;
42
+ };
43
+ }
44
+ /** Models down one axis, goldens down the other, one judge's score in every cell. */
45
+ export interface Matrix {
46
+ models: string[];
47
+ goldens: string[];
48
+ metrics: string[];
49
+ /** How many questions judging this whole matrix put to a model. Zero is the happy path. */
50
+ judge_calls: number;
51
+ runs: Cell[];
52
+ failures: {
53
+ model: string;
54
+ golden: string;
55
+ metric: string;
56
+ }[];
57
+ }
58
+ /** One golden under one model, and the call it opened: the log a person opens to disagree. */
59
+ export interface Opened {
60
+ golden: string;
61
+ model: string;
62
+ call: string;
63
+ }
64
+ /** One run of a suite, as the runner stores it and both `test` and `runs` read it back. */
65
+ export interface EvalRun {
66
+ id: string;
67
+ agent: string;
68
+ started_at: number;
69
+ finished_at: number | null;
70
+ status: "running" | "done" | "failed";
71
+ calls: Opened[];
72
+ matrix: Matrix | null;
73
+ error: string | null;
74
+ }
75
+ /** What one POST asks for: the agent, its goldens, the models, and which app socket to use. */
76
+ export interface Wanted {
77
+ agent: string;
78
+ goldens: Golden[];
79
+ models?: Camel<ModelConfig>[];
80
+ app?: string;
81
+ /** Ring 2: the same goldens said out loud on a real line, instead of written into a text session. */
82
+ voice?: boolean;
83
+ /** How many dB under the caller's own voice an interferer sits, on a spoken run. */
84
+ interferer_db?: number;
85
+ /** The share of the caller's packets that never arrive, 0 to 1, on a spoken run. */
86
+ packet_loss?: number;
87
+ }
88
+ /** One entry of a call's log, as `GET /v1/calls/{call}/events` projects it for this reader. */
89
+ export interface Entry {
90
+ seq: number;
91
+ type: string;
92
+ data: Record<string, unknown>;
93
+ /** Which call it belongs to. The chat socket's own frames carry it; a page of one call need not. */
94
+ call?: string | null;
95
+ }
96
+ /** Where this CLI is knocking: the gateway's HTTP address and the key that opens its doors. */
97
+ export interface Door {
98
+ url: string;
99
+ apiKey: string;
100
+ }
101
+ /** Every golden through the app that is holding the agent, scored and stored, in one round trip. */
102
+ export declare function aRun(door: Door, wanted: Wanted): Promise<EvalRun>;
103
+ /** The runs this gateway has done, newest first — of one agent, or of the whole fleet. */
104
+ export declare function theRuns(door: Door, limit: number, agent?: string): Promise<EvalRun[]>;
105
+ /** One run, whole: the calls it opened while it happened, and the matrix once it finished. */
106
+ export declare function oneRun(door: Door, id: string): Promise<EvalRun>;
107
+ /** Who is on the phone, as the door that plays them needs it: no script, three declarations. */
108
+ export interface Persona {
109
+ name: string;
110
+ goal: string;
111
+ style: string;
112
+ facts?: Record<string, unknown>;
113
+ }
114
+ /** One turn of a simulated call from the caller's side: the business, or the caller themselves. */
115
+ export interface Spoken {
116
+ who: "agent" | "caller";
117
+ said: string;
118
+ }
119
+ /** What the model playing the caller answered: the line, and whether they are done talking. */
120
+ export interface Improvised {
121
+ say: string;
122
+ hangup: boolean;
123
+ }
124
+ /**
125
+ * The next thing the caller says, improvised by a model in the runtime. It runs there because
126
+ * that is the process holding the provider keys — this terminal has the persona and the call so
127
+ * far, and the door has the only thing it is missing. See docs/decisions/simulate.md.
128
+ */
129
+ export declare function theNextLine(door: Door, asking: {
130
+ persona: Persona;
131
+ heard: Spoken[];
132
+ turns_left: number;
133
+ }): Promise<Improvised>;
134
+ /** What a reader narrows a log to: how many entries, from which seq, and of which types. */
135
+ export interface Narrowed {
136
+ limit?: number;
137
+ /** Entries above this seq only. The door calls it `after`, and it is a seq, never an index. */
138
+ after?: number;
139
+ /** `types=a.b,c.d`: the log's own filter, so a reader that wants one entry is served one. */
140
+ types?: string[];
141
+ }
142
+ /** One page of a call's log as this reader narrowed it: where the seqs a failure names are read. */
143
+ export declare function entriesOf(door: Door, call: string, narrowed?: Narrowed): Promise<Entry[]>;
144
+ /** Which calls this agent handled, newest first: the list drift reads its two windows out of. */
145
+ export declare function theSessions(door: Door, agent: string, limit: number): Promise<SessionLine[]>;
146
+ /** What the gateway answered when it did not answer 2xx: the status, and its own sentence. */
147
+ /** What a gateway says about itself with no key: which runtime, and whether it opens a sign-up. */
148
+ export interface Discovered {
149
+ version: string;
150
+ cloud: boolean;
151
+ signup: boolean;
152
+ /** How short a password this gateway accepts; 0 is no rule. A card asking for one says it. */
153
+ min_password: number;
154
+ }
155
+ /**
156
+ * `GET /.well-known/pinecall`, the one door that takes no key and asks nothing of the caller.
157
+ *
158
+ * A gateway too old to answer it, or one that does not answer at all, reads as a gateway that
159
+ * opens no sign-up: guessing that way offers nothing, and the other way would walk a person
160
+ * through typing a password for a door that refuses.
161
+ */
162
+ export declare function discovered(url: string): Promise<Discovered>;
163
+ export declare class Refused extends Error {
164
+ readonly status: number;
165
+ readonly text: string;
166
+ constructor(status: number, text: string);
167
+ }
168
+ export declare function asked<T>(door: Door, path: string, sent?: {
169
+ method?: string;
170
+ body?: unknown;
171
+ }): Promise<T>;
172
+ //# sourceMappingURL=gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../src/cli/testing/gateway.ts"],"names":[],"mappings":"AAAA,iGAAiG;AAEjG,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,6FAA6F;AAC7F,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM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AM,EAAE,QAAQ,GAAE,QAAa,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAanG;AAED,iGAAiG;AACjG,wBAAsB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAIlG;AAED,8FAA8F;AAC9F,mGAAmG;AACnG,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,8FAA8F;IAC9F,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAejE;AAED,qBAAa,OAAQ,SAAQ,KAAK;IAE9B,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM;IAFvB,YACW,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAGtB;CACF;AAKD,wBAAsB,KAAK,CAAC,CAAC,EAC3B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC7C,OAAO,CAAC,CAAC,CAAC,CAYZ"}
@@ -0,0 +1,96 @@
1
+ /** The gateway's eval doors, as this CLI knocks at them: run a suite, read a run, read a log. */
2
+ /** Every golden through the app that is holding the agent, scored and stored, in one round trip. */
3
+ export async function aRun(door, wanted) {
4
+ return await asked(door, "/v1/evals/run", { method: "POST", body: wanted });
5
+ }
6
+ /** The runs this gateway has done, newest first — of one agent, or of the whole fleet. */
7
+ export async function theRuns(door, limit, agent) {
8
+ const query = new URLSearchParams({ limit: String(limit) });
9
+ if (agent !== undefined)
10
+ query.set("agent", agent);
11
+ const answered = await asked(door, `/v1/evals/runs?${query.toString()}`);
12
+ return answered.runs;
13
+ }
14
+ /** One run, whole: the calls it opened while it happened, and the matrix once it finished. */
15
+ export async function oneRun(door, id) {
16
+ return await asked(door, `/v1/evals/runs/${encodeURIComponent(id)}`);
17
+ }
18
+ /**
19
+ * The next thing the caller says, improvised by a model in the runtime. It runs there because
20
+ * that is the process holding the provider keys — this terminal has the persona and the call so
21
+ * far, and the door has the only thing it is missing. See docs/decisions/simulate.md.
22
+ */
23
+ export async function theNextLine(door, asking) {
24
+ return await asked(door, "/v1/evals/caller", { method: "POST", body: asking });
25
+ }
26
+ /** One page of a call's log as this reader narrowed it: where the seqs a failure names are read. */
27
+ export async function entriesOf(door, call, narrowed = {}) {
28
+ const query = new URLSearchParams({
29
+ after: String(narrowed.after ?? 0),
30
+ limit: String(narrowed.limit ?? 500),
31
+ });
32
+ if (narrowed.types !== undefined)
33
+ query.set("types", narrowed.types.join(","));
34
+ const answered = await asked(door, `/v1/calls/${encodeURIComponent(call)}/events?${query.toString()}`);
35
+ // 204 is the door saying the call is over and this cursor has all of it: an empty body, and an
36
+ // empty page is the honest reading of it. Every other refusal still travels as an error.
37
+ return answered?.entries ?? [];
38
+ }
39
+ /** Which calls this agent handled, newest first: the list drift reads its two windows out of. */
40
+ export async function theSessions(door, agent, limit) {
41
+ const path = `/v1/agents/${encodeURIComponent(agent)}/sessions?limit=${limit}`;
42
+ const answered = await asked(door, path);
43
+ return answered.calls;
44
+ }
45
+ /**
46
+ * `GET /.well-known/pinecall`, the one door that takes no key and asks nothing of the caller.
47
+ *
48
+ * A gateway too old to answer it, or one that does not answer at all, reads as a gateway that
49
+ * opens no sign-up: guessing that way offers nothing, and the other way would walk a person
50
+ * through typing a password for a door that refuses.
51
+ */
52
+ export async function discovered(url) {
53
+ const shut = { version: "", cloud: false, signup: false, min_password: 0 };
54
+ try {
55
+ const answer = await fetch(`${url.replace(/\/$/, "")}/.well-known/pinecall`);
56
+ if (!answer.ok)
57
+ return shut;
58
+ const said = (await answer.json());
59
+ return {
60
+ version: said.version ?? "",
61
+ cloud: said.cloud === true,
62
+ signup: said.signup === true,
63
+ min_password: said.min_password ?? 0,
64
+ };
65
+ }
66
+ catch {
67
+ return shut;
68
+ }
69
+ }
70
+ export class Refused extends Error {
71
+ status;
72
+ text;
73
+ constructor(status, text) {
74
+ super(`the gateway answered ${status}: ${text}`);
75
+ this.status = status;
76
+ this.text = text;
77
+ }
78
+ }
79
+ // One door, one fetch, one refusal: every verb that knocks here spells neither the header, the
80
+ // JSON nor the error sentence again. What the gateway refused travels as its own words, because
81
+ // "the agent is not registered" and "no ring installed" both arrive this way and both name the fix.
82
+ export async function asked(door, path, sent = {}) {
83
+ // A door that mints the first key takes none (`/v1/signup`), so an empty key sends no header
84
+ // rather than an empty Bearer: what is not held is not claimed.
85
+ const authorization = door.apiKey === "" ? {} : { authorization: `Bearer ${door.apiKey}` };
86
+ const answered = await fetch(`${door.url.replace(/\/$/, "")}${path}`, {
87
+ method: sent.method ?? "GET",
88
+ headers: { ...authorization, "content-type": "application/json" },
89
+ ...(sent.body === undefined ? {} : { body: JSON.stringify(sent.body) }),
90
+ });
91
+ const text = await answered.text();
92
+ if (!answered.ok)
93
+ throw new Refused(answered.status, text);
94
+ return (text === "" ? null : JSON.parse(text));
95
+ }
96
+ //# sourceMappingURL=gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../../src/cli/testing/gateway.ts"],"names":[],"mappings":"AAAA,iGAAiG;AA2GjG,oGAAoG;AACpG,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAU,EAAE,MAAc;IACnD,OAAO,MAAM,KAAK,CAAU,IAAI,EAAE,eAAe,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AACvF,CAAC;AAED,0FAA0F;AAC1F,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAU,EAAE,KAAa,EAAE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AK,CAAC,IAAI,CAAC,CAAM,CAAC;AACtD,CAAC"}
@@ -0,0 +1,61 @@
1
+ /** A golden read off the tenant's disk: the schema the runner takes, and nothing more. */
2
+ /** A fact from the tenant's backend, injected mid-conversation the way the app would send it. */
3
+ export interface EventStep {
4
+ /** How many of the caller's turns have been answered when it arrives. 0 is before a word. */
5
+ after_turn?: number;
6
+ name: string;
7
+ data?: Record<string, unknown>;
8
+ }
9
+ /** What a golden is accepted against: one field is one question, and one graph answers it. */
10
+ export interface Expect {
11
+ tools?: string[];
12
+ /** The mirror of `tools`: none of these ran. `not` is about words; this one is about the log. */
13
+ not_tools?: string[];
14
+ not?: string[];
15
+ says?: string[];
16
+ grounded?: boolean;
17
+ register?: "tu" | "usted";
18
+ replies?: boolean;
19
+ }
20
+ /** One conversation written down: where it starts, what is said, and what is expected of it. */
21
+ export interface Golden {
22
+ name: string;
23
+ state?: Record<string, unknown>;
24
+ input: string[];
25
+ /** What memory already holds about this caller when the call opens, in the words a fact is
26
+ * written in. A golden that seeds one asks the question memory exists for — does the agent USE
27
+ * what it remembered — and it never touches the memory table: the facts are answered to the
28
+ * `recall` tool for this call and nothing is written down. */
29
+ memory?: string[];
30
+ events?: EventStep[];
31
+ /** `YYYY-MM-DD`: the day the call is opened on. A golden that names a weekday pins the one
32
+ * it means, so it reads the same in September and in a year. Without it, the real today. */
33
+ today?: string;
34
+ expect?: Expect;
35
+ /** The call `pinecall runs promote` read this out of. Provenance: no judge ever reads it. */
36
+ promoted_from?: string;
37
+ }
38
+ /**
39
+ * Where a golden lives when nobody said. `test/` itself already holds the tenant's own vitest
40
+ * files, the `--state` cases `pinecall prompt` reads and the captured prompts, so a golden gets a
41
+ * directory of its own rather than a naming convention inside a crowded one.
42
+ */
43
+ export declare const GOLDENS = "test/goldens";
44
+ /** What to say when the default directory is not there: the path, and what belongs in it. */
45
+ export declare const NO_GOLDENS = "no goldens at test/goldens: write one, or name the file or directory to run";
46
+ /** Every golden under those paths, in the order a person would read the directory. */
47
+ export declare function goldensIn(paths: string[]): Promise<Golden[]>;
48
+ /**
49
+ * Every case under those paths, whatever shape of golden the caller reads. A file holds one case
50
+ * or a list of them, and a case that named itself keeps that name — the file's own basename is
51
+ * what the rest are called, numbered when there are several, so a report names something a person
52
+ * can grep for in their own directory. The extraction goldens are read through this too.
53
+ */
54
+ export declare function casesIn<T extends {
55
+ name?: string;
56
+ }>(paths: string[], fallback: string): Promise<T[]>;
57
+ /** The cases whose name carries that text, or all of them when nobody narrowed the run. */
58
+ export declare function matching<T extends {
59
+ name: string;
60
+ }>(cases: T[], grep: string | undefined): T[];
61
+ //# sourceMappingURL=goldens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goldens.d.ts","sourceRoot":"","sources":["../../../src/cli/testing/goldens.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAK1F,iGAAiG;AACjG,MAAM,WAAW,SAAS;IACxB,6FAA6F;IAC7F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,8FAA8F;AAC9F,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,iGAAiG;IACjG,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,gGAAgG;AAChG,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;kEAG8D;IAC9D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB;gGAC4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6FAA6F;IAC7F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,iBAAiB,CAAC;AAEtC,6FAA6F;AAC7F,eAAO,MAAM,UAAU,gFACsD,CAAC;AAE9E,sFAAsF;AACtF,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAElE;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAM1G;AAED,2FAA2F;AAC3F,wBAAgB,QAAQ,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,EAAE,CAI9F"}
@@ -0,0 +1,54 @@
1
+ /** A golden read off the tenant's disk: the schema the runner takes, and nothing more. */
2
+ import { readdir, readFile, stat } from "node:fs/promises";
3
+ import { basename, extname, join, resolve } from "node:path";
4
+ /**
5
+ * Where a golden lives when nobody said. `test/` itself already holds the tenant's own vitest
6
+ * files, the `--state` cases `pinecall prompt` reads and the captured prompts, so a golden gets a
7
+ * directory of its own rather than a naming convention inside a crowded one.
8
+ */
9
+ export const GOLDENS = "test/goldens";
10
+ /** What to say when the default directory is not there: the path, and what belongs in it. */
11
+ export const NO_GOLDENS = `no goldens at ${GOLDENS}: write one, or name the file or directory to run`;
12
+ /** Every golden under those paths, in the order a person would read the directory. */
13
+ export async function goldensIn(paths) {
14
+ return await casesIn(paths, GOLDENS);
15
+ }
16
+ /**
17
+ * Every case under those paths, whatever shape of golden the caller reads. A file holds one case
18
+ * or a list of them, and a case that named itself keeps that name — the file's own basename is
19
+ * what the rest are called, numbered when there are several, so a report names something a person
20
+ * can grep for in their own directory. The extraction goldens are read through this too.
21
+ */
22
+ export async function casesIn(paths, fallback) {
23
+ const found = [];
24
+ for (const path of paths.length > 0 ? paths : [fallback]) {
25
+ for (const file of await filesUnder(resolve(path)))
26
+ found.push(...(await casesOf(file)));
27
+ }
28
+ return found;
29
+ }
30
+ /** The cases whose name carries that text, or all of them when nobody narrowed the run. */
31
+ export function matching(cases, grep) {
32
+ if (grep === undefined)
33
+ return cases;
34
+ const wanted = grep.toLowerCase();
35
+ return cases.filter((one) => one.name.toLowerCase().includes(wanted));
36
+ }
37
+ async function casesOf(file) {
38
+ const read = JSON.parse(await readFile(file, "utf8"));
39
+ const written = Array.isArray(read) ? read : [read];
40
+ const stem = basename(file, extname(file));
41
+ return written.map((one, index) => ({
42
+ ...one,
43
+ name: one.name ?? (written.length > 1 ? `${stem} #${index + 1}` : stem),
44
+ }));
45
+ }
46
+ // A directory is read one level deep and sorted: goldens are a flat folder of files, and the order
47
+ // a run reports in should be the order `ls` prints, not the order the filesystem happens to answer.
48
+ async function filesUnder(path) {
49
+ if (!(await stat(path).catch(() => null))?.isDirectory())
50
+ return [path];
51
+ const names = await readdir(path);
52
+ return names.filter((name) => extname(name) === ".json").sort().map((name) => join(path, name));
53
+ }
54
+ //# sourceMappingURL=goldens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goldens.js","sourceRoot":"","sources":["../../../src/cli/testing/goldens.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,I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,EAAE,MAAM,CAAC,CAAY,CAAC;IACjE,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,IAAY,CAAC,CAAC,CAAC,CAAC,IAAS,CAAC,CAAC;IAClE,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAClC,GAAG,GAAG;QACN,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KACxE,CAAC,CAAC,CAAC;AACN,CAAC;AAED,mGAAmG;AACnG,oGAAoG;AACpG,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAClG,CAAC"}
@@ -0,0 +1,15 @@
1
+ /** The latency a golden was answered with: the median of every turn's own metrics entry. */
2
+ import { TURN_METRICS } from "../view.js";
3
+ import type { Entry } from "./gateway.js";
4
+ /** The three numbers a report prints per golden, in seconds, as livekit measured each turn. */
5
+ export type Medians = Partial<Record<(typeof TURN_METRICS)[number], number>>;
6
+ /**
7
+ * The medians of one call. The median and not the mean: one cold first turn would drag an average
8
+ * of four turns somewhere no caller ever waited, and the number here is meant to be the one a
9
+ * typical caller felt. Nothing is computed that the log does not already carry — a metric the
10
+ * session never measured is absent from the answer rather than reported as a zero.
11
+ */
12
+ export declare function mediansOf(entries: Entry[]): Medians;
13
+ /** The medians on one line, in the order a person reads them: the wait first, then where it went. */
14
+ export declare function latencyLine(medians: Medians): string;
15
+ //# sourceMappingURL=latency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latency.d.ts","sourceRoot":"","sources":["../../../src/cli/testing/latency.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAE5F,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,+FAA+F;AAC/F,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAOnD;AAED,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAKpD"}