@akanjs/cli 3.1.2-rc.4 → 3.2.0-rc.1

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 (120) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-z34p8m91.js → CodeAgent-vmd9k4ak.js} +3 -3
  3. package/{CodeTui-nvd9fk3g.js → CodeTui-zka44v52.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-962mp3kg.js → agent.command-2f657613.js} +19 -17
  8. package/akanCode.js +6 -6
  9. package/{application.command-1nr0bqq1.js → application.command-q6skd3am.js} +36 -22
  10. package/{applicationBuildRunner-xy7hnfzq.js → applicationBuildRunner-sctcmkyx.js} +55 -16
  11. package/buildBatch.proc.js +7 -7
  12. package/{cloud.command-cj7b3m6y.js → cloud.command-7642pks6.js} +36 -19
  13. package/cloud.script-1sfseznn.js +30 -0
  14. package/{code.command-asq7xrr6.js → code.command-7s4ndq2k.js} +6 -6
  15. package/commandManifest.json +1 -1
  16. package/{context.command-fw4g2pw1.js → context.command-569z0rqf.js} +20 -19
  17. package/context.runner-ms8v1rxy.js +29 -0
  18. package/{devTui-evr3b35y.js → devTui-w38ch13a.js} +1 -1
  19. package/{guideline.command-43gfjsjv.js → guideline.command-gnv3e8p8.js} +2 -2
  20. package/guidelines/akanApi/akanApi.instruction.md +317 -0
  21. package/guidelines/conventions/rules/app.md +5 -5
  22. package/guidelines/conventions/rules/config.md +1 -1
  23. package/guidelines/conventions/rules/gates.md +10 -5
  24. package/incrementalBuilder.proc.js +69 -39
  25. package/{index-0tkj05cz.js → index-0fb3cpbt.js} +3 -3
  26. package/{index-6t7fkx73.js → index-1q1cjn8s.js} +21 -11
  27. package/{index-tenw3mah.js → index-23860fej.js} +16 -6
  28. package/{index-6zgt7zmx.js → index-48d5qsj3.js} +4 -4
  29. package/{index-z47rw9ez.js → index-5w9my9qe.js} +8 -8
  30. package/{index-qwe079ww.js → index-6wpaq392.js} +61 -15
  31. package/{index-kc871vpc.js → index-7xdpww43.js} +69 -12
  32. package/index-7y5yghjg.js +2969 -0
  33. package/{index-38patcx6.js → index-8g7tdsk4.js} +249 -696
  34. package/{index-90q0w90q.js → index-8kczhnmv.js} +1 -1
  35. package/{index-kdswbvys.js → index-8pb9yvp8.js} +63 -21
  36. package/{index-hmj94es2.js → index-8ts9774g.js} +4 -4
  37. package/{index-r0q2ka2b.js → index-93ewzmp6.js} +43 -14
  38. package/{index-y0y0pnx8.js → index-9tbgb4d8.js} +1 -1
  39. package/{index-jzpeny42.js → index-a8a9ede9.js} +7 -7
  40. package/index-abgh0jve.js +126 -0
  41. package/{index-t0hk1kxq.js → index-aj3ehkcx.js} +1 -1
  42. package/{index-demt944k.js → index-d4n1wmrz.js} +37 -4
  43. package/{index-sra1a5f8.js → index-drz9e84d.js} +22 -8
  44. package/{index-gfh90r3t.js → index-e3vmjtph.js} +2 -2
  45. package/{index-k64mhwbw.js → index-eajbmk10.js} +2 -1
  46. package/{index-g0yds382.js → index-ed6ea0qp.js} +1 -1
  47. package/{index-ap6ac70m.js → index-fjr4d6yd.js} +444 -368
  48. package/index-hqrkqxx2.js +176 -0
  49. package/{index-ampz4vgv.js → index-kpdv34rq.js} +4 -4
  50. package/{index-kc6ffq0s.js → index-ktb3wcqz.js} +73 -34
  51. package/{index-dcm66hss.js → index-mmym5xmb.js} +4 -2
  52. package/{index-8d9r465x.js → index-mqntfzv5.js} +2 -2
  53. package/{index-4am4dvmf.js → index-ny2k80mv.js} +15 -3
  54. package/index-p6hjwt2d.js +1668 -0
  55. package/{index-53h0053j.js → index-rc5fvqj2.js} +12 -14
  56. package/{index-jzz6ye8x.js → index-s2grpzef.js} +40 -8
  57. package/{index-38by07nw.js → index-sr5da35e.js} +32 -9
  58. package/{index-qev8p5wp.js → index-sy481q2x.js} +1 -1
  59. package/{index-ck64kxrn.js → index-thckcabc.js} +2 -2
  60. package/{index-2yan1ajk.js → index-v4p1zye8.js} +18 -9
  61. package/{index-wymcdsas.js → index-vkzfk7qt.js} +25 -23
  62. package/{index-r8t5sq7z.js → index-vr68mxj5.js} +68 -21
  63. package/{index-vkpqe29t.js → index-w639tvkd.js} +24 -125
  64. package/index-ygdbn9jn.js +122 -0
  65. package/{index-w60zxxye.js → index-zpv14wpy.js} +3 -3
  66. package/index.js +24 -23
  67. package/{library.command-zh29tjdd.js → library.command-1gp5qe3r.js} +3 -3
  68. package/{localRegistry.command-k9pn9ahj.js → localRegistry.command-x7jptkd3.js} +26 -17
  69. package/{module.command-dgpqs9fz.js → module.command-4xz9he6h.js} +6 -6
  70. package/{package.command-1je4hsca.js → package.command-s7qpnn1g.js} +12 -3
  71. package/package.json +2 -2
  72. package/{page.command-cgsasanh.js → page.command-fan34c49.js} +3 -3
  73. package/{pipeline.command-tb46sa8v.js → pipeline.command-ph4fnn9w.js} +2 -2
  74. package/{primitive.command-bzsy23x5.js → primitive.command-3fqh8emf.js} +7 -7
  75. package/{projectTypecheck-h8rgaczy.js → projectTypecheck-vkb40hjc.js} +1 -1
  76. package/{quality.command-120m9h6v.js → quality.command-ecj6exsh.js} +15 -10
  77. package/{repair.command-6m4wd0qv.js → repair.command-fe9jw719.js} +6 -6
  78. package/{scalar.command-3dn5hsc6.js → scalar.command-cnvfhk0n.js} +5 -5
  79. package/skills/akan-debug/SKILL.md +2 -1
  80. package/skills/akan-page/SKILL.md +16 -7
  81. package/skills/akan-service/SKILL.md +48 -19
  82. package/{subspace.command-s8nyfqbn.js → subspace.command-qw5ddd6y.js} +8 -8
  83. package/templates/app/lib/___appName__/__appName__.abstract.md.template +6 -0
  84. package/templates/app/page/_index.tsx +4 -284
  85. package/templates/app/page/_layout.tsx +1 -26
  86. package/templates/app/page/styles.css.template +58 -318
  87. package/templates/appSample/page/_index.tsx +281 -0
  88. package/templates/appSample/page/_layout.tsx +55 -0
  89. package/templates/appSample/page/styles.css.template +327 -0
  90. package/templates/libRoot/lib/___libName__/__libName__.abstract.md.template +6 -0
  91. package/templates/workspaceRoot/package.json.template +1 -12
  92. package/{tunnel.command-8mwrqkr3.js → tunnel.command-ggj38mqf.js} +7 -7
  93. package/{verify.command-2pspfy7k.js → verify.command-w9ttxkdz.js} +16 -14
  94. package/{workflow.command-7sy5vnsj.js → workflow.command-ss8devj0.js} +12 -12
  95. package/{workspace.command-x518tdv4.js → workspace.command-6z2rh8ze.js} +51 -39
  96. package/TunnelShare-jwbb50kz.js +0 -14
  97. package/cloud.script-8kr7qgfa.js +0 -27
  98. package/context.runner-p6m5cxk3.js +0 -28
  99. package/index-d894868w.js +0 -842
  100. package/index-re2kfscb.js +0 -1363
  101. /package/templates/{app → appSample}/page/_overrides.tsx +0 -0
  102. /package/templates/{app → appSample}/public/fonts/Pretendard-Black.woff2 +0 -0
  103. /package/templates/{app → appSample}/public/fonts/Pretendard-Bold.woff2 +0 -0
  104. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraBold.woff2 +0 -0
  105. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraLight.woff2 +0 -0
  106. /package/templates/{app → appSample}/public/fonts/Pretendard-Light.woff2 +0 -0
  107. /package/templates/{app → appSample}/public/fonts/Pretendard-Medium.woff2 +0 -0
  108. /package/templates/{app → appSample}/public/fonts/Pretendard-Regular.woff2 +0 -0
  109. /package/templates/{app → appSample}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
  110. /package/templates/{app → appSample}/public/fonts/Pretendard-Thin.woff2 +0 -0
  111. /package/templates/{app → appSample}/public/jelly/cloud.webp +0 -0
  112. /package/templates/{app → appSample}/public/jelly/comet.webp +0 -0
  113. /package/templates/{app → appSample}/public/jelly/moon.webp +0 -0
  114. /package/templates/{app → appSample}/public/jelly/planet.webp +0 -0
  115. /package/templates/{app → appSample}/public/jelly/rocket.webp +0 -0
  116. /package/templates/{app → appSample}/public/jelly/star.webp +0 -0
  117. /package/templates/{app → appSample}/public/jelly/sugar.webp +0 -0
  118. /package/templates/{app → appSample}/public/logo.png +0 -0
  119. /package/templates/{app → appSample}/ui/Recipe/index.ts +0 -0
  120. /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-r0q2ka2b.js";
5
+ } from "./index-93ewzmp6.js";
6
6
  import"./index-bns3wcpc.js";
7
- import"./index-38by07nw.js";
7
+ import"./index-sr5da35e.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-kdswbvys.js";
10
- import"./index-re2kfscb.js";
11
- import"./index-ck64kxrn.js";
12
- import"./index-53h0053j.js";
13
- import"./index-w60zxxye.js";
14
- import"./index-g0yds382.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-6t7fkx73.js";
17
- import"./index-dcm66hss.js";
16
+ import"./index-1q1cjn8s.js";
17
+ import"./index-mmym5xmb.js";
18
18
  import"./index-j6eeh5d7.js";
19
- import"./index-vkpqe29t.js";
20
- import"./index-0tkj05cz.js";
21
- import"./index-t0hk1kxq.js";
22
- import"./index-hmj94es2.js";
23
- import"./index-6zgt7zmx.js";
24
- import"./index-gfh90r3t.js";
25
- import"./index-k64mhwbw.js";
26
- import"./index-wymcdsas.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-ampz4vgv.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
+ };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  stripAnsi
4
- } from "./index-tenw3mah.js";
4
+ } from "./index-23860fej.js";
5
5
  import {
6
6
  writeClipboard
7
7
  } from "./index-p6pbz9n5.js";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  script,
4
4
  command
5
- } from "./index-r0q2ka2b.js";
5
+ } from "./index-93ewzmp6.js";
6
6
  import"./index-bns3wcpc.js";
7
- import"./index-38by07nw.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.