@akanjs/devkit 3.3.0-rc.6 → 3.3.0-rc.61

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 (278) hide show
  1. package/DEV_RUNTIME_KNOBS.md +1 -1
  2. package/README.ko.md +8 -2
  3. package/README.md +8 -3
  4. package/akanApp/akanApp.host.test.ts +4 -2
  5. package/akanApp/akanApp.host.ts +11 -0
  6. package/akanConfig/akanBin.ts +4 -0
  7. package/akanConfig/akanConfig.test.ts +280 -19
  8. package/akanConfig/akanConfig.ts +96 -270
  9. package/akanConfig/akanWorkers.test.ts +73 -0
  10. package/akanConfig/akanWorkers.ts +61 -0
  11. package/akanConfig/desktopServerConfig.ts +96 -0
  12. package/akanConfig/dockerImage.ts +216 -0
  13. package/akanConfig/index.ts +2 -0
  14. package/akanConfig/nativeFileSettings.ts +33 -0
  15. package/akanConfig/nativeKeys.ts +52 -0
  16. package/akanConfig/types.ts +2 -0
  17. package/app/appBin.test.ts +63 -0
  18. package/app/appBin.ts +50 -0
  19. package/app/applicationBuildReporter.test.ts +51 -1
  20. package/app/applicationBuildReporter.ts +6 -1
  21. package/app/applicationBuildRunner.test.ts +358 -5
  22. package/app/applicationBuildRunner.ts +204 -30
  23. package/app/dictionarySizes.test.ts +40 -0
  24. package/app/dictionarySizes.ts +95 -0
  25. package/app/routeFilesReport.test.ts +59 -0
  26. package/app/routeFilesReport.ts +46 -0
  27. package/app/routeJsBudget.ts +18 -4
  28. package/artifact/implicitRootLayout.test.ts +19 -0
  29. package/artifact/implicitRootLayout.ts +16 -2
  30. package/artifact/implicitRootLayoutRender.test.tsx +4 -1
  31. package/artifact/storeBootstrap.test.ts +28 -0
  32. package/artifact/storeBootstrap.ts +64 -8
  33. package/biome.base.json +7 -5
  34. package/codeAgent/agent/CodeAgent.ts +36 -16
  35. package/codeAgent/agent/CodeAgentAllowed.ts +35 -0
  36. package/codeAgent/agent/CodeAgentCommandLine.ts +372 -0
  37. package/codeAgent/agent/CodeAgentGate.ts +23 -4
  38. package/codeAgent/agent/CodeAgentRpcHost.ts +1 -1
  39. package/codeAgent/agent/codeAgent.test.ts +62 -0
  40. package/codeAgent/agent/codeAgentCommandLine.test.ts +212 -0
  41. package/codeAgent/agent/codeAgentContract.test.ts +117 -5
  42. package/codeAgent/skills/akan-agent/SKILL.md +8 -1
  43. package/codeAgent/skills/akan-code/SKILL.md +38 -3
  44. package/codeAgent/skills/akan-debug/SKILL.md +1 -1
  45. package/codeAgent/skills/akan-deps/SKILL.md +3 -2
  46. package/codeAgent/skills/akan-err/SKILL.md +13 -8
  47. package/codeAgent/skills/akan-mcp/SKILL.md +1 -1
  48. package/codeAgent/skills/akan-module/SKILL.md +2 -2
  49. package/codeAgent/skills/akan-page/SKILL.md +52 -28
  50. package/codeAgent/skills/akan-query/SKILL.md +13 -20
  51. package/codeAgent/skills/akan-runtime/SKILL.md +21 -1
  52. package/codeAgent/skills/akan-service/SKILL.md +10 -11
  53. package/codeAgent/skills/akan-transport/SKILL.md +5 -14
  54. package/codeAgent/skills/akan-ui/SKILL.md +16 -21
  55. package/commandDecorators/command.ts +28 -12
  56. package/commandDecorators/commandBuilder.ts +8 -1
  57. package/commandDecorators/commandDecorators.test.ts +70 -3
  58. package/commandDecorators/helpFormatter.ts +14 -12
  59. package/context/akanContext.ts +2 -0
  60. package/csrE2e/devHmrLatency.e2e.test.ts +1 -1
  61. package/docs/apiReference.test.ts +19 -0
  62. package/docs/apiReference.ts +28 -5
  63. package/executors/appExecutor.ts +26 -12
  64. package/executors/clientRuntimeKeyOrder.fixture.json +682 -0
  65. package/executors/clientRuntimeKeys.fixture.json +393 -0
  66. package/executors/clientRuntimeKeys.test.ts +1690 -0
  67. package/executors/executor.ts +14 -6
  68. package/executors/executors.test.ts +140 -1
  69. package/executors/sysExecutor.ts +112 -8
  70. package/executors/workspaceExecutor.ts +7 -4
  71. package/frontendBuild/allRoutesBuilder.ts +99 -7
  72. package/frontendBuild/autoImportSync.ts +3 -2
  73. package/frontendBuild/buildRouteClient.test.ts +686 -13
  74. package/frontendBuild/clientBuildTypes.ts +26 -0
  75. package/frontendBuild/clientEntriesBundler.ts +49 -1
  76. package/frontendBuild/clientEntryDiscovery.test.ts +308 -1
  77. package/frontendBuild/clientEntryDiscovery.ts +136 -14
  78. package/frontendBuild/clientEntryGroups.test.ts +77 -0
  79. package/frontendBuild/clientEntryGroups.ts +61 -0
  80. package/frontendBuild/csrDevArtifactWriter.ts +2 -2
  81. package/frontendBuild/csrDevModuleCompiler.test.ts +86 -0
  82. package/frontendBuild/csrDevModuleCompiler.ts +44 -8
  83. package/frontendBuild/csrDevPatcher.test.ts +1 -1
  84. package/frontendBuild/csrDevPatcher.ts +33 -7
  85. package/frontendBuild/csrDevTypes.ts +9 -0
  86. package/frontendBuild/devBarrelImports.test.ts +154 -0
  87. package/frontendBuild/devBarrelImports.ts +83 -23
  88. package/frontendBuild/devRegistryBundler.ts +4 -2
  89. package/frontendBuild/devRouteRuntime.test.ts +492 -0
  90. package/frontendBuild/devRouteRuntime.ts +167 -0
  91. package/frontendBuild/dictionaryAssetBuilder.test.ts +408 -0
  92. package/frontendBuild/dictionaryAssetBuilder.ts +185 -17
  93. package/frontendBuild/dictionaryConstants.ts +136 -0
  94. package/frontendBuild/dictionaryOwnParts.ts +88 -0
  95. package/frontendBuild/dictionaryPackState.ts +131 -0
  96. package/frontendBuild/dictionaryPacking.test.ts +207 -0
  97. package/frontendBuild/dictionaryPacking.ts +160 -0
  98. package/frontendBuild/dictionaryRoutes.test.ts +251 -0
  99. package/frontendBuild/dictionaryRoutes.ts +227 -0
  100. package/frontendBuild/pagesBundleBuilder.test.ts +84 -0
  101. package/frontendBuild/pagesBundleBuilder.ts +78 -2
  102. package/frontendBuild/precompressArtifacts.test.ts +22 -0
  103. package/frontendBuild/precompressArtifacts.ts +34 -8
  104. package/frontendBuild/registryMetadataFingerprint.ts +3 -3
  105. package/frontendBuild/renderedEntries.ts +144 -0
  106. package/frontendBuild/routeClientBuilder.ts +407 -43
  107. package/frontendBuild/routeHandoffs.test.ts +155 -0
  108. package/frontendBuild/routeHandoffs.ts +117 -0
  109. package/frontendBuild/routeModulePreloads.test.ts +32 -0
  110. package/frontendBuild/routeModulePreloads.ts +20 -11
  111. package/frontendBuild/routeRuntimeCheck.test.ts +280 -0
  112. package/frontendBuild/routeRuntimeCheck.ts +248 -0
  113. package/frontendBuild/routeRuntimePays.test.ts +143 -0
  114. package/frontendBuild/routeRuntimePays.ts +117 -0
  115. package/frontendBuild/ssrBaseArtifactBuilder.ts +24 -34
  116. package/frontendBuild/ssrDevBundler.test.ts +150 -1
  117. package/frontendBuild/ssrDevBundler.ts +66 -11
  118. package/frontendBuild/vendorFileImports.test.ts +254 -0
  119. package/frontendBuild/vendorFileImports.ts +163 -0
  120. package/frontendBuild/vendorNarrowing.ts +28 -0
  121. package/frontendBuild/vendorSpecifiers.ts +2 -0
  122. package/incrementalBuilder/buildBatch.proc.ts +9 -9
  123. package/incrementalBuilder/buildBatchProtocol.ts +1 -1
  124. package/incrementalBuilder/builderBoot.ts +5 -5
  125. package/incrementalBuilder/builderGraphPayloads.ts +4 -4
  126. package/incrementalBuilder/builderLanes.ts +2 -2
  127. package/incrementalBuilder/builderWatch.ts +8 -8
  128. package/incrementalBuilder/csrRegistry.ts +4 -4
  129. package/incrementalBuilder/incrementalBuilder.proc.test.ts +79 -0
  130. package/incrementalBuilder/incrementalBuilder.proc.ts +27 -8
  131. package/incrementalBuilder/ssrRegistry.ts +6 -6
  132. package/index.ts +1 -1
  133. package/integration/renderAdmissionSoak.test.ts +99 -0
  134. package/integration/renderAdmissionSoak.ts +609 -0
  135. package/lint/__fixtures__/no-arbitrary-color/every-color-function/bad.tsx +11 -0
  136. package/lint/__fixtures__/no-arbitrary-color/every-color-function/good.tsx +2 -0
  137. package/lint/__fixtures__/no-daisyui-legacy-class/every-class/bad.tsx +34 -0
  138. package/lint/__fixtures__/no-daisyui-legacy-class/every-class/good.tsx +2 -0
  139. package/lint/__fixtures__/no-inline-color/every-color-function/bad.tsx +10 -0
  140. package/lint/__fixtures__/no-inline-color/every-color-function/good.tsx +2 -0
  141. package/lint/__fixtures__/no-raw-palette-class/every-palette/bad.tsx +22 -0
  142. package/lint/__fixtures__/no-raw-palette-class/every-palette/good.tsx +2 -0
  143. package/lint/biomeBase.test.ts +50 -3
  144. package/lint/biomeBase.ts +1 -1
  145. package/lint/biomeCheck.test.ts +162 -0
  146. package/lint/biomeCheck.ts +131 -0
  147. package/lint/linter.test.ts +16 -11
  148. package/lint/no-arbitrary-color.grit +5 -0
  149. package/lint/no-conditional-st-hook.grit +5 -1
  150. package/lint/no-daisyui-legacy-class.grit +8 -0
  151. package/lint/no-document-cookie.grit +3 -0
  152. package/lint/no-inline-color.grit +10 -2
  153. package/lint/no-oversized-list-limit.grit +2 -0
  154. package/lint/no-raw-palette-class.grit +7 -0
  155. package/lint/no-unpublished-form-setter.grit +2 -0
  156. package/lint/no-web-only-api-outside-webkit.grit +5 -0
  157. package/lint/no-web-storage.grit +3 -0
  158. package/lint/withheldEnvFile.ts +17 -0
  159. package/mobile/desktopBin.ts +2 -2
  160. package/mobile/desktopServerStage.test.ts +18 -3
  161. package/mobile/desktopServerStage.ts +7 -2
  162. package/mobile/nativeApp.test.ts +7 -5
  163. package/mobile/nativeApp.ts +2 -2
  164. package/mobile/nativeConfig.test.ts +96 -1
  165. package/mobile/nativeConfig.ts +46 -12
  166. package/mobile/nativePublicEnv.ts +1 -1
  167. package/mobile/serverBundleSecrets.ts +43 -0
  168. package/package.json +20 -171
  169. package/packageExports.test.ts +38 -24
  170. package/quality/dictionaryKeys.test.ts +356 -0
  171. package/quality/dictionaryKeys.ts +488 -0
  172. package/quality/objectImportReport.test.ts +36 -0
  173. package/quality/objectImportReport.ts +105 -0
  174. package/quality/qualityScanner.ts +1 -1
  175. package/quality/routeRuntimeReport.test.ts +91 -0
  176. package/quality/routeRuntimeReport.ts +121 -0
  177. package/quality/runtimeConstantFacts.ts +71 -0
  178. package/quality/runtimeConstantGraph.ts +123 -0
  179. package/quality/runtimeConstantReads.ts +116 -0
  180. package/quality/runtimeImports.test.ts +190 -0
  181. package/quality/runtimeImports.ts +233 -0
  182. package/quality/runtimeKeyNames.ts +46 -0
  183. package/quality/runtimeLexicalScope.ts +132 -0
  184. package/quality/runtimeMarkerReach.test.ts +84 -0
  185. package/quality/runtimeMarkerReach.ts +255 -0
  186. package/quality/runtimeModuleFacts.ts +290 -0
  187. package/quality/runtimeNameTable.test.ts +172 -0
  188. package/quality/runtimeNameTable.ts +477 -0
  189. package/quality/runtimeScopeReport.test.ts +123 -0
  190. package/quality/runtimeScopeReport.ts +167 -0
  191. package/quality/runtimeSliceKey.ts +269 -0
  192. package/quality/runtimeSyntax.ts +133 -0
  193. package/quality/runtimeTable.fixture.ts +189 -0
  194. package/quality/runtimeUse.test.ts +737 -0
  195. package/quality/runtimeUse.ts +696 -0
  196. package/quality/runtimeUseReadable.test.ts +393 -0
  197. package/quality/ssrScanner.test.ts +13 -0
  198. package/quality/ssrScanner.ts +1 -1
  199. package/quality/translatorBindings.ts +187 -0
  200. package/test/secretEnvFixture.ts +134 -0
  201. package/test/testHelpers.ts +11 -0
  202. package/transforms/barrelAnalyzer.ts +26 -4
  203. package/transforms/barrelImportsPlugin.ts +121 -32
  204. package/transforms/exportReach.test.ts +162 -0
  205. package/transforms/exportReach.ts +308 -0
  206. package/transforms/frameworkObjects.fixture.tsx +58 -0
  207. package/transforms/frameworkObjects.test.ts +54 -0
  208. package/transforms/modelReference.test.ts +196 -0
  209. package/transforms/modelReference.ts +39 -0
  210. package/transforms/moduleParts.test.ts +225 -0
  211. package/transforms/moduleParts.ts +418 -0
  212. package/transforms/objectImportEdits.ts +150 -0
  213. package/transforms/objectMemberImports.test.ts +633 -0
  214. package/transforms/objectMemberImports.ts +571 -0
  215. package/transforms/objectMemberLookup.ts +150 -0
  216. package/transforms/objectModule.test.ts +307 -0
  217. package/transforms/objectModule.ts +482 -0
  218. package/transforms/objectModuleAnalyzer.ts +104 -0
  219. package/transforms/partImports.test.ts +76 -0
  220. package/transforms/partImports.ts +110 -0
  221. package/transforms/partModules.test.ts +187 -0
  222. package/transforms/partModules.ts +90 -0
  223. package/transforms/partPurity.ts +124 -0
  224. package/transforms/reactIconImports.test.ts +231 -0
  225. package/transforms/reactIconImports.ts +325 -0
  226. package/transforms/routeConstants.ts +122 -0
  227. package/transforms/routeRuntime.test.ts +835 -0
  228. package/transforms/routeRuntime.ts +703 -0
  229. package/transforms/routeRuntimeEdits.ts +92 -0
  230. package/transforms/routeRuntimeGraph.ts +66 -0
  231. package/transforms/routeRuntimePlan.ts +244 -0
  232. package/transforms/secretEnvDeclaration.test.ts +208 -0
  233. package/transforms/secretEnvDeclaration.ts +213 -0
  234. package/transforms/secretEnvFile.test.ts +117 -0
  235. package/transforms/secretEnvFile.ts +113 -0
  236. package/transforms/secretEnvName.test.ts +54 -0
  237. package/transforms/secretEnvName.ts +29 -0
  238. package/transforms/secretEnvSource.test.ts +148 -0
  239. package/transforms/secretEnvSource.ts +166 -0
  240. package/transforms/serverEnvEvaluationError.ts +11 -0
  241. package/transforms/serverEnvPlugin.test.ts +2 -1
  242. package/transforms/serverEnvPlugin.ts +13 -0
  243. package/transforms/serverEnvProfile.test.ts +129 -2
  244. package/transforms/serverEnvProfile.ts +126 -40
  245. package/transforms/serverEnvSecrets.test.ts +292 -0
  246. package/transforms/signalDescriptors.test.ts +280 -0
  247. package/transforms/signalDescriptors.ts +227 -0
  248. package/transforms/thisFreeExports.ts +87 -0
  249. package/transforms/transforms.test.ts +180 -3
  250. package/transforms/tsconfigPackageResolver.test.ts +1 -0
  251. package/tunnel/createTunnel.test.ts +29 -8
  252. package/tunnel/createTunnel.ts +22 -11
  253. package/tunnel/ssh2Module.test.ts +37 -0
  254. package/tunnel/ssh2Module.ts +32 -0
  255. package/tunnel/sshTunnel.ts +4 -2
  256. package/typecheck/projectTypecheck.test.ts +32 -1
  257. package/typecheck/projectTypecheck.ts +3 -3
  258. package/typecheck/typeChecker.test.ts +49 -0
  259. package/typecheck/typeChecker.ts +9 -7
  260. package/typecheck/withheldDiagnostics.ts +41 -0
  261. package/util/fileEditor.ts +1 -0
  262. package/util/selectModel.ts +1 -0
  263. package/workflow/executor.ts +6 -2
  264. package/workflow/index.ts +1 -0
  265. package/workflow/plan.ts +36 -7
  266. package/workflow/types.ts +1 -1
  267. package/workflow/uiTarget.ts +50 -0
  268. package/workspace/envSeed.test.ts +30 -1
  269. package/workspace/envSeed.ts +30 -1
  270. package/workspace/getRelatedCnsts.ts +7 -0
  271. package/workspace/mainCheckout.test.ts +55 -0
  272. package/workspace/mainCheckout.ts +38 -0
  273. package/workspace/scanInfo.test.ts +39 -0
  274. package/workspace/scanInfo.ts +55 -6
  275. package/workspace/slicePlanner.ts +1 -1
  276. package/workspace/workspaceLayout.test.ts +5 -1
  277. package/workspace/workspaceLayout.ts +3 -0
  278. package/CHANGELOG.md +0 -2717
package/CHANGELOG.md DELETED
@@ -1,2717 +0,0 @@
1
- # @akanjs/devkit
2
-
3
- ## 3.3.0
4
-
5
- ### Patch Changes
6
-
7
- - c44d068: A coding agent reads less to build its first app: the `akanjs` README keeps the path to a first app and links the rest on akanjs.com (17 KB to 7 KB), the `akan-page` and `akan-service` skills ship the API reference one section at a time with every entry named in the skill's index (`Link` now lists the anchor attributes it takes and `Link.Back`, `Link.Close` and `Link.Lang`), the `akan-page` skill holds what a first page looks up while `pageRule` keeps the deeper contract, and each rule is stated once across AGENTS.md, the path rules and the skills. Run `akan agent install` in a workspace to pick up the new files.
8
- - 1d8c8c2: An app with `basePaths` keeps every base path's CSS class scan in the candidate cache, so a start or build no longer rescans the sources of all but one of them. An entry is dropped only once its source file is deleted.
9
- - 90d740f: `native.ios.hideFormAccessoryBar: true` (or a target's `ios.hideFormAccessoryBar`) leaves out the bar WebKit shows above the keyboard while a page field is focused. The iOS shell already had the switch, but `akan.config.ts` refused the key and the native config never carried it, so every iOS app showed the bar.
10
-
11
- The key defaults to false, so existing apps are unchanged. The api report lists one new optional `AkanNativeIosConfig` property; no upgrade step is needed.
12
-
13
- - 4732186: `akan --version` loads no command module, and `akan tunnel`, `akan subspace` and the package commands such as `akan version` no longer load the TypeScript compiler unless a step compiles.
14
- - 6ea7242: `akan build`, `akan verify` and `akan start` stop with an error naming the import chain when the server pages bundle would import `react-dom/server` as it loads, instead of building a bundle whose RSC worker throws "react-dom/server is not supported in React Server Components" at boot. A module in the page graph that dynamically imports the app's `server.ts` is the usual cause: it brings the whole server, SSR renderer included, into the pages bundle.
15
- - 0d5e75e: A stylesheet whose imports use no Tailwind (no `@import "tailwindcss"`, Tailwind at-rule or `theme()` function anywhere in its import graph) is no longer run through the Tailwind compiler: its imports are inlined and it ships without the `/*! tailwindcss … */` banner. A stylesheet that uses Tailwind compiles exactly as before.
16
- - 98931e4: `akan start` boots the backend while the first base build runs: the backend loads its server graph beside the build and mounts the web surface as soon as the build's artifact is on disk, so the dev server is ready sooner.
17
-
18
- The port now answers from the start of the build. A request to `localhost` or an IP address, page or API, waits for the first artifact; a build longer than the 15 s the gateway holds a request ends the wait with a 503 "Backend is starting" page that reloads itself. A request to one of the app's own domains (a custom local domain) gets that 503 at once until the backend is ready, because the build has not written the app's hosts yet; after that it is served as before, and any other Host is refused as before.
19
-
20
- - 1d8c8c2: `akan start` keeps `apps/<app>/.akan/cache` between runs, so a restart reuses the CSS class scan and the subset fonts instead of redoing them. Each entry names the akanjs and Bun versions and the build of the cache code that wrote it, and an entry another one wrote, or one cut short, is rebuilt.
21
- - 98931e4: `akan start` prints one line when the dev server is ready that says where the start's time went: what the CLI did before the builder, the base build and its parts, the backend's boot, and when the first artifact was on disk.
22
- - 694444d: `akan verify` writes its build check to `dist/verify/<app>` and leaves `dist/apps/<app>` as `akan build` left it, so running `akan verify` after `akan build` no longer stops `cd dist/apps/<app> && bun main.js` from starting. The check no longer copies the app's `public/` and `private/` folders either.
23
- - Updated dependencies [c44d068]
24
- - Updated dependencies [af09c4f]
25
- - Updated dependencies [24315d1]
26
- - Updated dependencies [bf582c1]
27
- - Updated dependencies [90d740f]
28
- - Updated dependencies [3032627]
29
- - Updated dependencies [c10f7cf]
30
- - Updated dependencies [c10f7cf]
31
- - Updated dependencies [045699c]
32
- - Updated dependencies [5c7e083]
33
- - Updated dependencies [4040f2d]
34
- - Updated dependencies [aead1aa]
35
- - Updated dependencies [5c6d039]
36
- - Updated dependencies [0492e0b]
37
- - Updated dependencies [0492e0b]
38
- - Updated dependencies [5c7e083]
39
- - Updated dependencies [98931e4]
40
- - akanjs@3.3.0
41
- - @akanjs/language@3.3.0
42
-
43
- ## 3.2.0
44
-
45
- ### Minor Changes
46
-
47
- - 038d918: Akan.js 3.2.0. Read **Upgrade notes** before deploying an app that runs 3.1.1: unguarded endpoints, log levels, the `Err` class, loaders, SQLite transactions, exit codes and a CLI version check change behaviour.
48
-
49
- **Highlights**
50
-
51
- - **`agentService.loop`.** A server-side agent run over the `/mcp` tool catalogue, in-process, with `toolkits`, `remotes` (other MCP servers), `clientTools` (a screen the member has open), `ask` (a question parked between runs), `answer`, overflow retry, and a read rule that counts what a run reads as untrusted. `plug(AgentToolsRole)` runs the catalogue as a given account; `mcp: "agent"` keeps an entry off `/mcp` for the in-process agent only.
52
- - **Akan Graph and Akan Studio.** `get_graph` (MCP) returns the Akan Graph, read from source with no dev server: models, scalars, slices, endpoints with guards, services, jobs, adaptors, routes, layouts, the framework itself, and the Change Map for `since: <revision>`. `akan start` serves Studio at `/_akan/studio`, and it opens from the CLI and the editor.
53
- - **Editor support.** `@akanjs/language` resolves names Akan.js derives (`fetch.initMemoInPublic`, `st.do.setNameOnMemo`, `this.memoService.listByName`) and ships `akan-language-server`. The VS Code / Cursor extension opens a module side by side, runs `akan verify` and workflows, and publishes from CI to the VS Marketplace and Open VSX.
54
- - **Secure defaults.** Signals, websocket rooms, MCP, OAuth, the agent relay, the server edge, the ops channel, native builds, `akan code`, the CLI's tunnels and workflows, and the in-page agent each take the narrower default. Every change names how to get the old behaviour back.
55
- - **Faster pages.** Every SSR page loads 72K less framework JS (22K less Brotli); client modules preload from `<head>`; Link prefetch; Flight rows share inline scripts; one preloaded font face per family; faster RSC decoding and store writes; a route JS budget (`akan build --check-budget`).
56
- - **Realtime.** Per-socket, per-caller and per-model room limits, subscribe budgets, gateway subscribe acks, per-model live-sync routing, Redis room sharding, resync after a Redis outage, and an outbox limit for a down socket.
57
- - **Native.** `external-view` on Linux (Wayland and X11) with `sendKey`; Android 12 launch crash fixed; AppImage relaunch; tighter CSP, external-link, temp-folder and update defaults.
58
-
59
- **Upgrade notes**
60
-
61
- - **Guards.** An endpoint, slice query or pubsub room that declares no guards is refused with 403; open it with `[Public]`. Outside local operation a server whose signals declare a guardless endpoint stops at boot and names each one. `AKAN_UNGUARDED_ENDPOINTS=open` answers them as before. A slice whose `guards` leaves out `root` mounts no root list or insight. `guard(name)` refuses until `canPass` is overridden.
62
- - **`Err`.** Every `Err` is one class, `Err` from `akanjs/common`, and an `AkanError`. `err.code` is always set (a generalized failure's code, else its status's code), so `{ ...err }` now holds it. `Err.NotFound.is(error)` also requires status 404. Check across a page bundle and the framework with `Err.is`, not `instanceof`. `setErrorConstructor`, `HttpClientOptions.ErrorCls` and `FetchClient.build`'s `Err` option are deprecated.
63
- - **Coded failures.** The signal, service, server, route-tree, RSC and client facets throw coded `AkanError`s instead of a bare `Error`; messages and statuses are unchanged. A production 500 shows the status reason and code only. `bun run error:codes` lists the codes. A failed tool call and a failed agent turn carry a `code`.
64
- - **Log levels.** A failure under 500 logs at `warn`, a 5xx is one `error` record with `type` and `stack`, a declared error, a 429 and a by-id read of a missing id log at `debug`, and a crashed RSC worker logs at `warn`. Alerts and `--level error` filters see fewer lines. A page `redirect()` is `ok` at `info` with its 3xx status, and `notFound()` is `warn` with 404. Every log record reaches ndjson stdout, and a request line is never folded.
65
- - **Loaders.** A loader no longer shares a batch between a transaction and the requests outside it, and each caller gets its own document. A loader that keeps its keys forgets them when the model is written; a write by query clears every kept key of the model, and `cache: true` keeps the 10,000 most recent keys. A custom `DatabaseAdaptor` can implement `transactionKey()`; a `batchScheduleFn` must run its callback in the caller's async context.
66
- - **SQLite.** Work outside an open `this.transaction()` no longer sees its uncommitted rows, on `:memory:` or a non-WAL file either. `SqliteDatabase.getMeta` and `listMeta` return promises, so await them. A reader pays one database copy per transaction on `:memory:`; past a few tens of megabytes, put the database in a file.
67
- - **Indexes.** A boot keeps an index the release no longer declares and warns about it. After every instance runs this release, run `akan migrate <app> prune-indexes` once. `migrationActions` gains `indexes` and `prune-indexes`, so code that switches over every action needs the two cases.
68
- - **Websockets.** A socket holds at most 256 rooms, a caller 2,000 per process, a model 50,000 evaluated live rooms; a subscribe past a limit gets a 429 frame coded `liveRoomLimit`. Subscribes are budgeted at 1,000 a minute per socket and 10,000 per caller. A `pubsub` room's `onResync` also runs after Redis returns; a custom `WebsocketAdaptor.onRecovered` handler now takes the held rooms. A down socket keeps at most 100 emits.
69
- - **Gateway.** `/_akan/app/ready` answers 503 while no replica's RSC worker can render. A subscribe is acknowledged once the gateway routes the room.
70
- - **CLI.** A CLI whose major.minor differs from the workspace's `akanjs` refuses every command that writes, with exit 2; run `akan update`, or set `AKAN_ALLOW_VERSION_MISMATCH=1`. Exit codes: 2 for usage and unknown targets, 3 for failed checks (`verify`, `typecheck`), 130 for an interrupted prompt; a script that tested for exit 1 tests for non-zero. With `--json`, a failure ends stdout with `{"ok":false,"error":"<message>","code":"<code>"}`. `akan doctor` exits 1 on `"status": "failed"`; `akan workflow plan`, `apply` and `validate` exit non-zero on failure. A shell `AKAN_PUBLIC_ENV` now outranks the workspace `.env`, and `akan build --env <env>` builds another environment.
71
- - **Package budget.** `akan lint` and `akan verify` hold each package under `pkgs/` to the file, function and class budget. Run `akan quality baseline` once in a workspace whose packages are over it. `akan verify` also typechecks every app and lib that uses a changed lib.
72
- - **Secure defaults.**
73
- - Write tools in the in-page agent confirm by default (`submit`, `create`, `update`, `send`, `export` and the rest, not only `remove`); opt out with `{ confirm: false }`. Page text reaches the model fenced as data, and a transcript belongs to one account.
74
- - A `FetchClient` sends its session token only to its own origin; pass `clone({ origin, jwt })` to send one elsewhere.
75
- - A connection idle for 120 s closes (`AKAN_IDLE_TIMEOUT`), a body is capped at 128 MiB (`AKAN_MAX_UPLOAD_BODY`) and 16 MiB for a non-multipart one (`AKAN_MAX_REQUEST_BODY`), `akan start` binds 127.0.0.1 (`AKAN_LISTEN_HOST=*` restores it), and HTML carries `Cache-Control`, HSTS and a `frame-ancestors` policy.
76
- - The dev server answers only `localhost`, `*.localhost` and IP hosts unless `AKAN_ALLOWED_HOSTS` is set.
77
- - A 500 shows its message and stack only under `akan start`, `NODE_ENV` `development` or `test`, or `AKAN_ERROR_DETAIL=1`.
78
- - `ops snapshot` outside local operation needs `AKAN_BACKUP_RECIPIENT` or `--allow-plaintext`; the ops key must differ from `AKAN_MACHINE_PUBLIC_KEY`.
79
- - `/__rsc/manifest` is dev-only (`AKAN_EXPOSE_RSC_MANIFEST=1`), and health detail, metrics and devtools need a local dev runtime.
80
- - Filter arguments are parsed against their declared type and an `Any` filter argument throws at declaration; `q.search()` text is capped at 32 terms and 1000 characters.
81
- - The image optimizer refuses non-public remote hosts (`images.dangerouslyAllowLocalIP`).
82
- - The CLI's tunnels listen on loopback and check the SSH host key, workflow commands run without a shell, `akan download-env` copies only env and secret files, a Dockerfile built with `AKAN_PUBLIC_ENV=local` needs `--build-arg AKAN_ALLOW_LOCAL_IMAGE=1`, and `akan code` asks before network access and trusts a repository's MCP servers and extensions only after one terminal approval.
83
- - MCP rate-limits an unverified bearer by address, checks the browser Origin, and bounds client registration; the agent relay refuses a request past fixed limits with `agent.error.requestRefused` (413) unless a policy sets its own.
84
- - Native builds ship a Content-Security-Policy, open only `https:`, `mailto:` and `tel:` links, and recheck a downloaded desktop update before installing it; `updates.windowsSigners` and `updates.expiresIn` are new.
85
- - **UI.** `Field.Switch`'s on position is `primary` (pass `variant="accent"` for the old look), and two `Data.Item` status tags change color. `useCamera` and `useGeoLocation` no longer send the user to Settings after a denial. A page `.head()` can set `theme-color`, and a level that writes an image no longer inherits the image tags above it. `--akan-theme-color` drives the browser's `theme-color`.
86
- - **Libraries.** The `shared` and `util` libraries `akan install-library` copies are refreshed; compare your copy. In `util`, `security` and `security.jwtSecret` are optional in `ModulesOptions`. `libs/shared` keeps its SSO and refresh cookies on `__Host-` names outside local.
87
- - **Other.** `LLM` stream endings are read more completely: a cut tool call ends as `length`, and unparseable arguments in a finished answer get `argsError` and the code `invalidArgument`. `ConformanceEnv.has` fails instead of skipping when `AKAN_TEST_REQUIRE_BACKENDS=1`. A new workspace has no `patches/` folder, no `agent:sample:*` scripts and one `setup:agent` script; `create-akan-workspace` no longer hangs when `akan` is not on PATH.
88
-
89
- **Features**
90
-
91
- - **Agent.** `Agent.Chat` modals and toasts stack above the panel and its header takes a node; the tool row is the `AgentToolRow` override slot; a restored transcript that ends on an unanswered `askUser` reopens on it; a turn its caller stops is billed at what the provider plausibly charged, and every turn the quota passes is billed.
92
- - **Rendering and navigation.** `{ static: true }` page apps answer a host that asks for script-less HTML; `i18n.localePrefix: "as-needed"` serves the default locale unprefixed; a route guard receives `{ path }` and `signedIn({ path })` adds `?redirect=`; a failed route level or `Load.Stream` draws a notice with "Try again" in its own place; `router.refresh()` in CSR no longer reloads the document; a lazy chunk the server no longer serves reloads the page once; `forwardVisitor: false` keeps a render cacheable; a query takes `signal` and identical in-flight queries share one request.
93
- - **Data.** `create<Model>Many(rows)` runs every row through `_preCreate`, `_postCreate` and the document hooks; `bulkWrite` runs in one transaction; a cascade removes a long array's documents 200 ids at a time; `Binary` arguments are typed `Uint8Array<ArrayBuffer>`; a hidden `.optional()` field is optional in create inputs; store form setters and writes cost about one copy of the state; `onError` on store writes receives the failed request's dictionary error.
94
- - **Server and ops.** `/_akan/app/ready`; `RestartSchedule` shared by every child-restart loop; a single-flight `cache` endpoint; stopped or failed starts tear down what they brought up; the Redis WebSocket adaptor shards channels per room and model and flushes publishes on shutdown; a log stream stops growing for a client that stops reading; missing assets answer `no-store`.
95
- - **CLI.** `akan test --parallel=<n>`, `--junit <path>` and `--coverage`; `akan build --env`; a `rename-key` workflow; `akan remove-module pokedex:_billing` removes a service module; `akan create-workspace` works in an existing folder, without sample code, and without a git identity; `akan preview` opens `/_akan/studio`, `/openapi.json` and `/mcp` as written and restarts a dead browser; `akan verify` reports step durations and gives a dictionary hint for a missing key; commands without a terminal take the workspace's only app, lib or package, and remove commands never pick a target themselves; release candidates publish from CI with npm provenance.
96
- - **Native.** `external-view` and `sendKey` on Linux; Android 12 and 12L launch fix; AppImage relaunch; a `single-instance` pipe that another account cannot own on Windows.
97
- - **Types and styling.** A new app's default style is Pretendard with -3% letter spacing, even sizes from 12px, 150% line height for wrapping text and `leading-auto` for one line.
98
-
99
- **Fixes**
100
-
101
- - A dev page keeps its styles after a stylesheet change arrives with a pages rebuild; idle-suspended dev servers apply every save, stay awake when work arrives, and stop cleanly; `[BarrelAnalyzer] ERROR scan failed` is gone; a backend replica's builder answer no longer reaches its replacement.
102
- - A page that renders a string of 1024 characters or more renders and hydrates whatever its lines say; a page cut off by a disconnected client, or one that streamed an error, is no longer cached; partial RSC commit (`AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1`) patches real pages, replays patches from cache and cancels overtaken navigations.
103
- - In production, a render error no longer reaches the browser as its message; reading the client address from a crafted forwarded header no longer stalls the server; `happy-dom` peers ask for `^21.0.4`; the pi agent packages move to 1.5.2, dropping undici and minimatch advisories.
104
- - The build lock records its host and survives a dead remover, a Windows antivirus hold and a devcontainer; `akan` no longer rebuilds the dev CLI from a command it runs; the typecheck behind `akan verify` and `akan build` uses its incremental cache.
105
- - Internal: the largest classes and methods in `akanjs`, `@akanjs/devkit` and `@akanjs/cli` are split by concern with unchanged public members, and the `akanjs` facets import sibling files instead of their own barrel and list every export by name.
106
-
107
- ### Patch Changes
108
-
109
- - Updated dependencies [038d918]
110
- - akanjs@3.2.0
111
-
112
- ## 3.1.1
113
-
114
- ### Patch Changes
115
-
116
- - 39d5902: Akan.js 3.1.1. Read **Upgrade notes** before deploying an app that runs 3.1.0: sessions, proxies, the status routes and a few boot checks change, and `akan lint` gains gates a workspace adopts with a baseline.
117
-
118
- **Security**
119
-
120
- - **Build files.** In 3.1.0, `/_akan/styles/` and `/_akan/fonts/` resolved an encoded `..` against the whole build folder, so a request such as `/_akan/fonts/..%2fserver%2fpages-<hash>.js` could read any file in it, the server bundle and `base-artifact.json` included, through the gateway too. They now serve only from the build's `styles/` and `fonts/` folders. Upgrade any internet-facing 3.1.0 deployment.
121
- - **Session cookie.** Outside local the session cookie is `__Host-jwt:<appName>`, a name a browser accepts only from the app's own host over HTTPS at `Path=/`, so a sibling subdomain or a parent domain can no longer plant one. A request that carries the session cookie more than once reads as signed out — on the server, in SSR fetches, on websockets and in the browser — and an `Authorization: Bearer` header still wins. The server expires the duplicated copies of an unprefixed session cookie it can name (a local server's `jwt:<appName>`, or a name a library adds with `SessionCookies.watch(name)` from `akanjs/common`) and logs the name, the count and the host, never a value. A cookie name is trimmed of space and tab only, as RFC 6265 does, so a name padded with other whitespace never reads as a `__Host-` cookie. Outside local, `libs/shared` moves its SSO state, sign-up token and refresh cookies to `__Host-` names too, and reads a refresh cookie sent twice as absent.
122
- - **SSO origin.** `libs/shared` no longer builds the provider's `redirect_uri` from a cookie the sign-in page set. The server takes the origin from the request, trusting `x-forwarded-host` and `x-forwarded-proto` only from a trusted hop, and outside local refuses a host that is not the app's own with `shared.error.invalidSsoOrigin`. The native SSO start uses the same origin and check.
123
- - **Status routes.** Outside local, `/_akan/app/health` answers an anonymous caller only `{ status }` (`running`, or `stopping` while it drains) with 200, and `/_akan/app/metrics` answers 401. `Authorization: Bearer <AKAN_STATUS_TOKEN>` unlocks both in full; `AKAN_LOG_STREAM_TOKEN` works too, and a token containing whitespace unlocks nothing. Both answers are `cache-control: no-store`; `/_akan/app/info` and `/_akan/bench/ping` stay public. Detail stays open wherever `AKAN_PUBLIC_ENV` is `local`, and `akan build` bakes in the workspace's own value, so never expose an image built with `local`.
124
- - **Client address.** `AKAN_TRUSTED_PROXIES` names the proxies whose forwarded headers count. Unset, it is loopback and the private and link-local ranges, as before, and the caller is `X-Real-IP`, else the leftmost `X-Forwarded-For` entry. Set to a list of addresses or CIDRs, `private`, or `none` (loopback alone), it replaces those ranges: `X-Forwarded-For` is walked from the right past every trusted hop, and `X-Real-IP` counts only when `X-Forwarded-For` is absent or its nearest entry is no address. `*` alone trusts every peer; beside other entries it is ignored with a warning, as 3.1.0 ignored it. A forwarded value counts only when it is an IP address, and `Ip`, `context.getClientIp()` and the websocket address report it in one spelling, with no port or IPv6 zone and an IPv4-mapped IPv6 address as IPv4: `IpLiteral.parse(text)` from `akanjs/common` gives an address your code stores or compares the same spelling. The gateway and a solo server take `X-Forwarded-Host`, `-Proto` and `-Port` only from a trusted proxy. We recommend listing your load balancer's and ingress controller's own addresses: `private` lets any peer at a private address, such as a pod or a VPN user, name any caller, so pair it with a NetworkPolicy that admits only the ingress.
125
- - **In-page agent requests.** The browser writes a `runAgentTurn` request's instructions, tools and transcript, so a caller past `setAgentAccess` could send a hand-built turn and use the app's LLM key as a plain LLM. `option.setAgentRequestPolicy((request, { account, ip }) => request)` sees each turn after the access guard and before the quota hook and the model, with tool names as the page published them, and returns the request to send — a server-fixed lead to the instructions, a tool allowlist, caps, a per-turn `model` — or throws an `Err` to refuse it (`agent.error.requestRefused` is new) before any stream opens. Compaction turns pass through it too, with no tools and the summarizer's instructions. Attachments, references and tool results are folded into the prompt after the policy runs, so a size cap counts them itself. Without a policy nothing changes.
126
- - **CLI sign-in.** `akan login` prints a code such as `BCDF-GHJK` beside the sign-in URL: type it on the sign-in page to approve, and never type a code that did not come from your own terminal. The URL and its QR code carry only a login id, `RemoteAuthCode.loginIdOf(deviceCode)` from `akanjs/common`; the device code the CLI polls with is never in the link, so neither the code nor the session can be taken from it. A cloud serving `/remoteAuth` itself asks for the code: it accepts a poll only by a device code in the UUID form the CLI mints, registers a short-lived pending login under `loginIdOf` it, rate-limits that anonymous poll, approves only when `RemoteAuthCode.matches(deviceCode, typed)` holds, expires the login after three wrong codes, and hands the session out once. A cloud that does not still signs the CLI in, without the code.
127
-
128
- **Upgrade notes**
129
-
130
- - **Sessions.** Every visitor of a server-rendered page signs in once more; a CSR bundle keeps the token it stored until its `libs/shared` refresh fails. Native apps keep `jwt:<appName>` in secure storage and stay signed in. The `jwt:<appName>` and bare `jwt` cookies and the bare `jwt` secret-storage key are no longer read, and sign-in, sign-out and `initAuth` delete them; code that reads the cookie by a hard-coded name calls `authTokenKey()`. The app shell no longer signs a visitor in from a `?jwt=` query parameter, and `initAuth` no longer writes back a cookie it only read. `cookies()` from `akanjs/fetch` and `getCookie` / `cookies()` from `akanjs/client` read a name sent more than once as unset, percent-decode values, and no longer unwrap `j:` JSON values; the new `cookieJar()` in both returns every occurrence, with `read(name)`, `all(name)` and `readJson(name)`. `setCookie` escapes whitespace, control characters, `;`, `,`, `"`, `\` and a lone `%`, so `getCookie` reads the value back; a `%XX` its caller encoded is written unchanged. `removeCookie` writes `Secure` when it deletes a `__Host-` or `__Secure-` cookie. Deprecated: `parseCookieHeader`, `readAuthToken` (use `readSessionToken(CookieJar.parse(header))`), `cookieHeaderHasAuthToken` and `AppWsData.cookies` (use `jar`).
131
- - **SSO hosts.** Outside local, SSO accepts only the app's own hosts: the `routes` domains in `akan.config.ts`, `AKAN_SUB_ROUTE_HOSTS`, `<app>-<environment>.<serveDomain>`, the `hostname` option or `HOST_NAME` (`BackendEnv.hostname` now also takes a list, such as the apex and `www`, whose first name is the one links, the issuer and mail use), `AKAN_ALLOWED_HOSTS` (which, once set, also refuses every host it leaves out) and `AppHosts.declare(hosts)` from `akanjs/common`. Declare every host users sign in on before upgrading. A build with `web: false` records no `routes` domains, so list its hosts in `AKAN_ALLOWED_HOSTS`. A sign-in or sign-up left unfinished across the upgrade starts again, and a web session cannot be refreshed past it. `getSsoOrigin`, `NativeSso.publicOrigin` and `shared.error.invalidSsoCallbackMissingOrigin` are removed, and `readRefreshTokenCookie` takes the request.
132
- - **Proxies.** A proxy at a public address that terminates TLS or rewrites `Host`, such as a CDN, must be in `AKAN_TRUSTED_PROXIES` even where you never set it: otherwise the app reads `http` and the inner host, so MCP OAuth metadata, the SSO `redirect_uri` and absolute URLs come out wrong and browser mutations are refused as cross-site. If you already set the list, a private-range ingress it does not name is no longer trusted (add it), and the caller now comes from the right-hand walk of `X-Forwarded-For`, not `X-Real-IP`, so your proxy must set or append `X-Forwarded-For`.
133
- - **Status routes.** A metrics scraper or monitor that reads the health or metrics body sends `Authorization: Bearer <AKAN_STATUS_TOKEN>`. Probes that read only the status code — the chart's probes, the desktop shell, `akan` commands — need nothing.
134
- - **Writes during a render.** `fetch.<mutation>()` or a socket `message` sent while a page renders now throws `base.error.mutationInRender` as the call is made, before anything is sent, so a `.catch()` on its promise does not swallow it. On the server that covers a route's `.render()`, `.guard()`, `.head()` and `.loading()`, a layout's `.notFound()` and `.error()`, any component rendered inside them, and the page behind a `.prompt()`; in a CSR bundle, a route stage's synchronous part. Move the write to a user action, or pass `{ duringRender: true }` as the call's option (`fetch.prepareSession(id, { duringRender: true })`) only for a write harmless to repeat and safe for anyone following a link to trigger; an OAuth callback page that completes a connection needs it and must check that its `state` was issued to the signed-in user. `.app()` loads still refuse every mutation. `akan quality` reports these calls as `akan.ssr.render-mutation`, reading a route file's stages and the functions it calls in that file.
135
- - **Boot checks.** An app now fails to boot where 3.1.0 served one of two declarations and dropped the other; rename one side of each pair the error names.
136
- - One refName with two shapes: scalar fields, enum values, or a model declared under a lib's refName without building on the lib's model (extending through `lib/__lib/lib.constant.ts` stays legal). A field's `secret`, `hidden` or `visual` kind is part of its shape. Likely hits: an app enum or scalar sharing a `libs/shared` name with other values, and an app model that leaves out one of the lib model's layers. Libs disabled with `disableLibs` are not checked, and a lib's own `agentTurn` scalar with other fields is refused, naming `akanjs` as the other owner. When a lib and the app both declare a refName, the app's declaration now wins in every registry.
137
- - One `fetch.*` name claimed twice (`[DI:fetch]`): a mounted generated endpoint, a slice's `xListInY` / `initXInY`, or a custom query, mutation, pubsub or message; and a pubsub and a message sharing a name (`[DI:socket]`). A native or desktop build already shipped still calls the old name.
138
- - Two internal jobs of one kind under one name (`[DI:internal]`): two `initialize`, two `destroy`, two `process`, or two of `cron`, `interval` and `timeout`. Renaming a `process` job moves it to a new queue, so drain the old one first; renaming a cron or interval starts a new lease.
139
- - **Service methods.** `transaction` and `afterCommit` are now methods of every service: rename a service method of either name. A custom `DatabaseAdaptor` implements `afterCommit(fn)`.
140
- - **WebSocket on first use.** The socket opens at a page's first subscribe or message instead of at load. An app that relied on it being open at load — reading `fetch.ws.connected`, listening for `"connect"`, or expecting a push before it subscribes — adds `.wsConnect(true)` to its root layout.
141
- - **Dictionaries.** `System.Provider` no longer takes a `dictionary` prop: remove it from a hand-written root layout. `Translator.withDefaultLocale` is removed; the build fills a locale's missing keys from the default locale.
142
- - **MCP.** An app slice that writes no `mcp` map now inherits every verb its lib's slice took off the shelf, root `mcp: false` included. An app extending a `libs/shared` model whose slice says `mcp: { cru: false }` (such as `admin` or `notification`) stops publishing those generated writes on `/mcp`; write `mcp: { cru: true }` on the app's slice to publish them again. HTTP is unchanged.
143
- - **Slices on the client.** An app's slice that extends a lib's replaces the lib's guards, `mcp`, person-only and `crud` maps whole on the client too, as the server mounts them. A verb the app sets to `None` no longer gets a client handler, so `fetch.createX` for it is undefined instead of answering 403.
144
- - **Library sort keys.** An app filter built from a library's filter carries the library's sort keys in its type, so an app dictionary that does not spread the library's dictionaries into `modelDictionary(...)` translates them in `.sort()`.
145
- - **Pubsub `null`.** Publishing `null` or `undefined` to a pubsub that is not `{ nullable: true }` throws an error naming the pubsub.
146
- - **Compression.** HTML, RSC and other text responses compressed as they stream carry no `Content-Length`, and a strong `ETag` on one becomes weak. `AKAN_HTTP_COMPRESS=0` still turns compression off.
147
- - **Desktop updates.** Install matching `akanjs` and `@akanjs/cli` (native build API 0.13.0). A self-hosted feed must serve `<os>-<arch>/<channel>/app.json`. Renaming a native target cuts its installed desktop apps off updates. Before you revoke a key or sign with a spare, publish a release signed with the first key, so apps built with 3.1.0 move to a 3.1.1 binary. `native.updates.publicKeys` refuses a non-canonical or small-order Ed25519 key, which would verify signatures nobody made: replace it with one `akan update-keygen` prints. A desktop app now updates itself by default; set `native.updates.automatic: false` to keep checking, downloading and applying in the app's own `updates` calls.
148
- - **`@akanjs/devkit`.** `CloudApi.getRemoteAuthToken` and `CloudApi.getRemoteSelf` throw on a failed request and give up after 20 seconds; `null` now means only "not approved yet" and "no sign-in from this session". `uploadRelease`, an unused helper importable only as `@akanjs/devkit/uploadRelease`, is removed. The native build types come from `akanjs/native/api` and `akanjs/native/config`, not the unpublished `@akanjs/native/api`.
149
- - **Workspaces.** An existing workspace adds `@akanjs/cli` at its `akanjs` version (`bun add -d @akanjs/cli@<version>`), so `bunx akan` runs Akan's CLI and not the unrelated npm package `akan`. A `local/` folder an earlier version left inside an app or library is no longer written; delete it.
150
- - **Lint gates.** `akan lint` now fails in an app or library that already breaks the size and write rules under **New**, until `akan quality baseline` records what is there: run it once and commit the `akan.baseline.json` files it writes. A CI job that runs `akan lint` needs the default branch's history (`actions/checkout` with `fetch-depth: 0`); in a shallow clone the gate fails rather than pass unchecked. A literal list limit above 500 (`no-oversized-list-limit`) is a lint error the baseline does not record, so lower it. `akan typecheck` now also checks an app's `script/` files, which nothing imports.
151
- - **Agent guide.** Run `akan agent install` and commit what it writes: `AGENTS.md`, the scoped `AGENTS.md` files, `.claude/rules/akan/`, `.claude/skills/akan-*`, `.agents/skills/akan-*` and `.cursor/rules/akan-*.mdc`. Your `CLAUDE.md` and `.cursor/rules/akan.mdc` pointers are kept. Nothing reads `docs/AI-DEVELOPMENT.md` or `docs/GENERATED.md` anymore, so a workspace created before this release can delete them; `akan doctor` reports them.
152
-
153
- **New**
154
-
155
- - **Navigation guards.** `router.addNavigationGuard(guard)` keeps a page with unsaved work. `guard({ kind, from, to })` is asked before every in-app move — `push`, `replace`, `back`, a `Link`, a deep link, the browser's back and forward, a native back button or swipe, and the in-page agent's `navigate` and `goBack` — and returns the function that removes it. `useNavigationGuard(guard)` from `akanjs/webkit` registers one for the page that is on screen. Answering `false`, throwing or rejecting keeps the page, and `router.navigation()`, which now also follows `back()`, rejects with `NavigationRefused`. A refused browser back or forward is undone before the page redraws, and an async guard that later allows it replays the move. Guards answer one at a time, and a move started while one decides is refused. Redirects, `notFound()`, `setLang` and moves off the origin are not asked; a closing tab is `beforeunload`'s.
156
- - **Transactions.** Every service has `this.transaction(fn)` and `this.afterCommit(fn)`. `transaction` runs `fn` as one database transaction over every model and returns its value, typed; when `fn` throws it rolls back and rethrows that error. A transaction opened inside another joins it with no savepoint, so what the inner one wrote before throwing still commits if the outer catches the error. On Postgres a failed statement aborts the whole transaction even when caught, so `transaction` rolls back and rethrows it. On SQLite it holds the database's only write lock, so keep `fn` short and never wait on the network inside it. `afterCommit(fn)` runs `fn` after the commit and before `transaction` resolves, never after a rollback, and at once outside a transaction; a callback that throws is logged, not thrown. Cache, `memory`, outside calls and `listenPost` listeners, live sync included, are not part of the transaction: the listeners run after the commit. A task the transaction started without awaiting never joins it once it has ended. `@Transaction()` from `akanjs/server` is deprecated in favour of `this.transaction`.
157
- - **Writes that keep `updatedAt`.** `{ touch: false }` leaves `updatedAt` as stored, so bookkeeping such as a lease heartbeat or a mirrored snapshot no longer reads as an edit in `updatedAt` periods and sorts. Query-level writes take it in their options (`updateOne`, `updateMany`, `updateById`) or as `.set(update, { touch: false })` on the generated `update<Filter>` / `updateOne<Filter>`, and run no hooks, as before. The document path takes it as `doc.save({ touch: false })`, `pickAndWrite(id, data, { touch: false })` and `pickOneAndWrite(query, data, { touch: false })`, with save hooks and live sync running as usual.
158
- - **Conditional `upsertById`.** `upsertById(data, { where })` writes over a stored row only when that row matches `where`, and never over a removed row unless `withRemoved: true` is passed too; an id no row holds is inserted. It is one statement on SQLite and Postgres, so a writer whose lease lapsed cannot land over a newer row, or bring back a removed one, between its check and its write. With `where` it answers `updateOne`'s result: `modifiedCount` is 0 when the stored row did not match, and `upsertedId` is set when it inserted. `where: {}` writes over any live row and refuses a removed one. Without `where`, `upsertById` writes as before.
159
- - **Env transform.** `option.transformEnv(fn)` in a lib's or app's `lib/option.ts` rewrites the server env once, as the server is built and before any option, lib or `env(...)` injection reads it. It runs in every replica, in `bun main.js ops …` and in the test server; each lib's transform runs in mount order and the app's last, each given what the one before returned. `fn` gets a copy, so code that imports the env module itself still reads its values.
160
- - **MCP curation and tests.** `option.setMcp()` takes `excludeSignals` and `excludeEndpoints`, which keep a whole signal or single entries, generated ones included, off `/mcp`'s `tools/list`, `tools/call` and views while HTTP still serves them. The lists from every lib and the app add up. The boot log reports each exclusion and warns about a name that matches nothing served. `akanjs/test` exports `getServedMcpCatalogue({ as, ui })`, the tools and prompts the running test server's `/mcp` lists a guest or a test agent's account across every page, with `findTool`, `undescribed` and `listingCost`; `ui: true` gives the listing of a client that draws MCP Apps views. `TestServer#servedMcpCatalogue` does the same for a server you start.
161
- - **In-page agent.** The agent is told that `navigate` and `goBack` replace the screen's tools, which arrive on its next turn, so a navigation ends the turn. An unknown tool name is answered with the tools listed now, noting when the screen changed under the call. `navigate` reports where a redirect or the not-found page actually took it, and answers a path with no route with the paths the screen links to. `OpenaiLlm` with `host` set to `https://api.openai.com/v1` keeps image input, as with no host, and `OpenaiLlm.acceptsOf(llmOption)` lets an app's own chat-completions adaptor claim the same.
162
- - **Faster pages.** Server-rendered HTML and RSC flight responses are compressed with brotli, or gzip for a client that takes only gzip, as they stream; the shell still reaches the browser before the render ends, and a disconnect still cancels the render. The akanjs.com home page drops from 444 KB to about 48 KB. Behind the gateway each replica compresses for the client's `Accept-Encoding`, and the gateway relays its bytes. Text responses from the web routes — `public/` files without a `.br`/`.gz` sidecar, `robots.txt`, `sitemap.xml`, the CSR shell — are compressed the same way, and a page in the HTML result cache keeps its compressed bytes, which `AKAN_HTML_RESULT_CACHE_MAX_BYTES` now counts. Every compressible response varies on `Accept-Encoding`, compressed or not. A page no longer carries its locale's dictionary in the RSC flight: a build writes one immutable module per locale, `/_akan/dict/<lang>-<hash>.js`, which the page preloads and a navigation into another locale loads before it commits. `akanjs/common` and `tailwind-merge` load once from the import map, recipes build on `tailwind-variants/lite`, and a server-rendered page no longer loads react-spring or the native plugins. A font in `rootLayout().fonts([...])` takes `preload: false`, loading when text first uses it. A `public/` file is served with `stale-while-revalidate=86400` beside its 5-minute `max-age`.
163
- - **UI exports.** `akanjs/ui` exports `SelectLanguage`, `ThemeToggle` and `DevModeToggle` by name; import them that way in a `"use client"` file, where `System.ThemeToggle` bundles the whole app shell. `akanjs/client` exports `isNativeApp`, `isNativeShell`, `nativePlatform`, `desktopPlatform` and `openExternalUrl`. `fetch.instance.connectOnUse()` is the socket's new default mode.
164
- - **View modal in the URL.** `Data.ListContainer` and `Model.AdminPanel` take `viewInUrl`, which keeps the open view modal in the URL as `?action=view&modelId=<id>` beside the page's other params: a link carrying them opens that record whether or not the loaded page lists it, a link to another record replaces the open one, and an id that fails to load closes the modal and drops them. They also take `renderViewTitle`, the view's own title (`false` drops its title bar). The view's bottom bar carries the record's `actions` other than "view", with labels: "edit" opens the edit form and goes back to the view when it closes or saves, "remove" asks the row's confirm and then closes the view, and a function form is asked with the record and its place on the loaded page (-1 when unlisted); `viewActions={false}` turns the bar off. The container draws one view modal, not one per row. `Model.ViewModal` draws a title bar only when given `renderTitle` and an action bar only when `renderAction` answers something other than `null`, and without an `id` opens for whichever record `view<Model>` loads. `Data.Item` cards are more compact.
165
- - **Desktop updates, protocol v2.** Desktop apps built with 3.1.1 read `<url>/<os>-<arch>/<channel>/app.json`, the signed envelope phones read: they trust every key of `native.updates.publicKeys` except `revokedKeys`, apply the revocations a release carries, and take only releases made for their own native target. `akan publish-update --revoke` and `--reset-sequence` work for desktop releases. For apps built with 3.1.0, `publish-update` still writes `<channel>.json` and `.sig` when the first key signs, and warns when a release is invisible to them.
166
- - **Desktop apps update themselves.** About 30 seconds after it starts and every hour after that, a desktop app looks for a release on its channel and downloads it in the background. As the app quits, the download moves into place without a relaunch, and the next launch runs it on trial, so a release that fails still rolls back. A quit while a release is on trial installs nothing, a debug build never updates itself, and on Windows and Linux only one running copy of an app without single-instance updates itself. `native.updates.automatic: false`, or a target's `updates.automatic`, leaves it all to the app's own `updates` calls. `updates.download()` called while a download runs, the background one included, now answers with that download instead of rejecting with `CANCELLED`.
167
- - **`akan push-update --platform desktop`** (or `macos`, `windows`, `linux`, with `--arch arm64|x64`) uploads to the Akan Cloud project the release `publish-update` last signed, unchanged: the envelope, the archive and the patches it names, the old pair when it is the same release, and a `release.json` naming the CLI version, the build time and the app's signer (the macOS Team ID, the Windows Authenticode subject, or none). The envelope must verify against the target's keys. The command prints whether the project published, staged or rejected the release, and the URL installed apps read. A desktop release can be up to 1 GiB.
168
- - **Desktop secrets.** A desktop app's carried server keeps a secret the user gives it, such as their own API key, with `NativeSecret.set(key, value)`, `get(key)` and `remove(key)` from `akanjs/server`, which ask the shell that started it. The shell keeps them encrypted in the server's data folder, with the key in the macOS Keychain, the Windows Credential Manager or the Linux Secret Service, under a store of the server's own (a debug build has its own), apart from the page's `secretStorage`, so no page script reads them. On macOS without a Team ID, any program of the same user can read that key through `security`. A read during the server's boot waits for the window, so read a secret when a request needs it. Anywhere but a carried server, `NativeSecret.available` is false and every call rejects without sending anything.
169
- - **`akan test <target> [files]`** runs only the comma-separated test files or folders you name, read from the target or the workspace root; it is the way to run one signal test. Outside production, a server or test started inside `apps/<app>` or `libs/<lib>` without `AKAN_RUNTIME_DIR` keeps its sockets and logs in the workspace root's `local/<apps|libs>/<name>/runtime`, where `akan test` and `akan start` put them, and leaves a live dev server's log socket alone.
170
- - **Locked images.** `akan build` writes a `bun.lock` beside the image's `package.json`, cut down from the workspace's lockfile to what the server needs with every locked version and the root's registry `overrides` and `resolutions` kept, and the generated Dockerfile installs it with `bun install --production --frozen-lockfile`. A workspace without a text `bun.lock` gets a warning and the unlocked install as before; a hand-written `docker` string adds `--frozen-lockfile` itself, and `patchedDependencies` and a pin to a path or a workspace package are not carried.
171
- - **`akan create-workspace`** puts `@akanjs/cli` in the new workspace's `devDependencies` at its own version, and `akan update` moves it with `akanjs` and `@akanjs/devkit`. `--dir` is resolved against the current directory, so `--dir /abs/path` creates `/abs/path/<name>`.
172
- - **`akan login`** saves the session as soon as the cloud hands it out and reads the account with retries, so a failed read no longer loses it. Network errors are retried with backoff and reported, a 4xx refusal other than 408 or 429 ends the wait with the cloud's reason, and a session the cloud does not take is cleared with a message to sign in again.
173
- - **Version mismatch.** When `akan`'s version differs from the workspace's `akanjs`, the warning names a command that fixes it: the same command through the matching CLI (`bunx -p @akanjs/cli@<akanjs version> akan …`, or `bunx akan …` when the workspace pins that CLI), plus `akan update` when the CLI is the newer one. It no longer prints for `akan update`, `akan create-workspace`, `--help` or `--version`.
174
- - **`akan verify [targets]`** syncs, lints with fixes, typechecks, fast-builds and checks SSR over what git reports as changed, in one run, and prints one header line plus one line per diagnostic, repeats folded, errors first, at most 20 (`--max <n>`, `0` for all). With no target it covers the changed files under `apps/`, `libs/` and `pkgs/`, typechecking a changed library too and a framework package against its own `tsconfig.json`. The build runs only when nothing failed before it. Each code comment added since the last commit is an `akan.comment.added` warning. `--files` replaces the git scope, `--lint-only` and `--no-build` shorten the run, `--format json` prints one JSON line, and it exits 0 on a pass, 1 on a failure and 2 on an unknown target. `akan code` runs it for its `akan_verify` tool and end-of-turn check, so a typecheck error now reaches the model, and `akan workflow apply` and MCP `run_validation` validate with it, typecheck and build included.
175
- - **Agent guide.** `AGENTS.md` keeps only the rules that apply everywhere, under 12 KB instead of about 83 KB, and lists 16 path rules and 16 skills that load only when they apply: Claude Code reads `.claude/rules/akan/<area>.md` and Cursor `.cursor/rules/akan-<area>.mdc` when a matching file is touched, and the procedures sit in `.claude/skills/akan-*` and `.agents/skills/akan-*`, whose `references/` hold the full guidelines. A rule a lint plugin or gate enforces names its check, and the Work Loop checks with `akan verify` and, after a page, UI or runtime change, `akan preview`. `akan agent install` gains the targets `rules`, `skills` and `hooks`, and `--check` writes nothing, lists the files install would create, change or remove, and exits 1 if there are any; it ignores the version stamp, so it fits a CI step. A generated file carries `<!-- akan:generated -->`: a file without it is yours, never removed and overwritten only with `--force`, and generated files a newer CLI no longer produces are removed. `akan doctor` warns with `agent-guide-oversized` when `AGENTS.md` plus the largest app or library `AGENTS.md` pass 80 % of the 32 KiB Codex reads, and with `agent-guide-leftover` for the old `docs/` guides. A new workspace's `.gitignore` keeps `.claude/settings.local.json`, `.claude/worktrees/` and `.claude/scheduled_tasks.lock` out of git. The `workspaceOnboarding` guideline is removed.
176
- - **Claude Code hooks.** `akan agent install hooks` adds opt-in hooks to `.claude/settings.json`, keeping every other hook there: an edit to a generated file is refused with a pointer to its source, an edited file is linted with fixes and a remaining error sent back, and before the session stops what it edited is checked with `akan verify`, a failure or an added comment sent back once. `all` never installs them.
177
- - **`akan preview <app> [paths]`** opens each page in a headless browser and prints one verdict line per page (`ok`, `warn` or `FAIL`) with its status, title, load time and where a redirect landed, then its uncaught errors, the server errors logged while it loaded, console errors and warnings, and layout problems; it exits 1 when a page failed. A page fails on a 4xx or 5xx, an empty body, the server's error page, the dev build overlay, an uncaught or console error, a server error or a timeout, and warns on a console warning, a page wider than the viewport, text the colour of its background or a dropped daisyUI colour class. It reuses this checkout's dev server on the app's port, or starts `akan start <app>` and stops it afterwards (`--keep` leaves it running; its output goes to `local/apps/<app>/runtime/preview/server.log`). Paths are comma-separated, a path without a locale gets the default one, and `--changed` adds the pages uncommitted page and layout changes reach, `/` when no route changed, at most 8. `--csr` boots each page as a native app does, `--desktop` uses 1280×800 instead of 390×844, `--screenshot` saves a PNG, `--timeout` defaults to 60 seconds and `--format json` prints the full report. The engine is Bun.WebView: WebKit on macOS, so nothing is downloaded, and an installed Chrome or Chromium elsewhere (`--engine`). `@akanjs/devkit/preview` exports `PreviewView` and `PreviewChrome`, and the `akan code` preview check now reports console warnings too.
178
- - **Client errors in the dev log.** In `akan start`, every page the dev server serves, in a browser, a CSR boot or a native shell, reports its uncaught errors and unhandled rejections, logged as `ClientReport` error records naming the page, its boot and a native shell's platform and target, so `akan logs` and the dev terminal show them. A page reports at most 50, with control characters stripped.
179
- - **`akan context --app <app>`** lists the app's routes: path, file, search keys, and whether a guard applies, its own or a layout's. Past 60 routes the largest folders fold into one line each; `--format json` lists every route.
180
- - **Size and write gates.** For an app or library, `akan lint` fails on what no check caught before, and each failure names its rule and, where one exists, the `akan workflow plan …` command that builds the right shape:
181
- - **Size** (`akan.size.file`, `akan.size.component`): a `Zone`, `Util`, `Template`, `Unit`, `View`, `*.store.ts`, or `ui/` / `webkit/` file over 400 lines; a service or document over 500; an abstract over 300; a component or hook over 250.
182
- - **Store reach** (`akan.component.store-access`): a component or hook reaching `st` more than 16 times, form setters aside.
183
- - **Where a write starts** (`akan.write.placement`): a `fetch.<mutation>` outside a `*.store.ts`, or a writing `st.do.*` in `ui/` or `webkit/`, which take the write as a prop or hook argument instead.
184
- - **Chained writes** (`akan.store.multi-write`, `akan.store.root-write-chain`, `akan.component.write-chain`): two or more writes, or one per item in a loop or a `map`, sent by one store action, store `static` or component or hook handler, directly, through a sibling action or through another store via `RootStore`. Exclusive paths count apart, and a retry or a poll counts its write once.
185
- - **Per-item service calls** (`akan.service.call-in-loop`): a service method an `endpoint` or `slice` reaches that calls a service, a model or a generated query once per item. `internal` jobs, counted loops and a `get<Model>` / `load<Model>` in a `map` callback, which the DataLoader batches, are spared.
186
- - **Baselines.** `akan quality baseline` writes an `akan.baseline.json` at each app or library root that needs one, recording each breach under its rule with what was measured (`--force` rewrites one). After that `akan lint` fails only on what grows or is new, and lowers an entry as its code shrinks. It refuses a baseline that adds or raises an entry against its copy at the default branch's fork point, and with `--no-fix` one above what the code measures. A size, store-reach or per-item entry may be added or raised when its key carries a `reasons` line; the write rules take no exceptions. `akan quality scan` counts each app's adopted debt and reasoned exceptions (`akan.baseline.exceptions`), and `libs/shared` and `libs/util` ship their own baselines.
187
- - **Write-path workflows.** `akan workflow plan add-mutation` builds a whole write path in one apply: the document chain method, the service method, the mutation, a one-line store action, the dictionary entry and signal test stubs. `--guard` is required and checked against the guards the target reaches, `None` refused, and a name another reachable module claims is refused as the server would refuse it at boot. `--with <ref>.<method>` runs other writes inside the mutation's `this.transaction()`, `--after <ref>.<method>` runs side effects in `this.afterCommit()`, and either is refused when the workflow cannot supply its arguments. Under a guard that only checks sign-in, the service method gets a `TODO` for the acting user's right to the record and the tests a refusal to fill in; a `Public` mutation gets a rate limit. `akan workflow plan create-interaction` creates a `webkit/use<X>.tsx` hook over a pure `common/<x>.ts` class and its test, for drag, selection, keyboard and layout logic that would otherwise grow inside a component.
188
- - **Lists past 500 rows.** A client list asked for more than 500 rows is still served 500, and the server now logs it once per list. The lint rule `no-oversized-list-limit` fails on a literal limit above 500 in `fetch.<model>List<Suffix>(…, skip, limit)`, in `{ limit }` passed to `fetch.init…`, `st.do.init…` or `st.do.refresh…`, and in `st.do.setLimitOf…`. A store list asked for more than 500 reads `hasMoreOf…` as true after a full 500, so `loadMoreOf…` fetches the rest instead of stopping.
189
- - **`akan quality scan`** also warns about a `lib/` module or `ui/` entry whose comments pass 1 % of its lines once it holds five (`akan.comment.density`), a `// deprecated` comment that should be a `/** @deprecated */` tag (`akan.comment.deprecated-marker`), an export in an app's `common/`, `webkit/`, `srvkit/` or `ui/` that only tests use (`akan.global.test-only-export`), and a `*Kind` / `*Type` / `*Mode` enum value compared in three or more files outside its module (`akan.global.kind-branch`).
190
-
191
- **Fixes**
192
-
193
- - `save()` on a document of a model with a `field.secret` field, or one read with a `select`, writes only the fields it changed, as for any other document, and after `refresh()` too. It wrote back every field the document held, undoing what another write changed in between, such as a counter's increment or a status move. A field the read left out is written only when you set it. Outside production, saving a document that was never read, which still writes every field it holds, logs a warning once per model.
194
- - A pubsub publishes `0`, `false` and `""`, which it dropped with `Failed to serialize data`; a `{ nullable: true }` pubsub (or one returning `Any`) delivers `null`, and publishing `undefined` to it delivers `null`.
195
- - An endpoint's answer keeps the `""` a nullable `String` field holds, so a field declared `field(String, { default: "" })`, in a model or an embedded scalar, reaches the client as `""` rather than `null`. An argument or input left `""` is still sent as not given.
196
- - A `router.push`, `router.replace` or `router.enterDeepLink` called before the router is initialized, as from a page's mount effect, waits for it instead of throwing `Router is not initialized`.
197
- - `fetch.ws` listeners on `"connect"` and `"disconnect"` fire. The `.reconnect()` overlay runs only where `AKAN_PUBLIC_ENV` is `local`.
198
- - In the browser, a Korean `RecentTime` or `dayjs().locale("ko")` no longer falls back to English after hydration.
199
- - A server-rendered page's client components read their own request's locale and path while other requests render, and an `x-locale` header counts only when it names one of the app's locales.
200
- - `usePageLocation()` on an SSR page reads the URL's query, so `?filter=` links, the dashboard's selected tile and `viewInUrl` see it. It read none there: the SSR page wrapper carried no search params and never followed a shallow replace. The server render now reads the request's query and the base store starts from the address bar, so the first browser render matches it; the pathname stays the one the page was rendered for.
201
- - A HEAD request to a page, or a request the page redirects after its render has started, no longer logs `[SSR] render failed`. The status and `Location` it answers are unchanged.
202
- - The built-in 404 page hydrates without a hydration error in an app whose root layout sets `.theme("dark")` or `.theme("light")`, which put a `data-theme` on `<html>` the 404 document never named.
203
- - The `Clipboard` button from `akanjs/ui` has an accessible name, `base.copy`.
204
- - A toast shown with a `duration` of 0 or less, such as `msg.loading(key, { key, duration: 0 })`, stays until a toast with its `key` replaces it or the user closes it. It disappeared at once.
205
- - In `Data.ListContainer` and `Model.AdminPanel`, editing a record the loaded page does not list opens the edit form, where it opened nothing. A dialog whose title or action slot goes away no longer keeps showing the last one.
206
- - A streamed API response is no longer buffered whole before it is sent: from the producer's first pause it streams out compressed. A body complete when the handler returns is compressed with its length as before, and a stream that passes 4 MiB before its first pause is sent uncompressed. `application/wasm` is compressible, and a `.br`/`.gz` sidecar beside a `.wasm` in `public/` is served.
207
- - A plain GET on the websocket path answers `426 Upgrade Required` instead of `500`, at the gateway too, so a crawler or an uptime probe no longer counts as a server failure.
208
- - A fetch client created after another in the same process, such as a lib's on the server, finds the endpoints the earlier one registered.
209
- - A service declared with `serve(..., { serverMode })` is enabled or not by the `SERVER_MODE` in effect when the server boots, not when its module is imported.
210
- - A desktop app whose carried server gives up during a trial before the window opens quits into the previous release instead of waiting behind the alert, and until it restarts it offers, downloads and applies nothing, so it can no longer move the rolled-back release back. A rollback whose file moves failed keeps the release it moves back, and the tries it counted, for the next start. An app is never offered the release it was built from.
211
- - A macOS desktop app no longer takes minutes to download an update while its window is hidden or covered: `download()` holds an App Nap activity until it ends, through the shell's new `activity.begin` / `activity.end` ops, which still allow idle system sleep.
212
- - In `akan code`, a sub-agent started by `task` runs on the model the session is on, the one `--model` or `/model` chose, with that model's `models.json` entry. It ran on `deepseek/deepseek-flash` whenever DeepSeek had a key.
213
- - `akan push-update` exits 2 when the project rejects a release or refuses it with a `release.error.*` key, for phone packs too, and every 400 refusal prints the data it carries.
214
- - A workspace that typechecks code reaching `@akanjs/devkit/akanConfig`, `/pipeline` or `/mobile` no longer fails with `Cannot find module '@akanjs/native/api'`.
215
- - `akan lint`, `akan typecheck` and every sync that formats generated files run where only Bun is installed, and `akan lint <app>` passes for an app whose libs carry env modules.
216
- - A new app's `tsconfig.json` no longer names the Next.js TS plugin or `.next/types`, a new workspace's `bunfig.toml` no longer loads `bun-plugin-tailwind`, and `akan doctor` warns (`config-leftover`) about those lines in an existing workspace.
217
- - When a desktop app quits and its carried server outlasts the grace, the shell waits for the killed server to exit, so on Windows the server's files are no longer still locked after the quit.
218
- - On Windows, `akan verify-dist-package` names a dist file with `/` and leaves out its `node_modules`, as on macOS and Linux.
219
- - In `akan start`, a tab's hot-update socket connects through the dev gateway again. Under Bun 1.4.4 the replica refused it, so a save no longer reached an open tab.
220
- - A desktop or iOS build no longer stops when the file `android.googleServices` names is missing. Only an Android build reads it, and that build still stops without it.
221
- - On macOS, `akan start` measures the dev builder against `AKAN_BUILDER_MAX_RSS_MB` by the memory it holds, as the builder reports it. Pages it already freed no longer count, so a builder that gave memory back is no longer replaced, and a fresh one no longer makes a low ceiling look unmeetable.
222
- - A workspace, app, library, package, module, service, scalar, CRUD page or migration the CLI creates is written as Biome prints it, as are the `.mcp.json` and `.cursor/mcp.json` that `akan mcp-install` writes, so the first `akan lint` no longer rewrites files nobody has touched.
223
- - A new app in a workspace created with `--libs true` imports `Auth` from `@libs/shared/ui`. Its root layout imported `@shared/ui`, a name nothing in the workspace resolves.
224
- - `akan workflow apply` of `add-enum-field`, or of `add-field --type enum`, works on the sample `task` module a new workspace ships, where it failed with `primitive-post-edit-dictionary-verify-failed` and wrote nothing: the enum block landed inside the dictionary's header comment. `akan workflow plan add-field` takes `--surfaces template,unit` and `--include-in-light`, the inputs `akan workflow explain add-field` lists, and explain prints each camelCase input's flag beside it.
225
-
226
- - Updated dependencies [39d5902]
227
- - akanjs@3.1.1
228
-
229
- ## 3.1.0
230
-
231
- ### Minor Changes
232
-
233
- - ce817b6: A module's `serve(ref, { operationMode: ["edge"] }, …)` mounts only in the operation modes it lists, and `modules: ["@edge"]` / `AKAN_MODULES=@edge` names every module that lists edge; a selection now also mounts the targets of its modules' relation fields. `native.desktop.server` takes `{ profile, modules }`: `profile: "edge"` bundles `env/env.server.<env>.edge.ts` in place of the environment's own file, which no longer reaches the computers the app is installed on, and the build refuses a profile file whose secret-named keys hold a value; `akan build <app> --profile edge` does the same for an image. Machine tokens: `MachineToken.issue({ kind, id, version })` signs an Ed25519 JWT with `AKAN_MACHINE_PRIVATE_KEY` (`akan machine-keygen <file>` writes one), a server with that key or `AKAN_MACHINE_PUBLIC_KEY` sets `account.machine` from a verified token on HTTP and websocket calls and strips any other, and `.with(Machine)` reads it.
234
- - ce817b6: `akan build-desktop` and `akan publish-update` sign only with `--sign` and notarize only with `--notarize` (as does `akan-native build` / `update publish`): `AKAN_NATIVE_MACOS_*` and `AKAN_NATIVE_WINDOWS_*` name the identity and no longer decide to use it, and a build that finds them set without the flag says it is unsigned. A release build or `publish-update` of an app that carries its server, signed or not, first searches that server for every secret value of the workspace's server env files and refuses it with the file and key paths, and an env file it cannot evaluate stops the release; one line then names the identity and the service a signed app goes to. The SSR route bundle now takes the server env plugin too, so a build carries only its own environment's app env there and a profile build swaps the libs' env defaults in it as it does in the backend. `akan publish-update --arch arm64|x64` publishes a desktop release for another CPU into that CPU's feed folder.
235
-
236
- Upgrade note: signing and notarizing are opt-in. A CI that only sets `AKAN_NATIVE_MACOS_*` or `AKAN_NATIVE_WINDOWS_*` now builds and publishes unsigned macOS and Windows apps, after a line saying those variables went unused and a warning that the app is not signed, and an installed signed app refuses such an update. Add `--sign true` to `akan build-desktop` and `akan publish-update`, and `--notarize true` for macOS, to sign and notarize as before.
237
-
238
- - ce817b6: The `external-view` native plugin (`akanjs/client/native/external-view`) shows a third-party page first-party over a desktop window: a browser profile of its own, navigation held to the origins it was opened for, an init script for the top document, `evaluate`, a trusted `sendKey`, `capture` of its content, `setMuted`, `clearData`, autoplay with sound by default, and `load` / `loadFailed` / `gone` (it reloads, and is rebuilt when its browser process ends, counting `restarts`) / `consoleMessage` (warn and up by default, with source and line, rate-capped) events — every method on Windows, most on macOS 14+. The `window` plugin adds `placeOnDisplay({ display | index, bounds, unit: "logical" | "physical", fullscreen })`, `setDecorations`, `setCursorVisible`, `setMinSize` and `create({ frameless })`, and `native.desktop.window.frameless` opens the main window without a frame. `AkanServer.start({ schedules: false })` runs no internal.
239
- - 17aa243: `akan build` writes one single-file view per `.app()` to `mcp-apps/<name>.html`, beside `csr/`. The server reads it for that app's `ui://<app>/apps/<name>` resource. `akan start` writes the views to `.akan/artifact/mcp-apps/` when a host first reads one, and again after a save, without rebuilding the CSR bundle.
240
-
241
- - **What a view bundles.** The view bundles the app's page with its `.render()`, `.head()`, `.loading()` and `.guard()` replaced by functions that draw nothing. It therefore carries only the modules the page's `.app()` loads reach.
242
- - **Its root layout.** The view sits under the root layout that renders `System.Provider`. That layout's `McpAppRoot` gives it the theme, fonts and providers, and the `_overrides.tsx` over the page re-skin it as they do the page: one on the root layout's folder, or on a folder above it that holds no layout of its own, wraps that layout as it does on the web, so it also reaches the toasts and approvals the layout draws. A synced lib page, linked under `page/(libs)`, is trimmed like any other.
243
- - **Size.** A host loads one file, so a view inlines every module its loads reach, a `lazy(() => import(…))` included. The view build marks each `const X = lazy(…)` pure, so one that nothing renders — a barrel's, the page's own that only its `.render()` drew, or one an `_overrides.tsx` manifest's import brings in — is dropped with the module it imports. A `lazy()` called anywhere else stays.
244
- - **Names.** An `.app()` name must be a string literal that matches `^[A-Za-z0-9_-]{1,64}$`, on a chain written as the `export default` expression itself; a chain bound to a name and exported as `export default x` or `export { x as default }` fails the build. Two pages that declare one name fail the build, and so do two names that differ only in case, whose files would collide on a case-insensitive disk.
245
- - **Rebuilds.** Views are built aside and moved into place one file at a time, so a host that reads a view while `akan start` rebuilds them gets the previous view or the new one. A file the bundler emits beside a view reaches no host, so it is dropped with a warning.
246
- - A desktop server stage carries `mcp-apps/`. The font pruner keeps a font that only a view references.
247
-
248
- - ce817b6: `akan sync` now refuses a test at the `lib/` root and a module test that is not named after the one module file it covers. A module keeps one suite per role (`chatMessage.signal.test.ts`, `ChatMessage.Zone.test.tsx`), so `chatMessage.trim.signal.test.ts` is refused just like `chatMessage.trim.signal.ts`. `akan quality scan` reports a test at the `lib/` root under `akan.layout.lib-facet-file`. Upgrade note: move a `lib/<model>.signal.test.ts` into `lib/<model>/`, fold every `<model>.<topic>.signal.test.ts` into `<model>.signal.test.ts` as a `describe` block, and move a suite that drives several modules into `srvkit/`, like `libs/shared/srvkit/guards.signal.test.ts`.
249
- - ce817b6: A module's `*.signal.test.ts` / `*.service.test.ts` may import the runtime's `node:*` and `bun:*` modules (`no-import-external-library-in-test.grit`); third-party packages stay refused there.
250
- - ce817b6: Phone web bundle updates move to protocol v2.
251
-
252
- - **Path:** a binary reads only its own native API's manifest, `<url>/<platform>/<channel>/<nativeApi>.json`, so two store generations on one channel each take their own fixes.
253
- - **Envelope:** that file is one envelope holding the manifest's bytes, the signer's `keyId` and the signature, so a CDN can never pair a new manifest with an old signature.
254
- - **Keys:** `native.updates.publicKeys` lists 1 to 3 trusted keys, the online signing key first. `publicKey` stays as the one-key form.
255
- - **Revocation:** a manifest can carry `revokeKeys`, plus `resetSequence` to recover from a polluted sequence. A key may revoke only keys listed before it, and a revocation is kept for good on the device.
256
- - **Publishing:** `akan-native update publish` carries the channel's revocations forward into each new envelope and refuses to sign with a key they revoke, so a routine publish never undoes a revocation.
257
- - **Store build:** `bundle.json` records the binary's update URL, key ids and `embeddedSequence`.
258
- - **Server-side helpers:** `openEnvelope`, `keyIdOf` and `updateDecision` are exported for a server that signs or registers releases.
259
-
260
- Desktop app updates keep protocol v1 and trust the first key.
261
-
262
- Upgrade note: no phone binary that shipped with `updates` reads the new layout. Rebuild the binary before publishing, and point a signer at the new path. `akan pack-update` writes a schema 2 template.
263
-
264
- - ce817b6: CLI fixes for the OTA and Akan Cloud commands:
265
-
266
- - **One exit-code rule for the OTA commands.** `akan pack-update --against`, `akan push-update` and `akan register-binary` exit 2 when the pack needs a new store build. `push-update` also exits 2 when the project rejects the release. Any other failure exits 1. Each command's `--help` lists these codes.
267
- - **Akan Cloud refusals are read from the status and the whole response body**, so a server `Err` key is found wherever it sits in the body. When the server asks a pack commit or binary registration to retry, the CLI waits at least its `Retry-After`, and stops at once if that wait would pass the deadline. A storage PUT that gets a 429 or 503 also waits its `Retry-After`, up to a minute.
268
- - **Runner prompts fail fast when stdin is not a terminal.** This covers picking a script for `akan script`, installing a database mode's packages, choosing the scp env server, entering a Windows test target, going on past a platform test that did not pass, and confirming a `deploy-akan` publish. Each one used to read the piped input as its answer. Each now fails with what to pass or set instead.
269
- - **A malformed pipeline secret name is never echoed back** by `akan upload-secret` or `akan remove-secret`. Such a "name" is often a value pasted in the wrong place, and the refusal lands in terminal scrollback and CI logs.
270
- - **`deploy-akan`** writes each versioned `package.json` with its trailing newline, and so does the CLI dist.
271
- - **A template's static file** (an image or a font) is kept when the caller passes `overwrite: false`, which text files already did. Before, it was copied over the user's file.
272
-
273
- devkit adds `ExitCodeError` (a command exits with its code) and `assertPromptable(problem, { choices, remedy })` to `@akanjs/devkit/commandDecorators`. `@akanjs/devkit/cloud` gains `CloudHttpError` (status, whole body, headers), `PipelineSecrets` and `CloudUpdates`, and `@akanjs/devkit/mobile` gains `UpdatePackFolder`, the one reader and writer of a pack folder. Cloud `HttpClient` failures are `CloudHttpError`s, with the same message as before.
274
-
275
- Upgrade note: a CI step that answered one of the runner prompts above through stdin now fails. Pass the argument or set the value the error names.
276
-
277
- - ce817b6: A phone web bundle release can start revoking an update signing key, and the config keeps the revocation.
278
-
279
- - **Start one:** `akan publish-update --platform ios|android --revoke <keyId,...>` (`akan-native update publish ios|android --revoke <keyId>`, repeatable) revokes keys of `updates.publicKeys`; `--reset-sequence` adds `resetSequence` to that release. `akan update-keygen` prints each key's keyId.
280
- - **Keep it:** `native.updates.revokedKeys` lists the keyIds every phone release revokes, so a release published from a fresh checkout still revokes them. A release carries `revokedKeys`, the channel's published revocations and `--revoke` together, and warns about a revocation the list does not hold.
281
- - **New binaries:** a phone build trusts none of the keys `revokedKeys` lists, though `updates.publicKeys` still holds them, so a fresh install never takes a release a revoked key signs. A config whose `revokedKeys` covers every key is refused. A desktop release signed with a revoked first key warns that installed desktop apps keep trusting it until a binary with another first key replaces them.
282
- - **Refused before the build:** a keyId the key ring does not hold, more than 16 revoked keys, `--reset-sequence` without a revocation, either flag on a desktop release, and a signing key the release revokes or that is listed before a key it revokes. The error names where the revocation came from and the key to sign with (`AKAN_NATIVE_UPDATE_KEY` picks its file).
283
- - **API:** `publishUpdate` and `checkPublishUpdate` take `revoke` and `resetSequence`, and `checkPublishUpdate` validates the `updates` settings too; `updateKeygen` returns `keyId`. The native build API is 0.12.0.
284
-
285
- Upgrade note: the akan CLI needs native build API 0.12.0, so install matching versions of akanjs and @akanjs/cli; an older one is refused.
286
-
287
- - ce817b6: Fixes for over-the-air updates on a phone, plus the upload commands they were missing.
288
-
289
- - **Hung releases:** a release on trial whose page hangs in a script now rolls back while the app runs.
290
- - The ready timer starts with the page, not when it finishes loading.
291
- - A page that does not answer gets a fresh renderer: a new web view window on iOS, an ended renderer process on Android.
292
- - **Downloads:** update downloads ask for `*/*`, so a CDN that injects scripts into HTML responses can't change the signed bytes.
293
- - **Inlined dictionary:** the dictionary a build inlines into the client bundle is key-sorted, so the same commit gives the same bytes.
294
- - **`native.devtools: true`:** opens the web inspector of a release build, for an internal test target only.
295
- - **`akan push-update <app> --platform`:** packs an update and uploads it to the Akan Cloud project, which signs and publishes it.
296
- - The pack goes straight to the project's storage, so a proxy's request time limit can't cut off a large one. Only the files the pack's manifest lists go up, though a pack folder keeps every earlier pack's files.
297
- - `--pack <dir>` uploads a folder `akan pack-update` already wrote instead of packing again, so one pack built in CI can be checked, then uploaded as it is.
298
- - It exits 2 when the pack needs a new store build or the project rejects it, and stops without retrying when the project says the upload was already used.
299
- - **`akan register-binary <app> --platform --distribution`:** registers the store build `release-*` made, with a pack of the same commit, which goes up and stops the same way. It refuses when the two provide different native APIs.
300
-
301
- - ce817b6: `updates.report: { url }` has a phone post what became of each web bundle release, so whoever publishes sees rollback rates.
302
-
303
- - **Events:** downloaded, applied, confirmed, rolled back (timeout, relaunch, hang, failed check at start) and failed (download, file hash, disk, signature, manifest).
304
- - **When:** at the next launch or return to the foreground, 20 to a request. Events wait until the server takes them, at most 100.
305
- - **Identity:** a random install id that lasts as long as the install, not a device identifier, and nothing about the user.
306
- - **Store builds:** `bundle.json` names the address, so a server registering the binary can check it is its own.
307
-
308
- - ce817b6: `akan pack-update` records each pack in `<out>/pack.json`: app, target, platform, env, channel, app id and version, native API, web hash, file count and size. With `--against`, the record also carries the compatibility result. A pack that needs a new store build now exits 2 instead of 1, after writing `pack.json` and `compat.json`; any other failure exits 1 and leaves no `pack.json`. The same commit, env and target pack to the same bytes.
309
-
310
- That last guarantee needed an akanjs fix. A library's generated `getSerializedSignal` macro read every signal any other client in the build process had applied, so whether a lib's chunk carried the app's whole registry depended on Bun's transpiler cache. The macro and `FetchClient.from()` now read `ownSerializedSignal`, the signals a client was built with. Merged signals no longer keep keys set to `undefined`. Run `akan sync` to regenerate `lib/sig.ts`.
311
-
312
- Upgrade note: a CI step that took exit 1 from `akan pack-update --against` to mean "needs a new store build" checks for 2 now, since 1 is any other failure. Run `akan sync` once on every app and library, so its generated `lib/sig.ts` reads `ownSerializedSignal`.
313
-
314
- - ce817b6: An app's pipeline can ship its native web bundle over the air: `{ use: "ota", targets?, platforms? }` runs after `deploy` in its own `ota` phase, followed by an `after-ota` slot. It is opt-in, so an app without it runs build → docker → deploy as before. By default it packs every native target that declares `native.updates` for both iOS and Android, and a named target without `updates` is a plan error. The plan's step carries `with: { app, targets, platforms }`, and `akanjs/common` exports `pipelineOtaPlatforms` and the `PipelinePlanOtaStep` type. An executor parsing plans with an older `akanjs/common` refuses a plan that holds `ota`.
315
- - 8ba25ec: Data migrations: a change that reshapes stored documents ships a script in `apps/<app>/script/migration/`, which every environment runs the same way.
316
-
317
- - **`akan create-migration <name> <app>`** writes `script/migration/<yyyyMMddHHmm>_<name>.ts`, a default-exported `migration(title)` from `akanjs/server` with empty `.plan()`, `.apply()` and `.verify()` stages, which also takes `.param()`, `.rollback()` and `.config()`. A migration writes only through `table(refName)`, which records every value it changes.
318
- - **`akan migrate <app> [list|plan|apply|verify|rollback] [id]`** runs them locally, and `bun main.js ops migrate` takes the same arguments in a built image. `plan` prints a `planHash`, and `apply --expect <planHash>` refuses when the data changed since that plan was reviewed. `--json` prints the result as the last line, even when the command line itself is refused; the exit code is 0 on success, 2 when the command, a parameter or the id is wrong, 3 when verify finds problems (an apply's changes stay committed), and 1 otherwise.
319
- - **Runs are recorded in the app's own database** (`_akan_migration_run`, `_akan_migration_change`) under a lease, so one runs at a time; `db-export` and `db-import` carry them along, and no insight query can read them. `rollback` restores what an apply changed, deletes the rows it inserted or copied, skips a row edited since, and still works once the script is deleted, then with the default undo. `.config({ transaction: false })` commits as it goes, and a failed run is left `partial` to resume.
320
- - The generated `server.ts` exports a `migrations` manifest of that folder, and the `Err` lint rule leaves `script/migration/**` alone, since an operator reads its messages.
321
-
322
- - ce817b6: Apps declare their build pipeline in `akan.config.ts`. `pipeline: { stages, env, after }` in an app's config lists its stages in order — the built-in `{ use: "build" | "docker" | "deploy" }` actions plus shell stages (`{ name, sh | steps }` with `when`, `env`, `secrets`, `timeout`, `retry`, `allowFailure`) — and an app without one runs build → docker → deploy as before. A new workspace-root `akan.config.ts`, typed `WorkspaceConfig`, holds the stages around every app: `pipeline: { before, after, post, env, timeout }`, with `parallel` and `matrix: "apps"` stages. `akan pipeline dry-run | validate | plan` turns both into the plan Akan Cloud runs, locally and without running anything; it exits 0 with a plan, 1 with an envelope of errors and 2 for anything else. `akanjs/common` exports the plan schema and its strict parser (`PipelinePlanSchema`).
323
-
324
- `akan upload-secret <NAME>`, `akan list-secrets` and `akan remove-secret <NAME>` manage write-only pipeline secrets per project, optionally per branch (`--branch debug|develop|main`). A value comes from `--file`, piped stdin or a hidden prompt, never from an argument. A step lists the names it reads in `secrets`. Anyone who can push to the repository can make a step print a secret, as with GitHub Actions secrets.
325
-
326
- Upgrade note: `akan.subspace.ts` is no longer read. Move its content under `subspace` in the workspace-root `akan.config.ts` (`const config: WorkspaceConfig = { subspace: { … } }`). The root config never travels to a subspace.
327
-
328
- Upgrade note: delete `akan.subspace.ts` after moving its content. `akan subspace push` and `akan subspace pull` refuse while it is still at the workspace root, and a push removes any copy of it from the subspace.
329
-
330
- - ce817b6: `@akanjs/devkit/subspace` keeps the push and pull flow; its report text moved to `SubspaceReport` (`@akanjs/devkit/subspaceReport`) and its work on a subspace's clone to `SubspaceClone` (`@akanjs/devkit/subspaceClone`).
331
-
332
- Upgrade note: code that imported these from `@akanjs/devkit/subspace` reads them from the new modules:
333
-
334
- - `formatSubspaceStatuses`, `formatSubspacePushResults`, `formatSubspacePullResult`, `formatSubspaceEnvUpload` and `formatSubspaceDiff` are `SubspaceReport.statuses`, `.pushResults`, `.pullResult`, `.envUpload` and `.diff`.
335
- - `Subspace.anchorFile`, `memberDirs`, `subspaceOwnedDirs`, `secretsMarkers` and `holdDir` are static fields of `SubspaceClone`.
336
- - `Subspace.workspaceOnlyEntries` is gone; `Subspace.retiredConfigFile` names the file a subspace never receives.
337
-
338
- - ce817b6: `akan subspace plan <name>` prints what `akan subspace push` would ship, worked out from the checkout alone — no fetch, no remote, no clone: the apps and the libraries their closure pulls in, the file count, which workspace-root entries are pushed, excluded or left to the subspace's own copy, the root dependencies pruned from its manifest, and anything that would make a push refuse: a dirty working tree, a leftover root `akan.subspace.ts`, a branch outside `pushableBranches`, or a `bun.lock` resolving from a loopback registry, read from `HEAD` (`git show HEAD:bun.lock`) as a push reads it. It exits 1 when any of them is there. `--format json` prints the same as data. `akan subspace push` and `pull` also refuse while a root `akan.subspace.ts` exists.
339
- - ce817b6: `akan typecheck` takes a library too (`akan typecheck <lib>`: its `server.ts`, `client.ts`, `index.ts` and pages), and checks the target's own `*.test.ts` / `*.spec.ts` as well, which nothing imports and Bun runs unchecked; `--tests false` leaves them out, and a build's typecheck phase still does. Each mode keeps its own tsconfig and incremental cache under `.akan/typecheck`. Upgrade note: `akan typecheck` now checks tests and specs by default, so type errors they already had can fail a CI run that passed before; fix them, or pass `--tests false` for the old scope.
340
- - ce817b6: A desktop app's carried server takes `desktop.server: { env, restart, watchdog }`: variables over the image's (secret-named ones and the stage's own refused at build), `restart: "forever"` or a count of crashes before giving up, and a health-route watchdog that restarts a hung server. `desktop.webview2: "standalone"` embeds the whole WebView2 Runtime in the Windows setup. `updates.setChannel({ channel })` moves an installed desktop app to another manifest, and `akan publish-update --upload s3://<bucket>/<prefix>` uploads the release, its manifests last. Fixes: `Model.New` opens under its own `modal`; two `Model.New`s of one model on different slices open only the pressed one's form; the top inset slots clip at a 0 inset and follow iOS's keyboard pan; `Layout.BottomTab` matches tabs by segment with per-tab `exact` and `match`, keeps the badge under `renderTab` and marks the current tab `aria-current="page"`; a multipart mutation's other body args arrive typed as in a JSON body.
341
- - ce817b6: The workspace-root `akan.config.ts` takes `cloud: { host }`, the cloud the CLI uses when a command names no `--host`. This lets a workspace on a self-hosted Akan Cloud skip passing `--host` every time. It applies to login, env, secret, subspace and tunnel commands. The host must be https, or http on this computer.
342
-
343
- ### Patch Changes
344
-
345
- - b1165ba: `AKAN_BUILD_METAFILE=1 akan build <app>` writes the bundler's metafile for each backend entry (`main`, `server`, `rscWorker`, `console`) to `local/build-meta/<app>/<entry>.json`, which says which inputs put how many bytes into which output. Outside `dist/`, so an image never carries it, and off by default, since a server metafile is the size of its module graph.
346
- - bb71ed3: `akan build` bakes into its page and CSR bundles the `AKAN_PUBLIC_REPO_NAME` and `AKAN_PUBLIC_SERVE_DOMAIN` its Dockerfile carries, read from the workspace `.env` as `AKAN_PUBLIC_ENV` already was. A shell that exported a different value used to win in the bundles alone, so a cloud CSR bundle or native app dialed `<app>-<env>.<the shell's domain>` while the image served the `.env`'s. When the `.env` outranks a value the shell exported for one of the three, the build now says which ones and what it used (`AKAN_PUBLIC_ENV` from `--env` excepted).
347
- - 2082ccd: Akan.js now requires Bun 1.4.4: every package's `engines.bun` reads `>=1.4.4`. akan-native's doctor fails on an older Bun and warns on any other, with `bun upgrade --version 1.4.4` as the fix. Before 1.4.4, bun:sqlite counted the rows a full-text index's triggers wrote, so `updateManyByQuery` and `removeManyByQuery` on a model with search fields reported far more `matchedCount` and `modifiedCount` than the documents they changed.
348
-
349
- Upgrade note: 3.0.2 accepted Bun 1.4.0; run `bun upgrade --version 1.4.4` first.
350
-
351
- - 8ba25ec: A failed `akan typecheck` or `akan build` prints its diagnostics once, on stderr. The CLI's error handler printed them a second time on stdout, so anything reading both streams got every diagnostic twice.
352
- - ce817b6: CLI fixes:
353
-
354
- - **No prompt on a piped or closed stdin.** A missing argument, option, app, library, package or module fails at once with an error that names it. Before, the prompt read the piped input as its answer and printed it: `echo "$TOKEN" | akan upload-secret` without a NAME echoed the token into the log.
355
- - **`akan build`** bakes the build's own environment into the route and CSR bundles. That is the root `.env`'s `AKAN_PUBLIC_ENV` (`--env` on a desktop or mobile build): the same environment the server env plugin and the Dockerfile use. A shell `AKAN_PUBLIC_ENV` that named another one used to make SSR throw "env/env.server.<env>.ts is not in this build".
356
- - **A workspace on an older akanjs.** A workspace whose native API is older than 0.12.0 is refused with "install matching versions of akanjs and @akanjs/cli", instead of crashing on a missing function.
357
-
358
- Upgrade note: a CI step that relied on answering a prompt through stdin now fails fast; pass the argument on the command line.
359
-
360
- - ce817b6: Security: a server-side call to another server no longer carries the visitor's session. Server code answering a visitor's request used to send the visitor's `Authorization` header or auth cookie, and their `x-real-ip`, with every call it made, so a `fetch.clone({ origin })` toward another origin handed that server the visitor's token for this one. Now only a call to this server forwards them; a clone toward another origin, any clone of one, and a call given another `{ origin }` send only the client's own `jwt`, the one `fetch.clone({ jwt })` was given. Upgrade note: a server that relied on the forwarded session now receives a signed-out call; give the clone the token it should send (`fetch.clone({ origin, jwt })`).
361
- - ce817b6: `akan` cloud commands read `--host` and the root `cloud.host` the same way: as the URL's origin and path, with a trailing slash removed, so a trailing slash, an uppercase host or a default port no longer names a separate sign-in. Upgrade note: a login saved under a host spelled with a trailing slash, in uppercase or with `:443` is not found under the normalized spelling; run `akan login` once more.
362
- - 18f0bd8: Fixes from a CodeQL code-scanning and code-quality pass:
363
-
364
- - The `"use client"` check that the build runs on every module no longer backtracks exponentially on leading block comments (about 30 one-line comments hung the build), and it no longer reads `/* a */ x /* b */ "use client"` as a directive.
365
- - A package `exports` wildcard target with more than one `*` has every `*` replaced, as Node does, in the build's resolver and the barrel-imports plugin.
366
- - A tunnel agent ignores a gateway heartbeat outside 1 s to 5 min and keeps the 30 s default; Bun runs a NaN, negative or over-2^31 interval every millisecond.
367
- - The in-page agent's screen text prints no `data:` or `vbscript:` link, in any letter case, as it already printed no `javascript:` one.
368
- - A markdown link label or a mention label no longer spans a `[` or `@[` where another one starts: `[a [b](u)` links `b`.
369
- - `web_fetch` decodes `&amp;` last, so `&amp;lt;` reads as `&lt;`, and strips `</script >`-style end tags.
370
- - Native: `google_services.xml` escapes backslashes, a share refuses a `vbscript:` link, and the dev shim escapes `<`, `>`, U+2028 and U+2029 in the values it inlines.
371
- - `trimSlashes` and `trimTrailingSlashes` in `akanjs/common` trim in linear time; the framework's slash, email, translation and route-parsing regexes are now linear with the same results.
372
-
373
- - 9c87ed3: `akan lint` checks React's own hooks. Biome's `useHookAtTopLevel` runs on every `.tsx` under `apps/` and `libs/` except tests, and reports a `useState`, `useEffect` or other `use…` call behind a condition, in a loop or after an early `return`. The shared Biome config had it off, so such a call passed lint and broke the hook order only at runtime.
374
-
375
- `no-conditional-st-hook` judges an `st` hook by the nearest function around it. An `st` hook at the top of a component defined inside `useMemo` or picked by a module-level ternary passes, as does one in a `for` loop's initializer, which runs once. The rule now also reports an `st` hook in a default value, on the right of `||=`, `&&=` or `??=`, in the arguments of an optional call such as `props.format?.(st.use.x())`, written with computed access such as `st["use"].x()`, and in a render function passed by name, such as `renderList={renderList}`.
376
-
377
- Upgrade note: a workspace whose components call a React hook conditionally now fails `akan lint` until the hook moves to the top of the component.
378
-
379
- - 50afb48: A Tailwind class with a bracket nested inside its arbitrary part, such as `[[data-theme=light]_&]:block`, `has-[[aria-expanded=true]]:opacity-100`, `[&_[data-slot=x]]:p-2` or `[&:has([data-state=open])]:p-1`, now compiles. The source scanner cut each one at the inner `]`, so Tailwind never saw the class and its rule was left out of the built CSS without a warning. The candidate cache's version is bumped, so the scanner reads every file again on the next build instead of reusing the cut classes.
380
- - bd6f9e6: Dependency refresh for the published packages:
381
-
382
- - **React 19.3.1** (`react`, `react-dom`, `react-server-dom-webpack`), together with the 19.0.9 / 19.1.10 / 19.2.9 backports of the same day.
383
- - **Majors**: `chalk` 6, `commander` 15, `fontaine` 1, `firebase` 13 (optional peer), `happy-dom` / `@happy-dom/global-registrator` 21 (optional peers; CSS and iframe loading are now off by default).
384
- - **Minors and patches**: `lexical` and every `@lexical/*` 0.52, `typebox` 1.3.37, `@biomejs/biome` 2.5.14, `@inquirer/prompts`, `@tailwindcss/node` / `tailwindcss` 4.3.3, `dayjs`, `immer`, `ignore`, `ora`, `string-width`, `subset-font`, `tailwind-merge`, `tailwind-variants`, `protobufjs`, `react-icons`, `@react-spring/web`, `@playwright/test`, `@types/bun`, and `bullmq` / `ioredis` to their latest 5.x.
385
-
386
- Held back on purpose: `typescript` 7 (no compiler API, which devkit's scanners and transforms need), `ink` 7/8 (drop bracketed-paste markers and mouse reports from `useInput`, which `akan code`'s paste and wheel scrolling read), `ioredis` 6 (RESP3 by default) and `bullmq` 6 (backend rewrite), which need the conformance suite against real Redis, and `@biomejs/biome` 2.5.15 (reports `Object.keys(…).sort()` and other string sorts under `useArraySortCompare`).
387
-
388
- Upgrade note: a workspace pins `react` / `react-dom` to `19.3.1` to match the `akanjs` peer range.
389
-
390
- - d9cfc2d: `akan subspace push` keeps whatever root `Jenkinsfile` and `akan.config.ts` a subspace has, a `Jenkinsfile` an earlier push left there included, and never delivers the workspace's.
391
-
392
- `akan build` reads the workspace `.env` as Bun's own loader does: an unquoted value ends at its first `#`, and a quoted one at its closing quote. An inline comment used to stay in the value, so `AKAN_PUBLIC_SERVE_DOMAIN=example.com # prod domain` reached the app's domains and its Dockerfile, whose `ENV` line Docker refused (`can't find = in "#"`). The image, its bundles and its domains now take `example.com`.
393
-
394
- Upgrade note: a subspace no longer receives the workspace's `Jenkinsfile`, which 3.0.2 pushed into every subspace. The copy an earlier push left becomes the subspace's own, so change it there. Quote a `.env` value that holds a `#`, as Bun's own loader already required.
395
-
396
- - ce817b6: An external view shows `native.backgroundColor` until its page's first frame, and a Windows app's executable names the app as its company when `desktop.publisher` is unset instead of keeping Bun's own ("Oven"), which Explorer and Windows Firewall's prompt showed.
397
- - 9ee3a60: Guideline text (`akan guideline show <name>`, MCP `get_guideline`) catches up with 3.1.0:
398
-
399
- - `workspaceOnboarding`, `conventions` and `ssrRule` gate a signed-in layout with `.guard(() => signedIn())` from `@libs/shared/webkit`, which a new workspace has only with `create-workspace --libs true`. `ssrRule` says a crawler gets a late redirect as a real 3xx.
400
- - `queryRule` and `workspaceRecipes` count `purge<Filter>` among a filter's methods, and `queryRule` says which queries a purge refuses.
401
- - `workspaceRecipes` and the `akan-store` skill list `invalidate<Model>()`, and the `workspaceRecipes` page sample no longer awaits its view.
402
- - `transportRule` adds a 408 and a 409 `idempotencyInFlight` to what `retry` retries.
403
- - `modelDocument` points search at a `text` role rather than a `"text"` index.
404
- - `runtimeRule` says an edge server starts with `/mcp` off and that `operationMode` scopes whole modules.
405
- - `workspaceOnboarding` says only `--sign true` code-signs a `publish-update` release.
406
- - `conventions`, `runtimeRule` and the READMEs name Bun 1.4.4, and the `mcp`, `apps` and `modern` server options describe the edge default and MCP Apps as shipped.
407
-
408
- - ce817b6: Windows desktop apps:
409
- - An uninstall no longer leaves the app's exe behind when a watchdog starts the app again meanwhile. The stop step kills whatever starts from the folder until nothing runs, and deletes the exe in that same pass.
410
- - A setup no longer fails when a watchdog starts the app again between the stop and the folder swap. The stop step moves the install folder to `<folder>.setup-old` in the pass that finds nothing running; the setup then checks the unpacked files and moves the folder back when they are incomplete, before the second rename puts the new files in place.
411
- - A setup run with `/S` shows no "Verifying installer" window over a kiosk. NSIS shows it whatever `/S` says, so the setup no longer CRC-checks itself.
412
- - Two launches from different kinds of session no longer both run as the first instance. Before, a launch from an SSH or service-started session and one from the desktop each started their own server on the same data, because the single-instance pipe name hashed USERDOMAIN, which differs between those sessions. The pipe name now comes from the account SID in the process token, read through `bun:ffi`, and from the profile folder only where the token cannot be read. A running instance of the older build is not found across the upgrade, but the setup stops it first anyway.
413
- - A gate plugin is waited for up to 30 s, not 3, so a slow single-instance check can no longer let a second launch start its server before it exits.
414
- - The launch phase's own deadline, on every desktop OS, is 45 s, the gate, setup and ready waits added up, where it was 18 s, so a launch whose gate is still deciding is no longer ended early.
415
- - A setup's or uninstall's stop step that hangs is ended after a minute and counts as a failed stop. A setup then reports the app in use, where before it waited as long as the stop did.
416
- - The running instance logs one line when another launch hands over to it, with the argument count only, so a launch with no console of its own still leaves a trace.
417
- - ce817b6: `native.backgroundColor` (one color or `{ light, dark }`) is what a native window shows before its page paints, and the splash's default, so a dark screen no longer flashes white. `native.desktop.publisher` names a Windows app's publisher in Apps & features, in its setup program and in its executable. On Windows, `window.setCursorVisible(false)` hides the pointer over the window's external views too, in every document they load, until it is shown again.
418
- - 645b859: A native plugin's `ios.sources` and `android.sources` accept the extglob forms Bun 1.4.4's glob added: `!(…)`, `@(…)` and `+(…)` (for example `ios/!(Preview).swift`). They used to be read as one literal file name and failed the build with "source … not found". `?(…)`, `*(…)` and brace ranges such as `{1..3}` already reached the glob.
419
- - def5a20: Every native build and update pack records the `AKAN_PUBLIC_*` values its web bundle inlined in `bundle.json` as `web.publicEnv`, with a `web.publicEnvHash`; `pack.json` carries the hash too. Keys `akan.config.ts` derives are left out. A target with `updates` refuses a value an update could not carry: a key naming a secret, a non-string, a control character, or more than 256 keys or 64 KiB.
420
-
421
- `--public-env <file>` on `release-ios`, `release-android`, `pack-update`, `push-update` and `register-binary` builds the web bundle with exactly those values, taken from a JSON map or a store build's `bundle.json`; the shell's and `.env`'s other `AKAN_PUBLIC_*` are dropped. `pack-update --against` repeats what that store build recorded, and a pack whose values differ needs a new store build (exit 2). `register-binary` repeats what the store build recorded.
422
-
423
- - ce817b6: Native app fixes:
424
-
425
- - **Desktop updates keep the installed app's signer.**
426
- - On macOS, an app signed with a Developer ID team refuses a downloaded release that the same team did not sign.
427
- - On Windows, an app whose exe has a valid Authenticode signature refuses a release whose exe isn't signed by the same subject. The check runs in PowerShell, Constrained Language Mode included. Where AppLocker, SRP or WDAC keeps PowerShell from running, a signed app refuses every release, since none can be checked; update such PCs with the installer.
428
- - An ad hoc or unsigned installed app takes releases as before.
429
- - A refused release is recorded as failed (`NOT_ALLOWED`) and is not offered again.
430
- - **Phone web updates packed on Windows** (`akan pack-update`, `akan-native update publish`) list the files in subfolders with `/`. They listed them with `\`, which phones refuse, and their web hash now matches a store build made on another OS.
431
- - **iOS:** a pending web bundle becomes the trial when the first window asks for its page, not at launch. A silent push that launches the app in the background no longer starts a trial that the next launch rolls back as `relaunch`.
432
- - **Android:**
433
- - A destroyed activity's ready timer no longer fires after `recreate()` and rolls back the trial its new activity runs.
434
- - A downloaded web bundle can no longer be pruned between its move into place and its staging.
435
-
436
- Upgrade note: build every desktop release the way the installed app was signed, with `--sign` and the same `AKAN_NATIVE_MACOS_*` / `AKAN_NATIVE_WINDOWS_*` identity. A signed installed app now refuses an unsigned or differently signed release, so republish that release signed.
437
-
438
- - ce817b6: `router.push` / `router.replace` take `{ shallow: true }`: on an SSR page a query-only change writes the URL and the store without asking the server for the page, and back/forward between such entries stays shallow. `Tooltip` draws on the overlay layer and flips to the side with room, so it no longer clips inside a scrolling list or widens it. An SSR document links `rootLayout().manifest()` at `/manifest.webmanifest` (the basePath's own when it is visible), which the server answers, instead of a `data:` URL. An input smaller than 16px is drawn at 16px on a touch screen, where iOS would zoom into it, and a caller's own `text-*` still sets its size. `BottomSheet` reports a dismissal once and never on mount, locks the page while open, pads for the safe area, and opens on the overlay layer above the frame. Upgrade note: `Tooltip`'s bubble is no longer in the DOM until it opens; a test that read it beside its trigger reads the trigger's own text instead.
439
- - 07b8248: A new lint rule, `no-conditional-st-hook`, runs on every `.tsx` under `apps/` and `libs/`. It reports an `st` hook that does not run on every render:
440
-
441
- - The hooks it checks are `st.use.*`, `st.slice.<name>.use.*`, `st.sel`, `st.ref`, and the last step of `st.tool(…)` (`.exec` / `.card`), `st.useState(…)` (`.init`) and `st.expose(…)` (`.value`).
442
- - It reports them on the right of `||`, `&&` or `??`, in a ternary branch, an `if` / `else` body, a `switch` case, a loop or a `catch` block, and in a callback that a component hands to a call or a JSX prop.
443
-
444
- Biome's `useHookAtTopLevel` cannot see these hooks, because their names do not start with `use`. A skipped call shifts every later hook by one slot, and production React does not check the order. A later `useRef` then gets another hook's frozen store value, and the screen crashes with "Cannot add property current, object is not extensible".
445
-
446
- The fix is to read each hook into its own `const` at the top of the component, then combine the values.
447
-
448
- The rule does not report a hook after an early `return`, or one inside a local helper the component calls.
449
-
450
- Upgrade note: `akan lint` now fails on these call sites. One common case is a hook inside `Load.Units`' `renderList`. `Load.Units` calls it only while the list is non-empty, or when `renderEmpty={false}`. Move the hook into the component that renders `Load.Units`.
451
-
452
- - ce817b6: A server env profile build (`akan build --profile <p>`, `native.desktop.server.profile`) swaps each lib's env defaults as it swaps the app's: for the lib's `env/env.server.testing.<p>.ts`, which the build refuses when a secret-named key holds a value, or for the defaults with every secret-named value left out, named in a build warning. A secret name is one `Logger.isSecretKey` masks, and everything under such a key counts, so an `iapVerify` or service-account block is left out whole; under any key, a URL holding a password or a secret-named query parameter is a secret too. A profile file that imports the file it replaces is refused, and so is a lib default a JSON snapshot cannot hold (a function, `Map`, `Set`, `Date`, class instance, bigint or non-finite number) unless the lib has a profile file.
453
-
454
- Upgrade note: a desktop app that carries its server is refused a release build or `publish-update`, signed or not, while that server's bundle holds a secret value of the workspace's server env files; build its server with a profile (`native.desktop.server.profile`).
455
-
456
- - 2c5b833: `LibsqlDatabase` is removed, along with the `@libsql/client` optional peer dependency, `LibsqlDatabaseConfig`, the `database.libsql` server env and the `LIBSQL_URL` / `LIBSQL_URI` / `LIBSQL_AUTH_TOKEN` variables. No database mode used it: `single` and `multiple` run on `SqliteDatabase`, `cluster` on `PostgresDatabase`. Upgrade note: an app that applied `LibsqlDatabase` itself moves to `SqliteDatabase` for a local file or to `cluster` mode for a shared server.
457
- - 6b5646e: - The akan CLI runs in a workspace with no root `.env`: the workspace root is the folder with `package.json`, `tsconfig.json` and an `apps/`, `libs/` or `pkgs/` folder. Unset, `AKAN_PUBLIC_REPO_NAME` falls back to the origin remote's name and `AKAN_PUBLIC_SERVE_DOMAIN` to `localhost`; `akan build` and the redis/postgres tunnels refuse either fallback for any environment but `local`.
458
- - The theme contrast check reads every theme block. It used to read every other block, and none after an `@source` line, so on the framework stylesheet it checked only the light theme. `akan lint` may now report contrast failures in a `:root` or dark theme that were always there.
459
- - `declaredCustomProperties` skips a whole `@theme` block, nested `@keyframes` included, and ignores tokens inside comments. Theme CSS and the generated `useClient.ts` are parsed in linear time.
460
- - `akan agent install` writes an `AGENTS.md` about 60% smaller: the conventions guideline keeps the rules and points at the on-demand guidelines for the detail, and a new `pageRule` guideline covers routing.
461
- - 5914378: A `.loading()` on a layout that sits at a root boundary — `(group)/_layout.tsx`, or `(group)/<segment>/_layout.tsx` such as `(docs)/docs/_layout.tsx` — now reaches the route's Suspense boundaries. The generated wrapper that takes that layout's place in the route stack re-exported `NotFound`, `Error` and `pageConfig` but not `Loading`, so the stage was dropped silently: a streamed render flushed the shell around an empty content area, painting the footer directly under the header until the page arrived.
462
- - ee190b9: On Windows, a generated root layout named its layout files with backslashes, as in `page\_layout.tsx`. The names appear in the route-convention errors that `resolveRouteModule` and `assertGuardOnChain` throw. They now use `/` on every OS (`page/_layout.tsx`), so the generated file reads the same everywhere.
463
- - ce817b6: `rootLayout().viewport({ fitCover, interactiveWidget, themeColor })` writes the document's `viewport` and `theme-color` meta, on the server and in the CSR shell; a native app draws under the notch by default, and a per-theme `themeColor` follows a theme switch. Route heads now merge root first: a deeper `.head()` replaces the `<title>`, a `<meta>` with the same `name` or `property`, and a canonical, manifest or icon link, and keeps the rest. Upgrade note: a page that restated its root's manifest, icon or theme tags can drop them, and an ancestor's head now renders under every page that writes its own.
464
- - 17aa243: A route can check who may open it before anything on it renders. `rootLayout()`, `layout()` and `page()` take a `.guard(fn)` stage, declared at most once per route. It receives the route's typed arguments and `lang` (a layout's guard gets no `children`). It refuses with `router.redirect()` or `router.notFound()`, or with `getSelf({ unauthorize })` from a guard. The new `signedIn()` helper in `libs/shared/webkit` does the last of these.
465
-
466
- - **Server render.** Every guard in the chain runs in order before any layout body starts, root layout first, and before the route's arguments are checked. A redirect after an awaited query is now a real 307, and a not-found is a 404. Before this, a refusal raised inside a layout body after I/O arrived as a late, in-stream redirect. A query inside a guard that the server refuses with 403 or 404 (an owner check, for example) answers not-found, so the page does not tell anyone the record exists.
467
- - **Client navigation.** A page's layers wait for its guards. Their verdict is kept by what the guards read, so a move that changes only a query no guard reads keeps it. It lasts while a layer of that location is on screen. Only the page in front asks: a parked page, or the one under the current page during a swipe back, asks nothing. Back in front, a cached page included, it asks again in the background while what it drew stays; a refusal moves the router and blanks it, and a failure shows as a failed render. A legacy page keeps the props it was let in with while a new location is checked. A guard that moves the router ends the chain, and the page draws nothing. A refused or failed check runs again when its layer is retried. Root layouts are drawn once for every page and are not gated themselves, but their guards still run in each page's chain, and a legacy page under them waits for them too.
468
- - **A refusal shows nothing of what it refused.** The not-found page that a guard's `router.notFound()` answers is drawn under the layouts above the refusing guard only, with no route head; a guard that throws a string is cut the same way. A path no page matches asks the guards of the layouts its not-found would be drawn under first: a redirect answers as one, and a refusal keeps only the layouts above it.
469
- - **`guard` is a stage only.** A legacy module (a default function beside named exports) that exports `guard` fails to load and fails `akan build`, a legacy root layout included.
470
- - **MCP.** A page prompt runs its route's guards before its bodies, so a refusal ends the prompt as a redirect or a not-found. `prompts/list` and the app tools in `tools/list` show only the screens whose guards admit the caller. In a listing, no arguments are known yet: a guard that reads one counts as admitting the caller there, and is checked again when the prompt or tool is called. If the guards do not answer within the list wait, the list is served unfiltered, and the calls are still checked. `resources/list` shows a UI host only the views of the apps it may call. A caller's listing verdict is kept for 5 seconds, so a host that lists tools, prompts and resources in a row runs the guards once.
471
-
472
- A generated root layout passes the user layout's guard through. When there is no ancestor root, it composes the app root's guard and the user layout's guard with the new `RouteGuards.compose`.
473
-
474
- - 63479ae: The files `akan page` writes, and those of the app and library component and scalar scaffolds, now pass `biome check` as written, instead of starting with a blank line and leaving imports unsorted. The CRUD page scaffolds and the sample app's task pages hand each `fetch.init*` / `view*` / `edit*` result to its section unawaited, so the page shell is sent first and each section fills in behind its own boundary, and the single-page CRUD scaffold gives `Model.New` a `trigger` instead of a `className` it does not take. The conventions guideline's page body rule says the same: await only what the shell reads, through one `Promise.all`. Scaffolds (`akan create-*`, `akan page`, workspace and package templates) format only the files they wrote: an existing file they left alone is no longer reformatted.
475
- - ce817b6: The refusal a desktop build gives when its server bundle holds an env secret names the bundle file and the env file with `/` on every OS, as the rest of akan's messages do, instead of `apps\demo\env\…` on Windows.
476
- - 576df96: An MCP App view or CSR shell that draws `@lexical/code-prism` under a `lazy()` component no longer fails with `ReferenceError: Prism is not defined` (a host shows "The page failed to load."). These single-file bundles don't split, and Bun (1.4.4 included) runs a module that only an `import()` reaches with its ESM imports ahead of its CommonJS ones, whatever their order, so the Prism language files ran before the `prismjs` they extend. A vendor module's bare import of a module that may run late now goes through a shim that imports the same specifier, so it runs where it is written. ES module targets and packages that declare `sideEffects` are left to the bundler, so a bundle changes by the shims alone.
477
- - b56d305: The generated barrels (`cnst`, `db`, `dict`, `sig`, `st`, and the facet indexes) list modules in name order instead of the order the filesystem returns them, so two machines building the same commit produce the same CSR bundle. A store action or state key that two stores both define was decided by that order; it is now decided by module name.
478
- - ce817b6: `akan subspace push` and `akan subspace plan` name the setting behind a refused branch: `` Branch "x" is not pushable. `subspace.pushableBranches` in the workspace root akan.config.ts allows: main, develop, debug ``. The message used to say only where the subspace settings live.
479
- - ce817b6: `fetch.clone({ retry })` and a call's `{ retry, idempotencyKey }` retry an unreachable server, a 502/503/504 and a 429 after its Retry-After on a jittered backoff, within the call's one deadline; a mutation retries under one `Idempotency-Key`, and the server runs a mutation once per key, caller and arguments, answering a repeat with the first result (409 `base.error.idempotencyInFlight` while it runs) — a signed-out call, or one whose handler returns a `Response`, runs every time. The websocket client reconnects on a jittered exponential backoff (`ws: { reconnect, headers, tls, onStateChange, onRevoked, onError }`), sends a server-side client's token with the upgrade, numbers each room's frames, drops a repeat and calls `onResync` at a hole, and a resubscribe gets the frames it missed since its own subscribe replayed by a solo server on the built-in pub/sub (a Redis-backed or custom adaptor, and a `pubsub(Binary)` room, resync instead). `Model.upsertById(data, { preserveTimestamps })` writes a record under its own id with no hook. An insight field sums with `accumulate: { $sum: "<field>", ...condition }`. A `process` job's backoff takes `maxDelay` and its internal an `onFailed` dead-letter hook. Fixes: a live slice's `.live({ payload: "id" })` reaches its rooms; Tailwind v4's `top-(--x)` shorthand compiles; the root layout's manifest link is in the document head, where Chromium reads it.
480
- - Updated dependencies [4fc3902]
481
- - Updated dependencies [ce817b6]
482
- - Updated dependencies [ed26089]
483
- - Updated dependencies [8aaa0c6]
484
- - Updated dependencies [ce817b6]
485
- - Updated dependencies [b1165ba]
486
- - Updated dependencies [2082ccd]
487
- - Updated dependencies [1c577db]
488
- - Updated dependencies [ce817b6]
489
- - Updated dependencies [7cb97fa]
490
- - Updated dependencies [1dd54bf]
491
- - Updated dependencies [78e785e]
492
- - Updated dependencies [63479ae]
493
- - Updated dependencies [a597881]
494
- - Updated dependencies [ce817b6]
495
- - Updated dependencies [ce817b6]
496
- - Updated dependencies [63479ae]
497
- - Updated dependencies [ce817b6]
498
- - Updated dependencies [18f0bd8]
499
- - Updated dependencies [b1165ba]
500
- - Updated dependencies [63479ae]
501
- - Updated dependencies [bea9eb7]
502
- - Updated dependencies [ce817b6]
503
- - Updated dependencies [a6577eb]
504
- - Updated dependencies [297f437]
505
- - Updated dependencies [531ab68]
506
- - Updated dependencies [8bf9f8e]
507
- - Updated dependencies [bd6f9e6]
508
- - Updated dependencies [ce817b6]
509
- - Updated dependencies [ce817b6]
510
- - Updated dependencies [2c5b833]
511
- - Updated dependencies [ce817b6]
512
- - Updated dependencies [ce817b6]
513
- - Updated dependencies [ce817b6]
514
- - Updated dependencies [77411ef]
515
- - Updated dependencies [70ebbb4]
516
- - Updated dependencies [ea39ba0]
517
- - Updated dependencies [b1165ba]
518
- - Updated dependencies [ce817b6]
519
- - Updated dependencies [ce817b6]
520
- - Updated dependencies [ce817b6]
521
- - Updated dependencies [ce817b6]
522
- - Updated dependencies [b1165ba]
523
- - Updated dependencies [ce817b6]
524
- - Updated dependencies [ce817b6]
525
- - Updated dependencies [ce817b6]
526
- - Updated dependencies [b1165ba]
527
- - Updated dependencies [9ee3a60]
528
- - Updated dependencies [ce817b6]
529
- - Updated dependencies [ce817b6]
530
- - Updated dependencies [6294981]
531
- - Updated dependencies [113fab2]
532
- - Updated dependencies [ce817b6]
533
- - Updated dependencies [2cb9c0f]
534
- - Updated dependencies [ee01a4c]
535
- - Updated dependencies [ce817b6]
536
- - Updated dependencies [ce817b6]
537
- - Updated dependencies [b1165ba]
538
- - Updated dependencies [ce817b6]
539
- - Updated dependencies [0c1f96b]
540
- - Updated dependencies [658e59a]
541
- - Updated dependencies [5a94516]
542
- - Updated dependencies [509ba6f]
543
- - Updated dependencies [ce817b6]
544
- - Updated dependencies [b1165ba]
545
- - Updated dependencies [f6b70d8]
546
- - Updated dependencies [17aa243]
547
- - Updated dependencies [ce817b6]
548
- - Updated dependencies [3e275c2]
549
- - Updated dependencies [7b8c6c7]
550
- - Updated dependencies [63479ae]
551
- - Updated dependencies [50afb48]
552
- - Updated dependencies [4ed48d0]
553
- - Updated dependencies [63479ae]
554
- - Updated dependencies [ce817b6]
555
- - Updated dependencies [ce817b6]
556
- - Updated dependencies [e200ce1]
557
- - Updated dependencies [fe1e27d]
558
- - Updated dependencies [ce817b6]
559
- - Updated dependencies [f949da0]
560
- - Updated dependencies [ce817b6]
561
- - Updated dependencies [b1165ba]
562
- - Updated dependencies [9bf9181]
563
- - Updated dependencies [ce817b6]
564
- - Updated dependencies [ce817b6]
565
- - Updated dependencies [ce817b6]
566
- - Updated dependencies [ce817b6]
567
- - Updated dependencies [ce817b6]
568
- - Updated dependencies [ac753ff]
569
- - Updated dependencies [ce817b6]
570
- - Updated dependencies [17aa243]
571
- - Updated dependencies [6e5a402]
572
- - Updated dependencies [3b7e57d]
573
- - Updated dependencies [ce817b6]
574
- - Updated dependencies [1324d30]
575
- - Updated dependencies [329bd79]
576
- - Updated dependencies [2c5b833]
577
- - Updated dependencies [ce817b6]
578
- - Updated dependencies [c184074]
579
- - Updated dependencies [6b5646e]
580
- - Updated dependencies [ce817b6]
581
- - Updated dependencies [17aa243]
582
- - Updated dependencies [2c5b833]
583
- - Updated dependencies [6183f95]
584
- - Updated dependencies [8201174]
585
- - Updated dependencies [ce817b6]
586
- - Updated dependencies [fd52c2c]
587
- - Updated dependencies [8ba25ec]
588
- - Updated dependencies [ce817b6]
589
- - Updated dependencies [bb7a8cd]
590
- - Updated dependencies [f5c1f70]
591
- - Updated dependencies [b1165ba]
592
- - Updated dependencies [b7e969e]
593
- - Updated dependencies [471665c]
594
- - Updated dependencies [92a62ca]
595
- - Updated dependencies [6dabbf8]
596
- - Updated dependencies [b1165ba]
597
- - Updated dependencies [ce817b6]
598
- - Updated dependencies [181789d]
599
- - Updated dependencies [a1b32c7]
600
- - Updated dependencies [ca888e7]
601
- - Updated dependencies [63479ae]
602
- - Updated dependencies [ce817b6]
603
- - Updated dependencies [ce817b6]
604
- - Updated dependencies [587d530]
605
- - Updated dependencies [ce817b6]
606
- - Updated dependencies [b1165ba]
607
- - Updated dependencies [00e39db]
608
- - Updated dependencies [cebac7d]
609
- - akanjs@3.1.0
610
-
611
- ## 3.0.2
612
-
613
- ### Minor Changes
614
-
615
- - be8ed50: New lint rules: `no-unguarded-endpoint` warns on an endpoint, named slice or root slice that declares no guards, and `no-double-brace-placeholder` refuses `{{name}}` in a dictionary error/translate entry. `no-throw-raw-error` also warns on a raw `Error` constructed without `throw`, and `no-inline-color` warns on color literals in SVG color attributes and `el.style` writes.
616
- - af66669: Native builds moved from `apps/<app>/.akan/native/<target>` to `dist/native/<app>/<target>` (`build/<platform>`, `dev/<platform>`, `web`, `bin`, `updates`). It sits outside `dist/apps/<app>`, which every `akan build` empties, so a signed release waiting for upload survives the next build. Upload what is waiting in an old `.akan/native/<target>/updates` and delete the folder: `akan start` keeps it and warns until then. A CI step that collects installers reads `dist/native/<app>/*/build/*/` now, and `pack-update`'s default output is `dist/native/<app>/<target>/updates/<platform>`.
617
- - af66669: The macOS dmg `build-desktop --installer true` makes opens on a drag-to-Applications window: no toolbar, sidebar or status bar, 128 pt icons of the app and the Applications link on a background with an arrow between them (1x and 2x in one multi-resolution TIFF), and the app's icon on the mounted disk (`.VolumeIcon.icns`). Its own files (`.background`, `.VolumeIcon.icns`, `.DS_Store`, `.fseventsd`) are hidden. The window is a `.DS_Store` written directly while a read-write image is mounted, never through Finder or AppleScript, so a headless CI builds the same image; the compressed image is made afterwards and is what gets signed, notarized and stapled. `native.desktop.dmg` (a target's too) replaces the background (`background`, `background2x`, or `false`) and moves the window and the icons (`window`, `iconSize`, `textSize`, `app`, `applications`, in points); the default background lines up with the default positions only.
618
- - be8ed50: `akan sync` prunes a root-declared dependency nothing imports and realigns every root-declared entry to the root's version; `package.json#akan.keepDependencies`, `externalLibs` and `trustedDependencies` are always kept. `akan install-library` keeps the root's versions and only adds what the root lacks.
619
-
620
- ### Patch Changes
621
-
622
- - af66669: `akan build-desktop` builds for this computer's CPU without asking; `--arch arm64|x64` picks another one. Any CLI option declared both `enum` and `nullable` is now `null` when left out instead of prompting for one of its choices.
623
- - af66669: Upgrading may stop `akan sync` (and every command that runs it, `build-desktop` included) with a scan-convention error on a hand-written `index.tsx`, `index.jsx` or `index.mts` at the root of `ui/`, `webkit/`, `srvkit/`, `common/` or `plugin/`. Bun loads that file ahead of the generated `index.ts` while TypeScript checks `index.ts`, so a name only the generated barrel exports typechecks and is undefined at runtime. Delete the file: the generated barrel re-exports every file and folder of the facet. A namespace it built belongs in `<facet>/<Folder>/index.tsx`, which the check leaves alone.
624
- - be8ed50: Generated barrels, module indexes and `akan.*.json` are written exactly as Biome prints them, so `akan lint --no-fix` passes right after a sync.
625
- - af66669: A native build's `--env` reaches its CSR bundle. The CSR builds passed `env: "AKAN_PUBLIC_*"` to `Bun.build`, which inlines the `.env` Bun read when the process started and ranks it above `define`, so `build-desktop --env debug` shipped the root `.env`'s `AKAN_PUBLIC_ENV=local` and called `http://localhost:8282`, and `akan build` baked back the operation mode and ports it had just dropped. Every `AKAN_PUBLIC_*` now comes from `process.env` through `define` alone, and `akan build` drops `AKAN_PUBLIC_CLIENT_PORT` / `AKAN_PUBLIC_SERVER_PORT` from `process.env` as well, so a port in `.env` is no longer baked in.
626
- - af66669: A Linux desktop app's window is named after its app id (X11 `WM_CLASS`, Wayland `app_id`), so a dock or task bar finds its `<app id>.desktop` and shows that entry's name and icon instead of a generic one; the dock plugin's badge and progress name the same entry. The AppImage `build-desktop --installer true` makes carries `<app id>.desktop` with `StartupWMClass=<app id>` and `<app id>.png`, so the entry AppImageLauncher or appimaged installs under another file name still matches the window. The hidden entry that handles the app's deep links now shows the app's icon (installed as `~/.local/share/icons/hicolor/256x256/apps/<app id>.png`), and from an AppImage it starts the AppImage itself (`$APPIMAGE`) rather than the mount point it ran from, which is gone once the app quits, so a link opened after quitting the app no longer fails.
627
- - af66669: A `--env local` release build (`build-*`, `release-*`, `start-* --release true`, `publish-update`) calls the app's own dev server: its `env.runtime.json` names `PUBLIC_AKAN_SERVER_URL=http://localhost:<dev port>`, the port `akan start` gives the app (`AKAN_DEV_PORT`, else its place among the apps). Before, it always called 8282, which in a workspace with several apps is another app or nothing. A target that carries its server keeps the URL its server hands the page at launch, and an `AKAN_PUBLIC_SERVER_URL` the bundle was built with still wins.
628
- - be8ed50: `akan quality scan` no longer flags a non-exported interface or type declared beside a class.
629
- - 73a81da: Let non-local single database mode development servers continue when the Redis SSH tunnel is unavailable, warning with the SSH target and underlying connection errors and setting an explicitly unavailable Redis host instead of falling back to a local Redis instance. Working tunnels remain available to custom Redis adaptors, while multiple and cluster modes still require Redis and local development remains unchanged.
630
- - Updated dependencies [be8ed50]
631
- - Updated dependencies [af66669]
632
- - Updated dependencies [be8ed50]
633
- - Updated dependencies [be8ed50]
634
- - Updated dependencies [be8ed50]
635
- - Updated dependencies [be8ed50]
636
- - Updated dependencies [be8ed50]
637
- - Updated dependencies [be8ed50]
638
- - Updated dependencies [af66669]
639
- - Updated dependencies [af66669]
640
- - Updated dependencies [bd55713]
641
- - Updated dependencies [be8ed50]
642
- - Updated dependencies [be8ed50]
643
- - Updated dependencies [be8ed50]
644
- - Updated dependencies [be8ed50]
645
- - Updated dependencies [a789952]
646
- - Updated dependencies [be8ed50]
647
- - Updated dependencies [be8ed50]
648
- - akanjs@3.1.0
649
-
650
- ## 3.0.1
651
-
652
- ### Minor Changes
653
-
654
- - 4871ae5: New lint rule `no-static-in-object-light-model` for `*.constant.ts`: a `static` on an `XObject` or `LightX` class is an error. The full model `via(XObject, LightX, …)` mixes in their prototypes only, so such a static never reaches `X`; declare it on `XInput` (or a scalar), `X`, or `XInsight` instead.
655
-
656
- ### Patch Changes
657
-
658
- - Updated dependencies [4871ae5]
659
- - Updated dependencies [4871ae5]
660
- - Updated dependencies [4871ae5]
661
- - akanjs@3.1.0
662
-
663
- ## 3.0.0
664
-
665
- ### Minor Changes
666
-
667
- - ccf2ae2: A CSR dev page — `?csr=true`, `/__csr`, and every native dev build — updates in place on save instead of reloading.
668
-
669
- - `akan start` serves the CSR page as a module registry: each module is its own factory, and a save sends only the
670
- modules it changed. A component edit keeps hook and DOM state (React Fast Refresh), a store edit keeps the store,
671
- and a build error shows the overlay and recovers without a reload.
672
- - A page or layout edit swaps that route in place through `replacePages`: the page stack, history and stores stay,
673
- and so does the state of the components under the edited page or layout. A `*.constant.ts`, an added or removed
674
- route, a new npm dependency or a signal/dictionary change still reloads.
675
- - `AKAN_DEV_CSR=artifact` brings back the single-file dev bundle, which reloads on every save. `akan build` and a
676
- release mobile build are unchanged.
677
- - HMR sockets now say what they are: a CSR page connects as `/_akan/hmr?client=csr` and gets `csr-update` instead of
678
- the SSR `reload` and `rsc-refresh`, and a page that missed an update while disconnected reloads
679
- when it reconnects.
680
-
681
- - ccf2ae2: A Windows desktop app can share its screen without the picker
682
-
683
- `native.desktop.screenCapture: "auto"` in `akan.config.ts`, or `desktop.screenCapture` on one target, makes the
684
- Windows app answer the page's `getDisplayMedia()` with the first screen at once, without the picker and without a user
685
- gesture, for remote support on a screen nobody attends. It is Chromium's switch for automated media tests and covers
686
- every media request, so leave it off in an app whose pages ask for a camera or a microphone. The default `"picker"`
687
- keeps the picker; macOS and Linux ignore it.
688
-
689
- - ccf2ae2: `akan build-desktop --installer` makes a Windows setup program
690
-
691
- On Windows the build adds `<file>-<version>-<arch>-setup.exe`, made with NSIS (`winget install NSIS.NSIS`). It installs
692
- for the current user under `%LOCALAPPDATA%\Programs\<app name>`, where the updates plugin swaps the app without an
693
- administrator, with a Start menu shortcut and an uninstall entry. `/S` installs silently and `/RUN` starts the app
694
- afterwards, and a PC without the WebView2 Runtime gets it. The program is not code-signed yet.
695
-
696
- - What can fail without touching the installed app comes first: WebView2, then the new files, unpacked beside the
697
- folder. Only then is a copy of the app running from the folder stopped, found by its path, and the folder swapped by
698
- two renames. A swap that fails puts the old folder back, and with `/RUN` the app left in place starts again.
699
-
700
- - The uninstaller lives beside the app folder (`<folder>.uninstall.exe`), not in the folder an update replaces, so
701
- Settings › Apps can still remove an updated app. It finds the folder from the uninstall entry and removes it with
702
- whatever updates left beside it (`.previous`, unpacked or failed releases) and itself, the launch-at-login entry and
703
- the updates state; the server's data stays. An uninstaller that cannot be
704
- written there (a `/D=` right under a drive root) fails the install.
705
- - The Start menu shortcut and the app `/RUN` or the last page starts work in `%LOCALAPPDATA%`: Windows cannot rename a
706
- folder some process works in, which is what applying an update does.
707
- - `/RUN` starts the app after a silent install only; an interactive one offers it on its last page.
708
- - Run again without `/D=`, it installs into the folder the uninstall entry names, so a reinstall replaces the copy
709
- already installed wherever it was put, and a setup started while another one runs refuses to start.
710
- - A silent install that cannot finish exits with 2: files it could not write (the script is long-path aware, and the
711
- build warns when the deepest file nears 260 characters under `%LOCALAPPDATA%\Programs`), a WebView2 Runtime still
712
- missing after its setup ran (an interactive install asks), or a `/D=` folder holding someone else's files.
713
- - An update the app confirms sets the version Settings › Apps shows.
714
-
715
- - ccf2ae2: `akan start-desktop <app>` (alias `sd`) runs a native target as a desktop app on this computer — macOS, Windows or
716
- Linux, whichever it is — the way `start-ios` and `start-android` run it on a phone: a debug build whose pages come
717
- from `akan start` through the dev gateway, so every save shows up, or with `--release` a release build of its own
718
- bundle. It takes `--target`, `--env`, `--release` and `--write`. `NativeApp` accepts the desktop platforms, and
719
- `NativeApp.desktopPlatform()` names this computer's.
720
- - ccf2ae2: An app and a lib ship native plugins of their own from a `native/` folder
721
-
722
- A plugin the runtime has no builtin for sits in `apps/<app>/native/<id>/` (or `libs/<lib>/native/<id>/`), the folder
723
- named after the id in its `native-plugin.json`. It is listed nowhere: every mobile and desktop target of the app
724
- ships it, and its manifest says what runs on each platform. A lib's plugins reach only the apps that depend on it; an
725
- app's own plugin wins an id a lib also uses, and two libs claiming one id stop the build. `akan sync`, `akan doctor`
726
- and `akan quality scan` accept the folder.
727
-
728
- The page API is written with `definePlugin` from `akanjs/client/native` (which also exports `defineWebPlugin`,
729
- `createLiveValue`, `useLiveValue` and `usePluginEvent`), and the desktop part with `defineDesktopPlugin` from the new
730
- `akanjs/native/desktop`. A `native/` folder is out of the scope of `no-throw-raw-error` (a plugin throws
731
- `AkanNativeError`) and of `no-web-only-api-outside-webkit`. A plugin a target names by folder in `native.plugins` is now
732
- granted by its id instead of its path, and ships once when it is also the app's own `native/<id>`. A desktop plugin's
733
- `ctx.launch.exit(code)` after its setup ran past the launch phase's 3 s quits the app, since its window exists by then.
734
-
735
- - ccf2ae2: An installed app updates itself: a phone its web bundle over the air, a desktop app the whole app.
736
-
737
- - `native.updates: { url, publicKey, channel?, readyTimeout? }` in `akan.config.ts`, per target too, the target's
738
- fields winning. It brings the runtime's `updates` plugin. A channel left unnamed is the backend env the binary is
739
- built for (`main`, `develop`, `debug`, …), so a `build-desktop` app (`debug` unless `--env` names another) takes
740
- only the releases published for that env.
741
- - The CSR frame confirms a release on trial once the first page is on screen, in every native shell (an unconfirmed
742
- one is rolled back at the next launch). On a phone it also keeps the bundle current by itself: at start and on each
743
- return to the front it looks for a newer one and downloads it, and it runs from the next cold start. A desktop
744
- release is the whole app and a relaunch, so the app checks, downloads and applies it on its own schedule. A dev
745
- build's pages are left alone. `akanjs/client/native` exports `updates`, `markReady` and `useUpdateState`.
746
- - `akan update-keygen <app> [--platform]` makes the signing key of the app's id once and prints its public half.
747
- `akan publish-update <app>` builds a release on this machine and signs it: the whole app for this computer's desktop
748
- OS and CPU (with the app's server when `desktop.server` says so for the target, as for `build-desktop`), or the
749
- web bundle for `--platform android|ios`. It writes the manifest and its files under `.akan/native/<target>/updates`,
750
- to upload to `updates.url`, on the channel of its `--env` (`main` unless named). `--channel` names only the manifest
751
- written, not the channel the release follows, so a pilot group gets a target whose `updates.channel` is the pilot's.
752
- - The updates folder holds only what is uploaded, and whoever can reach `updates.url` reads it: the updater sends no
753
- credentials, and a desktop release is the whole app, with the carried server's `private/` (the app's and its libs')
754
- and its env file.
755
- - `akan pack-update <app> --platform ios|android [--target] [--env] [--out]` writes an unsigned phone update instead,
756
- for a signer that keeps the key elsewhere: `files/<sha256>`, `bundle.json` and `manifest.template.json`, the
757
- manifest with `channel`, `sequence` and `bundle` left for the signer. `--against <store bundle.json>` also checks
758
- the bundle runs in that store build, writes `compat.json`, and fails when it needs a new binary. The signing
759
- contract is in the native runtime's architecture notes: fill the three fields, sign exactly the bytes you upload,
760
- upload `files/` first.
761
- - `publish-update` refuses a `--channel` outside the names `updates.channel` accepts (lowercase letters, digits, `.`,
762
- `_`, `-`) before it builds, and numbers a release past the one its channel already has in the updates folder,
763
- warning when this computer's clock is behind it. Apps compare against the time their own build was made, so keep the
764
- building and the publishing computers' clocks in step.
765
- - While a desktop release is on trial, `updates.check()` answers `available: false` for it and `updates.apply()`
766
- rejects with `NOT_ALLOWED`: applying would replace the app a failed trial goes back to.
767
- - A release of a desktop app that carries its server is confirmed only once that server answered ready and stayed up
768
- for 5 s, and only while it is up; its trial clock (`readyTimeout`) starts then, so a server slow on its first run
769
- (its new files being scanned) costs no rollback. A server that gives up, or is not up within 120 s of the start,
770
- rolls the release back at once; the release stays downloaded for the next apply, and its third such failure
771
- excludes it for good.
772
- - A desktop release's manifest says whether it carries a server, and an installed app refuses one that differs from
773
- itself before downloading anything (`check()` answers `available: false`, `download()` rejects with
774
- `NOT_ALLOWED`), since either way its pages' backend would change place. `publish-update` refuses, before it builds,
775
- a desktop release whose server presence differs from the channel's previous one: publish it on another channel
776
- (`updates.channel`), or remove that `<channel>.json` from the output folder to start the channel over. Turning
777
- `native.desktop.server` on or off for an app already installed takes a reinstall.
778
- - On Windows an app started from its install folder (the installer, the Start menu, Explorer) applies and rolls back
779
- updates: Windows renames no folder a process works in, so the app moves to its local data folder before the webview
780
- starts, and the update helper and the app it starts work elsewhere.
781
- - The update state and the unpacked releases live in the app's local data (`%LOCALAPPDATA%\<app id>\akan-native-updates`
782
- on Windows), and plugins get that folder as `ctx.appLocalDataDir`.
783
- - An app installed under another folder name (`/D=`, a renamed `.app`) takes updates; a download older than a
784
- reinstalled build is dropped; a Windows swap that did not happen (a file stayed locked, the helper never ran) keeps
785
- the release downloaded for the next apply until its third such failure excludes it. Reinstalling the app clears the
786
- list of releases the earlier install refused.
787
- - `publish-update` checks every target before anything builds — its `updates` settings, its native config, the
788
- signing key on this computer, and whether its channel's previous release carries a server as it would — so a CI
789
- without the key stops at once and a publish never releases only the first targets. It writes `<channel>.json`
790
- together with its signature.
791
- The channels `bundle`, `manifest.template` and `compat` are refused. `akan start` keeps `.akan/native`, where
792
- releases wait to be uploaded, and the `bin` downloads in `.akan/cache/bin`.
793
-
794
- - ccf2ae2: An app image carries the server env of the environment it runs and no other.
795
-
796
- - `env/env.server.ts` imports every environment's file, so `akan build` used to bundle all of them into `server.js`:
797
- anyone holding the image of one environment could read the keys of every other. The backend build now keeps only
798
- `env.server.<AKAN_PUBLIC_ENV>.ts`, the environment the generated Dockerfile fixes, and swaps each other
799
- environment's file (`local`, `testing`, every branch) for exports that refuse to be read. Booting such an image under
800
- another `AKAN_PUBLIC_ENV` stops with `env/env.server.<name>.ts is not in this build` instead of running on a
801
- config it does not have. Nothing in `env/` needs to change.
802
- - An app's generated `server.ts` no longer re-exports `env` from `env.server.testing.ts`, which put the testing env in
803
- every image. Signal tests read it from the file. A script or test that imported `env` from an app's `server.ts`
804
- imports `./env/env.server.testing` instead. A lib's `server.ts` still exports it, since each app's
805
- `env.server.type.ts` spreads it as the lib's defaults.
806
- - Keys that already shipped in an image stay readable in it. Rotate them.
807
- - A build for a named `--env` (a mobile or desktop build) writes that env into the Dockerfile too, so the image boots
808
- the environment its `server.js` carries.
809
-
810
- **Breaking for an image started under another `AKAN_PUBLIC_ENV`, and for code importing `env` from an app's
811
- `server.ts`:** the image stops at boot until it runs the environment it was built for, and the import moves to
812
- `./env/env.server.testing`.
813
-
814
- - ccf2ae2: A desktop app nobody attends recovers its page, relaunches itself and opens as a kiosk
815
-
816
- `native.desktop.recovery: "reload"`, for the app or one target, loads a page whose web process ended (a crash, a hang,
817
- out of memory) again, once per end, instead of showing an error page after the second end, waiting longer after each
818
- end in a row (1 s, doubling to a minute). It relaunches the app when the webview's browser process ends, where the app
819
- used to quit: at once the first time, then after 1 s doubling to a minute while each relaunched app dies within a
820
- minute, and after ten in a row it exits with code 1 instead of restarting for good.
821
- `native.desktop.window: { fullscreen, skipTaskbar }` opens the main window borderless fullscreen and without a taskbar
822
- button (Windows, Linux) from its first frame; a plugin's launch phase decides the same per launch with
823
- `ctx.launch.setWindow`. `app.relaunch()` ends the app and starts it again in a new process on the desktop and Android,
824
- and reloads the page on the web; one process starts one new app, however many windows or calls asked for it.
825
- `native.android.autoplay: true` lets media play with sound without a tap first, as it already does on iOS and the
826
- desktop.
827
-
828
- An app relaunched by an update on Windows no longer quits the moment it starts when `akan start-desktop` had started
829
- the one before it.
830
-
831
- - ccf2ae2: A desktop app can carry the app's own server: with `native: { desktop: { server: true } }` in `akan.config.ts`, or
832
- `desktop.server` on one target, `akan build-desktop`, `akan start-desktop --release` and `akan publish-update` put the
833
- backend `akan build` made into the app, so it works on one computer with no backend elsewhere.
834
-
835
- - The build stages what the backend build wrote into `apps/<app>/.akan/desktop/server` — `main.js`, `server.js`, the
836
- chunks, `akan.build.json`, `private/`, and any `.node`, `.wasm` or file asset a bundled package brought — without the
837
- Dockerfile, the RSC worker, the console, `csr/` and `public/`. Its packages install there first
838
- (`bun install --production --prefer-offline`, without the RSC renderer and the drivers of every database mode but
839
- `single`), before `akan build` runs, so a computer that cannot reach the registry or find them in Bun's cache stops at
840
- once. The app needs `single` in `database.modes`; the command says so before it builds.
841
- - The backend is built for the command's own `--env`, not the workspace's `AKAN_PUBLIC_ENV` (the root `.env` usually
842
- names `local`), so `server.js` holds that environment's `env.server.<env>.ts` and no other.
843
- - What it carries is readable in plain text by anyone with the app: `private/` (each lib's too, under
844
- `private/libs/<lib>`), that `env.server.<env>.ts` and the server env defaults of the libs it uses (each lib's
845
- `env.server.testing.ts`). Keep deployment secrets out of them. It has no `public/`, and its working
846
- folder is its data folder: read a runtime file from the app folder (`AKAN_APP_DIR`, else the folder of `Bun.main`),
847
- never from `process.cwd()`.
848
- - At launch the shell starts it as a child on its own Bun (`BUN_BE_BUN`, with `.env`, `bunfig.toml` and
849
- auto-install off) on a loopback port, and hands the page its URL as `PUBLIC_AKAN_SERVER_URL`. The port of the last
850
- session comes first and a fresh one is picked only when it is taken, so an address registered somewhere usually
851
- stays valid from one launch to the next. The window waits for it up to 8 s.
852
- - It runs API only, `operationMode` edge, database mode `single`, SSR, CSR and MCP off, bound to 127.0.0.1 with every
853
- other Host refused. Any program on the computer can still call that port, so guard its endpoints as a network
854
- server's. It keeps its SQLite data, files, logs and a per-install JWT secret in the app data folder's
855
- `server/`, and a debug build, which has the release app's id, in its own `server-debug/`. On Windows that folder is
856
- `%LOCALAPPDATA%\<app id>\server`, not the Roaming folder a profile copies on every sign-in and an organisation may
857
- put on a file share, where SQLite's WAL does not work. Bun's transpiler cache goes to
858
- `<server data>/runtime/transpiler-cache`.
859
- - It trusts the operating system's CAs (`--use-system-ca`), as the page does, and gets the proxy and CA variables
860
- (`HTTP(S)_PROXY`, `NO_PROXY`, `NODE_EXTRA_CA_CERTS`, `SSL_CERT_FILE`, `NODE_USE_SYSTEM_CA`) and the desktop session's
861
- (`DISPLAY`, `WAYLAND_DISPLAY`, the session bus, the audio server, `XDG_*`, and Windows' `ProgramFiles`, `ComSpec`,
862
- `PATHEXT` and the like), so a `bin` tool reaches what the page reaches and can open the screen, the audio server or a
863
- shell.
864
- - `AkanApp` takes `BUN_BE_BUN` off `process.env` at boot and gives it back only to a spawn of its own executable (the
865
- ops snapshot, which also gets the server's runtime flags), so a `bin` tool built with `bun build --compile` starts as
866
- itself rather than as the Bun CLI. A child started with `Bun.spawn` and no `env` still gets the environment the
867
- process started with, so pass `env: process.env`.
868
- - A crash restarts it on the same port (1 s doubling to 30 s; the fifth in a row gives up with an alert). A server that
869
- exits before its first ready starts again 250 ms later, on the same port while it is still free, so one that cannot
870
- boot gives up while the window still waits for it and the window opens at once with the alert. A server
871
- that cannot start at all (an unreadable `jwt.secret`, a data folder that cannot be made) still hands the page a
872
- loopback URL and shows the same alert once the window is up, so the page never falls back to the backend its bundle
873
- was built for. A restart that throws counts as one failure. Its standard error, and its standard output until it is
874
- ready, also go to `server/runtime/logs/server-output.log`, where a server that fails before it listens leaves its
875
- reason.
876
- - Quitting the app stops it within its 1 s shutdown budget, inside the launcher's 1.5 s grace, and a server still
877
- there after the grace is killed. On macOS and Linux it leads its own process group, and whatever it started ends
878
- with it: the launcher ends the group when the app quits, and when the app was killed or crashed — even while the
879
- server was still starting — the server sees its parent gone and ends the group itself, SIGTERM first and SIGKILL a
880
- second later. A process started `detached` leaves the group. On Windows the job object ends them all with the app.
881
- - It runs in one process: a `main.ts` or an env asking for a gateway and replicas (`replica`, `solo: false`,
882
- `AKAN_SOLO=false`, `AKAN_REPLICA`, `AKAN_COMMAND_TYPE=start`) does not boot in the app, and says which.
883
- - A native plugin follows the server with `ctx.server.state` and `ctx.server.onState` (`starting`, `up`,
884
- `restarting`, `gaveUp`, `stopped`), and a page with the `app` plugin's `serverState` event, so an app nobody attends
885
- can act on a server that gave up (`app.relaunch()`, say).
886
- - `XAUTHORITY`, `PULSE_COOKIE`, `PULSE_RUNTIME_PATH` and `XDG_DATA_DIRS` reach it too. A second launch that hands
887
- over to the first starts none. The single-instance plugin comes with it.
888
- - `akan start-desktop` without `--release`, for such a target, follows this checkout's dev server already answering on
889
- the app's dev port, or starts `akan start` in the same command and opens the app once it serves; it asks for one
890
- target before it starts one, needs `single` as a release does, and stops at once when that dev server fails to boot
891
- (a replica's crash loop included) instead of waiting it out. Ctrl+C or closing the app stops the app, then the dev
892
- server it started, then the local database, one after another, and exits 130.
893
- - `akan start-desktop --release` of such a target shows the carried server's lines at the level its logger wrote them.
894
- - `AkanAppConfig.getProductionEnv()` is the env the image runs with; the Dockerfile's `ENV` lines come from it (same
895
- keys and order, without the two blank lines the template used to leave).
896
-
897
- - ccf2ae2: `akan build-desktop --arch arm64|x64` picks the CPU a Windows or Linux desktop app runs on
898
-
899
- A desktop app is still built on its own OS, now for either of its CPUs: the Rust library is built for that target,
900
- the executable with `bun build --compile --target=bun-<os>-<arch>`, the carried server installs with
901
- `bun install --cpu=<arch>` so its addons' prebuilt binaries are that CPU's, and each `bin` entry is that platform's.
902
- The setup program and the AppImage name the CPU they hold. A macOS app is Apple silicon only: Intel Macs are not a
903
- target, so `--arch x64` on macOS is refused.
904
-
905
- - ccf2ae2: `bin` in `akan.config.ts` puts executables in a desktop app, and the build says what the image installs that the app does not
906
-
907
- A desktop app ran whatever `ffmpeg` the user's computer had on its PATH, if any, and a Finder-launched app sees only
908
- `/usr/bin:/bin:/usr/sbin:/sbin`. `bin` names an executable and, per platform (`darwin-arm64`, `win32-x64`, …), where it
909
- comes from: a download with its `sha256` (an archive takes `file`, the executable inside it) or a path next to the
910
- declaring `akan.config.ts`. `build-desktop` and `start-desktop` fetch the file for the computer they build on, check it,
911
- and carry it in the app's `bin/`, which the app puts first on its PATH: the carried server's `spawn("ffmpeg")` runs
912
- that file, and a native plugin finds it in `ctx.binDir`. A download is kept as `download` plus its URL's extension
913
- (`.zip`, `.tar.xz`, `.exe`, …), never under a name the URL spells. Bun's own `spawn` without `env` reads the environment the app
914
- started with, so a plugin passes `env: process.env` to run one by name. A lib's entries reach the apps that depend on
915
- it, and an app's own entry of the same name wins. macOS builds sign every executable the app carries, in `bin/` and
916
- in the carried server, found by its Mach-O header rather than its name, so one a package ships without an extension
917
- passes Developer ID signing and notarization too. The image does not read `bin`: it still installs through `docker`.
918
-
919
- `build-desktop` of a target that carries its server now warns when the image runs `docker` steps (or the app writes
920
- its own Dockerfile) and the app carries no `bin`, since the carried server runs none of those steps.
921
-
922
- - ccf2ae2: `desktop.server: { omit }` carries the desktop app's server without packages only the image needs
923
-
924
- `native: { desktop: { server: { omit: ["rclnodejs"] } } }` carries the server as `server: true` does, minus the named
925
- packages and whatever only they pull in: an addon tied to the image's system (a ROS install), or code only a process
926
- the desktop app never starts loads. The image's `package.json` keeps them, `externalLibs` included; the desktop
927
- server's `package.json`, its `bun install --production` and the addon check do not see them. A package another
928
- dependency still installs stops the build, naming the dependents, and the targets that carry one build's server must
929
- omit the same packages.
930
-
931
- - ccf2ae2: A desktop app's server reads the files the user picks, with no copy and no path in the page
932
-
933
- `filePicker.pickFiles({ forServer: true })` (also `pickDirectory` and `saveFile`; `filePicker` is now exported from
934
- `akanjs/client/native`) copies nothing on the desktop, whatever the file's size: its FileRefs serve the originals,
935
- and each result carries a grant. The server exchanges the grant with `NativeFile.resolve(grant, "read" | "write" |
936
- "folder")` from `akanjs/server`, or `NativeFile.resolveIn(folderGrant, relative)`. The carried server asks the shell
937
- that showed the dialog over its IPC channel, so it reaches what the user picked and nothing else; a debug build
938
- that carries its server does the same. Behind a dev build without one, `akan start` checks the grant's signature
939
- instead, in `operationMode` local only. A phone or the web refuses `forServer`.
940
-
941
- `resolveIn` judges a relative path by where it lands once the links on it are resolved — through its nearest existing
942
- folder when the file is about to be written — so a link inside the granted folder cannot take it elsewhere, and a
943
- dangling link is refused. A name that starts with two dots (`..cache/x`) is inside the folder, not above it.
944
-
945
- - ccf2ae2: `akan build-desktop --installer true` on Linux adds an AppImage
946
-
947
- The app folder gains an `AppRun`, a `.desktop` entry naming the app's icon and its `deepLinks.schemes`, and a 256px icon,
948
- and is packed with `mksquashfs` behind the AppImage type 2 runtime, pinned to a dated release and checked by its
949
- digest. The AppImage needs only the WebKitGTK 4.1 and GTK 3 the folder already needs, and runs without FUSE through
950
- `--appimage-extract-and-run`. It runs from a read-only image, so the updates plugin cannot replace it: an app with
951
- `updates` is warned to publish a new AppImage for each release.
952
-
953
- - ccf2ae2: A macOS desktop release can be downloaded: Developer ID signing, the hardened runtime, notarization and a dmg
954
-
955
- `akan build-desktop` signs with a Developer ID when `AKAN_NATIVE_MACOS_IDENTITY` names one in a keychain, or
956
- `AKAN_NATIVE_MACOS_CERTIFICATE` + `_CERTIFICATE_PASSWORD` a `.p12` (imported into a keychain made for the build and
957
- deleted after it, for CI). Every Mach-O file is signed inside out with the hardened runtime and a secure timestamp, and
958
- the executable gets Bun's JIT entitlements plus the camera's or microphone's when a usage text asks for them;
959
- `native.desktop.entitlements` adds the app's own. With `AKAN_NATIVE_MACOS_NOTARY_KEY` + `_KEY_ID` + `_ISSUER` (an App
960
- Store Connect API key) or `_NOTARY_PROFILE`, the app is notarized, stapled and checked with `spctl`.
961
- `--installer true` on macOS adds a dmg with an Applications link, signed, notarized and stapled the same way.
962
- `publish-update` signs a macOS release with the same identity, since the updater checks the installed app's signature.
963
- A release that is not signed with a Developer ID, or not notarized, warns that Gatekeeper blocks a downloaded copy.
964
-
965
- - ccf2ae2: A native platform section takes its own `indexPath`
966
-
967
- `ios.indexPath`, `android.indexPath` and `desktop.indexPath` win over the section's (or the target's) `indexPath` on
968
- that platform, so one target opens the phones on `/mobile` and the desktop app on `/` with no `--target`. It moves
969
- both the dev build's first page and the `indexPath` a release bundle carries.
970
-
971
- - ccf2ae2: Mobile apps build and run on `@akanjs/native` instead of Capacitor.
972
-
973
- The runtime ships inside `akanjs` (vendored, not published on its own), so an app installs nothing extra for it.
974
- It generates each target's native projects under `.akan/native/<target>/build/<platform>` and loads the web
975
- root it assembles in `.akan/native/<target>/web` from the production CSR build — nothing native is committed.
976
-
977
- - **Configuration (`akan.config.ts`).** A `native` section, and each of its `targets`, takes `appName`, `appId`,
978
- `fileName`, `version`, `buildNum`, `basePath`, `indexPath`, `icon`, `splash`, `permissions`, `plugins` (builtin
979
- ids such as `iap`), `deepLinks`, `ios.{infoPlist, entitlements, files}` and
980
- `android.{manifest, application, activity, googleServices, files}`; a target overrides the section field by field.
981
- `files` maps where a file lands (a path in the iOS app bundle, `res/<type>/<file>` or `assets/<path>` on Android)
982
- to its source. A Capacitor-era key fails, naming the keys the section takes.
983
- - **Plugins declare, they do not edit projects.** `AkanPlugin.native` names the permission it serves and what the
984
- target then needs: native plugins, usage texts, plist and entitlement entries, Android permissions and features.
985
- It replaces `capacitor.configureNative`, `editIosAppDelegate` and `runtimePackages`. A release build names each
986
- plugin's default permissions as its capabilities.
987
- - **Commands.** `build-`, `start-` and `release-ios|android` go through the runtime. `start-*` follows `akan start`
988
- (it refuses when no dev server answers), runs one target at a time and takes `--device` (and `--team`/`-T` on
989
- iOS); `--release` runs a release build of its own bundle. `release-ios` takes `--team` and `--ad-hoc`;
990
- `release-android` builds an `.aab` by default (`--assemble-type apk` for an `.apk`), signed from
991
- `MYAPP_RELEASE_STORE_FILE`, `MYAPP_RELEASE_STORE_PASSWORD` and `MYAPP_RELEASE_KEY_ALIAS` (plus
992
- `MYAPP_RELEASE_KEY_PASSWORD` when the key has its own), which it checks before anything builds. `build-*` take
993
- `--debug`, and
994
- `akan doctor --ios` adds the native toolchain checks.
995
- - **Pages.** `akanjs/client/native` wraps the native plugins a page uses, and `isNativeApp()` is true only inside
996
- a shell. `Device` reads the runtime's device plugin and safe-area variables, `storage` the shell's preferences,
997
- and the new `secretStorage` keeps the JWT and refresh tokens in the OS credential store (cleared on the first
998
- launch after a reinstall). `useCamera` is one hook — the native sheet asks camera or library and answers an
999
- upright JPEG data URL — and `useGeoLocation` answers the flat native position. A native release bundle opened at
1000
- `/` starts on its target's home, and a target opened in a browser is a web device.
1001
-
1002
- **Breaking, with a migration path.**
1003
-
1004
- - Delete the app's `ios/`, `android/`, `mobile/` folders and `capacitor.config.*`: `akan sync`, `akan doctor` and
1005
- `akan quality scan` now refuse them in an app root and say why.
1006
- - Move Capacitor settings to the keys above; `google-services.json` goes to `native.android.googleServices`, and
1007
- `GoogleService-Info.plist` is no longer needed.
1008
- - Removed: `-g/--regenerate`, `--open`, `--allow-provisioning-updates`, `configure-app`, `codepush`,
1009
- `release-source`, `capacitor.base.config`, `useContact`, `useCodepush`, the native path of `useSpeech`, and every
1010
- `@capacitor/*`, `@capacitor-community/*`, `@capgo/*`, `capacitor-plugin-safe-area`, `cordova-plugin-purchase`
1011
- and `@trapezedev/project` dependency — `akanjs` no longer lists them as peers.
1012
- - `baseSt` drops `deviceToken`; the notification store owns it.
1013
-
1014
- - ccf2ae2: `native` in `akan.config.ts` replaces `mobile`, with each platform's settings in a section of its own
1015
-
1016
- **Breaking:** `mobile` is gone with no fallback; a config that still has it, or a key that moved, stops and names the
1017
- new place. `native` and each of `native.targets` take the same fields, a target merging objects key by key and
1018
- replacing lists and every other value, and without `targets` the app has one target, `default`. The next `akan start`
1019
- removes the old `.akan/mobile`.
1020
-
1021
- The agent guide `akan agent install` writes now covers native apps: the `native` section, the `start-*` / `build-*`
1022
- commands and updates, with the full contract in the `runtimeRule` guideline.
1023
-
1024
- | Before | Now |
1025
- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
1026
- | `mobile` | `native` |
1027
- | `mobile.native.X`, `targets.<t>.native.X` (`plugins`, `ios`, `android`, `desktop`) | `native.X`, `native.targets.<t>.X` |
1028
- | `native.push.android` | `android.push` |
1029
- | `native.privacy` | `ios.privacy` |
1030
- | `assets.icon`, `assets.splash` | `icon`, `splash` |
1031
- | `files["ios/<path>"]` | `ios.files["<path>"]` |
1032
- | `files["android/res/…"]`, `files["android/assets/…"]` | `android.files["res/…"]`, `android.files["assets/…"]` |
1033
- | `deepLinks.ios.teamId` | `ios.teamId` |
1034
- | `deepLinks.android.sha256CertFingerprints` | `android.sha256CertFingerprints` |
1035
- | `indexPath` on a target only | on `native` too, inherited by every target |
1036
- | root and target `plugins` joined, Android XML lists appended | the target's list replaces |
1037
- | `.akan/mobile/<target>/native/<platform>` | `.akan/native/<target>/build/<platform>` |
1038
- | `.akan/mobile/<target>/{dev,updates,web,bin}` | `.akan/native/<target>/{dev,updates,web,bin}` |
1039
- | `AkanMobileConfig`, `AkanMobileTargetConfig` | `AkanNativeAppConfig` (resolved: `AkanNativeAppResult`), `AkanNativeTarget`; `AkanNativeSettings` is what `native` and a target share |
1040
- | `AkanMobileUpdatesConfig`, `AkanMobileAppId`, `AkanMobileTargetDeepLinks` | `AkanNativeUpdatesConfig`, `AkanNativeAppId`, `AkanNativeDeepLinks` |
1041
- | `AkanMobileNativeConfig` | `AkanNativeIosConfig`, `AkanNativeAndroidConfig`, `AkanNativeDesktopConfig` |
1042
- | `AkanMobileTargetAssets`, `AkanMobileTargetFiles` | removed: `icon`, `splash` and each platform's `files` |
1043
- | `MobilePermission`, `MobileEnv`, `AppConfigResult.mobile` | `NativePermission`, `NativeEnv`, `AppConfigResult.native` |
1044
-
1045
- - 5f53462: `akan subspace upload-env <name>` sends one subspace's env to the cloud workspace it deploys from
1046
-
1047
- A subspace's `env/` values were the one thing the mirror had no way to move. Push holds them back and pull
1048
- leaves them alone — deliberately, because the values belong to the repo that deploys — so getting a changed
1049
- value into a customer's deployment meant running `akan upload-env` from somewhere that had both the values and
1050
- that customer's `AKAN_WORKSPACE_ID`, which is nowhere: a workspace has every customer's values and exactly one
1051
- id, its own.
1052
-
1053
- `SubspaceDeclaration` now carries an optional `workspaceId`, the cloud workspace that subspace deploys from,
1054
- and `akan subspace upload-env <name>` uploads against it. `akan.subspace.ts` is a workspace-only entry that no
1055
- push ever ships, so declaring every customer's id there puts none of them in a customer's repo.
1056
-
1057
- What is uploaded is the slice a push ships — the declared apps, the libraries their closure pulls in, and those
1058
- apps' `secrets` globs — and nothing else. The whole workspace would be the simpler thing to send, and it is the
1059
- wrong one: an env archive is replaced whole on arrival, so one customer's cloud workspace would end up holding
1060
- every other customer's secrets. `CloudRunner.gatherEnvFiles` takes that scope and an archive path (the slice
1061
- lands in `local/env.<name>.tar`, never over the full `local/env.tar`), while the `akan:secrets` block it
1062
- maintains in the root `.gitignore` keeps being written from every app in the workspace — narrowing that file to
1063
- one slice would silently un-ignore every other app's secrets.
1064
-
1065
- Because the upload replaces an archive in a repo you are not standing in, three things are refused rather than
1066
- guessed: a subspace with no `workspaceId`, a subspace declaring this workspace's own id (a slice uploaded there
1067
- would leave the workspace's next `download-env` short of every other app), and two subspaces declaring the same
1068
- id. The command asks for confirmation before it replaces anything, naming the subspace and the cloud workspace;
1069
- `-F, --force` skips the question, and with no terminal to ask in the command refuses instead of assuming yes.
1070
- (`-f` is already `--format` and `-y` already `--verify`.)
1071
-
1072
- The direction is one-way on purpose. There is no `subspace download-env`: it would write a customer's values
1073
- over the workspace's own copies, and which of the two is right is not something a command can know.
1074
-
1075
- - ccf2ae2: `trustedDependencies` in `akan.config.ts` names the packages whose install scripts run where the app is installed
1076
-
1077
- `bun install --production` skips every dependency's install and postinstall scripts unless the package is trusted, so
1078
- a native addon that builds itself at install time (one that ships no prebuilds) reached the image unbuilt and failed
1079
- at its first call. An app or a lib now lists those packages in `trustedDependencies`; the built `package.json`
1080
- carries the list, and both the image and a desktop app's server run their scripts. A lib's list reaches every app.
1081
-
1082
- - ccf2ae2: Three grit rules keep app and lib code off the browser APIs that behave differently inside a native app, and each
1083
- message names what to use instead.
1084
-
1085
- - `no-document-cookie` (error): an `app://localhost` page on iOS, macOS and Linux keeps no cookies, so
1086
- `document.cookie` reads empty and drops writes in the app. Use `getCookie` / `setCookie` / `removeCookie` from
1087
- `akanjs/client`.
1088
- - `no-web-storage` (error): `localStorage` / `sessionStorage` work in the shells but bypass the store akanjs picks
1089
- per platform and throw during SSR. Use `storage`, or `secretStorage` for credentials, from `akanjs/client`.
1090
- - `no-web-only-api-outside-webkit` (warning): `navigator.share` / `canShare`, `navigator.serviceWorker`,
1091
- `Notification.requestPermission` / `.permission`, `navigator.geolocation` and `navigator.vibrate` belong in a
1092
- `webkit/` hook that branches on `isNativeApp()`.
1093
-
1094
- The first two apply to `apps/**` and `libs/**` outside tests, the third to the same files outside `webkit/`.
1095
-
1096
- **Breaking for a workspace that reads Web Storage or cookies directly:** `akan lint` now fails there. Move the
1097
- call to the `akanjs/client` helpers, or keep it with `// biome-ignore lint/plugin: <reason>`.
1098
-
1099
- - ccf2ae2: A Windows desktop release is signed with Authenticode
1100
-
1101
- With `AKAN_NATIVE_WINDOWS_CERTIFICATE` + `_CERTIFICATE_PASSWORD` (a `.pfx`), `AKAN_NATIVE_WINDOWS_THUMBPRINT` (a
1102
- certificate in the store) or `AKAN_NATIVE_WINDOWS_SIGN_COMMAND` (a JSON array run once per file with `{file}`, for Azure
1103
- Trusted Signing or a cloud HSM), `akan build-desktop` signs every PE file of the app — the executable, its DLL, the
1104
- server's addons and `bin` — SHA-256 with an RFC 3161 timestamp (`AKAN_NATIVE_WINDOWS_TIMESTAMP_URL`), and verifies them.
1105
- `--installer` signs the setup program and, through makensis's `!uninstfinalize`, the uninstaller it writes; the
1106
- settings reach the signer through the environment only. `publish-update` signs a Windows release the same way, and an
1107
- unsigned release build warns that SmartScreen flags a downloaded copy.
1108
-
1109
- ### Patch Changes
1110
-
1111
- - 5f53462: fix(tunnel): reach the tunnel control plane at its real path, and report the status instead of parsing the error page
1112
-
1113
- `akan tunnel` and `akan start --share` could not open a share at all: `CloudApi` called `/api/requestTunnel`,
1114
- `/api/tunnelListInSelf` and `/api/revokeTunnel`, none of which exist. An endpoint's path carries the model's
1115
- refName — `fetch.serializer.ts` takes it from `sliceCls.srv.cnst?.refName` — so every database module's endpoints
1116
- sit under a segment of their own and the service modules beside them do not. `tunnel` is a database module; its
1117
- neighbours in the same file, `uploadEnv` and `getRemoteSelf`, belong to the `_cloud` service module and have no
1118
- `cnst` to take a prefix from. The three paths now carry `/tunnel/`, with a note saying why they differ from the
1119
- methods above them.
1120
-
1121
- **The 404 was invisible, which is the more expensive half.** `HttpClient.get` and `post` called `response.json()`
1122
- without looking at `response.ok`, so the control plane's HTML error page reached the user as
1123
- `JSON Parse error: Unrecognized token '<'` — a parse error where the status line had already said `404 Not Found`.
1124
- Both now read the status first and throw with it, matching `getFile`, which has always done so.
1125
-
1126
- Three failures were being swallowed the same way and now surface:
1127
-
1128
- - `uploadEnv` returned the parsed error body, which is a truthy object, so **a failed env upload reported success**
1129
- and the project went on to build against env that never arrived.
1130
- - `getRemoteSelf` and `getRemoteAuthToken` are written to catch and answer `null`; with nothing thrown they
1131
- answered an error object instead.
1132
- - `refreshAuthToken` fed a rejected response straight into `toAccessToken`, minting a token from it.
1133
-
1134
- - ccf2ae2: fix: a dev server whose replica crash-loops reports it at once
1135
-
1136
- When an app's `init` threw at every boot, the gateway gave up on the replica and waited for a code change, but the dev
1137
- host kept reporting the app as starting: `akan start` showed no reason and held its next wave of apps for 180 s, and
1138
- `akan start-desktop` waited 180 s before it gave up. The host now reports the app `failed` with the gateway's message
1139
- as soon as it gives up; `akan start` keeps running and shows the app ready again after the fix is saved.
1140
-
1141
- - ccf2ae2: A CSR page or layout whose async render throws says so, a cached page whose layout redirected renders again, and a
1142
- dev client module that imports a macro builds.
1143
-
1144
- - An async render that rejected used to leave its layer blank with nothing in the console, since the promise's
1145
- failure was dropped. It is now logged with the stack and the layer it belongs to (`render of page 2 of
1146
- /:lang/home failed: …`).
1147
- - `akan:debug:frame` takes `memory` besides `1`: the frame trace goes to `window.__AKAN_FRAME_TRACE__` (the last
1148
- 2000 events) instead of the console. A native dev build mirrors each console call over the bridge, which slows the
1149
- frame enough to hide a timing bug; `memory` does not. Async page and layout renders add `layer.render`,
1150
- `layer.settle` and `layer.fail` events.
1151
- - A cached page whose layout redirected renders that layout again when it is back on screen. Signed out, a
1152
- layout that sends the person to the sign-in page kept its empty result, so the page stayed blank after the sign-in
1153
- brought them back (a native app opens its home first, so it always did). A render that issued a redirect while it
1154
- ran is now rerun the next time its page becomes current; `router.redirectCount()` is what it compares.
1155
- - `window.__AKAN_DUMP_FRAME__()` reports the frame's location, stack and phase and every recent async page and
1156
- layout render: settled or pending, still awaited, drawn. It records only the latest state, so it does not change
1157
- the timing a trace would.
1158
- - `akan start` no longer fails a dev client build with `ReferenceError: __akanMeta is not defined` when a file
1159
- imports a macro (`useClient.ts`'s `with { type: "macro" }`) whose modules read `import.meta` at the top level.
1160
- Bun applied the dev build's `import.meta` rewrite to the macro's modules too, and ran them where nothing declared
1161
- the rewritten name; such a file now has its macros run by a build of its own first.
1162
-
1163
- - ccf2ae2: A native dev build's API calls and sockets go through the dev gateway, so a phone on the same network — or the
1164
- simulator, the emulator and a desktop app — reaches `akan start` without a reversed port.
1165
-
1166
- - A page the gateway served calls its own origin: `getEnv().serverHttpUri` is `<page origin><api prefix>` and the
1167
- websocket follows it, unless `AKAN_PUBLIC_SERVER_URL` names a server. A release build is unchanged.
1168
- - The iOS, Android and desktop hosts carry the method, the body and the request headers, `authorization`
1169
- included, to the gateway; the gateway relays the app's `<prefix><websocketPrefix>` socket. Android hands the
1170
- host no request body, so a call that carries one goes to the gateway's `http://localhost` origin directly and
1171
- the server answers its CORS.
1172
- - A desktop dev build opens the target's start page instead of `/`, and builds when the web root has no
1173
- `index.html` yet.
1174
- - `NativeWebDir` lists the web root in `/`-separated paths on Windows too.
1175
-
1176
- - ccf2ae2: A native app can sign in through the system browser and hear the callback on every desktop OS.
1177
-
1178
- - `akanjs/client/native` exports `authSession` and its `AuthSessionApi` type, the runtime's system-browser sign-in,
1179
- and `isNativeShell()`, true in any native shell; `isNativeApp()` stays iOS and Android only.
1180
- - `getServerOrigin()` in `akanjs/base` is the server's origin as a browser outside the page opens it. For a page the
1181
- native dev gateway served, that is the dev server (`http://localhost:<dev port>`), not the app origin the page
1182
- calls; otherwise it is the origin of `getEnv().serverHttpUri`.
1183
- - A native dev build on Android reverses the dev server's port as well as the gateway's, so a browser on the device
1184
- reaches it.
1185
- - A target with `deepLinks.schemes` ships `single-instance`. Windows and Linux open a link by starting the app again,
1186
- and the hand-over is how the link reaches the running app. A second launch of such an app now hands over and exits
1187
- instead of opening a second window, and a desktop debug build keeps the release app id, so it does the same while
1188
- the release app runs.
1189
- - In an app with basePaths whose only target names none, `start-*` and `build-*` without `--target` ask for a basePath
1190
- instead of opening the root, which has no CSR page.
1191
-
1192
- - 3ebd8e1: fix(agent): stop a workspace's agent guide and lint config from freezing at the release that created it
1193
-
1194
- `createWorkspace` copies the whole `templates/workspaceRoot` tree — 21 `.cursor/rules/*.mdc`, `AGENTS.md`,
1195
- `biome.json`, `tsconfig.json` — but the only maintenance path, `generateAgentRules`, rewrites three of them, and
1196
- `akan agent install` refreshes only the `akan:agent` block inside `AGENTS.md`. Twenty-one files created, three
1197
- maintained: everything else was a one-time copy that no framework release could ever reach. Adding one lint rule
1198
- meant writing the same sentence into `AGENTS.md`, `.cursor/rules/lint-enforced-rules.mdc`, its `.mdc.template`,
1199
- `AGENTS.md.template`, `biome.json`, and `biome.json.template` — and even then, no existing workspace saw it.
1200
-
1201
- Four changes, ordered by how much drift each removes.
1202
-
1203
- **Lint config now extends a config shipped in the package.** `@akanjs/devkit/biome.base.json` carries the
1204
- formatter, the rule set, and every grit plugin registration; a workspace `biome.json` is `extends` plus its own
1205
- `files.includes`. Biome resolves the specifier through node*modules (it does not consult the package `exports`
1206
- map), and `plugins` paths inside an extended config resolve from the entry config's directory, so the
1207
- `./node_modules/@akanjs/devkit/lint/*.grit`form the template already used is correct. Rule changes now reach a
1208
- workspace on`bun update`with no command to run. Two merge behaviours decided the split:`overrides`concatenate,
1209
- so the generated-file opt-out moved there from`files.includes`, which \_replaces* and would silently drop the base
1210
- list the moment a workspace added one exclusion of its own. Because Biome moves rules between groups across minors
1211
- (`noUnnecessaryConditions`is`nursery`at 2.4 and`suspicious`at 2.5, and the old position is a hard error), the
1212
- base config and the Biome version travel together:`biomeBase.ts`pins the version`createWorkspace`installs
1213
- instead of resolving`latest`.
1214
-
1215
- **The conventions body moved into the managed block.** It now ships as the `conventions` guideline and renders
1216
- between the `akan:agent` markers, so `akan agent install` refreshes it. `AGENTS.md.template` carried a _second_,
1217
- independently written 990-line convention guide — not a copy of the repo's 791-line one, a parallel fork — which
1218
- became the `workspaceOnboarding` guideline. Onboarding renders only outside the framework monorepo, where it would
1219
- otherwise double an always-loaded file for readers who are changing Akan rather than building on it. The two
1220
- guides still overlap and would repay a merge.
1221
-
1222
- **The 20 duplicate Cursor rules are gone.** `akan.mdc` is `alwaysApply: true` plus `@AGENTS.md`, so the per-topic
1223
- `.mdc` files were a second copy of the same rules drifting on their own schedule. This repo had all 20 and no
1224
- `akan.mdc` at all; it now has the pointer and nothing else.
1225
-
1226
- **`akan doctor` reports drift.** The block is stamped with the `@akanjs/devkit` version that rendered it, and
1227
- doctor warns `agent-guide-stale` (or `agent-guide-unstamped`) with `akan agent install agents-md` as the repair.
1228
-
1229
- **`repoName` no longer comes from the folder name.** `WorkspaceExecutor.fromRoot` defaulted to
1230
- `path.basename(process.cwd())`, so every generated file that names the repo — the `AGENTS.md` title, its `- Repo:`
1231
- line — depended on what each person called the directory they cloned into, and the committed diff never settled.
1232
- It now resolves from the `origin` remote, falling back to the directory name when there is no git or no remote.
1233
- `AKAN_PUBLIC_REPO_NAME` is deliberately not consulted: that is a deployment namespace (queue prefixes, cache keys,
1234
- secret paths) which a monorepo hosting several products legitimately points elsewhere.
1235
-
1236
- Two bugs surfaced on the way. `## Validation` listed `akan quality scan` and `akan quality ssr` in a _generated_
1237
- section — hand-added, and due to be wiped by the next install; they are in the generator's list now. And
1238
- `no-throw-raw-error` exempted `apps/akan/env/**` by name, so `apps/minimal/env/*` failed a rule the guide said did
1239
- not apply to `env/`; the exemption is `**/env/**`. Lint output over the whole repo is otherwise byte-identical
1240
- before and after, and formatter output is unchanged.
1241
-
1242
- Biome itself moves to **2.5.8** in the same change, so the shared config targets the current release rather than
1243
- freezing the ecosystem at 2.4.4 — workspaces created before this already installed a 2.5.x, and pinning backwards
1244
- would have made adoption a downgrade. The jump adds 263 diagnostics across the monorepo, but only **32 of them are
1245
- in `apps/` and `libs/`** (30 `noUnnecessaryConditions`, 2 `useArrayFind`) and the rest are in the framework's own
1246
- `pkgs/`. No scope regressed from passing to failing: `akan lint minimal`, the one green scope, is still green, and
1247
- `apps/akan`, `libs/util`, and `libs/shared` were already failing on 2.4.4 with pre-existing errors. Every grit
1248
- plugin was re-verified against 2.5.8. `noUnnecessaryConditions` stays at `error` and now reports 220 repo-wide,
1249
- 190 of them in `pkgs/` — a real backlog, and a deliberate one to leave visible rather than downgrade to a warning.
1250
-
1251
- Existing workspaces keep working untouched — they simply stay frozen at the release that created them, which
1252
- `akan doctor` now reports. The migration guide walks through adopting the change in four steps, only one of which
1253
- needs a human decision.
1254
-
1255
- - ccf2ae2: `akan.config.ts` reaches the native settings a store release needs, and an app keeps a different id on each store.
1256
-
1257
- - `native.android.push` (channel, `smallIcon` relative to the app folder, `color`) and `native.ios.privacy` (the iOS
1258
- privacy manifest) pass through, per target too.
1259
- - `native.icon` takes `{ image, backgroundColor }` and `native.splash` the runtime's `{ image, backgroundColor,
1260
- autoHide, timeout }`, besides a path.
1261
- - `appId` is a string or one per platform — `{ ios, android, default }` — for an app whose listings already carry
1262
- different ids. The app-link files serve each platform's own id.
1263
-
1264
- - 2d8de1c: fix(build): a barrel's own export wins over the same name a star re-export brings when imports are flattened
1265
-
1266
- The `barrelImports` rewrite turns `import { X } from "pkg"` into an import of the file `X` lives in. It read a barrel
1267
- top to bottom and kept the first file it met for each name, so in `export * from "./a"; export { X } from "./c";`
1268
- it sent `X` to `./a` — while in JavaScript a module's own export, named or declared, shadows whatever its stars
1269
- bring, and `import("pkg").X` is `./c`'s. A flattened import could therefore bind a different value than the
1270
- unflattened one. Each module's own exports are now mapped before its stars are walked, which is the ES rule; a name
1271
- two stars both bring still goes to the first. No barrel in this repository had such a name, so its builds are
1272
- unchanged.
1273
-
1274
- - c45ac6c: perf(build): bundle every route's client entries in one pass instead of one per route
1275
-
1276
- `AllRoutesBuilder` ran a `RouteClientBuilder` per route, and each one calls `Bun.build`. Entries were already
1277
- deduplicated globally through `knownEntries` — 169 routes produced 128 client entries — but **chunk splitting is
1278
- scoped to a single `Bun.build` invocation**, so any dependency shared by entries that landed in different
1279
- invocations was emitted once per invocation.
1280
-
1281
- In `apps/akan` that meant four complete copies of mermaid's parser layer. Six client entries reach
1282
- `import("mermaid")` — `pkgs/akanjs/ui/Constant/Mermaid.tsx`, `Constant/Doc.tsx`, `apps/akan/ui/ModalTests.tsx`,
1283
- `Docs/ConstantDocsDemo.tsx`, `Docs/Mermaid.tsx`, `SampleSchema.tsx` — and they were first discovered by four
1284
- different routes, so each pass emitted its own 32-chunk, 868KB copy. The macro payload in `lib/useClient.ts` was
1285
- duplicated the same way.
1286
-
1287
- Discovery now runs for every route first and the collected entries go through one build. Discovery does no
1288
- bundling and is already cached per file, so the extra pass costs almost nothing.
1289
-
1290
- | | before | after |
1291
- | --------------------------- | ------ | ------ |
1292
- | `.akan/artifact/client` | 26 MB | 8.1 MB |
1293
- | `.akan/artifact/client-ssr` | 17 MB | 4.7 MB |
1294
- | chunks | 605 | 258 |
1295
- | mermaid copies | 4 | 1 |
1296
- | build time | 12.9s | 10.1s |
1297
-
1298
- Client entries stay at 128 and the emitted manifest is unchanged: same 169 `routeIds` in the same order, the same
1299
- 151 `clientManifest` keys, and the same 114 `ssrManifest.moduleMap` entries. mermaid is still reached through
1300
- `await import(...)`, so its chunk stays lazy and out of the initial load.
1301
-
1302
- **Only the production path changes.** `AllRoutesBuilder` is constructed once, by `applicationBuildRunner` with
1303
- `command: "build"`. Dev keeps one build per route through `incrementalBuilder`, which is what makes an incremental
1304
- rebuild cheap, and `discoveredEntries` / `clientDepsByEntry` — consumed only there — are untouched.
1305
- `RouteClientBuilder` takes an optional `entries` list that skips discovery; dev never passes it.
1306
-
1307
- - 2d8de1c: fix(build): each reason a failed bundle gives names the file and line it points at
1308
-
1309
- `akan build` and `akan start` listed the bundler's reasons under "Bundle failed" as bare messages, so
1310
- `Could not resolve: "./not-there"` never said which file imported it. Each reason now carries the location Bun
1311
- reports, relative to the workspace root:
1312
-
1313
- ```
1314
- Bundle failed
1315
- Could not resolve: "./not-there" (apps/demo/ui/Broken.tsx:2:22)
1316
- ```
1317
-
1318
- A reason Bun gives no location for prints as before, and a file outside the workspace keeps its absolute path. An
1319
- error a plugin raised while loading a file names that file without a line, unless its message already names it.
1320
-
1321
- - ccf2ae2: fix(dev): the incremental builder's default memory ceiling is 2GB, up from 1.2GB
1322
-
1323
- - With no `AKAN_BUILDER_MAX_RSS_MB` set and no memory limit to take a share of, `akan start` now recycles its
1324
- builder past 2GB instead of 1.2GB. apps/akan's builder peaks near 950MB holding the SSR registry's patcher through
1325
- a route build, and arming CSR adds a second patcher, which left 1.2GB little room above ordinary work.
1326
- - A container limit or `AKAN_MEMORY_LIMIT` still sets the ceiling at 35% of it, and `AKAN_BUILDER_MAX_RSS_MB=0` still
1327
- leaves the builder unbounded.
1328
-
1329
- - 5f53462: fix(cli): scaffolds name their guards, and the mobile and package commands do what they say
1330
-
1331
- Guards and templates:
1332
-
1333
- - The module scaffold's slice is `{ root: Admin, get: Public, cru: Admin }` when the workspace mounts libs/shared,
1334
- and `{ root: None, get: Public, cru: None }` — closed until you name a guard — when it does not; its sample slice
1335
- and the sample app's `inPublic` take `init({ guards: [Public] })`. `cru: Public` is gone.
1336
- - `akan add-mutation` / `add-slice` write `mutation(Boolean, { guards: [None] })` / `init({ guards: [None] })` and
1337
- import `None`, and their surface step returns a review note instead of stopping as unsupported.
1338
- - The sample app's `SignedIn` admits only a caller with an identity (`id`, or libs/shared's `self` / `me`); a guest
1339
- carries an account object too and used to pass. `CurrentUserId` reads the same three places, and the sample's
1340
- task fixtures sign a user in through libs/shared when it is installed. Its spec holds no assertions.
1341
- - Every scaffolded abstract has the current shape — a title, one sentence and `## Rules` — instead of six headings
1342
- of placeholder text: `create-module` writes `# <model> Abstract` with its guard and soft-removal rules,
1343
- `create-service` writes `# <service> Service Abstract` and `create-scalar` `# <scalar> Abstract`, each with a
1344
- placeholder sentence and two placeholder rules. The sample app's task, noti and workHistory abstracts state their
1345
- real invariants instead of describing the module layout. The dead `module/__model__.abstract.md` template is
1346
- removed.
1347
- - `create-crud-page` imports from the module's own client (`@libs/<lib>/client` for a lib module), and
1348
- `create-package` writes a tsconfig that extends the workspace root from any depth and references no missing file.
1349
- - `akan add-field --default now` (and every Date default) writes a thunk, `() => dayjs()`.
1350
-
1351
- CLI and mobile:
1352
-
1353
- - iOS usage-description keys map to Apple's real Info.plist keys (`NSPhotoLibraryAddUsageDescription`,
1354
- `NSPhotoLibraryUsageDescription`, both location-always keys) instead of `NS` + the option name.
1355
- - A non-main server's `assetlinks.json` also lists `<appId>.debug`, so a debug build's App Links can verify.
1356
- - `start-ios` takes `--no-allow-provisioning-updates` (short flag `-a`); every boolean option that defaults to
1357
- `true` now accepts `--no-<name>`.
1358
- - `akan update` installs `@akanjs/cli@<tag>`, the package that provides the `akan` binary.
1359
- - `sync-package` reads package dependencies again (the tsconfig paths start with `./pkgs/`).
1360
- - The quality scanner no longer recommends the nonexistent `akan compact`; `AbstractDoc.compactMinLines` is gone.
1361
- - `--role` lists `federation`, and `--since` names its units.
1362
-
1363
- - 3ebd8e1: feat(lint): enforce the client/server import boundary in both directions
1364
-
1365
- The layering was documented but nothing checked it. A `.tsx` could `import * as db from "../db"`, a `*.service.ts`
1366
- could `import { st } from "@libs/shared/client"`, and a `*.constant.ts` could reach either side — each one a value
1367
- edge that drags the whole opposite graph along. In the client direction that means the database driver,
1368
- `node:crypto`, and any secret resolved from `process.env` land in the browser bundle; in the server direction it
1369
- means React, the store, and the browser globals underneath them load into every CLI command, worker, and migration
1370
- that touches a service. Both usually fail the build rather than failing at runtime, and the failure names a
1371
- transitive module, never the import that caused it.
1372
-
1373
- Two rules now hold the line, symmetric by design:
1374
-
1375
- - `no-import-server-in-client.grit` runs on client files (`ui/`, `webkit/`, `page/`, `*.store.ts`, every `.tsx`) and
1376
- bans `*.document` / `*.dictionary` / `*.service` / `*.signal` modules, `srvkit/`, package `server` entrypoints
1377
- including `akanjs/server`, and the `db` / `srv` / `sig` / `dict` / `option` / `useServer` barrels.
1378
- - `no-import-client-in-server.grit` runs on server files (those four suffixes plus `srvkit/`) and bans `*.store`
1379
- modules, module components (`*.Template` / `*.Unit` / `*.Util` / `*.View` / `*.Zone`), `ui/`, `webkit/`, package
1380
- `client` entrypoints including `akanjs/client`, and the `st` / `store` / `useClient` barrels.
1381
-
1382
- Shared files — `common/` and `*.constant.ts` — are wired into **both** overrides, so they reach neither side, which
1383
- is what makes them safe for either to import.
1384
-
1385
- `import type` is exempt in both directions: it is erased before bundling, so it emits no edge, and a shared file
1386
- that only needs to name a server-side type (`libs/shared/lib/summary/summary.constant.ts` names `UserFilter` from
1387
- `user.document`) stays legal. A mixed value-and-type import is not exempt — it emits a real edge. Test files are
1388
- excluded, as are `pkgs/akanjs/**`, which implements the boundary and is where the two graphs legitimately meet.
1389
-
1390
- Both rules land green: no `apps/**` or `libs/**` file crosses the boundary today, so this is a ratchet, not a
1391
- migration.
1392
-
1393
- - 2d8de1c: fix(cloud): an `akan` command started while another is refreshing the cloud session waits for it
1394
-
1395
- A command that read `~/.akan/config.json` while another process was mid-refresh saw the session with its refresh
1396
- token already taken and went ahead without signing in. It now waits for that refresh under the same lock and uses the
1397
- session it stored.
1398
-
1399
- - 2d8de1c: fix(cloud): a cloud session in its last hour is refreshed, once across every running `akan` process
1400
-
1401
- A stored cloud session within an hour of expiry, or past it, was treated as signed out: nothing ever called the
1402
- refresh endpoint, so `akan login` reopened the browser about once a week and `akan tunnel` answered a raw 401 in
1403
- that window. Every command that reaches the cloud — `login`, `upload-env`, `download-env`, `tunnel` and
1404
- `start --share` — now refreshes such a session before using it, and `akan login` only opens the browser when the
1405
- refresh fails.
1406
-
1407
- The refresh is written for a cloud that rotates the refresh token on every use and treats a second use as theft,
1408
- revoking every session of the account, browser included:
1409
-
1410
- - It runs under a lock beside `~/.akan/config.json`, held across CLI processes, and re-reads the file once it has
1411
- the lock, so of two commands started together only one refreshes and the other uses its result. A lock whose
1412
- holder has exited is taken over; one whose holder is still running is waited for, and a refresh is never made
1413
- without it.
1414
- - The refresh token leaves the file before it is sent, and the new pair is written before it is used. A command
1415
- killed mid-refresh, or a refresh that fails, therefore leaves no token that could be presented a second time;
1416
- the cost is one browser sign-in.
1417
- - Every other write to the file (hosts, remote env servers, test targets) re-reads under the same lock, so none can
1418
- put back a token that was rotated away, and the file is replaced atomically with mode 0600, so a concurrent
1419
- reader never sees half of it.
1420
-
1421
- - 8c31d54: fix: `akan code` says when compaction failed, leaves the Claude Code-sized buffer, and resolves its default model
1422
-
1423
- **A failed compaction read as a successful one.** The engine reports a compaction that failed or was cancelled on
1424
- the same `compaction_end` event as one that worked, with `errorMessage` and `aborted` beside the reason. The wire
1425
- kept only the reason, so every end printed "Compacted the conversation" — including an automatic compaction that
1426
- had failed, which nobody else reports, leaving the next sign of it an overflow error turns later. The `compaction`
1427
- frame now carries `error` and `aborted`, and the transcript prints the engine's own sentence as a warning, or
1428
- "Compaction cancelled.". A failed `/compact` still reports once, through the caller it threw to.
1429
-
1430
- **The buffer is 32,768 tokens, up from the engine's 16,384.** On a million-token window that moves the threshold
1431
- from 98.4% to 96.7% — where Claude Code compacts. The reserve is all the room the response at the threshold gets
1432
- (the request clamps its output to the window less the prompt less 4,096), so at 16k a reasoning model ran out
1433
- mid-thought there and the recovery re-sent a near-full window to retry. It is also the summary's output cap at 80%.
1434
- The small-window warning now reads the settings the session actually runs with rather than the engine's defaults.
1435
-
1436
- **The default model is `deepseek/deepseek-flash`.** `deepseek-v4-flash` is gone from both the engine's catalogue
1437
- and DeepSeek's own model list, so the default resolved to nothing and `akan code` silently ran on whichever model
1438
- sorted first among those with a key.
1439
-
1440
- - 5f53462: fix(console): a production `akan console` brings services up and starts no schedule
1441
-
1442
- The `console.js` an `akan build` writes never marked its process as a console, so `server.start()` took the replica
1443
- branch: it registered every `interval` / `cron` / queue worker, ran every internal `init()`, and opened the log
1444
- transport — a second scheduler inside a running deployment. The shim now marks the process before it loads the
1445
- server, the same way `akan console` does in development, so a console runs service and adaptor `onInit` and nothing
1446
- the internals schedule.
1447
-
1448
- `assertAkanConsoleAllowed()` was handed `server.env`, which carries neither `environment` nor `operationMode`, so it
1449
- effectively checked `NODE_ENV` alone. Called with no argument it now reads the deployment from `AKAN_PUBLIC_ENV` /
1450
- `AKAN_PUBLIC_OPERATION_MODE` (deriving the mode the way `getEnv()` does): a `main` environment, a `cloud` or `edge`
1451
- operation mode, or `NODE_ENV=production` refuses the console unless `AKAN_CONSOLE=1`.
1452
-
1453
- - ccf2ae2: fix(dev): a CSR dev save reaches the open tabs before `app.js` is rewritten, and a tab opened in between boots once
1454
-
1455
- A dev CSR save used to rewrite the whole `app.js` before telling the open tabs about the patch, although only a tab
1456
- that boots later needs it. The patch is now announced first and `app.js` follows. The manifest records which
1457
- generation `app.js` holds (`appGeneration`), and the server holds a booting tab's `app.js?g=N` for up to two seconds
1458
- until the file holds `N`, instead of booting it one generation behind and reloading it again. A build that died in
1459
- that gap leaves `app.js` behind; the next update rewrites it even when nothing else changed.
1460
-
1461
- - ccf2ae2: perf(dev): a CSR patch reaches the tabs before its module files and graph.json are written
1462
-
1463
- The dev registry announced a patch only after writing each changed module's file and the whole `graph.json`, which
1464
- only the next build reads. The patch file and the manifest now go first, and the rest follows the announcement; a
1465
- build that dies in between recompiles those files on its next run, since their mtimes no longer match the graph. The
1466
- dev entry also stopped parsing every page with TypeScript on each save to see whether its default export is async:
1467
- the result is kept per file until the file changes. On apps/akan a component save now reaches the tabs 72ms after the
1468
- builder picks it up, down from about 200ms.
1469
-
1470
- - ccf2ae2: perf(dev): a CSR dev save is patched by the resident builder, without spawning a build worker
1471
-
1472
- - The dev builder keeps the CSR registry's graph, manifest and module factories in memory and compiles a save itself.
1473
- A save no longer pays for a build worker's spawn and imports (about 130ms on minimal) or a pass over every module
1474
- file, and `app.js` is rebuilt from memory after the patch is announced.
1475
- - A save that needs a whole-app build still goes to a build worker, which exits and returns its memory: a first build,
1476
- a config or signal/dictionary change, a new npm module, and an import no recorded resolution answers.
1477
- - The builder works in two lanes. A save's codegen and CSR patch run in one, and the file watcher waits only for it;
1478
- build workers, route builds and client-entry discovery run in the other, where a batch queued behind another folds
1479
- into it. Consecutive saves no longer wait behind each other's pages and css builds, and css now builds before pages.
1480
- - `AKAN_DEV_CSR_PATCHER=off` sends every CSR save to a build worker as before. A builder that dies mid-patch turns the
1481
- patcher off until the dev server next replaces its builder and backend together (a config, signal or dictionary
1482
- change), and says so.
1483
-
1484
- - 69f7178: fix(css): fail the build on a stylesheet import that resolves to nothing, and let a lib own its design tokens
1485
-
1486
- Two halves of the same problem, reported together. An `@import` the pipeline could not resolve was allowed to
1487
- produce nothing, and a lib had nowhere to declare the colours its own components pin — so the workaround was to
1488
- copy one vendor palette into every app's stylesheet, where a single missed import broke that app alone, silently.
1489
- Since vocabulary closure (`@theme { --color-*: initial }`) makes a component whose token declaration never
1490
- arrived render unstyled rather than wrong, the quiet half is the dangerous one.
1491
-
1492
- **Every specifier is verified, path-shaped ones included.** `@import "./missing.css"` and
1493
- `@import "../../../libs/shared/ui/brand.css"` used to be turned into a path without asking whether a file was
1494
- there, surfacing later as a bare `ENOENT` that names no importer — or, in the dev server, as one log line while
1495
- the previous CSS kept serving. They now raise the same `[css] failed to resolve stylesheet import "…" from …`
1496
- error a bare specifier already did, naming the path that was tried.
1497
-
1498
- **A package subpath resolves literally or not at all.** `@import "@libs/shared/ui/brand.css"` fell back to the
1499
- package's own `style` entry (`pkg.exports["."].style`, `pkg.style`, `index.css`) when the subpath was not in
1500
- `exports` — loading a _different_ stylesheet than the author asked for and reporting success. The fallback now
1501
- applies only to the bare package name.
1502
-
1503
- **`libs/<lib>/ui/tokens.css` is the one CSS file a lib owns.** Plain `:root` custom properties for colours pinned
1504
- by someone else's brand guide — Kakao `#fee500`, Naver `#1ec800` — or by a fixed surface. Every app whose page
1505
- graph reaches that lib compiles the file automatically, ordered ahead of the app's own stylesheets so the app
1506
- stays the last word on any variable both declare. Nothing is imported by hand and adding an app cannot forget it.
1507
- Reference them as `bg-[var(--kakao)]`, which `no-arbitrary-color` allows by design; `@theme` extensions stay in
1508
- the app stylesheet, because the colour vocabulary is closed per stylesheet.
1509
-
1510
- **A stylesheet under `page/` that no route imports now warns.** It compiles to nothing and reports success, which
1511
- reads exactly like an empty theme — the failure the two fixes above cannot see, because nothing ever asked for
1512
- the file.
1513
-
1514
- **An `@import` that resolved, was read, and still contributed nothing now warns twice over.** Custom properties
1515
- declared outside `@theme` pass through Tailwind verbatim, so a stylesheet whose every declaration is missing from
1516
- the output did not make it in, whatever dropped it — the last shape of this bug that no check upstream of the
1517
- output can see. The compiled text is checked per compiled stylesheet, and the written asset is checked again
1518
- against the imports of its own base path, because those are two different places a declaration can go missing: a
1519
- build that ships a token to the CSR bundle and not to `styles/<base>-<hash>.css` renders unstyled on a
1520
- server-rendered page while looking correct in the browser bundle. Each resolution also logs at `verbose` with the
1521
- specifier, the importer, the resolved path, and the byte count.
1522
-
1523
- A name that survives only because something else declares it — an app overriding a lib token, which is the
1524
- ordering this release introduces — keeps the check quiet: the warning fires only when _no_ declaration of the
1525
- imported file's own names is present anywhere in the asset.
1526
-
1527
- - 22aa04f: fix(devkit): stop a labelled tuple type from wiping every variant out of the build
1528
-
1529
- Since arbitrary variants were kept whole, a candidate could open with `[`, which also made every
1530
- labelled tuple type in the tree look like a Tailwind arbitrary property —
1531
- `[key: string, make: () => unknown]` in `constant/getDefault.ts`,
1532
- `[setQueryArgs: (...) => QueryArgs, options?: FetchPolicy]` in `store/action.ts`. Tailwind compiled each
1533
- into a rule whose declaration was TypeScript, and the lightningcss pass in `optimize()` could not parse
1534
- it. Its error recovery does not stop at the offending rule: on `apps/minimal` it took 33KB of the
1535
- stylesheet with it, and what it took was **every variant** — no `hover:`, no `focus-visible:`, no
1536
- `disabled:`, no `sm:`/`md:`, no `dark:`, in a build that reported no error.
1537
-
1538
- What that looked like: buttons and badges with no hover or press feedback, inputs with the browser's
1539
- own blue focus ring because `focus-visible:outline-none` was gone, a Switch whose knob never moved, a
1540
- Tooltip that never appeared, a Popconfirm that lost its offset, and modals stretched to full width with
1541
- their `sm:`/`md:` sizing missing. All of it from two type annotations.
1542
-
1543
- Brackets in a candidate may no longer contain whitespace. Tailwind spells a space in an arbitrary value
1544
- `_`, so nothing legitimate is lost — `[&_td]:px-3` and `[&>*]:gap-2` still scan whole — while a tuple
1545
- type, which always has a space after its `:`, no longer reaches the compiler. The cache version is
1546
- bumped so extractions cached under the old pattern are re-read.
1547
-
1548
- - 5f53462: `akan start` sizes its boot wave against the machine instead of always booting one app at a time.
1549
-
1550
- - With no `--concurrency`, the wave is `min(apps, half the memory budget / ~1.8GB per app, cores / 4)` and never
1551
- below one, so a laptop boots its apps together while a small container still staggers them — which is the case
1552
- the old default of 1 existed for. 1.8GB is a cold boot's peak: the SSR registry's boot build adds a build worker
1553
- to every boot, and apps/akan's whole dev host peaks at about 1.76GB.
1554
- - The next wave starts once each app of the previous one serves and its builder's boot builds have settled — the SSR
1555
- registry's, and CSR's when `AKAN_DEV_CSR_REBUILD=1` arms it — or 30 seconds after it serves. The app shows as ready,
1556
- and `--open` opens it, as soon as it serves.
1557
- - The memory budget is the smaller of the host's RAM and `AKAN_MEMORY_LIMIT` / the cgroup limit. `os.freemem()` is
1558
- not consulted: it counts free pages rather than reclaimable ones and reports ~0.3GB on an idle 48GB laptop, which
1559
- would pin every machine to one app at a time.
1560
- - The session prints the wave size and what set it, so a boot that still waits app by app says why.
1561
- - `--concurrency <n>` is unchanged as an override and is clamped to the number of apps selected.
1562
-
1563
- - ccf2ae2: feat(dev): a dev save now says where its HMR latency went
1564
-
1565
- - Each save carries epoch-ms marks from the file watcher to the page: the first fs event and the watcher's flush,
1566
- the builder picking the batch up, the build worker's spawn, start and imports, the update on disk, the send, the
1567
- backend's broadcast, and the page receiving and applying it. The page keeps the last 64 in `__AKAN_HMR_TRACES__`.
1568
- - `AKAN_DEV_WATCH_DEBOUNCE_MS` sets how long the watcher collects changes before it hands a batch over.
1569
-
1570
- - ccf2ae2: The dev module registries load packages that used to take the whole vendor file down with them
1571
-
1572
- - A module that reads `import.meta` (jotai's and zustand's ESM builds) no longer makes the vendor file a SyntaxError:
1573
- `import.meta` is the module's own `{ url }`, as in a browser module, with no `env`, so an `import.meta.env` check
1574
- branches as it does in the ESM bundle. `import.meta.url` is an http URL instead of this machine's `file://` path.
1575
- - A package esbuild already bundled (the `@mermaid-js/parser` chunks) keeps its own `__reExport` / `__toESM` helpers
1576
- instead of stopping the registry build, and a package file's `#!` line no longer breaks its vendor file.
1577
- - A file the browser build tree-shook away (vfile, behind a side-effect-free barrel) resolves its imports with the
1578
- browser condition, and a package `browser` field mapping a file or a module to `false` gives an empty module;
1579
- neither reaches a Node built-in stub that throws at startup.
1580
- - Every module factory is parsed as a classic script before it is written. A package file that cannot be one (a
1581
- top-level await, or anything else a script cannot hold) is left out and named in the dev log, and requiring it
1582
- throws why, where it used to fail the whole registry or drop every module of its vendor file in the browser; app
1583
- code that cannot be one still fails the build. A registry built before this rebuilds once.
1584
-
1585
- - 2d8de1c: fix(start): a route whose client code fails to bundle says why
1586
-
1587
- `akan start` bundles a route's client components the first time the route is requested. When the bundler refused
1588
- them — an import that does not resolve, a syntax error — the builder reported only the bundler's own message,
1589
- "Bundle failed", in the request's error, the build status and the dev log alike. It now lists the bundler's reasons
1590
- under it, the way `akan build` and the rest of the dev build already did:
1591
-
1592
- ```
1593
- Bundle failed
1594
- Could not resolve: "./not-there" (apps/demo/ui/Broken.tsx:2:22)
1595
- ```
1596
-
1597
- - 69f7178: fix(dev): `akan start` is the dev server even when the environment says `NODE_ENV=production`
1598
-
1599
- An ambient `NODE_ENV=production` turned every route of the dev server into a 500:
1600
-
1601
- ```
1602
- [SSR] render failed scope=/en/: [SSR] route /:lang missing from production artifact — rebuild with `akan build` to include it
1603
- ```
1604
-
1605
- `WebRouter` picked its mode from `NODE_ENV` alone, so it installed the production route cache — the one whose
1606
- `buildRoute` throws because `akan build` was supposed to have written a routes manifest already. A dev artifact
1607
- never has one, so nothing could render, and the same ambient value also sent the gateway's runtime directory to
1608
- `<workspace>/runtime` and baked production React into the dev bundles.
1609
-
1610
- The value does not have to be exported to arrive: Bun auto-loads the workspace `.env`, so a `NODE_ENV=production`
1611
- line in a downloaded env file reaches the CLI while `env | grep NODE_ENV` in the shell stays empty. A CI image
1612
- default or a container base image does the same.
1613
-
1614
- **The command now outranks the environment.** `akan start` pins `NODE_ENV=development` for the processes it
1615
- spawns and for the in-process builder that bakes the value into dev bundles; `AkanApp` resolves a child's
1616
- `NODE_ENV` from `AKAN_COMMAND_TYPE` before falling back to the inherited value; and `WebRouter` refuses the
1617
- production branch outright while dev-hosted, warning once that it did rather than failing every request. Running
1618
- a built artifact (`bun main.js`, Docker) is untouched — it carries no command type and keeps honouring
1619
- `NODE_ENV`.
1620
-
1621
- - bf27773: fix(cli): stop `akan start` from leaving the terminal in raw mode, which killed Ctrl+C
1622
-
1623
- A dev server that had been running for a few minutes stopped responding to Ctrl+C. The cause was not
1624
- signal handling — the terminal had been left in **raw mode**, so with `isig` off the tty never turned
1625
- `^C` into SIGINT at all. `kill -INT <pid>` still ended the process instantly, which is the tell.
1626
-
1627
- A Bun child snapshots the controlling terminal's termios when it is spawned and writes that snapshot
1628
- back when it exits. ora's `discardStdin` holds the terminal raw for as long as a spinner runs, and the
1629
- dev host spawns the builder and the backend under the "Preparing backend..." spinner — so those
1630
- children snapshot a raw terminal. The spinner then restores it and Ctrl+C works, which is why a fresh
1631
- `akan start` behaved. The first dev-host recycle (an `akan.config.ts` change, or regenerated runtime
1632
- metadata such as `dict.ts` / `sig.ts`) SIGTERMs the builder, and its exit writes the stale raw termios
1633
- back over a terminal nobody restores again. `Spinner` no longer takes stdin.
1634
-
1635
- Two nearby hazards with the same symptom are fixed as well.
1636
-
1637
- `Spinner` refuses to animate against a tty that reports **0 columns** — an unsized pty, which CI
1638
- runners, `expect`/`script` harnesses and some detached panes produce. ora sizes its clear loop as
1639
- `ceil(lineWidth / stream.columns)`, so zero made it `Infinity`: measured 750MB of cursor moves and
1640
- 8.7GB RSS inside a minute, in a loop past the point where SIGINT or SIGTERM could be handled, leaving
1641
- SIGKILL as the only way out. Such a terminal now gets plain lines.
1642
-
1643
- `akan start`'s local-database teardown no longer hangs the exit. Registering a SIGINT listener
1644
- replaces the kernel's "terminate now", so that handler became the only thing that could end the
1645
- process — and it exited only if `docker compose down` succeeded. The teardown is now bounded
1646
- (`ApplicationScript.dbShutdownTimeoutMs`, 20s), the exit runs even when it fails or times out, and a
1647
- second Ctrl+C abandons it instead of queueing behind the first.
1648
-
1649
- - ccf2ae2: perf(dev): a save starts building 50ms sooner
1650
-
1651
- The dev file watcher collected changes for 80ms before handing a batch over, the largest fixed wait in a save once the
1652
- build is fast. It now waits 30ms. Measured on minimal, a CSR component save went from 340ms to 278ms, and a second write
1653
- 30ms after the first (a format-on-save) still produced one update, because the build reads the file's latest content.
1654
- `AKAN_DEV_WATCH_DEBOUNCE_MS=80` restores the old window.
1655
-
1656
- - 2d8de1c: fix(devkit): executor, doctor, barrel and code-agent fixes from the devkit/cli bug sweep
1657
-
1658
- - **Workspace apps, libs and packages are listed in name order**, not in the order the file system answered. It
1659
- shows in pickers, `akan context` / `akan doctor` listings, the `## Workspace` lines `akan agent install` writes,
1660
- and the order a lib's `docker.preRuns` / `postRuns` land in a generated Dockerfile, which is now the same on every
1661
- build.
1662
- - **Barrel import rewriting no longer drops re-exports when two barrels are analyzed at once.** Concurrent analyses
1663
- shared one regex position, so a build could leave an import on the whole barrel, differently from build to build.
1664
- - **`akan doctor`, `akan workflow validate` and MCP `doctor_workspace` ignore a malformed workflow artifact** instead
1665
- of throwing a `TypeError`.
1666
- - **`SysExecutor`'s module listings filter on each module's own file** — they returned every folder — and find a
1667
- service module at `lib/_<name>/<name>.service.ts`. `getScalarDictionaryFiles` reads `lib/__scalar/`, and
1668
- `getTsConfig({ refresh: true })` re-reads the config it extends.
1669
- - `akan code`: a prompt typed instead of answering drops the questions and approvals it replaced, a session past
1670
- 512 KiB still shows in `/sessions`, and an MCP token refreshed without `expires_in` is kept until the server
1671
- refuses it instead of being refreshed on every connect.
1672
-
1673
- - 2d8de1c: fix(devkit): stop re-exporting `lowerlize` from `@akanjs/devkit/workflow`
1674
-
1675
- The re-export was CLI plumbing that leaked through the facet's `export *`: it existed so one CLI script could
1676
- import it, and that script has imported it from `akanjs/common` for a while. Nothing else used it. The function
1677
- itself is unchanged — import `lowerlize` from `akanjs/common`, which is where it always lived.
1678
-
1679
- - ccf2ae2: fix(dev): a page that quotes `export default function` in a code snippet builds for the CSR dev page
1680
-
1681
- The Fast Refresh rewrite of `export default function Name(` also rewrote the same text inside a template literal or a
1682
- block comment, and appended a second `export default` for it. The CSR bundle refused the result with `Multiple
1683
- exports with the same name "default"`, so `?csr=true` failed on any page quoting such a component — eight docs pages
1684
- in the akan app — while SSR rendered them. Only a declaration the parser reports as an export is rewritten now.
1685
-
1686
- - 69f7178: fix: the first field run's findings — request context, module identity, and an honest agent surface
1687
-
1688
- Six fixes from running the in-page agent on a real product app, plus the one its own docs app hit.
1689
-
1690
- **Server components see the request again.** The RSC worker wrapped a render in `requestStorage.run(...)` only,
1691
- and the flight stream pumps components after that scope has exited — every `getSelf()` read no cookies and
1692
- bounced authed pages to `/signin`. The worker now keeps a request fallback pushed until the render settles, the
1693
- same discipline `ssrFromRscRenderer` already used. The stack is global and last-push-wins across concurrent
1694
- renders; pumping the flight render inside the ALS scope itself is the follow-up that removes the caveat.
1695
-
1696
- **`akanjs/fetch` is a vendor shared module.** It was bundled separately into the app and the vendored
1697
- `akanjs/store` chunk, so `FetchClient`'s static serialized-signal registry split in two and the agent catalogue
1698
- silently read the empty copy — every endpoint-named action refused as undescribed. The registry also moved to a
1699
- `globalThis` symbol (the anchoring the shared client proxy already had), so a future duplicated module instance
1700
- degrades to nothing instead of an empty surface.
1701
-
1702
- **The relay's return scalar registers on the client graph.** `agentTurn` lived in `akanjs/signal`, which no
1703
- client bundle loads, so the chat's first probe of `fetch.runAgentTurn` threw `No scalar constant model for
1704
- agentTurn`. The scalar now lives in `akanjs/fetch` and `FetchClient` itself force-registers it — Bun links a
1705
- barrel's `export *` modules lazily per used binding and its transpiler drops unused imports, so only a real call
1706
- survives to do that.
1707
-
1708
- **`labelOf` reads the `text: "title"` role as the `Set` it is.** It asserted `readonly string[]` and called
1709
- `.find`, so every screen-context label on a search-indexed model threw.
1710
-
1711
- **`akan build` relaunches itself once with the app env in place.** Bun macros snapshot `process.env` at process
1712
- start, so the env the build resolves and publishes later is invisible to them — and any hand-written
1713
- `@libs/<lib>/server` import (the sanctioned cross-lib entrypoint) puts that lib's env files, which read
1714
- `getEnv()` at module scope, into the `getSerializedSignal` macro graph. `AKAN_PUBLIC_APP_NAME` is the one
1715
- required key a workspace root `.env` cannot carry, so the CLI build now spawns itself again with it set and the
1716
- child does the real build — the `AKAN_PUBLIC_APP_NAME=<app> akan build <app>` workaround is built in. The
1717
- relaunch decision compares the env the process was **born** with, never the live `process.env`: the command
1718
- dispatcher writes the resolved app name into `process.env` before any command method runs, which satisfies
1719
- runtime readers but not macros — a guard reading the live value never fires (that inert shape is what alpha.19
1720
- shipped). A `Relaunching with AKAN_PUBLIC_APP_NAME=…` line in the build output is the observable proof. The
1721
- generated `sig`/`dict`/`srv`/`db` barrels also stopped walking parent _server_ barrels (they import the lib's
1722
- own `@libs/<lib>/lib/<facet>` modules after `akan sync`), and `FetchClient.from` resolves its origin tolerantly,
1723
- so a lib whose graph stays clean serializes with no env at all.
1724
-
1725
- **The agent surface stops publishing two lies.** Form setters for the base document fields (`setIdOnX`,
1726
- `setCreatedAtOnX`, `setUpdatedAtOnX`, `setRemovedAtOnX`) are no longer tools — the server stamps those. And an
1727
- action named after an endpoint is published with the endpoint's schema only when it declares at least as many
1728
- parameters: one declaring fewer would silently drop the borrowed tail and read stale form state, which shipped a
1729
- resident SMS with the wrong unit number in the field run. Such an action is refused by name and warned once in
1730
- the console; trailing extras beyond the endpoint's arguments stay legal, which is the generated
1731
- `create<Model>(data, options?)` shape.
1732
-
1733
- - 5f53462: The guideline set drops what only the removed code generator read
1734
-
1735
- Six guidelines existed for `AiSession`'s codegen contract and nothing else, and are gone:
1736
- `docPageRule`, `docSyncRule`, `moduleCodegen`, `enumConstant`, `sharedUiUsage` and `utilUiUsage`. Nothing in the
1737
- workspace or in any skill named them, and their bodies asked the model for a `// File: <path>` block contract that
1738
- an agent with edit tools cannot use. `akan-module` no longer offers `moduleCodegen` as a deeper read.
1739
-
1740
- Every `<name>.generate.json` is deleted, along with `Prompter.getGuideJson` and the `GuideGenerateJson` /
1741
- `GuideScan` / `GuideUpdate` types `@akanjs/devkit` re-exported. The `codegenPriority`, `scans` and `update.rules`
1742
- fields they carried were read by nothing after the generator left; the only consumer was `akan guideline show
1743
- --format json` echoing them back.
1744
-
1745
- `akan guideline` therefore loses its `--format` option — `list` prints names and `show` prints one instruction,
1746
- which is what both did in their default mode anyway. Guideline names drop from 35 to 29. What remains is the
1747
- deep-dive set the `AGENTS.md` table points at, plus the three documents `akan agent install` composes the
1748
- workspace guide from (`conventions`, `workspaceOnboarding`, `framework`). MCP `get_guideline`, the
1749
- `akan://guidelines/<name>` resources and the `akan guideline list` / `show` commands are unchanged otherwise.
1750
-
1751
- - 69f7178: feat(config): a lib's `externalLibs` reaches every app in the workspace
1752
-
1753
- `libs/<lib>/akan.config.ts` has always accepted `externalLibs` — it typechecks, `AkanLibConfig` resolves it, and the
1754
- lib scan result carries it — but nothing ever read the value back. All three consumers (the backend and rsc-worker
1755
- bundle externals, the SSR pages bundle, and the production `package.json` dependencies) read the _app_ config, so a
1756
- lib wrapping a runtime-sensitive dependency had to ask every app to repeat the declaration. Forgetting one surfaced
1757
- as a native package bundled into the app rather than as an error.
1758
-
1759
- An app's `externalLibs` is now its own declaration plus every lib's, deduped with the app's entries first. A
1760
- workspace where no lib declares one resolves exactly as before.
1761
-
1762
- The libs are read workspace-wide rather than narrowed to the app's own dependencies. That set comes from the
1763
- dependency scan, and the incremental page rebundle re-reads this config on every file change from a child process
1764
- that never scans — so narrowing it would put a full dependency scan in the hot path. The trade is that a lib's
1765
- declaration also lands in the production dependencies of an app that does not use that lib.
1766
-
1767
- `LibExecutor.getConfig({ refresh: true })` now busts the module import cache the way the app config already did, so
1768
- a `libs/<lib>/akan.config.ts` edited while the dev server runs is re-read instead of returning the first-loaded
1769
- module.
1770
-
1771
- - 69f7178: fix(sync): hold libraries to the root layout allowlist, and check a library's own `page/` tree
1772
-
1773
- `apps/<app>/base` was refused by `akan sync`, `akan doctor` and `akan quality scan`; `libs/<lib>/base` passed all
1774
- three. The rule lives in one file — `workspaceLayout.ts` exists precisely so the three tiers cannot disagree — but
1775
- the call sites read it behind `exec.type === "app"` / `for (const app of context.apps)` / `segments[0] === "apps"`,
1776
- so a library root was never compared to anything at all. A lib could carry a `base/`, a `helper.ts`, a stray
1777
- `script/`, and every command stayed green.
1778
-
1779
- Libraries now answer to their own allowlist, and it is the app's minus what only an app can use: no `main.ts`, no
1780
- `capacitor.config.ts`, no `.akan` / `android` / `ios` / `mobile` / `script` / `secrets`, because a library is never
1781
- booted or packaged. `index.ts`, `README.md` and `tsconfig.spec.json` are added, since a library ships as a package.
1782
- `public/` and `private/` stay, because `syncAssets` symlinks them into each consuming app.
1783
-
1784
- Three more places the same gate was one-sided:
1785
-
1786
- - `akan doctor` walked `context.apps` only. It now walks libraries too and reports `lib-root-unknown-entry` beside
1787
- the existing `app-root-unknown-entry`.
1788
- - `akan quality scan` warned on an unexpected app root _file_ and nothing else — not a library root file, and not a
1789
- root _folder_ on either side, which is the shape `base/` actually takes. It now reports all four
1790
- (`akan.layout.{app,lib}-root-{file,folder}`). Its `lib/` facet rule kept its own copy of the allowlist and flagged
1791
- a `<model>.signal.test.ts` that `akan sync` explicitly permits; both now read the shared helper, and the rule is
1792
- renamed `akan.layout.lib-facet-file` so its name no longer collides with the library root it was never about.
1793
- - A library's `page/` folder was validated only once an app opted into it with `syncPageLibs`. An app checks route
1794
- filenames in `getPageKeys`, which a library has no equivalent of, so `libs/<lib>/page/Component.tsx` synced clean
1795
- in the library it belongs to and failed in somebody else's app. `akan sync <lib>` now reports it as a scan
1796
- violation, from the same rule `validatePageSourceFile` throws — split out as `getPageSourceFileViolation` so the
1797
- reason is available where throwing is the wrong answer.
1798
-
1799
- - 69f7178: fix(lint): scope the module plugins to apps/libs, downgrade `noUnnecessaryConditions`, and stop truncating at 20
1800
-
1801
- Four reports from one workspace migration (5 apps, 11 libs, ~2,950 linted files), all in what the shared config
1802
- and `akan lint` do rather than in what a rule finds.
1803
-
1804
- **`noUnnecessaryConditions` ships as `warn`.** Biome 2.5.8's inference, with `domains.types: "all"` on, is wrong
1805
- on three shapes this framework uses everywhere — reproduced here, not taken on report: `useRef(false).current`
1806
- narrowed to its initial literal, `useRef<HTMLTextAreaElement>(null).current` treated as non-null, a `#private`
1807
- boolean flag narrowed the same way, and `RegExp.prototype.exec()` treated as non-nullable. Of 86 findings in the
1808
- reporting workspace 65 were of those shapes, where deleting the guard is a null dereference. The 21 real findings
1809
- are worth keeping, so the rule stays on as a warning rather than being dropped.
1810
-
1811
- **The akan-module plugins apply to `apps/**`and`libs/**` only.** `no-import-external-library` was scoped to a
1812
- bare `**/index.ts`, so it fired on any package entry in the workspace — a Hardhat package whose public surface
1813
- genuinely _is_ third-party types had no way out but a nested `biome.json` for the whole subtree, which replaces
1814
- the parent's config rather than merging. Same scoping for `no-deep-internal-import`,
1815
- `no-redeclare-predefined-endpoint`, `no-return-in-store-action`, `no-js-private-class-method`, and the
1816
- server-component plugins. `no-bang-comment-in-client` stays broad on purpose: it is about browser-reachable code,
1817
- not about akan module conventions, and a `//!` shipping to every visitor is no better in a plain package.
1818
-
1819
- **`**/lib/\_\_lib/**` joins the generated-file override.** It is scaffolded, gitignored, regenerated by `akan sync`,
1820
- and unused-import-clean by construction — so `biome check --write` stripped the imports and the next sync put
1821
- them back, 116 diagnostics per lap.
1822
-
1823
- **`akan lint` prints up to 200 diagnostics** and takes `--max-diagnostics <n>` (`0` for no limit). Biome's default
1824
- is 20; a run that shows 20 of 44 reads as "20 problems left", so a change in the _mix_ of findings looks like
1825
- progress.
1826
-
1827
- **`akan lint` pins the config path.** `biome.json` is strict JSON, and a JSONC comment in it makes Biome 2.5.8
1828
- fall back to config discovery instead of reporting the parse error — it then aborts on whatever nested root
1829
- config the walk finds, typically inside a directory `files.includes` excludes, naming a file the author never
1830
- touched. With `--config-path` the parse error lands on the offending line. `Linter` and the workspace runner also
1831
- accept `biome.jsonc`, which is where a comment is legal, and the workspace template now excludes `.claude` so an
1832
- agent worktree's stale config is not in the walk to begin with.
1833
-
1834
- Grit plugin diagnostics _are_ suppressible, contrary to the report: the category is `lint/plugin`, so
1835
- `// biome-ignore lint/plugin: <reason>` and `// biome-ignore-all lint/plugin: <reason>` both work. The bare
1836
- `// biome-ignore plugin:` form Biome's own diagnostic label suggests does not. Written down in the agent guide.
1837
-
1838
- - 5f53462: A server-side loopback fetch follows the port the process was actually run with, so a container started with
1839
- `PORT=80` renders instead of failing every page with `base.error.serverUnreachable`.
1840
-
1841
- - `getEnv().serverPort` fell back to a literal `8282` on the server side, and only `akan start` ever set
1842
- `AKAN_PUBLIC_SERVER_PORT`. A production image overriding the Dockerfile's `ENV PORT=8282` therefore bound one
1843
- port and pointed the RSC worker's `fetch.*` at another; the SSR render failed on every route, with no other
1844
- symptom than the transport error. When the origin resolves to `localhost` — the self-call — the port now comes
1845
- from `PORT`. A `SERVER_HOST` naming another host is not a self-call and keeps the explicit port, and
1846
- `AKAN_PUBLIC_SERVER_PORT` still outranks both.
1847
- - `AkanApp` publishes the port it resolved as `PORT` to the replica it runs in-process and to every child it
1848
- spawns, so `new AkanApp({ port })` reaches the tree the same way the env var does. In solo mode that is also
1849
- what makes the option bind: `AkanServer` reads `PORT`, so an explicitly configured port was previously ignored.
1850
- - `akan build` no longer publishes `AKAN_PUBLIC_CLIENT_PORT` / `AKAN_PUBLIC_SERVER_PORT` into the build process's
1851
- own env. Bundling `define`s every `AKAN_PUBLIC_*` into a literal, so with `PORT_OFFSET` set the builder's dev
1852
- port was baked into the artifact, where no deployment env could override it.
1853
-
1854
- - 2d8de1c: fix(code): an MCP server that refuses a stored token gets one refresh before `akan code` asks for a sign-in
1855
-
1856
- `akan code` refreshed an MCP server's token only when the stored expiry said it had run out. A server that refused
1857
- the token earlier — it was revoked, or it was a refreshed token the server issued with no lifetime, which is kept
1858
- until refused — sent the session straight to `sign-in needed · /mcp login <name>`, even though the stored refresh
1859
- token would still have worked.
1860
-
1861
- On a 401 at connect, a server holding a refresh token now gets exactly one refresh (or the token another session
1862
- already stored since), and the connect is retried with it. Only when that refresh is refused, or the new token is
1863
- refused too, is the server listed as needing a sign-in. A 401 is never retried a second time, so a server that
1864
- refuses every token costs one refresh, not a loop.
1865
-
1866
- - 2d8de1c: fix(code): an MCP tool call refused mid-session refreshes the token once and retries
1867
-
1868
- `akan code` refreshed an MCP server's token only while connecting. A token that expired or was revoked during a
1869
- long session made every call to that server fail with `MCP server "<name>" requires authentication`, which named no
1870
- way out, until the session was reloaded.
1871
-
1872
- A call answered 401 now gets one refresh (or the token another session stored since), reopens the server with it —
1873
- on a new streamable HTTP session, since a server may bind its session to the token that opened it — and is retried
1874
- once. If the refresh is refused, or the new token is refused too, the call fails with `MCP server "<name>" needs
1875
- signing in — /mcp login <name>`, and later calls to that server answer the same without refreshing again.
1876
-
1877
- Calls refused together share one refresh, and so does every connection in the process that would present the same
1878
- refresh token — a sub-agent's, or one opening with an expired token — because a server that rotates refresh tokens
1879
- may revoke the whole grant when one is presented twice. The token file's format and location are unchanged.
1880
-
1881
- - 2d8de1c: fix(code): two `akan code` sessions refreshing the same MCP token make one refresh between them
1882
-
1883
- Every `akan code` process refreshes an MCP server's token itself, from the one token file they all share. Two
1884
- sessions whose calls were refused at the same moment each presented the same refresh token, and a server that
1885
- rotates refresh tokens refuses the second use — signing that session out, or revoking the whole grant.
1886
-
1887
- A refresh now runs under a lock file beside the token file (`mcpAuth.json.lock`, the same kind of lock `akan login`
1888
- takes on `~/.akan/config.json`). The token is read again once the lock is held: if another session already replaced
1889
- it, that token is used and no refresh is made. A lock left by a process that died is taken over; one a live process
1890
- holds for more than 30 seconds reads as a failed refresh. The token file's format and location are unchanged.
1891
-
1892
- - 2d8de1c: fix(code): `/mcp remove` says when the home file still declares the server, and honours `--local`
1893
-
1894
- `akan code` reads MCP servers from two files — `~/.akan/code/mcp.json`, which every repo reads, and the repo's
1895
- `.akan/code/mcp.json`, which wins a name both declare. `/mcp remove <name>` takes the repo's entry first, so on a
1896
- name both files declare the home file's declaration took over after the reload, possibly with a different command
1897
- or url, while the notice read only "removed X from the workspace file". The notice now adds that the global file
1898
- still declares it, so it still applies, and that running `/mcp remove X` again removes that one too.
1899
-
1900
- `--local` was accepted by `/mcp remove` and ignored. It now means what it means for `/mcp add`: this repo's file
1901
- only. A name only the home file declares is left alone, and the reply says where it is declared.
1902
-
1903
- `McpServerConfig.remove(workspaceRoot, name, only?)` takes the scope as an optional third argument; without it the
1904
- lookup order is unchanged. The `akan-code` skill's manual now names both files and both flags.
1905
-
1906
- - 2d8de1c: fix(code): `/mcp` says `sign-in needed` for a server whose token stopped working mid-session
1907
-
1908
- An MCP server whose token could not be renewed during a session answered every tool call with `needs signing in —
1909
- /mcp login <name>`, but `/mcp` kept listing it as `signed in` — the state from when the session connected. Its row
1910
- now turns to the same `sign-in needed · /mcp login <name>` a failed connect shows, and `/mcp <name>` says it needs
1911
- signing in instead of listing tools that cannot answer; a server that failed to connect for want of a sign-in no
1912
- longer claims it "connected and published no tools" there either. `/mcp login <name>` (or `/mcp reload` once a
1913
- usable token is stored) reopens the session, and the server reads as signed in again.
1914
-
1915
- - ccf2ae2: fix: a native target's dev build has its own output folder
1916
-
1917
- `akan start-ios`, `start-android` and `start-desktop` without `--release` built into the same
1918
- `.akan/native/<target>/build/<platform>` as `build-ios`, `build-android`, `build-desktop` and `--release`, so a dev
1919
- session deleted the release build there, a desktop installer included, and put a dev build under its name. Dev builds
1920
- now go to `.akan/native/<target>/dev/<platform>`; the first dev session after the update builds from scratch once.
1921
-
1922
- - ccf2ae2: `akan start-desktop`, `start-ios` and `start-android` print a page's log once, at the level it was logged, and say a
1923
- boot came up in one line
1924
-
1925
- - A boot that comes up prints `cmdc ios ready · iPhone 16 · http://localhost:8283 · 12.4s` and nothing else; its steps
1926
- (prepare, build, install, launch) are debug. A boot that fails prints every step it took ahead of the error. A native
1927
- config warning still prints as it happens.
1928
- - A page line reads `WARN [page:WsClient] WebSocket message process failed …`: stamped once by the CLI's logger, at
1929
- the page's own level, with no `[default]` label, no empty line after it, and a multi-line message kept together. A
1930
- page logger writes `[Name] message` at the console method of its level inside a native shell, and the desktop host
1931
- and iOS tag each line `[page<+><#window> <level>]` for the CLI to read back.
1932
- - Android forwards the page console through the bridge in a dev build too, so logcat carries each line at its level
1933
- and a `console.error("%s", …)` substitution the way the devtools show it; iOS writes os_log at the page's level. An
1934
- uncaught error forwards its message along with WebKit's frames, which carry none.
1935
- - Frame tracing (`[akan:frame:…]`) is opt-in (`?akanFrameDebug=1` or `localStorage["akan:debug:frame"] = "1"`) and
1936
- logs at debug, once per event; a mobile or desktop target no longer turns it on for every visibility change.
1937
- - Lines no page or host wrote (the simulator, WebKit) and where the host's pages come from are debug; `--verbose` shows
1938
- the former. `start-desktop` and friends ask a dev server whose builder idled out for its health, not its home page,
1939
- so they no longer report it missing while it wakes.
1940
-
1941
- - c45ac6c: fix(lint): stop `//!` markers from shipping to the browser
1942
-
1943
- Bun's bundler classifies `//!` and `/*!` as legal comments — the `@license` / `@preserve` class it must preserve
1944
- for licence compliance — and keeps them through `minify: true`. Everything else goes: `//`, `/* */`, `//*`, `//?`,
1945
- and `// TODO:` are all stripped. But the workspace `AGENTS.md` prescribes `//!` as in-code marker 4, "disabled or
1946
- must-fix code", so the convention itself guaranteed that internal notes about broken and unfinished code shipped
1947
- verbatim to every visitor. A deployed app served eight of them in one chunk, including `//!env로 옮겨야함`,
1948
- `//!need to change`, and `//! Need to fix after bunjs migration`.
1949
-
1950
- There is no bundler-side fix: `legalComments` is not a `Bun.build` option, and `Bun.Transpiler.transformSync`
1951
- preserves `//!` too. The source is the only place to stop it.
1952
-
1953
- `no-bang-comment-in-client.grit` now bans the marker in browser-reachable code — `ui/`, `webkit/`, `common/`,
1954
- `page/**/*.tsx`, `*.constant.ts`, `*.store.ts`, and the five module component suffixes — while leaving it legal in
1955
- server, `srvkit/`, and CLI files, which never reach a bundle. The five existing occurrences in `akanjs` and the
1956
- libs became `// FIXME:`.
1957
-
1958
- The rule anchors the marker to line start or to whitespace after code, so a literal like `"https://host//!path"`
1959
- does not trip it. Comments are trivia rather than nodes, so the diagnostic spans the module and a marker on a
1960
- file's very first line is invisible to the pattern — the one case the rule cannot see.
1961
-
1962
- Rebuilding `apps/akan` takes the bundle from two `//!` comments to zero, with the third-party `/*!` licence
1963
- blocks left intact.
1964
-
1965
- - f882bbc: feat(lint): `no-init-fetch-in-client` — keep slice hydration on the server
1966
-
1967
- `fetch.init<Model><Suffix>` is not a request, it is a hydration snapshot: `#registerSlice` composes it out of the
1968
- slice's list and insight queries and returns a `ServerInit` whose only consumer is the `init` prop of
1969
- `Load.Units` / `Load.View`, which seeds the store from it before React renders. `fetch.get<Model>Init<Suffix>` is
1970
- the same call returning the payload alone. From a route both resolve before the first byte and the markup ships
1971
- populated; from a client component they are two extra round-trips for a shell the browser already painted empty,
1972
- landing in a local variable nothing reads — `Load.*` seeds state, so a value held in a client closure reaches
1973
- nowhere. Nothing in the framework flagged this, and the mistake reads as an ordinary load.
1974
-
1975
- The fix the message points at is the route: `await fetch.initXInY(...)` in `page/**` and pass the result down as
1976
- an `init` prop, or hand the unawaited promise to a `Zone`. The client is not missing the load either — every
1977
- slice also generates `st.do.init<Model><Suffix>()`, which runs the same two queries and commits them to state.
1978
-
1979
- The gate is the file, not the call site. `"use client"` is anchored to `JsDirective`, so the same text as an
1980
- ordinary string literal or inside a template-literal code sample — both common in docs pages — is not mistaken
1981
- for the directive. `*.store.ts` is added by name, being client-only by role while carrying no directive.
1982
-
1983
- The name is matched by shape, a lint rule having no way to know which slices exist. The generated one is `init`
1984
-
1985
- - `Capitalize<refName>` + `Capitalize<suffix>`, so it always carries two capital-led segments; requiring the
1986
- second is what keeps a hand-written `initPayment` / `initSession` endpoint out, and `initializeSomething` was
1987
- never at risk since `init` is followed by a lowercase letter there. A custom endpoint spelling the generated
1988
- shape exactly — `initPaymentSession`, `get<X>Init<Y>` — is the residue, suppressible with
1989
- `// biome-ignore lint/plugin: <reason>`.
1990
-
1991
- `view` / `edit` hydrate the same way but are deliberately unmatched: `edit<X>` is a plausible custom endpoint
1992
- name.
1993
-
1994
- A runtime guard was considered instead and rejected: CSR and Capacitor builds render route modules in the
1995
- browser (`RootRenderLayer` in `pkgs/akanjs/webkit/bootCsr.tsx` awaits the page's own async render), so
1996
- `typeof window !== "undefined"` holds for a perfectly correct page there and nothing at runtime can tell that
1997
- apart from a client component calling the same thing after hydration.
1998
-
1999
- - 69f7178: feat(lint): ban `cnst` model types in `*.Util.tsx` / `*.Zone.tsx` props
2000
-
2001
- `Util` and `Zone` are always client components, so a `cnst.Banner` / `cnst.LightBanner` prop is a hydrated class
2002
- instance the server has to hand across the boundary — the functions are stripped on the way and what arrives is a
2003
- plain object wearing the model's type. `no-model-type-in-util-zone.grit` reports it and points at the two shapes
2004
- that work: take `bannerId: string` and read the model from the store, or take the payload the framework already
2005
- serializes.
2006
-
2007
- Three exemptions, because none of them is an instance. `cnst.<Enum>["value"]` is an indexed access that resolves to
2008
- a string union, which is how every enum prop in the codebase is already written (`roles: cnst.AdminRole["value"][]`).
2009
- A `ClientInit` / `ClientView` / `ClientEdit` type argument is mapped through `GetStateObject<…>` before it reaches
2010
- a prop, which is the sanctioned server-to-client handoff. A `ModelsProps<cnst.Setting>` type argument spends the
2011
- model on `onClickItem?: (model: M) => unknown` and nowhere else, so it is the function-typed-prop exemption reached
2012
- through a generic — whoever passes the callback is a client component already holding the value.
2013
- `ModelProps<"setting", cnst.LightSetting>` stays reported: it spreads the model onto the props themselves, and the
2014
- `Unit` / `View` files that take it are server components outside this rule's scope. Any _other_ indexed access is
2015
- still reported — `cnst.Banner["image"]` is a `File`.
2016
-
2017
- The rule keys on the `cnst.` qualifier in a type position, so it never touches a value expression, and it is scoped
2018
- to those two filename suffixes: `Unit` and `View` are server components and keep taking the model itself.
2019
-
2020
- Only prop positions are read: a `*Props` interface or type alias, and the inline object type on the component's own
2021
- parameter. A `cnst` type that never leaves the file is not a boundary crossing and is left alone — a local
2022
- annotation, a callback parameter the framework itself types with the model (`renderItem`, `renderList`), a
2023
- module-scope helper, a non-`Props` local shape, and the props of a component nested inside another one. A
2024
- function-typed prop (`onPick?: (t: cnst.LightTicket) => void`) is exempt too: a closure cannot cross the RSC
2025
- boundary at all, so whoever passes it is a client component that already holds the value.
2026
-
2027
- - 5f53462: fix(lint): `non-scalar-props-restricted` covers `*.Unit.tsx` and `*.View.tsx`
2028
-
2029
- The guide has always said a server component may not hand a function prop across the client boundary in a page, a
2030
- Unit or a View, but the rule was scoped to `page/**` only. Units and Views are always server components, so a
2031
- function prop there fails at the boundary at runtime; lint now says so first.
2032
-
2033
- - ccf2ae2: `akan start` replaces its backend one restart at a time, so saves in quick succession can no longer leave a second
2034
- gateway holding the port.
2035
-
2036
- - A save whose restart came due while the previous one still waited for the old backend to exit used to signal the
2037
- same process again and then spawn a second backend beside the first. The host kept the one that lost the port,
2038
- restarted it on every save, and the untracked one went on answering. A restart that comes due now runs after the
2039
- one in flight, and a config or metadata recycle and `akan start`'s shutdown wait for it too.
2040
- - A gateway that cannot bind its port no longer reports itself ready while it waits for its replicas to exit.
2041
-
2042
- - 2d8de1c: fix(release): the published packages no longer carry test-run files from `local/`
2043
-
2044
- `akanjs` 3.0.0-beta.19 shipped 65 files (SQLite databases and logs, 820 KB) and `@akanjs/devkit` 2 from the
2045
- gitignored `local/` directory the test suites write into, because both builds copied the package directory whole.
2046
- `build-package` and `akanjs`'s own build now leave `local/` out, and `verify-akan-publish-packages` refuses a package
2047
- whose pack list still contains it.
2048
-
2049
- - c45ac6c: perf(build): precompress the CSS bundle, and serve brotli sidecars ahead of gzip
2050
-
2051
- The compiled stylesheet went out uncompressed in production. `precompressArtifacts` only walked
2052
- `.akan/artifact/client`, so every JS chunk got a `.gz` sidecar while the CSS — written to
2053
- `.akan/artifact/styles` — got none, and `#fileResponse` fell through to streaming the raw file. Nothing was
2054
- wrong on the serving side: `#isCompressible` already accepts `text/css` and the sidecar lookup already ran.
2055
- The file simply was not there. On one deployed app that was 319KB on the wire per cold load, against 45KB
2056
- gzipped. The CSS is and always was minified — Lightning CSS runs in `prepareCssAsset` — so this is purely the
2057
- transfer encoding.
2058
-
2059
- Sidecars are now written for `styles/` too, and a `.br` sidecar is written alongside every `.gz`.
2060
-
2061
- Brotli is tried first and gzip remains the fallback, because browsers only advertise `br` on secure origins.
2062
- Quality is 11 for CSS and 9 for everything else: there is one CSS asset per basePath and it is the largest
2063
- single file an app ships, worth ~20% over gzip for ~0.2s, while spending 11 on several hundred JS chunks costs
2064
- ~12s of build time for a few hundred KB. Measured on `apps/akan`: 371 files, 14.5MB raw, 4.2MB gzip, 3.9MB
2065
- brotli, and the CSS bundle 103KB raw → 16.2KB gzip → 13.0KB brotli. The compress phase went from ~0.3s to
2066
- ~0.64s. Gzip sidecars moved to level 9, which is free at build time and was previously left at the default.
2067
-
2068
- Encoding negotiation moved out of `WebRouter` and `AkanApp` into `resolveEncodedSidecar`. Both classes carried
2069
- their own copy of the gzip lookup plus `#acceptsGzip` / `#isCompressible`, and a gateway that disagrees with
2070
- its child about which encoding a request accepts serves a body the caller cannot decode. The shared version
2071
- also honours `q=0` as the refusal it is, and no longer treats a token merely starting with `br` as brotli.
2072
-
2073
- **Anything caching in front of the app must pass `Vary: Accept-Encoding` through.** The header was already
2074
- set, but it only mattered when one encoding was on offer; with two, a proxy that drops or ignores it will
2075
- hand a brotli body to a client that asked for gzip. Artifacts now carry both sidecars, so a build's static
2076
- output grows by roughly the brotli total (3.9MB for `apps/akan`).
2077
-
2078
- - 5f53462: feat(route): a route's head is JSX only, and analytics is the app's own component
2079
-
2080
- **`.metadata()` is gone, along with the `metadata` / `generateMetadata` exports and the `AkanMetadata` type.** A route
2081
- had two ways to say the same thing — an object of `title` / `description` / `openGraph` / `twitter` / `alternates`
2082
- that the server translated into tags, and `.head()` taking the tags themselves — and could use only one of them per
2083
- module. Every app in the workspace already wrote `.head(<>…</>)`. Rewrite an object as the tags it produced:
2084
-
2085
- ```tsx
2086
- .head(({ projectId }) => (
2087
- <>
2088
- <title>{`Project ${projectId}`}</title>
2089
- <meta name="description" content="Project workspace" />
2090
- <meta property="og:image" content="/og/project.png" />
2091
- <link rel="canonical" href="https://example.com/project" />
2092
- </>
2093
- ))
2094
- ```
2095
-
2096
- A legacy route that still exports `metadata` or `generateMetadata` now fails the load as an unsupported export,
2097
- the same way any other stray export does. The hreflang alternates Akan adds per locale are unchanged; the only thing
2098
- that could suppress them was an `alternates.languages` object, so leave them out of the JSX.
2099
-
2100
- **`.gaTrackingId()` and the `gaTrackingId` export / `System.Provider` prop are gone.** Which tags load, in which
2101
- environment and behind which consent banner are the app's decisions, and the framework's built-in `Gtag` made none
2102
- of them. Render a `"use client"` component that loads gtag.js from the root layout's `.render()` instead — the
2103
- routing guide has one. GA4's Enhanced measurement already counts the router's `history.pushState` navigations, so
2104
- the component only loads the tag.
2105
-
2106
- The head-snapshot path used by the experimental partial commit (`AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1` with
2107
- `rscPatchHeadSafe`) was fed only by the metadata object, so it now always falls back to a full navigation.
2108
-
2109
- - 5f53462: fix(build): the production server bundle keeps its identifiers, so a class still names its own log lines
2110
-
2111
- `akan build` compiled `main.ts`, `server.ts`, the RSC worker and the console runtime with `minify: true`, which
2112
- includes `identifiers`. Renaming every class in a server bundle is renaming the only identity several parts of
2113
- the framework read back at runtime:
2114
-
2115
- - `serve()` gives each service `new Logger(this.constructor.name)`, so a production log line read
2116
- `[P6e] ... Updating 0 Floors' Awairs Latest Air Data` — the class the message came from is exactly what a log
2117
- filter (`akan logs --child`, `--grep`) needs and the one thing the record no longer carried.
2118
- - `Exception` and `Err` set `this.name = this.constructor.name`, so a 500's logged error name was mangled too.
2119
- - A guard's `static name = "User";` is what `fetch` serializes, what the API explorer filters on, and what
2120
- `mcpExposure` compares against `"Public"`. The convention held the framework's own guards together; a guard
2121
- that omitted it silently published a two-letter name.
2122
- - Every frame of every stack trace lost its function and class name, on a single-line bundle that has no
2123
- source map to fall back on.
2124
-
2125
- Server bytes are read from the image, never sent to a client, and the measurements say identifier mangling was
2126
- not buying much: on `minimal`, `server.js` grows 5.5MB → 7.4MB, boot moves 202ms → 206ms (median of five), and
2127
- peak RSS stays inside the noise band. `minify.whitespace` and `minify.syntax` are unchanged, and the browser
2128
- bundles — CSR, page and client entries — still mangle identifiers, where the bytes actually travel.
2129
-
2130
- `minify.keepNames` would have been the narrow fix; Bun 1.4.2 accepts the flag in `BuildConfig` and renames
2131
- classes anyway, which `applicationBuildRunner.test.ts` now pins so the flag can be adopted when it lands.
2132
-
2133
- - 69f7178: fix(build): target the server when bundling `client-ssr`, so SSR keeps happening
2134
-
2135
- `ClientEntriesBundler` hardcoded `target: "browser"`, and both bundles go through it: the browser one under
2136
- `client` and the **server-executed** one under `client-ssr`, which `SsrFromRscRenderer` loads with
2137
- `await import(chunkId)`. The browser target resolves the `browser` export condition, so a dependency whose
2138
- `browser` entry touches a DOM global at module scope threw the moment the SSR renderer imported the chunk.
2139
-
2140
- That throw lands while React is rendering the shell, so the failure is not scoped to the offending subtree — the
2141
- whole document degrades to client rendering, with one browser console line (`Switched to client rendering because
2142
- the server rendering errored: document is not defined`) and a ~1KB server body holding nothing but an empty
2143
- Suspense placeholder. It was reported against `react-markdown` → `micromark` →
2144
- `decode-named-character-reference`, whose browser entry is `const element = document.createElement('i')`, and it
2145
- hit **every** route: the generated root layout imports the app store, so the shared UI graph is in every client
2146
- entry's SSR chunk graph.
2147
-
2148
- `ClientEntriesBundler` now takes the target as an option — still `"browser"` for the browser bundle — and
2149
- `resolveSsrClientBundleOptions` (was `resolveSsrClientExternalOptions`) carries `target: "bun"` for `start` and
2150
- `build` alike, so neither `client-ssr` call site can drift. `conditions: ["node"]` is not a fix: Bun _adds_
2151
- conditions to the target's defaults, so `browser` still wins. The target itself has to say server.
2152
-
2153
- - ccf2ae2: feat(dev): SSR pages load their client code from a dev module registry
2154
-
2155
- - Under `akan start`, an SSR page's `"use client"` code now comes from a module registry under
2156
- `.akan/artifact/ssr-dev`, the same machinery the dev CSR registry uses, instead of the route chunks. React and the
2157
- akanjs vendor facets stay the import map's, so the page keeps one React and one store registry. The route chunks and
2158
- the `client-refresh` that re-imported all of them are gone from dev; `akan build` is unchanged.
2159
- - A save patches the changed module in place with React Fast Refresh: state stays, and on minimal a component edit
2160
- shows in about 110ms instead of 900ms. Undoing an edit now shows too; with chunks the browser kept the module it had
2161
- already imported for that URL. A client module the RSC payload names that also exports constants re-runs in place.
2162
- - A save that changes nothing the server renders (a `"use client"` module that keeps its export names, or a module only
2163
- client code imports) keeps the page's build id and refetches no RSC payload. One that does — a component both sides
2164
- render, a constant — holds its client patch until that save's pages build lands, then sends the patch and the RSC
2165
- refresh together, so the page never runs new client code against old server props. A constant edit that reloads
2166
- waits for that build too, and a backend restarted by a server-only save renders from the latest pages build.
2167
- - The registry builds once in a build worker after the dev server boots, beside the builder's slow lane, and each route
2168
- build adds the entries its page names that the registry lacks; a page served before the registry exists waits for
2169
- it in the browser, in short holds. Route builds no longer bundle browser chunks in dev, which took about 240MB off
2170
- the builder's peak on apps/akan.
2171
- - Most saves are patched in the resident builder: a new file, a new import from a package something already resolved,
2172
- a moved or renamed file (a case-only rename, `Foo.tsx` to `Foo/index.tsx`, a file created beside a folder an import
2173
- resolved to), a deleted module brought back. A whole build in a build worker is left for a new npm package, a signal
2174
- save (its metadata is inlined into the client runtime; a dictionary save does not rebuild the SSR registry, which
2175
- inlines none), and a registry whose last whole build was cut short. A save that does not compile — a typo in an
2176
- import included — is reported by the builder at once, and the save that fixes it patches in about 120ms.
2177
- - A failed build keeps the registry the tabs and the next save read. Its error stays on the overlay, is shown to a tab
2178
- opened while it stands, and clears with the save that fixes it — for a route that failed on a shared module too,
2179
- which is built again once a newer build goes green. A broken file no page imports any more stops failing saves.
2180
- - A client module whose top level threw, or a store that throws at startup, recovers with the save that fixes it, and
2181
- the dev server's error page carries the HMR client, so it reloads once the fix lands. A pages bundle that builds but
2182
- throws while it loads shows its error while the RSC worker keeps serving the bundle it had.
2183
- - A tab that reconnects after a backend restart loads the patches it missed and refetches its payload instead of
2184
- reloading; one that reconnects to a new dev session (a new `akan start`, a config restart) reloads onto its registry.
2185
- A tab that booted beside the vendor file of the build before loads the newer one, so a new npm import in a leaf
2186
- component works without a manual refresh.
2187
- - A build worker exits with the builder that spawned it, and a boot build whose worker was killed is retried after 10
2188
- seconds. On Windows, registry writes retry a rename refused while a reader holds the file, and a build worker hashes
2189
- the same bundle config as the builder, so saves are not all handed to whole builds.
2190
-
2191
- - 2d8de1c: fix(code): at most `maxConcurrent` sub-agents run at once across the whole tree
2192
-
2193
- `/agents` says a profile runs sub-agents "at most N at once", but each `task` pool counted only its own children,
2194
- so a child agent could open N of its own while its parent's N were still running — with the shipped presets (two
2195
- levels, three at once) up to 12 sub-agents ran at once instead of 3.
2196
-
2197
- The running count now travels with the tree's token tally (`SubagentSpend` gained `running`), so every pool of one
2198
- tree checks the same number. A `task` over the limit is refused, as before, and never queued: every ancestor keeps
2199
- its slot while it waits on its child, so a queued child would deadlock the tree. The refusal tells an agent that has
2200
- sub-agents of its own running to wait for one of them or do the work itself, and one that has none to do it itself.
2201
-
2202
- - 2d8de1c: fix(code): a sub-agent that fails or is stopped still spends from the tree's budget
2203
-
2204
- A sub-agent's tokens were added to the tree's tally only when its run returned normally. One whose run threw — a
2205
- provider or engine error after it had already spent tokens — added nothing and said nothing, so a tree of failing
2206
- sub-agents could spend past the budget without `task` ever refusing; one stopped by its parent's interrupt was
2207
- counted but announced as "finished".
2208
-
2209
- Each sub-agent's own tokens are now added exactly once however it ends, and the notice says how it ended:
2210
- `explore sub-agent finished|failed|stopped, N tokens (M of B spent)`. A sub-agent's own children are still counted
2211
- by its pool, so nothing is counted twice.
2212
-
2213
- - 2d8de1c: fix(code): an interrupt that lands before a sub-agent's run is live stops it
2214
-
2215
- A sub-agent listened for its parent's interrupt only once it had been created, and the engine ignores an abort that
2216
- arrives before a run is live. So an interrupt pressed while a `task` was still opening its sub-agent — connecting
2217
- its MCP servers, say — or in the moment between that and the sub-agent's run starting was lost: the sub-agent ran
2218
- its whole task anyway, and in the second case its notice even said "stopped".
2219
-
2220
- A sub-agent whose parent was interrupted while it was being created now never starts, and one interrupted after that
2221
- is stopped as soon as its run is live. Either way it reports `stopped`, and its tokens are added to the tree's tally
2222
- once.
2223
-
2224
- - 2d8de1c: fix(code): every sub-agent of one tree draws on one token budget
2225
-
2226
- A profile's `subagent.budget` is documented, and shown by `/agents`, as the tokens "a whole subagent tree may
2227
- spend", but each `task` pool kept its own count. A child's pool started from zero against the same ceiling and
2228
- counted only its own children, so with the shipped presets (two levels, three at once) a tree could spend several
2229
- times the budget before anything refused.
2230
-
2231
- The count is now one object for the whole tree: the root pool starts it, hands it to every child agent it opens
2232
- (`CodeAgentOptions.subagentSpend`, forwarded through `AkanCodePlugins` to the child's pool), and each sub-agent's
2233
- tokens are added to it when that sub-agent finishes. Once the tree has spent the budget, `task` refuses at every
2234
- level, and the "sub-agent finished" notice reports the tree's total. Depth and concurrency limits are unchanged.
2235
-
2236
- - 5f53462: The CLI's AI editor is removed, and with it the `--ai` commands
2237
-
2238
- `AiSession` — the langchain-backed editor that asked a model to write module constants, dictionaries, scalars,
2239
- UI components, guideline instructions and abstract files — is deleted, along with every command that drove it.
2240
- Gone: `akan set-llm`, `akan reset-llm`, `akan ask`, `akan compact`, `akan generate-instruction`, `akan
2241
- update-instruction`, `akan generate-document`, `akan reapply-instruction`, and the `--ai` flag on `akan
2242
- create-module` and `akan create-scalar`. The scaffolding halves of those two commands are unchanged and are now
2243
- what they always do.
2244
-
2245
- `akan guideline list` and `akan guideline show` are unaffected — guidelines are bundled files the CLI reads and
2246
- never writes, and MCP `get_guideline` serves the same ones. `akan quality scan` still warns on an abstract past
2247
- 300 lines; there is no longer a command that rewrites one for you.
2248
-
2249
- The `@langchain/*` dependencies leave `@akanjs/cli`, `@akanjs/devkit` and the workspace root — they were the
2250
- heaviest lazy-loaded stack the CLI carried, and `EntryModuleGraph` no longer has to guard against one reaching
2251
- an entry. The workspace-global config at `~/.akan/config.json` no longer holds an LLM key; an existing `llm`
2252
- entry is ignored and can be deleted.
2253
-
2254
- This is the dev-time editor only. The in-page agent's runtime `LlmAdaptorRole`, `option.setLlm(...)` and the
2255
- shipped adaptors are a different surface and are untouched.
2256
-
2257
- Step-by-step migration: `akan guideline show workspaceRecipes`, Recipe 8.
2258
-
2259
- - 2d8de1c: fix(build): `export *` in a `"use client"` module is a build error, and a dev build failure says why
2260
-
2261
- The server replaces a `"use client"` module with one client reference per name the module exports, and the names
2262
- come from Bun's export scan — which reports none through `export * from "./x"`. So a star re-export in a client
2263
- module registered nothing: a star-only file was silently no client boundary at all, and a file mixing named exports
2264
- with a star lost the star's names on the server, where they were `undefined` in a server component while the same
2265
- import worked in a client one. `libs/shared`'s `User.Template.tsx` did exactly this with the leave-flow components.
2266
-
2267
- Like Next.js, the build now refuses it, in `akan build` and `akan start` alike, naming the file, the specifiers and
2268
- the fix:
2269
-
2270
- ```
2271
- libs/shared/lib/user/User.Template.tsx is a "use client" module, so it cannot `export * from "../../ui/UserLeave"`:
2272
- the server sees only the names a client module declares, and a star re-export declares none. Re-export them by
2273
- name — `export { … } from "../../ui/UserLeave"`.
2274
- ```
2275
-
2276
- `export type * from` and `export * as ns from` stay allowed, and a module without the directive is untouched. A
2277
- barrel that mixes client-only files with isomorphic ones should drop the directive instead: each client file keeps
2278
- its own, and the barrel stays importable on the server.
2279
-
2280
- A failed bundle during `akan start` used to report only the bundler's own message, "Bundle failed". The dev build
2281
- now prints the reasons nested under it, the way `akan build` already did.
2282
-
2283
- - 2d8de1c: fix(windows): `akan` commands and the dev build worker no longer stop silently at a missing file
2284
-
2285
- On Windows, Bun lets a process exit while a `Bun.file` read of a file that does not exist is still pending, if
2286
- nothing else is keeping it alive. `akan build` stopped right after `sync` without an error, and the dev server's boot
2287
- build ended with "build worker exited with code 0 before reporting a result" on any app that had no font cache yet.
2288
- The CLI and its build workers now await their work from the entry module, which keeps the process alive until it
2289
- settles; a failed command still prints its error once and exits 1.
2290
-
2291
- - ccf2ae2: fix(cloud): on Windows, a `~/.akan/config.json` write waits for another command's read instead of failing
2292
-
2293
- Windows refuses to rename over a file another process has open, and every `akan` command reads `config.json`
2294
- outside its lock. On a Windows VM, a writer racing two readers had 1374 of 1579 renames fail with `EPERM`. A token
2295
- refresh that lost that race fell back to the stored session. A session in its last hour is sent without
2296
- `Authorization`, so one of two commands started together saw the cloud as signed out. And when the lost write was
2297
- the one after the refresh, the rotated refresh token was never saved, so the next command had to sign in again.
2298
- `GlobalConfig` now retries the rename on `EPERM`, `EACCES` and `EBUSY` for up to about five seconds on Windows.
2299
- Under the same two readers, every write landed, the slowest after 40 tries (1.9s).
2300
-
2301
- - Updated dependencies [ccf2ae2]
2302
- - Updated dependencies [ccf2ae2]
2303
- - Updated dependencies [ccf2ae2]
2304
- - Updated dependencies [ccf2ae2]
2305
- - Updated dependencies [ccf2ae2]
2306
- - Updated dependencies [ccf2ae2]
2307
- - Updated dependencies [ccf2ae2]
2308
- - Updated dependencies [5f53462]
2309
- - Updated dependencies [ccf2ae2]
2310
- - Updated dependencies [ccf2ae2]
2311
- - Updated dependencies [5f53462]
2312
- - Updated dependencies [ccf2ae2]
2313
- - Updated dependencies [ccf2ae2]
2314
- - Updated dependencies [69f7178]
2315
- - Updated dependencies [69f7178]
2316
- - Updated dependencies [69f7178]
2317
- - Updated dependencies [5f53462]
2318
- - Updated dependencies [5f53462]
2319
- - Updated dependencies [5f53462]
2320
- - Updated dependencies [5f53462]
2321
- - Updated dependencies [5f53462]
2322
- - Updated dependencies [f882bbc]
2323
- - Updated dependencies [8c31d54]
2324
- - Updated dependencies [5f53462]
2325
- - Updated dependencies [69f7178]
2326
- - Updated dependencies [5f53462]
2327
- - Updated dependencies [f882bbc]
2328
- - Updated dependencies [5f53462]
2329
- - Updated dependencies [5f53462]
2330
- - Updated dependencies [f882bbc]
2331
- - Updated dependencies [f882bbc]
2332
- - Updated dependencies [5f53462]
2333
- - Updated dependencies [5f53462]
2334
- - Updated dependencies [69f7178]
2335
- - Updated dependencies [5f53462]
2336
- - Updated dependencies [5f53462]
2337
- - Updated dependencies [69f7178]
2338
- - Updated dependencies [f882bbc]
2339
- - Updated dependencies [5f53462]
2340
- - Updated dependencies [5f53462]
2341
- - Updated dependencies [69f7178]
2342
- - Updated dependencies [69f7178]
2343
- - Updated dependencies [5f53462]
2344
- - Updated dependencies [69f7178]
2345
- - Updated dependencies [5f53462]
2346
- - Updated dependencies [5f53462]
2347
- - Updated dependencies [f882bbc]
2348
- - Updated dependencies [69f7178]
2349
- - Updated dependencies [69f7178]
2350
- - Updated dependencies [ccf2ae2]
2351
- - Updated dependencies [ccf2ae2]
2352
- - Updated dependencies [ccf2ae2]
2353
- - Updated dependencies [ccf2ae2]
2354
- - Updated dependencies [5f53462]
2355
- - Updated dependencies [ccf2ae2]
2356
- - Updated dependencies [ccf2ae2]
2357
- - Updated dependencies [ccf2ae2]
2358
- - Updated dependencies [ccf2ae2]
2359
- - Updated dependencies [5f53462]
2360
- - Updated dependencies [c45ac6c]
2361
- - Updated dependencies [69f7178]
2362
- - Updated dependencies [69f7178]
2363
- - Updated dependencies [5f53462]
2364
- - Updated dependencies [5f53462]
2365
- - Updated dependencies [2d8de1c]
2366
- - Updated dependencies [5f53462]
2367
- - Updated dependencies [8c31d54]
2368
- - Updated dependencies [ccf2ae2]
2369
- - Updated dependencies [5f53462]
2370
- - Updated dependencies [5f53462]
2371
- - Updated dependencies [ccf2ae2]
2372
- - Updated dependencies [ccf2ae2]
2373
- - Updated dependencies [ccf2ae2]
2374
- - Updated dependencies [ccf2ae2]
2375
- - Updated dependencies [ccf2ae2]
2376
- - Updated dependencies [ccf2ae2]
2377
- - Updated dependencies [ccf2ae2]
2378
- - Updated dependencies [ccf2ae2]
2379
- - Updated dependencies [ccf2ae2]
2380
- - Updated dependencies [ccf2ae2]
2381
- - Updated dependencies [ccf2ae2]
2382
- - Updated dependencies [ccf2ae2]
2383
- - Updated dependencies [ccf2ae2]
2384
- - Updated dependencies [ccf2ae2]
2385
- - Updated dependencies [5f53462]
2386
- - Updated dependencies [ccf2ae2]
2387
- - Updated dependencies [ccf2ae2]
2388
- - Updated dependencies [ccf2ae2]
2389
- - Updated dependencies [69f7178]
2390
- - Updated dependencies [69f7178]
2391
- - Updated dependencies [69f7178]
2392
- - Updated dependencies [f882bbc]
2393
- - Updated dependencies [2d8de1c]
2394
- - Updated dependencies [69f7178]
2395
- - Updated dependencies [5f53462]
2396
- - Updated dependencies [22aa04f]
2397
- - Updated dependencies [69f7178]
2398
- - Updated dependencies [5f53462]
2399
- - Updated dependencies [ccf2ae2]
2400
- - Updated dependencies [2d8de1c]
2401
- - Updated dependencies [69f7178]
2402
- - Updated dependencies [2d8de1c]
2403
- - Updated dependencies [2d8de1c]
2404
- - Updated dependencies [2d8de1c]
2405
- - Updated dependencies [f882bbc]
2406
- - Updated dependencies [69f7178]
2407
- - Updated dependencies [f882bbc]
2408
- - Updated dependencies [f882bbc]
2409
- - Updated dependencies [5f53462]
2410
- - Updated dependencies [22aa04f]
2411
- - Updated dependencies [69f7178]
2412
- - Updated dependencies [2d8de1c]
2413
- - Updated dependencies [ccf2ae2]
2414
- - Updated dependencies [5f53462]
2415
- - Updated dependencies [5f53462]
2416
- - Updated dependencies [5f53462]
2417
- - Updated dependencies [ccf2ae2]
2418
- - Updated dependencies [f882bbc]
2419
- - Updated dependencies [69f7178]
2420
- - Updated dependencies [5f53462]
2421
- - Updated dependencies [5f53462]
2422
- - Updated dependencies [5f53462]
2423
- - Updated dependencies [3ebd8e1]
2424
- - Updated dependencies [326da07]
2425
- - Updated dependencies [ccf2ae2]
2426
- - Updated dependencies [ccf2ae2]
2427
- - Updated dependencies [ccf2ae2]
2428
- - Updated dependencies [ccf2ae2]
2429
- - Updated dependencies [5f53462]
2430
- - Updated dependencies [c45ac6c]
2431
- - Updated dependencies [2d8de1c]
2432
- - Updated dependencies [ccf2ae2]
2433
- - Updated dependencies [ccf2ae2]
2434
- - Updated dependencies [22aa04f]
2435
- - Updated dependencies [f882bbc]
2436
- - Updated dependencies [2d8de1c]
2437
- - Updated dependencies [5f53462]
2438
- - Updated dependencies [c45ac6c]
2439
- - Updated dependencies [f882bbc]
2440
- - Updated dependencies [2d8de1c]
2441
- - Updated dependencies [ccf2ae2]
2442
- - Updated dependencies [2d8de1c]
2443
- - Updated dependencies [ccf2ae2]
2444
- - Updated dependencies [f882bbc]
2445
- - Updated dependencies [326da07]
2446
- - Updated dependencies [ccf2ae2]
2447
- - Updated dependencies [5f53462]
2448
- - Updated dependencies [2d8de1c]
2449
- - Updated dependencies [5f53462]
2450
- - Updated dependencies [5f53462]
2451
- - Updated dependencies [ccf2ae2]
2452
- - Updated dependencies [2d8de1c]
2453
- - Updated dependencies [2d8de1c]
2454
- - Updated dependencies [2d8de1c]
2455
- - Updated dependencies [f882bbc]
2456
- - Updated dependencies [f882bbc]
2457
- - Updated dependencies [69f7178]
2458
- - Updated dependencies [2d8de1c]
2459
- - Updated dependencies [5f53462]
2460
- - Updated dependencies [5f53462]
2461
- - Updated dependencies [5f53462]
2462
- - Updated dependencies [ccf2ae2]
2463
- - Updated dependencies [bf27773]
2464
- - Updated dependencies [2d8de1c]
2465
- - Updated dependencies [5f53462]
2466
- - Updated dependencies [69f7178]
2467
- - Updated dependencies [5f53462]
2468
- - Updated dependencies [5f53462]
2469
- - Updated dependencies [ccf2ae2]
2470
- - Updated dependencies [ccf2ae2]
2471
- - Updated dependencies [2d8de1c]
2472
- - Updated dependencies [2d8de1c]
2473
- - Updated dependencies [2d8de1c]
2474
- - Updated dependencies [2d8de1c]
2475
- - Updated dependencies [ccf2ae2]
2476
- - Updated dependencies [5f53462]
2477
- - Updated dependencies [ccf2ae2]
2478
- - Updated dependencies [5f53462]
2479
- - Updated dependencies [f882bbc]
2480
- - akanjs@3.0.0
2481
-
2482
- ## 2.4.2
2483
-
2484
- ### Patch Changes
2485
-
2486
- - Updated dependencies [6d58c7e]
2487
- - Updated dependencies [11aa655]
2488
- - Updated dependencies [25d5b15]
2489
- - Updated dependencies [11aa655]
2490
- - Updated dependencies [11aa655]
2491
- - Updated dependencies [25d5b15]
2492
- - Updated dependencies [42cf7a2]
2493
- - Updated dependencies [25d5b15]
2494
- - Updated dependencies [04cb46d]
2495
- - akanjs@2.4.2
2496
-
2497
- ## 2.4.1
2498
-
2499
- ### Patch Changes
2500
-
2501
- - Updated dependencies [473be34]
2502
- - Updated dependencies [f5bfa27]
2503
- - Updated dependencies [473be34]
2504
- - Updated dependencies [068158b]
2505
- - Updated dependencies [46a1a4a]
2506
- - Updated dependencies [90c6597]
2507
- - Updated dependencies [aca901d]
2508
- - Updated dependencies [068158b]
2509
- - Updated dependencies [cb895b7]
2510
- - Updated dependencies [f8a9bc5]
2511
- - Updated dependencies [d973712]
2512
- - Updated dependencies [068158b]
2513
- - Updated dependencies [cc3dd40]
2514
- - Updated dependencies [8a2b795]
2515
- - Updated dependencies [068158b]
2516
- - Updated dependencies [473be34]
2517
- - Updated dependencies [e5fde3b]
2518
- - Updated dependencies [473be34]
2519
- - Updated dependencies [f28466f]
2520
- - Updated dependencies [51851fa]
2521
- - Updated dependencies [1c3436f]
2522
- - Updated dependencies [128e9a3]
2523
- - Updated dependencies [a5d4a8a]
2524
- - Updated dependencies [473be34]
2525
- - akanjs@2.4.1
2526
-
2527
- ## 2.4.0
2528
-
2529
- ### Minor Changes
2530
-
2531
- - 23d43b3: Harden dev host recovery during failed builds:
2532
-
2533
- - Defer builder/backend recycle while a generation's build is still failing
2534
- - Merge deferred invalidate batches so restarts cover every skipped change
2535
- - Recover the builder with exponential backoff instead of giving up
2536
- - Revive a backend that gave up once the build goes green again
2537
- - Resurrect dev children after a failed recycle so the error overlay stays reachable
2538
- - Enter degraded builder boot mode on compile errors and retry on the next edit
2539
- - Announce recovered pages/css state after a degraded boot succeeds
2540
-
2541
- - 18abf71: Improve dev server stability:
2542
-
2543
- - Add `isPortInUseError` utility for detecting EADDRINUSE across Bun versions
2544
- - Stop crash-looping replicas after max boot failures in dev mode (`akan start`)
2545
- - Handle parent IPC disconnect to prevent orphaned gateway/child processes
2546
- - Report `wsUpstream` in ready IPC so gateway routes to the actual bound port
2547
- - Fall back to ephemeral port when preferred WS port is in use
2548
- - Support controlled dev-host restart on config changes (`akan.config.ts`, `tsconfig`)
2549
- - Forward backend build-status IPC to dev host for error surfacing in HMR overlay
2550
- - Limit backend recovery attempts (5 max) and idle until next server-side edit
2551
- - Add integration tests for config-edit restart and boot-failure recovery
2552
-
2553
- - 23d43b3: Improve the mobile Capacitor workflow:
2554
-
2555
- - Auto-declare default Capacitor plugins in the app package.json before iOS/Android launch
2556
- - Expand mobile runtime peer dependencies and workspace-root preflight installs
2557
- - Derive repo-scoped default bundle ids to avoid Apple portal collisions
2558
- - Add `akan doctor --ios` to flag placeholder bundle identifiers
2559
- - Add `--device` to `akan start ios` for non-interactive simulator/device selection
2560
- - Prefer newer iOS runtimes and warn on SwiftUICore-incompatible simulators
2561
- - Detect SwiftUICore dyld failures with actionable guidance
2562
- - Select a routable LAN host for mobile live reload with override support
2563
- - Raise Android minSdkVersion to 26 for bundled Capacitor plugins
2564
- - Include `@capacitor-community/fcm` in push notification runtime packages
2565
- - Resolve client port from `window.location` on the browser client
2566
-
2567
- ### Patch Changes
2568
-
2569
- - d56a8f0: Ship Pretendard as the default font for newly created apps:
2570
-
2571
- - Bundle Pretendard woff2 files under the app template `public/fonts`
2572
- - Declare `fonts` with `default: true` in the generated root `_layout.tsx`
2573
-
2574
- - Updated dependencies [d56a8f0]
2575
- - Updated dependencies [23d43b3]
2576
- - Updated dependencies [18abf71]
2577
- - Updated dependencies [23d43b3]
2578
- - akanjs@2.4.0
2579
-
2580
- ## 2.3.11
2581
-
2582
- ### Minor Changes
2583
-
2584
- - 595390a: feat: UiOverride 시스템 및 \_overrides.tsx 지원 추가
2585
-
2586
- - `akanjs/ui/UiOverride` 추가: `Provider`, `createOverridable`, `useUiOverride`, `override` API로 UI 컴포넌트 커스터마이징 지원
2587
- - 모든 akanjs UI 컴포넌트(Button, Modal, Select, Table 등)에 `useUiOverride()` 통합
2588
- - 라우트 시스템에 `_overrides.tsx` 지원 추가 (routeConvention, routeTreeBuilder)
2589
- - qualityScanner에 `_overrides.tsx` 파일 검증 로직 추가
2590
- - 앱 예제: `apps/minimal`에 `_overrides.tsx`, `BrandModal`, `OverrideDemo` 추가
2591
- - `apps/akan` 문서에 UI 커스터마이징 가이드 페이지 추가
2592
- - devkit에 `no-throw-raw-error.grit` lint rule 추가
2593
- - `PushNotificationServer.ts` 리팩토링
2594
- - biome.json 업데이트 및 패키지 의존성 정리
2595
-
2596
- ### Patch Changes
2597
-
2598
- - 5ce752a: enhance: add host option for staging server tests
2599
- - 5ce752a: add host option for staging server tests
2600
- - Updated dependencies [5ce752a]
2601
- - Updated dependencies [5ce752a]
2602
- - Updated dependencies [595390a]
2603
- - akanjs@2.4.0
2604
-
2605
- ## 2.3.10
2606
-
2607
- ### Patch Changes
2608
-
2609
- - b92003a: fix: cross-platform path handling using path.resolve/path.join/path.sep
2610
- - Updated dependencies [b92003a]
2611
- - akanjs@2.3.10
2612
-
2613
- ## 2.3.9
2614
-
2615
- ### Patch Changes
2616
-
2617
- - f518afd: Improve dictionary type inference and lint coverage for generated workspaces.
2618
- - 6bc2209: auto-select app when the workspace has only one app
2619
- - Updated dependencies [f518afd]
2620
- - Updated dependencies [f518afd]
2621
- - akanjs@2.3.9
2622
-
2623
- ## 2.3.6
2624
-
2625
- ### Patch Changes
2626
-
2627
- - 0a4815a: Improve `akan start` stability for incremental dev changes.
2628
- - 1919062: Pin DaisyUI to 5.5.23 so generated workspaces and published CLI artifacts avoid the 5.6.x theme resolution regression.
2629
- - Updated dependencies [0a4815a]
2630
- - akanjs@2.3.6
2631
-
2632
- ## 2.3.5
2633
-
2634
- ### Patch Changes
2635
-
2636
- - Updated dependencies
2637
- - akanjs@2.3.5
2638
-
2639
- ## 2.3.2
2640
-
2641
- ### Patch Changes
2642
-
2643
- - d6db24d: Fix dev runtime refresh for client components, dictionaries, and signal metadata while keeping regenerated server page bundles aligned with live app signal definitions.
2644
- - 1a48756: Add RSC partial navigation patch handling and supporting SSR build updates, plus benchmark harness improvements for validating production behavior.
2645
- - Updated dependencies [940d6db]
2646
- - Updated dependencies [d6db24d]
2647
- - Updated dependencies [dc60773]
2648
- - Updated dependencies [ffe68ec]
2649
- - Updated dependencies [1a48756]
2650
- - Updated dependencies [1a48756]
2651
- - Updated dependencies [1a48756]
2652
- - Updated dependencies [1a48756]
2653
- - Updated dependencies [1a48756]
2654
- - Updated dependencies [4fc2673]
2655
- - akanjs@2.4.0
2656
-
2657
- ## 2.2.12
2658
-
2659
- ### Patch Changes
2660
-
2661
- - Updated dependencies [666e46c]
2662
- - Updated dependencies [666e46c]
2663
- - akanjs@2.2.12
2664
-
2665
- ## 2.2.11
2666
-
2667
- ### Patch Changes
2668
-
2669
- - 8af7a9d: Add agent-oriented workspace context tooling, generated agent rule templates, and LLM documentation surfaces for Akan workspaces.
2670
- - 8190632: Add Akan server console support with CLI/build integration and documentation for console-oriented workflows.
2671
- - 4bce7f9: Add initial LLM discovery docs and stabilize Akan client/runtime behavior.
2672
-
2673
- - Add `/llms.txt` documentation discovery for Akan docs.
2674
- - Add `wsConnect` support for automatic WebSocket connections.
2675
- - Delay client bootstrap module execution until the SSR fizz stream is ready.
2676
- - Improve route tree, HMR, fetch, store, and SSR/client runtime stability.
2677
-
2678
- - Updated dependencies [8190632]
2679
- - Updated dependencies [4bce7f9]
2680
- - akanjs@2.2.11
2681
-
2682
- ## 2.2.7
2683
-
2684
- ### Patch Changes
2685
-
2686
- - Updated dependencies [bf51564]
2687
- - Updated dependencies [bf51564]
2688
- - akanjs@2.2.7
2689
-
2690
- ## 2.2.5
2691
-
2692
- ### Patch Changes
2693
-
2694
- - 5cdb05e: reverse dependency of file upload api
2695
- - Updated dependencies [d636456]
2696
- - Updated dependencies [a1ee4e8]
2697
- - Updated dependencies [5cdb05e]
2698
- - Updated dependencies [a7da50e]
2699
- - akanjs@2.2.5
2700
-
2701
- ## 2.2.3
2702
-
2703
- ### Patch Changes
2704
-
2705
- - 587cc68: fix dictionary loading
2706
- - 587cc68: fix fetchClient for setting origin with clone or fetchPolicy
2707
- - Updated dependencies [587cc68]
2708
- - Updated dependencies [587cc68]
2709
- - akanjs@2.2.4
2710
-
2711
- ## 2.2.0
2712
-
2713
- ### Patch Changes
2714
-
2715
- - Updated dependencies [cb5b07a]
2716
- - Updated dependencies [258284e]
2717
- - akanjs@2.2.0