@akanjs/devkit 3.3.0-rc.2 → 3.3.0-rc.20

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 (111) hide show
  1. package/CHANGELOG.md +284 -20
  2. package/DEV_RUNTIME_KNOBS.md +1 -1
  3. package/README.ko.md +3 -2
  4. package/README.md +3 -3
  5. package/akanApp/akanApp.host.test.ts +1 -1
  6. package/akanConfig/akanConfig.test.ts +57 -8
  7. package/akanConfig/akanConfig.ts +16 -69
  8. package/akanConfig/dockerImage.ts +17 -0
  9. package/akanConfig/nativeKeys.ts +52 -0
  10. package/app/applicationBuildRunner.test.ts +321 -1
  11. package/app/applicationBuildRunner.ts +90 -3
  12. package/artifact/implicitRootLayoutRender.test.tsx +4 -1
  13. package/codeAgent/agent/CodeAgent.ts +36 -16
  14. package/codeAgent/agent/CodeAgentAllowed.ts +35 -0
  15. package/codeAgent/agent/CodeAgentCommandLine.ts +372 -0
  16. package/codeAgent/agent/CodeAgentGate.ts +23 -4
  17. package/codeAgent/agent/CodeAgentRpcHost.ts +1 -1
  18. package/codeAgent/agent/codeAgent.test.ts +62 -0
  19. package/codeAgent/agent/codeAgentCommandLine.test.ts +212 -0
  20. package/codeAgent/agent/codeAgentContract.test.ts +117 -5
  21. package/codeAgent/skills/akan-agent/SKILL.md +8 -1
  22. package/codeAgent/skills/akan-code/SKILL.md +38 -3
  23. package/codeAgent/skills/akan-err/SKILL.md +11 -2
  24. package/codeAgent/skills/akan-page/SKILL.md +21 -26
  25. package/codeAgent/skills/akan-runtime/SKILL.md +41 -16
  26. package/codeAgent/skills/akan-service/SKILL.md +2 -2
  27. package/docs/apiReference.test.ts +14 -0
  28. package/docs/apiReference.ts +21 -3
  29. package/docs/declarationReader.ts +28 -1
  30. package/executors/appExecutor.ts +16 -7
  31. package/executors/workspaceExecutor.ts +7 -4
  32. package/frontendBuild/buildRouteClient.test.ts +2 -7
  33. package/frontendBuild/clientEntryDiscovery.test.ts +35 -0
  34. package/frontendBuild/clientEntryDiscovery.ts +16 -3
  35. package/frontendBuild/cssCompiler.test.ts +112 -0
  36. package/frontendBuild/cssCompiler.ts +41 -21
  37. package/frontendBuild/devBarrelImports.test.ts +30 -0
  38. package/frontendBuild/devBarrelImports.ts +2 -2
  39. package/frontendBuild/pagesBundleBuilder.ts +3 -1
  40. package/frontendBuild/plainStylesheet.test.ts +155 -0
  41. package/frontendBuild/plainStylesheet.ts +197 -0
  42. package/frontendBuild/rscServerRendererGuard.test.ts +60 -0
  43. package/frontendBuild/rscServerRendererGuard.ts +68 -0
  44. package/guideline/agentAssets.test.ts +10 -0
  45. package/guideline/agentAssets.ts +52 -11
  46. package/incrementalBuilder/buildBatch.proc.ts +9 -9
  47. package/incrementalBuilder/buildBatchProtocol.ts +1 -1
  48. package/incrementalBuilder/builderBoot.ts +5 -5
  49. package/incrementalBuilder/builderGraphPayloads.ts +4 -4
  50. package/incrementalBuilder/builderLanes.ts +2 -2
  51. package/incrementalBuilder/builderWatch.ts +8 -8
  52. package/incrementalBuilder/csrRegistry.ts +4 -4
  53. package/incrementalBuilder/incrementalBuilder.proc.ts +8 -8
  54. package/incrementalBuilder/ssrRegistry.ts +6 -6
  55. package/index.ts +1 -1
  56. package/integration/renderAdmissionSoak.test.ts +99 -0
  57. package/integration/renderAdmissionSoak.ts +609 -0
  58. package/lint/__fixtures__/no-arbitrary-color/every-color-function/bad.tsx +11 -0
  59. package/lint/__fixtures__/no-arbitrary-color/every-color-function/good.tsx +2 -0
  60. package/lint/__fixtures__/no-daisyui-legacy-class/every-class/bad.tsx +34 -0
  61. package/lint/__fixtures__/no-daisyui-legacy-class/every-class/good.tsx +2 -0
  62. package/lint/__fixtures__/no-inline-color/every-color-function/bad.tsx +10 -0
  63. package/lint/__fixtures__/no-inline-color/every-color-function/good.tsx +2 -0
  64. package/lint/__fixtures__/no-raw-palette-class/every-palette/bad.tsx +22 -0
  65. package/lint/__fixtures__/no-raw-palette-class/every-palette/good.tsx +2 -0
  66. package/lint/biomeCheck.test.ts +145 -0
  67. package/lint/biomeCheck.ts +131 -0
  68. package/lint/no-arbitrary-color.grit +5 -0
  69. package/lint/no-conditional-st-hook.grit +5 -1
  70. package/lint/no-daisyui-legacy-class.grit +8 -0
  71. package/lint/no-document-cookie.grit +3 -0
  72. package/lint/no-inline-color.grit +10 -2
  73. package/lint/no-oversized-list-limit.grit +2 -0
  74. package/lint/no-raw-palette-class.grit +7 -0
  75. package/lint/no-unpublished-form-setter.grit +2 -0
  76. package/lint/no-web-only-api-outside-webkit.grit +5 -0
  77. package/lint/no-web-storage.grit +3 -0
  78. package/lint/withheldEnvFile.ts +17 -0
  79. package/mobile/nativeApp.test.ts +7 -5
  80. package/mobile/nativeApp.ts +2 -2
  81. package/mobile/nativeConfig.test.ts +117 -1
  82. package/mobile/nativeConfig.ts +66 -22
  83. package/mobile/serverBundleSecrets.ts +43 -0
  84. package/package.json +14 -169
  85. package/packageExports.test.ts +38 -24
  86. package/test/secretEnvFixture.ts +134 -0
  87. package/transforms/barrelAnalyzer.ts +2 -2
  88. package/transforms/secretEnvDeclaration.test.ts +208 -0
  89. package/transforms/secretEnvDeclaration.ts +213 -0
  90. package/transforms/secretEnvFile.test.ts +117 -0
  91. package/transforms/secretEnvFile.ts +113 -0
  92. package/transforms/secretEnvName.test.ts +54 -0
  93. package/transforms/secretEnvName.ts +29 -0
  94. package/transforms/secretEnvSource.test.ts +148 -0
  95. package/transforms/secretEnvSource.ts +166 -0
  96. package/transforms/serverEnvEvaluationError.ts +11 -0
  97. package/transforms/serverEnvPlugin.test.ts +2 -1
  98. package/transforms/serverEnvPlugin.ts +13 -0
  99. package/transforms/serverEnvProfile.test.ts +115 -2
  100. package/transforms/serverEnvProfile.ts +117 -40
  101. package/transforms/serverEnvSecrets.test.ts +292 -0
  102. package/transforms/transforms.test.ts +3 -3
  103. package/tunnel/createTunnel.test.ts +29 -8
  104. package/tunnel/createTunnel.ts +18 -11
  105. package/typecheck/projectTypecheck.test.ts +29 -0
  106. package/typecheck/typeChecker.test.ts +49 -0
  107. package/typecheck/typeChecker.ts +9 -7
  108. package/typecheck/withheldDiagnostics.ts +41 -0
  109. package/util/fileEditor.ts +1 -0
  110. package/util/selectModel.ts +1 -0
  111. package/workspace/getRelatedCnsts.ts +7 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,289 @@
4
4
 
5
5
  ### Minor Changes
6
6
 
7
+ - 217b061: `akan code` on the default `local` profile now asks before it runs a shell command, as it already did before reaching an unlisted host. File reads, writes and edits are not asked about.
8
+
9
+ **Upgrading.** An interactive `akan code` session shows `approve? run: <command> [y/n/a]` before each shell command; `a` answers yes and stops asking about that command until the session ends. Pass `--no-ask-commands` to run them unasked as before, or `--no-ask` to stop the network questions as well. A one-shot `akan code "<prompt>"` and a sub-agent have nobody to ask, so their commands run as before. A program that drives `akan code --rpc` on the `local` profile receives an `approval` event for each command and answers it with `approve`, as it does for the `web` profile's writes; `codeAgentPresets.local(root).approval` is now `"commands"`.
10
+
11
+ - e704d16: The Dockerfile `akan build` writes runs the server as oven/bun's `bun` user (uid 1000) on a base image pinned by digest, and the Helm chart in `infra/app` runs the pod as that user with no privilege escalation and holds the Ingress to the app's own body limit and CORS answer.
12
+
13
+ **Image**
14
+
15
+ - The base is `oven/bun:1.4.4-slim@sha256:…`, the multi-arch index's digest, so every build of a release, amd64 and arm64 alike, starts from the same Bun the workspace pins. A test fails when the image tag and the repo's Bun version disagree.
16
+ - `apt-get`, `preRuns`, `bun install` and `postRuns` still run as root, and the app files, `node_modules` included, stay root's and read-only to the server. uid 1000 owns only the directories the server writes: `/workspace/sqlite`, `/workspace/local`, `/workspace/runtime` (the control socket), `/workspace/data` and `/workspace/.akan/artifact/image-cache`. An empty named volume mounted at `/workspace/sqlite` or `/workspace/local` starts out owned by uid 1000.
17
+
18
+ **Chart** (`infra/app`, not an npm package; its defaults now live in `infra/app/values.yaml`)
19
+
20
+ - `podSecurityContext`: `runAsNonRoot: true`, uid and gid 1000, `fsGroup: 1000` with `fsGroupChangePolicy: OnRootMismatch`, and seccomp `RuntimeDefault`.
21
+ - `securityContext` (the container's): `allowPrivilegeEscalation: false` and every capability dropped. `readOnlyRootFilesystem` stays off, because the server writes `/workspace/runtime`, `/workspace/.akan`, `/workspace/data` and `/tmp` inside the image.
22
+ - A values file replaces single keys of either, and `null` on a key drops that key. A block that is left out or `null`, as in a release upgraded with `helm upgrade --reuse-values` from values that predate it, renders these defaults; so do the `ingress` keys below.
23
+ - `volumePermissions.enabled: true`: in single mode, an init container from the app's own image runs as root with only `CHOWN`, `FOWNER` and `DAC_READ_SEARCH` before the app starts, and hands every file on the `sqlite-data` claim that another uid or gid owns to `podSecurityContext`'s `runAsUser:runAsGroup`. Once ownership is right it changes nothing. Cluster mode has no such claim, and a `sharedClaim` is not touched.
24
+ - `ingress.proxyBodySize: 128m`: the Ingress passes a body up to the server's upload limit (`AKAN_MAX_UPLOAD_BODY`, 128 MiB) and answers a larger one 413 itself, as the server would.
25
+ - `ingress.cors.enabled: false`: the app's own CORS answer reaches the browser. Its native shells and the origins in `option.setCrossSite({ allowedOrigins })` get their origin back, a preflight gets every header it asked for (`idempotency-key` and the MCP headers included), and fonts keep `Access-Control-Allow-Origin: *`. Nothing else carries it, since `allowedOrigins` covers `/api` only.
26
+
27
+ **Upgrading.**
28
+
29
+ - A Docker volume or bind mount that an image of 3.2.0 or earlier already wrote is owned by root, so the new image stops at boot with `directoryNotWritable`, which names the directory, its owner and the `chown` that fixes it. Change its owner once, for example `docker run --rm -u 0 -v <volume>:/workspace/sqlite <image> chown -R 1000:1000 /workspace/sqlite`, and the same for a volume at `/workspace/local`. A new named volume mounted anywhere else, such as `/data`, starts out owned by root: mount it at `/workspace/sqlite` or `/workspace/local`, or `chown` it once the same way. To keep running as root, start the container with `--user 0:0` (compose: `user: "0:0"`), or declare `docker` as a whole Dockerfile string.
30
+ - A directory a `postRuns` step creates for the server to write needs `chown 1000:1000` in that step.
31
+ - On the chart, the `volumePermissions` init container hands the `sqlite-data` claim a root image wrote to uid 1000 at the first start, hostPath, NFS and CSI volumes the kubelet's `fsGroup` skips included. A cluster's `sharedClaim` needs the one-time `chown -R 1000:1000`. An image without `sh` and `find` needs `volumePermissions: { enabled: false }`.
32
+ - The chart runs the pod as uid 1000, so it needs an image whose server can run as that user. An image built with akanjs 3.2 or earlier (a rollback to one through `image.tag` included), a declared `docker` Dockerfile string that runs the server as root, or a custom `docker.image` whose files uid 1000 cannot read, needs these lines in the app's values file, which run the pod as root as before:
33
+
34
+ ```yaml
35
+ podSecurityContext: { runAsUser: 0, runAsGroup: 0, runAsNonRoot: false }
36
+ securityContext: { capabilities: null }
37
+ volumePermissions: { enabled: false }
38
+ ```
39
+
40
+ - A request body over 128 MiB, which the server refused after the Ingress read it, now gets 413 from the Ingress. An app that raised `AKAN_MAX_UPLOAD_BODY` raises `ingress.proxyBodySize` with it; `ingress.proxyBodySize: "0"` passes any size again.
41
+ - The Ingress no longer answers a preflight itself or adds `Access-Control-Allow-Origin: *` to every response. A page on an origin the app does not list could read the app's GET responses through that header, and now cannot: add its origin to `option.setCrossSite({ allowedOrigins })`, or write `ingress: { cors: { enabled: true } }` in the app's values file for the old annotations. `allowedOrigins` covers `/api` only: a page on another origin that `fetch`es a public file, such as a JSON file under `public/`, or draws an `/_akan/image` response onto a canvas, now fails, since only fonts keep `Access-Control-Allow-Origin: *`; for those, `ingress: { cors: { enabled: true } }` is the remedy.
42
+
43
+ - aff1ba2: An external view opens only origins the app's config lists, in `native.desktop.externalView.allowOrigins`: a view's own `allowOrigins` narrow within them, and an origin outside them is `NOT_ALLOWED`, naming that key. `evaluate` and `initScript` need their own permission, granted by `desktop.externalView.evaluate: true`, and `sendKey` its own, granted by `desktop.externalView.sendKey: true`; both are off by default. While a view is open, opening its id again keeps its origins or narrows them, and refuses one it was not opened for; once closed, the id opens again for any origins the config lists, with the same browser profile, which belongs to the id. Origins compare exactly as the URL parser reads them: scheme, host and port, the host in punycode without a trailing dot, the default port left out, and an origin with user info refused; there are no wildcards. A view loads a URL as the URL parser writes it, so the engine never reads the page's text another way. A page opens a view only over its own window. The desktop shell checks all of this itself on macOS, Windows and Linux, and grants nothing when the build carries no permission list; on Windows a view now takes only the two DevTools calls `sendKey` and `capture` make. A top-level navigation or redirect off a view's origins stays refused, as before.
44
+
45
+ A plugin manifest's `scope` can say `required: true`: then every grant of the plugin, not only `<plugin>:default`, is within its `defaultScope` unless the grant gives its own `allow`, and a scope entry naming no field is a build error. `external-view` says so.
46
+
47
+ **Upgrading.** An app that lists `external-view` opens no view until its `akan.config.ts` names the origins, and needs `evaluate` and `sendKey` only for the calls it makes:
48
+
49
+ ```ts
50
+ native: {
51
+ plugins: ["external-view"],
52
+ desktop: {
53
+ externalView: {
54
+ allowOrigins: ["https://board.example"], // every origin a view's allowOrigins names
55
+ evaluate: true, // when it calls evaluate or opens with initScript
56
+ sendKey: true, // when it calls sendKey
57
+ },
58
+ },
59
+ },
60
+ ```
61
+
62
+ An app built with the akan-native CLI's own config grants the same in its capabilities: `{ identifier: "external-view:default", allow: [{ origin: "https://board.example" }] }`, `"external-view:allow-evaluate"` and `"external-view:allow-sendKey"`. A grant of `external-view:all` or `external-view:allow-open` opens no origin unless its own `allow` lists them. A page that passed `window` to `open` passes its own window or leaves it out.
63
+
64
+ - 8d75f2b: The public surface 3.2.0 deprecated is removed. `akanjs` and `@akanjs/devkit` publish only the subpaths their `exports` name, with no wildcard, so a file becomes public only when an entry names it.
65
+
66
+ - **`@akanjs/devkit` has no root aliases and no `./*` or `./*.ts`.** It publishes `@akanjs/devkit` (types only), `biome.base.json`, the facets `akanApp`, `akanConfig`, `artifact`, `cloud`, `codeAgent`, `commandDecorators`, `executors`, `frontendBuild`, `incrementalBuilder`, `mobile`, `pipeline`, `preview`, `transforms` and `workflow`, and the files `app/applicationBuildRunner`, `cloud/cloudApi`, `cloud/cloudUpdates`, `commandDecorators/exitCodeError`, `mobile/desktopRelease`, `mobile/serverBundleSecrets` and `transforms/serverEnvProfile`. `util/fileEditor`, `util/selectModel` and `workspace/getRelatedCnsts` are named too, and deprecated: nothing in akanjs uses them.
67
+ - **`akanjs` drops `akanjs/common/*`, `akanjs/server/*`, `akanjs/ui/*`, `akanjs/webkit/*` and `akanjs/client/native/*`.** Every `akanjs/client/native/<plugin>` path still resolves, now as its own entry, and so does `akanjs/webkit/usePurchase`. The layouts `akan` generates import `akanjs/ui/System/index.tsx`, `akanjs/ui/System/SSR.tsx`, `akanjs/ui/UiOverride/UiOverride.tsx` and `akanjs/webkit/RouteLevelBoundary.tsx`, and the `akan` command's bundled `@akanjs/language` imports `akanjs/common/akanNames.ts`, `akanjs/common/facetBarrel.ts` and `akanjs/common/routeConvention.ts`: these stay as named entries. `@akanjs/language`'s declarations now import their types from `akanjs/common`. Barrel imports in an installed workspace's build now resolve to files on disk instead of package subpaths.
68
+ - **The error-constructor plumbing is gone**: `setErrorConstructor` on `FetchClient`, `HttpClient` and `WsClient`, `HttpClientOptions.ErrorCls`, and `FetchClient.build`'s `Err` option. Every restored error is `akanjs/common`'s `Err`, as it already was. `registerClientRuntime` no longer re-points the shared client at the runtime's `Err`.
69
+ - **Thirteen deprecated exports are deleted, and eleven internals are no longer exported.**
70
+
71
+ **Upgrading.**
72
+
73
+ - `@akanjs/devkit/<name>` and `@akanjs/devkit/<name>.ts`, for 81 root names, and `@akanjs/devkit/executors.ts` (`@akanjs/devkit/executors` stays, as a facet):
74
+ - `applicationBuildRunner` → `@akanjs/devkit/app/applicationBuildRunner`, `fileEditor` → `@akanjs/devkit/util/fileEditor`, `selectModel` → `@akanjs/devkit/util/selectModel` and `getRelatedCnsts` → `@akanjs/devkit/workspace/getRelatedCnsts` (the last three are deprecated).
75
+ - Import the types of `akanContext`, `akanMcpContract`, `applicationBuildReporter`, `applicationTestPreload`, `createTunnel`, `dependencyScanner`, `fileSys`, `maintainabilityContract`, `packageExportsMap`, `prompter`, `qualityScanner`, `recipeScanner`, `scanInfo`, `spinner`, `stripAnsi`, `typeChecker` and `types` from `@akanjs/devkit`. Their values have no public entry.
76
+ - `abstractDoc`, `agentAssets`, `agentsIndex`, `akanMcpToolError`, `apiReference`, `appSelectionMemory`, `bareErrorScanner`, `biomeBase`, `codegenLock`, `commentDensityScanner`, `componentSizeScanner`, `componentWriteChainScanner`, `conventionSet`, `declarationReader`, `deprecatedCommentScanner`, `endpointReach`, `envSeed`, `errorCodeReference`, `errorCodeScan`, `formSetterScanner`, `frameworkGraph`, `gitRevision`, `jsonFormatter`, `kindBranchScanner`, `libSource`, `linter`, `maintainabilityBaseline`, `maintainabilityExceptionScanner`, `maintainabilityLimits`, `maintainabilityReport`, `manifestDependencies`, `moduleFieldNames`, `renderMutationScanner`, `repoIdentity`, `routeJsBudget`, `routeSourceValidator`, `semver`, `serviceLoopCallScanner`, `shellOnlyEnv`, `signalMutationIndex`, `slicePlanner`, `sourceComments`, `sshHostKeys`, `sshTunnel`, `ssrScanner`, `storeAccessScanner`, `storeSource`, `storeWriteScanner`, `structureScanner`, `subspace`, `subspaceClone`, `subspaceConfig`, `subspaceReport`, `testHelpers`, `testOnlyExportScanner`, `workspaceGraph`, `workspaceLayout`, `writePath`, `writePlacementScanner` and `writingActionIndex` have no replacement: they are the `akan` command's internals, which its build inlines.
77
+ - Any other `@akanjs/devkit/<dir>/<file>` that only `./*` reached: import its types from `@akanjs/devkit` where that barrel exports them; it is otherwise internal, with no replacement.
78
+ - `akanjs/<common|server|ui|webkit>/<file>`: import from the barrel, `akanjs/common`, `akanjs/server`, `akanjs/ui` or `akanjs/webkit` (`akanjs/server/machine/machineToken` → `akanjs/server`; `akanjs/ui/Constant/schemaDoc` → `akanjs/ui`), or from a named entry such as `akanjs/server/tunnel` for `akanjs/server/tunnel/index.ts`. A file no barrel re-exports is internal, `SignalResolver` and `akanjs/ui/Agent/RichInput` included, with no replacement: check which routes an endpoint serves with a signal test (`akan test <app>`) rather than through `SignalResolver.resolveEndpoint`. These 28 were public only through a wildcard and are internal now: `isIndexable`; `DEFAULT_HTML_CONTENT_SECURITY_POLICY`, `htmlContentSecurityPolicy`, `DEFAULT_STRICT_TRANSPORT_SECURITY`, `CONTENT_ENCODINGS`, `topologicalStages`, `traceCycle`, `getSystemPageErrorDetails`, `SYSTEM_PAGE_STYLE`, `getSameOriginHref`, `carriesCredentials`, `DEFAULT_ROUTE_CACHE_TTL_SECONDS`, `isAkanRouterStateV1`, `countCommonRouteSegments`, `AKAN_RSC_STATE_VERSION`, `decodeAkanRedirectDigest` and `validateRscSegmentPatch` (server); `getKeyboardAccessorySlots`, `blurActiveElement`, `KEYBOARD_SHOW_ANIMATION_DURATION_MS`, `KEYBOARD_HIDE_ANIMATION_DURATION_MS`, `KEYBOARD_SHOW_ANIMATION_EASING`, `KEYBOARD_HIDE_ANIMATION_EASING` and `clonePageState` (webkit); `DefaultPagination`, `DefaultTable`, `DefaultUnauthorized` and `isPublicEndpoint` (ui).
79
+ - `fetch.setErrorConstructor(Err)` in an older `lib/sig.ts`, and `{ Err: pageProto.Err }` passed to `FetchClient.build` in an older `lib/useClient.ts`: run `akan sync`, which rewrites both. Elsewhere, drop the `setErrorConstructor` call, the `ErrorCls` option and the `Err` option. A `FetchClient` constructed with its own error class still restores its WebSocket, bridge, refusal and abort errors into it, but an HTTP response error is always `Err`.
80
+ - `MAX_INT` → `2 ** 31 - 1`. `isFilterModel(ref)` → `getFilterMeta(ref, { allowEmpty: true }) !== undefined`. `setFilterInfoByKey` → declare the query with `from(model, (filter) => …)`. `getDefaultSchemaOptions()` → `new DocumentSchema()`. `runWithTrace` → `runTraced`, only where the caller owns the trace, since it finalizes it. `traceDbQuery(ms)` → `getCurrentTrace()?.countDbQuery(ms)`. `isSitemapPath(pathname, basePaths)` → `getSitemapBasePath(pathname, basePaths, headerBasePath) !== undefined`. `useRscNavigation` → `navigateRsc`, `clearRscNavigationCache` and `isRscNavigationFromCache`. `getSearchParam` and `getBaseSearchParam` → read `searchParams[key]`, taking the first value of an array. `dictionaryContext`, `groupByOwner` and `ServiceRegistry` have no replacement.
81
+ - No longer exported, with no replacement: `setFilterMeta` and `getFilterArgInfo` (`akanjs/document`), `isDebugHeaderAllowed` (`akanjs/signal`), `parseAkanConsoleQuery`, `createAkanConsoleLogCommands` and `createAkanConsoleContext` (`akanjs/server`), `isResponsiveInset`, `getClientRuntime`, `colorTokens` and `radiusTokens` (`akanjs/client`), and `isStateBuilderMarker` (`akanjs/store`).
82
+
83
+ - 6e5da23: `akan build` no longer puts the secret values of `env/env.server.<env>.ts` into the server it builds. The server reads each one from an environment variable when it starts, and says at boot which ones its deployment has not set.
84
+
85
+ - **What counts as a secret.** A string under a secret-sounding key (password, secret, token, apiKey, privateKey, accessKey, webhook, …), at any depth below it, or a URL with a password in it. It is the rule a desktop profile build already applies and the logger masks by, now also for a key named `aesKey`. Numbers, booleans, `null` and every other string stay in the build as before.
86
+ - **Where it is read from.** A variable named after the value's place in the env file, one upper snake case segment per key joined with `__`: `security.sso.google.clientSecret` is read from `SECURITY__SSO__GOOGLE__CLIENT_SECRET`. An array holding a secret is read whole from one variable holding JSON (`discord.tokens` from `DISCORD__TOKENS`). Four settings keep the names the framework already reads: `security.jwtSecret` is `JWT_SECRET`, and `database.postgres.url`, `.password` and `.insightUrl` are `POSTGRES_URL` (or `POSTGRES_URI`), `POSTGRES_PASSWORD` and `POSTGRES_INSIGHT_URL`. In `process.env.MY_VAR ?? "literal"` only the literal is replaced, so your own variable still comes first.
87
+ - **What the build writes.** `akan.env.json` and the Dockerfile gain `AKAN_ENV_NAMES`, the names the server reads (never a value), and the build prints them.
88
+ - **`akan secret-env <app> [--env <env>]`** lists each variable, its kind, its key in the env file and whether the shell sets it. With `--out <file>` it writes the values from the env file: `--format k8s` (the default) a Kubernetes Secret named by `--name` (default `<app>-env`), `--format dotenv` `NAME=value` lines that Bun's loader reads back unchanged. The file is readable by its user alone; a path under `dist/`, a path git would track, and an existing file without `--force` are refused.
89
+ - **At boot** (`AkanApp.start`, before the server is loaded or a replica is spawned) a variable that is not set is one warning naming every such variable. The framework does not stop for them, though whatever reads a value may, as a missing `JWT_SECRET` does. A JSON variable that does not parse is refused with the code `secretEnvInvalid`. A multi-line value that arrives with a backslash and an n in place of its line breaks is warned about by name.
90
+ - **What stops a build.** A secret-named key whose value the env file computes or imports rather than writes as a string stops the build before it writes anything, whatever the value's length, naming the app, the env file and the keys. After the bundles are written, the build looks in them for each secret string it left out: a long mixed one that another key of the env, the app's code or a copied file holds as well stops the build by its keys, and a short or plain one is a warning. No message prints a value.
91
+ - **Your own `process.env` reads stay yours.** A secret-named key the env file reads from `process.env.<NAME>` itself is left as that read: the build does not move it, does not stop at it, and writes no value of it, whether or not the build's shell sets the variable.
92
+ - **How the build finds the secrets.** It loads the env file, first with none of the shell's variables, so the list is the same from any shell, and with them when the file cannot load without (`process.env.HOSTS!.split(",")`). A file that loads neither way stops the build with the error's class and its file and line, never its message. Loading has a 60 second limit.
93
+ - **Unchanged:** your env files, `akan start`, `akan test`, `--profile` builds, and desktop and mobile builds, whose carried server still bundles its env file as written.
94
+
95
+ **Upgrading.** This changes how every app deploys. Before you deploy an image built with this version:
96
+
97
+ 1. Run `akan secret-env <app> --env <env>` for each app and environment you deploy. It lists the variables the server now expects. It prints names, never values.
98
+ 2. Give the server those variables.
99
+ - Kubernetes: `akan secret-env <app> --env <env> --format k8s --name <secret-name> --out <file>`, `kubectl apply -f <file>` in the app's namespace, reference the Secret from the container with `envFrom: [{ secretRef: { name: <secret-name> } }]`, then delete the file.
100
+ - Docker: `docker run -e NAME=value …`. `docker run --env-file` takes each line as written, so of a `--format dotenv` file it reads the values written without quotes and no quoted or multi-line one: pass those with `-e`.
101
+ - `bun main.js` on a host: `bun --env-file=<file> main.js` with the dotenv file, or set the variables in the service's environment. Keep the file outside `dist/apps/<app>`, which the image copies whole.
102
+ - Another platform: set them in its secret settings.
103
+ 3. Deploy. At start the server logs one warning naming any variable it is missing. The framework does not stop for it, though whatever reads the value may. Version 3.5.0 will refuse to start instead.
104
+ 4. When the new images are live, rotate those secrets and delete the old image tags. Images built before this version still contain the values.
105
+ 5. If you cannot change your deployment yet, build with `akan build <app> --inline-secrets`. The image then carries the values as before, and a variable you set still wins. When the env file cannot be loaded, this build warns and bundles the env files as written, reading no variable. Version 3.5.0 removes the flag.
106
+ 6. If a build stops with "holds … this build cannot leave out", each named key is computed or imported in the env file. Write the string at the key, or write `process.env.<NAME>` there and set that variable in the deployment.
107
+ 7. If a build stops with "holds secret values the server reads from its process env", a secret string is also somewhere the build keeps as written: the plain key the message names, the app's code, or a copied file. Take it out there, or read it there from the same variable.
108
+ 8. If a build stops with "could not be evaluated to check it for secrets", the env file throws at the named line when it is loaded. Set the variable it reads there in the build's shell, or give it a fallback.
109
+ 9. If a build stops at a key "a build would read from the environment variable …", two keys map to one variable name, or the name is one the platform or akan owns (`PWD`, `HOSTNAME`, `AKAN_*`, …). Rename the key, or write `process.env.<NAME>` there yourself.
110
+
111
+ A key file an env value points at by path (an Apple sign-in key under `private/`) is not an env value and still ships in the image: mount it instead. A key the rule does not recognise (`stripeKey`, a `salt`) stays in the build; write `process.env.<NAME>` for it.
112
+
113
+ ### Patch Changes
114
+
115
+ - 4a568b2: What an agent turn carries beside the conversation reaches the model as marked data in a user turn, outside the system prompt.
116
+
117
+ - **A turn's `context` is no longer written into the system prompt.** `OpenaiDialect` and `AnthropicLlm` send it as a `<turn-context …>` block that ends the turn's last user-role content, after that turn's tool results: a text block on the Messages API, and on the chat-completions wire the end of the user message the turn closes on, or a user message of its own after tool messages. The block closes on a delimiter chosen so that its content cannot contain it, in any case or width or with characters that do not show between its letters. The delimiter is keyed with a secret of the process: the same text gets the same one in every request a process sends, and another process gives it another. The system prompt is the instructions alone, so it is the same text on every turn of a conversation and a provider's prefix cache keeps it.
118
+ - **A compaction summary is history in a user turn on both dialects.** It is sent as a `<conversation-summary …>` block. The chat-completions dialect used to send it with the system role, and the Messages API mapping with no fence. When the user's message follows the summary, the block opens that message, so neither dialect sends two user turns in a row.
119
+ - **`LlmContext`** (`akanjs/service`) is what an adaptor of the app's own calls: `LlmContext.of(request.context)` is the context text, empty when there is none, and `LlmContext.summary(text)` the summary block.
120
+ - **A context block can be marked `untrusted: true`** (`AgentWireContext`, and `ContextBlock` in the page) when it holds text someone other than the developer or the user may have written. Both dialects fence marked blocks apart from the app's own, in a `<page-content …>` block, the one a `readScreen` result arrives in. A turn that carries one counts as an untrusted read. In the page the first change after it asks the user first, as after `readScreen`. In `agentService.loop` the run is tainted from its first round: `approve` hears `tainted: true`, and with no `approve` a write is answered with the code `writeAfterPageText` and a sentence for the model, and the loop logs once per run that `approve` is what decides such a call. The run stores `tainted: true` on each assistant message it writes while tainted, so a resume and the next ask in that conversation keep the taint when the block is not passed again.
121
+ - **Text from a mentioned record is treated like text a tool read.** An `@` mention's reference reaches the model with its pointer, label, value and note together in one `<page-content …>` block under the "Referenced data" heading; before, only the value was fenced. The token in the user's message is sent as `@[pointer](mention:pointer)`, so the record's title is in that block only; the chat still draws the title. When the id or the path is not a token, as a slug is not, the token is sent as `@[ref-1a2b3c4d](mention:ref-1a2b3c4d)` and the block spells the pointer under that name. A message that carries a reference counts as an untrusted read: in `Agent.Chat` the first change after it shows the approval card a change after `readScreen` shows, and an `agentService.loop` run whose messages carry `references` is tainted from its first round. A loop's compaction digest names a pointed-at record by its pointer.
122
+ - **The page's default context keeps ids, enum members, numbers and booleans inline, and leaves free text to a read tool.**
123
+ - A string rides inline only when it is one token: up to 40 letters, digits, `.`, `_` or `-`, of at most three words. A word ends at a separator or at a lower-to-upper case change, so `created-at-desc` and `createdAtDesc` pass and `archive-every-note-now` does not. More parts pass only as an id's: each hex, with a digit or eight characters long, as in a UUID. A run of over sixteen letters with no digit never passes. It used to ride inline up to 200 characters.
124
+ - In the `state` block any other string is listed by key and type with no value.
125
+ - The `route` block applies the rule to each path segment and path param, and keeps at most twelve words of each. A search param rides inline when a store declares its key with `search("key", …)` and its value is a token. Of the others at most four ride, key and value both tokens, so `?tab=settings&page=2&sort=created-at-desc` reads the same on a page whose stores declare none; the rest are left out, key and value. A page's typed `search` is read on the server and does not count as a declaration. What is left out reads `…` in the path, the block names the keys to read in `withheld` and the number of search params left out in `searchParamsWithheld`. `readState` answers `pathname`, `params` and `searchParams` whether or not a component subscribes them, as page content.
126
+ - In the `screen` block a `Load` scope's label, which is its record's title, and the ids and labels of a list scope's `items` follow the rule; the block then says to read the scope with `readScreen`.
127
+ - Not covered: an `Agent.Zone`'s `label` and a value published with `st.expose`, `st.useState` or `useAgentResource` still ride whole, as no read tool returns them. Publish an id or an enum member there, not text a user wrote.
128
+ - The MCP App view names its screen to the host by origin and path under the same rule, without the query string or the hash.
129
+ - `AgentService.preamble` and each adaptor's fallback prompt say what a `<turn-context …>` block is, and that a `<page-content …>` block may also end a user turn.
130
+ - The agent and MCP guidelines and the `akan-agent` skill describe all of the above.
131
+
132
+ **Upgrading.**
133
+
134
+ An `LlmAdaptor` of your own that builds its whole request with `OpenaiDialect.requestBody` or `AnthropicLlm.requestBody` needs no change. One that builds its own messages must change, also when it takes its system prompt from `OpenaiDialect.systemPrompt(request)` or `AnthropicLlm.systemPrompt(request)`: those now return the instructions without the context, so such an adaptor would send no context at all. Append the context to the last user-role content, and map a `summary` message to a user turn:
135
+
136
+ ```ts
137
+ // before
138
+ const system = OpenaiDialect.systemPrompt(request); // held the context
139
+ const turns = request.messages.map((message) =>
140
+ message.summary
141
+ ? { role: "system", content: message.text }
142
+ : toTurn(message)
143
+ );
144
+ // after
145
+ const system = OpenaiDialect.systemPrompt(request); // the instructions alone
146
+ const turns = request.messages.map((message) =>
147
+ message.summary
148
+ ? { role: "user", content: LlmContext.summary(message.text ?? "") }
149
+ : toTurn(message)
150
+ );
151
+ const context = LlmContext.of(request.context); // "" when the turn carries none
152
+ if (context) turns.push({ role: "user", content: context }); // or append it to the last user turn
153
+ ```
154
+
155
+ Marked blocks come fenced by the same call. A test that looked for a context value in `body.system`, or in the first chat-completions message, finds it in the last user-role content, and one that looked for a summary in a system message finds it in a user message.
156
+
157
+ A loop request or a page context that already used a field named `untrusted` on a block for something else must rename it: any value but `false` or `undefined` now marks the block.
158
+
159
+ A store for `agentService.loop` messages must keep `tainted` on assistant messages too. Store each message `onMessage` hands over whole, as before; a store that picks fields adds this one. A loop that passes user messages with `references` and has no `approve` no longer writes: each write is answered with the code `writeAfterPageText`. Pass `approve`, or send the message without `references`. This lasts for the rest of the conversation, not for one run, because the stored messages keep the reference; a marked context block lasts as long through the mark on what the model said. Passing `untrusted` does not lift it.
160
+
161
+ A loop that passes messages with `references` and has an `approve` hears `tainted: true` on every call from that message on, in that run and in every later ask of the conversation. An approver that allows untainted calls by itself and holds tainted ones for a person will hold them all.
162
+
163
+ In a loop the model reads a mention in the user's words as `@[ticket/t1](mention:ticket/t1)`, or as `@[ref-1a2b3c4d](mention:ref-1a2b3c4d)` when the id or path is not a token, and finds the title only in that message's "Referenced data" block. A compaction summary names a mentioned record by its pointer and no longer by its title, so after a compaction the model reads the record again to name it. A prompt or a test that expected the title in the user's text looks in the block.
164
+
165
+ An app that relied on the model seeing a search param, a path param, a short store string or a list row's title in its context now has the model read it with `readState` or `readScreen`. The model is told which to call, so most apps change nothing. To keep a search param in the context whatever else the link carries, declare it in a store (`search("status", String, { default: "" })`); an undeclared one rides only as one of the first four whose key and value are tokens.
166
+
167
+ An id that is not a token is left out like other free text: a slug of more than three words (`my-first-blog-post`) or a mixed-case random id such as a nanoid (`V1StGXR8_Z5jdHi6B-myT`). A list scope's `items` then lists the other rows only, a list whose ids are all such lists none, and the block's `note` says to call `readScreen` with the scope's path, where every row is. A live store key holding such an id is listed with no value. A 24-character hex id, a UUID, a ULID and a number ride as before.
168
+
169
+ The URL an MCP App view reports to its host as model context no longer has the query string or the hash, and a path segment of free text reads `…`. A host prompt or a test that read a search param from that URL gets it from a tool the view publishes.
170
+
171
+ Two cases need an edit. Instructions that point at the context point at the tool instead:
172
+
173
+ ```tsx
174
+ // before
175
+ <Agent.Chat instructions="The search box's text is searchParams.q in the route context." />
176
+ // after
177
+ <Agent.Chat instructions="The search box's text is the q search param: call readState with key searchParams." />
178
+ ```
179
+
180
+ And a chat or zone that withholds a read tool gives it back when its agent needs such a value:
181
+
182
+ ```tsx
183
+ // before
184
+ <Agent.Zone builtins={["highlight"]}>
185
+ // after
186
+ <Agent.Zone builtins={["highlight", "readState", "readScreen"]}>
187
+ ```
188
+
189
+ What `readState` and `readScreen` return is page content, so the first change after one asks the user first.
190
+
191
+ A chat where the user mentions a record now asks before the first change that follows. `AgentConfirm.set({ afterScreenRead: false })` turns that off together with the ask after `readScreen`.
192
+
193
+ - a291bbb: The path rules an agent loads with every service, signal, page and `.tsx` file are shorter: the `server`, `style` and `ssr` rules keep only what fails the build or silently changes behaviour and point at the skill that explains the rest (server 7.9 KB to 2.4 KB, style 5.8 KB to 2.5 KB, ssr 3.6 KB to 1.9 KB), and the `akan-page` skill no longer repeats what the `page` rule already says. Nothing was dropped: an endpoint's `errors` option and where an adapter's error keys live are now in the `akan-err` skill, the request-schema check in `transportRule`, and the `cn`, multi-slot and enum-to-class conventions in `cssRule`. `cssRule` and `recipeRule` now say the framework recipe list is in the `style` rule, and the API reference says what `akanjs/dictionary`, `document`, `service`, `store`, `client/native`, `native/desktop` and `test` hold. Run `akan agent install` in a workspace to pick up the new files.
194
+ - 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.
195
+ - 19c6fa7: `akan code` on the `local` profile can be told to stop asking about a command for the rest of the session, and one option turns asking off for a run.
196
+
197
+ - **A third answer.** The prompt before a shell command is now `approve? run: <command> [y/n/a]`. `a` runs the command and stops asking about it until the session ends. What is remembered is the program, and the sub-command too for `git`, `bun`, `bunx`, `npm`, `npx`, `pnpm`, `yarn`, `akan`, `docker`, `kubectl`, `helm`, `cargo` and `go`: allowing `git status` leaves `git diff` asked about, and allowing `bun test` leaves `bun x` asked about. `gh` is remembered two words deep, so allowing `gh pr view` leaves `gh pr merge` asked about. A line of several commands (`&&`, `;`, `|`, `$(…)`, a subshell) runs unasked only once every command in it is allowed. `/allowed` lists what the session has allowed and `/allowed clear` forgets it. Nothing is written to disk, so a resumed, forked or reloaded session asks again.
198
+ - **Still asked every time**, with a prompt that offers only `[y/n]`: a networking command (`curl`, `wget`, `nc`, `ssh`, `scp`, `rsync`, …) and a redirection to or from `/dev/tcp/…` or `/dev/udp/…`; a command that sends something out of the machine (`git push`, `npm publish`, `pnpm publish`, `yarn publish`, `yarn npm`, `bun publish`, `cargo publish`, `gh api`, and a `docker` line with `push` or `--push` in it); `rm`; a command that runs another or sets what a later one runs (`sudo`, `env`, `timeout`, `xargs`, `sh`, `bash`, `eval`, `builtin`, `source`, `.`, `trap`, `alias`, `export`, `declare`, `find -exec`, …); a variable set in front of a command other than `CI`, `NODE_ENV`, `FORCE_COLOR`, `NO_COLOR`, `TZ`, `LANG`, `LC_ALL`, `TERM`, `DEBUG` or `PORT` given one plain word; a line that writes a file with `>` or `>>`; and a line that cannot be split into its commands with confidence (a loop or `if`, backticks, a here-document, a program named by a variable).
199
+ - **`--no-ask`.** `akan code --no-ask` runs the session without asking before a shell command or a network request: the same as `--no-ask-commands --no-ask-network`. It prints one line at start saying so. It changes nothing else: secret files stay refused, this repo's MCP servers and extensions still wait for their own approval (`--trust-workspace`), the agent's own questions are still asked, and the `pod`, `review` and `web` profiles behave as before.
200
+
201
+ A program that drives `akan code --rpc` sees `remember: string[]` on an `approval` request when the session answer is offered, sends `{ "type": "approve", "approvalId": …, "approved": true, "remember": "session" }` to give it, and reads the names on `approval_resolved.remembered`. A host that sends only `approved` keeps working as before.
202
+
203
+ **Upgrading.** No step is needed: the three wire fields in `akanjs/common` (`CodeAgentApprovalRequest.remember`, the `approve` command's `remember`, `approval_resolved.remembered`) and `CodeTranscriptPart`'s `remembered` are optional additions.
204
+
205
+ - 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.
206
+ - 53bf2de: A problem in an env file is reported without the file's text, so a build or lint log holds no secret.
207
+
208
+ - **Type errors.** `akan build`, `akan typecheck` and `akan verify` report a TypeScript error in `env/env.server.*.ts` or `env/env.client.*.ts` by file, line, column and code alone. The source line and TypeScript's message are left out, because either can quote a value.
209
+ - **Lint.** `akan lint` and `akan verify` report a diagnostic in those files by file, line, column and rule, with no code frame, formatter diff or rule message. The files are still linted and formatted, and their errors still fail the run. Every other file prints as before.
210
+ - **`akan lint` output.** The `Found N errors.` lines are printed once at the end and the "Checked N files in …" line is gone. When Biome cannot read `biome.json`, the error is Biome's own explanation.
211
+
212
+ **Upgrading.** A failed `akan lint` now exits with 3, the code of a failed check, where it exited with 1. A script that tests for a non-zero exit needs no change; one that tests for exactly 1 does. To see what is wrong on a line of an env file, open the file at the position the diagnostic names.
213
+
214
+ - 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.
215
+
216
+ The key defaults to false, so existing apps are unchanged. The api report lists one new optional `AkanNativeIosConfig` property; no upgrade step is needed.
217
+
218
+ - 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.
219
+ - 1879e92: A whole-app lint runs about four times faster: `biome check apps/akan` in this repository went from 8.0 s to 2.0 s (median of five runs each on an Apple M4 Pro, 14 cores), where the same check with no lint plugins takes 0.95 s; `akan lint akan` went from 17.2 s to 5.0 s and `akan lint minimal` from 2.3 s to 1.7 s on the same machine. The ten costliest grit rules shipped in `@akanjs/devkit/lint` (the four colour rules, `no-conditional-st-hook`, `no-web-storage`, `no-web-only-api-outside-webkit`, `no-document-cookie`, `no-oversized-list-limit` and `no-unpublished-form-setter`) now check for a substring every match contains before their regex or code snippet runs, because Biome's GritQL engine pays for a regex or a snippet on every node it tries. Every rule reports the same diagnostics as before, and `biome.base.json` is unchanged, so a workspace picks this up by updating `@akanjs/devkit`.
220
+ - 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.
221
+ - 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.
222
+ - 36408f1: The route JS budget report no longer counts, and the route build no longer emits, chunks for `"use client"` files that export only hooks, such as the `akanjs/store` field tools, which no page loads. Reported route sizes drop by about 21 KB brotli on every route of `apps/akan` and `apps/minimal`.
223
+ - 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.
224
+
225
+ 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.
226
+
227
+ - 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.
228
+ - 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.
229
+ - 8bbe7c8: A Redis or Postgres tunnel to a cluster environment needs a configured credential: `SSH_TUNNEL_PRIVATE_KEY_PATH` (with `SSH_TUNNEL_PASSPHRASE` if the key has one), exported in the shell, or `SSH_TUNNEL_PASSWORD`. Without either, the tunnel fails before it dials, with an error naming both settings, instead of signing in with a built-in default credential and a warning. This removes an unsafe default. A key file the tunnel cannot read fails with an error naming the tunnel, `SSH_TUNNEL_PRIVATE_KEY_PATH` and the path.
230
+
231
+ **Upgrading.** If `akan start` against a cluster environment opened its tunnel with neither setting, it now stops with that error in every database mode but `single`, where it logs the error and runs without Redis. Export `SSH_TUNNEL_PRIVATE_KEY_PATH` in the shell (a repository's dotenv file cannot set it), or set `SSH_TUNNEL_PASSWORD` to the password the cluster's tunnel endpoint expects. `SSH_TUNNEL_USERNAME` still defaults to `root`.
232
+
233
+ - 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.
234
+ - Updated dependencies [4a568b2]
235
+ - Updated dependencies [c44d068]
236
+ - Updated dependencies [43b44ca]
237
+ - Updated dependencies [af09c4f]
238
+ - Updated dependencies [24315d1]
239
+ - Updated dependencies [19c6fa7]
240
+ - Updated dependencies [217b061]
241
+ - Updated dependencies [c7dee50]
242
+ - Updated dependencies [c30e4df]
243
+ - Updated dependencies [0baacae]
244
+ - Updated dependencies [e704d16]
245
+ - Updated dependencies [5c7c6cf]
246
+ - Updated dependencies [53bf2de]
247
+ - Updated dependencies [bbc9def]
248
+ - Updated dependencies [aff1ba2]
249
+ - Updated dependencies [bf582c1]
250
+ - Updated dependencies [8bbe7c8]
251
+ - Updated dependencies [90d740f]
252
+ - Updated dependencies [1a225e8]
253
+ - Updated dependencies [e9598f3]
254
+ - Updated dependencies [1885caf]
255
+ - Updated dependencies [45e3ffa]
256
+ - Updated dependencies [3032627]
257
+ - Updated dependencies [c10f7cf]
258
+ - Updated dependencies [c10f7cf]
259
+ - Updated dependencies [10641a0]
260
+ - Updated dependencies [045699c]
261
+ - Updated dependencies [5c7e083]
262
+ - Updated dependencies [31097f2]
263
+ - Updated dependencies [4040f2d]
264
+ - Updated dependencies [9a7a9d5]
265
+ - Updated dependencies [8d75f2b]
266
+ - Updated dependencies [d5e60f2]
267
+ - Updated dependencies [aead1aa]
268
+ - Updated dependencies [4225827]
269
+ - Updated dependencies [4225827]
270
+ - Updated dependencies [fb5e77e]
271
+ - Updated dependencies [31097f2]
272
+ - Updated dependencies [6e5da23]
273
+ - Updated dependencies [48d33a7]
274
+ - Updated dependencies [5c6d039]
275
+ - Updated dependencies [0492e0b]
276
+ - Updated dependencies [0492e0b]
277
+ - Updated dependencies [5c7e083]
278
+ - Updated dependencies [98931e4]
279
+ - Updated dependencies [05ef91f]
280
+ - Updated dependencies [f4b5aa6]
281
+ - Updated dependencies [4225827]
282
+ - Updated dependencies [8f9d432]
283
+ - akanjs@3.3.0
284
+ - @akanjs/language@3.3.0
285
+
286
+ ## 3.2.0
287
+
288
+ ### Minor Changes
289
+
7
290
  - 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.
8
291
 
9
292
  **Highlights**
@@ -66,27 +349,8 @@
66
349
 
67
350
  ### Patch Changes
68
351
 
69
- - 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.
70
- - 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.
71
- - 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.
72
-
73
- 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.
74
-
75
- - 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.
76
- - 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.
77
- - Updated dependencies [bf582c1]
78
- - Updated dependencies [c10f7cf]
79
- - Updated dependencies [c10f7cf]
80
- - Updated dependencies [5c7e083]
81
352
  - Updated dependencies [038d918]
82
- - Updated dependencies [aead1aa]
83
- - Updated dependencies [5c6d039]
84
- - Updated dependencies [0492e0b]
85
- - Updated dependencies [0492e0b]
86
- - Updated dependencies [5c7e083]
87
- - Updated dependencies [98931e4]
88
- - akanjs@3.3.0
89
- - @akanjs/language@3.3.0
353
+ - akanjs@3.2.0
90
354
 
91
355
  ## 3.1.1
92
356
 
@@ -83,7 +83,7 @@ reporting ready until the file it names exists.
83
83
 
84
84
  | variable | default | what it does |
85
85
  |---|---|---|
86
- | `AKAN_MEMORY_LOG` | off | `=1` logs a periodic memory report from each server role. |
86
+ | `AKAN_MEMORY_LOG` | off | `=1` logs a periodic memory report from each server role, and adds `rscFirstRenderMemory` (each route's first-render growth and loaded modules) to the RSC worker's metrics. |
87
87
  | `AKAN_MEMORY_LOG_INTERVAL_MS` | `60000` | How often that report is written. |
88
88
  | `AKAN_MEMORY_GC_ON_REPORT` | off | `=1` forces a GC before each report, so the number is retained memory rather than garbage. Costs a full GC per report. |
89
89
 
package/README.ko.md CHANGED
@@ -39,8 +39,9 @@ await runner.build();
39
39
 
40
40
  값은 그것을 가진 facet에서 import합니다(`@akanjs/devkit/executors`, `@akanjs/devkit/akanConfig`,
41
41
  `@akanjs/devkit/workflow` 등). 루트 `@akanjs/devkit` 진입점은 타입만 내보내므로, 도구 하나를 불러도 모든 facet이
42
- 프로세스에 올라오지 않습니다. facet이 따로 없는 도구는 그 폴더에서 import합니다(`@akanjs/devkit/app/…`, `quality/`,
43
- `workspace/`, `util/` 등). 이 도구들이 패키지 루트에 있던 시절의 경로는 다음 minor 릴리스까지 계속 동작합니다.
42
+ 프로세스에 올라오지 않습니다. facet 외에는 `exports`가 이름을 붙인 몇몇 파일(`app/applicationBuildRunner`,
43
+ `cloud/cloudApi`, `mobile/desktopRelease` 등)만 공개되며, 그 밖의 파일은 `akan` 명령의 내부 구현이라 패키지 밖에서
44
+ resolve되지 않습니다.
44
45
 
45
46
  ## 제공하는 것
46
47
 
package/README.md CHANGED
@@ -38,9 +38,9 @@ await runner.build();
38
38
 
39
39
  Import values from the facet that owns them (`@akanjs/devkit/executors`, `@akanjs/devkit/akanConfig`,
40
40
  `@akanjs/devkit/workflow`, …). The root `@akanjs/devkit` entry exports types only, so loading a tool does not pull
41
- every facet into the process. A tool with no facet of its own is imported from its folder (`@akanjs/devkit/app/…`,
42
- `quality/`, `workspace/`, `util/`, …); the paths these tools had at the package root still resolve until the next
43
- minor release.
41
+ every facet into the process. Besides the facets, `exports` names a few files (`app/applicationBuildRunner`,
42
+ `cloud/cloudApi`, `mobile/desktopRelease`, …); any other file is internal to the `akan` command and does not resolve
43
+ from outside the package.
44
44
 
45
45
  ## What It Provides
46
46
 
@@ -52,7 +52,7 @@ describe("Redis tunnels during dev startup", () => {
52
52
  const listener = Bun.listen({ hostname: "127.0.0.1", port: 0, socket: { data() {} } });
53
53
  const port = listener.port;
54
54
  listener.stop(true);
55
- process.env.SSH_TUNNEL_PORT = String(port);
55
+ Object.assign(process.env, { SSH_TUNNEL_PORT: String(port), SSH_TUNNEL_PASSWORD: "test-password" });
56
56
  if (mode === "local") process.env.AKAN_PUBLIC_ENV = "local";
57
57
  const create = IncrementalBuilderHost.create;
58
58
  IncrementalBuilderHost.create = async () =>
@@ -7,6 +7,7 @@ import { AppExecutor, WorkspaceExecutor } from "../executors";
7
7
  import { NativeConfig } from "../mobile/nativeConfig";
8
8
  import type { PackageJson } from "../workspace/types";
9
9
  import { AkanAppConfig, AkanLibConfig, deriveDefaultAppId } from "./akanConfig";
10
+ import { BUN_IMAGE_PIN, DEFAULT_DOCKER_IMAGE } from "./dockerImage";
10
11
  import type { LibConfigInput } from "./types";
11
12
 
12
13
  const akanPackageJson = JSON.parse(
@@ -15,7 +16,14 @@ const akanPackageJson = JSON.parse(
15
16
  const rootPackageJson = JSON.parse(
16
17
  fs.readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "../../../../package.json"), "utf8"),
17
18
  ) as { engines: { bun: string } };
18
- const pinnedBunImage = `oven/bun:${rootPackageJson.engines.bun}-slim`;
19
+ const writeDirsStep =
20
+ "RUN mkdir -p /workspace/sqlite /workspace/local /workspace/runtime /workspace/data /workspace/.akan/artifact/image-cache && chown 1000:1000 /workspace/sqlite /workspace/local /workspace/runtime /workspace/data /workspace/.akan/artifact/image-cache";
21
+ const setupActionBunVersion = /bun-version:\s*(\S+)/.exec(
22
+ fs.readFileSync(
23
+ path.join(path.dirname(fileURLToPath(import.meta.url)), "../../../../.github/actions/setup/action.yml"),
24
+ "utf8",
25
+ ),
26
+ )?.[1];
19
27
 
20
28
  const packageJson: PackageJson = {
21
29
  name: "repo",
@@ -180,7 +188,7 @@ describe("AkanAppConfig", () => {
180
188
  env: { PATH: process.env.PATH ?? "", ...(allow ? { AKAN_ALLOW_LOCAL_IMAGE: allow } : {}) },
181
189
  });
182
190
 
183
- expect(local).toContain(`FROM ${pinnedBunImage}\nARG AKAN_ALLOW_LOCAL_IMAGE\nRUN if`);
191
+ expect(local).toContain(`FROM ${DEFAULT_DOCKER_IMAGE}\nARG AKAN_ALLOW_LOCAL_IMAGE\nRUN if`);
184
192
  expect(config.dockerfileFor("main")).not.toContain("AKAN_ALLOW_LOCAL_IMAGE");
185
193
  expect(run().exitCode).toBe(1);
186
194
  expect(run().stderr.toString()).toContain("--build-arg AKAN_ALLOW_LOCAL_IMAGE=1");
@@ -240,7 +248,9 @@ describe("AkanAppConfig", () => {
240
248
  const envBlock = Object.entries(config.getProductionEnv())
241
249
  .map(([key, value]) => `ENV ${key}=${value}`)
242
250
  .join("\n");
243
- expect(config.dockerfile).toContain(`COPY . .\n${envBlock}\nCMD ["bun","main.js"]`);
251
+ expect(config.dockerfile).toContain(
252
+ `COPY . .\n${writeDirsStep}\n${envBlock}\nUSER 1000:1000\nCMD ["bun","main.js"]`,
253
+ );
244
254
  });
245
255
 
246
256
  test('publishes localePrefix "as-needed" to the bundles and the image, and leaves the default out of the image', () => {
@@ -255,19 +265,19 @@ describe("AkanAppConfig", () => {
255
265
  });
256
266
 
257
267
  test("writes the Dockerfile instructions it wrote before its env came from getProductionEnv", () => {
258
- //? 9adfb95c's output for this config, less the blank lines its empty interpolations left and its floating tag.
268
+ //? 9adfb95c's output for this config, less the blank lines its empty interpolations left, its floating tag and root.
259
269
  const before = [
260
- `FROM ${pinnedBunImage}`,
270
+ `FROM ${DEFAULT_DOCKER_IMAGE}`,
261
271
  "RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates tzdata && rm -rf /var/lib/apt/lists/*",
262
272
  "RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime",
263
273
  "ARG TARGETARCH",
264
274
  "",
265
- "RUN mkdir -p /workspace",
266
275
  "WORKDIR /workspace",
267
276
  "COPY ./package.json ./bun.lock ./",
268
277
  "RUN bun install --production --frozen-lockfile",
269
278
  "",
270
279
  "COPY . .",
280
+ writeDirsStep,
271
281
  "ENV PORT=8282",
272
282
  "ENV NODE_ENV=production",
273
283
  "ENV AKAN_PUBLIC_REPO_NAME=akanjs",
@@ -283,6 +293,7 @@ describe("AkanAppConfig", () => {
283
293
  "ENV AKAN_DATABASE_MODES=single",
284
294
  "ENV AKAN_LOG_TO_FILE=0",
285
295
  "",
296
+ "USER 1000:1000",
286
297
  'CMD ["bun","main.js"]',
287
298
  ];
288
299
  const lines = (text: string) => text.split("\n").filter((line) => line !== "");
@@ -307,6 +318,33 @@ describe("AkanAppConfig", () => {
307
318
  expect(config.dockerfile).not.toContain(dropped);
308
319
  });
309
320
 
321
+ test("pins the default image to the Bun release the repo runs, by the digest kept beside that version", () => {
322
+ expect(rootPackageJson.engines.bun).toBe(BUN_IMAGE_PIN.version);
323
+ expect(setupActionBunVersion).toBe(rootPackageJson.engines.bun);
324
+ expect(BUN_IMAGE_PIN.digest).toMatch(/^sha256:[0-9a-f]{64}$/);
325
+ expect(DEFAULT_DOCKER_IMAGE).toBe(`oven/bun:${BUN_IMAGE_PIN.version}-slim@${BUN_IMAGE_PIN.digest}`);
326
+ });
327
+
328
+ test("runs the generated image as the bun user once every root step is done, owning only what it writes", () => {
329
+ const config = new AkanAppConfig(
330
+ app,
331
+ [],
332
+ packageJson,
333
+ { docker: { preRuns: ["apt-get install -y ffmpeg"], postRuns: ["echo after"] } },
334
+ baseDevEnv,
335
+ );
336
+ const instructions = config.dockerfile.split("\n").filter((line) => line !== "");
337
+ const userAt = instructions.indexOf("USER 1000:1000");
338
+
339
+ expect(instructions.filter((line) => line.startsWith("USER "))).toEqual(["USER 1000:1000"]);
340
+ expect(instructions.slice(userAt + 1)).toEqual(['CMD ["bun","main.js"]']);
341
+ for (const rootStep of ["apt-get update", "apt-get install -y ffmpeg", "bun install", "echo after"])
342
+ expect(instructions.findIndex((line) => line.includes(rootStep))).toBeLessThan(userAt);
343
+ expect(instructions.filter((line) => line.includes("--chown"))).toEqual([]);
344
+ expect(instructions[instructions.indexOf("COPY . .") + 1]).toBe(writeDirsStep);
345
+ expect(instructions.filter((line) => line.includes("chown") && / \/workspace( |$)/.test(line))).toEqual([]);
346
+ });
347
+
310
348
  test("keeps a declared Dockerfile string verbatim", () => {
311
349
  const dockerfile = 'FROM oven/bun:1-slim\nCOPY . .\nCMD ["bun","main.js"]';
312
350
  const config = new AkanAppConfig(app, [], packageJson, { docker: dockerfile }, baseDevEnv);
@@ -319,7 +357,7 @@ describe("AkanAppConfig", () => {
319
357
  const config = new AkanAppConfig(app, [], packageJson, { docker: { preRuns: ["echo hi"] } }, baseDevEnv);
320
358
 
321
359
  expect(config.docker).toEqual({
322
- image: pinnedBunImage,
360
+ image: DEFAULT_DOCKER_IMAGE,
323
361
  preRuns: ["echo hi"],
324
362
  postRuns: [],
325
363
  command: ["bun", "main.js"],
@@ -662,7 +700,7 @@ describe("AkanAppConfig", () => {
662
700
  targets: {
663
701
  default: {
664
702
  plugins: ["share"],
665
- ios: { files: { "extra.caf": "assets/extra.caf" } },
703
+ ios: { files: { "extra.caf": "assets/extra.caf" }, hideFormAccessoryBar: true },
666
704
  android: { manifest: ["<uses-feature/>"] },
667
705
  },
668
706
  },
@@ -677,6 +715,7 @@ describe("AkanAppConfig", () => {
677
715
  ios: {
678
716
  infoPlist: { ITSAppUsesNonExemptEncryption: false },
679
717
  files: { "sound.caf": "assets/sound.caf", "extra.caf": "assets/extra.caf" },
718
+ hideFormAccessoryBar: true,
680
719
  },
681
720
  android: {
682
721
  manifest: ["<uses-feature/>"],
@@ -869,6 +908,16 @@ describe("AkanAppConfig", () => {
869
908
  expect(make({ native: { desktop: { dmg: { backgroundImage: "bg.png" } } } })).toThrow(
870
909
  "native.desktop.dmg.backgroundImage in apps/portal/akan.config.ts is not a native setting",
871
910
  );
911
+ expect(make({ native: { desktop: { externalView: { origins: ["https://board.example"] } } } })).toThrow(
912
+ "native.desktop.externalView.origins in apps/portal/akan.config.ts is not a native setting. Known: allowOrigins, evaluate, sendKey.",
913
+ );
914
+ expect(
915
+ make({
916
+ native: {
917
+ desktop: { externalView: { allowOrigins: ["https://board.example"], evaluate: true, sendKey: true } },
918
+ },
919
+ }),
920
+ ).not.toThrow();
872
921
  });
873
922
 
874
923
  test("derives a repo-scoped default appId and records an explicit native section", () => {