@akanjs/cli 3.1.2-rc.4 → 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 (118) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-z34p8m91.js → CodeAgent-h6g8dg3a.js} +2 -2
  3. package/{CodeTui-nvd9fk3g.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-962mp3kg.js → agent.command-2f657613.js} +19 -17
  8. package/akanCode.js +2 -2
  9. package/{application.command-1nr0bqq1.js → application.command-yb8v177e.js} +35 -21
  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-et06ja22.js} +35 -18
  13. package/cloud.script-s6rbrwer.js +30 -0
  14. package/{code.command-asq7xrr6.js → code.command-7m67c7zc.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/{guideline.command-43gfjsjv.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/incrementalBuilder.proc.js +69 -39
  24. package/{index-0tkj05cz.js → index-0fb3cpbt.js} +3 -3
  25. package/{index-6t7fkx73.js → index-1q1cjn8s.js} +21 -11
  26. package/{index-90q0w90q.js → index-3wjbhj2n.js} +1 -1
  27. package/{index-6zgt7zmx.js → index-48d5qsj3.js} +4 -4
  28. package/{index-z47rw9ez.js → index-5w9my9qe.js} +8 -8
  29. package/{index-qwe079ww.js → index-6wpaq392.js} +61 -15
  30. package/{index-kc871vpc.js → index-7xdpww43.js} +69 -12
  31. package/index-7y5yghjg.js +2969 -0
  32. package/{index-38patcx6.js → index-8g7tdsk4.js} +249 -696
  33. package/{index-kdswbvys.js → index-8pb9yvp8.js} +63 -21
  34. package/{index-hmj94es2.js → index-8ts9774g.js} +4 -4
  35. package/{index-r0q2ka2b.js → index-93ewzmp6.js} +43 -14
  36. package/{index-y0y0pnx8.js → index-9tbgb4d8.js} +1 -1
  37. package/index-abgh0jve.js +126 -0
  38. package/{index-t0hk1kxq.js → index-aj3ehkcx.js} +1 -1
  39. package/{index-demt944k.js → index-d4n1wmrz.js} +37 -4
  40. package/{index-sra1a5f8.js → index-drz9e84d.js} +22 -8
  41. package/{index-gfh90r3t.js → index-e3vmjtph.js} +2 -2
  42. package/{index-k64mhwbw.js → index-eajbmk10.js} +2 -1
  43. package/{index-g0yds382.js → index-ed6ea0qp.js} +1 -1
  44. package/{index-ap6ac70m.js → index-fjr4d6yd.js} +444 -368
  45. package/index-hqrkqxx2.js +176 -0
  46. package/{index-jzpeny42.js → index-jdamtr7e.js} +3 -3
  47. package/{index-ampz4vgv.js → index-kpdv34rq.js} +4 -4
  48. package/{index-kc6ffq0s.js → index-ktb3wcqz.js} +73 -34
  49. package/{index-dcm66hss.js → index-mmym5xmb.js} +4 -2
  50. package/{index-8d9r465x.js → index-mqntfzv5.js} +2 -2
  51. package/{index-4am4dvmf.js → index-ny2k80mv.js} +15 -3
  52. package/index-p6hjwt2d.js +1668 -0
  53. package/{index-53h0053j.js → index-rc5fvqj2.js} +12 -14
  54. package/{index-r8t5sq7z.js → index-ryrm5z2c.js} +66 -19
  55. package/{index-jzz6ye8x.js → index-s2grpzef.js} +40 -8
  56. package/{index-38by07nw.js → index-sr5da35e.js} +32 -9
  57. package/{index-qev8p5wp.js → index-sy481q2x.js} +1 -1
  58. package/{index-ck64kxrn.js → index-thckcabc.js} +2 -2
  59. package/{index-wymcdsas.js → index-vkzfk7qt.js} +25 -23
  60. package/{index-vkpqe29t.js → index-w639tvkd.js} +24 -125
  61. package/index-ygdbn9jn.js +122 -0
  62. package/{index-w60zxxye.js → index-zpv14wpy.js} +3 -3
  63. package/{index-2yan1ajk.js → index-zxsygkda.js} +18 -9
  64. package/index.js +24 -23
  65. package/{library.command-zh29tjdd.js → library.command-1gp5qe3r.js} +3 -3
  66. package/{localRegistry.command-k9pn9ahj.js → localRegistry.command-v3g21rex.js} +25 -16
  67. package/{module.command-dgpqs9fz.js → module.command-4xz9he6h.js} +6 -6
  68. package/{package.command-1je4hsca.js → package.command-s7qpnn1g.js} +12 -3
  69. package/package.json +2 -2
  70. package/{page.command-cgsasanh.js → page.command-fan34c49.js} +3 -3
  71. package/{pipeline.command-tb46sa8v.js → pipeline.command-ph4fnn9w.js} +2 -2
  72. package/{primitive.command-bzsy23x5.js → primitive.command-3fqh8emf.js} +7 -7
  73. package/{projectTypecheck-h8rgaczy.js → projectTypecheck-vkb40hjc.js} +1 -1
  74. package/{quality.command-120m9h6v.js → quality.command-ecj6exsh.js} +15 -10
  75. package/{repair.command-6m4wd0qv.js → repair.command-fe9jw719.js} +6 -6
  76. package/{scalar.command-3dn5hsc6.js → scalar.command-cnvfhk0n.js} +5 -5
  77. package/skills/akan-debug/SKILL.md +2 -1
  78. package/skills/akan-page/SKILL.md +16 -7
  79. package/skills/akan-service/SKILL.md +48 -19
  80. package/{subspace.command-s8nyfqbn.js → subspace.command-yxtt3v3e.js} +8 -8
  81. package/templates/app/lib/___appName__/__appName__.abstract.md.template +6 -0
  82. package/templates/app/page/_index.tsx +4 -284
  83. package/templates/app/page/_layout.tsx +1 -26
  84. package/templates/app/page/styles.css.template +58 -318
  85. package/templates/appSample/page/_index.tsx +281 -0
  86. package/templates/appSample/page/_layout.tsx +55 -0
  87. package/templates/appSample/page/styles.css.template +327 -0
  88. package/templates/libRoot/lib/___libName__/__libName__.abstract.md.template +6 -0
  89. package/templates/workspaceRoot/package.json.template +1 -12
  90. package/{tunnel.command-8mwrqkr3.js → tunnel.command-ggj38mqf.js} +7 -7
  91. package/{verify.command-2pspfy7k.js → verify.command-w9ttxkdz.js} +16 -14
  92. package/{workflow.command-7sy5vnsj.js → workflow.command-ss8devj0.js} +12 -12
  93. package/{workspace.command-x518tdv4.js → workspace.command-rw1p0xeq.js} +50 -38
  94. package/TunnelShare-jwbb50kz.js +0 -14
  95. package/cloud.script-8kr7qgfa.js +0 -27
  96. package/context.runner-p6m5cxk3.js +0 -28
  97. package/index-d894868w.js +0 -842
  98. package/index-re2kfscb.js +0 -1363
  99. /package/templates/{app → appSample}/page/_overrides.tsx +0 -0
  100. /package/templates/{app → appSample}/public/fonts/Pretendard-Black.woff2 +0 -0
  101. /package/templates/{app → appSample}/public/fonts/Pretendard-Bold.woff2 +0 -0
  102. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraBold.woff2 +0 -0
  103. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraLight.woff2 +0 -0
  104. /package/templates/{app → appSample}/public/fonts/Pretendard-Light.woff2 +0 -0
  105. /package/templates/{app → appSample}/public/fonts/Pretendard-Medium.woff2 +0 -0
  106. /package/templates/{app → appSample}/public/fonts/Pretendard-Regular.woff2 +0 -0
  107. /package/templates/{app → appSample}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
  108. /package/templates/{app → appSample}/public/fonts/Pretendard-Thin.woff2 +0 -0
  109. /package/templates/{app → appSample}/public/jelly/cloud.webp +0 -0
  110. /package/templates/{app → appSample}/public/jelly/comet.webp +0 -0
  111. /package/templates/{app → appSample}/public/jelly/moon.webp +0 -0
  112. /package/templates/{app → appSample}/public/jelly/planet.webp +0 -0
  113. /package/templates/{app → appSample}/public/jelly/rocket.webp +0 -0
  114. /package/templates/{app → appSample}/public/jelly/star.webp +0 -0
  115. /package/templates/{app → appSample}/public/jelly/sugar.webp +0 -0
  116. /package/templates/{app → appSample}/public/logo.png +0 -0
  117. /package/templates/{app → appSample}/ui/Recipe/index.ts +0 -0
  118. /package/templates/{app → appSample}/ui/Recipe/jellyButton.ts +0 -0
@@ -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
+ };
@@ -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.
@@ -3,12 +3,12 @@ import {
3
3
  HmrWatcher,
4
4
  WatchRootResolver,
5
5
  ApplicationBuildReporter
6
- } from "./index-d894868w.js";
6
+ } from "./index-p6hjwt2d.js";
7
7
  import {
8
8
  CodegenLock,
9
9
  WorkspaceExecutor,
10
10
  AppExecutor
11
- } from "./index-38by07nw.js";
11
+ } from "./index-sr5da35e.js";
12
12
  import"./index-bns3wcpc.js";
13
13
  import {
14
14
  GraphClientEntryDiscovery,
@@ -19,15 +19,20 @@ import {
19
19
  DevChangePlanner,
20
20
  DevGeneratedIndexSync,
21
21
  SsrDevBundler
22
- } from "./index-kc871vpc.js";
22
+ } from "./index-7xdpww43.js";
23
23
  import {
24
24
  ServerGraphFile
25
- } from "./index-6t7fkx73.js";
25
+ } from "./index-1q1cjn8s.js";
26
+ import"./index-7y5yghjg.js";
27
+ import {
28
+ FrameworkGraph
29
+ } from "./index-abgh0jve.js";
30
+ import {
31
+ GitRevision
32
+ } from "./index-ygdbn9jn.js";
26
33
  import {
27
- GitRevision,
28
34
  WorkspaceGraph
29
- } from "./index-vkpqe29t.js";
30
- import"./index-re2kfscb.js";
35
+ } from "./index-w639tvkd.js";
31
36
  import {
32
37
  prepareDevWatchBatch
33
38
  } from "./index-a5vmm6x4.js";
@@ -144,6 +149,59 @@ class BuilderChannel {
144
149
  }
145
150
  }
146
151
 
152
+ // pkgs/@akanjs/devkit/incrementalBuilder/builderGraphPayloads.ts
153
+ class BuilderGraphPayloads {
154
+ #app;
155
+ #generation;
156
+ #graph = null;
157
+ #changes = null;
158
+ constructor(app, generation) {
159
+ this.#app = app;
160
+ this.#generation = generation;
161
+ }
162
+ touched(files) {
163
+ FrameworkGraph.touched(this.#app.workspace.workspaceRoot, files);
164
+ }
165
+ async of(msg) {
166
+ if (msg.framework)
167
+ return await this.#framework();
168
+ return msg.changes ? await this.#changesSince(msg.changes.since) : await this.#workspaceGraph();
169
+ }
170
+ async#workspaceGraph() {
171
+ const generation = this.#generation();
172
+ if (this.#graph?.generation !== generation) {
173
+ const { workspace } = this.#app;
174
+ const graph = WorkspaceGraph.visibleTo(await WorkspaceGraph.build(workspace), this.#app.name);
175
+ this.#graph = { generation, payload: { workspaceRoot: workspace.workspaceRoot, graph } };
176
+ }
177
+ return this.#graph.payload;
178
+ }
179
+ async#framework() {
180
+ const { workspaceRoot } = this.#app.workspace;
181
+ return { workspaceRoot, framework: await FrameworkGraph.cached(workspaceRoot) };
182
+ }
183
+ async#changesSince(since) {
184
+ const { workspace, name } = this.#app;
185
+ const { workspaceRoot } = workspace;
186
+ const forkPoint = await new GitRevision(workspaceRoot).forkPointOf(since);
187
+ if (forkPoint.error !== undefined)
188
+ return { workspaceRoot, changes: { error: forkPoint.error } };
189
+ const key = `${this.#generation()}:${forkPoint.sha}`;
190
+ if (this.#changes?.key !== key) {
191
+ const payload = WorkspaceGraph.changesAt(workspace, forkPoint.sha).then((changes) => ({
192
+ workspaceRoot,
193
+ changes: WorkspaceGraph.changesVisibleTo(changes, name)
194
+ }));
195
+ payload.catch(() => {
196
+ if (this.#changes?.payload === payload)
197
+ this.#changes = null;
198
+ });
199
+ this.#changes = { key, payload };
200
+ }
201
+ return await this.#changes.payload;
202
+ }
203
+ }
204
+
147
205
  // pkgs/@akanjs/devkit/incrementalBuilder/builderWorkQueue.ts
148
206
  class BuilderWorkQueue {
149
207
  #runBatch;
@@ -243,8 +301,7 @@ class IncrementalBuilder {
243
301
  #watcher = null;
244
302
  #generation = 0;
245
303
  #shellKey = null;
246
- #graph = null;
247
- #changes = null;
304
+ #graphPayloads;
248
305
  #discoveredThrough = 0;
249
306
  #csrActive = IncrementalBuilder.#csrArmedByEnv();
250
307
  #csrBundler;
@@ -282,6 +339,7 @@ class IncrementalBuilder {
282
339
  this.#discovery = options.discovery;
283
340
  this.#generation = options.initialGeneration ?? 0;
284
341
  this.#discoveredThrough = this.#generation;
342
+ this.#graphPayloads = new BuilderGraphPayloads(options.app, () => this.#generation);
285
343
  this.#batchRunner = new BuildBatchRunner({
286
344
  workspaceRoot: options.app.workspace.workspaceRoot,
287
345
  cwd: options.app.cwdPath
@@ -515,6 +573,7 @@ class IncrementalBuilder {
515
573
  this.#logger.verbose(`watching ${roots.length} roots`);
516
574
  }
517
575
  async#handleWatchBatch(batch) {
576
+ this.#graphPayloads.touched(batch.files);
518
577
  const rawKinds = new Set(batch.kinds);
519
578
  if (rawKinds.size === 0)
520
579
  return;
@@ -927,7 +986,7 @@ class IncrementalBuilder {
927
986
  }
928
987
  async handleBuildGraph(msg) {
929
988
  try {
930
- const data = msg.changes ? await this.#changesPayload(msg.changes.since) : await this.#graphPayload();
989
+ const data = await this.#graphPayloads.of(msg);
931
990
  await BuilderChannel.send({ type: "build-graph-res", id: msg.id, ok: true, data });
932
991
  } catch (err) {
933
992
  const error = ApplicationBuildReporter.formatError(err, this.#app.workspace.workspaceRoot);
@@ -935,35 +994,6 @@ class IncrementalBuilder {
935
994
  await BuilderChannel.send({ type: "build-graph-res", id: msg.id, ok: false, error });
936
995
  }
937
996
  }
938
- async#graphPayload() {
939
- const generation = this.#generation;
940
- if (this.#graph?.generation !== generation) {
941
- const { workspace } = this.#app;
942
- const graph = WorkspaceGraph.visibleTo(await WorkspaceGraph.build(workspace), this.#app.name);
943
- this.#graph = { generation, payload: { workspaceRoot: workspace.workspaceRoot, graph } };
944
- }
945
- return this.#graph.payload;
946
- }
947
- async#changesPayload(since) {
948
- const { workspace, name } = this.#app;
949
- const { workspaceRoot } = workspace;
950
- const forkPoint = await new GitRevision(workspaceRoot).forkPointOf(since);
951
- if (forkPoint.error !== undefined)
952
- return { workspaceRoot, changes: { error: forkPoint.error } };
953
- const key = `${this.#generation}:${forkPoint.sha}`;
954
- if (this.#changes?.key !== key) {
955
- const payload = WorkspaceGraph.changesAt(workspace, forkPoint.sha).then((changes) => ({
956
- workspaceRoot,
957
- changes: WorkspaceGraph.changesVisibleTo(changes, name)
958
- }));
959
- payload.catch(() => {
960
- if (this.#changes?.payload === payload)
961
- this.#changes = null;
962
- });
963
- this.#changes = { key, payload };
964
- }
965
- return await this.#changes.payload;
966
- }
967
997
  async handleBuildCsr(msg) {
968
998
  if (msg.shell) {
969
999
  await this.#buildShell(msg);
@@ -7,13 +7,13 @@ import {
7
7
  isWorkflowSysName,
8
8
  isWorkflowModuleName,
9
9
  renderRepairReport
10
- } from "./index-kdswbvys.js";
10
+ } from "./index-8pb9yvp8.js";
11
11
  import {
12
12
  AkanContextAnalyzer
13
- } from "./index-ck64kxrn.js";
13
+ } from "./index-thckcabc.js";
14
14
  import {
15
15
  runner
16
- } from "./index-r0q2ka2b.js";
16
+ } from "./index-93ewzmp6.js";
17
17
 
18
18
  // pkgs/@akanjs/cli/repair/repair.runner.ts
19
19
  var akanArgPattern = /^(?:--?[a-z][a-zA-Z0-9-]*|[A-Za-z0-9@_][A-Za-z0-9@._/:,=-]*)$/;