waterplane 0.1.25 → 0.1.26

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 (342) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/SECURITY.md +24 -4
  3. package/node_modules/@waterplane/shared/dist/agentseries/compare.d.ts +8 -0
  4. package/node_modules/@waterplane/shared/dist/agentseries/compare.js +103 -0
  5. package/node_modules/@waterplane/shared/dist/agentseries/compare.js.map +1 -0
  6. package/node_modules/@waterplane/shared/dist/agentseries/markers.d.ts +17 -0
  7. package/node_modules/@waterplane/shared/dist/agentseries/markers.js +125 -0
  8. package/node_modules/@waterplane/shared/dist/agentseries/markers.js.map +1 -0
  9. package/node_modules/@waterplane/shared/dist/agentseries/series.d.ts +16 -0
  10. package/node_modules/@waterplane/shared/dist/agentseries/series.js +93 -0
  11. package/node_modules/@waterplane/shared/dist/agentseries/series.js.map +1 -0
  12. package/node_modules/@waterplane/shared/dist/agentseries/stats.d.ts +8 -0
  13. package/node_modules/@waterplane/shared/dist/agentseries/stats.js +33 -0
  14. package/node_modules/@waterplane/shared/dist/agentseries/stats.js.map +1 -0
  15. package/node_modules/@waterplane/shared/dist/agentseries/types.d.ts +103 -0
  16. package/node_modules/@waterplane/shared/dist/agentseries/types.js +11 -0
  17. package/node_modules/@waterplane/shared/dist/agentseries/types.js.map +1 -0
  18. package/node_modules/@waterplane/shared/dist/agentseries.d.ts +10 -0
  19. package/node_modules/@waterplane/shared/dist/agentseries.js +11 -0
  20. package/node_modules/@waterplane/shared/dist/agentseries.js.map +1 -0
  21. package/node_modules/@waterplane/shared/dist/calday.d.ts +5 -0
  22. package/node_modules/@waterplane/shared/dist/calday.js +10 -0
  23. package/node_modules/@waterplane/shared/dist/calday.js.map +1 -1
  24. package/node_modules/@waterplane/shared/dist/clihealth/healthfixture.d.ts +13 -1
  25. package/node_modules/@waterplane/shared/dist/clihealth/healthfixture.js +22 -4
  26. package/node_modules/@waterplane/shared/dist/clihealth/healthfixture.js.map +1 -1
  27. package/node_modules/@waterplane/shared/dist/clihealth.d.ts +1 -1
  28. package/node_modules/@waterplane/shared/dist/clihealth.js +1 -1
  29. package/node_modules/@waterplane/shared/dist/clihealth.js.map +1 -1
  30. package/node_modules/@waterplane/shared/dist/dictate.d.ts +6 -0
  31. package/node_modules/@waterplane/shared/dist/dictate.js.map +1 -1
  32. package/node_modules/@waterplane/shared/dist/dictatemodels.d.ts +23 -0
  33. package/node_modules/@waterplane/shared/dist/dictatemodels.js +31 -0
  34. package/node_modules/@waterplane/shared/dist/dictatemodels.js.map +1 -0
  35. package/node_modules/@waterplane/shared/dist/healthspend.d.ts +23 -0
  36. package/node_modules/@waterplane/shared/dist/healthspend.js +31 -0
  37. package/node_modules/@waterplane/shared/dist/healthspend.js.map +1 -1
  38. package/node_modules/@waterplane/shared/dist/index.d.ts +7 -0
  39. package/node_modules/@waterplane/shared/dist/index.js +7 -0
  40. package/node_modules/@waterplane/shared/dist/index.js.map +1 -1
  41. package/node_modules/@waterplane/shared/dist/installrow.js +10 -0
  42. package/node_modules/@waterplane/shared/dist/installrow.js.map +1 -1
  43. package/node_modules/@waterplane/shared/dist/itempaths.d.ts +23 -0
  44. package/node_modules/@waterplane/shared/dist/itempaths.js +38 -0
  45. package/node_modules/@waterplane/shared/dist/itempaths.js.map +1 -1
  46. package/node_modules/@waterplane/shared/dist/pluginlaunch.d.ts +3 -2
  47. package/node_modules/@waterplane/shared/dist/pluginlaunch.js +1 -1
  48. package/node_modules/@waterplane/shared/dist/pluginlaunch.js.map +1 -1
  49. package/node_modules/@waterplane/shared/dist/pricelist.d.ts +57 -0
  50. package/node_modules/@waterplane/shared/dist/pricelist.js +128 -0
  51. package/node_modules/@waterplane/shared/dist/pricelist.js.map +1 -0
  52. package/node_modules/@waterplane/shared/dist/pricing.d.ts +86 -9
  53. package/node_modules/@waterplane/shared/dist/pricing.js +140 -20
  54. package/node_modules/@waterplane/shared/dist/pricing.js.map +1 -1
  55. package/node_modules/@waterplane/shared/dist/queue/queuelanestate.d.ts +14 -0
  56. package/node_modules/@waterplane/shared/dist/queue/queuelanestate.js +25 -0
  57. package/node_modules/@waterplane/shared/dist/queue/queuelanestate.js.map +1 -0
  58. package/node_modules/@waterplane/shared/dist/queue/queueplan.d.ts +4 -0
  59. package/node_modules/@waterplane/shared/dist/queue/queueplan.js +21 -0
  60. package/node_modules/@waterplane/shared/dist/queue/queueplan.js.map +1 -1
  61. package/node_modules/@waterplane/shared/dist/queue/queuewords.js +2 -1
  62. package/node_modules/@waterplane/shared/dist/queue/queuewords.js.map +1 -1
  63. package/node_modules/@waterplane/shared/dist/queue.d.ts +2 -0
  64. package/node_modules/@waterplane/shared/dist/queue.js +1 -0
  65. package/node_modules/@waterplane/shared/dist/queue.js.map +1 -1
  66. package/node_modules/@waterplane/shared/dist/skillstate.d.ts +51 -0
  67. package/node_modules/@waterplane/shared/dist/skillstate.js +176 -0
  68. package/node_modules/@waterplane/shared/dist/skillstate.js.map +1 -0
  69. package/node_modules/@waterplane/shared/dist/skillwords.d.ts +10 -0
  70. package/node_modules/@waterplane/shared/dist/skillwords.js +18 -0
  71. package/node_modules/@waterplane/shared/dist/skillwords.js.map +1 -0
  72. package/node_modules/@waterplane/shared/dist/wire/agentreadings.d.ts +147 -3
  73. package/node_modules/@waterplane/shared/dist/wire/agentreadings.js +29 -0
  74. package/node_modules/@waterplane/shared/dist/wire/agentreadings.js.map +1 -1
  75. package/node_modules/@waterplane/shared/dist/wire/backend.d.ts +2 -0
  76. package/node_modules/@waterplane/shared/dist/wire/costwindow.d.ts +4 -0
  77. package/node_modules/@waterplane/shared/dist/wire/dictatesetup.d.ts +42 -0
  78. package/node_modules/@waterplane/shared/dist/wire/dictatesetup.js +9 -0
  79. package/node_modules/@waterplane/shared/dist/wire/dictatesetup.js.map +1 -0
  80. package/node_modules/@waterplane/shared/dist/wire/messages/hostcore.d.ts +22 -1
  81. package/node_modules/@waterplane/shared/dist/wire/skills.d.ts +142 -0
  82. package/node_modules/@waterplane/shared/dist/wire/skills.js +6 -0
  83. package/node_modules/@waterplane/shared/dist/wire/skills.js.map +1 -0
  84. package/node_modules/@waterplane/shared/dist/wire/sysstat.d.ts +17 -0
  85. package/node_modules/@waterplane/shared/dist/wire/telemetry.d.ts +4 -0
  86. package/npm-shrinkwrap.json +2 -2
  87. package/package.json +1 -1
  88. package/packages/extensions/diskspace/waterplane-plugin.json +16 -0
  89. package/packages/extensions/links/waterplane-plugin.json +18 -0
  90. package/packages/host/dist/agentclass.d.ts +42 -31
  91. package/packages/host/dist/agentclass.js +155 -5
  92. package/packages/host/dist/agentclass.js.map +1 -1
  93. package/packages/host/dist/agentmarkers.d.ts +49 -0
  94. package/packages/host/dist/agentmarkers.js +255 -0
  95. package/packages/host/dist/agentmarkers.js.map +1 -0
  96. package/packages/host/dist/agentreadings.d.ts +30 -2
  97. package/packages/host/dist/agentreadings.js +89 -7
  98. package/packages/host/dist/agentreadings.js.map +1 -1
  99. package/packages/host/dist/agentscan.d.ts +1 -1
  100. package/packages/host/dist/agentscan.js +107 -9
  101. package/packages/host/dist/agentscan.js.map +1 -1
  102. package/packages/host/dist/archive.js +9 -3
  103. package/packages/host/dist/archive.js.map +1 -1
  104. package/packages/host/dist/artifacts.js +4 -7
  105. package/packages/host/dist/artifacts.js.map +1 -1
  106. package/packages/host/dist/askrules.js +12 -4
  107. package/packages/host/dist/askrules.js.map +1 -1
  108. package/packages/host/dist/auth.d.ts +1 -0
  109. package/packages/host/dist/auth.js +5 -3
  110. package/packages/host/dist/auth.js.map +1 -1
  111. package/packages/host/dist/autopull.js +4 -8
  112. package/packages/host/dist/autopull.js.map +1 -1
  113. package/packages/host/dist/backends/claude.js +1 -0
  114. package/packages/host/dist/backends/claude.js.map +1 -1
  115. package/packages/host/dist/backends/derive.js +3 -1
  116. package/packages/host/dist/backends/derive.js.map +1 -1
  117. package/packages/host/dist/binguard.js +19 -2
  118. package/packages/host/dist/binguard.js.map +1 -1
  119. package/packages/host/dist/capture.js +7 -10
  120. package/packages/host/dist/capture.js.map +1 -1
  121. package/packages/host/dist/clifixtures.d.ts +24 -4
  122. package/packages/host/dist/clifixtures.js +50 -10
  123. package/packages/host/dist/clifixtures.js.map +1 -1
  124. package/packages/host/dist/clihealth.d.ts +8 -2
  125. package/packages/host/dist/clihealth.js +11 -3
  126. package/packages/host/dist/clihealth.js.map +1 -1
  127. package/packages/host/dist/costwindow.js +4 -2
  128. package/packages/host/dist/costwindow.js.map +1 -1
  129. package/packages/host/dist/ctxlog/ctxagents.d.ts +2 -0
  130. package/packages/host/dist/ctxlog/ctxagents.js +5 -5
  131. package/packages/host/dist/ctxlog/ctxagents.js.map +1 -1
  132. package/packages/host/dist/ctxlog/ctxcursor.d.ts +2 -0
  133. package/packages/host/dist/ctxlog/ctxcursor.js +2 -2
  134. package/packages/host/dist/ctxlog/ctxcursor.js.map +1 -1
  135. package/packages/host/dist/ctxlog/ctxupdate.js +11 -6
  136. package/packages/host/dist/ctxlog/ctxupdate.js.map +1 -1
  137. package/packages/host/dist/deliver/deliverknobs.d.ts +0 -2
  138. package/packages/host/dist/deliver/deliverknobs.js +0 -2
  139. package/packages/host/dist/deliver/deliverknobs.js.map +1 -1
  140. package/packages/host/dist/deliver/deliverproof.d.ts +3 -2
  141. package/packages/host/dist/deliver/deliverproof.js +9 -8
  142. package/packages/host/dist/deliver/deliverproof.js.map +1 -1
  143. package/packages/host/dist/deliver/deliverreturn.d.ts +3 -2
  144. package/packages/host/dist/deliver/deliverreturn.js +13 -12
  145. package/packages/host/dist/deliver/deliverreturn.js.map +1 -1
  146. package/packages/host/dist/deliver/deliverrun.js +20 -18
  147. package/packages/host/dist/deliver/deliverrun.js.map +1 -1
  148. package/packages/host/dist/deliver/deliverscreen.d.ts +2 -1
  149. package/packages/host/dist/deliver/deliverscreen.js +9 -8
  150. package/packages/host/dist/deliver/deliverscreen.js.map +1 -1
  151. package/packages/host/dist/deliver/delivertypes.d.ts +4 -0
  152. package/packages/host/dist/deliver.js +2 -1
  153. package/packages/host/dist/deliver.js.map +1 -1
  154. package/packages/host/dist/dictate.d.ts +11 -0
  155. package/packages/host/dist/dictate.js +20 -10
  156. package/packages/host/dist/dictate.js.map +1 -1
  157. package/packages/host/dist/dictatesetup.d.ts +54 -0
  158. package/packages/host/dist/dictatesetup.js +261 -0
  159. package/packages/host/dist/dictatesetup.js.map +1 -0
  160. package/packages/host/dist/doctor.js +1 -1
  161. package/packages/host/dist/doctor.js.map +1 -1
  162. package/packages/host/dist/exposurepush.js +2 -2
  163. package/packages/host/dist/exposurepush.js.map +1 -1
  164. package/packages/host/dist/extensions/diskspace/host/candidates.d.mts +180 -0
  165. package/packages/host/dist/extensions/diskspace/host/candidates.mjs +716 -0
  166. package/packages/host/dist/extensions/diskspace/host/candidates.mjs.map +1 -0
  167. package/packages/host/dist/extensions/diskspace/host/engine.d.mts +21 -0
  168. package/packages/host/dist/extensions/diskspace/host/engine.mjs +498 -0
  169. package/packages/host/dist/extensions/diskspace/host/engine.mjs.map +1 -0
  170. package/packages/host/dist/extensions/diskspace/host/index.d.mts +25 -0
  171. package/packages/host/dist/extensions/diskspace/host/index.mjs +135 -0
  172. package/packages/host/dist/extensions/diskspace/host/index.mjs.map +1 -0
  173. package/packages/host/dist/extensions/diskspace/host/large.d.mts +11 -0
  174. package/packages/host/dist/extensions/diskspace/host/large.mjs +56 -0
  175. package/packages/host/dist/extensions/diskspace/host/large.mjs.map +1 -0
  176. package/packages/host/dist/extensions/diskspace/host/run.d.mts +94 -0
  177. package/packages/host/dist/extensions/diskspace/host/run.mjs +200 -0
  178. package/packages/host/dist/extensions/diskspace/host/run.mjs.map +1 -0
  179. package/packages/host/dist/extensions/diskspace/shared/wire.d.mts +197 -0
  180. package/packages/host/dist/extensions/diskspace/shared/wire.mjs +23 -0
  181. package/packages/host/dist/extensions/diskspace/shared/wire.mjs.map +1 -0
  182. package/packages/host/dist/extensions/links/host/engine.d.mts +39 -0
  183. package/packages/host/dist/extensions/links/host/engine.mjs +285 -0
  184. package/packages/host/dist/extensions/links/host/engine.mjs.map +1 -0
  185. package/packages/host/dist/extensions/links/host/index.d.mts +10 -0
  186. package/packages/host/dist/extensions/links/host/index.mjs +72 -0
  187. package/packages/host/dist/extensions/links/host/index.mjs.map +1 -0
  188. package/packages/host/dist/extensions/links/host/parse.d.mts +61 -0
  189. package/packages/host/dist/extensions/links/host/parse.mjs +225 -0
  190. package/packages/host/dist/extensions/links/host/parse.mjs.map +1 -0
  191. package/packages/host/dist/extensions/links/host/run.d.mts +15 -0
  192. package/packages/host/dist/extensions/links/host/run.mjs +32 -0
  193. package/packages/host/dist/extensions/links/host/run.mjs.map +1 -0
  194. package/packages/host/dist/extensions/links/host/store.d.mts +11 -0
  195. package/packages/host/dist/extensions/links/host/store.mjs +76 -0
  196. package/packages/host/dist/extensions/links/host/store.mjs.map +1 -0
  197. package/packages/host/dist/extensions/links/shared/wire.d.mts +141 -0
  198. package/packages/host/dist/extensions/links/shared/wire.mjs +20 -0
  199. package/packages/host/dist/extensions/links/shared/wire.mjs.map +1 -0
  200. package/packages/host/dist/git.d.ts +5 -3
  201. package/packages/host/dist/git.js +16 -28
  202. package/packages/host/dist/git.js.map +1 -1
  203. package/packages/host/dist/halt.js +16 -3
  204. package/packages/host/dist/halt.js.map +1 -1
  205. package/packages/host/dist/jsonstore.d.ts +16 -4
  206. package/packages/host/dist/jsonstore.js +32 -8
  207. package/packages/host/dist/jsonstore.js.map +1 -1
  208. package/packages/host/dist/landedbase.d.ts +41 -0
  209. package/packages/host/dist/landedbase.js +59 -0
  210. package/packages/host/dist/landedbase.js.map +1 -0
  211. package/packages/host/dist/lantls.js +2 -2
  212. package/packages/host/dist/lantls.js.map +1 -1
  213. package/packages/host/dist/limitretry.js +2 -3
  214. package/packages/host/dist/limitretry.js.map +1 -1
  215. package/packages/host/dist/localledger.js +9 -12
  216. package/packages/host/dist/localledger.js.map +1 -1
  217. package/packages/host/dist/main.js +2 -0
  218. package/packages/host/dist/main.js.map +1 -1
  219. package/packages/host/dist/opendeliveries.d.ts +4 -0
  220. package/packages/host/dist/opendeliveries.js +27 -1
  221. package/packages/host/dist/opendeliveries.js.map +1 -1
  222. package/packages/host/dist/plugins/setupcontrib.js +3 -2
  223. package/packages/host/dist/plugins/setupcontrib.js.map +1 -1
  224. package/packages/host/dist/pricefetch.d.ts +80 -0
  225. package/packages/host/dist/pricefetch.js +289 -0
  226. package/packages/host/dist/pricefetch.js.map +1 -0
  227. package/packages/host/dist/pricegap.d.ts +11 -0
  228. package/packages/host/dist/pricegap.js +30 -0
  229. package/packages/host/dist/pricegap.js.map +1 -0
  230. package/packages/host/dist/repohealthscopes.js +16 -24
  231. package/packages/host/dist/repohealthscopes.js.map +1 -1
  232. package/packages/host/dist/repos.d.ts +4 -0
  233. package/packages/host/dist/repos.js +1 -1
  234. package/packages/host/dist/repos.js.map +1 -1
  235. package/packages/host/dist/routes/apiagentpoints.d.ts +5 -0
  236. package/packages/host/dist/routes/apiagentpoints.js +48 -0
  237. package/packages/host/dist/routes/apiagentpoints.js.map +1 -0
  238. package/packages/host/dist/routes/apidictate.d.ts +2 -0
  239. package/packages/host/dist/routes/apidictate.js +27 -0
  240. package/packages/host/dist/routes/apidictate.js.map +1 -0
  241. package/packages/host/dist/routes/apihost.js +3 -2
  242. package/packages/host/dist/routes/apihost.js.map +1 -1
  243. package/packages/host/dist/routes/apirepofiles.js +3 -1
  244. package/packages/host/dist/routes/apirepofiles.js.map +1 -1
  245. package/packages/host/dist/routes/apirepowork.js +3 -2
  246. package/packages/host/dist/routes/apirepowork.js.map +1 -1
  247. package/packages/host/dist/routes/apiroutes.js +4 -1
  248. package/packages/host/dist/routes/apiroutes.js.map +1 -1
  249. package/packages/host/dist/routes/apiskills.d.ts +3 -0
  250. package/packages/host/dist/routes/apiskills.js +81 -0
  251. package/packages/host/dist/routes/apiskills.js.map +1 -0
  252. package/packages/host/dist/routes/apistats.js +2 -2
  253. package/packages/host/dist/routes/apistats.js.map +1 -1
  254. package/packages/host/dist/server/billingwire.js +5 -0
  255. package/packages/host/dist/server/billingwire.js.map +1 -1
  256. package/packages/host/dist/server/deliveries.d.ts +4 -1
  257. package/packages/host/dist/server/deliveries.js +38 -6
  258. package/packages/host/dist/server/deliveries.js.map +1 -1
  259. package/packages/host/dist/server/intentDeps.js +7 -6
  260. package/packages/host/dist/server/intentDeps.js.map +1 -1
  261. package/packages/host/dist/server/wsops.js +2 -1
  262. package/packages/host/dist/server/wsops.js.map +1 -1
  263. package/packages/host/dist/sessions/core.d.ts +1 -0
  264. package/packages/host/dist/sessions/ctxseries.js +7 -5
  265. package/packages/host/dist/sessions/ctxseries.js.map +1 -1
  266. package/packages/host/dist/sessions/drive.d.ts +6 -1
  267. package/packages/host/dist/sessions/drive.js +13 -10
  268. package/packages/host/dist/sessions/drive.js.map +1 -1
  269. package/packages/host/dist/sessions/record.js +16 -17
  270. package/packages/host/dist/sessions/record.js.map +1 -1
  271. package/packages/host/dist/sessions/sidechannel.js +1 -1
  272. package/packages/host/dist/sessions/sidechannel.js.map +1 -1
  273. package/packages/host/dist/sessions/turn.js +5 -0
  274. package/packages/host/dist/sessions/turn.js.map +1 -1
  275. package/packages/host/dist/sessions.d.ts +2 -1
  276. package/packages/host/dist/sessions.js +1 -1
  277. package/packages/host/dist/sessions.js.map +1 -1
  278. package/packages/host/dist/settle.d.ts +3 -2
  279. package/packages/host/dist/settle.js +13 -13
  280. package/packages/host/dist/settle.js.map +1 -1
  281. package/packages/host/dist/sidecar/sidecarname.d.ts +2 -0
  282. package/packages/host/dist/sidecar/sidecarname.js +5 -1
  283. package/packages/host/dist/sidecar/sidecarname.js.map +1 -1
  284. package/packages/host/dist/sidecar/sidecarroute.d.ts +1 -1
  285. package/packages/host/dist/sidecar/sidecarroute.js +5 -0
  286. package/packages/host/dist/sidecar/sidecarroute.js.map +1 -1
  287. package/packages/host/dist/sidecar.d.ts +1 -1
  288. package/packages/host/dist/sidecar.js +1 -1
  289. package/packages/host/dist/sidecar.js.map +1 -1
  290. package/packages/host/dist/skills/skillinventory.d.ts +23 -0
  291. package/packages/host/dist/skills/skillinventory.js +275 -0
  292. package/packages/host/dist/skills/skillinventory.js.map +1 -0
  293. package/packages/host/dist/skills/skilllayers.d.ts +28 -0
  294. package/packages/host/dist/skills/skilllayers.js +73 -0
  295. package/packages/host/dist/skills/skilllayers.js.map +1 -0
  296. package/packages/host/dist/skills/skillrecommend.d.ts +42 -0
  297. package/packages/host/dist/skills/skillrecommend.js +171 -0
  298. package/packages/host/dist/skills/skillrecommend.js.map +1 -0
  299. package/packages/host/dist/skills/skillrefs.d.ts +2 -0
  300. package/packages/host/dist/skills/skillrefs.js +50 -0
  301. package/packages/host/dist/skills/skillrefs.js.map +1 -0
  302. package/packages/host/dist/skills/skilluse.d.ts +57 -0
  303. package/packages/host/dist/skills/skilluse.js +242 -0
  304. package/packages/host/dist/skills/skilluse.js.map +1 -0
  305. package/packages/host/dist/skills/skillweight.d.ts +18 -0
  306. package/packages/host/dist/skills/skillweight.js +69 -0
  307. package/packages/host/dist/skills/skillweight.js.map +1 -0
  308. package/packages/host/dist/skills/skillwrite.d.ts +56 -0
  309. package/packages/host/dist/skills/skillwrite.js +183 -0
  310. package/packages/host/dist/skills/skillwrite.js.map +1 -0
  311. package/packages/host/dist/sysstat.d.ts +34 -1
  312. package/packages/host/dist/sysstat.js +82 -14
  313. package/packages/host/dist/sysstat.js.map +1 -1
  314. package/packages/host/dist/tokenscan.js +5 -2
  315. package/packages/host/dist/tokenscan.js.map +1 -1
  316. package/packages/host/dist/tokenstats.js +7 -4
  317. package/packages/host/dist/tokenstats.js.map +1 -1
  318. package/packages/host/dist/transcript/transcriptparse.js +2 -2
  319. package/packages/host/dist/transcript/transcriptparse.js.map +1 -1
  320. package/packages/host/dist/waitclock.d.ts +12 -0
  321. package/packages/host/dist/waitclock.js +23 -0
  322. package/packages/host/dist/waitclock.js.map +1 -0
  323. package/packages/host/dist/worktreeleftover.js +13 -15
  324. package/packages/host/dist/worktreeleftover.js.map +1 -1
  325. package/packages/web/dist/assets/demo-DHkwSmU5.js +26 -0
  326. package/packages/web/dist/assets/{icons-D8RlmSLR.js → icons-5lVTFNUU.js} +1 -1
  327. package/packages/web/dist/assets/index-Bh4cH6X8.js +170 -0
  328. package/packages/web/dist/assets/index-F7VHtsLI.css +1 -0
  329. package/packages/web/dist/assets/shared-BvQMg9ra.js +51 -0
  330. package/packages/web/dist/assets/sheets-Cwi72V02.js +257 -0
  331. package/packages/web/dist/assets/sheets-DjU2XiUd.css +1 -0
  332. package/packages/web/dist/build-id.txt +1 -1
  333. package/packages/web/dist/buildstamp.json +1 -1
  334. package/packages/web/dist/index.html +7 -7
  335. package/packages/web/dist/sw.js +2 -2
  336. package/release.json +11 -3
  337. package/packages/web/dist/assets/demo-mKJo0QVO.js +0 -26
  338. package/packages/web/dist/assets/index-B6f7Lcp1.js +0 -170
  339. package/packages/web/dist/assets/index-DQIK94fc.css +0 -1
  340. package/packages/web/dist/assets/shared-Cd69oxHd.js +0 -51
  341. package/packages/web/dist/assets/sheets-BImsk1_Y.js +0 -256
  342. package/packages/web/dist/assets/sheets-DoUhPGK0.css +0 -1
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Skills and plugins switch — the pure logic both ends agree on: which level wins, what a write
3
+ * to a settings file may touch, and what a change set saves. Degrades to refusal-in-words, never
4
+ * to a rewrite of a file it could not read.
5
+ */
6
+ import { CHARS_PER_TOKEN } from "./contextweight.js";
7
+ import { SKILL_STATES, } from "./wire/skills.js";
8
+ const RANK = { "on": 0, "name-only": 1, "user-invocable-only": 2, "off": 3 };
9
+ const isState = (v) => typeof v === "string" && SKILL_STATES.includes(v);
10
+ const own = (o, k) => !!o && Object.prototype.hasOwnProperty.call(o, k);
11
+ export function resolveSkillState(id, layers, locks = {}) {
12
+ let locked = null;
13
+ for (const l of [locks.policy, locks.flag]) {
14
+ const v = own(l, id) ? l[id] : undefined;
15
+ if (isState(v) && (locked === null || RANK[v] > RANK[locked]))
16
+ locked = v;
17
+ }
18
+ if (locked)
19
+ return { state: locked, from: "locked" };
20
+ const order = [["local", "repo-local"], ["project", "repo-shared"], ["user", "global"]];
21
+ for (const [k, level] of order) {
22
+ const m = layers[k];
23
+ const v = own(m, id) ? m[id] : undefined;
24
+ if (isState(v))
25
+ return { state: v, from: level };
26
+ }
27
+ return { state: "on", from: "default" };
28
+ }
29
+ export function resolvePluginEnabled(id, layers, locks = {}, cliDefault = true) {
30
+ const bools = [locks.policy, locks.flag].map((l) => (own(l, id) ? l[id] : undefined)).filter((v) => typeof v === "boolean");
31
+ if (bools.length)
32
+ return { enabled: !bools.includes(false), from: "locked" };
33
+ const order = [["local", "repo-local"], ["project", "repo-shared"], ["user", "global"]];
34
+ for (const [k, level] of order) {
35
+ const m = layers[k];
36
+ const v = own(m, id) ? m[id] : undefined;
37
+ if (typeof v === "boolean")
38
+ return { enabled: v, from: level };
39
+ }
40
+ return { enabled: cliDefault, from: "default" };
41
+ }
42
+ const KEY_RE = /^[A-Za-z0-9._:@-]{1,255}$/;
43
+ const FORBIDDEN_KEYS = new Set(["__proto__", "constructor", "prototype"]);
44
+ const PLUGIN_RE = /^[A-Za-z0-9._-]{1,127}@[A-Za-z0-9._-]{1,127}$/;
45
+ /** null = fine, else a sentence. */
46
+ export function validateChange(c) {
47
+ if (!c || (c.kind !== "skill" && c.kind !== "plugin") || typeof c.id !== "string")
48
+ return "A change needs a kind and an id.";
49
+ if (FORBIDDEN_KEYS.has(c.id) || !KEY_RE.test(c.id))
50
+ return `"${c.id.slice(0, 60)}" is not a name this screen can write.`;
51
+ if (c.kind === "plugin") {
52
+ if (!PLUGIN_RE.test(c.id))
53
+ return `"${c.id}" is not a plugin id (name@marketplace).`;
54
+ if (c.to !== true && c.to !== false && c.to !== "inherit")
55
+ return `A plugin is switched on, off or back to inherit, not "${String(c.to)}".`;
56
+ return null;
57
+ }
58
+ if (c.to !== "inherit" && !isState(c.to))
59
+ return `"${String(c.to)}" is not one of the four skill states.`;
60
+ return null;
61
+ }
62
+ function indentOf(text) {
63
+ const m = /^[ \t]+(?=")/m.exec(text);
64
+ if (!m)
65
+ return 2;
66
+ return m[0].includes("\t") ? "\t" : m[0].length;
67
+ }
68
+ const show = (v) => (v === undefined ? "inherit" : String(v));
69
+ /**
70
+ * Apply `changes` to a settings file's text. Touches only `skillOverrides` and `enabledPlugins`;
71
+ * a new key appends, an existing key keeps its place, `inherit` deletes the key (and the object
72
+ * only if this call emptied it). `text: null` = no file yet. Refuses an unparseable file.
73
+ */
74
+ export function withSkillSettings(text, changes) {
75
+ for (const c of changes) {
76
+ const bad = validateChange(c);
77
+ if (bad)
78
+ return { ok: false, error: bad };
79
+ }
80
+ let obj = {};
81
+ let indent = 2;
82
+ let trailingNl = true;
83
+ if (text != null && text.trim() !== "") {
84
+ let parsed;
85
+ try {
86
+ parsed = JSON.parse(text);
87
+ }
88
+ catch (e) {
89
+ return { ok: false, error: `not valid JSON, left as it is (${e.message})` };
90
+ }
91
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
92
+ return { ok: false, error: "not a JSON object, left as it is" };
93
+ obj = parsed;
94
+ indent = indentOf(text);
95
+ trailingNl = text.endsWith("\n");
96
+ }
97
+ for (const k of ["skillOverrides", "enabledPlugins"]) {
98
+ const v = obj[k];
99
+ if (v !== undefined && (!v || typeof v !== "object" || Array.isArray(v)))
100
+ return { ok: false, error: `"${k}" is not an object, left as it is` };
101
+ }
102
+ const changed = [];
103
+ for (const c of changes) {
104
+ const field = c.kind === "skill" ? "skillOverrides" : "enabledPlugins";
105
+ const had = Object.prototype.hasOwnProperty.call(obj, field);
106
+ const map = (had ? obj[field] : {});
107
+ const before = own(map, c.id) ? map[c.id] : undefined;
108
+ if (c.to === "inherit") {
109
+ if (before === undefined)
110
+ continue;
111
+ delete map[c.id];
112
+ if (had && Object.keys(map).length === 0)
113
+ delete obj[field];
114
+ }
115
+ else {
116
+ if (before === c.to)
117
+ continue;
118
+ map[c.id] = c.to;
119
+ if (!had)
120
+ obj[field] = map;
121
+ }
122
+ changed.push({ id: c.id, from: show(before), to: show(c.to === "inherit" ? undefined : c.to) });
123
+ }
124
+ if (changed.length === 0 && text != null)
125
+ return { ok: true, text, changed };
126
+ return { ok: true, text: JSON.stringify(obj, null, indent) + (trailingNl ? "\n" : ""), changed };
127
+ }
128
+ /** The listing line a skill costs in a given state: name-only keeps "- name", the others drop it or keep all of it. */
129
+ const NAME_LINE = 2;
130
+ export function lineCost(row, state) {
131
+ if (row.listingChars === undefined)
132
+ return null;
133
+ if (state === "on")
134
+ return row.listingChars;
135
+ if (state === "name-only")
136
+ return Math.min(row.listingChars, row.id.length + NAME_LINE);
137
+ return 0;
138
+ }
139
+ /**
140
+ * Chars a change set would remove from the skill listing (negative = adds). Unmeasured rows and
141
+ * `inherit` (whose result depends on the other levels) contribute nothing and are counted.
142
+ */
143
+ export function savingsOf(rows, changes) {
144
+ const byId = new Map(rows.map((r) => [`${r.kind}:${r.id}`, r]));
145
+ let chars = 0;
146
+ let unmeasured = 0;
147
+ for (const c of changes) {
148
+ const r = byId.get(`${c.kind}:${c.id}`);
149
+ if (!r || c.to === "inherit") {
150
+ unmeasured++;
151
+ continue;
152
+ }
153
+ if (r.kind === "skill" && c.kind === "skill") {
154
+ if (!isState(c.to))
155
+ continue;
156
+ const a = lineCost(r, r.effective);
157
+ const b = lineCost(r, c.to);
158
+ if (a === null || b === null) {
159
+ unmeasured++;
160
+ continue;
161
+ }
162
+ chars += a - b;
163
+ }
164
+ else if (r.kind === "plugin" && c.kind === "plugin" && typeof c.to === "boolean") {
165
+ if (c.to === r.enabled)
166
+ continue;
167
+ if (r.listingChars === undefined) {
168
+ unmeasured++;
169
+ continue;
170
+ }
171
+ chars += c.to ? -r.listingChars : r.listingChars;
172
+ }
173
+ }
174
+ return { chars, tokens: Math.round(chars / CHARS_PER_TOKEN), unmeasured };
175
+ }
176
+ //# sourceMappingURL=skillstate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillstate.js","sourceRoot":"","s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EAAE,CAAC;AAC5E,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** The sentences of the skills and plugins switch, worded once for phone, host and VS Code. */
2
+ import type { SwitchLevel } from "./wire/skills.js";
3
+ export declare const SKILL_NEW_SESSIONS_ONLY = "Changes reach new sessions only \u2014 a session that is already running keeps what it was started with.";
4
+ export declare function skillFileLine(level: SwitchLevel, path: string): string;
5
+ export declare const skillPluginSkillLine: (plugin: string) => string;
6
+ export declare const skillPluginNotSwitchable: (plugin: string) => string;
7
+ export declare const SKILL_UNMEASURED = "size not measured";
8
+ export declare const skillLayerUnreadable: (path: string, why: string) => string;
9
+ export declare const skillRevConflict: (path: string) => string;
10
+ export declare const skillSavingsLine: (tokens: number, unmeasured: number) => string;
@@ -0,0 +1,18 @@
1
+ export const SKILL_NEW_SESSIONS_ONLY = "Changes reach new sessions only — a session that is already running keeps what it was started with.";
2
+ export function skillFileLine(level, path) {
3
+ const who = level === "global" ? "every repo on this desktop" : level === "repo-shared" ? "this repo, shared with everyone who clones it" : "this repo, on this desktop only";
4
+ return `Writes ${path} (${who}).`;
5
+ }
6
+ export const skillPluginSkillLine = (plugin) => `follows ${plugin}`;
7
+ export const skillPluginNotSwitchable = (plugin) => `This skill comes with ${plugin}; the CLI only switches it with the whole plugin.`;
8
+ export const SKILL_UNMEASURED = "size not measured";
9
+ export const skillLayerUnreadable = (path, why) => `${path} was not changed: ${why}`;
10
+ export const skillRevConflict = (path) => `${path} changed since this screen read it. Nothing was written; reload and choose again.`;
11
+ export const skillSavingsLine = (tokens, unmeasured) => {
12
+ const more = unmeasured > 0 ? `, plus ${unmeasured} unmeasured` : "";
13
+ if (tokens === 0)
14
+ return `No change in the skill listing${more}.`;
15
+ const n = Math.abs(tokens);
16
+ return tokens > 0 ? `Up to about ${n} tokens fewer per turn${more}.` : `Up to about ${n} tokens more per turn${more}.`;
17
+ };
18
+ //# sourceMappingURL=skillwords.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillwords.js","sourceRoot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AAC,CAAC,eAAe,CAAC,wBAAwB,IAAI,GAAG,CAAC;AACzH,CAAC,CAAC"}
@@ -4,8 +4,12 @@
4
4
  * host `agentreadings.ts`). Four readings, one row per ISO week (Monday, the
5
5
  * host's local day), oldest first:
6
6
  *
7
- * - `explore` — how many input-side tokens a FRESH session spends before its
8
- * first file edit: how navigable the repo is for an agent. Lower is better.
7
+ * - `start` — what a fresh session's first request carried: median tokens,
8
+ * median chars per part, and the subagents' own start. MEASURED off the logs
9
+ * (never the skills screen's estimated weights; the two are never summed).
10
+ * - `explore` — "Before the first edit": input-side tokens AND look calls a
11
+ * fresh session spends before its first file edit, over one population.
12
+ * - `requests` — median requests of a fresh session that committed.
9
13
  * - `rework` — the share of the week's tokens spent in sessions whose work
10
14
  * was repairing earlier work, beside feature and UNKNOWN (never folded into
11
15
  * feature).
@@ -19,6 +23,8 @@
19
23
  * `{ absent }`. A total always travels with its split (`TokenTotals`).
20
24
  */
21
25
  import type { TokenTotals } from "./telemetry.js";
26
+ import type { SeriesValue } from "../agentseries/types.js";
27
+ import type { AgentMarker } from "../agentseries/types.js";
22
28
  /** A reading that could not be taken this week, and why — never a zero. */
23
29
  export interface AgentReadingAbsent {
24
30
  absent: string;
@@ -35,8 +41,26 @@ export interface AgentExploreReading {
35
41
  medianTok: number;
36
42
  /** That same session's split: output is zero by construction (input-side only). */
37
43
  split: TokenTotals;
38
- /** Requests that session made before its first edit. */
44
+ /** Requests that session made before its first edit. Kept on the wire for older phones; not drawn
45
+ * (the look-call median says what it said, more tightly). */
39
46
  medianRequests: number;
47
+ /** Median look calls before the first edit over the same sessions (`LOOK_RULE_TEXT`), the agent
48
+ * series' `look` reading. Absent FIELD on an older host. */
49
+ looks?: SeriesValue;
50
+ }
51
+ /** What a fresh session's first request carried this week (agent series `start`, `parts`, `subStart`). */
52
+ export interface AgentStartReading {
53
+ /** Fresh, non-subagent sessions that started this week (headless included). */
54
+ fresh: number;
55
+ /** Median first-request tokens (input + cache read + cache write), fresh interactive sessions. */
56
+ tok: SeriesValue;
57
+ /** Median chars per part over the same sessions, in `START_PARTS` order; a part no session measured is not listed. */
58
+ parts: {
59
+ id: StartPart;
60
+ chars: SeriesValue;
61
+ }[];
62
+ /** Median first-request tokens of the subagent logs that started this week. */
63
+ sub: SeriesValue;
40
64
  }
41
65
  /** Which bucket a session's tokens were filed under. */
42
66
  export type ReworkClass = "rework" | "feature" | "unknown";
@@ -65,10 +89,44 @@ export interface AgentEscapedReading {
65
89
  /** Backlog items with category `bug` created this week that are still on the backlog. */
66
90
  bugItems: number | AgentReadingAbsent;
67
91
  }
92
+ /**
93
+ * What the week cost, off the token ledger's per-repo day rows (the same rows
94
+ * the token-stats screen's *By repo* and the health score's context line read):
95
+ * every request the repo's conversations made, subagents included.
96
+ */
97
+ export interface AgentSpendReading {
98
+ requests: number;
99
+ /** Requests on a model with a list price: the denominator of a price per request. */
100
+ pricedRequests: number;
101
+ /** List-price dollars — a counterfactual off one dated table, never a bill. */
102
+ usd: number;
103
+ /** Input + cache read + cache write over `requests`: the context they sent. Absent on an older ledger. */
104
+ ctxTok?: number;
105
+ }
106
+ /** Who did the week's work: the conversations and their subagents, off the same logs as `rework`. */
107
+ export interface AgentActivityReading {
108
+ /** Conversations that spent tokens this week (a conversation over two weeks counts in both). */
109
+ sessions: number;
110
+ /** Of those, the ones that started this week. */
111
+ started: number;
112
+ /** Subagent logs that spent tokens this week. */
113
+ agents: number;
114
+ /** Tokens (all four kinds) in the conversations' own logs, and in their subagents' — the split of `rework.totalTok`. */
115
+ mainTok: number;
116
+ agentTok: number;
117
+ }
68
118
  export interface AgentReadingsWeek {
69
119
  /** ISO week, its Monday as `YYYY-MM-DD` (host local day). */
70
120
  week: string;
121
+ /** Absent FIELD on an older host; absent READING when the ledger has no row for the repo that week. */
122
+ spend?: AgentSpendReading | AgentReadingAbsent;
123
+ /** Absent FIELD on an older host. */
124
+ activity?: AgentActivityReading | AgentReadingAbsent;
125
+ /** Absent FIELD on an older host. */
126
+ start?: AgentStartReading | AgentReadingAbsent;
71
127
  explore: AgentExploreReading | AgentReadingAbsent;
128
+ /** Median requests of fresh sessions that committed, in the week they started. Absent FIELD on an older host. */
129
+ requests?: SeriesValue;
72
130
  rework: AgentReworkReading | AgentReadingAbsent;
73
131
  compact: AgentCompactReading | AgentReadingAbsent;
74
132
  escaped: AgentEscapedReading;
@@ -79,6 +137,11 @@ export interface AgentReadingRules {
79
137
  rework: string;
80
138
  compact: string;
81
139
  escaped: string;
140
+ /** Absent on an older host. */
141
+ spend?: string;
142
+ activity?: string;
143
+ start?: string;
144
+ requests?: string;
82
145
  }
83
146
  export interface AgentReadingsDoc {
84
147
  ok: true;
@@ -102,3 +165,84 @@ export type AgentReadingsResponse = AgentReadingsDoc | {
102
165
  export declare const AGENT_READING_WEEKS = 12;
103
166
  /** True when the reading is the absent sentence rather than a value. */
104
167
  export declare function isAgentAbsent(x: unknown): x is AgentReadingAbsent;
168
+ /** What the first request carried, by part, in display order. Closed: a part not listed is `other`. */
169
+ export type StartPart = "system" | "tools" | "claudeMd" | "memory" | "skills" | "deferredTools" | "agents" | "hooks" | "session" | "other";
170
+ /**
171
+ * The parts in display order, with the label a person reads — the SAME names the per-session
172
+ * "what every turn carries" list uses (`alwaysonwords.ts` `carriedLabel`), so one part has one
173
+ * name app-wide; `claudeMd` and `memory` are that list's "instruction files" cut by file type.
174
+ */
175
+ export declare const START_PARTS: readonly {
176
+ id: StartPart;
177
+ label: string;
178
+ }[];
179
+ /** What counts as a look before the first edit, in a sentence the region's `?` quotes. */
180
+ export declare const LOOK_RULE_TEXT = "A look is a call that only reads: Read, Grep, Glob, LS or NotebookRead, or a shell command that starts with grep, rg, find, ls, cat, head, tail, sed -n, wc, jq, tree or git log, show, diff, grep, blame or status (a leading cd \u2026 && is ignored). Looks are counted up to the session's first file edit; a session that never edits has no count.";
181
+ export interface AgentPoint {
182
+ /** The log's own id: the conversation's session id, or a subagent's path under it. */
183
+ id: string;
184
+ /** First record's time (ms). */
185
+ t0: number;
186
+ /** The repo the session ran in (worktrees folded in). */
187
+ repo: string;
188
+ /** Began as a new conversation: not a fork, a continuation or a headless run. */
189
+ fresh: boolean;
190
+ headless: boolean;
191
+ /** A subagent's log. */
192
+ sub?: boolean;
193
+ /** Model of the first counted request, as logged. */
194
+ model?: string;
195
+ /** The CLI version that wrote the log. */
196
+ cli?: string;
197
+ /** Tokens the first request carried: input + cache read + cache write. */
198
+ start?: number;
199
+ /** Characters per part of that start context; a part never observed is absent. */
200
+ parts?: Partial<Record<StartPart, number>>;
201
+ /** Read-only calls before the first edit; absent when the session never edited. */
202
+ look?: number;
203
+ /** Counted requests (a streamed reply counted once). */
204
+ req: number;
205
+ /** A `git commit` succeeded in the session. Absent on a subagent (not read there). */
206
+ commit?: boolean;
207
+ }
208
+ export interface AgentPointsDoc {
209
+ ok: true;
210
+ /** Newest first: at most `AGENT_POINTS_CAP` fresh conversations (a fork, a continuation or a headless run is no reading's session, so it is left off) and `AGENT_SUB_POINTS_CAP` subagent logs. */
211
+ points: AgentPoint[];
212
+ /** Points left off by the caps (the oldest of each kind), 0 when none. */
213
+ cut: number;
214
+ /** The repos asked about: one for a repo's route, every known one otherwise. */
215
+ repos: string[];
216
+ rules: {
217
+ look: string;
218
+ };
219
+ scannedAt: number;
220
+ logs: number;
221
+ reread: number;
222
+ }
223
+ export type AgentPointsResponse = AgentPointsDoc | {
224
+ ok: false;
225
+ error: string;
226
+ pending?: true;
227
+ };
228
+ /** The window the points cover: the same weeks the readings do. */
229
+ export declare const AGENT_POINT_WEEKS = 12;
230
+ /**
231
+ * Caps, per kind. A point is ~300 bytes of JSON, so these keep a response near 1.5 MB, which a phone
232
+ * parses without a stall. Subagent logs outnumber conversations ~5:1 on a busy repo (measured: 20,000
233
+ * of 24,000 points in twelve weeks), so one shared cap would be all subagents of the last few days
234
+ * and no conversation at all; each kind keeps its own newest.
235
+ */
236
+ export declare const AGENT_POINTS_CAP = 3000;
237
+ export declare const AGENT_SUB_POINTS_CAP = 2000;
238
+ /** What changed, drawn beside the readings (`GET /api/repos/:id/agentmarkers`). Markers say what changed, never whether it helped. */
239
+ export interface AgentMarkersDoc {
240
+ ok: true;
241
+ markers: AgentMarker[];
242
+ /** One sentence per source that could not be read: a source missing here is unknown, not unchanged. */
243
+ absent: string[];
244
+ }
245
+ export type AgentMarkersResponse = AgentMarkersDoc | {
246
+ ok: false;
247
+ error: string;
248
+ };
@@ -4,4 +4,33 @@ export const AGENT_READING_WEEKS = 12;
4
4
  export function isAgentAbsent(x) {
5
5
  return typeof x === "object" && x !== null && typeof x.absent === "string";
6
6
  }
7
+ /**
8
+ * The parts in display order, with the label a person reads — the SAME names the per-session
9
+ * "what every turn carries" list uses (`alwaysonwords.ts` `carriedLabel`), so one part has one
10
+ * name app-wide; `claudeMd` and `memory` are that list's "instruction files" cut by file type.
11
+ */
12
+ export const START_PARTS = [
13
+ { id: "system", label: "system prompt" },
14
+ { id: "tools", label: "tool schemas" },
15
+ { id: "claudeMd", label: "instruction files: CLAUDE.md" },
16
+ { id: "memory", label: "instruction files: auto-memory" },
17
+ { id: "skills", label: "skill listing" },
18
+ { id: "deferredTools", label: "deferred tool names" },
19
+ { id: "agents", label: "subagent listing" },
20
+ { id: "hooks", label: "hook context" },
21
+ { id: "session", label: "session context" },
22
+ { id: "other", label: "MCP instructions and other" },
23
+ ];
24
+ /** What counts as a look before the first edit, in a sentence the region's `?` quotes. */
25
+ export const LOOK_RULE_TEXT = "A look is a call that only reads: Read, Grep, Glob, LS or NotebookRead, or a shell command that starts with grep, rg, find, ls, cat, head, tail, sed -n, wc, jq, tree or git log, show, diff, grep, blame or status (a leading cd … && is ignored). Looks are counted up to the session's first file edit; a session that never edits has no count.";
26
+ /** The window the points cover: the same weeks the readings do. */
27
+ export const AGENT_POINT_WEEKS = AGENT_READING_WEEKS;
28
+ /**
29
+ * Caps, per kind. A point is ~300 bytes of JSON, so these keep a response near 1.5 MB, which a phone
30
+ * parses without a stall. Subagent logs outnumber conversations ~5:1 on a busy repo (measured: 20,000
31
+ * of 24,000 points in twelve weeks), so one shared cap would be all subagents of the last few days
32
+ * and no conversation at all; each kind keeps its own newest.
33
+ */
34
+ export const AGENT_POINTS_CAP = 3000;
35
+ export const AGENT_SUB_POINTS_CAP = 2000;
7
36
  //# sourceMappingURL=agentreadings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agentreadings.js","sourceRoot":"","sources":["../../src/wire/agentreadings.ts"],"names":[],"mappings":"AA2GA,wCAAwC;AACxC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC,wEAAwE;AACxE,MAAM,UAAU,aAAa,CAAC,CAAU;IACtC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,OAAQ,CAAwB,CAAC,MAAM,KAAK,QAAQ,CAAC;AACrG,CAAC"}
1
+ {"version":3,"file":"agentreadings.js","sourceRoot":"","sources":["../../src/wire/agentreadings.ts"],"names":[],"mappings":"AA0KA,wCAAwC;AACxC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC,wEAAwE;AACxE,MAAM,UAAU,aAAa,CAAC,CAAU;IACtC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,OAAQ,CAAwB,CAAC,MAAM,KAAK,QAAQ,CAAC;AACrG,CAAC;AAUD;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgD;IACtE,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE;IACxC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE;IACtC,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,8BAA8B,EAAE;IACzD,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,gCAAgC,EAAE;IACzD,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE;IACxC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,qBAAqB,EAAE;IACrD,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,kBAAkB,EAAE;IAC3C,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE;IACtC,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;IAC3C,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,4BAA4B,EAAE;CACrD,CAAC;AAEF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,cAAc,GACzB,qVAAqV,CAAC;AA8CxV,mEAAmE;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACrD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC"}
@@ -123,6 +123,8 @@ export interface BackendInfo {
123
123
  modes?: true;
124
124
  /** The phone's slash sheet lists the backend's OWN commands (`slash` keeps meaning claude's set and header chips). */
125
125
  commands?: true;
126
+ /** The skills and plugins switch (settings files of the claude family) is offered; absent = not offered, never `false`. */
127
+ skillSwitch?: true;
126
128
  /** How the core's repo instructions reach this backend by default (the session's actual: `SessionInfo.told`). */
127
129
  told?: "plugin-dir" | "env-file" | "config" | "flag" | "none";
128
130
  /**
@@ -139,6 +139,10 @@ export interface CostWindowDoc {
139
139
  /** Tokens no list price covered — counted, never charged zero. */
140
140
  unpriced: TokenTotals;
141
141
  pricesAsOf: string;
142
+ /** `list`: the rates were read off Anthropic's price page on `pricesAsOf`.
143
+ * `builtin`: the table shipped with this version, dated `pricesAsOf`.
144
+ * Absent on an older host — which always meant the built-in table. */
145
+ pricesFrom?: "list" | "builtin";
142
146
  scannedAt: number;
143
147
  /** Records in `totals` that are in NO hour (no readable timestamp) and that COULD fall in this
144
148
  * window — only logs last written at or after `fromHour` count (a record is never later than
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Setting up local dictation from the phone, on the wire.
3
+ *
4
+ * The desktop installs whisper.cpp (macOS brew) and downloads ONE chosen ggml
5
+ * model from upstream on a person's tap — never bundled, never automatic. The
6
+ * model table itself is `dictatemodels.ts`; these are the shapes that cross.
7
+ */
8
+ /** A model the person may choose, as the phone draws it (the table's row less
9
+ * the url and hash: the host holds those). */
10
+ export interface DictateModelChoice {
11
+ id: string;
12
+ file: string;
13
+ bytes: number;
14
+ note: string;
15
+ recommended: boolean;
16
+ /** This model's file is already in the model directory at the right size. */
17
+ installed: boolean;
18
+ }
19
+ /** What `POST /api/host/dictate/setup` takes. */
20
+ export interface DictateSetupRequest {
21
+ model: string;
22
+ }
23
+ export type DictateSetupStep = "engine" | "disk" | "download" | "verify";
24
+ /** `GET /api/host/dictate/setup`. A failure is a SENTENCE a person can act on;
25
+ * there is no auto-retry — the next attempt is another POST. */
26
+ export type DictateSetupState = {
27
+ state: "idle";
28
+ } | {
29
+ state: "running";
30
+ model: string;
31
+ step: DictateSetupStep;
32
+ bytesDone: number;
33
+ bytesTotal: number;
34
+ } | {
35
+ state: "done";
36
+ model: string;
37
+ } | {
38
+ state: "failed";
39
+ model: string;
40
+ step: DictateSetupStep;
41
+ reason: string;
42
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Setting up local dictation from the phone, on the wire.
3
+ *
4
+ * The desktop installs whisper.cpp (macOS brew) and downloads ONE chosen ggml
5
+ * model from upstream on a person's tap — never bundled, never automatic. The
6
+ * model table itself is `dictatemodels.ts`; these are the shapes that cross.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=dictatesetup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictatesetup.js","sourceRoot":"","sources":["../../src/wire/dictatesetup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -42,6 +42,23 @@ export type HostCoreMsg = HostUpdatesMsg | {
42
42
  updateKey?: string;
43
43
  tlsPort?: number;
44
44
  tlsSpki?: string;
45
+ /** The rates this host read off Anthropic's price page, so the phone's own cost hints match the
46
+ * host's. Absent = the host prices from its built-in table (or is older): the phone uses its own. */
47
+ prices?: {
48
+ rates: Record<string, {
49
+ input: number;
50
+ output: number;
51
+ cacheRead?: number;
52
+ }>;
53
+ /** Long-prompt cards (Haiku 5.5 past 100K tokens); absent from an older host. */
54
+ longPrompt?: Record<string, {
55
+ input: number;
56
+ output: number;
57
+ cacheRead?: number;
58
+ overTokens: number;
59
+ }>;
60
+ fetchedAt: number;
61
+ };
45
62
  }
46
63
  /**
47
64
  * The daemon is going down (SIGTERM/SIGINT — `npm run restart` is one),
@@ -298,7 +315,10 @@ export type HostCoreMsg = HostUpdatesMsg | {
298
315
  * session's worktree, plus its background shells (the same `shellList` a
299
316
  * status poll would publish) — a close sheet asking "what's at stake here"
300
317
  * needs both facts in the one reply, not a second round trip. Absent means
301
- * the same as `SessionInfo.shellList` absent: could not read, not "none". */
318
+ * the same as `SessionInfo.shellList` absent: could not read, not "none".
319
+ * `unmergedUnknown: true` = the host could not measure `unmerged` (no base
320
+ * branch found, or git failed); `unmerged` is then 0 and means nothing.
321
+ * Absent = measured (an older host). */
302
322
  | {
303
323
  t: "session.closecheck";
304
324
  id: string;
@@ -306,6 +326,7 @@ export type HostCoreMsg = HostUpdatesMsg | {
306
326
  branch: string;
307
327
  dirty: boolean;
308
328
  unmerged: number;
329
+ unmergedUnknown?: boolean;
309
330
  isMain: boolean;
310
331
  mainBranch: string;
311
332
  shells?: SessionShell[];