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
@@ -4,6 +4,8 @@ export declare const overlayZ: {
4
4
  readonly dropdown: 100;
5
5
  readonly popconfirmScrim: 105;
6
6
  readonly popconfirm: 110;
7
+ readonly tooltip: 115;
8
+ readonly modal: 120;
7
9
  };
8
10
  /** Takes the scope from {@link useOverlayScope}. */
9
11
  export declare const OverlayOwnerProvider: import("react").Provider<string>;
@@ -15,3 +17,7 @@ export declare const useOverlayLayerProps: () => {
15
17
  };
16
18
  /** True when the click landed in an overlay `scope`, or a scope nested in it, rendered; any other is outside. */
17
19
  export declare const isOwnOverlayClick: (target: EventTarget | null, scope: string) => boolean;
20
+ /** Takes the root a modal draws its panel in; overlays rendered under it portal there instead of `<body>`. */
21
+ export declare const OverlayPortalProvider: import("react").Provider<HTMLElement | null>;
22
+ /** The element an overlay portals into: the enclosing modal's root, else `<body>`. `null` until mounted. */
23
+ export declare const useOverlayPortal: () => HTMLElement | null;
@@ -14,3 +14,20 @@ export declare const useOverlayPosition: ({ opened, triggerRef, panelRef, align,
14
14
  align: "start" | "end";
15
15
  gap?: number;
16
16
  }) => OverlayPosition | null;
17
+ export type OverlaySide = "top" | "right" | "bottom" | "left";
18
+ export interface AnchoredPosition {
19
+ top: number;
20
+ left: number;
21
+ /** The side the panel landed on: the asked one, or its opposite when that has more room. */
22
+ side: OverlaySide;
23
+ /** The trigger's centre along the panel's edge, held clear of its corners, for the pointer. */
24
+ arrowOffset: number;
25
+ }
26
+ /** Like {@link useOverlayPosition}, for a panel centred on any side of its trigger, as a tooltip is. */
27
+ export declare const useAnchoredPosition: ({ opened, triggerRef, panelRef, side, gap, }: {
28
+ opened: boolean;
29
+ triggerRef: RefObject<HTMLElement | null>;
30
+ panelRef: RefObject<HTMLElement | null>;
31
+ side: OverlaySide;
32
+ gap?: number;
33
+ }) => AnchoredPosition | null;
@@ -1,5 +1,6 @@
1
1
  import { type DoctorCheck } from "./commands/doctor.ts";
2
2
  import type { AkanNativeConfig } from "./config.ts";
3
+ import { requestedDistribution } from "./lib/distribution.ts";
3
4
  import type { Device, DeviceSelector } from "./lib/launch.ts";
4
5
  import { type LogEvent, type LogSink } from "./lib/log.ts";
5
6
  import { type MacosBuild, type MacosNotarization, type MacosSigning, macosDistributionFromEnv } from "./lib/macossigning.ts";
@@ -7,15 +8,21 @@ import { type AndroidSigning, type BuildProfile, type IosBuild, type IosSigning,
7
8
  import { type DesktopArch, type UpdateManifest } from "./lib/updates.ts";
8
9
  import { type WindowsSigning, windowsSigningFromEnv } from "./lib/windowssigning.ts";
9
10
  import { type TargetPlatform } from "./platforms/index.ts";
11
+ export { type UpdateDecision, type UpdateDecisionInput, updateDecision } from "../../core/src/kernel.ts";
12
+ /**
13
+ * A phone's update protocol as the apps run it, for a signer or a server that checks what it publishes or registers:
14
+ * the envelope's verification, the keyId of a public key, and what a verified manifest means to a binary.
15
+ */
16
+ export { keyIdOf, openEnvelope } from "./lib/updates.ts";
10
17
  export type { AkanNativeConfig, AndroidSigning, DesktopArch, Device, DeviceSelector, DoctorCheck, IosBuild, IosSigning, IosSigningResult, LinuxBuild, LogEvent, MacosBuild, MacosNotarization, MacosSigning, TargetPlatform, WindowsBuild, WindowsSigning, };
11
18
  /**
12
19
  * The macOS signing and notarization the AKAN_NATIVE_MACOS_* variables name, for a caller that keeps them in its
13
20
  * environment (the API itself reads no variable): pass the result as `macos`.
14
21
  */
15
22
  /** The Authenticode settings the AKAN_NATIVE_WINDOWS_* variables name: pass the result as `windows.signing`. */
16
- export { macosDistributionFromEnv, windowsSigningFromEnv };
23
+ export { macosDistributionFromEnv, requestedDistribution, windowsSigningFromEnv };
17
24
  /** semver of this API. A caller checks the major before it relies on anything here. */
18
- export declare const API_VERSION = "0.10.0";
25
+ export declare const API_VERSION = "0.11.0";
19
26
  export type AkanNativeErrorCode = "CONFIG_INVALID" | "TOOLCHAIN_MISSING" | "WEB_INPUT_INVALID" | "WEB_BUILD_FAILED" | "NATIVE_BUILD_FAILED" | "SIGNING_FAILED" | "DEVICE_FAILED" | "CANCELLED" | "INTERNAL";
20
27
  export declare class AkanNativeError extends Error {
21
28
  readonly code: AkanNativeErrorCode;
@@ -144,6 +151,8 @@ export interface PublishCheckOptions extends Pick<TaskOptions, "appDir" | "confi
144
151
  out?: string;
145
152
  /** Whether the release will carry a server; the config's `desktop.server` by default. */
146
153
  server?: boolean;
154
+ /** A desktop release's CPU, which names its feed folder: this computer's by default. */
155
+ arch?: DesktopArch;
147
156
  }
148
157
  /**
149
158
  * What publishUpdate() refuses before it builds, without building (CONFIG_INVALID): no updates settings, a channel no
@@ -166,6 +175,8 @@ export declare function publishUpdate(options: TaskOptions & {
166
175
  macos?: Pick<MacosBuild, "signing" | "notarize">;
167
176
  /** Authenticode for a Windows release's files. No setup program is made. */
168
177
  windows?: Pick<WindowsBuild, "signing">;
178
+ /** A desktop release's CPU, of the same OS: an x64 release from an arm64 machine. Default this computer's. */
179
+ arch?: DesktopArch;
169
180
  }): Promise<PublishResult>;
170
181
  /**
171
182
  * Whether a web bundle can run in the binary a store release shipped (UP-3): `shipped` is that build's bundle.json,
@@ -177,7 +188,7 @@ export declare function compareBundles(shipped: string, bundle: string): {
177
188
  };
178
189
  /**
179
190
  * The app's update signing key: made once (AKAN_NATIVE_UPDATE_KEY, else ~/.akan/native/keys/<app id>.update.key),
180
- * then read. `publicKey` goes into the config's `updates.publicKey`; the key file never leaves the machine.
191
+ * then read. `publicKey` goes into the config's `updates.publicKeys`; the key file never leaves the machine.
181
192
  */
182
193
  export declare function updateKeygen(options: {
183
194
  config: AkanNativeConfig;
@@ -1,2 +1,2 @@
1
- export declare const UPDATE_USAGE = "akan-native update keygen [--app <dir>] | akan-native update publish <ios|android|macos|windows|linux> [--app <dir>] [--mode <mode>] [--debug] [--channel <name>] [--out <dir>] | akan-native update serve [--app <dir>] [--out <dir>] [--port <n>]";
1
+ export declare const UPDATE_USAGE = "akan-native update keygen [--app <dir>] | akan-native update publish <ios|android|macos|windows|linux> [--app <dir>] [--mode <mode>] [--debug] [--channel <name>] [--out <dir>] [--arch <arm64|x64>] [--sign] [--notarize] | akan-native update serve [--app <dir>] [--out <dir>] [--port <n>]";
2
2
  export declare function update(argv: string[]): Promise<number>;
@@ -82,6 +82,8 @@ export interface AkanNativeConfig {
82
82
  /** Painted before the page loads, to avoid a white flash (SH-3). */
83
83
  backgroundColor?: string;
84
84
  backgroundColorDark?: string;
85
+ /** The web inspector in a release build too (a debug build always has it): internal test builds only. */
86
+ devtools?: boolean;
85
87
  };
86
88
  /** Overrides for permission usage texts, e.g. { NSCameraUsageDescription: "..." }. */
87
89
  usageDescriptions?: Record<string, string>;
@@ -112,14 +114,21 @@ export interface AkanNativeConfig {
112
114
  };
113
115
  /**
114
116
  * Over-the-air updates (UP-2 web bundles on iOS / Android, UP-1 app updates on macOS), used by
115
- * @akanjs/native/plugins/updates. `akan-native update keygen` makes the signing key and prints `publicKey`;
116
- * `akan-native update publish <platform>` writes signed releases for `url`.
117
+ * @akanjs/native/plugins/updates. `akan-native update keygen` makes the signing key and prints its public key;
118
+ * `akan-native update publish <platform>` writes signed releases for `url`. `publicKeys` lists the keys a phone
119
+ * trusts, the online signing key first and offline spares after (a key revokes only keys before it); `publicKey` is
120
+ * the one-key form, and a desktop app trusts the first. `report.url` is where a phone posts what became of each
121
+ * release, at its next launch or return to the foreground.
117
122
  */
118
123
  updates?: {
119
124
  url: string;
120
- publicKey: string;
125
+ publicKey?: string;
126
+ publicKeys?: string[];
121
127
  channel?: string;
122
128
  readyTimeout?: number;
129
+ report?: {
130
+ url: string;
131
+ };
123
132
  };
124
133
  /** Links that open the app, delivered through the app plugin's urlOpen (and getLaunchUrl). */
125
134
  deepLinks?: {
@@ -268,12 +277,13 @@ export interface AkanNativeConfig {
268
277
  recovery?: "errorPage" | "reload";
269
278
  /**
270
279
  * The main window from its first frame: `fullscreen` (borderless, on the display the window opens on)
271
- * and `skipTaskbar` (no taskbar button; Windows and Linux). A plugin's launch phase may still decide
272
- * otherwise (DesktopContext.launch.setWindow). Default false for both.
280
+ * `skipTaskbar` (no taskbar button; Windows and Linux) and `frameless` (no title bar or border). A plugin's
281
+ * launch phase may still decide otherwise (DesktopContext.launch.setWindow). Default false for all three.
273
282
  */
274
283
  window?: {
275
284
  fullscreen?: boolean;
276
285
  skipTaskbar?: boolean;
286
+ frameless?: boolean;
277
287
  };
278
288
  /**
279
289
  * Windows: "auto" answers the page's getDisplayMedia() with the first screen at once, without the picker or a
@@ -283,16 +293,31 @@ export interface AkanNativeConfig {
283
293
  * offered. macOS and Linux ignore it.
284
294
  */
285
295
  screenCapture?: "picker" | "auto";
296
+ /**
297
+ * Windows installer: "bootstrapper" (default) carries Microsoft's 2 MB setup that downloads the WebView2
298
+ * Runtime when the PC has none; "standalone" carries the whole runtime (~200 MB), for a PC that is offline or
299
+ * behind a proxy at install. Either runs only where no runtime is installed.
300
+ */
301
+ webview2?: "bootstrapper" | "standalone";
302
+ /** Windows: the installed app's Publisher (Apps & features) and its executable's company name (default: the app name). */
303
+ publisher?: string;
286
304
  /**
287
305
  * A server the app starts beside its window (akanjs `native.desktop.server`). `dir` is copied to
288
306
  * the app's resources (`server/`), and `entry` there runs on the app's own Bun with `env`, bound to
289
307
  * a loopback port picked at launch; the page reads its URL as PUBLIC_AKAN_SERVER_URL. The launcher
290
308
  * sets PORT, JWT_SECRET, the data folders (`<app local data>/server`) and the listen host itself.
309
+ * `restart`: crashes in a row before it gives up (5), or "forever"; `watchdog`: its health route asked every
310
+ * `intervalMs`, `failures` missed in a row restarting it.
291
311
  */
292
312
  server?: {
293
313
  dir: string;
294
314
  entry: string;
295
315
  env?: Record<string, string>;
316
+ restart?: number | "forever";
317
+ watchdog?: {
318
+ intervalMs: number;
319
+ failures: number;
320
+ };
296
321
  };
297
322
  /**
298
323
  * A folder of executables the app carries (akanjs `bin`): copied to the app's resources (`bin/`) and put
@@ -37,6 +37,14 @@ export interface BundleInfo {
37
37
  hash: string;
38
38
  files: number;
39
39
  };
40
+ /** A phone build with updates: what its binary reads (updates.json), the floor of every release's sequence included. */
41
+ updates?: {
42
+ protocol: 2;
43
+ url: string;
44
+ channel: string;
45
+ keyIds: string[];
46
+ embeddedSequence: number;
47
+ };
40
48
  }
41
49
  /** "0.1.4" → "0.1", "1.2.0" → "1". */
42
50
  export declare function runtimeLine(version: string): string;
@@ -4,5 +4,10 @@ export interface DesktopServerConfig {
4
4
  dir: string;
5
5
  entry: string;
6
6
  env: Record<string, string>;
7
+ restart?: number | "forever";
8
+ watchdog?: {
9
+ intervalMs: number;
10
+ failures: number;
11
+ };
7
12
  }
8
13
  export declare function validateDesktopServer(desktop: AkanNativeConfig["desktop"], appDir: string, problems: string[]): DesktopServerConfig | null;
@@ -0,0 +1,22 @@
1
+ import { type MacosNotarization, type MacosSigning } from "./macossigning.ts";
2
+ import { type WindowsSigning } from "./windowssigning.ts";
3
+ export interface DistributionRequest {
4
+ /** Sign the app with the identity the env names (Developer ID on macOS, Authenticode on Windows). */
5
+ sign?: boolean;
6
+ /** macOS: upload the signed app to Apple's notary service. */
7
+ notarize?: boolean;
8
+ }
9
+ export interface Distribution {
10
+ macos?: {
11
+ signing?: MacosSigning;
12
+ notarize?: MacosNotarization;
13
+ };
14
+ windows?: {
15
+ signing?: WindowsSigning;
16
+ };
17
+ /** One line saying who signs and where the app goes, for before the build; null when nothing is signed. */
18
+ notice: string | null;
19
+ /** The env names that configure a signature this build was not asked to make. */
20
+ unused: string[];
21
+ }
22
+ export declare function requestedDistribution(platform: string, profile: "debug" | "release", { sign, notarize }: DistributionRequest, env?: Record<string, string | undefined>): Distribution;
@@ -18,6 +18,7 @@ export interface ResolvedConfig extends Omit<AkanNativeConfig, "icon" | "splash"
18
18
  shell: {
19
19
  backgroundColor: string;
20
20
  backgroundColorDark: string;
21
+ devtools: boolean;
21
22
  };
22
23
  usageDescriptions: Record<string, string>;
23
24
  permissions: PermissionsConfig;
@@ -34,8 +35,11 @@ export interface ResolvedConfig extends Omit<AkanNativeConfig, "icon" | "splash"
34
35
  window: {
35
36
  fullscreen: boolean;
36
37
  skipTaskbar: boolean;
38
+ frameless: boolean;
37
39
  };
38
40
  screenCapture: "picker" | "auto";
41
+ webview2: "bootstrapper" | "standalone";
42
+ publisher?: string;
39
43
  server?: DesktopServerConfig;
40
44
  /** Absolute. */
41
45
  bin?: string;
@@ -1,32 +1,38 @@
1
1
  import type { BuildContext } from "./prepare.ts";
2
- import { type UpdateManifest } from "./updates.ts";
2
+ import { type DesktopArch, type UpdateManifest } from "./updates.ts";
3
3
  export type ReleasePlatform = "macos" | "windows" | "linux" | "ios" | "android";
4
4
  export interface PublishedRelease {
5
5
  /** `<out>/<os>-<arch>` for a desktop app, `<out>/<platform>` for a phone's web bundle. */
6
6
  dir: string;
7
7
  manifest: UpdateManifest;
8
+ /** The file installed apps read: `<dir>/<channel>.json`, or a phone's `<dir>/<channel>/<nativeApi>.json`. */
9
+ file: string;
8
10
  }
9
11
  /**
10
- * The publish time in seconds, and past the release `<channel>.json` in `dir` already names: apps take only a larger
11
- * sequence, so a clock behind the last publisher's would make this release look older to every one of them.
12
+ * The publish time in seconds, and past every release of the channel in `dir`: apps take only a larger sequence, so a
13
+ * clock behind the last publisher's would make this release look older to every one of them. A phone's native APIs
14
+ * share one count, so a binary moving to the next generation never meets a smaller number.
12
15
  */
13
16
  export declare function nextSequence(dir: string, channel: string, now?: number): number;
14
- /** `<out>/<os>-<arch>` for a desktop release, `<out>/<platform>` for a phone's web bundle. */
15
- export declare function releaseDir(out: string, platform: ReleasePlatform): string;
17
+ /** `<out>/<os>-<arch>` for a desktop release (the arch it was built for), `<out>/<platform>` for a phone's web bundle. */
18
+ export declare function releaseDir(out: string, platform: ReleasePlatform, arch?: DesktopArch): string;
16
19
  /** Refuses before the build a desktop release the apps of its channel would refuse for its server (assertSameServer). */
17
20
  export declare function assertServerOfChannel(config: {
18
21
  desktop?: {
19
22
  server?: unknown;
20
23
  };
21
- }, platform: ReleasePlatform, out: string, channel: string): void;
22
- /** Refuses before the build a release that could not be signed: no key on this machine, or another app's. */
24
+ }, platform: ReleasePlatform, out: string, channel: string, arch?: DesktopArch): void;
25
+ /**
26
+ * Refuses before the build a release that could not be signed: no key on this machine, another app's, or for a desktop
27
+ * app one the app does not trust (it trusts the first of updates.publicKeys).
28
+ */
23
29
  export declare function assertSigningKey(config: {
24
30
  app: {
25
31
  id: string;
26
32
  };
27
33
  updates?: {
28
- publicKey: string;
34
+ publicKeys: string[];
29
35
  } | null;
30
- }): void;
31
- /** Writes the release of `artifact` (the app a release build made) and its signed `<channel>.json` under `out`. */
36
+ }, platform?: ReleasePlatform): void;
37
+ /** Writes the release of `artifact` (the app a release build made) and its signed manifest under `out`. */
32
38
  export declare function publishRelease(ctx: BuildContext, platform: ReleasePlatform, artifact: string, out: string, channel: string): Promise<PublishedRelease>;
@@ -2,12 +2,18 @@ import type { Platform } from "../../../core/src/index.ts";
2
2
  export interface UpdatesConfig {
3
3
  /** Base URL of the update files, e.g. "https://example.com/updates". http:// only for localhost / 10.0.2.2 in dev builds. */
4
4
  url: string;
5
- /** Raw 32-byte Ed25519 public key, base64 (`akan-native update keygen` prints it). */
6
- publicKey: string;
5
+ /**
6
+ * Raw 32-byte Ed25519 public keys, base64 (`akan-native update keygen` prints one): the keys a phone binary trusts, the
7
+ * online signing key first and offline spares after it, since a key may revoke only keys listed before it. A desktop
8
+ * app trusts the first.
9
+ */
10
+ publicKeys: string[];
7
11
  /** Manifest name under <platform>/. Default "production". */
8
12
  channel: string;
9
13
  /** How long a newly applied bundle has to call notifyReady() before it is rolled back, ms. Default 10000. */
10
14
  readyTimeout: number;
15
+ /** Where a phone posts what became of each release (downloaded, applied, confirmed, rolled back, failed); null: no reports. */
16
+ reportUrl: string | null;
11
17
  }
12
18
  export interface UpdateFile {
13
19
  /** Relative path inside the bundle ("index.html", "icons/a.png", "env.runtime.json"). */
@@ -19,7 +25,8 @@ export type DesktopArch = "arm64" | "x64";
19
25
  /** The CPU of the desktop apps this machine builds (cargo and bun build for the host). */
20
26
  export declare function hostArch(): DesktopArch;
21
27
  export interface UpdateManifest {
22
- schema: 1;
28
+ /** 2 for a phone's web bundle, which travels in an UpdateEnvelope; 1 for a desktop app. */
29
+ schema: 1 | 2;
23
30
  kind: "web" | "app";
24
31
  app: string;
25
32
  platform: Platform;
@@ -54,6 +61,18 @@ export interface UpdateManifest {
54
61
  }[];
55
62
  /** App updates: whether the app carries a server; an installed app refuses a release that differs from itself. */
56
63
  server?: boolean;
64
+ /** Web bundles: keyIds the phone stops trusting for good; each listed before the signer's key in its updates.publicKeys. */
65
+ revokeKeys?: string[];
66
+ /** Web bundles: with a new revocation, compare this release with the binary's own bundle instead of the running one. */
67
+ resetSequence?: boolean;
68
+ }
69
+ /** A phone's `<platform>/<channel>/<nativeApi>.json`: one object, so a new manifest never meets an old signature. */
70
+ export interface UpdateEnvelope {
71
+ /** The manifest's exact bytes, base64. */
72
+ manifest: string;
73
+ keyId: string;
74
+ /** Ed25519 over the manifest bytes, base64. */
75
+ signature: string;
57
76
  }
58
77
  /** Every file of a web bundle as the app serves it: index.html with the init script and CSP, public/, env.runtime.json. */
59
78
  export declare function webFiles(webDir: string, html: string, env: Record<string, string>): {
@@ -78,6 +97,8 @@ export declare function webManifest(release: {
78
97
  /** Refuses a channel no app could be configured for: it would be written but never taken. */
79
98
  export declare function assertChannel(channel: string): void;
80
99
  export declare function validateUpdates(raw: unknown, problems: string[]): UpdatesConfig | null;
100
+ /** What an envelope names its signer by: the first 8 bytes of the raw public key's SHA-256, in hex. */
101
+ export declare const keyIdOf: (publicKey: string) => string;
81
102
  /** Where the signing key of an app lives: AKAN_NATIVE_UPDATE_KEY (a file path), else ~/.akan/native/keys/<app id>.update.key. */
82
103
  export declare function updateKeyPath(appId: string, env?: Record<string, string | undefined>): string;
83
104
  /** Creates the Ed25519 key pair; returns the public key for akan-native.config.ts. Never overwrites a key. */
@@ -85,9 +106,24 @@ export declare function generateUpdateKey(path: string): {
85
106
  publicKey: string;
86
107
  created: boolean;
87
108
  };
88
- /** The key at `keyPath`, refused unless it is the one whose public half the apps were built with. */
89
- export declare function signingKey(keyPath: string, expectedPublicKey: string): import("node:crypto").KeyObject;
90
- export declare function signManifest(bytes: Uint8Array, keyPath: string, expectedPublicKey: string): string;
109
+ /** The key at `keyPath` and where it sits in `publicKeys`, refused unless the apps were built to trust it. */
110
+ export declare function signingKey(keyPath: string, publicKeys: readonly string[]): {
111
+ key: import("node:crypto").KeyObject;
112
+ keyId: string;
113
+ index: number;
114
+ };
115
+ /** A desktop app's base64 signature (protocol v1), with the key the app trusts: the first of updates.publicKeys. */
116
+ export declare function signManifest(bytes: Uint8Array, keyPath: string, publicKeys: readonly string[]): string;
117
+ /** A phone's envelope (protocol v2) for the manifest's exact bytes, signed with any key of `publicKeys`. */
118
+ export declare function sealManifest(bytes: Uint8Array, keyPath: string, publicKeys: readonly string[]): UpdateEnvelope;
119
+ /**
120
+ * The manifest bytes of an envelope, verified as a phone verifies it against `publicKeys` (minus `revoked`). What it
121
+ * then decides (revocation, sequence) is AkanNativeKernel.updateDecision, kernel.ts updateDecision.
122
+ */
123
+ export declare function openEnvelope(text: string, publicKeys: readonly string[], revoked?: readonly string[]): {
124
+ manifest: Uint8Array;
125
+ keyId: string;
126
+ };
91
127
  /** Verifies like the apps do: raw public key, base64 signature over the exact manifest bytes. */
92
128
  export declare function verifyManifest(bytes: Uint8Array, signature: string, publicKey: string): boolean;
93
129
  export declare const sha256: (data: Uint8Array | string) => string;
@@ -100,4 +136,12 @@ export declare const sha256: (data: Uint8Array | string) => string;
100
136
  export declare function updatesResource(updates: UpdatesConfig, app: {
101
137
  id: string;
102
138
  version: string;
103
- }, platform: Platform, nativeApi: string | undefined, dev: boolean): string;
139
+ }, platform: Platform, nativeApi: string | undefined, dev: boolean, embeddedSequence?: number): string;
140
+ /**
141
+ * updates.json of a phone build, and the same facts in the build's bundle.json: a signer that registers the store build
142
+ * checks the binary reads its URL and keys, and takes `embeddedSequence` as the floor every release must pass.
143
+ */
144
+ export declare function writePhoneUpdates(path: string, outDir: string, updates: UpdatesConfig, app: {
145
+ id: string;
146
+ version: string;
147
+ }, platform: "ios" | "android", nativeApi: string | undefined, dev: boolean): void;
@@ -1,4 +1,4 @@
1
- export declare const VECTOR_FILES: readonly ["scope", "routes", "ranges", "ids", "bridge", "navigation", "acl", "retained", "ed25519"];
1
+ export declare const VECTOR_FILES: readonly ["scope", "routes", "ranges", "ids", "bridge", "navigation", "acl", "retained", "ed25519", "updates"];
2
2
  /**
3
3
  * How many checks each file holds: the runners fail when a file is missing or ran another number,
4
4
  * so an empty or truncated file cannot pass as zero checks.
@@ -1,6 +1,11 @@
1
1
  import type { BuildContext } from "../lib/prepare.ts";
2
2
  /** Microsoft's permanent link to the Evergreen Bootstrapper (MicrosoftEdgeWebview2Setup.exe). */
3
3
  export declare const WEBVIEW2_BOOTSTRAPPER_URL = "https://go.microsoft.com/fwlink/p/?LinkId=2124703";
4
+ /** The Evergreen Standalone Installer per CPU (MicrosoftEdgeWebView2RuntimeInstaller<X64|ARM64>.exe). */
5
+ export declare const WEBVIEW2_STANDALONE_URLS: {
6
+ readonly x64: "https://go.microsoft.com/fwlink/?linkid=2124701";
7
+ readonly arm64: "https://go.microsoft.com/fwlink/?linkid=2099616";
8
+ };
4
9
  /** MAX_PATH less its NUL: what a PC without long paths enabled (the Windows default) can open or unpack. */
5
10
  export declare const WINDOWS_MAX_PATH = 259;
6
11
  export interface InstallerInput {
@@ -24,6 +29,8 @@ export interface InstallerInput {
24
29
  /** deepLinks.schemes: the uninstaller removes those the app registered for its own executable. */
25
30
  schemes: string[];
26
31
  icon?: string;
32
+ /** desktop.publisher: the Publisher Apps & features lists, and the setup program's company name. */
33
+ publisher?: string;
27
34
  bootstrapper: string;
28
35
  stopScript: string;
29
36
  outFile: string;
@@ -3,6 +3,11 @@ import type { Launched, LaunchOptions } from "../lib/launch.ts";
3
3
  import type { BuildContext } from "../lib/prepare.ts";
4
4
  /** The version resource wants four numbers: major.minor.patch.build. */
5
5
  export declare function windowsVersion(version: string, build: number): string;
6
+ export declare function windowsVersionInfo(app: {
7
+ name: string;
8
+ version: string;
9
+ build: number;
10
+ }, publisher?: string): string[];
6
11
  export declare function buildWindows(ctx: BuildContext): Promise<string>;
7
12
  export declare function launchWindows(ctx: BuildContext, dir: string, opts: LaunchOptions): Promise<Launched>;
8
13
  export declare function runWindows(ctx: BuildContext, dir: string, args: ParsedArgs): Promise<number>;
@@ -110,3 +110,39 @@ export declare function externalSchemes(extra?: readonly string[]): string[];
110
110
  * never opens anything.
111
111
  */
112
112
  export declare function decideNavigation(url: string, topLevel: boolean, origin: string, extra?: readonly string[]): "load" | "open" | "drop";
113
+ export interface UpdateDecisionInput {
114
+ /** The binary's keyIds, in `updates.publicKeys` order. */
115
+ ring: readonly string[];
116
+ /** keyIds state.json has revoked. */
117
+ revoked: readonly string[];
118
+ /** The envelope's keyId, whose signature over the manifest verified. */
119
+ signer: string;
120
+ revokeKeys: readonly string[];
121
+ resetSequence: boolean;
122
+ sequence: number;
123
+ /** The binary's own bundle (updates.json `embeddedSequence`). */
124
+ embedded: number;
125
+ /** The bundle running now, null for the binary's own. */
126
+ running: {
127
+ sequence: number;
128
+ keyId: string;
129
+ } | null;
130
+ }
131
+ export type UpdateDecision = {
132
+ kind: "untrusted" | "revoked" | "self-revoke" | "revoke-later";
133
+ } | {
134
+ kind: "take" | "stale";
135
+ baseline: number;
136
+ revoke: string[];
137
+ };
138
+ /**
139
+ * Whether a web bundle manifest is taken (updates protocol v2, vectors/updates.json). A key may revoke only keys listed
140
+ * before it, so a leaked online key — listed first — cannot revoke the offline spares that recover from it, and
141
+ * `resetSequence` counts only on a manifest that newly revokes a key, so replaying it cannot roll anyone back. A bundle a
142
+ * revoked key signed sets no bar, and revocations apply even when the release itself is not newer.
143
+ */
144
+ export declare function updateDecision(input: UpdateDecisionInput): UpdateDecision;
145
+ /** One answer of updateDecision as the vectors write it. */
146
+ export declare const updateDecisionWire: (decision: UpdateDecision) => string;
147
+ /** The v2 envelope of a channel for one native API: one file per binary generation, so each takes its own fixes. */
148
+ export declare const updateManifestUrl: (url: string, platform: string, channel: string, nativeApi: string) => string;
@@ -165,6 +165,8 @@ export interface LaunchWindow {
165
165
  fullscreen?: boolean;
166
166
  /** No taskbar button (Windows, Linux; macOS has none). */
167
167
  skipTaskbar?: boolean;
168
+ /** No title bar or border. */
169
+ frameless?: boolean;
168
170
  }
169
171
  /** What the launch phase decided; sent to the main thread with "ready". */
170
172
  export interface Launch {
@@ -3,7 +3,16 @@ export interface ServerManifest {
3
3
  /** The file in resources/server that starts the server. */
4
4
  entry: string;
5
5
  env: Record<string, string>;
6
+ /** Crashes in a row before the launcher gives up, MAX_FAILURES unless named; "forever" never gives up. */
7
+ restart?: number | "forever";
8
+ /** The health route asked every `intervalMs` once the server is ready; `failures` missed in a row restart it. */
9
+ watchdog?: {
10
+ intervalMs: number;
11
+ failures: number;
12
+ };
6
13
  }
14
+ /** Answered by the server's own process, solo or behind its gateway, without a database round trip. */
15
+ export declare const HEALTH_PATH = "/_akan/app/health";
7
16
  /** Set by the launcher at every start, so desktop.server.env may not name them (cli lib/desktop-server.ts). */
8
17
  export declare const LAUNCHER_ENV_KEYS: readonly ["BUN_BE_BUN", "BUN_RUNTIME_TRANSPILER_CACHE_PATH", "PORT", "JWT_SECRET", "AKAN_LISTEN_HOST", "AKAN_ALLOWED_HOSTS", "AKAN_SQLITE_DIR", "AKAN_WORKSPACE_ROOT", "AKAN_RUNTIME_DIR"];
9
18
  /** How long the window waits for the server; after that it opens and the first calls may fail. */
@@ -50,6 +59,8 @@ export interface DesktopServerOptions {
50
59
  stopGrace?: number;
51
60
  restartDelay?(failures: number, everReady: boolean): number;
52
61
  now?(): number;
62
+ /** Whether the server at `url` answers its health route; the watchdog's question. */
63
+ probe?(url: string, timeoutMs: number): Promise<boolean>;
53
64
  }
54
65
  export interface DesktopServer {
55
66
  /**
@@ -0,0 +1,17 @@
1
+ import type { ExternalViewApi, ExternalViewConsoleLevel, ExternalViewEvents } from "./index.ts";
2
+ /** consoleMessage per view: this many in CONSOLE_WINDOW_MS, the rest counted and reported with the next one. */
3
+ export declare const CONSOLE_BURST = 20;
4
+ export declare const CONSOLE_WINDOW_MS = 10000;
5
+ export declare function consoleLevel(value: unknown): ExternalViewConsoleLevel | null;
6
+ /** Chrome's virtual key code for a KeyboardEvent.code, which a trusted key event needs beside `key`. */
7
+ export declare function virtualKey(code: string): number;
8
+ /** One console call or uncaught exception as a message, from the protocol event the shell passed on. */
9
+ export declare function consoleMessageOf(method: string, params: unknown): Omit<ExternalViewEvents["consoleMessage"], "id"> | null;
10
+ /** Lets CONSOLE_BURST messages through per window of time, and counts what it held back for the next one. */
11
+ export declare function createConsoleCap(now?: () => number): (view: string) => {
12
+ pass: boolean;
13
+ dropped: number;
14
+ };
15
+ export declare function createDesktopExternalView(): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<ExternalViewApi, ExternalViewEvents>;
16
+ declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<ExternalViewApi, ExternalViewEvents>;
17
+ export default _default;