@akanjs/cli 3.2.0-rc.9 → 3.2.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/.build-stamp +2 -2
  2. package/CodeAgent-xdw73nbz.js +11 -0
  3. package/{CodeTui-qstk5vpj.js → CodeTui-0gewm71c.js} +822 -666
  4. package/README.ko.md +7 -0
  5. package/README.md +7 -0
  6. package/TunnelShare-cccfdgbm.js +16 -0
  7. package/agent.command-g1mj34wz.js +59 -0
  8. package/akanCode.js +12 -12
  9. package/appExecutor-rrx10jya.js +11 -0
  10. package/{application.command-m4rq4wc2.js → application.command-3w4v7t40.js} +84 -40
  11. package/{applicationBuildRunner-df7rx3ra.js → applicationBuildRunner-y5xbetyz.js} +51 -20
  12. package/buildBatch.proc.js +31 -16
  13. package/{cloud.command-a0gy0qq2.js → cloud.command-ph0rz6sw.js} +28 -29
  14. package/cloud.script-8bs9tp4j.js +30 -0
  15. package/{code.command-5rsdqw8s.js → code.command-9b967qpg.js} +13 -9
  16. package/context.command-ndzs5rbf.js +62 -0
  17. package/context.runner-bmstpng2.js +32 -0
  18. package/csrArtifactBuilder-gtvff6k7.js +10 -0
  19. package/{index-qd7xn2bk.js → dependencyScanner-93g8tk0r.js} +7 -6
  20. package/{devTui-h77zrjv5.js → devTui-rf374y2w.js} +1 -1
  21. package/{fileSys-zpvt5gtf.js → fileSys-e5mwt73x.js} +1 -1
  22. package/frameworkGraph-aneq2nwy.js +8 -0
  23. package/{guideline.command-mffxknbr.js → guideline.command-y8qz9kxy.js} +9 -5
  24. package/guidelines/agentRule/agentRule.instruction.md +25 -9
  25. package/guidelines/akanApi/akanApi.instruction.md +6 -4
  26. package/guidelines/conventions/core.md +23 -5
  27. package/guidelines/conventions/rules/app.md +4 -1
  28. package/guidelines/conventions/rules/page.md +5 -4
  29. package/guidelines/conventions/rules/ts.md +3 -3
  30. package/guidelines/errorCodes/errorCodes.instruction.md +165 -0
  31. package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
  32. package/guidelines/mcpRule/mcpRule.instruction.md +225 -5
  33. package/guidelines/pageRule/pageRule.instruction.md +10 -1
  34. package/guidelines/queryRule/queryRule.instruction.md +3 -1
  35. package/guidelines/runtimeRule/runtimeRule.instruction.md +14 -8
  36. package/guidelines/transportRule/transportRule.instruction.md +31 -1
  37. package/incrementalBuilder.proc.js +609 -437
  38. package/{index-skmtj8rm.js → index-02v45hh9.js} +27 -10
  39. package/{index-j6gc8n14.js → index-0csk6jqm.js} +11 -9
  40. package/{index-2r9ff9qm.js → index-0wa5z6rm.js} +2 -2
  41. package/{index-nmvhjn8c.js → index-0z8sbdme.js} +93 -82
  42. package/{index-2vgv7fs7.js → index-1c2807kg.js} +727 -693
  43. package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
  44. package/{index-2mf1aen9.js → index-1p9bxjmt.js} +2 -2
  45. package/{index-an76bdrv.js → index-2kh4xj3m.js} +1 -1
  46. package/{index-99qvtff2.js → index-2vn0m9z5.js} +5 -5
  47. package/{index-rp4yf32g.js → index-3569fr49.js} +36 -29
  48. package/{index-xvk2a75m.js → index-38x8ynrx.js} +25 -25
  49. package/{index-cmg5ngqa.js → index-3fmzz9sf.js} +20 -20
  50. package/{index-rfzp4pqs.js → index-45aprybg.js} +3 -3
  51. package/{index-k92x3vne.js → index-4a1n0nym.js} +1 -1
  52. package/{index-ra9fvn7s.js → index-4zgm54wf.js} +76 -40
  53. package/{index-exn38bzx.js → index-652f3bs8.js} +116 -54
  54. package/{index-grxs6fts.js → index-6gepp8yn.js} +57 -31
  55. package/{index-vm0dn0mt.js → index-6j351de4.js} +294 -157
  56. package/{index-w15mg3km.js → index-7ssr7wq4.js} +1 -1
  57. package/{index-gxav1bjz.js → index-82cmbpxc.js} +9 -9
  58. package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
  59. package/{index-gcx48get.js → index-9rymt8d6.js} +2 -2
  60. package/{index-swwjakt0.js → index-ankyx6dj.js} +14 -18
  61. package/{index-28x1aszt.js → index-b0t92k71.js} +154 -58
  62. package/index-b372rck5.js +799 -0
  63. package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
  64. package/{index-r0a604h4.js → index-c669pbyb.js} +5 -4
  65. package/{index-xyn02k0w.js → index-cm9rb480.js} +662 -433
  66. package/{index-j9790rhk.js → index-d0n78fzc.js} +1635 -1139
  67. package/{index-hqv34wzq.js → index-dr1carpr.js} +10 -10
  68. package/index-f2arv0mv.js +30 -0
  69. package/{index-5radqwn2.js → index-gtydr9qc.js} +12 -12
  70. package/{index-j6eeh5d7.js → index-j3fqs8rc.js} +5 -5
  71. package/{index-yckz5t8b.js → index-jdw9m5c4.js} +516 -434
  72. package/{index-ny2k80mv.js → index-jf4vk1s0.js} +9 -2
  73. package/{index-x40bdsca.js → index-jg5rwrf7.js} +77 -115
  74. package/{index-5zwr4n6k.js → index-ktxdfqg5.js} +65 -8
  75. package/index-mnhrqjjq.js +127 -0
  76. package/{index-3ghdb7p5.js → index-pc42gxa5.js} +2777 -3676
  77. package/{index-0hbtve0a.js → index-q8h4eg5y.js} +32 -28
  78. package/{index-j3v29pq7.js → index-qh81drde.js} +219 -175
  79. package/{index-b4qq3rq0.js → index-rwgqba9p.js} +1 -1
  80. package/{index-w8yasvpc.js → index-scfsqen7.js} +2136 -2175
  81. package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
  82. package/{index-0gg15zwa.js → index-twjgmryg.js} +6 -6
  83. package/index-whvhsb5f.js +80 -0
  84. package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
  85. package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
  86. package/{index-35j83zkd.js → index-xv3pvdw4.js} +2 -2
  87. package/{index-34792nh7.js → index-y2g0s9tn.js} +1 -1
  88. package/{index-43f4h4cm.js → index-ymgsvhc5.js} +7 -8
  89. package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
  90. package/{index-bns3wcpc.js → index-zyjztrvc.js} +2 -2
  91. package/index.js +30 -24
  92. package/libExecutor-nstr00s7.js +10 -0
  93. package/{library.command-bmd7zc5m.js → library.command-b02aw1hm.js} +12 -5
  94. package/{localRegistry.command-y6en1599.js → localRegistry.command-3hg1p4aj.js} +24 -24
  95. package/{module.command-7exfffqw.js → module.command-bd9gz6cv.js} +11 -7
  96. package/{package.command-adskw2rj.js → package.command-xmr0mxze.js} +11 -10
  97. package/package.json +8 -8
  98. package/{page.command-dw01272p.js → page.command-x94qf58g.js} +8 -4
  99. package/{pipeline.command-0b1r3y5r.js → pipeline.command-n2843k6t.js} +15 -9
  100. package/pkgExecutor-cka27e3c.js +10 -0
  101. package/{primitive.command-byw6vc04.js → primitive.command-cs7v376h.js} +12 -8
  102. package/{projectTypecheck-kkrpq60a.js → projectTypecheck-za2n3nbr.js} +1 -1
  103. package/{prompter-qrwx1p17.js → prompter-d33wmdpa.js} +2 -2
  104. package/{quality.command-6rqnhzct.js → quality.command-nqngh1jd.js} +25 -16
  105. package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
  106. package/{repair.command-rw5zymak.js → repair.command-v2medwsm.js} +12 -8
  107. package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
  108. package/{scalar.command-2dyp9nh9.js → scalar.command-61cjmxn1.js} +10 -6
  109. package/skills/akan-debug/SKILL.md +8 -5
  110. package/skills/akan-err/SKILL.md +7 -0
  111. package/skills/akan-mcp/SKILL.md +19 -1
  112. package/skills/akan-scaffold/SKILL.md +1 -1
  113. package/skills/akan-validate/SKILL.md +3 -3
  114. package/{subspace.command-111ynwv1.js → subspace.command-dtv8nfh7.js} +30 -24
  115. package/templates/app/page/_layout.tsx +13 -0
  116. package/templates/app/page/styles.css.template +40 -0
  117. package/templates/appSample/page/_index.tsx +9 -9
  118. package/templates/appSample/page/_layout.tsx +1 -0
  119. package/templates/appSample/page/styles.css.template +40 -5
  120. package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
  121. package/templates/biomeForm.ts +1 -1
  122. package/templates/env/_env.server.type.ts +1 -1
  123. package/templates/facetIndex/index.ts +2 -37
  124. package/templates/lib/sig.ts +0 -4
  125. package/templates/lib/useClient.ts +1 -1
  126. package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
  127. package/templates/workspaceRoot/AGENTS.md.template +2 -1
  128. package/templates/workspaceRoot/README.ts +4 -2
  129. package/{tunnel.command-2gcpfbdj.js → tunnel.command-fmwm5fgb.js} +15 -13
  130. package/{typeChecker-s640r6c0.js → typeChecker-7jt6abrs.js} +1 -1
  131. package/typecheck.proc.js +3 -2
  132. package/{verify.command-djgs86ma.js → verify.command-4f260t53.js} +19 -17
  133. package/{workflow.command-n0k2mxr5.js → workflow.command-tm5q9xsm.js} +21 -14
  134. package/{workspace.command-fh1qwxfx.js → workspace.command-75gc280j.js} +56 -54
  135. package/CodeAgent-x2p3a3e0.js +0 -11
  136. package/TunnelShare-c4xsfzg5.js +0 -15
  137. package/agent.command-9et2e27p.js +0 -52
  138. package/cloud.script-xze4zh7n.js +0 -31
  139. package/context.command-rk1dwrg4.js +0 -57
  140. package/context.runner-83ky5m1b.js +0 -30
  141. package/dependencyScanner-78sq8m4q.js +0 -8
  142. /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
  143. /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
  144. /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
  145. /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
@@ -200,7 +200,8 @@ normalized to `info` with one warning.
200
200
  - **The hub lives with whoever owns the surface**: the gateway when there is one, the replica itself under solo
201
201
  (`AKAN_REPLICA=0,0,1`), the same rule as the rotating log file and `/_akan/app/*`. It keeps a ring
202
202
  (`AKAN_LOG_BUFFER` records / `AKAN_LOG_BUFFER_MB`, default 2000 / 4), suppresses a line repeating more than 20
203
- times a second into one counted line, and serves `<runtimeDir>/akan-control.sock` (`0600`, NDJSON). A child
203
+ times a second into one counted line there, in live tails and in the log file (never a request line; the ndjson
204
+ stdout gets every record), and serves `<runtimeDir>/akan-control.sock` (`0600`, NDJSON). A child
204
205
  forwards records only while a subscriber wants that level (`log.level` IPC), so an unwatched process sends
205
206
  nothing; `AKAN_LOG_STREAM=1` keeps it on. The RSC worker forwards to its replica the same way.
206
207
  - **`akan logs <app>`** is the client: `--level --grep --endpoint --trace --child --role --origin --since`
@@ -216,9 +217,12 @@ normalized to `info` with one warning.
216
217
  solo replica) its only writer** — every other server process turns its console off and forwards from
217
218
  `AKAN_LOG_STDOUT_LEVEL` (default: the console level); a child's or the RSC worker's crash stack is wrapped as a
218
219
  `raw=true` record instead of breaking the stream. Text stays the default; turn it on in the deployment.
219
- - **`AKAN_LOG_STREAM_TOKEN` mounts `/_akan/app/logs`** (SSE, `Last-Event-ID` resume, explicit `gap` events);
220
+ - **`AKAN_LOG_STREAM_TOKEN` mounts `/_akan/app/logs`** (SSE, `Last-Event-ID` resume, explicit `gap` events;
221
+ a client that stops reading holds at most 4 MiB of live records beyond a resume's replay, hears `{type:"dropped",count}` when it reads again, and is cut off
222
+ past 10,000 dropped records);
220
223
  unset, the route does not exist. The same bearer also unlocks the health detail and metrics.
221
- - **`AKAN_LOG_CANONICAL=1|slow`** writes one `ok|error <endpoint> ms= status=` line per call; **`AKAN_LOG_FLIGHT=1`**
224
+ - **`AKAN_LOG_CANONICAL=1|slow`** writes one `ok|error <endpoint> ms= status=` line per call, at `info`, `warn` under
225
+ 500, or `error` with `type` and `stack` for a 5xx (then the only 5xx record); **`AKAN_LOG_FLIGHT=1`**
222
226
  keeps each call's last 64 sub-level records and promotes them (`flight=true`) only when it failed or ran past
223
227
  `AKAN_LOG_FLIGHT_MS`; an `x-akan-debug` header lowers one request to `trace` — under the local dev runtime, or
224
228
  with the `AKAN_LOG_DEBUG_HEADER` secret.
@@ -391,7 +395,8 @@ const config: AppConfig = {
391
395
  was opened for while its frames load web content from anywhere, with an init script that runs in the top document
392
396
  only, `evaluate`, a trusted `sendKey`, `capture`, and `loadFailed` / `gone` (it reloads, or is rebuilt, by itself;
393
397
  the reason is `terminated` on macOS, and `rebuildFailed` when a rebuild failed and the view is closed, to be opened
394
- again) / `consoleMessage` events. Every method on Windows; macOS 14+ lacks `sendKey`, `setMuted` and `capture`.
398
+ again) / `consoleMessage` events. Every method on Windows and Linux, where a visible view also holds the keyboard
399
+ focus and no `consoleMessage` is sent; macOS 14+ lacks `sendKey`, `setMuted` and `capture`.
395
400
 
396
401
  ## A Desktop App's Server — `bin` And `trustedDependencies`
397
402
 
@@ -629,10 +634,11 @@ serving without a key. Everything else is behind the ops channel.
629
634
  get 30 a minute per process; every refusal is the same 401 and spends none of them, and an address refused 10
630
635
  times in a minute gets 429 until it passes. A malformed key, or the machine token's own key
631
636
  (`AKAN_MACHINE_PUBLIC_KEY`), logs an error and leaves the app serving with the channel off.
632
- - **A migrate job runs for the token's `sub`**, which the run records as its actor: apply and rollback refuse a
633
- token without one, and a body naming `actor` is refused. Each option reaches the command as `--name=value`. One
634
- job runs at a time per process (409 meanwhile); the run's own lease keeps two hosts on one database apart. Jobs
635
- live in memory, so after a restart read the outcome from `list`. Polls count toward the 30 a minute.
637
+ - **A migrate job runs for the token's `sub`**, which the run records as its actor: apply, rollback and prune-indexes
638
+ refuse a token without one, and a body naming `actor` is refused. Each option reaches the command as
639
+ `--name=value`. One job runs at a time per process (409 meanwhile); the run's own lease keeps two hosts on one
640
+ database apart. Jobs live in memory, so after a restart read the outcome from `list`. Polls count toward the 30 a
641
+ minute.
636
642
  - **The app holds no storage credential.** It PUTs to the presigned URLs it was handed (`application/octet-stream`,
637
643
  the manifest `application/json`), plain http only to loopback. The manifest landing is the commit marker.
638
644
  - **Snapshots cover the SQLite modes only.** `single` copies the main file and, with `includeSolid`, the Solid file;
@@ -57,7 +57,9 @@ HTTP verb a mutation is mounted under. `conventions` carries the invariants —
57
57
  each room delivers (`seq`); a client drops a repeat, and a hole — a frame dropped under backpressure — calls the
58
58
  room's `onResync`. A resubscribe names its last frame (`since`): a server that saw every publish (a solo process)
59
59
  replays what followed it ahead of the ack, and otherwise answers a gap, which calls `onResync` as before. Binary
60
- rooms are not numbered.
60
+ rooms are not numbered. A server on Redis whose link to the app's other servers drops and returns sends each room a
61
+ `resync` frame once Redis hands it the room's events again, which calls `onResync` too (a live room refetches
62
+ instead), since what other servers published meanwhile never reached it.
61
63
  - **A cleanup registered with `ws.on("disconnect" | "unsubscribe", fn)` is scoped to the call that registered it.**
62
64
  From a `pubsub` subscribe it belongs to that room — `unsubscribe` runs when the client leaves it or a credential
63
65
  change revokes it, `disconnect` when the socket closes while still subscribed — so a room already left runs
@@ -231,6 +233,34 @@ HTTP verb a mutation is mounted under. `conventions` carries the invariants —
231
233
  ``await this.rateLimit.consume(`otp:${phone}`, { calls: 5, windowMs: 3_600_000 })``, which answers
232
234
  `{ ok: true } | { ok: false, retryAfterMs }` and is never switched off — throw the module's own `Err` with the
233
235
  wait when it refuses.
236
+ - **Rooms per socket are capped at 256, live or not** (`option.setLiveRoomLimit({ roomsPerSocket })`, merged in
237
+ mount order with the app last; `AKAN_LIVE_ROOMS_PER_SOCKET=<count>|off` wins over it). A subscribe past the cap is
238
+ refused with 429 `base.error.liveRoomLimit`, `data: { limit, per: "socket" }`; the rooms already held keep their events,
239
+ subscribing a held room again does not count twice, and leaving a room or closing the socket frees its place.
240
+ - **Rooms per caller are capped at 2,000 per server process**, across its sockets (`roomsPerCaller`,
241
+ `AKAN_LIVE_ROOMS_PER_CALLER`). The caller is `accountKey(account)`, else the address (`addressBlockOf`: an IPv4
242
+ address, mapped or not, as itself, an IPv6 one by its /64); one whose address is unknown is bounded per socket
243
+ only. A subscribe past it is refused the same way with `per: "caller"`, and the count drops as its sockets leave
244
+ rooms or close. Sockets per address stay unlimited: this count bounds the rooms whatever their number.
245
+ - **Live rooms per model are capped at 50,000 per server process** (`roomsPerModel` in the same setting,
246
+ `AKAN_LIVE_ROOMS_PER_MODEL`), counting only the rooms every write evaluates: those no equality index files and the
247
+ invalidating ones. An indexed room is reached through its key and never counts. A new counted room past it is
248
+ refused the same way with `per: "model"`, existing rooms keep working, and the refusal is warned at most once a
249
+ minute per model. It is a backstop behind the per-caller cap, which about 25 distinct callers at 2,000 rooms each
250
+ can reach; both count per server process, not across replicas.
251
+ - **A subscribe refused with 429 names its room** (`requestRoomId` on the error frame) and echoes the subscribe
252
+ frame's `token`, so the client ignores a refusal that answers an earlier subscribe of the room. Refused with
253
+ `liveRoomLimit`, the client drops that room, so a reconnect does not send it again, and calls the subscriber's
254
+ `onRefused(error)` fetch policy once. Refused for a budget (`tooManyRequests`), it sends the subscribe again after
255
+ the frame's `data.seconds` (1 to 60) plus up to a second of jitter per attempt, resyncs the room on the retry's
256
+ ack as a reconnect does, and drops the room the same way after five tries without an ack. A live slice whose room is dropped shows the error as a message, marks its list
257
+ stale, and subscribes again only on its next watch, such as the next mount — never in a loop.
258
+ - **Subscribe frames have a budget of their own**, over every pubsub endpoint: 1,000 a minute per websocket, counted
259
+ before the arguments are read, and 10,000 a minute per caller (the same caller as the room cap; one whose address
260
+ is unknown is counted per socket only), shared through the cache. A reconnect resubscribing every held room fits
261
+ either. `option.setRateLimit({ subscribe: { perSocket, perCaller } })` changes them (`{ calls,
262
+ windowMs? }`, or `false` to lift one; `subscribe: false` lifts both), and `AKAN_RATE_LIMIT=off` and a `local`
263
+ environment turn them off with every other budget. A refusal is the same 429 `base.error.tooManyRequests`.
234
264
 
235
265
  ## Calling Another Server
236
266