akanjs 3.0.2 → 3.1.0-rc.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 (378) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/base/baseEnv.ts +0 -4
  3. package/base/primitiveRegistry.ts +2 -2
  4. package/client/cookie.ts +5 -1
  5. package/client/csrLocation.ts +122 -0
  6. package/client/csrTypes.ts +32 -4
  7. package/client/device.ts +2 -1
  8. package/client/frameConfig.ts +78 -7
  9. package/client/index.ts +3 -0
  10. package/client/makePageProto.tsx +3 -2
  11. package/client/native/external-view.ts +1 -0
  12. package/client/route/RootLayoutDefinition.ts +7 -1
  13. package/client/route/RouteHead.ts +108 -0
  14. package/client/route/index.ts +1 -0
  15. package/client/router.ts +36 -23
  16. package/client/rscNavigation.ts +8 -2
  17. package/client/viewportMeta.ts +60 -0
  18. package/client/webManifest.ts +18 -0
  19. package/common/Logger.ts +7 -2
  20. package/common/PipelineNames.ts +31 -0
  21. package/common/PipelinePattern.ts +70 -0
  22. package/common/PipelinePlanSchema.ts +490 -0
  23. package/common/backoff.ts +14 -0
  24. package/common/index.ts +39 -0
  25. package/common/pipelinePlan.ts +259 -0
  26. package/common/routeConvention.ts +1 -0
  27. package/common/types.ts +17 -0
  28. package/constant/constantRegistry.ts +26 -6
  29. package/dictionary/base.dictionary.ts +8 -0
  30. package/dictionary/trans.ts +9 -1
  31. package/document/into.ts +5 -0
  32. package/fetch/client/fetchClient.ts +135 -31
  33. package/fetch/client/httpClient.ts +45 -0
  34. package/fetch/client/wsClient.ts +125 -16
  35. package/fetch/fetchType/buildFetch.type.ts +1 -0
  36. package/index.ts +243 -10
  37. package/package.json +1 -5
  38. package/server/akanApp.ts +5 -2
  39. package/server/akanServer.ts +44 -8
  40. package/server/artifact/builderRpc.ts +8 -3
  41. package/server/artifact/ipcTypes.ts +5 -2
  42. package/server/di/diLifecycle.ts +39 -3
  43. package/server/di/utils.ts +28 -1
  44. package/server/ed25519Key.ts +48 -0
  45. package/server/index.ts +1 -0
  46. package/server/machine/index.ts +2 -0
  47. package/server/machine/machineAccount.ts +27 -0
  48. package/server/machine/machineToken.ts +151 -0
  49. package/server/mcp/McpApps.ts +256 -0
  50. package/server/mcp/McpDispatcher.ts +31 -7
  51. package/server/mcp/McpRouter.ts +209 -46
  52. package/server/ops/opsToken.ts +3 -10
  53. package/server/resolver/database.resolver.ts +3 -0
  54. package/server/resolver/signal.resolver.ts +40 -3
  55. package/server/routeElementComposer.tsx +78 -2
  56. package/server/routeState.ts +6 -0
  57. package/server/routeTreeBuilder.ts +26 -9
  58. package/server/routing/apiRouter.ts +6 -3
  59. package/server/routing/roomReplay.ts +88 -0
  60. package/server/rscClient.tsx +53 -8
  61. package/server/rscWorker.tsx +141 -27
  62. package/server/rscWorkerHost.ts +18 -5
  63. package/server/sitemap.ts +14 -0
  64. package/server/ssrFromRscRenderer.tsx +12 -6
  65. package/server/ssrTypes.ts +3 -1
  66. package/server/systemPageDocument.tsx +38 -30
  67. package/server/types.tsx +2 -0
  68. package/server/webRouter.ts +74 -5
  69. package/service/injectInfo.ts +9 -1
  70. package/service/ipcTypes.ts +2 -1
  71. package/service/predefinedAdaptor/database.adaptor.ts +1 -146
  72. package/service/predefinedAdaptor/queue.adaptor.ts +44 -6
  73. package/service/predefinedAdaptor/queueBackoff.ts +12 -0
  74. package/service/predefinedAdaptor/solidQueue.adaptor.ts +17 -13
  75. package/service/predefinedAdaptor/sql/SqlDocumentStore.ts +44 -2
  76. package/service/predefinedAdaptor/sql/dialect/postgres.ts +3 -0
  77. package/service/predefinedAdaptor/sql/dialect/sqlite.ts +5 -2
  78. package/service/predefinedAdaptor/sql/search/fts5.ts +1 -1
  79. package/service/predefinedAdaptor/sql/types.ts +8 -6
  80. package/service/predefinedAdaptor/sql/values.ts +0 -23
  81. package/service/serve.ts +5 -1
  82. package/signal/agent.signal.ts +1 -1
  83. package/signal/base.signal.ts +2 -2
  84. package/signal/endpointIdempotency.ts +53 -0
  85. package/signal/internalArg.ts +14 -0
  86. package/signal/mcp/McpDocument.ts +38 -1
  87. package/signal/mcp/mcpProtocol.ts +18 -0
  88. package/signal/signalContext.ts +58 -30
  89. package/signal/signalRegistry.ts +14 -4
  90. package/signal/types.ts +18 -3
  91. package/store/agent/StoreSurfaceSource.ts +1 -1
  92. package/store/agentic/StToolBuilder.ts +3 -0
  93. package/test/conformance.ts +9 -33
  94. package/types/base/baseEnv.d.ts +0 -4
  95. package/types/base/primitiveRegistry.d.ts +1 -1
  96. package/types/client/csrLocation.d.ts +32 -0
  97. package/types/client/csrTypes.d.ts +40 -4
  98. package/types/client/frameConfig.d.ts +14 -2
  99. package/types/client/index.d.ts +3 -0
  100. package/types/client/native/external-view.d.ts +1 -0
  101. package/types/client/route/RootLayoutDefinition.d.ts +2 -1
  102. package/types/client/route/RouteHead.d.ts +13 -0
  103. package/types/client/route/index.d.ts +1 -0
  104. package/types/client/router.d.ts +6 -0
  105. package/types/client/rscNavigation.d.ts +4 -0
  106. package/types/client/viewportMeta.d.ts +18 -0
  107. package/types/client/webManifest.d.ts +4 -0
  108. package/types/common/PipelineNames.d.ts +6 -0
  109. package/types/common/PipelinePattern.d.ts +14 -0
  110. package/types/common/PipelinePlanSchema.d.ts +9 -0
  111. package/types/common/backoff.d.ts +10 -0
  112. package/types/common/index.d.ts +5 -0
  113. package/types/common/pipelinePlan.d.ts +224 -0
  114. package/types/common/types.d.ts +16 -0
  115. package/types/constant/constantRegistry.d.ts +5 -2
  116. package/types/dictionary/base.dictionary.d.ts +1 -1
  117. package/types/dictionary/dictionary.d.ts +8 -8
  118. package/types/document/into.d.ts +9 -0
  119. package/types/fetch/client/fetchClient.d.ts +31 -4
  120. package/types/fetch/client/httpClient.d.ts +8 -0
  121. package/types/fetch/client/wsClient.d.ts +26 -2
  122. package/types/fetch/fetchType/buildFetch.type.d.ts +1 -0
  123. package/types/index.d.ts +230 -9
  124. package/types/server/akanServer.d.ts +16 -1
  125. package/types/server/artifact/builderRpc.d.ts +7 -2
  126. package/types/server/artifact/ipcTypes.d.ts +5 -1
  127. package/types/server/di/utils.d.ts +1 -0
  128. package/types/server/ed25519Key.d.ts +13 -0
  129. package/types/server/index.d.ts +1 -0
  130. package/types/server/machine/index.d.ts +2 -0
  131. package/types/server/machine/machineAccount.d.ts +5 -0
  132. package/types/server/machine/machineToken.d.ts +29 -0
  133. package/types/server/machine.d.ts +1 -0
  134. package/types/server/mcp/McpApps.d.ts +50 -0
  135. package/types/server/mcp/McpDispatcher.d.ts +4 -1
  136. package/types/server/mcp/McpRouter.d.ts +4 -0
  137. package/types/server/resolver/signal.resolver.d.ts +2 -1
  138. package/types/server/routeElementComposer.d.ts +24 -4
  139. package/types/server/routeState.d.ts +4 -1
  140. package/types/server/routing/roomReplay.d.ts +24 -0
  141. package/types/server/rscWorkerHost.d.ts +5 -2
  142. package/types/server/sitemap.d.ts +2 -0
  143. package/types/server/ssrFromRscRenderer.d.ts +3 -3
  144. package/types/server/ssrTypes.d.ts +4 -1
  145. package/types/server/systemPageDocument.d.ts +2 -0
  146. package/types/server/types.d.ts +4 -1
  147. package/types/server/webRouter.d.ts +3 -1
  148. package/types/service/ipcTypes.d.ts +2 -0
  149. package/types/service/predefinedAdaptor/database.adaptor.d.ts +1 -24
  150. package/types/service/predefinedAdaptor/queue.adaptor.d.ts +10 -3
  151. package/types/service/predefinedAdaptor/queueBackoff.d.ts +4 -0
  152. package/types/service/predefinedAdaptor/solidQueue.adaptor.d.ts +3 -3
  153. package/types/service/predefinedAdaptor/sql/SqlDocumentStore.d.ts +6 -1
  154. package/types/service/predefinedAdaptor/sql/dialect/postgres.d.ts +1 -0
  155. package/types/service/predefinedAdaptor/sql/dialect/sqlite.d.ts +1 -0
  156. package/types/service/predefinedAdaptor/sql/search/fts5.d.ts +1 -1
  157. package/types/service/predefinedAdaptor/sql/types.d.ts +9 -5
  158. package/types/service/predefinedAdaptor/sql/values.d.ts +0 -3
  159. package/types/service/serve.d.ts +3 -0
  160. package/types/signal/endpointIdempotency.d.ts +7 -0
  161. package/types/signal/internalArg.d.ts +10 -0
  162. package/types/signal/mcp/McpDocument.d.ts +8 -0
  163. package/types/signal/mcp/mcpProtocol.d.ts +17 -0
  164. package/types/signal/signalContext.d.ts +5 -3
  165. package/types/signal/signalRegistry.d.ts +4 -4
  166. package/types/signal/types.d.ts +21 -1
  167. package/types/store/agentic/StToolBuilder.d.ts +2 -0
  168. package/types/test/conformance.d.ts +7 -10
  169. package/types/ui/Agent/Chat.d.ts +5 -1
  170. package/types/ui/Agent/EmbedApproval.d.ts +1 -0
  171. package/types/ui/Agent/index.d.ts +3 -0
  172. package/types/ui/Agent/useKeyboardFrame.d.ts +2 -0
  173. package/types/ui/Agent/useScreenActions.d.ts +18 -0
  174. package/types/ui/BottomSheet.d.ts +1 -0
  175. package/types/ui/Constant/Doc.d.ts +11 -17
  176. package/types/ui/Constant/index.d.ts +7 -2
  177. package/types/ui/Constant/schemaDoc.d.ts +11 -0
  178. package/types/ui/Dialog/Modal.d.ts +6 -1
  179. package/types/ui/Dialog/index.d.ts +1 -1
  180. package/types/ui/Dialog/modalSurface.d.ts +12 -0
  181. package/types/ui/Layout/BottomTab.d.ts +11 -2
  182. package/types/ui/Layout/FrameSlotFallback.d.ts +9 -0
  183. package/types/ui/Layout/Navbar.d.ts +4 -1
  184. package/types/ui/Layout/TopInset.d.ts +1 -1
  185. package/types/ui/Layout/index.d.ts +3 -3
  186. package/types/ui/Link/Action.d.ts +5 -1
  187. package/types/ui/Link/Anchor.d.ts +5 -3
  188. package/types/ui/Link/activePath.d.ts +13 -0
  189. package/types/ui/Link/index.d.ts +1 -1
  190. package/types/ui/Modal.d.ts +6 -1
  191. package/types/ui/Model/EditModal.d.ts +6 -1
  192. package/types/ui/Model/New.d.ts +6 -1
  193. package/types/ui/Model/ViewEditModal.d.ts +6 -1
  194. package/types/ui/Model/ViewModal.d.ts +6 -1
  195. package/types/ui/Model/newFormOrigin.d.ts +7 -0
  196. package/types/ui/Portal.d.ts +3 -1
  197. package/types/ui/Reference/origin.d.ts +12 -0
  198. package/types/ui/Signal/Doc.d.ts +23 -18
  199. package/types/ui/Signal/Listener.d.ts +2 -6
  200. package/types/ui/Signal/Object.d.ts +6 -10
  201. package/types/ui/Signal/Response.d.ts +3 -6
  202. package/types/ui/Signal/RestApi.d.ts +11 -15
  203. package/types/ui/Signal/WebSocket.d.ts +11 -21
  204. package/types/ui/Signal/endpointEntries.d.ts +8 -0
  205. package/types/ui/Signal/index.d.ts +35 -12
  206. package/types/ui/Signal/signalText.d.ts +178 -0
  207. package/types/ui/System/CSR.d.ts +2 -2
  208. package/types/ui/System/Client.d.ts +4 -3
  209. package/types/ui/System/Common.d.ts +27 -6
  210. package/types/ui/System/SSR.d.ts +6 -6
  211. package/types/ui/Tooltip.d.ts +4 -2
  212. package/types/ui/index.d.ts +2 -1
  213. package/types/ui/overlayLayer.d.ts +6 -0
  214. package/types/ui/overlayPosition.d.ts +17 -0
  215. package/types/vendor/@akanjs/native/packages/cli/src/api.d.ts +14 -3
  216. package/types/vendor/@akanjs/native/packages/cli/src/commands/update.d.ts +1 -1
  217. package/types/vendor/@akanjs/native/packages/cli/src/config.d.ts +30 -5
  218. package/types/vendor/@akanjs/native/packages/cli/src/lib/compat.d.ts +8 -0
  219. package/types/vendor/@akanjs/native/packages/cli/src/lib/desktop-server.d.ts +5 -0
  220. package/types/vendor/@akanjs/native/packages/cli/src/lib/distribution.d.ts +22 -0
  221. package/types/vendor/@akanjs/native/packages/cli/src/lib/project.d.ts +4 -0
  222. package/types/vendor/@akanjs/native/packages/cli/src/lib/publish.d.ts +16 -10
  223. package/types/vendor/@akanjs/native/packages/cli/src/lib/updates.d.ts +51 -7
  224. package/types/vendor/@akanjs/native/packages/cli/src/lib/vectors.d.ts +1 -1
  225. package/types/vendor/@akanjs/native/packages/cli/src/platforms/windows-installer.d.ts +7 -0
  226. package/types/vendor/@akanjs/native/packages/cli/src/platforms/windows.d.ts +5 -0
  227. package/types/vendor/@akanjs/native/packages/core/src/kernel.d.ts +36 -0
  228. package/types/vendor/@akanjs/native/packages/desktop/src/plugin.d.ts +2 -0
  229. package/types/vendor/@akanjs/native/packages/desktop/src/server.d.ts +11 -0
  230. package/types/vendor/@akanjs/native/plugins/external-view/src/desktop.d.ts +17 -0
  231. package/types/vendor/@akanjs/native/plugins/external-view/src/index.d.ts +132 -0
  232. package/types/vendor/@akanjs/native/plugins/external-view/src.d.ts +1 -0
  233. package/types/vendor/@akanjs/native/plugins/updates/src/index.d.ts +8 -0
  234. package/types/vendor/@akanjs/native/plugins/window/src/desktop.d.ts +4 -1
  235. package/types/vendor/@akanjs/native/plugins/window/src/index.d.ts +49 -0
  236. package/types/vendor/use-agentic/types.d.ts +2 -0
  237. package/types/webkit/CsrStack.d.ts +1 -1
  238. package/types/webkit/McpAppAgent.d.ts +14 -0
  239. package/types/webkit/McpAppApprovals.d.ts +8 -0
  240. package/types/webkit/McpAppBridge.d.ts +101 -0
  241. package/types/webkit/McpAppView.d.ts +21 -0
  242. package/types/webkit/index.d.ts +1 -0
  243. package/types/webkit/useLocation.d.ts +1 -1
  244. package/types/webkit/useVisualViewportFrame.d.ts +13 -0
  245. package/ui/Agent/Chat.tsx +29 -10
  246. package/ui/Agent/Composer.tsx +2 -1
  247. package/ui/Agent/EmbedApproval.tsx +17 -0
  248. package/ui/Agent/RichInput.tsx +1 -1
  249. package/ui/Agent/index.ts +2 -0
  250. package/ui/Agent/useKeyboardFrame.ts +10 -0
  251. package/ui/Agent/useScreenActions.ts +45 -0
  252. package/ui/BottomSheet.tsx +82 -53
  253. package/ui/Constant/Doc.tsx +113 -60
  254. package/ui/Constant/index.ts +2 -2
  255. package/ui/Constant/schemaDoc.ts +86 -26
  256. package/ui/Dialog/LegacyModal.tsx +53 -52
  257. package/ui/Dialog/Modal.tsx +93 -49
  258. package/ui/Dialog/modalSurface.ts +61 -0
  259. package/ui/DragAction.tsx +1 -1
  260. package/ui/DraggableList.tsx +1 -1
  261. package/ui/Dropdown.tsx +4 -6
  262. package/ui/KeyboardAvoiding.tsx +1 -1
  263. package/ui/Layout/BottomInset.tsx +20 -14
  264. package/ui/Layout/BottomTab.tsx +42 -16
  265. package/ui/Layout/FrameSlotFallback.tsx +59 -0
  266. package/ui/Layout/Navbar.tsx +37 -11
  267. package/ui/Layout/Sider.tsx +1 -1
  268. package/ui/Layout/TopInset.tsx +15 -14
  269. package/ui/Link/Action.tsx +15 -5
  270. package/ui/Link/Anchor.tsx +25 -13
  271. package/ui/Link/activePath.ts +25 -0
  272. package/ui/Link/index.tsx +1 -1
  273. package/ui/Load/Pagination.tsx +1 -1
  274. package/ui/Load/Units.tsx +1 -1
  275. package/ui/Loading/ProgressBar.tsx +1 -1
  276. package/ui/Modal.tsx +9 -0
  277. package/ui/Model/EditModal.tsx +16 -1
  278. package/ui/Model/New.tsx +25 -2
  279. package/ui/Model/NewWrapper_Client.tsx +2 -0
  280. package/ui/Model/ViewEditModal.tsx +9 -0
  281. package/ui/Model/ViewModal.tsx +16 -1
  282. package/ui/Model/newFormOrigin.ts +45 -0
  283. package/ui/Popconfirm.tsx +5 -7
  284. package/ui/Portal.tsx +4 -7
  285. package/ui/Reference/origin.ts +31 -0
  286. package/ui/ScreenNavigator.tsx +1 -1
  287. package/ui/Select.tsx +2 -7
  288. package/ui/Signal/Arg.tsx +2 -2
  289. package/ui/Signal/Doc.tsx +125 -63
  290. package/ui/Signal/Endpoint.tsx +11 -10
  291. package/ui/Signal/Listener.tsx +7 -10
  292. package/ui/Signal/Object.tsx +7 -14
  293. package/ui/Signal/Response.tsx +24 -24
  294. package/ui/Signal/RestApi.tsx +63 -52
  295. package/ui/Signal/WebSocket.tsx +65 -72
  296. package/ui/Signal/endpointEntries.ts +25 -0
  297. package/ui/Signal/index.ts +23 -6
  298. package/ui/Signal/signalText.ts +59 -0
  299. package/ui/System/CSR.tsx +34 -8
  300. package/ui/System/Client.tsx +36 -5
  301. package/ui/System/Common.tsx +76 -32
  302. package/ui/System/SSR.tsx +73 -31
  303. package/ui/Toast.tsx +1 -1
  304. package/ui/Tooltip.tsx +84 -30
  305. package/ui/index.ts +11 -1
  306. package/ui/overlayLayer.ts +25 -2
  307. package/ui/overlayPosition.ts +90 -0
  308. package/ui/recipe/inputRecipe.ts +8 -1
  309. package/ui/styles.css +152 -0
  310. package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeActivity.kt +22 -2
  311. package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeKernel.kt +37 -0
  312. package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeUpdateReports.kt +169 -0
  313. package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeUpdates.kt +110 -38
  314. package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeVectors.kt +20 -0
  315. package/vendor/@akanjs/native/native/desktop/Cargo.lock +16 -16
  316. package/vendor/@akanjs/native/native/desktop/src/external.rs +651 -0
  317. package/vendor/@akanjs/native/native/desktop/src/json.rs +23 -0
  318. package/vendor/@akanjs/native/native/desktop/src/lib.rs +228 -5
  319. package/vendor/@akanjs/native/native/ios/Sources/AkanNativeApp.swift +2 -1
  320. package/vendor/@akanjs/native/native/ios/Sources/AkanNativeKernel.swift +47 -1
  321. package/vendor/@akanjs/native/native/ios/Sources/AkanNativeUpdateReports.swift +145 -0
  322. package/vendor/@akanjs/native/native/ios/Sources/AkanNativeUpdates.swift +112 -43
  323. package/vendor/@akanjs/native/native/ios/Sources/AkanNativeVectors.swift +18 -0
  324. package/vendor/@akanjs/native/native/ios/Sources/AkanNativeViewController.swift +24 -2
  325. package/vendor/@akanjs/native/packages/cli/src/api.ts +22 -6
  326. package/vendor/@akanjs/native/packages/cli/src/commands/build.ts +24 -8
  327. package/vendor/@akanjs/native/packages/cli/src/commands/update.ts +11 -9
  328. package/vendor/@akanjs/native/packages/cli/src/config.ts +35 -7
  329. package/vendor/@akanjs/native/packages/cli/src/lib/compat.ts +2 -0
  330. package/vendor/@akanjs/native/packages/cli/src/lib/configkeys.ts +6 -4
  331. package/vendor/@akanjs/native/packages/cli/src/lib/desktop-server.ts +11 -1
  332. package/vendor/@akanjs/native/packages/cli/src/lib/distribution.ts +73 -0
  333. package/vendor/@akanjs/native/packages/cli/src/lib/project.ts +15 -3
  334. package/vendor/@akanjs/native/packages/cli/src/lib/publish.ts +70 -23
  335. package/vendor/@akanjs/native/packages/cli/src/lib/updates.ts +159 -23
  336. package/vendor/@akanjs/native/packages/cli/src/lib/vectors.ts +2 -0
  337. package/vendor/@akanjs/native/packages/cli/src/platforms/android.ts +9 -4
  338. package/vendor/@akanjs/native/packages/cli/src/platforms/desktop-update.ts +1 -1
  339. package/vendor/@akanjs/native/packages/cli/src/platforms/desktop.ts +4 -2
  340. package/vendor/@akanjs/native/packages/cli/src/platforms/ios.ts +9 -4
  341. package/vendor/@akanjs/native/packages/cli/src/platforms/windows-installer.ts +25 -11
  342. package/vendor/@akanjs/native/packages/cli/src/platforms/windows.ts +14 -3
  343. package/vendor/@akanjs/native/packages/core/src/kernel.ts +49 -0
  344. package/vendor/@akanjs/native/packages/core/vectors/updates.json +31 -0
  345. package/vendor/@akanjs/native/packages/desktop/src/main.ts +3 -0
  346. package/vendor/@akanjs/native/packages/desktop/src/plugin.ts +2 -0
  347. package/vendor/@akanjs/native/packages/desktop/src/server.ts +70 -6
  348. package/vendor/@akanjs/native/plugins/external-view/native-plugin.json +23 -0
  349. package/vendor/@akanjs/native/plugins/external-view/src/desktop.ts +321 -0
  350. package/vendor/@akanjs/native/plugins/external-view/src/index.ts +106 -0
  351. package/vendor/@akanjs/native/plugins/updates/android/UpdatesPlugin.kt +133 -41
  352. package/vendor/@akanjs/native/plugins/updates/ios/UpdatesPlugin.swift +101 -36
  353. package/vendor/@akanjs/native/plugins/updates/native-plugin.json +4 -2
  354. package/vendor/@akanjs/native/plugins/updates/src/desktop.ts +15 -1
  355. package/vendor/@akanjs/native/plugins/updates/src/index.ts +7 -1
  356. package/vendor/@akanjs/native/plugins/window/native-plugin.json +4 -0
  357. package/vendor/@akanjs/native/plugins/window/src/desktop.ts +68 -1
  358. package/vendor/@akanjs/native/plugins/window/src/index.ts +47 -0
  359. package/vendor/use-agentic/ToolRunner.ts +8 -1
  360. package/vendor/use-agentic/types.ts +2 -0
  361. package/webkit/CsrRouteTable.ts +1 -0
  362. package/webkit/CsrStack.ts +9 -2
  363. package/webkit/McpAppAgent.ts +138 -0
  364. package/webkit/McpAppApprovals.ts +56 -0
  365. package/webkit/McpAppBridge.ts +291 -0
  366. package/webkit/McpAppView.ts +258 -0
  367. package/webkit/bootCsr.tsx +54 -5
  368. package/webkit/index.ts +1 -0
  369. package/webkit/useCsrValues.ts +16 -10
  370. package/webkit/useFrameRuntime.ts +10 -1
  371. package/webkit/useLocation.ts +4 -3
  372. package/webkit/useVisualViewportFrame.tsx +52 -0
  373. package/service/predefinedAdaptor/sql/driver/libsql.ts +0 -45
  374. package/types/service/predefinedAdaptor/sql/driver/libsql.d.ts +0 -20
  375. package/types/ui/Agent/useKeyboardInset.d.ts +0 -1
  376. package/types/ui/ServerPortal.d.ts +0 -15
  377. package/ui/Agent/useKeyboardInset.ts +0 -19
  378. package/ui/ServerPortal.tsx +0 -49
@@ -9,6 +9,7 @@ import type { ReactNode } from "react";
9
9
 
10
10
  import { agentAttrs } from "../agentAttrs";
11
11
  import { type DraftProp, newDraftScope } from "./draftScope";
12
+ import { NewFormOrigin } from "./newFormOrigin";
12
13
 
13
14
  interface NewWrapperProps<Full = any> {
14
15
  className?: string;
@@ -60,6 +61,7 @@ export const NewWrapper_Client = <Full,>({
60
61
  sliceName,
61
62
  routePath: path,
62
63
  });
64
+ NewFormOrigin.set(modelName, sliceName);
63
65
  void storeDo[names.newModel](crystal, { modal, setDefault, sliceName, draftScope });
64
66
  resets?.forEach((reset) => {
65
67
  void storeDo[`reset${capitalize(reset)}`]();
@@ -9,6 +9,7 @@ import { BiDotsVertical, BiTrash } from "react-icons/bi";
9
9
 
10
10
  import { agentAttrs } from "../agentAttrs";
11
11
  import { buttonRecipe } from "../Button";
12
+ import type { ModalPlacement, ModalPresentation } from "../Dialog/modalSurface";
12
13
  import { Dropdown } from "../Dropdown";
13
14
  import { Modal } from "../Modal";
14
15
  import Remove from "./Remove";
@@ -59,6 +60,10 @@ const SaveAction = ({ modelName, label, onAct, closeView }: ActionProps) => {
59
60
 
60
61
  interface ViewEditModalProps {
61
62
  modalClassName?: string;
63
+ /** Passed to the `Modal`: `auto` is a full-screen sheet below `md`. */
64
+ presentation?: ModalPresentation;
65
+ /** Passed to the `Modal`: `right` is a side sheet from `md` up. */
66
+ placement?: ModalPlacement;
62
67
  viewClassName?: string;
63
68
  slice: SliceMeta;
64
69
  renderTitle?: (model: any) => ReactNode | string;
@@ -71,6 +76,8 @@ interface ViewEditModalProps {
71
76
  }
72
77
  export default function ViewEditModal({
73
78
  modalClassName,
79
+ presentation,
80
+ placement,
74
81
  viewClassName,
75
82
  slice,
76
83
  renderTitle,
@@ -121,6 +128,8 @@ export default function ViewEditModal({
121
128
  open={isModalOpen}
122
129
  onCancel={closeView}
123
130
  className={modalClassName}
131
+ presentation={presentation}
132
+ placement={placement}
124
133
  title={
125
134
  <div className="flex w-full items-center justify-between">
126
135
  <Title />
@@ -4,6 +4,7 @@ import type { SliceMeta } from "akanjs/fetch";
4
4
  import { st } from "akanjs/store";
5
5
  import type { ReactNode } from "react";
6
6
 
7
+ import type { ModalPlacement, ModalPresentation } from "../Dialog/modalSurface";
7
8
  import { Modal } from "../Modal";
8
9
  import View from "./View";
9
10
 
@@ -23,6 +24,10 @@ interface ViewModalProps {
23
24
  id: string;
24
25
  modal?: string;
25
26
  modalClassName?: string;
27
+ /** Passed to the `Modal`: `auto` is a full-screen sheet below `md`. */
28
+ presentation?: ModalPresentation;
29
+ /** Passed to the `Modal`: `right` is a side sheet from `md` up. */
30
+ placement?: ModalPlacement;
26
31
  viewClassName?: string;
27
32
  slice: SliceMeta;
28
33
  renderTitle?: (model: any) => ReactNode | string;
@@ -33,6 +38,8 @@ export default function ViewModal({
33
38
  id,
34
39
  modal,
35
40
  modalClassName,
41
+ presentation,
42
+ placement,
36
43
  viewClassName,
37
44
  slice,
38
45
  renderTitle,
@@ -73,7 +80,15 @@ export default function ViewModal({
73
80
  return (
74
81
  <>
75
82
  {isModalOpen ? <ViewTools modelName={modelName} closeView={closeView} /> : null}
76
- <Modal open={isModalOpen} onCancel={closeView} className={modalClassName} title={<Title />} action={<Action />}>
83
+ <Modal
84
+ open={isModalOpen}
85
+ onCancel={closeView}
86
+ className={modalClassName}
87
+ presentation={presentation}
88
+ placement={placement}
89
+ title={<Title />}
90
+ action={<Action />}
91
+ >
77
92
  <View className={viewClassName} model={model} modelLoading={modelLoading} render={renderView} />
78
93
  </Modal>
79
94
  </>
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { useSyncExternalStore } from "react";
3
+
4
+ interface OriginRegistry {
5
+ origins: Map<string, string>;
6
+ listeners: Set<() => void>;
7
+ }
8
+
9
+ const globalWithOrigins = globalThis as typeof globalThis & { __AKAN_NEW_FORM_ORIGIN__?: OriginRegistry };
10
+
11
+ globalWithOrigins.__AKAN_NEW_FORM_ORIGIN__ ??= { origins: new Map(), listeners: new Set() };
12
+ const registry = globalWithOrigins.__AKAN_NEW_FORM_ORIGIN__;
13
+
14
+ export class NewFormOrigin {
15
+ static set(model: string, sliceName: string) {
16
+ if (registry.origins.get(model) === sliceName) return;
17
+ registry.origins.set(model, sliceName);
18
+ NewFormOrigin.#notify();
19
+ }
20
+
21
+ static clear(model: string) {
22
+ if (registry.origins.delete(model)) NewFormOrigin.#notify();
23
+ }
24
+
25
+ static get(model: string) {
26
+ return registry.origins.get(model) ?? null;
27
+ }
28
+
29
+ static use(model: string) {
30
+ return useSyncExternalStore(
31
+ NewFormOrigin.#subscribe,
32
+ () => NewFormOrigin.get(model),
33
+ () => null,
34
+ );
35
+ }
36
+
37
+ static #subscribe(listener: () => void) {
38
+ registry.listeners.add(listener);
39
+ return () => registry.listeners.delete(listener);
40
+ }
41
+
42
+ static #notify() {
43
+ for (const listener of registry.listeners) listener();
44
+ }
45
+ }
package/ui/Popconfirm.tsx CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { cn, usePage } from "akanjs/client";
3
3
  import { useEscapeKey } from "akanjs/webkit";
4
- import { type ButtonHTMLAttributes, type ReactNode, useEffect, useRef, useState } from "react";
4
+ import { type ButtonHTMLAttributes, type ReactNode, useRef, useState } from "react";
5
5
  import { createPortal } from "react-dom";
6
6
  import { BiMessageRoundedError } from "react-icons/bi";
7
7
  import { buttonRecipe } from "./Button";
8
- import { overlayZ, useOverlayLayerProps } from "./overlayLayer";
8
+ import { overlayZ, useOverlayLayerProps, useOverlayPortal } from "./overlayLayer";
9
9
  import { useOverlayPosition } from "./overlayPosition";
10
10
  import { createOverridable, useUiRecipe } from "./UiOverride";
11
11
 
@@ -51,8 +51,7 @@ export const DefaultPopconfirm = ({
51
51
  const { l } = usePage();
52
52
  const recipe = useUiRecipe("button") ?? buttonRecipe;
53
53
  const [isConfirming, setIsConfirming] = useState(false);
54
-
55
- const [portal, setPortal] = useState<HTMLElement | null>(null);
54
+ const portal = useOverlayPortal();
56
55
  const triggerRef = useRef<HTMLDivElement>(null);
57
56
  const panelRef = useRef<HTMLDivElement>(null);
58
57
  const overlayLayerProps = useOverlayLayerProps();
@@ -72,9 +71,6 @@ export const DefaultPopconfirm = ({
72
71
  setIsConfirming(false);
73
72
  };
74
73
  useEscapeKey(isConfirming, handleCancel);
75
- useEffect(() => {
76
- setPortal(document.body);
77
- }, []);
78
74
 
79
75
  const panel = (
80
76
  <>
@@ -141,8 +137,10 @@ export const DefaultPopconfirm = ({
141
137
  );
142
138
  return (
143
139
  <div className="relative inline-block" ref={triggerRef}>
140
+ {/* Keeps an enclosing dropdown open: the panel is anchored to this row, which a closed menu hides. */}
144
141
  <div
145
142
  className={cn("trigger", triggerClassName)}
143
+ data-dropdown-keep-open
146
144
  onClick={(e) => {
147
145
  e.stopPropagation();
148
146
  setIsConfirming(true);
package/ui/Portal.tsx CHANGED
@@ -2,14 +2,15 @@
2
2
 
3
3
  import { type ReactNode, useLayoutEffect, useState } from "react";
4
4
  import { createPortal } from "react-dom";
5
- import { captureServerPortal } from "./ServerPortal";
6
5
 
7
6
  interface PortalProps {
8
7
  children: ReactNode;
9
8
  id: string;
9
+ /** Drawn in place until the target is found: on the server, and in the first client render that hydrates it. */
10
+ fallback?: ReactNode;
10
11
  }
11
12
 
12
- export const Portal = ({ children, id }: PortalProps) => {
13
+ export const Portal = ({ children, id, fallback = null }: PortalProps) => {
13
14
 
14
15
  const [targetElement, setTargetElement] = useState<HTMLElement | null>(null);
15
16
 
@@ -17,9 +18,5 @@ export const Portal = ({ children, id }: PortalProps) => {
17
18
  setTargetElement(document.getElementById(id));
18
19
  }, [id]);
19
20
 
20
- if (typeof document === "undefined" && captureServerPortal(id, children)) {
21
- return null;
22
- }
23
-
24
- return targetElement ? createPortal(children, targetElement) : null;
21
+ return targetElement ? createPortal(children, targetElement) : fallback;
25
22
  };
@@ -0,0 +1,31 @@
1
+ export const ownerOf = (origin: string[] | undefined) => origin?.at(-1);
2
+
3
+ /**
4
+ * Owners in dependency order, the app first, from origin chains listed in registration order. A lib's modules
5
+ * register before those of whatever builds on it, so the order in which each owner first registers a module of its
6
+ * own, reversed, puts dependents ahead of dependencies; an owner that only extends others' modules comes first.
7
+ */
8
+ export const ownerOrderOf = (origins: (string[] | undefined)[]) => {
9
+ const seen: string[] = [];
10
+ for (const origin of origins) {
11
+ const first = origin?.[0];
12
+ if (first && !seen.includes(first)) seen.push(first);
13
+ }
14
+ for (const origin of origins) for (const owner of origin ?? []) if (!seen.includes(owner)) seen.push(owner);
15
+ return seen.reverse();
16
+ };
17
+
18
+ export const originText = (origin: string[]) => {
19
+ const owner = ownerOf(origin) ?? "";
20
+ const bases = origin.slice(0, -1).reverse().join(", ");
21
+ return bases ? { en: `${owner} (extends ${bases})`, ko: `${owner} (${bases} 확장)` } : { en: owner, ko: owner };
22
+ };
23
+
24
+ export const groupByOwner = <Item>(items: Item[], originOf: (item: Item) => string[] | undefined, order: string[]) => {
25
+ const groups = new Map<string, Item[]>(order.map((owner) => [owner, []]));
26
+ for (const item of items) {
27
+ const owner = ownerOf(originOf(item)) ?? "";
28
+ groups.set(owner, [...(groups.get(owner) ?? []), item]);
29
+ }
30
+ return [...groups.entries()].filter(([, grouped]) => grouped.length);
31
+ };
@@ -3,10 +3,10 @@ import { useDrag } from "@use-gesture/react";
3
3
  import { cn } from "akanjs/client";
4
4
  import { capitalize } from "akanjs/common";
5
5
  import { st } from "akanjs/store";
6
- import { animated } from "akanjs/ui";
7
6
  import { type ReactNode, useContext, useEffect, useRef, useState } from "react";
8
7
  import { SpringValue, useSpringValue } from "react-spring";
9
8
  import { sharedContext } from "../client/sharedContext";
9
+ import { animated } from "./animated";
10
10
 
11
11
  interface ScreenNavigatorContextType {
12
12
  bind: (...args: any[]) => any;
package/ui/Select.tsx CHANGED
@@ -22,7 +22,7 @@ import { TiDelete } from "react-icons/ti";
22
22
  import { agentAttrs } from "./agentAttrs";
23
23
  import { Label } from "./Field/Label";
24
24
  import { Spin } from "./Loading/Spin";
25
- import { overlayZ, useOverlayLayerProps } from "./overlayLayer";
25
+ import { overlayZ, useOverlayLayerProps, useOverlayPortal } from "./overlayLayer";
26
26
  import { useOverlayPosition } from "./overlayPosition";
27
27
  import { createOverridable, useUiOverride } from "./UiOverride";
28
28
 
@@ -113,8 +113,7 @@ const DefaultSelect = <
113
113
  }, [options]);
114
114
 
115
115
  const [searchText, setSearchText] = useState("");
116
-
117
- const [portal, setPortal] = useState<HTMLElement | null>(null);
116
+ const portal = useOverlayPortal();
118
117
  const [searchOptions, setSearchOptions] = useState<LabelOption<T>[]>(labeledOptions);
119
118
  const [activeIdx, setActiveIdx] = useState(-1);
120
119
  const listId = useId();
@@ -228,10 +227,6 @@ const DefaultSelect = <
228
227
  };
229
228
  }, [isOpen]);
230
229
 
231
- useEffect(() => {
232
- setPortal(document.body);
233
- }, []);
234
-
235
230
  useEffect(() => {
236
231
  setSearchOptions(labeledOptions);
237
232
  }, [labeledOptions]);
package/ui/Signal/Arg.tsx CHANGED
@@ -12,7 +12,7 @@ import { Input } from "../Input";
12
12
  import { dictText, docDash, docUi } from "../Reference";
13
13
  import { Select } from "../Select";
14
14
  import { Tooltip } from "../Tooltip";
15
- import UiObject from "./Object";
15
+ import { ObjectType } from "./Object";
16
16
  import { signalUi } from "./style";
17
17
 
18
18
  interface ArgProps {
@@ -80,7 +80,7 @@ const ArgTable = ({ refName, endpointKey, args }: ArgTableProps) => {
80
80
  {label ? <div className="text-foreground/45 text-xs">{label}</div> : null}
81
81
  </td>
82
82
  <td>
83
- <UiObject.Type objRef={argRef as ConstantCls} arrDepth={arg.arrDepth ?? 0} nullable={arg.nullable} />
83
+ <ObjectType objRef={argRef as ConstantCls} arrDepth={arg.arrDepth ?? 0} nullable={arg.nullable} />
84
84
  </td>
85
85
  <td>
86
86
  {argEnum ? (
package/ui/Signal/Doc.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { cn, usePage } from "akanjs/client";
3
- import { decodeJwtPayload, lowerlize, mcpRefusalOf } from "akanjs/common";
3
+ import { decodeJwtPayload, mcpRefusalOf } from "akanjs/common";
4
4
  import { type Account, type FetchProxy, getDefaultAccount } from "akanjs/fetch";
5
5
  import { st } from "akanjs/store";
6
6
  import { type ReactNode, useState } from "react";
@@ -23,13 +23,20 @@ import {
23
23
  Toolbar,
24
24
  ToolbarField,
25
25
  } from "../Reference";
26
- import { endpointEntriesOf, guardNamesOf, isWsEndpoint } from "./endpointEntries";
27
- import RestApi from "./RestApi";
28
- import WebSocket from "./WebSocket";
29
-
30
- export default function Doc() {
31
- return <div></div>;
32
- }
26
+ import { originText, ownerOf } from "../Reference/origin";
27
+ import { Tab } from "../Tab";
28
+ import {
29
+ endpointEntriesOf,
30
+ guardNamesOf,
31
+ isWsEndpoint,
32
+ runtimeFetch,
33
+ type SignalScope,
34
+ signalOwnerOrderOf,
35
+ signalRefNamesOf,
36
+ } from "./endpointEntries";
37
+ import { RestApiEndpoints } from "./RestApi";
38
+ import { guardCountText, signalText } from "./signalText";
39
+ import { WebSocketEndpoints } from "./WebSocket";
33
40
 
34
41
  interface GuardItemProps {
35
42
  active: boolean;
@@ -47,20 +54,25 @@ const GuardItem = ({ active, label, onClick }: GuardItemProps) => (
47
54
  </button>
48
55
  );
49
56
 
50
- interface DocSettingProps {
51
- fetch: FetchProxy;
57
+ export interface DocSettingProps {
58
+ fetch?: FetchProxy;
52
59
  search?: string;
53
60
  onSearch?: (search: string) => void;
54
61
  }
55
- const DocSetting = ({ fetch, search, onSearch }: DocSettingProps) => {
62
+ export const DocSetting = ({ fetch = runtimeFetch, search, onSearch }: DocSettingProps) => {
63
+ const { l } = usePage();
56
64
  const tryGuards = st.use.tryGuards({ agent: false });
57
65
  const tryJwt = st.use.tryJwt({ agent: false });
58
66
  const guardNames = guardNamesOf(fetch);
59
67
  const selectionLabel =
60
- tryGuards.length === 0 ? "All guards" : tryGuards.length === 1 ? tryGuards[0] : `${tryGuards.length} guards`;
68
+ tryGuards.length === 0
69
+ ? l.trans(signalText.allGuards)
70
+ : tryGuards.length === 1
71
+ ? tryGuards[0]
72
+ : l.trans(guardCountText(tryGuards.length));
61
73
  return (
62
74
  <Toolbar>
63
- <ToolbarField label="Base URL">
75
+ <ToolbarField label={l.trans(signalText.baseUrl)}>
64
76
  <Copy text={fetch.origin}>
65
77
  <button className={buttonRecipe({ variant: "ghost", size: "sm" }, "font-mono text-foreground/80")}>
66
78
  {fetch.origin}
@@ -69,7 +81,7 @@ const DocSetting = ({ fetch, search, onSearch }: DocSettingProps) => {
69
81
  </Copy>
70
82
  </ToolbarField>
71
83
  {guardNames.length ? (
72
- <ToolbarField label="Guards">
84
+ <ToolbarField label={l.trans(signalText.guards)}>
73
85
  <Dropdown
74
86
  buttonClassName={buttonRecipe({ variant: "outline", size: "sm" }, "font-normal")}
75
87
  align="start"
@@ -85,7 +97,7 @@ const DocSetting = ({ fetch, search, onSearch }: DocSettingProps) => {
85
97
  <li data-dropdown-keep-open="">
86
98
  <GuardItem
87
99
  active={!tryGuards.length}
88
- label="All guards"
100
+ label={l.trans(signalText.allGuards)}
89
101
  onClick={() => {
90
102
  st.do.setTryGuards([]);
91
103
  }}
@@ -110,10 +122,10 @@ const DocSetting = ({ fetch, search, onSearch }: DocSettingProps) => {
110
122
  />
111
123
  </ToolbarField>
112
124
  ) : null}
113
- <ToolbarField label="Auth">
125
+ <ToolbarField label={l.trans(signalText.auth)}>
114
126
  <DocAuthModal>
115
127
  <button className={buttonRecipe({ variant: tryJwt ? "primary" : "outline", size: "sm" })} type="button">
116
- <BiLock /> {tryJwt ? "Authorized" : "Anonymous"}
128
+ <BiLock /> {l.trans(tryJwt ? signalText.authorized : signalText.anonymous)}
117
129
  </button>
118
130
  </DocAuthModal>
119
131
  </ToolbarField>
@@ -125,19 +137,18 @@ const DocSetting = ({ fetch, search, onSearch }: DocSettingProps) => {
125
137
  inputClassName="w-56 pl-9"
126
138
  nullable
127
139
  onChange={onSearch}
128
- placeholder="Search endpoints"
140
+ placeholder={l.trans(signalText.searchEndpoints)}
129
141
  value={search ?? ""}
130
142
  />
131
143
  ) : null}
132
144
  </Toolbar>
133
145
  );
134
146
  };
135
- Doc.Setting = DocSetting;
136
-
137
- interface DocAuthModalProps {
147
+ export interface DocAuthModalProps {
138
148
  children: ReactNode;
139
149
  }
140
- const DocAuthModal = ({ children }: DocAuthModalProps) => {
150
+ export const DocAuthModal = ({ children }: DocAuthModalProps) => {
151
+ const { l } = usePage();
141
152
  const tryJwt = st.use.tryJwt({ agent: false });
142
153
  const [jwt, setJwt] = useState(tryJwt);
143
154
  const [modalOpen, setModalOpen] = useState(false);
@@ -159,7 +170,7 @@ const DocAuthModal = ({ children }: DocAuthModalProps) => {
159
170
  onCancel={() => {
160
171
  setModalOpen(false);
161
172
  }}
162
- title="Set JWT for Authorization"
173
+ title={l.trans(signalText.setJwtTitle)}
163
174
  action={
164
175
  <button
165
176
  className={buttonRecipe({ variant: "primary" }, "w-full")}
@@ -172,12 +183,12 @@ const DocAuthModal = ({ children }: DocAuthModalProps) => {
172
183
  setModalOpen(false);
173
184
  }}
174
185
  >
175
- <BiLock /> Set Authorization
186
+ <BiLock /> {l.trans(signalText.setAuthorization)}
176
187
  </button>
177
188
  }
178
189
  >
179
190
  <div className="flex w-full flex-col gap-2">
180
- <div className={docUi.sectionLabel}>Bearer token</div>
191
+ <div className={docUi.sectionLabel}>{l.trans(signalText.bearerToken)}</div>
181
192
  <Input
182
193
  inputClassName="w-full font-mono text-xs"
183
194
  placeholder="eyJhbGciOi…"
@@ -186,36 +197,27 @@ const DocAuthModal = ({ children }: DocAuthModalProps) => {
186
197
  validate={() => true}
187
198
  />
188
199
  </div>
189
- <Code code={accountStr} label="Account decoded" />
200
+ <Code code={accountStr} label={l.trans(signalText.accountDecoded)} />
190
201
  </Modal>
191
202
  </>
192
203
  );
193
204
  };
194
- Doc.AuthModal = DocAuthModal;
195
-
196
- interface DocSignalsProps {
197
- fetch: FetchProxy;
205
+ export interface DocSignalsProps extends SignalScope {
206
+ fetch?: FetchProxy;
198
207
  }
199
- const DocSignals = ({ fetch }: DocSignalsProps) => {
200
- const signalEntries = Object.entries(fetch.serializedSignal).sort(([keyA], [keyB]) =>
201
- lowerlize(keyA) > lowerlize(keyB) ? 1 : -1,
202
- );
203
- return (
204
- <div className="flex flex-col gap-2">
205
- {signalEntries.map(([refName], idx) => (
206
- <DocSignal key={idx} refName={refName} fetch={fetch} />
207
- ))}
208
- </div>
209
- );
210
- };
211
-
212
- Doc.DocSignals = DocSignals;
208
+ export const DocSignals = ({ fetch = runtimeFetch, include, exclude, libs }: DocSignalsProps) => (
209
+ <div className="flex flex-col gap-2">
210
+ {signalRefNamesOf(fetch, { include, exclude, libs }).map((refName) => (
211
+ <DocSignal key={refName} refName={refName} fetch={fetch} />
212
+ ))}
213
+ </div>
214
+ );
213
215
 
214
- interface DocSignalProps {
216
+ export interface DocSignalProps {
215
217
  refName: string;
216
- fetch: FetchProxy;
218
+ fetch?: FetchProxy;
217
219
  }
218
- const DocSignal = ({ refName, fetch }: DocSignalProps) => {
220
+ export const DocSignal = ({ refName, fetch = runtimeFetch }: DocSignalProps) => {
219
221
  const { l } = usePage();
220
222
  const desc = dictText(l, `${refName}.modelDesc`);
221
223
  return (
@@ -224,53 +226,113 @@ const DocSignal = ({ refName, fetch }: DocSignalProps) => {
224
226
  <div className="flex min-w-0 flex-col gap-1.5">
225
227
  <div className="flex flex-wrap items-center gap-2">
226
228
  <span className="font-bold text-lg">{refName}</span>
227
- <span className={docPill("muted")}>Signal</span>
229
+ <span className={docPill("muted")}>{l.trans(signalText.signal)}</span>
228
230
  </div>
229
231
  {desc ? <div className="text-foreground/55 text-sm">{desc}</div> : null}
230
232
  </div>
231
233
  }
232
234
  >
233
- <RestApi.Endpoints refName={refName} fetch={fetch} />
235
+ <RestApiEndpoints refName={refName} fetch={fetch} />
234
236
  </Collapse>
235
237
  );
236
238
  };
237
- Doc.DocSignal = DocSignal;
238
239
 
239
- interface ZoneProps {
240
+ export interface ZoneProps {
240
241
  refName: string;
241
- fetch: FetchProxy;
242
+ fetch?: FetchProxy;
242
243
  openAll?: boolean;
243
244
  }
244
- const Zone = ({ refName, fetch, openAll }: ZoneProps) => {
245
+ export const Zone = ({ refName, fetch = runtimeFetch, openAll }: ZoneProps) => {
245
246
  const { l } = usePage();
246
247
  const [search, setSearch] = useState("");
247
248
  const desc = dictText(l, `${refName}.modelDesc`);
248
249
  const entries = endpointEntriesOf(refName, fetch);
249
250
  const wsEntries = entries.filter(({ endpoint }) => isWsEndpoint(endpoint));
250
251
  const mcpEntries = entries.filter(({ key, endpoint }) => !mcpRefusalOf(endpoint, { refName, key }));
252
+ const origin = fetch.serializedSignal[refName]?.origin;
251
253
  return (
252
254
  <div className="flex break-after-page flex-col gap-6">
253
255
  <div className="flex flex-col gap-1">
254
256
  <div className="flex flex-wrap items-center gap-2">
255
257
  <h1 className={docUi.pageTitle}>{refName}</h1>
256
- <span className={docPill("muted")}>Signal</span>
258
+ <span className={docPill("muted")}>{l.trans(signalText.signal)}</span>
259
+ {origin?.length ? <span className={docPill("muted", "font-mono")}>{l.trans(originText(origin))}</span> : null}
257
260
  </div>
258
261
  {desc ? <p className={docUi.sectionDescription}>{desc}</p> : null}
259
262
  </div>
260
263
  <SummaryGrid>
261
- <SummaryCard label="Endpoints" value={entries.length} />
262
- <SummaryCard label="REST API" value={entries.length - wsEntries.length} />
263
- <SummaryCard label="Web Socket" value={wsEntries.length} />
264
- <SummaryCard label="MCP Tools" value={mcpEntries.length} />
264
+ <SummaryCard label={l.trans(signalText.endpoints)} value={entries.length} />
265
+ <SummaryCard label={l.trans(signalText.restApi)} value={entries.length - wsEntries.length} />
266
+ <SummaryCard label={l.trans(signalText.webSocket)} value={wsEntries.length} />
267
+ <SummaryCard label={l.trans(signalText.mcpTools)} value={mcpEntries.length} />
265
268
  </SummaryGrid>
266
269
  <DocSetting fetch={fetch} onSearch={setSearch} search={search} />
267
- <Section title="REST API">
268
- <RestApi.Endpoints refName={refName} fetch={fetch} openAll={openAll} search={search} />
270
+ <Section title={l.trans(signalText.restApi)}>
271
+ <RestApiEndpoints refName={refName} fetch={fetch} openAll={openAll} search={search} />
269
272
  </Section>
270
- <Section title="Web Socket">
271
- <WebSocket.Endpoints refName={refName} fetch={fetch} openAll={openAll} search={search} />
273
+ <Section title={l.trans(signalText.webSocket)}>
274
+ <WebSocketEndpoints refName={refName} fetch={fetch} openAll={openAll} search={search} />
272
275
  </Section>
273
276
  </div>
274
277
  );
275
278
  };
276
- Doc.Zone = Zone;
279
+
280
+ export interface ExplorerProps extends SignalScope {
281
+ className?: string;
282
+ fetch?: FetchProxy;
283
+ defaultRefName?: string;
284
+ openAll?: boolean;
285
+ groupBy?: "lib";
286
+ }
287
+ export const Explorer = ({
288
+ className,
289
+ fetch = runtimeFetch,
290
+ include,
291
+ exclude,
292
+ libs,
293
+ defaultRefName,
294
+ openAll,
295
+ groupBy,
296
+ }: ExplorerProps) => {
297
+ const { l } = usePage();
298
+ const refNames = signalRefNamesOf(fetch, { include, exclude, libs });
299
+ if (!refNames.length) return <div className={docUi.emptyPanel}>{l.trans(signalText.noSignal)}</div>;
300
+ const groups =
301
+ groupBy === "lib"
302
+ ? [...signalOwnerOrderOf(fetch), ""]
303
+ .map((owner) => ({
304
+ owner,
305
+ refNames: refNames.filter((refName) => (ownerOf(fetch.serializedSignal[refName]?.origin) ?? "") === owner),
306
+ }))
307
+ .filter((group) => group.refNames.length)
308
+ : [{ owner: null, refNames }];
309
+ const ordered = groups.flatMap((group) => group.refNames);
310
+ const firstRefName = defaultRefName && ordered.includes(defaultRefName) ? defaultRefName : ordered[0];
311
+ return (
312
+ <Tab className={cn("flex w-full items-start gap-8", className)} defaultMenu={firstRefName}>
313
+ <aside className="sticky top-0 flex max-h-screen w-56 shrink-0 flex-col gap-4 overflow-y-auto py-2">
314
+ {groups.map((group) => (
315
+ <div className="flex flex-col gap-1" key={group.owner ?? ""}>
316
+ {group.owner === null ? null : (
317
+ <div className={cn(docUi.sectionLabel, "px-3")}>{group.owner || l.trans(signalText.unknownOrigin)}</div>
318
+ )}
319
+ <Tab.Menus className="flex flex-col items-stretch gap-0.5">
320
+ {group.refNames.map((refName) => (
321
+ <Tab.Menu key={refName} className="truncate text-left font-mono" menu={refName} scrollToTop>
322
+ {refName}
323
+ </Tab.Menu>
324
+ ))}
325
+ </Tab.Menus>
326
+ </div>
327
+ ))}
328
+ </aside>
329
+ <div className="min-w-0 flex-1">
330
+ {ordered.map((refName) => (
331
+ <Tab.Panel key={refName} loading="lazy" menu={refName}>
332
+ <Zone refName={refName} fetch={fetch} openAll={openAll} />
333
+ </Tab.Panel>
334
+ ))}
335
+ </div>
336
+ </Tab>
337
+ );
338
+ };