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,86 @@
1
+ /** The console's own door to a simulated caller: this directory's personas, and one call started from the page. */
2
+ import { aSimulation, degradedBy, ONLY_ON_A_LINE, TURNS } from "../simulate.js";
3
+ import { NO_PERSONAS, personasIn } from "../testing/caller.js";
4
+ import { aFlag, anObject, aNumber, aString, maybeNumber } from "./asked.js";
5
+ import { Refusal } from "./refusal.js";
6
+ // The most turns the page may ask for: a persona that never hangs up would otherwise hold the
7
+ // class, and the terminal that typed `ui`, for as long as the model keeps talking.
8
+ const MOST_TURNS = 30;
9
+ // The console may be opened on any agent the gateway holds, but a simulation needs the CLASS —
10
+ // mounted in this process, as `pinecall simulate` mounts it — and the class is the one in the
11
+ // directory `pinecall run` was typed in. Another agent's page gets the sentence, not a call.
12
+ const NOT_THIS_DIRECTORY = (asked, here) => here === null
13
+ ? `no agent class in this directory: run \`pinecall run\` where ${asked}'s agent.tsx is`
14
+ : `this process runs in ${here}'s directory: to simulate ${asked}, run \`pinecall run\` there`;
15
+ const NO_CALL = "the simulation ended before a call opened";
16
+ /**
17
+ * One `Simulating` for the life of a `pinecall run`: the door it was opened with, the class of the
18
+ * directory it runs in, and where the simulation's own lines go — the terminal that typed `ui`,
19
+ * exactly as `pinecall simulate` prints them. The call itself is watched from the page, off the
20
+ * log, like any other call; nothing here keeps a second transcript.
21
+ */
22
+ export function simulatingFrom(door, agent, out, pieces = { personas: () => personasIn(), simulate: aSimulation }) {
23
+ return {
24
+ async roster() {
25
+ const personas = await pieces.personas();
26
+ return { agent, personas: personas.map(({ name, goal, style }) => ({ name, goal, style })) };
27
+ },
28
+ async start(asked) {
29
+ const wanted = parsed(asked);
30
+ if (wanted.agent !== agent)
31
+ throw new Refusal(409, NOT_THIS_DIRECTORY(wanted.agent, agent));
32
+ const degraded = degradedBy(wanted.background_noise === undefined ? undefined : String(wanted.background_noise), wanted.packet_loss === undefined ? undefined : String(wanted.packet_loss));
33
+ if (!wanted.voice && degraded !== undefined)
34
+ throw new Refusal(422, ONLY_ON_A_LINE);
35
+ const persona = (await pieces.personas()).find((one) => one.name === wanted.persona);
36
+ if (persona === undefined) {
37
+ throw new Refusal(404, `no persona called ${wanted.persona}: ${NO_PERSONAS}`);
38
+ }
39
+ return await opened(persona, wanted, degraded, door, out, pieces.simulate);
40
+ },
41
+ };
42
+ }
43
+ // The call is answered the moment it has an id and the simulation keeps going on its own: the
44
+ // page navigates to the call and reads the log; this process prints the turns and, with `judge`,
45
+ // the verdict, as the terminal verb does. A simulation that ends before any call opened is a
46
+ // refusal with whatever it said, never a page waiting on a call that does not exist.
47
+ async function opened(persona, wanted, degraded, door, out, simulate) {
48
+ return await new Promise((answer, refuse) => {
49
+ let answered = false;
50
+ const running = simulate(persona, {
51
+ door,
52
+ judge: wanted.judge,
53
+ voice: wanted.voice,
54
+ ...(degraded === undefined ? {} : { degraded }),
55
+ turns: wanted.turns,
56
+ out,
57
+ opened: (call) => {
58
+ answered = true;
59
+ answer({ call });
60
+ },
61
+ });
62
+ running.then(() => {
63
+ if (!answered)
64
+ refuse(new Refusal(502, NO_CALL));
65
+ }, (failed) => {
66
+ const why = failed instanceof Error ? failed.message : String(failed);
67
+ out.write(`simulation failed: ${why}\n`);
68
+ if (!answered)
69
+ refuse(new Refusal(502, why));
70
+ });
71
+ });
72
+ }
73
+ // Read with the shared readers of ui/asked.ts: every door of this process reads a body the same way.
74
+ function parsed(asked) {
75
+ const given = anObject(asked, "a simulation");
76
+ return {
77
+ agent: aString(given, "agent"),
78
+ persona: aString(given, "persona"),
79
+ voice: aFlag(given, "voice"),
80
+ judge: aFlag(given, "judge"),
81
+ turns: given["turns"] === undefined ? TURNS : aNumber(given, "turns", 1, MOST_TURNS),
82
+ background_noise: maybeNumber(given, "background_noise", 0, 120),
83
+ packet_loss: maybeNumber(given, "packet_loss", 0, 100),
84
+ };
85
+ }
86
+ //# sourceMappingURL=simulating.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulating.js","sourceRoot":"","sources":["../../../src/cli/ui/simulating.ts"],"names":[],"mappings":"AAAA,mHAAmH;AAEnH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAgB,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAevC,8FAA8F;AAC9F,mFAAmF;AACnF,MAAM,UAAU,GAAG,EAAE,CAAC;AAetB,+FAA+F;AAC/F,8FAA8F;AAC9F,6FAA6F;AAC7F,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAE,IAAmB,EAAU,EAAE,CACxE,IAAI,KAAK,IAAI;IACX,CAAC,CAAC,gEAAgE,KAAK,iBAAiB;IACxF,CAAC,CAAC,wBAAwB,IAAI,6BAA6B,KAAK,8BAA8B,CAAC;AAEnG,MAAM,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E,OAAO,CAAC,CAAC,CAAC;QACnD,CAAC,EACD,CAAC,MAAe,EAAE,EAAE;YAClB,MAAM,GAAG,GAAG,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACtE,GAAG,CAAC,KAAK,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC;YACzC,IAAI,CAAC,QAAQ;gBAAE,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC/C,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,qGAAqG;AACrG,SAAS,MAAM,CAAC,KAAc;IAC5B,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IAC9C,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;QAC9B,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC;QAClC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC;QAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC;QAC5B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,CAAC;QACpF,gBAAgB,EAAE,WAAW,CAAC,KAAK,EAAE,kBAAkB,EAAE,CAAC,EAAE,GAAG,CAAC;QAChE,WAAW,EAAE,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,EAAE,GAAG,CAAC;KACvD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,49 @@
1
+ /** The console's own door to the goldens: this directory's, listed, and a run of the chosen ones started from the page. */
2
+ import type { Door, Wanted as RunWanted } from "../testing/gateway.js";
3
+ import { type Golden } from "../testing/goldens.js";
4
+ /** What the page asks for: which goldens, under which models, and on what line. */
5
+ export interface Wanted {
6
+ agent: string;
7
+ goldens: string[];
8
+ /** `vendor/model`, one per column of the matrix. Empty is the one the class declared. */
9
+ models: string[];
10
+ voice: boolean;
11
+ /** dB under the caller. Only on a spoken line. */
12
+ background_noise?: number | undefined;
13
+ /** The share of packets lost, 0 to 1, as `pinecall test --packet-loss` takes it. Only spoken. */
14
+ packet_loss?: number | undefined;
15
+ }
16
+ /** A golden as the page lists it: the name to tick, what the caller says, what is expected. */
17
+ export interface Listed {
18
+ name: string;
19
+ input: string[];
20
+ expect: Record<string, unknown>;
21
+ }
22
+ /** What the door answers: the class this console can run against, and its goldens. */
23
+ export interface Roster {
24
+ agent: string | null;
25
+ goldens: Listed[];
26
+ }
27
+ /** What the server needs from a suite, and nothing of how it prints. */
28
+ export interface Testing {
29
+ roster(): Promise<Roster>;
30
+ start(wanted: unknown): Promise<{
31
+ run: string;
32
+ }>;
33
+ }
34
+ /** The pieces a run is built from, named so a test can hand in its own. */
35
+ export interface Pieces {
36
+ goldens: () => Promise<Golden[]>;
37
+ /** Runs the chosen goldens through the class of this directory; answers the run's exit code. */
38
+ suite: (door: Door, goldens: Golden[], models: string[], line: Partial<RunWanted>, out: NodeJS.WritableStream) => Promise<number>;
39
+ /** The id of the run the gateway is driving for this agent right now, when there is one. */
40
+ running: (door: Door, agent: string) => Promise<string | undefined>;
41
+ }
42
+ /**
43
+ * One `Testing` for the life of a `pinecall run`: the door it was opened with, the class of the
44
+ * directory it runs in, and where the report goes — the terminal that typed `ui`, exactly as
45
+ * `pinecall test` prints it. The run itself is read from the page off `GET /v1/evals/runs`, like
46
+ * any other run; the reproductions are written where the verb writes them.
47
+ */
48
+ export declare function testingFrom(door: Door, agent: string | null, out: NodeJS.WritableStream, pieces?: Pieces): Testing;
49
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/cli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CAAC,EACxB,GAAG,EAAE,MAAM,CAAC,cAAc,KACvB,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,4FAA4F;IAC5F,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACrE;AAeD;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,GAAG,EAAE,MAAM,CAAC,cAAc,EAC1B,MAAM,GAAE,MAAkF,GACzF,OAAO,CAqBT"}
@@ -0,0 +1,104 @@
1
+ /** The console's own door to the goldens: this directory's, listed, and a run of the chosen ones started from the page. */
2
+ import { Pinecall } from "../../client/index.js";
3
+ import { modelOf } from "../../runtime/connect.js";
4
+ import { load } from "../load.js";
5
+ import { inFlight } from "../testing/progress.js";
6
+ import { goldensIn } from "../testing/goldens.js";
7
+ import { mountedForASuite, ranSuite } from "../testing/suite.js";
8
+ import { aFlag, anObject, aString, maybeNumber, names } from "./asked.js";
9
+ import { Refusal } from "./refusal.js";
10
+ // How long the page may wait for the gateway to write the run's row before it is told nothing
11
+ // opened. The runner writes the row before the first call, so this is the class mounting.
12
+ const A_RUN_OPENS_WITHIN_MS = 20_000;
13
+ const A_LOOK_EVERY_MS = 250;
14
+ const NOT_THIS_DIRECTORY = (asked, here) => here === null
15
+ ? `no agent class in this directory: run \`pinecall run\` where ${asked}'s agent.tsx is`
16
+ : `this process runs in ${here}'s directory: to run ${asked}'s goldens, run \`pinecall run\` there`;
17
+ const ONLY_ON_A_LINE = "background noise and packet loss are about audio: a spoken run";
18
+ const NO_RUN = "the suite ended before the gateway opened a run";
19
+ /**
20
+ * One `Testing` for the life of a `pinecall run`: the door it was opened with, the class of the
21
+ * directory it runs in, and where the report goes — the terminal that typed `ui`, exactly as
22
+ * `pinecall test` prints it. The run itself is read from the page off `GET /v1/evals/runs`, like
23
+ * any other run; the reproductions are written where the verb writes them.
24
+ */
25
+ export function testingFrom(door, agent, out, pieces = { goldens: () => goldensIn([]), suite: inThisProcess, running: inFlight }) {
26
+ return {
27
+ async roster() {
28
+ const goldens = await pieces.goldens();
29
+ return {
30
+ agent,
31
+ goldens: goldens.map(({ name, input, expect }) => ({ name, input, expect: { ...(expect ?? {}) } })),
32
+ };
33
+ },
34
+ async start(asked) {
35
+ const wanted = parsed(asked);
36
+ if (wanted.agent !== agent)
37
+ throw new Refusal(409, NOT_THIS_DIRECTORY(wanted.agent, agent));
38
+ const spoiled = wanted.background_noise !== undefined || wanted.packet_loss !== undefined;
39
+ if (!wanted.voice && spoiled)
40
+ throw new Refusal(422, ONLY_ON_A_LINE);
41
+ const chosen = (await pieces.goldens()).filter((golden) => wanted.goldens.includes(golden.name));
42
+ const missing = wanted.goldens.filter((name) => !chosen.some((golden) => golden.name === name));
43
+ if (missing.length > 0)
44
+ throw new Refusal(404, `no golden called ${missing.join(", ")}`);
45
+ return await opened(agent, chosen, wanted.models, aLine(wanted), door, out, pieces);
46
+ },
47
+ };
48
+ }
49
+ // Only the fields a spoken run adds travel: a written run must not carry a `voice: false` that
50
+ // reads as a decision somebody made. The same rule `pinecall test` keeps.
51
+ function aLine(wanted) {
52
+ if (!wanted.voice)
53
+ return {};
54
+ return {
55
+ voice: true,
56
+ ...(wanted.background_noise === undefined ? {} : { interferer_db: wanted.background_noise }),
57
+ ...(wanted.packet_loss === undefined ? {} : { packet_loss: wanted.packet_loss }),
58
+ };
59
+ }
60
+ // The suite runs on in this process and the page is answered with the run's id as soon as the
61
+ // gateway has written its row, which `pinecall test` reads off the same door for its header. A
62
+ // suite that ends first — refused, or no call opened — is the refusal, with what it said.
63
+ async function opened(agent, goldens, models, line, door, out, pieces) {
64
+ let settled = false;
65
+ const suite = pieces.suite(door, goldens, models, line, out).then(() => (settled = true), (failed) => {
66
+ settled = true;
67
+ out.write(`suite failed: ${failed instanceof Error ? failed.message : String(failed)}\n`);
68
+ });
69
+ const deadline = Date.now() + A_RUN_OPENS_WITHIN_MS;
70
+ while (!settled && Date.now() < deadline) {
71
+ const id = await pieces.running(door, agent);
72
+ if (id !== undefined)
73
+ return { run: id };
74
+ await Promise.race([suite, new Promise((wake) => setTimeout(wake, A_LOOK_EVERY_MS))]);
75
+ }
76
+ throw new Refusal(502, NO_RUN);
77
+ }
78
+ /** The chosen goldens through the class of this directory, mounted here for the length of the run. */
79
+ async function inThisProcess(door, goldens, models, line, out) {
80
+ const loaded = await load();
81
+ const pc = new Pinecall({ url: door.url, apiKey: door.apiKey });
82
+ const held = mountedForASuite(loaded, pc);
83
+ try {
84
+ await pc.connect();
85
+ const asked = models.map(modelOf).filter((model) => model !== undefined);
86
+ return await ranSuite({ door, loaded, held, goldens, models: asked, line, out, json: false });
87
+ }
88
+ finally {
89
+ pc.close();
90
+ }
91
+ }
92
+ // Read with the shared readers of ui/asked.ts: every door of this process reads a body the same way.
93
+ function parsed(asked) {
94
+ const given = anObject(asked, "a run");
95
+ return {
96
+ agent: aString(given, "agent"),
97
+ goldens: names(given, "goldens"),
98
+ models: given["models"] === undefined ? [] : names(given, "models"),
99
+ voice: aFlag(given, "voice"),
100
+ background_noise: maybeNumber(given, "background_noise", 0, 120),
101
+ packet_loss: maybeNumber(given, "packet_loss", 0, 1),
102
+ };
103
+ }
104
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/cli/ui/testing.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAE3H,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAe,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,gBAAgB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,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC;QAChC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC;QACnE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC;QAC5B,gBAAgB,EAAE,WAAW,CAAC,KAAK,EAAE,kBAAkB,EAAE,CAAC,EAAE,GAAG,CAAC;QAChE,WAAW,EAAE,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;KACrD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,43 @@
1
+ /** The live terminal view as a pure function: entries in, one screen of text out. No terminal here. */
2
+ import type { CamelEvent } from "../client/index.js";
3
+ /** One line of the view, already formatted, with the mark that says what kind of line it is. */
4
+ export interface Line {
5
+ mark: string;
6
+ text: string;
7
+ }
8
+ /** Everything the view knows, folded from the entries it has seen. Nothing here is the screen. */
9
+ export interface Screen {
10
+ slug: string;
11
+ url: string;
12
+ calls: number;
13
+ transcript: Line[];
14
+ tools: Line[];
15
+ state: Record<string, unknown>;
16
+ /** The fields the last state.changed named: what the STATE panel highlights. */
17
+ changed: string[];
18
+ metrics: string[];
19
+ events: string[];
20
+ }
21
+ export declare const CALLER = "\u2039";
22
+ export declare const BROKE = "\u2717";
23
+ /** A view that has seen nothing yet. */
24
+ export declare function screenFor(slug: string, url: string): Screen;
25
+ /**
26
+ * One event folded into the view. Pure: it returns the next screen and touches nothing else,
27
+ * which is what lets the whole live view be tested without a terminal or a gateway.
28
+ */
29
+ export declare function absorb(screen: Screen, event: CamelEvent): Screen;
30
+ /**
31
+ * The one line an event is worth, mark and all, or null when it is not a line at all. The view
32
+ * draws these into its panels and `pinecall chat` prints them one per frame: one renderer, so the
33
+ * marks mean the same thing in both places.
34
+ */
35
+ export declare function lineFor(event: CamelEvent): Line | null;
36
+ export declare const TURN_METRICS: readonly ["e2e_latency", "llm_node_ttft", "tts_node_ttfb"];
37
+ /** The one line a finished agent turn is worth: its latencies, in milliseconds, or a dash. */
38
+ export declare function metricsLine(metrics: Record<string, unknown> | undefined): string;
39
+ /** The STATE panel: one field per line, the ones the last change named marked with a dot. */
40
+ export declare function statePanel(state: Record<string, unknown>, changed: string[]): string[];
41
+ /** The whole view as one screen of text, cut to the terminal it is going to be written on. */
42
+ export declare function draw(screen: Screen, rows: number, columns: number, raw?: boolean): string;
43
+ //# sourceMappingURL=view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/cli/view.ts"],"names":[],"mappings":"AAAA,uGAAuG;AAEvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,gGAAgG;AAChG,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kGAAkG;AAClG,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,IAAI,EAAE,CAAC;IACnB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,gFAAgF;IAChF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAID,eAAO,MAAM,MAAM,WAAM,CAAC;AAO1B,eAAO,MAAM,KAAK,WAAM,CAAC;AAMzB,wCAAwC;AACxC,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAqBhE;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAatD;AAKD,eAAO,MAAM,YAAY,YAAI,aAAa,EAAE,eAAe,EAAE,eAAe,CAAU,CAAC;AAEvF,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAOhF;AAED,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAItF;AAED,8FAA8F;AAC9F,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,UAAQ,GAAG,MAAM,CAQvF"}
@@ -0,0 +1,137 @@
1
+ /** The live terminal view as a pure function: entries in, one screen of text out. No terminal here. */
2
+ // The mark column is a glyph and never a colour: this view is read over ssh, piped to grep and
3
+ // pasted into a card, and none of those carry an escape sequence.
4
+ export const CALLER = "‹";
5
+ const AGENT = "›";
6
+ const ASKS = "→";
7
+ const ANSWERS = "←";
8
+ // The mark an error wears in the middle of a transcript. Not one of the conversation's four —
9
+ // the live view draws an error in a panel of its own — but `pinecall chat` and the talk page both
10
+ // put one between two turns, and one glyph is spelled once.
11
+ export const BROKE = "✗";
12
+ // A panel that grows forever is a panel nobody can read: the view keeps what fits on a screen
13
+ // and forgets the rest. The log keeps everything; this is a window onto it, not a copy of it.
14
+ const KEPT = 200;
15
+ /** A view that has seen nothing yet. */
16
+ export function screenFor(slug, url) {
17
+ return { slug, url, calls: 0, transcript: [], tools: [], state: {}, changed: [], metrics: [], events: [] };
18
+ }
19
+ /**
20
+ * One event folded into the view. Pure: it returns the next screen and touches nothing else,
21
+ * which is what lets the whole live view be tested without a terminal or a gateway.
22
+ */
23
+ export function absorb(screen, event) {
24
+ const next = { ...screen, events: keep([...screen.events, JSON.stringify(event)]) };
25
+ switch (event.type) {
26
+ case "call.started":
27
+ return { ...next, calls: screen.calls + 1 };
28
+ case "turn.user":
29
+ return { ...next, transcript: keep([...screen.transcript, lineFor(event)]) };
30
+ case "turn.agent":
31
+ return {
32
+ ...next,
33
+ transcript: keep([...screen.transcript, lineFor(event)]),
34
+ metrics: keep([...screen.metrics, metricsLine(event.data.metrics)]),
35
+ };
36
+ case "tool.call":
37
+ case "tool.result":
38
+ return { ...next, tools: keep([...screen.tools, lineFor(event)]) };
39
+ case "state.changed":
40
+ return { ...next, state: { ...event.data.state }, changed: [...event.data.changed] };
41
+ default:
42
+ return next;
43
+ }
44
+ }
45
+ /**
46
+ * The one line an event is worth, mark and all, or null when it is not a line at all. The view
47
+ * draws these into its panels and `pinecall chat` prints them one per frame: one renderer, so the
48
+ * marks mean the same thing in both places.
49
+ */
50
+ export function lineFor(event) {
51
+ switch (event.type) {
52
+ case "turn.user":
53
+ return { mark: CALLER, text: String(event.data.text ?? "") };
54
+ case "turn.agent":
55
+ return { mark: AGENT, text: String(event.data.text ?? "") };
56
+ case "tool.call":
57
+ return { mark: ASKS, text: toolCallLine(event.data) };
58
+ case "tool.result":
59
+ return { mark: ANSWERS, text: toolResultLine(event.data) };
60
+ default:
61
+ return null;
62
+ }
63
+ }
64
+ // Only the fields livekit actually measured for this turn, in the order a person reads them:
65
+ // how long the caller waited, then where that time went. A metric the session did not take is
66
+ // left out rather than printed as a zero, because a zero here would read as "instant".
67
+ export const TURN_METRICS = ["e2e_latency", "llm_node_ttft", "tts_node_ttfb"];
68
+ /** The one line a finished agent turn is worth: its latencies, in milliseconds, or a dash. */
69
+ export function metricsLine(metrics) {
70
+ const parts = [];
71
+ for (const name of TURN_METRICS) {
72
+ const value = metrics?.[name];
73
+ if (typeof value === "number")
74
+ parts.push(`${name} ${Math.round(value * 1000)}ms`);
75
+ }
76
+ return parts.length === 0 ? "no metrics on this turn" : parts.join(" ");
77
+ }
78
+ /** The STATE panel: one field per line, the ones the last change named marked with a dot. */
79
+ export function statePanel(state, changed) {
80
+ const names = Object.keys(state);
81
+ if (names.length === 0)
82
+ return [" (no state yet)"];
83
+ return names.map((name) => `${changed.includes(name) ? "● " : " "}${name}: ${short(state[name])}`);
84
+ }
85
+ /** The whole view as one screen of text, cut to the terminal it is going to be written on. */
86
+ export function draw(screen, rows, columns, raw = false) {
87
+ const body = raw ? screen.events.slice(-(rows - 4)) : panels(screen, rows);
88
+ const lines = [
89
+ `pinecall ${screen.slug} ${screen.url} calls ${screen.calls}`,
90
+ divider(columns),
91
+ ...body,
92
+ ];
93
+ return lines.map((line) => line.slice(0, columns)).join("\n");
94
+ }
95
+ // The three panels under the header, in the order a person's eye goes: what was said, what ran,
96
+ // and what the agent believes right now. The transcript gets whatever height is left over.
97
+ function panels(screen, rows) {
98
+ const state = statePanel(screen.state, screen.changed);
99
+ const tools = screen.tools.slice(-5);
100
+ const metric = screen.metrics.at(-1);
101
+ const height = Math.max(3, rows - state.length - tools.length - 9);
102
+ return [
103
+ ...screen.transcript.slice(-height).map((line) => `${line.mark} ${line.text}`),
104
+ "",
105
+ "TOOLS",
106
+ ...tools.map((line) => `${line.mark} ${line.text}`),
107
+ "",
108
+ "STATE",
109
+ ...state,
110
+ "",
111
+ `metrics ${metric ?? "—"}`,
112
+ ];
113
+ }
114
+ function divider(columns) {
115
+ return "─".repeat(Math.max(1, Math.min(columns, 100)));
116
+ }
117
+ function toolCallLine(data) {
118
+ return `${data.name}(${short(data.arguments)})`;
119
+ }
120
+ function toolResultLine(data) {
121
+ if (data.error !== undefined && data.error !== null)
122
+ return `${data.name ?? "tool"} error: ${short(data.error)}`;
123
+ // A method that returns nothing answers with no output at all — JSON has no undefined — and
124
+ // the line says so in a word, never as the JavaScript for it.
125
+ const answered = data.summary ?? (data.output === undefined ? "nothing" : short(data.output));
126
+ return `${data.name ?? "tool"} ${answered}`;
127
+ }
128
+ // A value is shown as the JSON it is, cut: the view is a window onto the state, and a caller's
129
+ // whole slot list would push the panel it belongs to off the screen.
130
+ function short(value, width = 60) {
131
+ const text = typeof value === "string" ? value : JSON.stringify(value) ?? String(value);
132
+ return text.length > width ? `${text.slice(0, width - 1)}…` : text;
133
+ }
134
+ function keep(lines) {
135
+ return lines.length > KEPT ? lines.slice(-KEPT) : lines;
136
+ }
137
+ //# sourceMappingURL=view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/cli/view.ts"],"names":[],"mappings":"AAAA,uGAAuG;AAwBvG,+FAA+F;AAC/F,kEAAkE;AAClE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;AAC1B,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,MAAM,IAAI,GAAG,GAAG,CAAC;AACjB,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,8FAA8F;AAC9F,kGAAkG;AAClG,4DAA4D;AAC5D,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAC;AAEzB,8FAA8F;AAC9F,8FAA8F;AAC9F,MAAM,IAAI,GAAG,GAAG,CAAC;AAEjB,wCAAwC;AACxC,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,GAAW;IACjD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC7G,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,MAAc,EAAE,KAAiB;IACtD,MAAM,IAAI,GAAW,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAA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,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9F,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;AAC9C,CAAC;AAED,+FAA+F;AAC/F,qEAAqE;AACrE,SAAS,KAAK,CAAC,KAAc,EAAE,KAAK,GAAG,EAAE;IACvC,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;IACxF,OAAO,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC;AAED,SAAS,IAAI,CAAI,KAAU;IACzB,OAAO,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,37 @@
1
+ /** `pinecall whoami`: which gateway this terminal talks to, whose key it holds, and where it found it. */
2
+ import type { Group } from "./groups.js";
3
+ import { type Door } from "./testing/gateway.js";
4
+ /** What the gateway says about the key that opened it: never the key, and never its hash. */
5
+ export interface Who {
6
+ org: string;
7
+ /** The word a person types and reads — `clinica` — as against `org`, which is the id every
8
+ * door takes. A gateway too old to answer it leaves it out, and the id is what is said then. */
9
+ slug?: string | null;
10
+ key_id: string;
11
+ label: string | null;
12
+ /** The world this key opens. Where you are IS the key you hold, so the verb says which. */
13
+ env: string;
14
+ }
15
+ export declare const group: Group;
16
+ /** Resolve the door, ask it who is knocking, and print the two lines. */
17
+ export declare function run(_argv: string[], out?: NodeJS.WritableStream, err?: NodeJS.WritableStream, env?: NodeJS.ProcessEnv): Promise<number>;
18
+ /** Who the gateway says is knocking with this key. */
19
+ export declare function whoIs(door: Door): Promise<Who>;
20
+ /**
21
+ * Whose org this is, in the word its people use.
22
+ *
23
+ * `org` is the id every door takes — `org_98889a61509c` on an org the box made — and a line that
24
+ * prints THAT at a person prints them nothing. The id is said only when there is no slug: a
25
+ * gateway too old to carry one, or an org whose row is gone.
26
+ */
27
+ export declare function orgOf(who: Who): string;
28
+ /** One line: whose key, which of theirs, which world it opens, and what it was issued for. */
29
+ export declare function describing(who: Who): string;
30
+ /**
31
+ * What the gateway said when it refused, in its own words.
32
+ *
33
+ * A refusal arrives as a JSON body and a person should read the sentence in it, not the body:
34
+ * "this door takes an API key" is the whole answer, and `{"detail": …}` around it is noise.
35
+ */
36
+ export declare function refusal(failed: unknown): string;
37
+ //# sourceMappingURL=whoami.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../src/cli/whoami.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAG1G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAMjE,6FAA6F;AAC7F,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ;oGACgG;IAChG,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,2FAA2F;IAC3F,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,KAAK,EAAE,KASnB,CAAC;AAEF,yEAAyE;AACzE,wBAAsB,GAAG,CACvB,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,GAAE,MAAM,CAAC,cAA+B,EAC3C,GAAG,GAAE,MAAM,CAAC,cAA+B,EAC3C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,MAAM,CAAC,CAajB;AAED,sDAAsD;AACtD,wBAAsB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAEtC;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAI3C;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAI/C"}
@@ -0,0 +1,78 @@
1
+ /** `pinecall whoami`: which gateway this terminal talks to, whose key it holds, and where it found it. */
2
+ import { doorLine, theDoor } from "./env.js";
3
+ import { asked, Refused } from "./testing/gateway.js";
4
+ // The door that answers who is knocking, written once: `login` proves a key at this same path,
5
+ // through whoIs() below, so neither verb spells it.
6
+ const WHOAMI = "/v1/whoami";
7
+ export const group = {
8
+ purpose: "which org and which key this terminal is holding",
9
+ usage: `usage: pinecall whoami
10
+
11
+ Prints the gateway every connecting verb would talk to, where the key came from, and what
12
+ that gateway says the key is: the org, the key's id, the world it opens and the label it was
13
+ issued under. The
14
+ key itself is neither printed nor sent anywhere else.`,
15
+ run,
16
+ };
17
+ /** Resolve the door, ask it who is knocking, and print the two lines. */
18
+ export async function run(_argv, out = process.stdout, err = process.stderr, env = process.env) {
19
+ const door = theDoor(env, err);
20
+ if (door === undefined)
21
+ return 2;
22
+ let who;
23
+ try {
24
+ who = await whoIs(door);
25
+ }
26
+ catch (refused) {
27
+ err.write(`${refusal(refused)}\n`);
28
+ return 1;
29
+ }
30
+ out.write(`${doorLine(door)}\n`);
31
+ out.write(`${describing(who)}\n`);
32
+ return 0;
33
+ }
34
+ /** Who the gateway says is knocking with this key. */
35
+ export async function whoIs(door) {
36
+ return await asked(door, WHOAMI);
37
+ }
38
+ /**
39
+ * Whose org this is, in the word its people use.
40
+ *
41
+ * `org` is the id every door takes — `org_98889a61509c` on an org the box made — and a line that
42
+ * prints THAT at a person prints them nothing. The id is said only when there is no slug: a
43
+ * gateway too old to carry one, or an org whose row is gone.
44
+ */
45
+ export function orgOf(who) {
46
+ return who.slug ?? who.org;
47
+ }
48
+ /** One line: whose key, which of theirs, which world it opens, and what it was issued for. */
49
+ export function describing(who) {
50
+ const said = [`org ${orgOf(who)}`, `key ${who.key_id}`, who.env];
51
+ if (who.label !== null)
52
+ said.push(who.label);
53
+ return said.join(" · ");
54
+ }
55
+ /**
56
+ * What the gateway said when it refused, in its own words.
57
+ *
58
+ * A refusal arrives as a JSON body and a person should read the sentence in it, not the body:
59
+ * "this door takes an API key" is the whole answer, and `{"detail": …}` around it is noise.
60
+ */
61
+ export function refusal(failed) {
62
+ if (!(failed instanceof Refused))
63
+ return failed instanceof Error ? failed.message : String(failed);
64
+ const said = detailOf(failed.text);
65
+ return said === undefined ? failed.message : `the gateway answered ${failed.status}: ${said}`;
66
+ }
67
+ // FastAPI puts a refusal's sentence under `detail`; anything else is printed as it arrived.
68
+ function detailOf(text) {
69
+ try {
70
+ const body = JSON.parse(text);
71
+ const said = body.detail;
72
+ return typeof said === "string" ? said : undefined;
73
+ }
74
+ catch {
75
+ return undefined;
76
+ }
77
+ }
78
+ //# sourceMappingURL=whoami.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../src/cli/whoami.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAE1G,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAa,MAAM,sBAAsB,CAAC;AAEjE,+FAA+F;AAC/F,oDAAoD;AACpD,MAAM,MAAM,GAAG,YAAY,CAAC;AAc5B,MAAM,CAAC,MAAM,KA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CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjE,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,IAAI,CAAC,CAAC,MAAM,YAAY,OAAO,CAAC;QAAE,OAAO,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnG,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;AAChG,CAAC;AAED,4FAA4F;AAC5F,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QACH,MAAM,IAAI,GAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,IAAI,GAAI,IAA6B,CAAC,MAAM,CAAC;QACnD,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,33 @@
1
+ /** Which world a verb works in. The KEY decides it; `--env` is how a person says they know which. */
2
+ import type { Open } from "./env.js";
3
+ import { type Who } from "./whoami.js";
4
+ /** The world a laptop is in: what is being written, held per person, nobody's customers calling. */
5
+ export declare const SANDBOX = "sandbox";
6
+ /** The world a deployment is in: the org's own, held by a key issued for a machine. */
7
+ export declare const PRODUCTION = "production";
8
+ /**
9
+ * The `--env` every registering verb takes, declared once so the flag is spelled in one place.
10
+ *
11
+ * It selects NOTHING. A key opens one world and that is a property of the key, so a flag that
12
+ * chose would be a flag that lies: what this one does is say out loud which world you believe you
13
+ * are in, and refuse when the key disagrees. Sandbox is what a verb assumes when nothing is said,
14
+ * because a laptop is where things are written and a deployment is the deliberate act.
15
+ */
16
+ export declare const ENV_FLAG: {
17
+ env: {
18
+ type: "string";
19
+ };
20
+ };
21
+ /** What the gateway says this key is: asked once, and used for both the check and the line. */
22
+ export declare function standing(door: Open): Promise<Who>;
23
+ /**
24
+ * Why this verb will not run with the key in hand, or undefined when it will.
25
+ *
26
+ * The whole reason this exists: `pinecall run` used to register wherever the key it happened to
27
+ * find pointed, and the line it printed read the same either way — so an agent landed in
28
+ * production, in somebody else's org, and nothing said so until a customer called it.
29
+ */
30
+ export declare function notThisWorld(verb: string, who: Who, said: string | undefined): string | undefined;
31
+ /** When the gateway will not say which world the key opens: guessing is the bug this replaces. */
32
+ export declare function cannotTell(verb: string, failed: unknown): string;
33
+ //# sourceMappingURL=world.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../src/cli/world.ts"],"names":[],"mappings":"AAAA,qGAAqG;AAErG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAkB,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvD,oGAAoG;AACpG,eAAO,MAAM,OAAO,YAAY,CAAC;AAEjC,uFAAuF;AACvF,eAAO,MAAM,UAAU,eAAe,CAAC;AAIvC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;IAAK,GAAG;QAAI,IAAI,EAAE,QAAQ;;CAAa,CAAC;AAE7D,+FAA+F;AAC/F,wBAAsB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAkBjG;AAED,kGAAkG;AAClG,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAEhE"}