@akanjs/cli 3.1.2-rc.3 → 3.1.2-rc.4

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 (86) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-n2tkg59z.js → CodeAgent-z34p8m91.js} +2 -2
  3. package/{CodeTui-9wsdx7ap.js → CodeTui-nvd9fk3g.js} +1 -1
  4. package/TunnelShare-jwbb50kz.js +14 -0
  5. package/{agent.command-tffz6wdn.js → agent.command-962mp3kg.js} +15 -15
  6. package/akanCode.js +2 -2
  7. package/{application.command-7bkxbrsp.js → application.command-1nr0bqq1.js} +24 -15
  8. package/{applicationBuildRunner-s13x3zqb.js → applicationBuildRunner-xy7hnfzq.js} +7 -6
  9. package/buildBatch.proc.js +6 -6
  10. package/{cloud.command-a792bc10.js → cloud.command-cj7b3m6y.js} +15 -15
  11. package/cloud.script-8kr7qgfa.js +27 -0
  12. package/{code.command-ma8dtzww.js → code.command-asq7xrr6.js} +6 -6
  13. package/{context.command-80a1qhps.js → context.command-fw4g2pw1.js} +18 -18
  14. package/context.runner-p6m5cxk3.js +28 -0
  15. package/{guideline.command-195g0h9a.js → guideline.command-43gfjsjv.js} +2 -2
  16. package/guidelines/conventions/rules/page.md +4 -2
  17. package/guidelines/conventions/rules/server.md +2 -0
  18. package/guidelines/conventions/rules/style.md +3 -1
  19. package/guidelines/conventions/rules/ts.md +2 -1
  20. package/guidelines/cssRule/cssRule.instruction.md +3 -1
  21. package/guidelines/pageRule/pageRule.instruction.md +3 -0
  22. package/incrementalBuilder.proc.js +39 -13
  23. package/{index-tns543wd.js → index-0tkj05cz.js} +3 -3
  24. package/{index-sx91nf4z.js → index-2yan1ajk.js} +7 -7
  25. package/{index-g500c5j9.js → index-38by07nw.js} +1 -1
  26. package/{index-zttm13c3.js → index-38patcx6.js} +4 -4
  27. package/{index-jb2sreps.js → index-53h0053j.js} +16 -14
  28. package/{index-zbrwnmf1.js → index-6t7fkx73.js} +1 -1
  29. package/{index-361ex3rb.js → index-6zgt7zmx.js} +4 -4
  30. package/{index-y4kcmbt2.js → index-8d9r465x.js} +2 -2
  31. package/{index-wrmq92vk.js → index-90q0w90q.js} +1 -1
  32. package/{index-scck6h6d.js → index-ampz4vgv.js} +4 -4
  33. package/{index-sjabnf7j.js → index-ap6ac70m.js} +3 -3
  34. package/{index-j9d3mjx1.js → index-ck64kxrn.js} +2 -2
  35. package/{index-p6x5b7hr.js → index-d894868w.js} +3 -0
  36. package/{index-sveq36gh.js → index-dcm66hss.js} +2 -2
  37. package/{index-84h43kg6.js → index-demt944k.js} +2 -2
  38. package/{index-0j1t1h2b.js → index-g0yds382.js} +1 -1
  39. package/{index-hapx5myy.js → index-gfh90r3t.js} +2 -2
  40. package/{index-gbp1q1b5.js → index-hmj94es2.js} +4 -4
  41. package/{index-z7kbxdqg.js → index-jzpeny42.js} +3 -3
  42. package/{index-eft5c2mp.js → index-jzz6ye8x.js} +296 -24
  43. package/{index-ppvqy5bc.js → index-kc6ffq0s.js} +8 -8
  44. package/{index-tp56652m.js → index-kc871vpc.js} +3 -3
  45. package/{index-m02tdq8a.js → index-kdswbvys.js} +3 -3
  46. package/{index-defp4gmb.js → index-qev8p5wp.js} +1 -1
  47. package/{index-1h2jc0x3.js → index-qwe079ww.js} +4 -4
  48. package/{index-wwe9rsrx.js → index-r0a604h4.js} +12 -2
  49. package/{index-9zy8479y.js → index-r0q2ka2b.js} +1 -1
  50. package/{index-db2nqrad.js → index-r8t5sq7z.js} +13 -8
  51. package/{index-j2dgmzbj.js → index-re2kfscb.js} +122 -18
  52. package/{index-gr9thy79.js → index-sra1a5f8.js} +2 -2
  53. package/{index-khk05tsf.js → index-t0hk1kxq.js} +1 -1
  54. package/index-vkpqe29t.js +267 -0
  55. package/{index-sp0qsr7a.js → index-w60zxxye.js} +3 -3
  56. package/{index-9z3egsmg.js → index-wymcdsas.js} +8 -8
  57. package/{index-zdpte1pj.js → index-y0y0pnx8.js} +1 -1
  58. package/{index-aayg4dqf.js → index-z47rw9ez.js} +6 -6
  59. package/index.js +23 -23
  60. package/{library.command-63hgt9te.js → library.command-zh29tjdd.js} +3 -3
  61. package/{localRegistry.command-343ksmn9.js → localRegistry.command-k9pn9ahj.js} +14 -14
  62. package/{module.command-2hce9m6k.js → module.command-dgpqs9fz.js} +6 -6
  63. package/{package.command-96eheyvd.js → package.command-1je4hsca.js} +3 -3
  64. package/package.json +2 -2
  65. package/{page.command-gs6d841d.js → page.command-cgsasanh.js} +3 -3
  66. package/{pipeline.command-wdfvdbfj.js → pipeline.command-tb46sa8v.js} +2 -2
  67. package/{primitive.command-7tdj12wn.js → primitive.command-bzsy23x5.js} +7 -7
  68. package/{projectTypecheck-kqj1t6hb.js → projectTypecheck-h8rgaczy.js} +1 -1
  69. package/{quality.command-29bgarh1.js → quality.command-120m9h6v.js} +4 -4
  70. package/{repair.command-yng4rf5d.js → repair.command-6m4wd0qv.js} +6 -6
  71. package/{scalar.command-1nk4329t.js → scalar.command-3dn5hsc6.js} +5 -5
  72. package/skills/akan-page/SKILL.md +19 -0
  73. package/skills/akan-service/SKILL.md +47 -0
  74. package/{subspace.command-5cehmcdd.js → subspace.command-s8nyfqbn.js} +8 -8
  75. package/{tunnel.command-yrd4atqy.js → tunnel.command-8mwrqkr3.js} +7 -7
  76. package/{typeChecker-j2jdnqsr.js → typeChecker-s640r6c0.js} +1 -1
  77. package/typecheck.proc.js +1 -1
  78. package/{verify.command-kbq0fcg8.js → verify.command-2pspfy7k.js} +12 -12
  79. package/{workflow.command-274qfa8z.js → workflow.command-7sy5vnsj.js} +11 -11
  80. package/{workspace.command-r6hgmawy.js → workspace.command-x518tdv4.js} +30 -30
  81. package/TunnelShare-6d7z36sr.js +0 -14
  82. package/cloud.script-t2n13gv6.js +0 -27
  83. package/context.runner-wxqb3qcy.js +0 -28
  84. package/index-vzpnr12w.js +0 -65
  85. package/templates/workspaceRoot/patches/zod@3.25.76.patch.template +0 -22
  86. package/templates/workspaceRoot/patches/zod@4.4.3.patch.template +0 -11
package/index.js CHANGED
@@ -4,9 +4,9 @@ import {
4
4
  getTargetMetas,
5
5
  getTargetCommandNames,
6
6
  runCommands
7
- } from "./index-9zy8479y.js";
7
+ } from "./index-r0q2ka2b.js";
8
8
  import"./index-bns3wcpc.js";
9
- import"./index-g500c5j9.js";
9
+ import"./index-38by07nw.js";
10
10
 
11
11
  // pkgs/@akanjs/cli/bunVersionGuard.ts
12
12
  class BunVersionGuard {
@@ -22,27 +22,27 @@ import path from "path";
22
22
 
23
23
  // pkgs/@akanjs/cli/commandModules.ts
24
24
  var commandModules = {
25
- workspace: async () => (await import("./workspace.command-r6hgmawy.js")).WorkspaceCommand,
26
- agent: async () => (await import("./agent.command-tffz6wdn.js")).AgentCommand,
27
- code: async () => (await import("./code.command-ma8dtzww.js")).CodeCommand,
28
- application: async () => (await import("./application.command-7bkxbrsp.js")).ApplicationCommand,
29
- library: async () => (await import("./library.command-63hgt9te.js")).LibraryCommand,
30
- localRegistry: async () => (await import("./localRegistry.command-343ksmn9.js")).LocalRegistryCommand,
31
- package: async () => (await import("./package.command-96eheyvd.js")).PackageCommand,
32
- module: async () => (await import("./module.command-2hce9m6k.js")).ModuleCommand,
33
- page: async () => (await import("./page.command-gs6d841d.js")).PageCommand,
34
- context: async () => (await import("./context.command-80a1qhps.js")).ContextCommand,
35
- cloud: async () => (await import("./cloud.command-a792bc10.js")).CloudCommand,
36
- subspace: async () => (await import("./subspace.command-5cehmcdd.js")).SubspaceCommand,
37
- guideline: async () => (await import("./guideline.command-195g0h9a.js")).GuidelineCommand,
38
- scalar: async () => (await import("./scalar.command-1nk4329t.js")).ScalarCommand,
39
- primitive: async () => (await import("./primitive.command-7tdj12wn.js")).PrimitiveCommand,
40
- quality: async () => (await import("./quality.command-29bgarh1.js")).QualityCommand,
41
- verify: async () => (await import("./verify.command-kbq0fcg8.js")).VerifyCommand,
42
- repair: async () => (await import("./repair.command-yng4rf5d.js")).RepairCommand,
43
- workflow: async () => (await import("./workflow.command-274qfa8z.js")).WorkflowCommand,
44
- pipeline: async () => (await import("./pipeline.command-wdfvdbfj.js")).PipelineCommand,
45
- tunnel: async () => (await import("./tunnel.command-yrd4atqy.js")).TunnelCommand
25
+ workspace: async () => (await import("./workspace.command-x518tdv4.js")).WorkspaceCommand,
26
+ agent: async () => (await import("./agent.command-962mp3kg.js")).AgentCommand,
27
+ code: async () => (await import("./code.command-asq7xrr6.js")).CodeCommand,
28
+ application: async () => (await import("./application.command-1nr0bqq1.js")).ApplicationCommand,
29
+ library: async () => (await import("./library.command-zh29tjdd.js")).LibraryCommand,
30
+ localRegistry: async () => (await import("./localRegistry.command-k9pn9ahj.js")).LocalRegistryCommand,
31
+ package: async () => (await import("./package.command-1je4hsca.js")).PackageCommand,
32
+ module: async () => (await import("./module.command-dgpqs9fz.js")).ModuleCommand,
33
+ page: async () => (await import("./page.command-cgsasanh.js")).PageCommand,
34
+ context: async () => (await import("./context.command-fw4g2pw1.js")).ContextCommand,
35
+ cloud: async () => (await import("./cloud.command-cj7b3m6y.js")).CloudCommand,
36
+ subspace: async () => (await import("./subspace.command-s8nyfqbn.js")).SubspaceCommand,
37
+ guideline: async () => (await import("./guideline.command-43gfjsjv.js")).GuidelineCommand,
38
+ scalar: async () => (await import("./scalar.command-3dn5hsc6.js")).ScalarCommand,
39
+ primitive: async () => (await import("./primitive.command-bzsy23x5.js")).PrimitiveCommand,
40
+ quality: async () => (await import("./quality.command-120m9h6v.js")).QualityCommand,
41
+ verify: async () => (await import("./verify.command-2pspfy7k.js")).VerifyCommand,
42
+ repair: async () => (await import("./repair.command-6m4wd0qv.js")).RepairCommand,
43
+ workflow: async () => (await import("./workflow.command-7sy5vnsj.js")).WorkflowCommand,
44
+ pipeline: async () => (await import("./pipeline.command-tb46sa8v.js")).PipelineCommand,
45
+ tunnel: async () => (await import("./tunnel.command-8mwrqkr3.js")).TunnelCommand
46
46
  };
47
47
  var commandModuleIds = Object.keys(commandModules);
48
48
 
@@ -3,12 +3,12 @@ import {
3
3
  Lib,
4
4
  Workspace,
5
5
  command
6
- } from "./index-9zy8479y.js";
6
+ } from "./index-r0q2ka2b.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-g500c5j9.js";
8
+ import"./index-38by07nw.js";
9
9
  import {
10
10
  LibraryScript
11
- } from "./index-y4kcmbt2.js";
11
+ } from "./index-8d9r465x.js";
12
12
 
13
13
  // pkgs/@akanjs/cli/library/library.command.ts
14
14
  class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
@@ -4,37 +4,37 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-9zy8479y.js";
7
+ } from "./index-r0q2ka2b.js";
8
8
  import"./index-bns3wcpc.js";
9
9
  import {
10
10
  PkgExecutor
11
- } from "./index-g500c5j9.js";
11
+ } from "./index-38by07nw.js";
12
12
  import {
13
13
  npmRegistryFromEnv,
14
14
  warnIgnoredNpmRegistry,
15
15
  getNpmRegistryUrl
16
16
  } from "./index-4am4dvmf.js";
17
- import"./index-p6x5b7hr.js";
18
- import"./index-sp0qsr7a.js";
19
- import"./index-0j1t1h2b.js";
17
+ import"./index-d894868w.js";
18
+ import"./index-w60zxxye.js";
19
+ import"./index-g0yds382.js";
20
20
  import"./index-m9jj544v.js";
21
- import"./index-zbrwnmf1.js";
22
- import"./index-sveq36gh.js";
23
- import"./index-y4kcmbt2.js";
24
- import"./index-ppvqy5bc.js";
21
+ import"./index-6t7fkx73.js";
22
+ import"./index-dcm66hss.js";
23
+ import"./index-8d9r465x.js";
24
+ import"./index-kc6ffq0s.js";
25
25
  import {
26
26
  ApplicationScript
27
- } from "./index-db2nqrad.js";
27
+ } from "./index-r8t5sq7z.js";
28
28
  import"./index-tenw3mah.js";
29
- import"./index-gr9thy79.js";
29
+ import"./index-sra1a5f8.js";
30
30
  import {
31
31
  CloudRunner
32
- } from "./index-1h2jc0x3.js";
32
+ } from "./index-qwe079ww.js";
33
33
  import"./index-qd7xn2bk.js";
34
34
  import {
35
35
  PackageScript
36
- } from "./index-84h43kg6.js";
37
- import"./index-defp4gmb.js";
36
+ } from "./index-demt944k.js";
37
+ import"./index-qev8p5wp.js";
38
38
  import"./index-9bv479q5.js";
39
39
 
40
40
  // pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
@@ -3,17 +3,17 @@ import {
3
3
  Sys,
4
4
  Module,
5
5
  command
6
- } from "./index-9zy8479y.js";
6
+ } from "./index-r0q2ka2b.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-g500c5j9.js";
8
+ import"./index-38by07nw.js";
9
9
  import {
10
10
  renderPrimitiveReport
11
- } from "./index-m02tdq8a.js";
12
- import"./index-j2dgmzbj.js";
13
- import"./index-khk05tsf.js";
11
+ } from "./index-kdswbvys.js";
12
+ import"./index-re2kfscb.js";
13
+ import"./index-t0hk1kxq.js";
14
14
  import {
15
15
  ModuleScript
16
- } from "./index-gbp1q1b5.js";
16
+ } from "./index-hmj94es2.js";
17
17
 
18
18
  // pkgs/@akanjs/cli/module/module.command.ts
19
19
  import { Logger, lowerlize } from "akanjs/common";
@@ -3,13 +3,13 @@ import {
3
3
  Pkg,
4
4
  Workspace,
5
5
  command
6
- } from "./index-9zy8479y.js";
6
+ } from "./index-r0q2ka2b.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-g500c5j9.js";
8
+ import"./index-38by07nw.js";
9
9
  import"./index-qd7xn2bk.js";
10
10
  import {
11
11
  PackageScript
12
- } from "./index-84h43kg6.js";
12
+ } from "./index-demt944k.js";
13
13
 
14
14
  // pkgs/@akanjs/cli/package/package.command.ts
15
15
  class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.1.2-rc.3",
3
+ "version": "3.1.2-rc.4",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "1.3.0",
40
40
  "@inquirer/prompts": "^8.7.3",
41
41
  "@tailwindcss/node": "^4.3.3",
42
- "akanjs": "3.1.2-rc.3",
42
+ "akanjs": "3.1.2-rc.4",
43
43
  "chalk": "^6.0.1",
44
44
  "commander": "^15.0.0",
45
45
  "dayjs": "^1.11.23",
@@ -3,12 +3,12 @@ import {
3
3
  App,
4
4
  Module,
5
5
  command
6
- } from "./index-9zy8479y.js";
6
+ } from "./index-r0q2ka2b.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-g500c5j9.js";
8
+ import"./index-38by07nw.js";
9
9
  import {
10
10
  PageScript
11
- } from "./index-khk05tsf.js";
11
+ } from "./index-t0hk1kxq.js";
12
12
 
13
13
  // pkgs/@akanjs/cli/page/page.command.ts
14
14
  class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
@@ -4,7 +4,7 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-9zy8479y.js";
7
+ } from "./index-r0q2ka2b.js";
8
8
  import {
9
9
  FileSys2
10
10
  } from "./index-bns3wcpc.js";
@@ -12,7 +12,7 @@ import {
12
12
  AkanAppConfig,
13
13
  AkanWorkspaceConfig,
14
14
  AppExecutor
15
- } from "./index-g500c5j9.js";
15
+ } from "./index-38by07nw.js";
16
16
  import {
17
17
  resolveMobileTargets
18
18
  } from "./index-m9jj544v.js";
@@ -2,18 +2,18 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-9zy8479y.js";
5
+ } from "./index-r0q2ka2b.js";
6
6
  import"./index-bns3wcpc.js";
7
- import"./index-g500c5j9.js";
7
+ import"./index-38by07nw.js";
8
8
  import {
9
9
  renderPrimitiveReport
10
- } from "./index-m02tdq8a.js";
11
- import"./index-j2dgmzbj.js";
12
- import"./index-khk05tsf.js";
13
- import"./index-gbp1q1b5.js";
10
+ } from "./index-kdswbvys.js";
11
+ import"./index-re2kfscb.js";
12
+ import"./index-t0hk1kxq.js";
13
+ import"./index-hmj94es2.js";
14
14
  import {
15
15
  PrimitiveScript
16
- } from "./index-361ex3rb.js";
16
+ } from "./index-6zgt7zmx.js";
17
17
 
18
18
  // pkgs/@akanjs/cli/primitive/primitive.command.ts
19
19
  import { Logger } from "akanjs/common";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ProjectTypecheck2
4
- } from "./index-g500c5j9.js";
4
+ } from "./index-38by07nw.js";
5
5
  export {
6
6
  ProjectTypecheck2 as ProjectTypecheck
7
7
  };
@@ -3,20 +3,20 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-9zy8479y.js";
6
+ } from "./index-r0q2ka2b.js";
7
7
  import"./index-bns3wcpc.js";
8
8
  import {
9
9
  AppExecutor,
10
10
  LibExecutor
11
- } from "./index-g500c5j9.js";
11
+ } from "./index-38by07nw.js";
12
12
  import {
13
13
  MaintainabilityBaseline,
14
14
  WorkspaceRunner,
15
15
  AkanQualityScanner,
16
16
  formatQualityScanResult,
17
17
  formatSsrScanResult
18
- } from "./index-sjabnf7j.js";
19
- import"./index-j2dgmzbj.js";
18
+ } from "./index-ap6ac70m.js";
19
+ import"./index-re2kfscb.js";
20
20
  import"./index-62md4dwy.js";
21
21
  import"./index-hj6w4ka1.js";
22
22
  import"./index-4am4dvmf.js";
@@ -3,16 +3,16 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-9zy8479y.js";
6
+ } from "./index-r0q2ka2b.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-g500c5j9.js";
8
+ import"./index-38by07nw.js";
9
9
  import"./index-hj6w4ka1.js";
10
- import"./index-m02tdq8a.js";
11
- import"./index-j2dgmzbj.js";
12
- import"./index-j9d3mjx1.js";
10
+ import"./index-kdswbvys.js";
11
+ import"./index-re2kfscb.js";
12
+ import"./index-ck64kxrn.js";
13
13
  import {
14
14
  RepairRunner
15
- } from "./index-tns543wd.js";
15
+ } from "./index-0tkj05cz.js";
16
16
 
17
17
  // pkgs/@akanjs/cli/repair/repair.script.ts
18
18
  import { Logger } from "akanjs/common";
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  Sys,
4
4
  command
5
- } from "./index-9zy8479y.js";
5
+ } from "./index-r0q2ka2b.js";
6
6
  import"./index-bns3wcpc.js";
7
- import"./index-g500c5j9.js";
7
+ import"./index-38by07nw.js";
8
8
  import {
9
9
  renderPrimitiveReport
10
- } from "./index-m02tdq8a.js";
11
- import"./index-j2dgmzbj.js";
10
+ } from "./index-kdswbvys.js";
11
+ import"./index-re2kfscb.js";
12
12
  import {
13
13
  ScalarScript
14
- } from "./index-hapx5myy.js";
14
+ } from "./index-gfh90r3t.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/scalar/scalar.command.ts
17
17
  import { Logger, lowerlize } from "akanjs/common";
@@ -34,6 +34,25 @@ export default page()
34
34
  6. Re-skin an `akanjs/ui` component for a subtree with `_overrides.tsx`:
35
35
  `export default override({ Slot: AppComponent })`, no logic.
36
36
 
37
+ ## API at a glance
38
+
39
+ `page`, `layout` and `router` come from `akanjs/client`, `Link` from `akanjs/ui`, `usePageLocation` from
40
+ `akanjs/webkit`. A stage receives the declared params and search keys plus `lang`.
41
+
42
+ - Data-driven title: `.head(async ({ name }) => <title>{(await fetch.pokemon(name))?.label}</title>)`.
43
+ - Async page: `.render(async ({ name }) => { const pokemon = await fetch.pokemon(name); if (!pokemon) router.notFound(); … })`;
44
+ the same query in `.head()` and `.render()` is one request.
45
+ - `router.notFound()` from `.guard()`, `.head()` or `.render()` answers 404 with the nearest layout's `.notFound()`
46
+ above it (an unmatched URL: the deepest layout covering it), else the built-in 404.
47
+ - A layout's own 404 and error views: `.notFound(({ pathname }) => …)` and `.error(({ error }) => …)` on `layout()`
48
+ or `rootLayout()`.
49
+ - `<Link href="/pokemon/deoxys">`: write the path without the locale; Link adds it, or leaves it off for the default
50
+ locale under `i18n.localePrefix: "as-needed"`. `activeClassName` marks the current one.
51
+ - From a handler: `router.push(href)` / `router.replace(href)`; in a server stage, `router.redirect(href)`.
52
+ - A client filter kept in the URL without reloading the page: ``router.replace(`/pokemon?q=${q}`, { shallow: true,
53
+ scrollToTop: false })`` in a `"use client"` component, read back with `usePageLocation().searchParams`. Shallow
54
+ holds only while the path stays the same; a server `.search()` sees the value at the next full navigation.
55
+
37
56
  ## Never
38
57
 
39
58
  - A `fetch.<mutation>()` while rendering — it throws `base.error.mutationInRender`, because opening a link would
@@ -31,4 +31,51 @@ registered under `<refName>`, and the `Service` suffix is required.
31
31
  An external API or piece of infrastructure is an `adapt()` class in `srvkit/`, injected with `plug`. It
32
32
  self-registers, so do **not** add it to `lib/option.ts`.
33
33
 
34
+ ## Recipe: pages backed by an external HTTP API
35
+
36
+ `akan create-service pokeapi <app>` scaffolds `lib/_pokeapi/`; the adapter beside it is yours.
37
+
38
+ ```ts
39
+ // srvkit/pokeApi.ts — read at boot, so the built server takes API_BASE_URL from the host that runs it
40
+ export class PokeApi extends adapt("pokeApi" as const, ({ env }) => ({
41
+ baseUrl: env(() => process.env.API_BASE_URL ?? "http://localhost:9000"),
42
+ })) {
43
+ async get<T>(path: string): Promise<T | null> {
44
+ try {
45
+ const res = await fetch(`${this.baseUrl}/${path}`, { signal: AbortSignal.timeout(20_000) });
46
+ if (res.ok) return (await res.json()) as T;
47
+ if (res.status !== 404) this.logger.warn(`${path} answered ${res.status}`);
48
+ } catch (error) {
49
+ this.logger.warn(`${path} failed: ${String(error)}`);
50
+ }
51
+ return null;
52
+ }
53
+ }
54
+
55
+ // lib/_pokeapi/pokeapi.service.ts — shape the upstream JSON here, not in the page
56
+ export class PokeapiService extends serve("pokeapi" as const, ({ plug }) => ({ pokeApi: plug(PokeApi) })) {
57
+ async getPokemon(name: string) {
58
+ const pokemon = await this.pokeApi.get<ApiPokemon>(`pokemon/${name}`);
59
+ return pokemon && { id: pokemon.id, name: pokemon.name };
60
+ }
61
+ }
62
+
63
+ // lib/_pokeapi/pokeapi.signal.ts — Any answers plain JSON; nullable lets it answer null for "not found"
64
+ export class PokeapiEndpoint extends endpoint(srv.pokeapi, ({ query }) => ({
65
+ pokemon: query(Any, { guards: [Public], nullable: true })
66
+ .param("name", String)
67
+ .exec(async function (name) {
68
+ return await this.pokeapiService.getPokemon(name);
69
+ }),
70
+ })) {}
71
+
72
+ // lib/_pokeapi/pokeapi.dictionary.ts — typecheck asks a label for every endpoint
73
+ .endpoint<PokeapiEndpoint>((fn) => ({ pokemon: fn(["Pokémon", "포켓몬"]) }))
74
+ ```
75
+
76
+ The page calls it as `await fetch.pokemon(name)` (`fetch` from `@apps/<app>/client`) and answers
77
+ `router.notFound()` on `null`. An `Any` return reaches the page as `unknown`: type it with an interface in
78
+ `common/`, or return a scalar (`akan create-scalar`) for a typed wire shape. A query that answers `null` without
79
+ `nullable: true` fails the render, naming the endpoint.
80
+
34
81
  Full detail: `get_guideline` with `modelService`.
@@ -5,7 +5,7 @@ import {
5
5
  runner,
6
6
  script,
7
7
  command
8
- } from "./index-9zy8479y.js";
8
+ } from "./index-r0q2ka2b.js";
9
9
  import {
10
10
  FileSys2
11
11
  } from "./index-bns3wcpc.js";
@@ -14,20 +14,20 @@ import {
14
14
  Executor,
15
15
  WorkspaceExecutor,
16
16
  AppExecutor
17
- } from "./index-g500c5j9.js";
17
+ } from "./index-38by07nw.js";
18
18
  import {
19
19
  GlobalConfig
20
- } from "./index-gr9thy79.js";
20
+ } from "./index-sra1a5f8.js";
21
21
  import"./index-m9jj544v.js";
22
- import"./index-sp0qsr7a.js";
23
- import"./index-zbrwnmf1.js";
24
- import"./index-sveq36gh.js";
22
+ import"./index-w60zxxye.js";
23
+ import"./index-6t7fkx73.js";
24
+ import"./index-dcm66hss.js";
25
25
  import {
26
26
  SubspaceConfig
27
27
  } from "./index-h7hehkw6.js";
28
28
  import {
29
29
  SlicePlanner
30
- } from "./index-defp4gmb.js";
30
+ } from "./index-qev8p5wp.js";
31
31
 
32
32
  // pkgs/@akanjs/devkit/subspace.ts
33
33
  import { mkdir as mkdir2 } from "fs/promises";
@@ -818,7 +818,7 @@ class SubspaceRunner extends runner("subspace") {
818
818
  if (!asked)
819
819
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
820
820
  const { libs } = await subspace.slice();
821
- const { CloudScript } = await import("./cloud.script-t2n13gv6.js");
821
+ const { CloudScript } = await import("./cloud.script-8kr7qgfa.js");
822
822
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
823
823
  host,
824
824
  workspaceId,
@@ -4,22 +4,22 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-9zy8479y.js";
7
+ } from "./index-r0q2ka2b.js";
8
8
  import"./index-bns3wcpc.js";
9
9
  import {
10
10
  AppExecutor
11
- } from "./index-g500c5j9.js";
11
+ } from "./index-38by07nw.js";
12
12
  import {
13
13
  GlobalConfig,
14
14
  CloudApi
15
- } from "./index-gr9thy79.js";
15
+ } from "./index-sra1a5f8.js";
16
16
  import"./index-m9jj544v.js";
17
- import"./index-sp0qsr7a.js";
18
- import"./index-zbrwnmf1.js";
19
- import"./index-sveq36gh.js";
17
+ import"./index-w60zxxye.js";
18
+ import"./index-6t7fkx73.js";
19
+ import"./index-dcm66hss.js";
20
20
  import {
21
21
  TunnelShare2
22
- } from "./index-zdpte1pj.js";
22
+ } from "./index-y0y0pnx8.js";
23
23
  import {
24
24
  writeClipboard
25
25
  } from "./index-p6pbz9n5.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  TypeChecker2
4
- } from "./index-wwe9rsrx.js";
4
+ } from "./index-r0a604h4.js";
5
5
  export {
6
6
  TypeChecker2 as TypeChecker
7
7
  };
package/typecheck.proc.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  TypeChecker2
4
- } from "./index-wwe9rsrx.js";
4
+ } from "./index-r0a604h4.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/typecheck/typecheck.proc.ts
7
7
  import { Logger } from "akanjs/common";
@@ -5,32 +5,32 @@ import {
5
5
  ExitCodeError,
6
6
  markCliErrorPrinted,
7
7
  command
8
- } from "./index-9zy8479y.js";
8
+ } from "./index-r0q2ka2b.js";
9
9
  import"./index-bns3wcpc.js";
10
- import"./index-g500c5j9.js";
10
+ import"./index-38by07nw.js";
11
11
  import {
12
12
  ApplicationRunner,
13
13
  VerifyScope
14
- } from "./index-ppvqy5bc.js";
15
- import"./index-p6x5b7hr.js";
16
- import"./index-sp0qsr7a.js";
17
- import"./index-0j1t1h2b.js";
14
+ } from "./index-kc6ffq0s.js";
15
+ import"./index-d894868w.js";
16
+ import"./index-w60zxxye.js";
17
+ import"./index-g0yds382.js";
18
18
  import"./index-m9jj544v.js";
19
- import"./index-zbrwnmf1.js";
20
- import"./index-sveq36gh.js";
19
+ import"./index-6t7fkx73.js";
20
+ import"./index-dcm66hss.js";
21
21
  import"./index-62md4dwy.js";
22
22
  import {
23
23
  WorkspaceRunner
24
- } from "./index-sjabnf7j.js";
25
- import"./index-j2dgmzbj.js";
24
+ } from "./index-ap6ac70m.js";
25
+ import"./index-re2kfscb.js";
26
26
  import"./index-hj6w4ka1.js";
27
27
  import"./index-4am4dvmf.js";
28
28
  import"./index-k64mhwbw.js";
29
29
  import {
30
30
  VerifyPipeline,
31
31
  VerifyReport
32
- } from "./index-eft5c2mp.js";
33
- import"./index-defp4gmb.js";
32
+ } from "./index-jzz6ye8x.js";
33
+ import"./index-qev8p5wp.js";
34
34
 
35
35
  // pkgs/@akanjs/cli/verify/verify.script.ts
36
36
  import path from "path";
@@ -3,22 +3,22 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-9zy8479y.js";
6
+ } from "./index-r0q2ka2b.js";
7
7
  import"./index-bns3wcpc.js";
8
- import"./index-g500c5j9.js";
8
+ import"./index-38by07nw.js";
9
9
  import"./index-hj6w4ka1.js";
10
- import"./index-m02tdq8a.js";
11
- import"./index-j2dgmzbj.js";
12
- import"./index-j9d3mjx1.js";
13
- import"./index-khk05tsf.js";
14
- import"./index-gbp1q1b5.js";
15
- import"./index-361ex3rb.js";
16
- import"./index-tns543wd.js";
17
- import"./index-hapx5myy.js";
10
+ import"./index-kdswbvys.js";
11
+ import"./index-re2kfscb.js";
12
+ import"./index-ck64kxrn.js";
13
+ import"./index-t0hk1kxq.js";
14
+ import"./index-hmj94es2.js";
15
+ import"./index-6zgt7zmx.js";
16
+ import"./index-0tkj05cz.js";
17
+ import"./index-gfh90r3t.js";
18
18
  import"./index-k64mhwbw.js";
19
19
  import {
20
20
  WorkflowRunner
21
- } from "./index-9z3egsmg.js";
21
+ } from "./index-wymcdsas.js";
22
22
 
23
23
  // pkgs/@akanjs/cli/workflow/workflow.script.ts
24
24
  import { Logger } from "akanjs/common";