fnloom 0.3.0 → 0.4.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 (587) hide show
  1. package/README.md +27 -20
  2. package/package.json +14 -11
  3. package/packages/build/package.json +2 -2
  4. package/packages/build/src/tests.ts +2 -2
  5. package/packages/cli/package.json +1 -1
  6. package/packages/cli/src/cli.ts +2 -2
  7. package/packages/cli/src/command.ts +2 -2
  8. package/packages/cli/src/commands/install.ts +1 -1
  9. package/packages/cli/src/commands/mcp.ts +6 -6
  10. package/packages/cli/src/commands/store.ts +3 -3
  11. package/packages/cli/src/hub.ts +25 -25
  12. package/packages/cli/src/index.ts +1 -1
  13. package/packages/cli/src/io.ts +2 -2
  14. package/packages/cli/src/local.ts +7 -7
  15. package/packages/cli/src/premade.ts +1 -1
  16. package/packages/core/package.json +4 -4
  17. package/packages/core/src/auto-pair.ts +1 -1
  18. package/packages/core/src/connections.ts +1 -14
  19. package/packages/core/src/context-graph.ts +1 -1
  20. package/packages/core/src/data.ts +1 -1
  21. package/packages/core/src/https.ts +2 -2
  22. package/packages/core/src/identity.ts +1 -1
  23. package/packages/core/src/image-embeddings.ts +1 -1
  24. package/packages/core/src/index.ts +5 -7
  25. package/packages/core/src/link.ts +1 -1
  26. package/packages/core/src/manifest.ts +2 -2
  27. package/packages/core/src/mention-search.ts +1 -1
  28. package/packages/core/src/model-calls.ts +1 -1
  29. package/packages/core/src/package.ts +1 -1
  30. package/packages/core/src/ports.ts +2 -2
  31. package/packages/core/src/query.ts +1 -1
  32. package/packages/core/src/records/chat.ts +1 -1
  33. package/packages/core/src/records/runs.ts +1 -1
  34. package/packages/core/src/records/spend.ts +4 -0
  35. package/packages/core/src/registries.ts +9 -3
  36. package/packages/core/src/sso.ts +2 -2
  37. package/packages/core/src/stores.ts +1 -1
  38. package/packages/core/src/suggestions.ts +2 -2
  39. package/packages/core/src/system-pages.ts +32 -6
  40. package/packages/core/src/tables.ts +233 -0
  41. package/packages/core/src/visuals.ts +47 -139
  42. package/packages/core/src/web.ts +2 -2
  43. package/packages/core/src/widgets-v1.ts +78 -1
  44. package/packages/hub/package.json +13 -11
  45. package/packages/hub/src/api/admin-ops.ts +5 -5
  46. package/packages/hub/src/api/auth.ts +2 -2
  47. package/packages/hub/src/api/https.ts +6 -6
  48. package/packages/hub/src/api/identities.ts +1 -1
  49. package/packages/hub/src/api/reads.ts +1 -1
  50. package/packages/hub/src/api/secrets.ts +1 -1
  51. package/packages/hub/src/api/serve.ts +2 -2
  52. package/packages/hub/src/api/sso-route.ts +2 -2
  53. package/packages/hub/src/api/sso.ts +6 -6
  54. package/packages/hub/src/api/testing/rig.ts +1 -1
  55. package/packages/hub/src/api/tls.ts +2 -2
  56. package/packages/hub/src/api/web/auth.ts +1 -1
  57. package/packages/hub/src/api/web/find.ts +1 -1
  58. package/packages/hub/src/api/web/pages.ts +4 -3
  59. package/packages/hub/src/api/web/pickers.ts +4 -4
  60. package/packages/hub/src/boot/env.ts +82 -78
  61. package/packages/hub/src/boot/hub-fns.ts +1 -1
  62. package/packages/hub/src/boot/identity.ts +2 -2
  63. package/packages/hub/src/boot/index.ts +1 -1
  64. package/packages/hub/src/boot/info.ts +1 -1
  65. package/packages/hub/src/boot/keys.ts +6 -6
  66. package/packages/hub/src/boot/log.ts +4 -4
  67. package/packages/hub/src/boot/modules.ts +4 -4
  68. package/packages/hub/src/boot/services.ts +9 -9
  69. package/packages/hub/src/boot/start.ts +23 -23
  70. package/packages/hub/src/chat/cache.ts +1 -1
  71. package/packages/hub/src/chat/chat.ts +1 -1
  72. package/packages/hub/src/chat/compare.ts +2 -2
  73. package/packages/hub/src/chat/deliveries.ts +1 -1
  74. package/packages/hub/src/chat/deps.ts +3 -3
  75. package/packages/hub/src/chat/enrich.ts +7 -7
  76. package/packages/hub/src/chat/env.ts +20 -20
  77. package/packages/hub/src/chat/mention-requests.ts +1 -1
  78. package/packages/hub/src/chat/mention-search.ts +1 -1
  79. package/packages/hub/src/chat/mentions.ts +3 -3
  80. package/packages/hub/src/chat/notifications.ts +2 -2
  81. package/packages/hub/src/chat/presence.ts +2 -2
  82. package/packages/hub/src/chat/sessions.ts +2 -2
  83. package/packages/hub/src/chat/suggestions.ts +8 -8
  84. package/packages/hub/src/chat/testing.ts +1 -1
  85. package/packages/hub/src/chat/turns.ts +6 -6
  86. package/packages/hub/src/chat/undo.ts +1 -1
  87. package/packages/hub/src/connections/create.ts +1 -1
  88. package/packages/hub/src/connections/env.ts +2 -2
  89. package/packages/hub/src/connections/service.ts +5 -9
  90. package/packages/hub/src/contextor/contextors.ts +9 -9
  91. package/packages/hub/src/contextor/crawl.ts +1 -1
  92. package/packages/hub/src/contextor/create.ts +5 -5
  93. package/packages/hub/src/contextor/dynamic.ts +5 -5
  94. package/packages/hub/src/contextor/env.ts +46 -46
  95. package/packages/hub/src/contextor/injected.ts +1 -1
  96. package/packages/hub/src/contextor/limits.ts +9 -9
  97. package/packages/hub/src/contextor/planner.ts +11 -11
  98. package/packages/hub/src/contextor/testing.ts +1 -1
  99. package/packages/hub/src/data/env.ts +3 -3
  100. package/packages/hub/src/data/service.ts +5 -5
  101. package/packages/hub/src/execution/agent.ts +8 -8
  102. package/packages/hub/src/execution/ai.ts +7 -7
  103. package/packages/hub/src/execution/create.ts +11 -6
  104. package/packages/hub/src/execution/env.ts +16 -16
  105. package/packages/hub/src/execution/executors.ts +2 -2
  106. package/packages/hub/src/execution/gateway.ts +1 -1
  107. package/packages/hub/src/execution/index.ts +1 -1
  108. package/packages/hub/src/execution/ledger.ts +2 -2
  109. package/packages/hub/src/execution/limits.ts +2 -2
  110. package/packages/hub/src/execution/models.ts +2 -2
  111. package/packages/hub/src/execution/ports.ts +1 -1
  112. package/packages/hub/src/execution/providers.ts +55 -11
  113. package/packages/hub/src/execution/queues.ts +6 -6
  114. package/packages/hub/src/execution/runs.ts +10 -10
  115. package/packages/hub/src/execution/stream-guard.ts +2 -2
  116. package/packages/hub/src/execution/testing.ts +5 -5
  117. package/packages/hub/src/execution/wire.ts +3 -3
  118. package/packages/hub/src/fns/auto.ts +2 -2
  119. package/packages/hub/src/fns/client-logs.ts +2 -2
  120. package/packages/hub/src/fns/create.ts +2 -2
  121. package/packages/hub/src/fns/decided.ts +2 -2
  122. package/packages/hub/src/fns/env.ts +14 -14
  123. package/packages/hub/src/fns/examples.ts +3 -3
  124. package/packages/hub/src/fns/facts.ts +5 -5
  125. package/packages/hub/src/fns/search.ts +5 -5
  126. package/packages/hub/src/graph/graph.ts +1 -1
  127. package/packages/hub/src/index/context-sections.ts +1 -1
  128. package/packages/hub/src/index/embedders.ts +3 -3
  129. package/packages/hub/src/index/env.ts +12 -12
  130. package/packages/hub/src/index/index.ts +1 -1
  131. package/packages/hub/src/index/indexer.ts +4 -4
  132. package/packages/hub/src/index/search.ts +1 -1
  133. package/packages/hub/src/index/testing.ts +2 -2
  134. package/packages/hub/src/link/build.ts +32 -32
  135. package/packages/hub/src/link/env.ts +14 -14
  136. package/packages/hub/src/link/grants.ts +10 -10
  137. package/packages/hub/src/link/lifecycle.ts +4 -4
  138. package/packages/hub/src/link/migrate-api.ts +55 -15
  139. package/packages/hub/src/link/pairing.ts +1 -1
  140. package/packages/hub/src/link/process.ts +1 -1
  141. package/packages/hub/src/link/rig.ts +12 -12
  142. package/packages/hub/src/link/supervisor.ts +1 -1
  143. package/packages/hub/src/mcp/calls.ts +6 -6
  144. package/packages/hub/src/mcp/create.ts +5 -5
  145. package/packages/hub/src/mcp/env.ts +6 -6
  146. package/packages/hub/src/mcp/fns.ts +2 -2
  147. package/packages/hub/src/mcp/index.ts +2 -2
  148. package/packages/hub/src/mcp/sources.ts +3 -3
  149. package/packages/hub/src/mcp/tokens.ts +1 -1
  150. package/packages/hub/src/models/create.ts +1 -1
  151. package/packages/hub/src/models/decide.ts +2 -2
  152. package/packages/hub/src/models/index.ts +1 -1
  153. package/packages/hub/src/models/roles.ts +12 -12
  154. package/packages/hub/src/query/env.ts +5 -5
  155. package/packages/hub/src/query/sources.ts +3 -3
  156. package/packages/hub/src/questions/plans.ts +1 -1
  157. package/packages/hub/src/questions/worker.ts +2 -2
  158. package/packages/hub/src/resources/context.ts +3 -3
  159. package/packages/hub/src/resources/converters.ts +2 -2
  160. package/packages/hub/src/resources/create.ts +6 -6
  161. package/packages/hub/src/resources/env.ts +15 -15
  162. package/packages/hub/src/resources/fetch.ts +5 -5
  163. package/packages/hub/src/resources/forms.ts +5 -5
  164. package/packages/hub/src/resources/index.ts +1 -1
  165. package/packages/hub/src/resources/library.ts +2 -2
  166. package/packages/hub/src/resources/raw.ts +1 -1
  167. package/packages/hub/src/resources/reader.ts +2 -2
  168. package/packages/hub/src/resources/sqlite-files.ts +1 -1
  169. package/packages/hub/src/resources/storage.ts +5 -5
  170. package/packages/hub/src/resources/testing.ts +6 -6
  171. package/packages/hub/src/store/env.ts +4 -4
  172. package/packages/hub/src/store/hybrid.ts +4 -4
  173. package/packages/hub/src/store/sqlite.ts +3 -3
  174. package/packages/hub/src/stores/drivers.ts +2 -2
  175. package/packages/hub/src/stores/host.ts +3 -3
  176. package/packages/hub/src/stores/moves.ts +2 -2
  177. package/packages/hub/src/stores/service.ts +2 -2
  178. package/packages/hub/src/tables/env.ts +3 -3
  179. package/packages/hub/src/tables/index.ts +5 -5
  180. package/packages/hub/src/tables/service.ts +7 -7
  181. package/packages/sdk/AUTHORING.md +1206 -881
  182. package/packages/sdk/package.json +11 -8
  183. package/packages/sdk/src/agent.ts +1 -1
  184. package/packages/sdk/src/app-parts.ts +95 -0
  185. package/packages/sdk/src/authored.ts +26 -0
  186. package/packages/sdk/src/authoring.ts +13 -30
  187. package/packages/sdk/src/client-runtime.ts +24 -1
  188. package/packages/sdk/src/client-ui/AddServiceDialog.vue +43 -0
  189. package/packages/sdk/src/client-ui/InstanceNameField.vue +29 -0
  190. package/packages/sdk/src/client-ui/PairRowsEditor.vue +74 -0
  191. package/packages/sdk/src/client-ui/RemoteAuthFields.vue +95 -0
  192. package/packages/sdk/src/client-ui/ServiceRows.vue +57 -0
  193. package/packages/sdk/src/client-ui/draft.ts +10 -0
  194. package/packages/sdk/src/client-ui/host.ts +37 -0
  195. package/packages/sdk/src/client-ui/index.ts +19 -0
  196. package/packages/sdk/src/client-ui/loaded.ts +69 -0
  197. package/packages/sdk/src/client-ui/problems.ts +98 -0
  198. package/packages/sdk/src/client-ui/remote-config.ts +199 -0
  199. package/packages/sdk/src/client-ui/service-rows.ts +25 -0
  200. package/packages/sdk/src/client-ui/state.ts +14 -0
  201. package/packages/sdk/src/client-ui/testing.ts +147 -0
  202. package/packages/sdk/src/client-ui/vue-shim.d.ts +13 -0
  203. package/packages/sdk/src/client.ts +82 -11
  204. package/packages/sdk/src/hub.ts +4 -4
  205. package/packages/sdk/src/index.ts +13 -9
  206. package/packages/sdk/src/page-parts.ts +4 -0
  207. package/packages/sdk/src/program/env.ts +7 -7
  208. package/packages/sdk/src/program/runtime.ts +5 -5
  209. package/packages/sdk/src/program/tools.ts +3 -3
  210. package/packages/sdk/src/remote-auth.ts +128 -7
  211. package/packages/sdk/src/server/context-files.ts +1 -1
  212. package/packages/sdk/src/server/env.ts +36 -36
  213. package/packages/sdk/src/server/fake-hub-widgets.ts +7 -6
  214. package/packages/sdk/src/server/host.ts +28 -28
  215. package/packages/sdk/src/server/index.ts +2 -2
  216. package/packages/sdk/src/server/live.ts +4 -4
  217. package/packages/sdk/src/server/llm-wire.ts +4 -4
  218. package/packages/sdk/src/server/pairing.ts +1 -1
  219. package/packages/sdk/src/server/results.ts +4 -4
  220. package/packages/sdk/src/server/socket-guard.ts +1 -1
  221. package/packages/sdk/src/server/start-gate.ts +2 -2
  222. package/packages/sdk/src/server/store/engines.ts +2 -2
  223. package/packages/sdk/src/server/store/keeper.ts +2 -2
  224. package/packages/sdk/src/server/supervise.ts +4 -4
  225. package/packages/sdk/src/testing/env.ts +6 -6
  226. package/packages/sdk/src/testing/hub.ts +3 -1
  227. package/packages/sdk/src/testing/models.ts +3 -3
  228. package/packages/sdk/src/testing/openrouter.ts +3 -2
  229. package/packages/sdk/src/testing/preview.ts +7 -7
  230. package/packages/sdk/src/widgets.ts +21 -136
  231. package/packages/sdk/tsconfig.json +2 -2
  232. package/packages/web/dist/assets/{ActorSettingsView-v2k7v454.js → ActorSettingsView-CDszUbHz.js} +2 -2
  233. package/packages/web/dist/assets/AdminLayout-CFIz4GsQ.js +2 -0
  234. package/packages/web/dist/assets/{AdminLayout-1hbRPV3d.css → AdminLayout-ggcdQGlQ.css} +1 -1
  235. package/packages/web/dist/assets/{AppPage-CFmKZS8G.js → AppPage-BvoVTk6h.js} +2 -2
  236. package/packages/web/dist/assets/{AutoPairPicker-C61gihmh.js → AutoPairPicker-CLjD-muP.js} +2 -2
  237. package/packages/web/dist/assets/{BrowserFrame-Sq9EmQRT.js → BrowserFrame-BcN-A76X.js} +2 -2
  238. package/packages/web/dist/assets/ChatPage-DhTpAyM2.js +4 -0
  239. package/packages/web/dist/assets/{ChatPage-CbsRmktV.css → ChatPage-DjPv238m.css} +1 -1
  240. package/packages/web/dist/assets/{CodeViewer-tUNXZB77.js → CodeViewer-K9jrTmFO.js} +2 -2
  241. package/packages/web/dist/assets/ConfigWithCustom-BvrvSVIp.js +3 -0
  242. package/packages/web/dist/assets/{ConfirmDialog-Dd3E4sJt.js → ConfirmDialog-BDvLleYf.js} +2 -2
  243. package/packages/web/dist/assets/{ConnectPage-CX9acyQH.js → ConnectPage-Dg6IPNNh.js} +2 -2
  244. package/packages/web/dist/assets/ContextItemPage-qisBQetR.js +2 -0
  245. package/packages/web/dist/assets/ContextPage-DXa6Yqk-.js +3 -0
  246. package/packages/web/dist/assets/{ContextRow-DrtPumZ5.js → ContextRow-DDYnYRaL.js} +2 -2
  247. package/packages/web/dist/assets/{DataPage-DDSsxHro.js → DataPage-DOE_pKAY.js} +2 -2
  248. package/packages/web/dist/assets/DataTypePage-BnP_JELT.js +2 -0
  249. package/packages/web/dist/assets/{DataTypePage-Cr238Hx_.css → DataTypePage-CWrWvUPs.css} +1 -1
  250. package/packages/web/dist/assets/{DesignPage-6e0XbOFC.js → DesignPage-B9MJbF10.js} +3 -3
  251. package/packages/web/dist/assets/{ExplorePage-B7ND0W0l.js → ExplorePage-cRDQZRea.js} +2 -2
  252. package/packages/web/dist/assets/{FnPill-Cp3KuLmP.js → FnPill-CbLZCXYM.js} +2 -2
  253. package/packages/web/dist/assets/{FnView-C0XZdnsS.js → FnView-CG_wBKTP.js} +2 -2
  254. package/packages/web/dist/assets/{FnsView-GTH3p7a0.js → FnsView-BybyK12w.js} +2 -2
  255. package/packages/web/dist/assets/{GinExprView-DGxns6lH.js → GinExprView-BYCKSD_n.js} +2 -2
  256. package/packages/web/dist/assets/{GinForm-BDBUzuDP.js → GinForm-CXjYVf2_.js} +2 -2
  257. package/packages/web/dist/assets/{GinTypeView-CUsymbVf.js → GinTypeView-Bmbmx9e_.js} +2 -2
  258. package/packages/web/dist/assets/{GinValueView-jsKIfiEA.js → GinValueView-CWUzS7ti.js} +2 -2
  259. package/packages/web/dist/assets/{GraphPage-BCcPPsHu.js → GraphPage-D6OhckfJ.js} +2 -2
  260. package/packages/web/dist/assets/GraphPanel-BTitgA-K.js +2 -0
  261. package/packages/web/dist/assets/{HubPicker-EoOErgmk.js → HubPicker-DVly8dLD.js} +2 -2
  262. package/packages/web/dist/assets/{InboxApprovals-Dkq7DFp_.js → InboxApprovals-BF84edZU.js} +2 -2
  263. package/packages/web/dist/assets/{InboxPage-CHhslePq.js → InboxPage-DohZ9EDP.js} +2 -2
  264. package/packages/web/dist/assets/InjectedList-e6qr1kdU.js +2 -0
  265. package/packages/web/dist/assets/{InstallDialog-D-VwfZYF.js → InstallDialog-JJCKYs2s.js} +2 -2
  266. package/packages/web/dist/assets/InstanceTypes-BqUzx87o.js +2 -0
  267. package/packages/web/dist/assets/InstanceView-C73pev7A.js +2 -0
  268. package/packages/web/dist/assets/{ItemHistory-NQAP69ma.js → ItemHistory-dbGgOZsw.js} +2 -2
  269. package/packages/web/dist/assets/LimitsView-Ddp5WakY.js +2 -0
  270. package/packages/web/dist/assets/{ListSearch-BunVrDO0.js → ListSearch-CYNNAuMB.js} +2 -2
  271. package/packages/web/dist/assets/{LlmCallDetails-BoVNDTVs.js → LlmCallDetails-C9H5Hc2J.js} +2 -2
  272. package/packages/web/dist/assets/{LlmCallsView-BGpV92RC.js → LlmCallsView-CBqyZ8Cj.js} +2 -2
  273. package/packages/web/dist/assets/{LoadState-h-K9bTYc.js → LoadState-B2YhZlyC.js} +2 -2
  274. package/packages/web/dist/assets/McpDialog-DhlLklIq.js +2 -0
  275. package/packages/web/dist/assets/{McpView-GPXdCMne.js → McpView-D_ZmNO56.js} +2 -2
  276. package/packages/web/dist/assets/{McpsView-DJIR2JX5.js → McpsView-9_gwBuzw.js} +2 -2
  277. package/packages/web/dist/assets/{MemoryDialog-BTeIHQyA.js → MemoryDialog-pTHIxKEX.js} +2 -2
  278. package/packages/web/dist/assets/{ModelCallsView-DMcnwF2S.js → ModelCallsView-FHv2XWRX.js} +2 -2
  279. package/packages/web/dist/assets/{ModelPicker-CgkMFxSO.js → ModelPicker-EqOuvVnE.js} +2 -2
  280. package/packages/web/dist/assets/ModelsView-D9UaL4PX.js +2 -0
  281. package/packages/web/dist/assets/{NotFoundPage-Tk92K7HN.js → NotFoundPage-BsuJysan.js} +2 -2
  282. package/packages/web/dist/assets/{PairPage-D0BK8CCw.js → PairPage-B_ZXsbL4.js} +2 -2
  283. package/packages/web/dist/assets/{PanelHost-C-gKrxAk.js → PanelHost-Dx-vNNl5.js} +2 -2
  284. package/packages/web/dist/assets/PeopleView-D6dmEgMs.js +2 -0
  285. package/packages/web/dist/assets/{PeopleView-CJ8yArTh.css → PeopleView-DBxdbT1C.css} +1 -1
  286. package/packages/web/dist/assets/{PoliciesView-BRi-QAuo.js → PoliciesView-Bn4rm-ao.js} +2 -2
  287. package/packages/web/dist/assets/{RefusalList-DVO0bmeB.js → RefusalList-aosRD1ie.js} +2 -2
  288. package/packages/web/dist/assets/RendererHost-Ym_SMkhp.css +1 -0
  289. package/packages/web/dist/assets/RendererHost-rjnpSgyQ.js +2 -0
  290. package/packages/web/dist/assets/{ResourceViewer-Do0chYxU.js → ResourceViewer-C4tRColf.js} +2 -2
  291. package/packages/web/dist/assets/ResourcesPage-7mCLBORZ.js +2 -0
  292. package/packages/web/dist/assets/ResultGrid-CL2WSYQH.css +1 -0
  293. package/packages/web/dist/assets/ResultGrid-GIMoQUAr.js +2 -0
  294. package/packages/web/dist/assets/{ReviewSummaryStrip-DO3p64Qj.js → ReviewSummaryStrip-Bvjn3Iq8.js} +2 -2
  295. package/packages/web/dist/assets/ReviewView-DIqsUedT.js +3 -0
  296. package/packages/web/dist/assets/{RuleRow-DX9v4iGP.js → RuleRow-zRg-e8Vj.js} +2 -2
  297. package/packages/web/dist/assets/RunCard-C7wOGaw8.js +2 -0
  298. package/packages/web/dist/assets/RunCard-CSDiz-Nt.css +1 -0
  299. package/packages/web/dist/assets/{RunDetails-DjR206q6.js → RunDetails-W4GbE6AE.js} +2 -2
  300. package/packages/web/dist/assets/{RunDot-lHRICdM5.js → RunDot-C46uzzNM.js} +2 -2
  301. package/packages/web/dist/assets/{RunPage-CbAQ_WPR.js → RunPage-DPLtZpeB.js} +2 -2
  302. package/packages/web/dist/assets/{RunProgress-C3-B4tQf.js → RunProgress-Cr_6TBaF.js} +2 -2
  303. package/packages/web/dist/assets/{RunsView-DMkPmkqX.js → RunsView-tU350TPK.js} +2 -2
  304. package/packages/web/dist/assets/SettingsPage-B8QmmMN3.js +3 -0
  305. package/packages/web/dist/assets/{SettingsPage-t03BqXw8.css → SettingsPage-BTl3Ie4F.css} +1 -1
  306. package/packages/web/dist/assets/SignInPage-CXxLf7Rp.css +1 -0
  307. package/packages/web/dist/assets/{SignInPage-ByqGEZfj.js → SignInPage-DTwdqlnB.js} +2 -2
  308. package/packages/web/dist/assets/{StatusBadge-CXne0sRZ.js → StatusBadge-D7wKMAcD.js} +2 -2
  309. package/packages/web/dist/assets/{StorePlacementStep-B6SwTmdM.js → StorePlacementStep-C04nRU-u.js} +2 -2
  310. package/packages/web/dist/assets/{SystemConfig-vQDL_eUl.js → SystemConfig-CE3keXWq.js} +2 -2
  311. package/packages/web/dist/assets/SystemPageHost-CEhz4li8.js +2 -0
  312. package/packages/web/dist/assets/SystemPageHost-DX7LrFoN.css +1 -0
  313. package/packages/web/dist/assets/SystemView-CBFzEGfm.js +2 -0
  314. package/packages/web/dist/assets/SystemsView-0G8JntMV.js +2 -0
  315. package/packages/web/dist/assets/TableView-BK0uwLHl.js +3 -0
  316. package/packages/web/dist/assets/TableView-B_4MViVb.css +1 -0
  317. package/packages/web/dist/assets/{TableViewer-Boxx86f5.js → TableViewer-nbMInGJJ.js} +3 -3
  318. package/packages/web/dist/assets/{ThemePicker-CIg_oRQX.js → ThemePicker-fZpVSYqG.js} +2 -2
  319. package/packages/web/dist/assets/{TurnTree-Ecm0yA5g.js → TurnTree-Co-iBqhT.js} +2 -2
  320. package/packages/web/dist/assets/{UserMessage-BtECa8ka.css → UserMessage-B63G9sxC.css} +1 -1
  321. package/packages/web/dist/assets/{UserMessage-BlnqZDVU.js → UserMessage-CDjUxKY0.js} +6 -6
  322. package/packages/web/dist/assets/{ValueVisual-C-MWpp7c.js → ValueVisual-EJnCKgSy.js} +2 -2
  323. package/packages/web/dist/assets/{fn-modal-B98MR7JN.js → fn-modal-DtE65mFt.js} +2 -2
  324. package/packages/web/dist/assets/{fn-notices-CfTa1E8y.js → fn-notices-CCZ-DFbi.js} +2 -2
  325. package/packages/web/dist/assets/{formats-JwoKfXIq.js → formats-CyHV2siv.js} +2 -2
  326. package/packages/web/dist/assets/index-BY7M8QUk.css +1 -0
  327. package/packages/web/dist/assets/index-OZS2EluT.js +4 -0
  328. package/packages/web/dist/assets/{labels-BFbk11BE.js → labels-CT7_K0Pt.js} +2 -2
  329. package/packages/web/dist/assets/{layout-D1gf481r.js → layout-B6fBDg80.js} +2 -2
  330. package/packages/web/dist/assets/loaded-LaPjk6mK.js +2 -0
  331. package/packages/web/dist/assets/{metrics-CBPX3W5Y.js → metrics-9n8bKI7u.js} +2 -2
  332. package/packages/web/dist/assets/problems--AW4igVY.js +2 -0
  333. package/packages/web/dist/assets/{push-payload-BeU1ADYt.js → push-payload-B3EcrsVz.js} +64 -64
  334. package/packages/web/dist/assets/record-edits-B-FWAbxR.js +2 -0
  335. package/packages/web/dist/assets/{review-fP-l9D6H.js → review-uLESCEz1.js} +3 -3
  336. package/packages/web/dist/assets/routes-B7Zmt8wh.js +4 -0
  337. package/packages/web/dist/assets/{runs-CveC2kKo.js → runs-CUb2PTFg.js} +2 -2
  338. package/packages/web/dist/assets/{shared-LbaIHjbV.js → shared-Bxhw_9et.js} +2 -2
  339. package/packages/web/dist/assets/{sources-VPrtgLIi.js → sources-YgkjgFLe.js} +2 -2
  340. package/packages/web/dist/assets/src-DY1fSFJS.js +43 -0
  341. package/packages/web/dist/assets/state-ChQDWWj-.js +2 -0
  342. package/packages/web/dist/assets/{systems-BqE3WTSF.js → systems-CjwjRySu.js} +2 -2
  343. package/packages/web/dist/assets/table-host-B_D9dmCz.js +2 -0
  344. package/packages/web/dist/assets/tables-CaxIuHdw.js +2 -0
  345. package/packages/web/dist/assets/{ui-BzgWquIU.js → ui-DWjytmDS.js} +5 -5
  346. package/packages/web/dist/assets/{url-DKGcECT1.js → url-DbGOI14W.js} +2 -2
  347. package/packages/web/dist/index.html +49 -47
  348. package/packages/web/dist/sw.js +1 -1
  349. package/packages/web/package.json +2 -4
  350. package/premade/claude.zip +0 -0
  351. package/premade/database.zip +0 -0
  352. package/premade/web.zip +0 -0
  353. package/scripts/dev-env.ts +9 -9
  354. package/scripts/run-stack.ts +15 -15
  355. package/scripts/stack.ts +3 -3
  356. package/scripts/start.ts +18 -18
  357. package/systems/api/client/ApiServiceForm.vue +55 -0
  358. package/systems/api/client/ServiceList.vue +90 -0
  359. package/systems/api/client/ServicePage.vue +142 -0
  360. package/systems/api/client/ServicesPage.vue +32 -0
  361. package/systems/api/client/index.ts +15 -0
  362. package/systems/api/client/logic.ts +140 -0
  363. package/systems/api/client/state.ts +92 -0
  364. package/systems/api/package.json +9 -6
  365. package/systems/api/server/authoring.ts +2 -1
  366. package/systems/api/server/env.ts +1 -1
  367. package/systems/api/server/guard.ts +1 -1
  368. package/systems/api/server/http.ts +3 -2
  369. package/systems/api/server/impl.ts +3 -2
  370. package/systems/api/server/main.ts +11 -7
  371. package/systems/api/server/openapi.ts +1 -1
  372. package/systems/api/server/program.ts +2 -1
  373. package/systems/api/server/services.ts +2 -1
  374. package/systems/api/shared/http.ts +2 -1
  375. package/systems/api/shared/index.ts +15 -5
  376. package/{packages/core/src/programs.ts → systems/api/shared/services.ts} +7 -51
  377. package/systems/api/system.json +2 -1
  378. package/systems/api/tsconfig.json +2 -2
  379. package/systems/code/package.json +4 -3
  380. package/systems/code/server/authoring.ts +2 -1
  381. package/systems/code/server/impl.ts +2 -1
  382. package/systems/code/server/main.ts +5 -5
  383. package/systems/code/shared/index.ts +2 -3
  384. package/systems/code/shared/program.ts +23 -0
  385. package/systems/embedder/package.json +1 -1
  386. package/systems/embedder/server/env.ts +1 -1
  387. package/systems/embedder/server/main.ts +5 -5
  388. package/systems/embedder/shared/index.ts +1 -1
  389. package/systems/fs/client/machines/fakes.ts +1 -1
  390. package/systems/fs/client/machines/files/fakes.ts +1 -1
  391. package/systems/fs/client/machines/palette.ts +3 -2
  392. package/systems/fs/context/authoring/parts/client.md +23 -5
  393. package/systems/fs/context/authoring/parts/client.reference/client.md +7 -16
  394. package/systems/fs/context/authoring/parts/client.reference/pageinbox.md +524 -0
  395. package/systems/fs/context/authoring/parts/client.reference/{resultview.md → visuals.md} +85 -116
  396. package/systems/fs/context/authoring/parts/client.reference.md +8 -8
  397. package/systems/fs/context/authoring/parts/context.md +1 -1
  398. package/systems/fs/context/authoring/parts/contract.md +1 -1
  399. package/systems/fs/context/authoring/parts/core-types/admin-ts.md +2 -2
  400. package/systems/fs/context/authoring/parts/core-types/connections-ts.md +12 -1
  401. package/systems/fs/context/authoring/parts/core-types/context-files-ts.md +2 -2
  402. package/systems/fs/context/authoring/parts/core-types/context-graph-ts.md +2 -2
  403. package/systems/fs/context/authoring/parts/core-types/contextdecl.md +2 -2
  404. package/systems/fs/context/authoring/parts/core-types/lifecycle-ts.md +27 -2
  405. package/systems/fs/context/authoring/parts/core-types/manifest.md +27 -2
  406. package/systems/fs/context/authoring/parts/core-types/manifestpatch.md +26 -2
  407. package/systems/fs/context/authoring/parts/core-types/modes-ts.md +3 -3
  408. package/systems/fs/context/authoring/parts/core-types/records-systems-ts.md +145 -1
  409. package/systems/fs/context/authoring/parts/core-types/registries-ts.md +98 -2
  410. package/systems/fs/context/authoring/parts/core-types/run-ts.md +2 -2
  411. package/systems/fs/context/authoring/parts/core-types/system-pages-ts.md +4 -2
  412. package/systems/fs/context/authoring/parts/core-types/system-providers-ts.md +2 -2
  413. package/systems/fs/context/authoring/parts/core-types/tables-ts.md +91 -0
  414. package/systems/fs/context/authoring/parts/core-types/web-ts.md +1 -2
  415. package/systems/fs/context/authoring/parts/core-types.md +5 -8
  416. package/systems/fs/context/authoring/parts/examples/server-main-ts.md +4 -4
  417. package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-568-660.md +1 -1
  418. package/systems/fs/context/authoring/parts/fns.md +1 -1
  419. package/systems/fs/context/authoring/parts/folder.md +6 -6
  420. package/systems/fs/context/authoring/parts/hub/hub-ctx-from-resource.md +2 -2
  421. package/systems/fs/context/authoring/parts/hub/hub-install-package.md +2 -2
  422. package/systems/fs/context/authoring/parts/hub.reference.md +3 -3
  423. package/systems/fs/context/authoring/parts/internals/manifestof.md +2 -2
  424. package/systems/fs/context/authoring/parts/internals/permissionargs.md +4 -4
  425. package/systems/fs/context/authoring/parts/kinds-agents.md +1 -1
  426. package/systems/fs/context/authoring/parts/kinds-agents.reference/authoringsession.md +7 -5
  427. package/systems/fs/context/authoring/parts/kinds-agents.reference/kind.md +4 -4
  428. package/systems/fs/context/authoring/parts/outcomes.md +2 -2
  429. package/systems/fs/context/authoring/parts/outcomes.reference.md +2 -2
  430. package/systems/fs/context/authoring/parts/packaging.md +4 -4
  431. package/systems/fs/context/authoring/parts/remote.md +5 -5
  432. package/systems/fs/context/authoring/parts/remote.reference.md +201 -17
  433. package/systems/fs/context/authoring/parts/server.md +7 -7
  434. package/systems/fs/context/authoring/parts/server.reference.md +15 -15
  435. package/systems/fs/context/authoring/parts/testing.reference/equal.md +3 -3
  436. package/systems/fs/context/authoring/parts/testing.reference/fakehub.md +1 -1
  437. package/systems/fs/context/authoring/parts/testing.reference/kindprops.md +22 -10
  438. package/systems/fs/context/authoring/parts/testing.reference/{openmemorystore.md → storeconnection.md} +7 -19
  439. package/systems/fs/context/authoring/parts/testing.reference.md +5 -5
  440. package/systems/fs/context/authoring/parts/widgets.md +32 -22
  441. package/systems/fs/context/authoring/parts/widgets.reference.md +503 -9
  442. package/systems/fs/package.json +3 -3
  443. package/systems/fs/server/hosting.ts +10 -10
  444. package/systems/fs/server/main.ts +8 -8
  445. package/systems/fs/server/shell.ts +1 -1
  446. package/systems/fs/shared/index.ts +1 -1
  447. package/systems/google-calendar/package.json +1 -1
  448. package/systems/google-calendar/server/main.ts +4 -4
  449. package/systems/input/package.json +3 -3
  450. package/systems/input/server/main.ts +6 -6
  451. package/systems/mcp/client/McpServerForm.vue +99 -0
  452. package/systems/mcp/client/ServerList.vue +78 -0
  453. package/systems/mcp/client/ServerPage.vue +194 -0
  454. package/systems/mcp/client/ServersPage.vue +32 -0
  455. package/systems/mcp/client/index.ts +15 -0
  456. package/systems/mcp/client/logic.ts +224 -0
  457. package/systems/mcp/client/state.ts +128 -0
  458. package/systems/mcp/package.json +9 -6
  459. package/systems/mcp/server/dial.ts +1 -1
  460. package/systems/mcp/server/impl.ts +2 -1
  461. package/systems/mcp/server/instance.ts +3 -5
  462. package/systems/mcp/server/main.ts +10 -6
  463. package/systems/mcp/server/mirror.ts +2 -3
  464. package/systems/mcp/server/oauth.ts +2 -1
  465. package/systems/mcp/server/server-link.ts +2 -1
  466. package/systems/mcp/shared/index.ts +15 -2
  467. package/{packages/core/src/mcp-servers.ts → systems/mcp/shared/servers.ts} +6 -5
  468. package/systems/mcp/system.json +2 -1
  469. package/systems/mcp/tsconfig.json +2 -2
  470. package/systems/ollama/package.json +3 -3
  471. package/systems/ollama/server/main.ts +5 -5
  472. package/systems/schedule/package.json +3 -3
  473. package/systems/schedule/server/main.ts +6 -6
  474. package/systems/template/README.md +2 -2
  475. package/systems/template/package.json +1 -1
  476. package/systems/template/server/main.ts +4 -4
  477. package/systems/widgets/client/ChipRow.vue +22 -0
  478. package/systems/widgets/client/ProposalCard.vue +6 -5
  479. package/systems/widgets/client/SavedWidget.vue +11 -8
  480. package/systems/widgets/client/WidgetChips.vue +137 -0
  481. package/systems/widgets/client/WidgetView.vue +32 -0
  482. package/systems/widgets/client/charts/ChartVisual.vue +157 -0
  483. package/systems/widgets/client/charts/chart-data.ts +230 -0
  484. package/systems/widgets/client/charts/echarts-setup.ts +69 -0
  485. package/systems/widgets/client/charts/export.ts +36 -0
  486. package/systems/widgets/client/charts/families/calendar.ts +105 -0
  487. package/systems/widgets/client/charts/families/category.ts +186 -0
  488. package/systems/widgets/client/charts/families/crosstab.ts +113 -0
  489. package/systems/widgets/client/charts/families/distribution.ts +160 -0
  490. package/systems/widgets/client/charts/families/finance.ts +96 -0
  491. package/systems/widgets/client/charts/families/gauge.ts +75 -0
  492. package/systems/widgets/client/charts/families/hierarchy.ts +166 -0
  493. package/systems/widgets/client/charts/families/index.ts +21 -0
  494. package/systems/widgets/client/charts/families/network.ts +140 -0
  495. package/systems/widgets/client/charts/families/part.ts +61 -0
  496. package/systems/widgets/client/charts/families/profile.ts +30 -0
  497. package/systems/widgets/client/charts/families/progress.ts +76 -0
  498. package/systems/widgets/client/charts/families/range.ts +107 -0
  499. package/systems/widgets/client/charts/families/time.ts +177 -0
  500. package/systems/widgets/client/charts/families/timeline.ts +114 -0
  501. package/systems/widgets/client/charts/families/wide.ts +41 -0
  502. package/systems/widgets/client/charts/index.ts +37 -0
  503. package/systems/widgets/client/charts/maths.ts +139 -0
  504. package/systems/widgets/client/charts/size.ts +39 -0
  505. package/systems/widgets/client/chips.ts +150 -0
  506. package/systems/widgets/client/index.ts +18 -5
  507. package/systems/widgets/client/proposal.ts +2 -1
  508. package/systems/widgets/package.json +7 -4
  509. package/systems/widgets/server/authoring.ts +13 -7
  510. package/systems/widgets/server/env.ts +1 -1
  511. package/systems/widgets/server/impl.ts +10 -6
  512. package/systems/widgets/server/main.ts +6 -6
  513. package/systems/widgets/server/run.ts +16 -9
  514. package/systems/widgets/server/upgrade.ts +34 -0
  515. package/systems/widgets/shared/args.ts +137 -0
  516. package/systems/widgets/shared/charts.ts +243 -0
  517. package/systems/widgets/shared/index.ts +12 -3
  518. package/{packages/sdk/src → systems/widgets/shared}/relative-dates.ts +2 -1
  519. package/systems/widgets/shared/spec.ts +208 -0
  520. package/{packages/sdk/src → systems/widgets/shared}/widget-check.ts +7 -9
  521. package/{packages/sdk/src → systems/widgets/shared}/widget-schema.ts +4 -4
  522. package/packages/core/src/remote-auth.ts +0 -111
  523. package/packages/core/src/widgets.ts +0 -427
  524. package/packages/web/dist/assets/AdminLayout-B6Jrc_4W.js +0 -2
  525. package/packages/web/dist/assets/ApiServiceForm-BxprSaAq.css +0 -1
  526. package/packages/web/dist/assets/ApiServiceForm-CuuQgOJc.js +0 -2
  527. package/packages/web/dist/assets/ApiServiceView-7bTHSO_Z.js +0 -2
  528. package/packages/web/dist/assets/ApiServiceView-BVmdRCjR.css +0 -1
  529. package/packages/web/dist/assets/ApiServicesView-BTLV6c8n.css +0 -1
  530. package/packages/web/dist/assets/ApiServicesView-BXi24n49.js +0 -2
  531. package/packages/web/dist/assets/ChartVisual-BnFG9aFi.css +0 -1
  532. package/packages/web/dist/assets/ChartVisual-C4mgw4wh.js +0 -11
  533. package/packages/web/dist/assets/ChatPage-CAhHE03Z.js +0 -4
  534. package/packages/web/dist/assets/ConfigWithCustom-D_-rY66L.js +0 -3
  535. package/packages/web/dist/assets/ContextItemPage-rUI3-T_L.js +0 -2
  536. package/packages/web/dist/assets/ContextPage-CtefzyKg.js +0 -3
  537. package/packages/web/dist/assets/DataTypePage-BW9fWaz8.js +0 -2
  538. package/packages/web/dist/assets/FnList-BCnb4kOB.css +0 -1
  539. package/packages/web/dist/assets/FnList-Bx6H-kux.js +0 -2
  540. package/packages/web/dist/assets/GraphPanel-9tztGHmu.js +0 -2
  541. package/packages/web/dist/assets/InjectedList-CSWqRiON.js +0 -2
  542. package/packages/web/dist/assets/InstanceTypes-D3rAEiE7.js +0 -2
  543. package/packages/web/dist/assets/InstanceView-DoH8C-1j.js +0 -2
  544. package/packages/web/dist/assets/LimitsView-DY2C9nYS.js +0 -2
  545. package/packages/web/dist/assets/McpDialog-DhOCk6_E.js +0 -2
  546. package/packages/web/dist/assets/McpServerForm-Cor3fI7s.js +0 -2
  547. package/packages/web/dist/assets/McpServerForm-DsHaf5Um.css +0 -1
  548. package/packages/web/dist/assets/McpServerView-7I76EznB.css +0 -1
  549. package/packages/web/dist/assets/McpServerView-ewXRPEmZ.js +0 -2
  550. package/packages/web/dist/assets/McpServersView-Dd0xmfws.js +0 -2
  551. package/packages/web/dist/assets/ModelsView-cMHygeiK.js +0 -2
  552. package/packages/web/dist/assets/PeopleView-DRfeNWK5.js +0 -2
  553. package/packages/web/dist/assets/RemoteAuthFields-CgiufuqQ.js +0 -2
  554. package/packages/web/dist/assets/RemoteAuthFields-Dm44vz2t.css +0 -1
  555. package/packages/web/dist/assets/ResourcesPage-BBx2u2mw.js +0 -2
  556. package/packages/web/dist/assets/ResultGrid-Bj-0I5HY.js +0 -2
  557. package/packages/web/dist/assets/ResultGrid-CuUQyTjW.css +0 -1
  558. package/packages/web/dist/assets/ReviewView-DZF9E1hb.js +0 -3
  559. package/packages/web/dist/assets/RunCard-BnrtK2Yp.js +0 -2
  560. package/packages/web/dist/assets/RunCard-CfyRaDLS.css +0 -1
  561. package/packages/web/dist/assets/ServiceRows-4WythFpF.js +0 -2
  562. package/packages/web/dist/assets/ServiceRows-HPQ0pN6b.css +0 -1
  563. package/packages/web/dist/assets/SettingsPage-BN4oSzoL.js +0 -3
  564. package/packages/web/dist/assets/SignInPage-Djx-M-0U.css +0 -1
  565. package/packages/web/dist/assets/SystemPageHost-BeZ-6N0-.css +0 -1
  566. package/packages/web/dist/assets/SystemPageHost-DrMrEPyh.js +0 -2
  567. package/packages/web/dist/assets/SystemView-Be6TBM4j.js +0 -2
  568. package/packages/web/dist/assets/SystemsView-DZtT3laz.js +0 -2
  569. package/packages/web/dist/assets/WidgetView-DQUDeFkB.css +0 -1
  570. package/packages/web/dist/assets/WidgetView-DX4ejNb6.js +0 -3
  571. package/packages/web/dist/assets/export-BwFkEtcm.js +0 -15
  572. package/packages/web/dist/assets/index-6ScWTFy2.js +0 -4
  573. package/packages/web/dist/assets/index-CEslGcrX.css +0 -1
  574. package/packages/web/dist/assets/problems-t1E_ovSz.js +0 -2
  575. package/packages/web/dist/assets/record-edits-Bfsi4lU3.js +0 -2
  576. package/packages/web/dist/assets/remote-config-BNQhSDzB.js +0 -2
  577. package/packages/web/dist/assets/routes-DV4IJpwe.js +0 -4
  578. package/packages/web/dist/assets/size-Bh__w5aI.js +0 -2
  579. package/packages/web/dist/assets/src-CT3TeFaM.js +0 -43
  580. package/packages/web/dist/assets/state-xfQqaQPX.js +0 -2
  581. package/packages/web/dist/assets/widget-host-B87MTaTn.js +0 -2
  582. package/packages/web/dist/assets/widgets-BBCuSS6E.js +0 -2
  583. package/systems/fs/context/authoring/parts/client.reference/textareaprops.md +0 -195
  584. package/systems/fs/context/authoring/parts/core-types/remote-auth-ts.md +0 -64
  585. package/systems/fs/context/authoring/parts/core-types/widgets-ts.md +0 -303
  586. package/systems/fs/context/authoring/parts/widgets.reference/hub-visuals.md +0 -627
  587. package/systems/fs/context/authoring/parts/widgets.reference/sourcecompatible.md +0 -154
@@ -1,427 +0,0 @@
1
- /**
2
- * Widgets (widget pass, after product's widget plan; build-8-widgets-design.md is binding). A widget is a saved view of
3
- * a read fn that returns a `ResultTable`: the visuals it switches between with their styles and bindings, a plan per
4
- * source argument (a control, pinned or hidden), presets, the range args a chart drives, the paging args its buffered
5
- * pager drives, a drill and the row actions it narrows.
6
- *
7
- * The bundled `widgets` system owns the kind (`WIDGET_KIND`), saved widgets (fns of that kind, kept with `hub/fns_save`),
8
- * the authoring fn (`widgets/make_widget`, which proposes; the person presses Save, which runs `widgets/save_widget`)
9
- * and runs: a run calls its source as a child run, checks the bindings against the real columns and returns a
10
- * `WidgetResult`. The hub keeps only its `native` and `llm` kinds, the visual registry (`HUB_VISUALS`), row actions
11
- * (derived from the catalog) and the export route.
12
- *
13
- * Actions are derived, never listed by hand: every method of a row's type is offered, and a widget may narrow them, add
14
- * any fn bound to columns, relabel them and declare a drill. Anything that is not a read confirms first (`confirmOf`);
15
- * a write with a form shows the form, then the confirm. What follows is derived (`deriveThen`).
16
- */
17
- import { z } from 'zod';
18
- import { GinTypeDef } from './gin.ts';
19
- import { humanize } from './labels.ts';
20
- import { FnNameValue } from './model-names.ts';
21
- import { FnMode } from './manifest.ts';
22
- import { partialNote } from './partial.ts';
23
- import { InstanceName, Json, LocalName, QualifiedName, RunId } from './primitives.ts';
24
- import { ResultTable } from './registries.ts';
25
- import { ResultFacts, VisualBinding } from './visuals.ts';
26
- import type { ActionThenV1, WidgetSpecV1 } from './widgets-v1.ts';
27
-
28
- /** The bundled system that owns widgets. */
29
- export const WIDGETS_SYSTEM = 'widgets';
30
-
31
- /** The widget kind. */
32
- export const WIDGET_KIND = 'widgets/widget';
33
-
34
- // ─── Argument values ──────────────────────────────────────────────────────────
35
-
36
- /**
37
- * The fixed list of relative dates a date control offers, stored in the date grammar's own text (product's
38
- * `today-7d`, `startOf(month)`) so the full grammar can follow without migrating saved widgets. `day` ones fill a
39
- * date arg, `instant` ones a datetime arg. The control resolves one to a plain value when it applies it.
40
- */
41
- export const RELATIVE_DATE_EXPRS = [
42
- 'today', 'today-1d', 'today+1d', 'today-7d', 'today-30d', 'today+7d', 'startOf(week)', 'endOf(week)', 'startOf(month)', 'endOf(month)',
43
- 'startOf(month,today-1mo)', 'startOf(quarter)', 'startOf(year)', 'now', 'now-1h', 'now-24h',
44
- ] as const;
45
- export const RelativeDate = z.enum(RELATIVE_DATE_EXPRS);
46
- export type RelativeDate = z.infer<typeof RelativeDate>;
47
-
48
- /** Each relative date's words, and whether it fills a date (`day`) or a datetime (`instant`) argument. */
49
- export const RELATIVE_DATES: Readonly<Record<RelativeDate, { readonly label: string; readonly yields: 'day' | 'instant' }>> = {
50
- 'today': { label: 'Today', yields: 'day' },
51
- 'today-1d': { label: 'Yesterday', yields: 'day' },
52
- 'today+1d': { label: 'Tomorrow', yields: 'day' },
53
- 'today-7d': { label: '7 days ago', yields: 'day' },
54
- 'today-30d': { label: '30 days ago', yields: 'day' },
55
- 'today+7d': { label: 'In 7 days', yields: 'day' },
56
- 'startOf(week)': { label: 'Start of this week', yields: 'day' },
57
- 'endOf(week)': { label: 'End of this week', yields: 'day' },
58
- 'startOf(month)': { label: 'Start of this month', yields: 'day' },
59
- 'endOf(month)': { label: 'End of this month', yields: 'day' },
60
- 'startOf(month,today-1mo)': { label: 'Start of last month', yields: 'day' },
61
- 'startOf(quarter)': { label: 'Start of this quarter', yields: 'day' },
62
- 'startOf(year)': { label: 'Start of this year', yields: 'day' },
63
- 'now': { label: 'Now', yields: 'instant' },
64
- 'now-1h': { label: 'An hour ago', yields: 'instant' },
65
- 'now-24h': { label: '24 hours ago', yields: 'instant' },
66
- };
67
-
68
- /** A value for a source argument: a plain value, or a relative date resolved when the widget runs. */
69
- export const ArgValue = z.union([z.object({ literal: Json }), z.object({ relative: RelativeDate })]);
70
- export type ArgValue = z.infer<typeof ArgValue>;
71
-
72
- /** One choice of a control: its words and its value. Without a value it is the "Any" row, which clears the argument. */
73
- export const ChoiceOption = z.object({ label: z.string().min(1), value: ArgValue.optional() });
74
- export type ChoiceOption = z.infer<typeof ChoiceOption>;
75
-
76
- /**
77
- * How a widget shows one argument of its source: a chip in the control row (labelled, limited to choices, with a
78
- * default), `pinned` to a value (it leaves the widget's args; no chip), or `hidden` (no chip; it takes its default, so
79
- * only an argument with a default may be hidden). An argument with no plan is a chip with the source's own words.
80
- */
81
- export const ArgPlan = z.discriminatedUnion('show', [
82
- z.object({
83
- show: z.literal('control'),
84
- label: z.string().min(1).optional(),
85
- /** The only values offered, in order; an "Any" row only on an optional argument. */
86
- choices: z.array(ChoiceOption).min(1).optional(),
87
- /** Whether a value outside `choices` may be typed. */
88
- custom: z.boolean().optional(),
89
- default: ArgValue.optional(),
90
- }),
91
- z.object({ show: z.literal('pinned'), value: ArgValue }),
92
- z.object({ show: z.literal('hidden') }),
93
- ]);
94
- export type ArgPlan = z.infer<typeof ArgPlan>;
95
-
96
- /** A named preset that sets several arguments in one tap ("Overdue", "This week"). */
97
- export const WidgetPreset = z.object({ label: z.string().min(1), sets: z.record(LocalName, ArgValue) });
98
- export type WidgetPreset = z.infer<typeof WidgetPreset>;
99
-
100
- /** The source's range args a visual's range claim drives (a calendar's month, a zoomed time axis). */
101
- export const WidgetRange = z.object({ from: LocalName, to: LocalName });
102
- export type WidgetRange = z.infer<typeof WidgetRange>;
103
-
104
- /** The source's paging args, which the buffered pager drives instead of showing them as controls. */
105
- export const WidgetPaging = z.object({ offset: LocalName, limit: LocalName });
106
- export type WidgetPaging = z.infer<typeof WidgetPaging>;
107
-
108
- // ─── Visuals, drill and actions ───────────────────────────────────────────────
109
-
110
- /** One visual a widget offers: its name in `HUB_VISUALS`, the style shown, and the columns bound to each channel. */
111
- export const WidgetVisual = z.object({
112
- visual: LocalName,
113
- style: LocalName,
114
- /** The switcher's label instead of the visual's. */
115
- label: z.string().min(1).optional(),
116
- /** Channel → columns; a channel left out takes the default binding (`rankVisuals`). Bindings carry over between styles. */
117
- bind: VisualBinding,
118
- });
119
- export type WidgetVisual = z.infer<typeof WidgetVisual>;
120
-
121
- /**
122
- * What follows an action: `open` its rows as a new level (with a breadcrumb back), `refresh` the widget, or a `status`
123
- * line. Derived (`deriveThen`): rows returned open, a write refreshes, anything else is a status line.
124
- */
125
- export const ActionThen = z.enum(['open', 'refresh', 'status']);
126
- export type ActionThen = z.infer<typeof ActionThen>;
127
-
128
- /** One action a widget keeps, relabels or confirms: a method of the row's type, or any fn with args bound to columns. */
129
- export const WidgetAction = z.object({
130
- /** The fn: a type method (`fs/Entry.reveal`) or any fn. */
131
- fn: QualifiedName,
132
- label: z.string().min(1).optional(),
133
- /** `true` asks before running even a read. Writes and deletes always ask. */
134
- confirm: z.literal(true).optional(),
135
- /** Argument → the column whose value it takes from the row (`self` for a method is bound by the row's type). */
136
- bind: z.record(LocalName, z.string().min(1)),
137
- /** Instead of the derived `then`. */
138
- then: ActionThen.optional(),
139
- });
140
- export type WidgetAction = z.infer<typeof WidgetAction>;
141
-
142
- /**
143
- * What clicking a bar, slice, point or row runs: a read fn returning a table, its args from the clicked row's columns,
144
- * opened as a new level with a breadcrumb. Without one, a click opens the row's action menu.
145
- */
146
- export const WidgetDrill = z.object({ fn: QualifiedName, label: z.string().min(1), bind: z.record(LocalName, z.string().min(1)) });
147
- export type WidgetDrill = z.infer<typeof WidgetDrill>;
148
-
149
- /** A saved widget: the payload of a `widgets/widget` fn. */
150
- export const WidgetSpec = z.object({
151
- title: z.string().min(1),
152
- /** The read fn whose result it draws; it must return a `ResultTable`. */
153
- source: QualifiedName,
154
- /** The visuals offered, the first shown first; only visuals that fit the source's columns. */
155
- visuals: z.array(WidgetVisual).min(1),
156
- /** A plan per source argument; one left out is a chip with the source's own words. */
157
- args: z.record(LocalName, ArgPlan),
158
- presets: z.array(WidgetPreset),
159
- range: WidgetRange.optional(),
160
- paging: WidgetPaging.optional(),
161
- /** The actions offered on each row; absent offers every derived one, `[]` none. */
162
- actions: z.array(WidgetAction).optional(),
163
- drill: WidgetDrill.optional(),
164
- /** Re-run on its own while shown, when the source declares a live source (`FnDecl.live`). */
165
- live: z.literal(true).optional(),
166
- });
167
- export type WidgetSpec = z.infer<typeof WidgetSpec>;
168
-
169
- // ─── Results ──────────────────────────────────────────────────────────────────
170
-
171
- /** A chip in the control row: the argument, its words and type, what it offers and what it is set to. */
172
- export const WidgetShownControl = z.object({
173
- arg: LocalName,
174
- label: z.string().min(1),
175
- /**
176
- * The argument's gin type, for the chip's popover editor. Not named `type`: next to `value` that would make the
177
- * control read as a gin value envelope (`{type, value}`) inside a typed list.
178
- */
179
- argType: GinTypeDef,
180
- /** Whether it may be cleared (the "Any" row). */
181
- optional: z.boolean(),
182
- /**
183
- * Whether the widget fills it with its own default when it is left out: clearing it ("Any") then sends `null`, which
184
- * the widget reads as "explicitly unset" (absent when not given).
185
- */
186
- defaulted: z.boolean().optional(),
187
- choices: z.array(ChoiceOption).min(1).optional(),
188
- custom: z.boolean(),
189
- /** Whether the popover offers `RELATIVE_DATES` (a date or datetime argument). */
190
- relative: z.boolean(),
191
- value: ArgValue.optional(),
192
- });
193
- export type WidgetShownControl = z.infer<typeof WidgetShownControl>;
194
-
195
- /**
196
- * How the buffered pager asks for more: the paging args, the window the run applied (`limit`), and whether more may
197
- * follow (a full window means there may be; a short one is the last). The pager pages locally through what it holds and
198
- * runs the widget again (offset = rows held) only when a page needs rows it lacks.
199
- */
200
- export const WidgetPager = z.object({ offset: LocalName, limit: LocalName, window: z.number().int().min(1), more: z.boolean() });
201
- export type WidgetPager = z.infer<typeof WidgetPager>;
202
-
203
- /** An action as a row's menu offers it: derived from the fn, narrowed and labelled by the widget. */
204
- export const WidgetActionOption = z.object({
205
- fn: QualifiedName,
206
- label: z.string().min(1),
207
- mode: FnMode,
208
- confirm: z.boolean(),
209
- bind: z.record(LocalName, z.string().min(1)),
210
- /** The args left for a form after binding (shown first; the confirm follows for anything above a read). */
211
- form: GinTypeDef.optional(),
212
- then: ActionThen,
213
- });
214
- export type WidgetActionOption = z.infer<typeof WidgetActionOption>;
215
-
216
- /** What a widget run returns, and what the widget view draws. */
217
- export const WidgetResult = z.object({
218
- title: z.string().min(1),
219
- table: ResultTable,
220
- /** The table's column facts (`columnFacts`, with the source's gin facts); the pager works them out again as it grows. */
221
- facts: ResultFacts,
222
- /** The source fn, the child run that made the table, and the args it ran with, so the pager and refresh can ask again. */
223
- source: z.object({ fn: QualifiedName, run: RunId, args: z.record(z.string(), Json) }),
224
- /** The spec's visuals that still fit, in its order; the table always last. */
225
- visuals: z.array(WidgetVisual).min(1),
226
- /** Bindings that no longer fit (a column gone or of another kind), in words; the widget still draws. */
227
- problems: z.array(z.string()),
228
- /** The chip row, in the source's arg order. */
229
- controls: z.array(WidgetShownControl),
230
- presets: z.array(WidgetPreset),
231
- range: WidgetRange.optional(),
232
- paging: WidgetPager.optional(),
233
- /** The actions on rows of the table's row types, narrowed by the spec. */
234
- actions: z.array(WidgetActionOption),
235
- drill: WidgetDrill.optional(),
236
- /** The rows came from a write (`table.write`): no controls, no fetching more, no drill; "Run again" asks first. */
237
- readOnly: z.boolean(),
238
- /** How often the view re-runs it while shown, when it is live (never below the hub's floor). */
239
- live: z.object({ every: z.number().int().min(1) }).optional(),
240
- /** One line for the chat model ("Bar chart of count by stage, 12 rows"); `tableModelView` adds who sees the rows. */
241
- summary: z.string().min(1),
242
- });
243
- export type WidgetResult = z.infer<typeof WidgetResult>;
244
-
245
- // ─── Fns and routes ───────────────────────────────────────────────────────────
246
-
247
- /**
248
- * The actions offered on rows of these types (hub `rowActions` and `hub/row_actions`), narrowed by a widget's list. With
249
- * no row types (a source with no records type or ref columns) only the fns the widget binds are offered.
250
- */
251
- export const RowActionsQuery = z.object({ types: z.array(QualifiedName).max(20), narrow: z.array(WidgetAction).optional() })
252
- .refine((query) => query.types.length > 0 || (query.narrow?.length ?? 0) > 0, { message: 'name a row type or an action to offer' });
253
- export type RowActionsQuery = z.infer<typeof RowActionsQuery>;
254
-
255
- /** `hub/read_table`: run a read fn that returns a table, as a child run of the caller, as its person. */
256
- export const ReadTableArgs = z.object({ fn: QualifiedName, args: z.record(z.string(), Json) });
257
- export type ReadTableArgs = z.infer<typeof ReadTableArgs>;
258
-
259
- /** The web's quiet read (`readFn`): a read fn and its args, and for a fleet the instance it runs on (`on`, else the hub picks). */
260
- export const ReadFnArgs = ReadTableArgs.extend({ on: InstanceName.optional() });
261
- export type ReadFnArgs = z.infer<typeof ReadFnArgs>;
262
-
263
- /**
264
- * `widgets/make_widget`: the source fn, what the person wants, sample args, the widget to change (absent: a new one),
265
- * and whether the person asked to see something (the proposal then opens with its chart drawn).
266
- */
267
- export const MakeWidgetArgs = z.object({
268
- // fn names as the model's tools spell them, read back at the boundary (`g.fnName()`)
269
- source: FnNameValue,
270
- request: z.string().min(1),
271
- args: z.record(z.string(), Json).optional(),
272
- /** Other fns the widget may bind as row actions or its drill (any fn, as the person names them), besides the rows' types' methods. */
273
- fns: z.array(FnNameValue).max(10).optional(),
274
- widget: FnNameValue.optional(),
275
- show: z.boolean(),
276
- });
277
- export type MakeWidgetArgs = z.infer<typeof MakeWidgetArgs>;
278
-
279
- /** What `widgets/make_widget` returns: a proposal the chat draws as a preview with a Save button. Nothing is saved. */
280
- export const WidgetProposal = z.object({
281
- name: LocalName,
282
- description: z.string().min(1),
283
- spec: WidgetSpec,
284
- /** The source run with the plan's args, drawn as the widget will be. */
285
- preview: WidgetResult,
286
- /** The widget it changes, when it edits one. */
287
- replaces: FnNameValue.optional(),
288
- show: z.boolean(),
289
- });
290
- export type WidgetProposal = z.infer<typeof WidgetProposal>;
291
-
292
- /** `widgets/save_widget` (a person's Save, never an agent's tool): keep a proposal as a widget fn. */
293
- export const SaveWidgetArgs = z.object({ name: LocalName, description: z.string().min(1), spec: WidgetSpec, replace: QualifiedName.optional() });
294
- export type SaveWidgetArgs = z.infer<typeof SaveWidgetArgs>;
295
-
296
- /**
297
- * The hub's streamed export (`GET /api/export`): a read fn, its args as JSON text, its paging args, and the format. The
298
- * hub runs it page by page as the person, writes each page and lets it go, and ends a file cut at the row ceiling with a
299
- * line saying so.
300
- */
301
- export const ExportQuery = z.object({ fn: QualifiedName, args: z.string(), offset: LocalName, limit: LocalName, format: z.literal('csv') });
302
- export type ExportQuery = z.infer<typeof ExportQuery>;
303
-
304
- // ─── Routing ──────────────────────────────────────────────────────────────────
305
-
306
- /** The clause the chat's fn line gets for a fn whose declared return is a `ResultTable`. */
307
- export const RESULT_TABLE_ROUTING = 'returns a table; the chat draws it as a chart, calendar, cards or a table chosen from its columns, every other fitting visual one click away';
308
-
309
- /** The short instruction beside those lines. */
310
- export const RESULT_TABLE_INSTRUCTION = 'To show data as a chart or table, call a fn that returns a table; never write a chart yourself. To keep one, call widgets/make_widget with that fn.';
311
-
312
- /** What the chat model sees of a table result: one line, the columns, and the first rows. */
313
- export const TableModelView = z.object({
314
- summary: z.string(), columns: z.array(z.string()), rows: z.array(z.array(Json)), more: z.number().int().min(0),
315
- /** When the model reads fewer rows than there are: which rows it has, how many were left out and how to read them (`partialNote`). */
316
- partial: z.string().optional(),
317
- });
318
- export type TableModelView = z.infer<typeof TableModelView>;
319
-
320
- /**
321
- * How the chat model reads table results in one run: how many rows it gets, and whether a person is watching
322
- * (`RunInfo.watched`), so the table is drawn for them. Unwatched (a nested agent, a background or scheduled run) no one
323
- * sees the rows, so the model gets more of them and answers from those.
324
- */
325
- export interface TableReading {
326
- readonly rows: number;
327
- readonly watched: boolean;
328
- }
329
-
330
- /**
331
- * A table result as the chat model sees it: the summary with who sees the rows, the column names and the first
332
- * `reading.rows` rows. Watched, the person has the whole table; unwatched, the summary says no one sees them.
333
- */
334
- export function tableModelView(summary: string, table: ResultTable, reading: TableReading): TableModelView {
335
- const rows = table.rows.slice(0, reading.rows);
336
- const more = table.rows.length - rows.length;
337
- const held = more > 0 ? `: answer from the first ${String(rows.length)}, and say the answer covers only those` : `: answer from them`;
338
- const seen = reading.watched ? `${summary}, shown to the person` : `${summary}. Nobody is watching this run, so no one sees them${held}`;
339
- // rows nobody sees (held back from an unwatched run, or past this page): the view says how many and how to read them;
340
- // a watched run's person has the whole page, and `more` counts what the model was not given
341
- const total = table.total ?? (table.truncated ? undefined : table.offset + table.rows.length);
342
- const rest = `run it again narrower${table.truncated ? ` or from offset ${String(table.offset + table.rows.length)}` : ''}`;
343
- const partial = (more > 0 && !reading.watched) || table.truncated
344
- ? partialNote({ unit: 'rows', offset: table.offset, shown: rows.length, ...(total === undefined ? {} : { total }), rest })
345
- : undefined;
346
- return { summary: seen, columns: table.columns.map((column) => column.name), rows, more, ...(partial === undefined ? {} : { partial }) };
347
- }
348
-
349
- /** A widget's summary line: "Bar chart of count by stage, 12 rows". */
350
- export function widgetSummary(visualLabel: string, bind: VisualBinding, table: ResultTable): string {
351
- const names = (channel: string): string => (bind[channel] ?? []).join(', ');
352
- const measure = names('y') || names('value');
353
- const key = names('x') || names('itemName') || names('time');
354
- const of = measure === '' ? '' : ` of ${measure}${key === '' ? '' : ` by ${key}`}`;
355
- return `${visualLabel}${of}, ${rowsLine(table)}`;
356
- }
357
-
358
- /** How many rows a table holds, as the model reads it: "12 rows (more held back)". */
359
- export function rowsLine(table: Pick<ResultTable, 'rows' | 'truncated'>): string {
360
- const count = table.rows.length === 1 ? '1 row' : `${String(table.rows.length)} rows`;
361
- return `${count}${table.truncated ? ' (more held back)' : ''}`;
362
- }
363
-
364
- // ─── Rules ────────────────────────────────────────────────────────────────────
365
-
366
- /** Whether an action asks first: always for anything that is not a read, else when the widget says so. */
367
- export function confirmOf(mode: FnMode, declared: true | undefined): boolean {
368
- return mode !== 'read' || declared === true;
369
- }
370
-
371
- /** What follows an action by default: rows returned open a new level, a write refreshes, else a status line. */
372
- export function deriveThen(mode: FnMode, returnsTable: boolean): ActionThen {
373
- if (returnsTable) { return 'open'; }
374
- return mode === 'read' ? 'status' : 'refresh';
375
- }
376
-
377
- /** A method, fn or arg name as a label: `mark_done` → "Mark done", `Task.archive` → "Archive", `owner_id` → "Owner ID". */
378
- export function actionLabel(fn: string): string {
379
- const last = fn.split(/[/.]/).pop() ?? fn;
380
- return humanize(last) || fn;
381
- }
382
-
383
- /** Build 8's visuals as the widget pass names them: the family and its style, and how the old channels map. */
384
- const V1_VISUALS: Readonly<Record<string, { readonly visual: string; readonly style: string; readonly channels: Readonly<Record<string, string>> }>> = {
385
- table: { visual: 'table', style: 'table', channels: { columns: 'columns' } },
386
- bar: { visual: 'category', style: 'bar', channels: { label: 'x', value: 'y' } },
387
- value: { visual: 'value', style: 'cards', channels: { value: 'value' } },
388
- };
389
-
390
- /** A build 8 action's `then` in the widget pass's words. */
391
- const V1_THEN: Readonly<Record<ActionThenV1, ActionThen>> = { refresh: 'refresh', show: 'open', none: 'status' };
392
-
393
- /**
394
- * A build 8 `hub/widget` payload as a widget-pass spec, for the hub's start-up migration: visuals renamed to their
395
- * family and style (another system's visual keeps its name with the `default` style), controls as arg plans, paging
396
- * kept only when both paging args were named, actions with their `then` renamed.
397
- */
398
- export function upgradeWidgetSpec(old: WidgetSpecV1): WidgetSpec {
399
- const visuals = old.visuals.map((entry): WidgetVisual => {
400
- const known = V1_VISUALS[entry.visual];
401
- const bind: VisualBinding = {};
402
- for (const [channel, columns] of Object.entries(entry.bind)) { bind[known?.channels[channel] ?? channel] = columns; }
403
- return { visual: known?.visual ?? entry.visual, style: known?.style ?? 'default', ...(entry.label === undefined ? {} : { label: entry.label }), bind };
404
- });
405
- const [first, ...rest] = visuals;
406
- const args: Record<string, ArgPlan> = {};
407
- for (const control of old.controls) {
408
- if (control.pinned !== undefined) { args[control.arg] = { show: 'pinned', value: { literal: control.pinned } }; continue; }
409
- if (control.hidden === true) { args[control.arg] = { show: 'hidden' }; continue; }
410
- const choices = control.choices?.map((value): ChoiceOption => ({ label: typeof value === 'string' ? value : JSON.stringify(value), value: { literal: value } }));
411
- args[control.arg] = {
412
- show: 'control', ...(control.label === undefined ? {} : { label: control.label }),
413
- ...(choices === undefined ? {} : { choices }), ...(control.custom === undefined ? {} : { custom: control.custom }),
414
- };
415
- }
416
- const { offset, limit } = old.paging ?? {};
417
- return {
418
- title: old.title, source: old.source, visuals: first === undefined ? [{ visual: 'table', style: 'table', bind: {} }] : [first, ...rest], args, presets: [],
419
- ...(offset !== undefined && limit !== undefined ? { paging: { offset, limit } } : {}),
420
- ...(old.actions === undefined ? {} : {
421
- actions: old.actions.map((action): WidgetAction => ({
422
- fn: action.fn, bind: action.bind, then: V1_THEN[action.then],
423
- ...(action.label === undefined ? {} : { label: action.label }), ...(action.confirm === undefined ? {} : { confirm: action.confirm }),
424
- })),
425
- }),
426
- };
427
- }
@@ -1,2 +0,0 @@
1
- import{D as e,Ht as t,On as n,St as r,Zn as i,_ as a,b as o,bt as s,ct as c,g as l,it as u,k as d,mt as f,o as p,qt as m,tr as h,tt as g,v as _,vn as v,y}from"./runtime-core.esm-bundler-wlpNGAAZ.js";import{Pr as b,i as x,o as S,pr as C}from"./routes-DV4IJpwe.js";import{n as w}from"./stores-BMEvTe-I.js";import{W as T,Y as E,c as D}from"./ui-BzgWquIU.js";import{t as O}from"./_plugin-vue_export-helper-BDNMzG2s.js";var k={class:`admin-nav`,"aria-label":`Admin`},A=[`data-more`],j=[`data-group`],M=[`aria-label`],N=[`aria-label`],P=O(d({__name:`AdminNav`,props:{groups:{}},setup(l){let u=l,d=v(null),b=D(d),x=e=>e.active&&e.entries.length>1;function S(){g(()=>{d.value?.querySelector(`[aria-current="page"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})})}return c(S),t(()=>u.groups.flatMap(e=>e.entries).find(e=>e.active)?.id,S),(t,c)=>{let u=r(`RouterLink`);return f(),o(`nav`,k,[a(`ul`,{ref_key:`list`,ref:d,class:`strip edge-fade`,"data-more":n(b)},[(f(!0),o(p,null,s(l.groups,t=>(f(),o(`li`,{key:t.id,class:i({cluster:x(t)}),"data-group":t.id},[x(t)?(f(!0),o(p,{key:0},s(t.entries,(e,r)=>(f(),_(u,{key:e.id,to:e.to,class:i([`link`,{active:e.active}]),"aria-current":e.active?`page`:void 0,"data-testid":`admin-nav-${e.id}`},{default:m(()=>[r===0?(f(),_(n(E),{key:0,name:t.icon,size:16},null,8,[`name`])):y(``,!0),a(`span`,null,h(e.label),1),e.count>0?(f(),o(`span`,{key:1,class:`count`,"aria-label":`${e.count} waiting`},h(n(T)(e.count)),9,M)):y(``,!0)]),_:2},1032,[`to`,`class`,`aria-current`,`data-testid`]))),128)):(f(),_(u,{key:1,to:t.to,class:i([`link`,{active:t.active}]),"aria-current":t.active?`page`:void 0,"data-testid":t.entries.length===1?`admin-nav-${t.entries[0]?.id}`:`admin-nav-group-${t.id}`},{default:m(()=>[e(n(E),{name:t.icon,size:16},null,8,[`name`]),a(`span`,null,h(t.entries.length===1?t.entries[0]?.label:t.label),1),t.count>0?(f(),o(`span`,{key:0,class:`count`,"aria-label":`${t.count} waiting`},h(n(T)(t.count)),9,N)):y(``,!0)]),_:2},1032,[`to`,`class`,`aria-current`,`data-testid`]))],10,j))),128))],8,A)])}}}),[[`__scopeId`,`data-v-cb0cb8da`]]),F={systems:{label:`Systems`,icon:`server`,to:S.systems(),routes:[x.systems,x.system,x.review,x.instance]},fns:{label:`Fns`,icon:`fn`,to:S.fns(),routes:[x.fns,x.fn]},graph:{label:`Graph`,icon:`tree`,to:S.graph(),routes:[x.graph]},models:{label:`Models`,icon:`sparkles`,to:S.models(),routes:[x.models]},limits:{label:`Budgets`,icon:`coins`,to:S.limits(),routes:[x.limits]},people:{label:`People`,icon:`users`,to:S.people(),routes:[x.people]},policies:{label:`Policies`,icon:`shield`,to:S.policies(),routes:[x.policies]},"actor-settings":{label:`Actor settings`,icon:`users`,to:S.actorSettings(),routes:[x.actorSettings]},runs:{label:`Runs`,icon:`play`,to:S.runs(),routes:[x.runs]},"model-calls":{label:`Model calls`,icon:`cpu`,to:S.modelCalls(),routes:[x.modelCalls,x.llmCalls]},mcps:{label:`Hub MCP`,icon:`link`,to:S.mcps(),routes:[x.mcps,x.mcp]},"mcp-servers":{label:`MCP servers`,icon:`layers`,to:S.mcpServers(),routes:[x.mcpServers,x.mcpServer]},"api-services":{label:`API services`,icon:`globe`,to:S.apiServices(),routes:[x.apiServices,x.apiService]}},I=e=>typeof e==`string`&&Object.values(x).includes(e);function L(e,t={}){let n=I(e.name)?e.name:void 0;return C.options.map(e=>{let r=F[e],i=r.routes;return{id:e,label:r.label,icon:r.icon,to:r.to,active:n!==void 0&&i.includes(n),count:t[e]??0}})}var R=[{id:`systems`,label:`Systems`,icon:`server`,sections:[`systems`,`graph`,`mcp-servers`,`api-services`]},{id:`fns`,label:`Fns`,icon:`fn`,sections:[`fns`]},{id:`models`,label:`Models`,icon:`sparkles`,sections:[`models`,`limits`]},{id:`people`,label:`People`,icon:`users`,sections:[`people`]},{id:`rules`,label:`Rules`,icon:`shield`,sections:[`policies`,`actor-settings`]},{id:`activity`,label:`Activity`,icon:`play`,sections:[`runs`,`model-calls`]},{id:`mcps`,label:`Hub MCP`,icon:`link`,sections:[`mcps`]}];function z(e,t={}){let n=new Map(L(e,t).map(e=>[e.id,e]));return R.map(e=>{let t=e.sections.flatMap(e=>n.get(e)??[]);return{id:e.id,label:e.label,icon:e.icon,to:F[e.sections[0]].to,active:t.some(e=>e.active),count:t.reduce((e,t)=>e+t.count,0),entries:t}})}var B={class:`admin`,"data-testid":`admin`},V=O(d({__name:`AdminLayout`,setup(t){let{admin:n}=w(),i=b(),a=l(()=>z(i,{systems:n.systems.pending.value}));return c(()=>{n.start()}),u(()=>{n.stop()}),(t,n)=>{let i=r(`RouterView`);return f(),o(`div`,B,[e(P,{groups:a.value},null,8,[`groups`]),e(i)])}}}),[[`__scopeId`,`data-v-e8e718c4`]]);export{V as default};
2
- //# sourceMappingURL=AdminLayout-B6Jrc_4W.js.map
@@ -1 +0,0 @@
1
- .form[data-v-b0f43632]{gap:var(--space-4);min-width:0;display:grid}.pair[data-v-b0f43632]{gap:var(--space-3);grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));display:grid}
@@ -1,2 +0,0 @@
1
- import{$ as e,D as t,Ft as n,On as r,_ as i,b as a,k as o,mt as s,un as c,v as l,y as u}from"./runtime-core.esm-bundler-wlpNGAAZ.js";import{a as d,b as f,l as p}from"./ui-BzgWquIU.js";import{Ot as m}from"./index-6ScWTFy2.js";import{n as h,r as g,t as _}from"./RemoteAuthFields-CgiufuqQ.js";import{t as v}from"./_plugin-vue_export-helper-BDNMzG2s.js";var y={class:`form`,"data-testid":`api-service-form`},b={class:`pair`},x=v(o({__name:`ApiServiceForm`,props:e({problems:{default:()=>({})}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let o=n(e,`modelValue`),v=g(o),x=v(`label`),S=v(`description`),C=v(`baseUrl`),w=v(`auth`),T=v(`headers`),E=v(`openapi`),D=v(`timeout`),O=v(`maxBody`),k=v(`allowPrivate`),A=v(`shared`);return(n,g)=>(s(),a(`div`,y,[t(r(f),{modelValue:r(x),"onUpdate:modelValue":g[0]||=e=>c(x)?x.value=e:null,label:`Name`,placeholder:`GitHub`,required:``,error:e.problems.label??``,"data-testid":`service-label`},null,8,[`modelValue`,`error`]),t(r(d),{modelValue:r(S),"onUpdate:modelValue":g[1]||=e=>c(S)?S.value=e:null,label:`Description`,rows:2,placeholder:`What it is for`},null,8,[`modelValue`]),t(r(f),{modelValue:r(C),"onUpdate:modelValue":g[2]||=e=>c(C)?C.value=e:null,label:`Base URL`,type:`url`,placeholder:`https://api.github.com`,required:``,hint:`Every request is made under it; a program can't leave it.`,error:e.problems.baseUrl??``,"data-testid":`service-base-url`},null,8,[`modelValue`,`error`]),t(_,{modelValue:r(w),"onUpdate:modelValue":g[3]||=e=>c(w)?w.value=e:null,problems:e.problems,kinds:r(m),secrets:!1},null,8,[`modelValue`,`problems`,`kinds`]),t(h,{rows:r(T),"onUpdate:rows":g[4]||=e=>c(T)?T.value=e:null,label:`Headers on every request`,"name-placeholder":`Accept`,"value-placeholder":`application/json`,hint:`Not secrets; the sign-in carries those.`,error:e.problems.headers??``,testid:`service-headers`},null,8,[`rows`,`error`]),t(r(f),{modelValue:r(E),"onUpdate:modelValue":g[5]||=e=>c(E)?E.value=e:null,label:`OpenAPI document`,type:`url`,placeholder:`https://api.example.com/openapi.json`,hint:`The authoring agent reads its operations.`,error:e.problems.openapi??``},null,8,[`modelValue`,`error`]),i(`div`,b,[t(r(f),{modelValue:r(D),"onUpdate:modelValue":g[6]||=e=>c(D)?D.value=e:null,label:`Request timeout (seconds)`,type:`number`,hint:`A slower request is stopped.`,error:e.problems.timeout??``},null,8,[`modelValue`,`error`]),t(r(f),{modelValue:r(O),"onUpdate:modelValue":g[7]||=e=>c(O)?O.value=e:null,label:`Largest body kept (KB)`,type:`number`,hint:`A larger response becomes a resource.`,error:e.problems.maxBody??``},null,8,[`modelValue`,`error`])]),t(r(p),{modelValue:r(k),"onUpdate:modelValue":g[8]||=e=>c(k)?k.value=e:null,label:`Allow private addresses`,description:`Let requests reach your own network (localhost, 10.x, 192.168.x). Off by default.`,"data-testid":`service-allow-private`},null,8,[`modelValue`]),o.value.privateTo===void 0?u(``,!0):(s(),l(r(p),{key:0,modelValue:r(A),"onUpdate:modelValue":g[9]||=e=>c(A)?A.value=e:null,label:`Shared with everyone`,description:`Added by someone's agent: only they see it until you share it.`,"data-testid":`service-shared`},null,8,[`modelValue`]))]))}}),[[`__scopeId`,`data-v-b0f43632`]]);export{x as t};
2
- //# sourceMappingURL=ApiServiceForm-CuuQgOJc.js.map
@@ -1,2 +0,0 @@
1
- import{D as e,E as t,Ht as n,On as r,St as ee,_ as i,b as a,g as o,it as s,k as c,mt as l,o as u,qt as d,tr as f,un as p,v as m,vn as h,y as g}from"./runtime-core.esm-bundler-wlpNGAAZ.js";import{q as _}from"./src-CT3TeFaM.js";import{Fr as v,Pr as y,mr as te,o as b}from"./routes-DV4IJpwe.js";import{t as ne}from"./AppPage-CFmKZS8G.js";import{t as re}from"./url-DKGcECT1.js";import{l as ie}from"./labels-BFbk11BE.js";import{n as ae}from"./stores-BMEvTe-I.js";import{R as x,Y as S,o as C,z as w}from"./ui-BzgWquIU.js";import{t as T}from"./now-40JhSjx0.js";import{t as E}from"./ConfirmDialog-Dd3E4sJt.js";import{t as D}from"./FactList-CeAbKajD.js";import{t as O}from"./FnList-Bx6H-kux.js";import{t as k}from"./LoadState-h-K9bTYc.js";import{t as A}from"./ApiServiceForm-CuuQgOJc.js";import{At as j,Dt as M,jt as N,kt as P}from"./index-6ScWTFy2.js";import{a as F}from"./remote-config-BNQhSDzB.js";import{t as I}from"./_plugin-vue_export-helper-BDNMzG2s.js";var L={key:0,class:`links`},R={class:`save`},z={key:0,class:`problem`,role:`alert`},B=I(c({__name:`ApiServiceView`,setup(c){let{admin:I,toasts:B}=ae(),V=I.apiServices,H=y(),U=v(),W=T(),G=re(`tab`,te,`overview`),K=o(()=>N(H.params.service)),q=o(()=>V.service.value.value),J=o(()=>q.value?.service),Y=o(()=>J.value?.label??K.value??`API service`),X=o(()=>V.fns.value.value??[]),oe=o(()=>[{value:`overview`,label:`Overview`},{value:`settings`,label:`Settings`}]),se=o(()=>{let e=J.value;return e===void 0?[]:[{label:`Base URL`,value:e.baseUrl,code:!0},{label:`Sign-in`,value:F(e.auth)},...e.openapi===void 0?[]:[{label:`OpenAPI`,value:e.openapi,code:!0}],...e.headers===void 0?[]:[{label:`Headers`,value:Object.keys(e.headers).join(`, `)}],{label:`Limits`,value:`${String(e.timeout/1e3)} s a request, bodies up to ${ie(e.maxBody)}`},{label:`Name`,value:e.name,code:!0},...e.allowPrivate?[{label:`Private addresses`,value:`Allowed`}]:[],...e.privateTo===void 0?[]:[{label:`Seen by`,value:`Only the person whose agent added it, until you share it in Settings`}]]}),Z=h(P()),Q=h({}),$=h(!1);n(()=>q.value?.version,()=>{Z.value=P(J.value),Q.value={}},{immediate:!0}),n(K,e=>{e!==void 0&&V.show(e)},{immediate:!0}),s(()=>{V.close()});async function ce(){let e=q.value;if(e===void 0)return;let t=j({...Z.value,name:e.service.name});if(Q.value=t.ok?{}:t.problems,!t.ok)return;let n=await V.save(t.service,e);if(n.ok){let t=n.value.service.baseUrl!==e.service.baseUrl&&e.service.auth.kind!==`none`;B.ok(`Settings saved`,t?`Its base URL changed: its sign-ins are set again on the API sign-ins page.`:void 0)}}async function le(){let e=q.value;if(e===void 0)return;let t=await V.remove(e);$.value=!1,t?(B.ok(`Removed ${Y.value}`),await U.push(b.apiServices())):B.error(V.removing.problem.value||`Couldn't remove ${Y.value}.`)}return(n,o)=>{let s=ee(`RouterLink`);return l(),m(ne,{title:Y.value,description:J.value?.description??``,"keep-title":``},{crumb:d(()=>[e(s,{to:r(b).apiServices(),class:`crumb`,"data-testid":`back-to-services`},{default:d(()=>[e(r(S),{name:`chevron-left`,size:14}),o[8]||=t(`API services`,-1)]),_:1},8,[`to`])]),actions:d(()=>[K.value?(l(),m(r(w),{key:0,icon:`refresh`,variant:`ghost`,loading:r(V).service.loading.value,"data-testid":`service-refresh`,onClick:o[0]||=e=>r(V).show(K.value)},{default:d(()=>[...o[9]||=[t(`Refresh`,-1)]]),_:1},8,[`loading`])):g(``,!0),q.value?(l(),m(r(w),{key:1,icon:`trash`,variant:`ghost`,"data-testid":`service-remove`,onClick:o[1]||=e=>$.value=!0},{default:d(()=>[...o[10]||=[t(`Remove`,-1)]]),_:1})):g(``,!0)]),default:d(()=>[e(k,{loading:r(V).service.loading.value,problem:r(V).service.problem.value,ready:r(V).service.value.value!==void 0||!r(V).service.loading.value,empty:J.value===void 0,"empty-icon":`globe`,"empty-title":`No such API service`,"empty-body":`It may have been removed.`,lines:8,onRetry:o[6]||=e=>K.value&&r(V).show(K.value)},{default:d(()=>[J.value&&K.value?(l(),a(u,{key:0},[e(r(C),{modelValue:r(G),"onUpdate:modelValue":o[2]||=e=>p(G)?G.value=e:null,tabs:oe.value,label:`API service`},null,8,[`modelValue`,`tabs`]),r(G)===`overview`?(l(),a(u,{key:0},[e(r(x),{compact:``},{default:d(()=>[e(D,{facts:se.value,testid:`service-facts`},null,8,[`facts`])]),_:1}),J.value.auth.kind===`none`?g(``,!0):(l(),a(`div`,L,[e(s,{to:r(b).connect(r(M)),"data-testid":`service-connections`},{default:d(()=>[e(r(S),{name:`key`,size:14}),t(f(J.value.auth.per===`shared`?`Set its shared sign-in`:`Sign-ins`),1)]),_:1},8,[`to`])])),e(k,{loading:r(V).fns.loading.value,problem:r(V).fns.problem.value,ready:r(V).fns.value.value!==void 0,empty:X.value.length===0,"empty-icon":`fn`,"empty-title":`No fns yet`,"empty-body":`Ask in the chat for a fn that calls ${Y.value}; the authoring agent reads its OpenAPI document and tests GETs.`,onRetry:o[3]||=e=>r(V).show(K.value)},{default:d(()=>[e(O,{fns:X.value,now:r(W),"runs-of":r(b).fnRuns},null,8,[`fns`,`now`,`runs-of`])]),_:1},8,[`loading`,`problem`,`ready`,`empty`,`empty-body`])],64)):(l(),a(`form`,{key:1,class:`settings`,novalidate:``,"data-testid":`service-settings`,onSubmit:_(ce,[`prevent`])},[e(r(x),{compact:``},{default:d(()=>[e(A,{modelValue:Z.value,"onUpdate:modelValue":o[4]||=e=>Z.value=e,problems:Q.value},null,8,[`modelValue`,`problems`])]),_:1}),i(`div`,R,[e(r(w),{variant:`ghost`,onClick:o[5]||=e=>Z.value=r(P)(J.value)},{default:d(()=>[...o[11]||=[t(`Revert`,-1)]]),_:1}),e(r(w),{type:`submit`,variant:`primary`,loading:r(V).saving.busy.value,"data-testid":`service-save`},{default:d(()=>[...o[12]||=[t(`Save`,-1)]]),_:1},8,[`loading`])]),r(V).saving.problem.value===``?g(``,!0):(l(),a(`p`,z,f(r(V).saving.problem.value),1))],32))],64)):g(``,!0)]),_:1},8,[`loading`,`problem`,`ready`,`empty`]),e(E,{open:$.value,"onUpdate:open":o[7]||=e=>$.value=e,title:`Remove ${Y.value}?`,body:`Its fns stop working until a service of the same name is added again. People's sign-ins to it stay until they remove them.`,confirm:`Remove`,busy:r(V).removing.busy.value,onConfirm:le},null,8,[`open`,`title`,`busy`])]),_:1},8,[`title`,`description`])}}}),[[`__scopeId`,`data-v-7ffa7807`]]);export{B as default};
2
- //# sourceMappingURL=ApiServiceView-7bTHSO_Z.js.map
@@ -1 +0,0 @@
1
- .crumb[data-v-7ffa7807]{color:var(--text-dim);font-weight:var(--weight-medium);align-items:center;gap:2px;margin-left:-2px;text-decoration:none;display:inline-flex}.crumb[data-v-7ffa7807]:hover{color:var(--accent)}.links[data-v-7ffa7807]{gap:var(--space-2) var(--space-4);font-size:var(--text-sm);flex-wrap:wrap;display:flex}.links a[data-v-7ffa7807]{align-items:center;gap:var(--space-1);display:inline-flex}.settings[data-v-7ffa7807]{gap:var(--space-4);max-width:48rem;display:grid}.save[data-v-7ffa7807]{justify-content:flex-end;gap:var(--space-2);display:flex}.problem[data-v-7ffa7807]{color:var(--danger);font-size:var(--text-sm);margin:0}
@@ -1 +0,0 @@
1
- .page[data-v-9f1682e1]{gap:var(--space-4);min-width:0;display:grid}
@@ -1,2 +0,0 @@
1
- import{D as e,E as t,Ht as n,On as r,_ as i,ct as a,g as o,k as s,mt as c,qt as l,v as u,vn as d}from"./runtime-core.esm-bundler-wlpNGAAZ.js";import{Fr as f,i as p,o as m}from"./routes-DV4IJpwe.js";import{t as h}from"./AppPage-CFmKZS8G.js";import{t as g}from"./live-kTMxmy8I.js";import{n as _}from"./url-DKGcECT1.js";import{n as v}from"./stores-BMEvTe-I.js";import{S as y,b,z as x}from"./ui-BzgWquIU.js";import{n as S,t as C}from"./ServiceRows-4WythFpF.js";import{t as w}from"./ApiServiceForm-CuuQgOJc.js";import{t as T}from"./LoadState-h-K9bTYc.js";import{At as E,Dt as D,kt as O}from"./index-6ScWTFy2.js";import{a as k}from"./remote-config-BNQhSDzB.js";import{t as A}from"./_plugin-vue_export-helper-BDNMzG2s.js";var j={class:`page`},M=A(s({__name:`ApiServicesView`,setup(s){let{admin:A,toasts:M}=v(),N=A.apiServices,P=f(),F=_(p.apiServices),I=F.draft(`q`),L=F.text(`add`,{push:!0}),R=o({get:()=>L.value===`1`,set:e=>{L.value=e?`1`:``}}),z=d(O()),B=d(``),V=d({});n(R,e=>{e&&(z.value=O(),B.value=``,V.value={})});let H={none:{tone:`ok`,word:`Open`,live:!1},shared:{tone:`accent`,word:`Shared sign-in`,live:!1},person:{tone:`neutral`,word:`Each person signs in`,live:!1}},U=o(()=>(N.list.value.value??[]).map(({service:e})=>({key:e.name,to:m.apiService(e.name),label:e.label,where:e.baseUrl,look:H[e.auth.kind===`none`?`none`:e.auth.per],detail:[e.name,k(e.auth),e.openapi===void 0?``:`OpenAPI`].filter(e=>e!==``).join(` · `)}))),W=o(()=>I.value.value.trim()!==``);n(()=>I.value.value,e=>{N.load(e,N.list.value.value!==void 0)}),a(()=>{N.load(I.value.value,N.list.value.value!==void 0)}),g(()=>{N.load(I.value.value,!0)},3e4);async function G(){let e=E({...z.value,name:B.value});if(V.value=e.ok?{}:e.problems,!e.ok)return;let t=await N.save(e.service);if(!t.ok)return;let n=e.service.auth.kind===`none`?`Ask in the chat for fns that call it.`:`Its sign-in is set on the API sign-ins page; then ask in the chat for fns that call it.`;M.ok(`Added ${e.service.label}`,n),await P.replace(m.apiService(t.value.service.name))}return(n,a)=>(c(),u(h,{title:`API services`,description:`The web APIs api fns call: each a base URL and how it signs in. Fns never see a credential; people's tokens are their connections.`},{actions:l(()=>[e(r(x),{variant:`ghost`,icon:`key`,"data-testid":`api-sign-ins`,onClick:a[0]||=e=>r(P).push(r(m).connect(r(D)))},{default:l(()=>[...a[8]||=[t(`Sign-ins`,-1)]]),_:1}),e(r(x),{variant:`primary`,icon:`plus`,"data-testid":`add-api-service`,onClick:a[1]||=e=>R.value=!0},{default:l(()=>[...a[9]||=[t(`Add API service`,-1)]]),_:1})]),default:l(()=>[i(`div`,j,[e(r(b),{modelValue:r(I).draft.value,"onUpdate:modelValue":a[2]||=e=>r(I).draft.value=e,type:`search`,icon:`search`,label:`Search API services`,"hide-label":``,placeholder:`Search names, base URLs and descriptions`,clearable:``,"data-testid":`api-services-search`},null,8,[`modelValue`]),e(T,{loading:r(N).list.loading.value,problem:r(N).list.problem.value,ready:r(N).list.value.value!==void 0,empty:U.value.length===0,onRetry:a[4]||=e=>r(N).load()},{empty:l(()=>[W.value?(c(),u(r(y),{key:0,icon:`search`,title:`No API services match`,body:`Try other words.`})):(c(),u(r(y),{key:1,icon:`globe`,title:`No API services yet`,body:`Add one by its base URL and sign-in, or ask in the chat for a fn that calls a web API: the authoring agent adds its service.`},{actions:l(()=>[e(r(x),{variant:`primary`,icon:`plus`,onClick:a[3]||=e=>R.value=!0},{default:l(()=>[...a[10]||=[t(`Add API service`,-1)]]),_:1})]),_:1}))]),default:l(()=>[e(C,{rows:U.value,icon:`globe`,testid:`api-services`},null,8,[`rows`])]),_:1},8,[`loading`,`problem`,`ready`,`empty`])]),e(S,{open:R.value,"onUpdate:open":a[6]||=e=>R.value=e,instance:B.value,"onUpdate:instance":a[7]||=e=>B.value=e,title:`Add API service`,description:`A web API that api fns call through the hub.`,label:z.value.label,"name-hint":`Its fns and sign-ins name it; it can't change later.`,"name-error":V.value.name??``,busy:r(N).saving.busy.value,problem:r(N).saving.problem.value,onSave:G},{default:l(()=>[e(w,{modelValue:z.value,"onUpdate:modelValue":a[5]||=e=>z.value=e,problems:V.value},null,8,[`modelValue`,`problems`])]),_:1},8,[`open`,`instance`,`label`,`name-error`,`busy`,`problem`])]),_:1}))}}),[[`__scopeId`,`data-v-9f1682e1`]]);export{M as default};
2
- //# sourceMappingURL=ApiServicesView-BXi24n49.js.map
@@ -1 +0,0 @@
1
- .chart[data-v-61963f21]{gap:var(--space-1);width:100%;min-width:0;display:grid}.canvas[data-v-61963f21]{width:100%;min-width:0;height:var(--chart-full,var(--chart-h))}.period[data-v-61963f21]{justify-content:center;align-items:center;gap:var(--space-2);display:flex}.period .label[data-v-61963f21]{min-width:10ch;color:var(--text);font-size:var(--text-sm);font-weight:var(--weight-medium);text-align:center}.problem[data-v-61963f21]{padding:var(--space-4);border:1px dashed var(--border-strong);border-radius:var(--radius);color:var(--text-dim);font-size:var(--text-sm);margin:0}