@akanjs/cli 3.1.2-rc.3 → 3.2.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-n2tkg59z.js → CodeAgent-h6g8dg3a.js} +2 -2
  3. package/{CodeTui-9wsdx7ap.js → CodeTui-n9gacepn.js} +1 -1
  4. package/README.ko.md +9 -0
  5. package/README.md +9 -0
  6. package/TunnelShare-k3ja4w9x.js +14 -0
  7. package/{agent.command-tffz6wdn.js → agent.command-2f657613.js} +19 -17
  8. package/akanCode.js +2 -2
  9. package/{application.command-7bkxbrsp.js → application.command-yb8v177e.js} +45 -22
  10. package/{applicationBuildRunner-s13x3zqb.js → applicationBuildRunner-sctcmkyx.js} +57 -17
  11. package/buildBatch.proc.js +7 -7
  12. package/{cloud.command-a792bc10.js → cloud.command-et06ja22.js} +35 -18
  13. package/cloud.script-s6rbrwer.js +30 -0
  14. package/{code.command-ma8dtzww.js → code.command-7m67c7zc.js} +6 -6
  15. package/commandManifest.json +1 -1
  16. package/{context.command-80a1qhps.js → context.command-569z0rqf.js} +20 -19
  17. package/context.runner-ms8v1rxy.js +29 -0
  18. package/{guideline.command-195g0h9a.js → guideline.command-gnv3e8p8.js} +2 -2
  19. package/guidelines/akanApi/akanApi.instruction.md +317 -0
  20. package/guidelines/conventions/rules/app.md +5 -5
  21. package/guidelines/conventions/rules/config.md +1 -1
  22. package/guidelines/conventions/rules/gates.md +10 -5
  23. package/guidelines/conventions/rules/page.md +4 -2
  24. package/guidelines/conventions/rules/server.md +2 -0
  25. package/guidelines/conventions/rules/style.md +3 -1
  26. package/guidelines/conventions/rules/ts.md +2 -1
  27. package/guidelines/cssRule/cssRule.instruction.md +3 -1
  28. package/guidelines/pageRule/pageRule.instruction.md +3 -0
  29. package/incrementalBuilder.proc.js +70 -14
  30. package/{index-tns543wd.js → index-0fb3cpbt.js} +3 -3
  31. package/{index-zbrwnmf1.js → index-1q1cjn8s.js} +21 -11
  32. package/{index-wrmq92vk.js → index-3wjbhj2n.js} +1 -1
  33. package/{index-361ex3rb.js → index-48d5qsj3.js} +4 -4
  34. package/{index-aayg4dqf.js → index-5w9my9qe.js} +8 -8
  35. package/{index-1h2jc0x3.js → index-6wpaq392.js} +61 -15
  36. package/{index-tp56652m.js → index-7xdpww43.js} +69 -12
  37. package/index-7y5yghjg.js +2969 -0
  38. package/{index-zttm13c3.js → index-8g7tdsk4.js} +249 -696
  39. package/{index-m02tdq8a.js → index-8pb9yvp8.js} +63 -21
  40. package/{index-gbp1q1b5.js → index-8ts9774g.js} +4 -4
  41. package/{index-9zy8479y.js → index-93ewzmp6.js} +43 -14
  42. package/{index-zdpte1pj.js → index-9tbgb4d8.js} +1 -1
  43. package/index-abgh0jve.js +126 -0
  44. package/{index-khk05tsf.js → index-aj3ehkcx.js} +1 -1
  45. package/{index-84h43kg6.js → index-d4n1wmrz.js} +37 -4
  46. package/{index-gr9thy79.js → index-drz9e84d.js} +22 -8
  47. package/{index-hapx5myy.js → index-e3vmjtph.js} +2 -2
  48. package/{index-k64mhwbw.js → index-eajbmk10.js} +2 -1
  49. package/{index-0j1t1h2b.js → index-ed6ea0qp.js} +1 -1
  50. package/{index-sjabnf7j.js → index-fjr4d6yd.js} +444 -368
  51. package/index-hqrkqxx2.js +176 -0
  52. package/{index-z7kbxdqg.js → index-jdamtr7e.js} +3 -3
  53. package/{index-scck6h6d.js → index-kpdv34rq.js} +4 -4
  54. package/{index-ppvqy5bc.js → index-ktb3wcqz.js} +73 -34
  55. package/{index-sveq36gh.js → index-mmym5xmb.js} +4 -2
  56. package/{index-y4kcmbt2.js → index-mqntfzv5.js} +2 -2
  57. package/{index-4am4dvmf.js → index-ny2k80mv.js} +15 -3
  58. package/index-p6hjwt2d.js +1668 -0
  59. package/{index-wwe9rsrx.js → index-r0a604h4.js} +12 -2
  60. package/{index-jb2sreps.js → index-rc5fvqj2.js} +18 -18
  61. package/{index-db2nqrad.js → index-ryrm5z2c.js} +71 -19
  62. package/{index-eft5c2mp.js → index-s2grpzef.js} +331 -27
  63. package/{index-g500c5j9.js → index-sr5da35e.js} +33 -10
  64. package/{index-defp4gmb.js → index-sy481q2x.js} +1 -1
  65. package/{index-j9d3mjx1.js → index-thckcabc.js} +2 -2
  66. package/{index-9z3egsmg.js → index-vkzfk7qt.js} +25 -23
  67. package/index-w639tvkd.js +166 -0
  68. package/index-ygdbn9jn.js +122 -0
  69. package/{index-sp0qsr7a.js → index-zpv14wpy.js} +3 -3
  70. package/{index-sx91nf4z.js → index-zxsygkda.js} +18 -9
  71. package/index.js +24 -23
  72. package/{library.command-63hgt9te.js → library.command-1gp5qe3r.js} +3 -3
  73. package/{localRegistry.command-343ksmn9.js → localRegistry.command-v3g21rex.js} +25 -16
  74. package/{module.command-2hce9m6k.js → module.command-4xz9he6h.js} +6 -6
  75. package/{package.command-96eheyvd.js → package.command-s7qpnn1g.js} +12 -3
  76. package/package.json +2 -2
  77. package/{page.command-gs6d841d.js → page.command-fan34c49.js} +3 -3
  78. package/{pipeline.command-wdfvdbfj.js → pipeline.command-ph4fnn9w.js} +2 -2
  79. package/{primitive.command-7tdj12wn.js → primitive.command-3fqh8emf.js} +7 -7
  80. package/{projectTypecheck-kqj1t6hb.js → projectTypecheck-vkb40hjc.js} +1 -1
  81. package/{quality.command-29bgarh1.js → quality.command-ecj6exsh.js} +15 -10
  82. package/{repair.command-yng4rf5d.js → repair.command-fe9jw719.js} +6 -6
  83. package/{scalar.command-1nk4329t.js → scalar.command-cnvfhk0n.js} +5 -5
  84. package/skills/akan-debug/SKILL.md +2 -1
  85. package/skills/akan-page/SKILL.md +30 -2
  86. package/skills/akan-service/SKILL.md +77 -1
  87. package/{subspace.command-5cehmcdd.js → subspace.command-yxtt3v3e.js} +8 -8
  88. package/templates/app/lib/___appName__/__appName__.abstract.md.template +6 -0
  89. package/templates/app/page/_index.tsx +4 -284
  90. package/templates/app/page/_layout.tsx +1 -26
  91. package/templates/app/page/styles.css.template +58 -318
  92. package/templates/appSample/page/_index.tsx +281 -0
  93. package/templates/appSample/page/_layout.tsx +55 -0
  94. package/templates/appSample/page/styles.css.template +327 -0
  95. package/templates/libRoot/lib/___libName__/__libName__.abstract.md.template +6 -0
  96. package/templates/workspaceRoot/package.json.template +1 -12
  97. package/{tunnel.command-yrd4atqy.js → tunnel.command-ggj38mqf.js} +7 -7
  98. package/{typeChecker-j2jdnqsr.js → typeChecker-s640r6c0.js} +1 -1
  99. package/typecheck.proc.js +1 -1
  100. package/{verify.command-kbq0fcg8.js → verify.command-w9ttxkdz.js} +16 -14
  101. package/{workflow.command-274qfa8z.js → workflow.command-ss8devj0.js} +12 -12
  102. package/{workspace.command-r6hgmawy.js → workspace.command-rw1p0xeq.js} +50 -38
  103. package/TunnelShare-6d7z36sr.js +0 -14
  104. package/cloud.script-t2n13gv6.js +0 -27
  105. package/context.runner-wxqb3qcy.js +0 -28
  106. package/index-j2dgmzbj.js +0 -1259
  107. package/index-p6x5b7hr.js +0 -839
  108. package/index-vzpnr12w.js +0 -65
  109. package/templates/workspaceRoot/patches/zod@3.25.76.patch.template +0 -22
  110. package/templates/workspaceRoot/patches/zod@4.4.3.patch.template +0 -11
  111. /package/templates/{app → appSample}/page/_overrides.tsx +0 -0
  112. /package/templates/{app → appSample}/public/fonts/Pretendard-Black.woff2 +0 -0
  113. /package/templates/{app → appSample}/public/fonts/Pretendard-Bold.woff2 +0 -0
  114. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraBold.woff2 +0 -0
  115. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraLight.woff2 +0 -0
  116. /package/templates/{app → appSample}/public/fonts/Pretendard-Light.woff2 +0 -0
  117. /package/templates/{app → appSample}/public/fonts/Pretendard-Medium.woff2 +0 -0
  118. /package/templates/{app → appSample}/public/fonts/Pretendard-Regular.woff2 +0 -0
  119. /package/templates/{app → appSample}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
  120. /package/templates/{app → appSample}/public/fonts/Pretendard-Thin.woff2 +0 -0
  121. /package/templates/{app → appSample}/public/jelly/cloud.webp +0 -0
  122. /package/templates/{app → appSample}/public/jelly/comet.webp +0 -0
  123. /package/templates/{app → appSample}/public/jelly/moon.webp +0 -0
  124. /package/templates/{app → appSample}/public/jelly/planet.webp +0 -0
  125. /package/templates/{app → appSample}/public/jelly/rocket.webp +0 -0
  126. /package/templates/{app → appSample}/public/jelly/star.webp +0 -0
  127. /package/templates/{app → appSample}/public/jelly/sugar.webp +0 -0
  128. /package/templates/{app → appSample}/public/logo.png +0 -0
  129. /package/templates/{app → appSample}/ui/Recipe/index.ts +0 -0
  130. /package/templates/{app → appSample}/ui/Recipe/jellyButton.ts +0 -0
@@ -1 +1 @@
1
- {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","migrate":"application","create-migration":"application","preview":"application","studio":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","verify":"verify","repair":"repair","workflow":"workflow","pipeline":"pipeline","tunnel":"tunnel"}}
1
+ {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","migrate":"application","create-migration":"application","preview":"application","studio":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","sync-architecture":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","verify":"verify","repair":"repair","workflow":"workflow","pipeline":"pipeline","tunnel":"tunnel"}}
@@ -2,31 +2,32 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-9zy8479y.js";
5
+ } from "./index-93ewzmp6.js";
6
6
  import"./index-bns3wcpc.js";
7
- import"./index-g500c5j9.js";
7
+ import"./index-sr5da35e.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-m02tdq8a.js";
10
- import"./index-j2dgmzbj.js";
11
- import"./index-j9d3mjx1.js";
12
- import"./index-jb2sreps.js";
13
- import"./index-sp0qsr7a.js";
14
- import"./index-0j1t1h2b.js";
9
+ import"./index-8pb9yvp8.js";
10
+ import"./index-7y5yghjg.js";
11
+ import"./index-thckcabc.js";
12
+ import"./index-rc5fvqj2.js";
13
+ import"./index-zpv14wpy.js";
14
+ import"./index-ed6ea0qp.js";
15
15
  import"./index-m9jj544v.js";
16
- import"./index-zbrwnmf1.js";
17
- import"./index-sveq36gh.js";
16
+ import"./index-1q1cjn8s.js";
17
+ import"./index-mmym5xmb.js";
18
18
  import"./index-j6eeh5d7.js";
19
- import"./index-vzpnr12w.js";
20
- import"./index-tns543wd.js";
21
- import"./index-khk05tsf.js";
22
- import"./index-gbp1q1b5.js";
23
- import"./index-361ex3rb.js";
24
- import"./index-hapx5myy.js";
25
- import"./index-k64mhwbw.js";
26
- import"./index-9z3egsmg.js";
19
+ import"./index-ygdbn9jn.js";
20
+ import"./index-w639tvkd.js";
21
+ import"./index-0fb3cpbt.js";
22
+ import"./index-aj3ehkcx.js";
23
+ import"./index-8ts9774g.js";
24
+ import"./index-48d5qsj3.js";
25
+ import"./index-e3vmjtph.js";
26
+ import"./index-eajbmk10.js";
27
+ import"./index-vkzfk7qt.js";
27
28
  import {
28
29
  ContextScript
29
- } from "./index-scck6h6d.js";
30
+ } from "./index-kpdv34rq.js";
30
31
 
31
32
  // pkgs/@akanjs/cli/context/context.command.ts
32
33
  class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
@@ -0,0 +1,29 @@
1
+ // @bun
2
+ import {
3
+ ContextRunner2
4
+ } from "./index-rc5fvqj2.js";
5
+ import"./index-vkzfk7qt.js";
6
+ import"./index-e3vmjtph.js";
7
+ import"./index-48d5qsj3.js";
8
+ import"./index-0fb3cpbt.js";
9
+ import"./index-8ts9774g.js";
10
+ import"./index-aj3ehkcx.js";
11
+ import"./index-eajbmk10.js";
12
+ import"./index-thckcabc.js";
13
+ import"./index-8pb9yvp8.js";
14
+ import"./index-ed6ea0qp.js";
15
+ import"./index-j6eeh5d7.js";
16
+ import"./index-zpv14wpy.js";
17
+ import"./index-m9jj544v.js";
18
+ import"./index-93ewzmp6.js";
19
+ import"./index-w639tvkd.js";
20
+ import"./index-ygdbn9jn.js";
21
+ import"./index-7y5yghjg.js";
22
+ import"./index-mmym5xmb.js";
23
+ import"./index-1q1cjn8s.js";
24
+ import"./index-sr5da35e.js";
25
+ import"./index-hj6w4ka1.js";
26
+ import"./index-bns3wcpc.js";
27
+ export {
28
+ ContextRunner2 as ContextRunner
29
+ };
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  script,
4
4
  command
5
- } from "./index-9zy8479y.js";
5
+ } from "./index-93ewzmp6.js";
6
6
  import"./index-bns3wcpc.js";
7
- import"./index-g500c5j9.js";
7
+ import"./index-sr5da35e.js";
8
8
  import {
9
9
  Prompter2
10
10
  } from "./index-j6eeh5d7.js";
@@ -0,0 +1,317 @@
1
+ # Akan.js API reference
2
+
3
+ Generated from the akanjs sources of this release: the import paths and signatures a first app needs, so none of
4
+ them has to be looked up in `node_modules`. A stage's return type is the same chain, left out below.
5
+
6
+ ## Imports
7
+
8
+ ```ts
9
+ import { Any, Binary, dayjs, Float, ID, Int, Upload } from "akanjs/base";
10
+ import { layout, page, rootLayout, router } from "akanjs/client";
11
+ import { serviceDictionary } from "akanjs/dictionary";
12
+ import { adapt, serve } from "akanjs/service";
13
+ import { endpoint, internal, None, Public } from "akanjs/signal";
14
+ import { Link } from "akanjs/ui";
15
+ import { usePageLocation } from "akanjs/webkit";
16
+ import { fetch, usePage, <Model> } from "@apps/<app>/client"; // pages and UI
17
+ import * as cnst from "../cnst"; // inside lib/<module>/, beside srv and Err
18
+ import { Err } from "../dict";
19
+ import * as srv from "../srv";
20
+ import { BookApi } from "@apps/<app>/srvkit"; // a layer barrel: common, srvkit, ui, webkit
21
+ import { signedIn } from "@libs/shared/webkit"; // a workspace created with --libs true
22
+ ```
23
+
24
+ ## Routes (`page/`)
25
+
26
+ ### `page` · `akanjs/client`
27
+
28
+ ```ts
29
+ page(): PageDefinition<Record<never, never>, Record<never, never>>
30
+ ```
31
+
32
+ ### `layout` · `akanjs/client`
33
+
34
+ ```ts
35
+ layout(): LayoutDefinition<Record<never, never>>
36
+ ```
37
+
38
+ ### `rootLayout` · `akanjs/client`
39
+
40
+ ```ts
41
+ rootLayout(): RootLayoutDefinition<Record<never, never>>
42
+ ```
43
+
44
+ ### `RouteBaseArgs`
45
+
46
+ ```ts
47
+ lang: string;
48
+ ```
49
+
50
+ ### `router` · `akanjs/client`
51
+
52
+ ```ts
53
+ .push(href: string, routeOptions?: RouteOptions)
54
+ .replace(href: string, routeOptions?: RouteOptions)
55
+ .canGoBack()
56
+ .backOrFallback(fallbackHref?: string, routeOptions?: RouteOptions)
57
+ .back(routeOptions?: RouteOptions)
58
+ .refresh()
59
+ .redirect(target: string, options?: RedirectOptions)
60
+ .notFound()
61
+ .getPath(pathname?: string)
62
+ ```
63
+
64
+ ### `RouteOptions`
65
+
66
+ ```ts
67
+ scrollToTop?: boolean;
68
+ /** Writes the URL and the store's path and search params without asking the server for the page, as for `?peek=`; honoured only when the path stays the same. */
69
+ shallow?: boolean;
70
+ /** Lets an absolute URL on another origin through; without it the router refuses one, so a `?redirect=` handed on unchecked cannot send a visitor off-site. */
71
+ external?: boolean;
72
+ ```
73
+
74
+ ### `Link` · `akanjs/ui`
75
+
76
+ ```ts
77
+ Link({ className, href, disabled, children, ...props }: CommonLinkProps): Element
78
+ ```
79
+
80
+ ### `CommonLinkProps`
81
+
82
+ ```ts
83
+ /** Omitted, or with `disabled`, Link renders a plain div around the same children. */
84
+ href?: string;
85
+ disabled?: boolean;
86
+ scrollToTop?: boolean;
87
+ /** Replaces the current history entry instead of pushing a new one. */
88
+ replace?: boolean;
89
+ /** Applied while the current page is `href` or below it, or exactly `href` with `activeExact`; basePath-aware. */
90
+ activeClassName?: string;
91
+ activeExact?: boolean;
92
+ /** More paths under which the link counts as active, as a tab does for its detail pages. */
93
+ activeMatch?: string[];
94
+ noCache?: boolean;
95
+ /** `"hover"` (the default, or `true`) loads the page on hover or keyboard focus, `"viewport"` also once it shows. */
96
+ prefetch?: LinkPrefetch;
97
+ ```
98
+
99
+ ### `usePageLocation` · `akanjs/webkit`
100
+
101
+ ```ts
102
+ usePageLocation(): { pathname: string; params: { [key: string]: string; }; searchParams: BaseSearchParamsState; }
103
+ ```
104
+
105
+ ### Route stages
106
+
107
+ Shared by `page()`, `layout()` and `rootLayout()`:
108
+
109
+ ```ts
110
+ .param<Name extends string, Type extends RouteArgType>(name: Name & FreeName<Name, Record<never, never>>, type: Type, option?: RouteArgOption)
111
+ .search<Name extends string, Type extends RouteSearchType>(name: Name & FreeName<Name, Record<never, never>>, type: Type, option?: RouteArgOption)
112
+ .render(render: (args: RouteBaseArgs) => PromiseOrObject<ReactNode>)
113
+ .config(config: PageConfig)
114
+ .head(head: HeadStage<RouteBaseArgs>)
115
+ .guard(guard: (args: RouteBaseArgs) => void | Promise<void>)
116
+ .loading(render: (args: RouteBaseArgs) => PromiseOrObject<ReactNode>)
117
+ ```
118
+
119
+ Only on `page()`:
120
+
121
+ ```ts
122
+ .prompt(name: string, description: string)
123
+ .app<Name extends string>(name: Name & FreeName<Name, Record<never, never>>, description: string, load: (args: RouteBaseArgs) => PromiseOrObject<ReactNode>)
124
+ ```
125
+
126
+ On `layout()` and `rootLayout()`, where a line replaces its shared form above:
127
+
128
+ ```ts
129
+ interface LayoutExtra { children: ReactNode; }
130
+ .param<Name extends string, Type extends RouteArgType>(name: Name, type: Type, option?: RouteArgOption)
131
+ .search<Name extends string, Type extends RouteSearchType>(name: Name, type: Type, option?: RouteArgOption)
132
+ .notFound(render: LayoutNotFoundRender)
133
+ .error(render: LayoutErrorRender)
134
+ .loading(render: (args: RouteBaseArgs & LayoutExtra) => PromiseOrObject<ReactNode>)
135
+ .render(render: (args: RouteBaseArgs & LayoutExtra) => PromiseOrObject<ReactNode>)
136
+ ```
137
+
138
+ Only on `rootLayout()`, before `.param()` and `.search()`:
139
+
140
+ ```ts
141
+ .fonts(fonts: ReactFont[])
142
+ .manifest(manifest: WebAppManifest)
143
+ .theme(theme: string)
144
+ .reconnect(on?: boolean)
145
+ .wsConnect(on?: boolean)
146
+ .layoutStyle(style: "mobile" | "web")
147
+ .viewport(viewport: RouteViewport)
148
+ ```
149
+
150
+ ## Services and adapters (`lib/_<service>/`, `srvkit/`)
151
+
152
+ ### `adapt` · `akanjs/service`
153
+
154
+ ```ts
155
+ adapt<Name extends string>(name: Name): AdaptorCls<{}, Record<never, never>>
156
+ adapt<Name extends string, Injection extends InjectBuilder<"use" | "env" | "memory" | "plug">>(name: Name, injectBuilder: Injection): AdaptorCls<{}, ReturnType<Injection>>
157
+ ```
158
+
159
+ ### `serve` · `akanjs/service`
160
+
161
+ ```ts
162
+ serve<RefName extends string, Injection extends InjectBuilder>(refName: RefName, injectBuilder: Injection, ...extendSrvs: (new (...args: never[]) => unknown)[]): ServiceCls<RefName, {}, ReturnType<Injection>>
163
+ serve<RefName extends string, Injection extends InjectBuilder>(refName: RefName, option: ServiceOptions, injectBuilder: Injection, ...extendSrvs: (new (...args: never[]) => unknown)[]): ServiceCls<RefName, {}, ReturnType<Injection>>
164
+ serve<Db extends DatabaseModel, Injection extends InjectBuilder, LibSrvs extends Cls[] = []>(db: Db, injectBuilder: Injection, ...extendSrvs: LibSrvs): ServiceCls<Db["refName"], DatabaseServiceForModel<Db, LibSrvs>, ReturnType<Injection>>
165
+ serve<Db extends DatabaseModel, Injection extends InjectBuilder, LibSrvs extends Cls[] = []>(db: Db, option: ServiceOptions, injectBuilder: Injection, ...extendSrvs: LibSrvs): ServiceCls<Db["refName"], DatabaseServiceForModel<Db, LibSrvs>, ReturnType<Injection>>
166
+ ```
167
+
168
+ ### `ServiceOptions`
169
+
170
+ ```ts
171
+ enabled?: boolean | (() => boolean);
172
+ /** The `SERVER_MODE` process that mounts the module, endpoints included; `all` mounts every mode and an unset mode mounts everywhere. */
173
+ serverMode?: "batch" | "federation";
174
+ /** The operation modes the module mounts in; `modules: ["@edge"]` selects every module that lists `edge`. */
175
+ operationMode?: ("local" | "module" | "edge" | "cloud")[];
176
+ ```
177
+
178
+ ## Endpoints (`*.signal.ts`)
179
+
180
+ `endpoint(srv.<module>, ({ query, mutation, pubsub, message }) => ({ … }))`: each builder takes the return type and a `SignalOption`, then chains the stages below and ends in `.exec()`.
181
+
182
+ ### `endpoint` · `akanjs/signal`
183
+
184
+ ```ts
185
+ endpoint<SrvModule extends ServiceModel, Builder extends EndpointBuilder<SrvModule>, LibEndpoints extends readonly EndpointCls[]>(srv: SrvModule, builder: Builder, ...libEndpoints: LibEndpoints): EndpointCls<SrvModule, LibEndpoints extends readonly [] ? ReturnType<Builder> : Assign<MergeEndpointMetas<LibEndpoints, unknown>, ReturnType<Builder>>>
186
+ ```
187
+
188
+ ### `BuildEndpoint`
189
+
190
+ ```ts
191
+ query<Returns extends ConstantFieldTypeInput = ConstantFieldTypeInput, Nullable extends boolean = false>(returnRef: Returns, signalOption?: SignalOption<Returns, Nullable>)
192
+ mutation<Returns extends ConstantFieldTypeInput = ConstantFieldTypeInput, Nullable extends boolean = false>(returnRef: Returns, signalOption?: SignalOption<Returns, Nullable>)
193
+ pubsub<Returns extends ConstantFieldTypeInput = ConstantFieldTypeInput, Nullable extends boolean = false>(returnRef: Returns, signalOption?: SignalOption<Returns, Nullable>)
194
+ message<Returns extends ConstantFieldTypeInput = ConstantFieldTypeInput, Nullable extends boolean = false>(returnRef: Returns, signalOption?: SignalOption<Returns, Nullable>)
195
+ ```
196
+
197
+ ### `EndpointInfo`
198
+
199
+ ```ts
200
+ .param<ArgName extends string, Arg extends ParamFieldType>(name: string, arg: Arg, option?: Omit<EndpointArgProps, "nullable">)
201
+ .body<ArgName extends string, ExplicitType = unknown, Arg extends ConstantFieldTypeInput = PlainTypeToFieldType<ExplicitType>, Optional extends boolean = false>(name: ArgName, arg: Arg, option?: EndpointArgProps<Optional>)
202
+ .room<ArgName extends string, ExplicitType = unknown, Arg extends ConstantFieldTypeInput = PlainTypeToFieldType<ExplicitType>>(name: string, arg: Arg, option?: Omit<EndpointArgProps, "nullable">)
203
+ .msg<ArgName extends string, ExplicitType = unknown, Arg extends ConstantFieldTypeInput = PlainTypeToFieldType<ExplicitType>, Optional extends boolean = false>(name: string, arg: Arg, option?: EndpointArgProps<Optional>)
204
+ .search<ArgName extends string, ExplicitType = unknown, Arg extends ConstantFieldTypeInput = PlainTypeToFieldType<ExplicitType>>(name: string, arg: Arg, option?: Omit<EndpointArgProps, "nullable">)
205
+ .with<ArgType, Optional extends boolean = false>(argRef: InternalArgCls<ArgType>, option?: InternalArgProps<Optional>)
206
+ .exec<ExecFn extends (this: Srvs, ...args: [...ServerArgs, ...InternalArgs]) => ReqType extends "pubsub" ? Promise<void> | void : PromiseOrObject<DocumentModel<FieldToValue<Returns>> | (Nullable extends true ? null | undefined : never)>>(execFn: ExecFn)
207
+ ```
208
+
209
+ ### `EndpointArgProps`
210
+
211
+ ```ts
212
+ nullable?: Optional;
213
+ example?: string | number | boolean | Dayjs;
214
+ ```
215
+
216
+ ### `SignalOption`
217
+
218
+ ```ts
219
+ nullable?: Nullable;
220
+ name?: string;
221
+ default?: boolean;
222
+ path?: string;
223
+ serverMode?: "batch" | "federation" | "all";
224
+ /** Milliseconds; the server rejects with `base.error.gatewayTimeout` and the client sizes its request budget from it. */
225
+ timeout?: number;
226
+ partial?: _Key[] | readonly _Key[];
227
+ /** Milliseconds to reuse the answer, keyed by endpoint and arguments; unset caches nothing. */
228
+ cache?: number;
229
+ /** Calls per caller per window, refused with 429 `base.error.tooManyRequests`. */
230
+ rateLimit?: false | RateLimitBudget;
231
+ guards?: GuardCls[];
232
+ middlewares?: MiddlewareCls[];
233
+ prefix?: string | false;
234
+ globalPrefix?: false;
235
+ /** HTTP verb of a `mutation`, `POST` unless named; every other endpoint type ignores it. */
236
+ method?: HttpMutationMethod;
237
+ fileUpload?: boolean;
238
+ /** `false` keeps it out of the MCP catalogue (default `true`); curation, not authorization — HTTP still serves it. */
239
+ mcp?: boolean;
240
+ /** The errors this endpoint throws on purpose, by status. */
241
+ errors?: EndpointErrors;
242
+ /** A slow subscriber of a `pubsub(Binary)`: `"coalesce"` (default) keeps only the newest frame per room, `"queue"` delivers every frame and grows the send buffer with the slowest subscriber. */
243
+ backpressure?: "coalesce" | "queue";
244
+ enabled?: boolean;
245
+ operationMode?: ("local" | "edge" | "cloud" | (string & {}))[];
246
+ ```
247
+
248
+ ## Dictionaries (`*.dictionary.ts`)
249
+
250
+ ### `serviceDictionary` · `akanjs/dictionary`
251
+
252
+ ```ts
253
+ serviceDictionary<Languages extends [string, ...string[]] = [string]>(languages?: Languages): ServiceDictInfo<Languages, never, never, never>
254
+ ```
255
+
256
+ ### `FunctionTranslation`
257
+
258
+ ```ts
259
+ .desc(descTrans: Languages)
260
+ .arg<TransMap extends { [key: string]: FieldTranslation<Languages>; }>(translate: (t: (trans: Languages) => FieldTranslation<Languages>) => TransMap)
261
+ ```
262
+
263
+ ### `FieldTranslation`
264
+
265
+ ```ts
266
+ .desc(descTrans: Languages)
267
+ ```
268
+
269
+ ## App config (`akan.config.ts`)
270
+
271
+ ### `AppConfig` · `akanjs`
272
+
273
+ ```ts
274
+ type AppConfig = AppConfigInput | ((app: AppConfigContext) => AppConfigInput)
275
+ ```
276
+
277
+ ### `AppConfigInput` · `akanjs`
278
+
279
+ ```ts
280
+ database?: DeepPartial<AkanDatabaseConfig>;
281
+ /** Baked into every client bundle, since a prebuilt CSR shell or mobile bundle never asks the server; `new AkanApp({ prefix })` still overrides the server and every server-rendered page. */
282
+ api?: DeepPartial<AkanApiConfig>;
283
+ routes?: AkanRouteConfig[];
284
+ /** Mounts `libs/<lib>/page` under `page/(libs)/(<lib>)` on sync: `true` every lib dependency with a `page` folder, an array exactly those libs, `false` (the default) nothing, removing what a previous sync created. */
285
+ syncPageLibs?: boolean | string[];
286
+ externalLibs?: string[];
287
+ /** Dependencies whose install scripts `bun install --production` runs, in the image and in a desktop app's server. */
288
+ trustedDependencies?: string[];
289
+ barrelImports?: string[];
290
+ optimizeImports?: string[];
291
+ images?: DeepPartial<AkanImageConfig>;
292
+ i18n?: DeepPartial<AkanI18nConfig>;
293
+ publicEnv?: string[];
294
+ secrets?: string[];
295
+ assets?: DeepPartial<AkanAssetsConfig>;
296
+ docker?: DockerOption;
297
+ web?: AkanWebOption;
298
+ bin?: AkanBinConfig;
299
+ native?: AkanNativeAppConfig;
300
+ plugins?: AkanPlugin[];
301
+ pipeline?: AppPipelineConfig;
302
+ ```
303
+
304
+ ### `AkanWebOption` · `akanjs`
305
+
306
+ ```ts
307
+ type AkanWebOption = boolean | { csr: boolean; }
308
+ ```
309
+
310
+ ### `AkanI18nConfig`
311
+
312
+ ```ts
313
+ defaultLocale: string;
314
+ locales: string[];
315
+ /** `"always"` (absent means this) serves every page under `/<locale>/…` and redirects an unprefixed path by Accept-Language; `"as-needed"` serves the default locale's pages unprefixed, so a single-locale app has no prefix. */
316
+ localePrefix?: "always" | "as-needed";
317
+ ```
@@ -41,11 +41,11 @@ each plugin's header and diagnostic carry its full reasoning.
41
41
 
42
42
  ## Akan Sync Conventions
43
43
 
44
- - App root files: `AGENTS.md`, `CLAUDE.md`, `akan.app.json`, `akan.baseline.json`, `akan.config.ts`, `client.ts`,
45
- `main.ts`, `package.json`, `server.ts`, `tsconfig.json`, `tsconfig.tsbuildinfo`; folders: `.akan`, `common`, `env`,
46
- `lib`, `native`, `page`, `plugin`, `private`, `public`, `script`, `secrets`, `srvkit`, `ui`, `webkit`. A Capacitor-era
47
- `ios` / `android` / `mobile` folder or `capacitor.config.*` in an app root is refused as a leftover (native
48
- projects live under `dist/native/<app>/<target>`).
44
+ - App root files: `AGENTS.md`, `CLAUDE.md`, `akan.app.json`, `akan.baseline.json`, `akan.budget.json`,
45
+ `akan.config.ts`, `client.ts`, `main.ts`, `package.json`, `server.ts`, `tsconfig.json`, `tsconfig.tsbuildinfo`;
46
+ folders: `.akan`, `common`, `env`, `lib`, `native`, `page`, `plugin`, `private`, `public`, `script`, `secrets`,
47
+ `srvkit`, `ui`, `webkit`. A Capacitor-era `ios` / `android` / `mobile` folder or `capacitor.config.*` in an app root
48
+ is refused as a leftover (native projects live under `dist/native/<app>/<target>`).
49
49
  - Lib root files: `AGENTS.md`, `CLAUDE.md`, `README.md`, `akan.baseline.json`, `akan.config.ts`, `akan.lib.json`,
50
50
  `client.ts`, `index.ts`, `package.json`, `server.ts`, `tsconfig.json`, `tsconfig.spec.json`, `tsconfig.tsbuildinfo`;
51
51
  folders: the app's minus `.akan`, `script`, `secrets` (no `main.ts` either — a lib is never booted).
@@ -27,7 +27,7 @@ Declared in `akan.config.ts`, narrowed — never widened — by an env at boot;
27
27
  `NativeSecret` (the OS credential store), never in a file.
28
28
  - **`database: { modes: [...] }`** (`single`, `multiple`, `cluster`), chosen by `AKAN_DATABASE_MODE`; an app running
29
29
  in two modes avoids `q.raw`.
30
- - **`i18n: { localePrefix: "as-needed" }`** serves the default locale at unprefixed paths (`/pokemon/x`, and `<Link>`
30
+ - **`i18n: { localePrefix: "as-needed" }`** serves the default locale at unprefixed paths (`/books/x`, and `<Link>`
31
31
  renders them so) while other locales keep `/<locale>/…`. Use it, not a raw `<a>`, for a single-language app or URLs
32
32
  fixed from outside (OAuth callbacks, QR codes, mail links, a migrated site).
33
33
 
@@ -5,15 +5,19 @@ paths:
5
5
  - "{apps,libs}/**/*.{store,service,document}.ts"
6
6
  - "{apps,libs}/*/{ui,webkit}/**"
7
7
  - "{apps,libs}/*/akan.baseline.json"
8
+ - "pkgs/**/*.{ts,tsx}"
9
+ - "pkgs/**/akan.baseline.json"
8
10
  ---
9
11
 
10
12
  # Lint Gates
11
13
 
12
- - **Size, store reach, where writes start, and per-item calls fail `akan lint`** for an app or lib, each failure
13
- naming its rule and the `akan workflow plan …` path that fixes it:
14
+ - **Size, store reach, where writes start, and per-item calls fail `akan lint`** for an app or lib, and size for a
15
+ workspace package, each failure naming its rule and, for an app or lib, the `akan workflow plan …` path fixing it:
14
16
  - `akan.size.file`: a `Zone` / `Util` / `Template` / `Unit` / `View`, a `*.store.ts`, or a `ui/` / `webkit/` file
15
17
  over 400 lines; a service or document over 500; an abstract over 300. `akan.size.component`: a component or hook
16
18
  over 250. `akan.component.store-access`: a component or hook reaching `st` more than 16 times (form setters aside).
19
+ - A workspace package (`pkgs/<pkg>`): a file over 800 lines, a function over 150 (`akan.size.function`), a class
20
+ over 60 members (`akan.size.class`), tests and their fixtures aside, against the package's own `akan.baseline.json`.
17
21
  - `akan.write.placement`: a server write leaves the browser only through a store action, started by a module
18
22
  component — no `fetch.<mutation>` outside a `*.store.ts`, and no writing `st.do.*` in `ui/` or `webkit/`, which
19
23
  take the write as an `onX` prop or hook argument.
@@ -27,6 +31,7 @@ paths:
27
31
  filter query) or write it once (`create<Model>Many`). An `internal` job and a counted loop (a retry, paging) are
28
32
  spared.
29
33
  - `akan.baseline.json` (`akan.baseline.growth`) records, per rule, the debt adopted with the gate, and is compared
30
- with its copy at the fork point of the default branch, so it only ever shrinks: never add or raise an entry. A size,
31
- store-reach or per-item entry with a `reasons` line is an exception a person decided on, never an agent; the write
32
- rules take no exceptions.
34
+ with its copy at the fork point of the default branch, so it only ever shrinks: never add or raise an entry. With no
35
+ copy there, it may hold only the breaches the fork point's code already had, so a new app, lib or package starts
36
+ with none. A size, store-reach or per-item entry with a `reasons` line is an exception a person decided on, never
37
+ an agent; the write rules take no exceptions.
@@ -16,9 +16,11 @@ Full contract — guards, apps, heads, CSR root layouts, typed params, lib pages
16
16
  `.notFound` / `.error` on layouts; `.fonts` / `.theme` / `.manifest` / … on the root; `.prompt` / `.app` on a page).
17
17
  A named export beside it fails the build.
18
18
  - **Name every `[x]` segment with `.param("x", Type)`** and read query keys only via `.search("k", Type)`; values
19
- arrive typed. `lang` is never declared — every stage receives it.
19
+ arrive typed. `lang` is never declared — every stage receives it. A client filter writes its key back with
20
+ `router.replace(href, { shallow: true })`, which keeps the page on screen.
20
21
  - `.head()` takes JSX or a function returning it — never a metadata object; deeper heads replace by tag identity,
21
- and a canonical link / `og:url` comes only from the page's own `.head()`.
22
+ and a canonical link / `og:url` comes only from the page's own `.head()`. A 404's title is the `<title>` a layout's
23
+ `.notFound()` returns at its top: `.notFound(() => <><title>Not found</title>…</>)`, except below a `.loading()`.
22
24
  - In a CSR bundle a root layout's own markup is hidden: what a person must see from it renders through
23
25
  `createPortal(…, document.body)`.
24
26
  - `_overrides.tsx` is one `export default override({ Slot: AppComponent })` (`akanjs/ui`), no logic, no
@@ -84,6 +84,8 @@ paths:
84
84
  option, with keys its dictionary defines and never `base.error.*`. That is the status's OpenAPI response and a line
85
85
  of the MCP tool's description; outside production a thrown key it leaves out warns once. A caller narrows with
86
86
  `Err.is(error, "ticket.error.locked")`.
87
+ - An `srvkit/` adapter belongs to no module: its keys go in the app's or lib's own service dictionary,
88
+ `lib/_<name>/<name>.dictionary.ts`, thrown as `new Err("<name>.error.<key>")` with `Err` from `"../lib/dict"`.
87
89
  - `try/catch` turns an exception into a decision: guards → `logger.warn` → `false`; adapters → `logger.error` →
88
90
  `null`; UI `try/finally` resets a spinner. A bodyless `catch {}` needs a one-line reason.
89
91
  - Store actions do not `try/catch` (the framework toasts the `Err`); one no screen waits on (a token refresh) is
@@ -14,7 +14,9 @@ paths:
14
14
  `no-daisyui-legacy-class`, `no-inline-color`): no raw palette (`bg-blue-500`), arbitrary or interpolated color classes
15
15
  (`bg-[#3b82f6]`), daisyUI classes or slots (`btn-primary`, `bg-base-100`), or color literals in `style={{}}` — they
16
16
  render no CSS. Use semantic tokens (`bg-primary`, `text-foreground/70`); a legitimate fixed color takes
17
- `// biome-ignore lint/plugin: <reason>`. Slot replacements, SVG / `el.style` warnings, legal values: `cssRule`.
17
+ `// biome-ignore lint/plugin: <reason>`. A daisyUI component name (`stat-value`) is only a warning, which
18
+ `akan verify` drops once the app's or a lib's CSS defines that class. Slot replacements, SVG / `el.style` warnings,
19
+ legal values: `cssRule`.
18
20
 
19
21
  - Static class strings stay plain. `cn` (from `akanjs/client`) only for a conditional or to merge an incoming
20
22
  `className`, caller last: `cn("base", cond && "extra", className)` — the only combiner: no `clsx`, raw `twMerge`,
@@ -43,7 +43,8 @@ paths:
43
43
 
44
44
  - **`#private` is banned in exactly `*.constant.ts`, `*.document.ts`, `*.service.ts`, `*.store.ts`**
45
45
  (`no-js-private-class-method`, by path, so it stays the house style everywhere else, `srvkit/` and `adapt()` classes
46
- included).
46
+ included). A `#method` there becomes `private method()`, never `_method` (a service runs `_preCreate`-style names as
47
+ hooks); `akan verify` renames it and its calls unless the class already has that name.
47
48
 
48
49
  ## TypeScript And Imports
49
50
 
@@ -14,10 +14,12 @@ Use TailwindCSS with Akan's semantic design-token layer and the `akanjs/ui` prim
14
14
  ## Color Vocabulary — What Lint Refuses
15
15
  - Vocabulary closure strips the raw Tailwind palette, so these render as no CSS and fail lint: raw palette classes
16
16
  (`bg-blue-500`, `text-gray-400`), arbitrary color values (`bg-[#3b82f6]`), an arbitrary class built by
17
- interpolation, daisyUI legacy classes (`btn-primary`, `card-body`) and its dropped color slots (`bg-base-100`,
17
+ interpolation, daisyUI's dropped color slots (`bg-base-100`,
18
18
  `text-base-content`, `text-primary-content`, `bg-error` — use `background`/`muted`/`border`, `foreground`,
19
19
  `<color>-foreground`, `destructive`), and color literals in `style={{...}}` (`no-raw-palette-class`,
20
20
  `no-arbitrary-color`, `no-daisyui-legacy-class`, `no-inline-color`, `no-interpolated-arbitrary-class`).
21
+ - daisyUI component classes (`btn-primary`, `card-body`) render no CSS unless the app defines them, so lint only warns;
22
+ `akan verify` drops the warning once the app's or a lib's stylesheet defines the class.
21
23
  - A legitimate fixed color (OS-chrome mockups, data-viz) takes a `// biome-ignore lint/plugin: <reason>`.
22
24
  - Color literals in SVG color attributes (`fill`, `stroke`, `stopColor`, `floodColor`, `lightingColor`, `color`) and
23
25
  in `el.style.<prop> = …` / `el.style.setProperty(…)` writes are flagged as warnings for now; `currentColor`,
@@ -114,6 +114,9 @@ body shape — this is the full contract behind them. Before changing route beha
114
114
  `property`, and a canonical / manifest / icon link, and keeps the rest — so a page states only what it changes.
115
115
  - A canonical link and `og:url` each name one URL, so a page carries them only from its own `.head()`, never from a
116
116
  layout's.
117
+ - **A not-found or error view titles itself**: the `<title>` and `<meta>` at the top of what a layout's `.notFound()`
118
+ / `.error()` returns replace the layouts' head, and the page's own head is dropped. Under a `.loading()` the head is
119
+ already out, so they stay in the view.
117
120
 
118
121
  ## A Root Layout Inside A CSR Bundle
119
122