@akanjs/cli 3.0.0-alpha.3 → 3.0.0-alpha.31

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 (105) hide show
  1. package/.build-stamp +1 -1
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/{abstractCompactor-e5yq60qz.js → abstractCompactor-20e0cwbs.js} +2 -2
  5. package/{agent.command-yv00p0s0.js → agent.command-e835fjem.js} +8 -7
  6. package/{application.command-0qsczf4k.js → application.command-sjtbk6tr.js} +6 -5
  7. package/{applicationBuildRunner-ct2pxyvw.js → applicationBuildRunner-7gnfz7ww.js} +6 -7
  8. package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-93nzdfsy.js} +1 -1
  9. package/buildBatch.proc.js +5 -4
  10. package/{capacitorApp-4r9sm3qg.js → capacitorApp-qv7g3dp2.js} +29 -26
  11. package/{cloud.command-dxfv18sa.js → cloud.command-y0e4eyqz.js} +10 -9
  12. package/{context.command-8d9e3k6b.js → context.command-vn87jb08.js} +16 -15
  13. package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
  14. package/getDirname-ka11hm7e.js +8 -0
  15. package/{guideline.command-3jbkxzh6.js → guideline.command-s4hn2bsy.js} +7 -6
  16. package/guidelines/conventions/conventions.generate.json +25 -0
  17. package/guidelines/conventions/conventions.instruction.md +986 -0
  18. package/guidelines/cssRule/cssRule.instruction.md +7 -0
  19. package/guidelines/framework/framework.instruction.md +1 -0
  20. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
  21. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +972 -0
  22. package/incrementalBuilder.proc.js +6 -5
  23. package/{index-1pvex4az.js → index-0h212yqe.js} +13 -13
  24. package/index-1577bej2.js +7 -0
  25. package/{index-k95xkh4p.js → index-33zce8gt.js} +8 -4
  26. package/{index-2q1f5j9k.js → index-3dp7x6rc.js} +3 -3
  27. package/{index-7c6k4yvg.js → index-73rnbwgg.js} +15 -7
  28. package/{index-e16gnn26.js → index-8d2sv6pw.js} +13 -13
  29. package/{index-hgna5rjy.js → index-8vkkm7v0.js} +124 -65
  30. package/{index-bekddz9q.js → index-9jsnb4vw.js} +4 -4
  31. package/{index-nm6wghb6.js → index-becx1t0k.js} +6 -6
  32. package/{index-a00jg8x8.js → index-g9e2fhw2.js} +49 -32
  33. package/{index-pyt2b4nw.js → index-hg0qvhmx.js} +152 -241
  34. package/{index-tdbas9r0.js → index-j37qq1f2.js} +1 -1
  35. package/{index-ej426mcr.js → index-k6fvbcj1.js} +37 -6
  36. package/{index-yzmhasdb.js → index-mykmf6wd.js} +8 -8
  37. package/{index-t3723f99.js → index-mz5jtaq7.js} +86 -17
  38. package/{index-8hsbnyes.js → index-n706txcv.js} +5 -3
  39. package/{index-bbkek1bp.js → index-qc0tnhs2.js} +1 -1
  40. package/{index-rh16j3c7.js → index-qnv0aqmm.js} +12 -8
  41. package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
  42. package/{index-zasydjxd.js → index-t71zvmt9.js} +9 -11
  43. package/{index-rzwcpcc3.js → index-tsmjxph2.js} +1 -1
  44. package/{index-ec09pws3.js → index-x33gnap3.js} +4 -4
  45. package/{index-mr5s7mqd.js → index-xyrb7pk5.js} +3 -3
  46. package/index.js +20 -19
  47. package/{library.command-ebdj1vnm.js → library.command-v5cyaw9t.js} +5 -4
  48. package/{localRegistry.command-gb178ne8.js → localRegistry.command-53t758pt.js} +9 -8
  49. package/{module.command-9c1bnsx4.js → module.command-pq6w84xg.js} +9 -8
  50. package/{package.command-t93p4jkj.js → package.command-qkcs60ts.js} +5 -4
  51. package/package.json +3 -4
  52. package/{page.command-k3k0meh2.js → page.command-qj5bfnh9.js} +5 -4
  53. package/{primitive.command-de6nktdt.js → primitive.command-bw0nes6x.js} +10 -9
  54. package/{quality.command-z5kth2wa.js → quality.command-f8drhx6c.js} +11 -41
  55. package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
  56. package/{repair.command-ehf2g112.js → repair.command-mzwtejpk.js} +7 -6
  57. package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-7fycdqyv.js} +3 -39
  58. package/{scalar.command-7a2jtv33.js → scalar.command-rm6k3c65.js} +8 -7
  59. package/templates/app/env/env.server.debug.ts.template +1 -5
  60. package/templates/app/env/env.server.develop.ts.template +1 -5
  61. package/templates/app/env/env.server.local.ts.template +1 -5
  62. package/templates/app/env/env.server.main.ts.template +1 -5
  63. package/templates/app/page/styles.css.template +3 -3
  64. package/templates/appSample/srvkit/AuthGuard.ts +9 -5
  65. package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
  66. package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
  67. package/templates/crudPages/new/page.tsx +1 -1
  68. package/templates/crudSinglePage/page.tsx +1 -1
  69. package/templates/env/_env.server.type.ts +7 -5
  70. package/templates/lib/db.ts +1 -1
  71. package/templates/lib/dict.ts +1 -1
  72. package/templates/lib/sig.ts +1 -1
  73. package/templates/lib/srv.ts +6 -2
  74. package/templates/lib/useClient.ts +9 -3
  75. package/templates/module/__Model__.Util.tsx +1 -1
  76. package/templates/module/__Model__.Zone.tsx +3 -5
  77. package/templates/workspaceRoot/AGENTS.md.template +0 -963
  78. package/templates/workspaceRoot/CLAUDE.md.template +19 -0
  79. package/templates/workspaceRoot/biome.json.template +4 -198
  80. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
  81. package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
  82. package/typecheck.proc.js +1 -1
  83. package/{workflow.command-e0tt0vk2.js → workflow.command-g2cgcgxn.js} +15 -14
  84. package/{workspace.command-fpda0evj.js → workspace.command-f7jerqb2.js} +69 -51
  85. package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
  86. package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -33
  87. package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
  88. package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
  89. package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
  90. package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
  91. package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
  92. package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
  93. package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
  94. package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -18
  95. package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -61
  96. package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
  97. package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
  98. package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
  99. package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -58
  100. package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
  101. package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
  102. package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
  103. package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
  104. package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
  105. /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
@@ -2,31 +2,32 @@
2
2
  import {
3
3
  CloudRunner,
4
4
  getNpmRegistryUrl
5
- } from "./index-zasydjxd.js";
5
+ } from "./index-t71zvmt9.js";
6
6
  import {
7
7
  PackageScript
8
- } from "./index-k95xkh4p.js";
9
- import"./index-0cj2zxbm.js";
8
+ } from "./index-33zce8gt.js";
9
+ import"./index-sh01r3pm.js";
10
10
  import {
11
11
  ApplicationScript
12
- } from "./index-e16gnn26.js";
12
+ } from "./index-8d2sv6pw.js";
13
+ import"./index-73rnbwgg.js";
13
14
  import"./index-76rn3g2c.js";
14
- import"./index-7c6k4yvg.js";
15
15
  import {
16
16
  Workspace,
17
17
  command,
18
18
  runner,
19
19
  script
20
- } from "./index-8hsbnyes.js";
20
+ } from "./index-n706txcv.js";
21
21
  import"./index-fgc8r6dj.js";
22
22
  import"./index-bjpxzr6s.js";
23
23
  import {
24
24
  PkgExecutor
25
- } from "./index-hgna5rjy.js";
25
+ } from "./index-8vkkm7v0.js";
26
26
  import"./index-mxvakhsm.js";
27
+ import"./index-1577bej2.js";
27
28
  import"./index-46tjzh6s.js";
28
29
  import"./index-67546d0j.js";
29
- import"./index-r24hmh0q.js";
30
+ import"./index-yb2wsc7f.js";
30
31
 
31
32
  // pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
32
33
  import { mkdir, rm } from "fs/promises";
@@ -1,23 +1,24 @@
1
1
  // @bun
2
2
  import {
3
3
  ModuleScript
4
- } from "./index-yzmhasdb.js";
5
- import"./index-bbkek1bp.js";
4
+ } from "./index-mykmf6wd.js";
6
5
  import"./index-ss469dec.js";
7
- import"./index-0cj2zxbm.js";
6
+ import"./index-qc0tnhs2.js";
7
+ import"./index-sh01r3pm.js";
8
8
  import {
9
9
  renderPrimitiveReport
10
- } from "./index-rzwcpcc3.js";
11
- import"./index-tdbas9r0.js";
10
+ } from "./index-tsmjxph2.js";
11
+ import"./index-j37qq1f2.js";
12
12
  import {
13
13
  Module,
14
14
  Sys,
15
15
  command
16
- } from "./index-8hsbnyes.js";
17
- import"./index-hgna5rjy.js";
16
+ } from "./index-n706txcv.js";
17
+ import"./index-8vkkm7v0.js";
18
18
  import"./index-mxvakhsm.js";
19
+ import"./index-1577bej2.js";
19
20
  import"./index-67546d0j.js";
20
- import"./index-r24hmh0q.js";
21
+ import"./index-yb2wsc7f.js";
21
22
 
22
23
  // pkgs/@akanjs/cli/module/module.command.ts
23
24
  import { Logger, lowerlize } from "akanjs/common";
@@ -1,17 +1,18 @@
1
1
  // @bun
2
2
  import {
3
3
  PackageScript
4
- } from "./index-k95xkh4p.js";
4
+ } from "./index-33zce8gt.js";
5
5
  import {
6
6
  Pkg,
7
7
  Workspace,
8
8
  command
9
- } from "./index-8hsbnyes.js";
10
- import"./index-hgna5rjy.js";
9
+ } from "./index-n706txcv.js";
10
+ import"./index-8vkkm7v0.js";
11
11
  import"./index-mxvakhsm.js";
12
+ import"./index-1577bej2.js";
12
13
  import"./index-46tjzh6s.js";
13
14
  import"./index-67546d0j.js";
14
- import"./index-r24hmh0q.js";
15
+ import"./index-yb2wsc7f.js";
15
16
 
16
17
  // pkgs/@akanjs/cli/package/package.command.ts
17
18
  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.0.0-alpha.3",
3
+ "version": "3.0.0-alpha.31",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -14,7 +14,7 @@
14
14
  "directory": "pkgs/@akanjs/cli"
15
15
  },
16
16
  "engines": {
17
- "bun": ">=1.3.13"
17
+ "bun": ">=1.4.0"
18
18
  },
19
19
  "bin": {
20
20
  "akan": "./index.js",
@@ -34,7 +34,7 @@
34
34
  "@langchain/openai": "^1.4.6",
35
35
  "@tailwindcss/node": "^4.3.0",
36
36
  "@trapezedev/project": "^7.1.4",
37
- "akanjs": "3.0.0-alpha.3",
37
+ "akanjs": "3.0.0-alpha.31",
38
38
  "chalk": "^5.6.2",
39
39
  "commander": "^14.0.3",
40
40
  "dayjs": "^1.11.20",
@@ -42,7 +42,6 @@
42
42
  "fonteditor-core": "^2.6.3",
43
43
  "ignore": "^7.0.5",
44
44
  "ink": "^6.8.0",
45
- "js-yaml": "^4.1.1",
46
45
  "ora": "^9.4.0",
47
46
  "qrcode": "^1.5.4",
48
47
  "react": "19.2.7",
@@ -1,16 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  PageScript
4
- } from "./index-bbkek1bp.js";
4
+ } from "./index-qc0tnhs2.js";
5
5
  import {
6
6
  App,
7
7
  Module,
8
8
  command
9
- } from "./index-8hsbnyes.js";
10
- import"./index-hgna5rjy.js";
9
+ } from "./index-n706txcv.js";
10
+ import"./index-8vkkm7v0.js";
11
11
  import"./index-mxvakhsm.js";
12
+ import"./index-1577bej2.js";
12
13
  import"./index-67546d0j.js";
13
- import"./index-r24hmh0q.js";
14
+ import"./index-yb2wsc7f.js";
14
15
 
15
16
  // pkgs/@akanjs/cli/page/page.command.ts
16
17
  class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
@@ -1,23 +1,24 @@
1
1
  // @bun
2
2
  import {
3
3
  PrimitiveScript
4
- } from "./index-bekddz9q.js";
5
- import"./index-yzmhasdb.js";
6
- import"./index-bbkek1bp.js";
4
+ } from "./index-9jsnb4vw.js";
5
+ import"./index-mykmf6wd.js";
7
6
  import"./index-ss469dec.js";
8
- import"./index-0cj2zxbm.js";
7
+ import"./index-qc0tnhs2.js";
8
+ import"./index-sh01r3pm.js";
9
9
  import {
10
10
  renderPrimitiveReport
11
- } from "./index-rzwcpcc3.js";
12
- import"./index-tdbas9r0.js";
11
+ } from "./index-tsmjxph2.js";
12
+ import"./index-j37qq1f2.js";
13
13
  import {
14
14
  Workspace,
15
15
  command
16
- } from "./index-8hsbnyes.js";
17
- import"./index-hgna5rjy.js";
16
+ } from "./index-n706txcv.js";
17
+ import"./index-8vkkm7v0.js";
18
18
  import"./index-mxvakhsm.js";
19
+ import"./index-1577bej2.js";
19
20
  import"./index-67546d0j.js";
20
- import"./index-r24hmh0q.js";
21
+ import"./index-yb2wsc7f.js";
21
22
 
22
23
  // pkgs/@akanjs/cli/primitive/primitive.command.ts
23
24
  import { Logger } from "akanjs/common";
@@ -7,16 +7,21 @@ import {
7
7
  command,
8
8
  runner,
9
9
  script
10
- } from "./index-8hsbnyes.js";
11
- import"./index-hgna5rjy.js";
10
+ } from "./index-n706txcv.js";
11
+ import {
12
+ appRootAllowedFiles,
13
+ libFacetRootAllowedFiles
14
+ } from "./index-8vkkm7v0.js";
12
15
  import"./index-mxvakhsm.js";
16
+ import"./index-1577bej2.js";
13
17
  import"./index-67546d0j.js";
14
- import"./index-r24hmh0q.js";
18
+ import"./index-yb2wsc7f.js";
15
19
 
16
20
  // pkgs/@akanjs/devkit/qualityScanner.ts
17
21
  import { createHash } from "crypto";
18
22
  import { readdir, readFile, stat } from "fs/promises";
19
23
  import path from "path";
24
+ import { RESERVED_ROUTE_CONFIG_EXPORTS } from "akanjs/common";
20
25
  import ignore from "ignore";
21
26
  import ts2 from "typescript";
22
27
 
@@ -404,27 +409,6 @@ var SUGGESTED_RULES = [
404
409
  "Move shared app utilities to apps/*/common instead of creating apps/*/base.",
405
410
  "Avoid large mixed-purpose class files; class export files should import helpers from neighboring utility files instead of declaring them inline."
406
411
  ];
407
- var APP_ROOT_FILES = new Set([
408
- "akan.app.json",
409
- "akan.config.ts",
410
- "capacitor.config.ts",
411
- "client.ts",
412
- "main.ts",
413
- "package.json",
414
- "server.ts",
415
- "tsconfig.json"
416
- ]);
417
- var LIB_ROOT_FILES = new Set([
418
- "cnst.ts",
419
- "db.ts",
420
- "dict.ts",
421
- "option.ts",
422
- "sig.ts",
423
- "srv.ts",
424
- "st.ts",
425
- "useClient.ts",
426
- "useServer.ts"
427
- ]);
428
412
  var CONVENTION_SUFFIXES = [
429
413
  ".constant.ts",
430
414
  ".dictionary.ts",
@@ -433,20 +417,6 @@ var CONVENTION_SUFFIXES = [
433
417
  ".signal.ts",
434
418
  ".store.ts"
435
419
  ];
436
- var PAGE_RESERVED_EXPORTS = new Set([
437
- "pageConfig",
438
- "head",
439
- "metadata",
440
- "generateHead",
441
- "generateMetadata",
442
- "fonts",
443
- "manifest",
444
- "theme",
445
- "reconnect",
446
- "wsConnect",
447
- "layoutStyle",
448
- "gaTrackingId"
449
- ]);
450
420
  var RULE_FIXES = {
451
421
  "akan.global.duplicate-exported-function-name": "Rename one of the exports, or if they are the same thing, extract it into one shared module and import it in both places.",
452
422
  "akan.global.duplicate-exported-function-body": "Extract the shared implementation into a single exported helper and import it, instead of copying the body.",
@@ -703,7 +673,7 @@ class AkanQualityScanner {
703
673
  #scanLayoutQuality(sourceFile) {
704
674
  const segments = sourceFile.file.split("/");
705
675
  const warnings = [];
706
- if (segments[0] === "apps" && segments.length === 3 && !APP_ROOT_FILES.has(segments[2])) {
676
+ if (segments[0] === "apps" && segments.length === 3 && !appRootAllowedFiles.has(segments[2])) {
707
677
  warnings.push({
708
678
  rule: "akan.layout.app-root-file",
709
679
  scope: "layout",
@@ -713,7 +683,7 @@ class AkanQualityScanner {
713
683
  });
714
684
  }
715
685
  const libRootFile = getLibRootFile(sourceFile.file);
716
- if (libRootFile && !LIB_ROOT_FILES.has(libRootFile)) {
686
+ if (libRootFile && !libFacetRootAllowedFiles.has(libRootFile)) {
717
687
  warnings.push({
718
688
  rule: "akan.layout.lib-root-file",
719
689
  scope: "layout",
@@ -929,7 +899,7 @@ function isRestrictedInternalKind(kind) {
929
899
  function isAllowedComponentExport(declaration, isPage) {
930
900
  if (isComponentValueKind(declaration.kind) && isPascalCaseName(declaration.name))
931
901
  return true;
932
- return isPage && PAGE_RESERVED_EXPORTS.has(declaration.name);
902
+ return isPage && RESERVED_ROUTE_CONFIG_EXPORTS.has(declaration.name);
933
903
  }
934
904
  function isPascalCaseName(name) {
935
905
  return /^[A-Z]/.test(name) && !/^[A-Z0-9_]+$/.test(name);
@@ -4,9 +4,9 @@ import {
4
4
  findInlineRecipeDuplicates,
5
5
  scanRecipes
6
6
  } from "./index-xys926f2.js";
7
- import"./index-r24hmh0q.js";
7
+ import"./index-yb2wsc7f.js";
8
8
  export {
9
- scanRecipes,
9
+ collectRecipeSources,
10
10
  findInlineRecipeDuplicates,
11
- collectRecipeSources
11
+ scanRecipes
12
12
  };
@@ -1,19 +1,20 @@
1
1
  // @bun
2
2
  import {
3
3
  RepairRunner
4
- } from "./index-mr5s7mqd.js";
5
- import"./index-a00jg8x8.js";
6
- import"./index-rzwcpcc3.js";
4
+ } from "./index-xyrb7pk5.js";
5
+ import"./index-g9e2fhw2.js";
6
+ import"./index-tsmjxph2.js";
7
7
  import {
8
8
  Workspace,
9
9
  command,
10
10
  script
11
- } from "./index-8hsbnyes.js";
12
- import"./index-hgna5rjy.js";
11
+ } from "./index-n706txcv.js";
12
+ import"./index-8vkkm7v0.js";
13
13
  import"./index-mxvakhsm.js";
14
14
  import"./index-xys926f2.js";
15
+ import"./index-1577bej2.js";
15
16
  import"./index-67546d0j.js";
16
- import"./index-r24hmh0q.js";
17
+ import"./index-yb2wsc7f.js";
17
18
 
18
19
  // pkgs/@akanjs/cli/repair/repair.script.ts
19
20
  import { Logger } from "akanjs/common";
@@ -1,50 +1,14 @@
1
1
  // @bun
2
- import"./index-r24hmh0q.js";
2
+ import"./index-yb2wsc7f.js";
3
3
 
4
4
  // pkgs/@akanjs/devkit/routeSourceValidator.ts
5
+ import { getRouteExports } from "akanjs/common";
5
6
  import ts from "typescript";
6
7
 
7
8
  class RouteSourceValidator {
8
- static #pageExports = new Set([
9
- "default",
10
- "pageConfig",
11
- "head",
12
- "metadata",
13
- "generateHead",
14
- "generateMetadata",
15
- "Loading"
16
- ]);
17
- static #rootLayoutExports = new Set([
18
- "default",
19
- "pageConfig",
20
- "head",
21
- "metadata",
22
- "generateHead",
23
- "generateMetadata",
24
- "fonts",
25
- "manifest",
26
- "theme",
27
- "reconnect",
28
- "layoutStyle",
29
- "gaTrackingId",
30
- "Loading",
31
- "NotFound",
32
- "Error"
33
- ]);
34
- static #layoutExports = new Set([
35
- "default",
36
- "pageConfig",
37
- "head",
38
- "metadata",
39
- "generateHead",
40
- "generateMetadata",
41
- "Loading",
42
- "NotFound",
43
- "Error"
44
- ]);
45
9
  static validateRouteSourceExports(source, filePath, kind, options = {}) {
46
10
  const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
47
- const allowed = kind === "page" ? RouteSourceValidator.#pageExports : options.rootLayout ? RouteSourceValidator.#rootLayoutExports : RouteSourceValidator.#layoutExports;
11
+ const allowed = getRouteExports(kind, { rootLayout: options.rootLayout });
48
12
  const exported = new Set;
49
13
  const assertExport = (name) => {
50
14
  if (!allowed.has(name)) {
@@ -1,21 +1,22 @@
1
1
  // @bun
2
2
  import {
3
3
  ScalarScript
4
- } from "./index-ec09pws3.js";
4
+ } from "./index-x33gnap3.js";
5
5
  import"./index-ss469dec.js";
6
- import"./index-0cj2zxbm.js";
6
+ import"./index-sh01r3pm.js";
7
7
  import {
8
8
  renderPrimitiveReport
9
- } from "./index-rzwcpcc3.js";
10
- import"./index-tdbas9r0.js";
9
+ } from "./index-tsmjxph2.js";
10
+ import"./index-j37qq1f2.js";
11
11
  import {
12
12
  Sys,
13
13
  command
14
- } from "./index-8hsbnyes.js";
15
- import"./index-hgna5rjy.js";
14
+ } from "./index-n706txcv.js";
15
+ import"./index-8vkkm7v0.js";
16
16
  import"./index-mxvakhsm.js";
17
+ import"./index-1577bej2.js";
17
18
  import"./index-67546d0j.js";
18
- import"./index-r24hmh0q.js";
19
+ import"./index-yb2wsc7f.js";
19
20
 
20
21
  // pkgs/@akanjs/cli/scalar/scalar.command.ts
21
22
  import { Logger, lowerlize } from "akanjs/common";
@@ -1,7 +1,3 @@
1
- import { getEnv } from "akanjs/base";
2
-
3
1
  import type { ModulesOptions } from "../lib/option";
4
2
 
5
- export const env: ModulesOptions = {
6
- ...getEnv(),
7
- };
3
+ export const env: ModulesOptions = {};
@@ -1,7 +1,3 @@
1
- import { getEnv } from "akanjs/base";
2
-
3
1
  import type { ModulesOptions } from "../lib/option";
4
2
 
5
- export const env: ModulesOptions = {
6
- ...getEnv(),
7
- };
3
+ export const env: ModulesOptions = {};
@@ -1,7 +1,3 @@
1
- import { getEnv } from "akanjs/base";
2
-
3
1
  import type { ModulesOptions } from "../lib/option";
4
2
 
5
- export const env: ModulesOptions = {
6
- ...getEnv(),
7
- };
3
+ export const env: ModulesOptions = {};
@@ -1,7 +1,3 @@
1
- import { getEnv } from "akanjs/base";
2
-
3
1
  import type { ModulesOptions } from "../lib/option";
4
2
 
5
- export const env: ModulesOptions = {
6
- ...getEnv(),
7
- };
3
+ export const env: ModulesOptions = {};
@@ -1,10 +1,10 @@
1
1
  @import "tailwindcss";
2
2
  @import "akanjs/ui/styles.css";
3
3
 
4
- /* 테마 시스템(브랜드-중립 기본 팔레트 · @theme inline 매핑 · dark 변형 · 런타임 data-theme 전환)은
5
- akanjs/ui/styles.css(프레임워크)가 전부 제공한다. 앱은 import 만으로 즉시 동작한다.
4
+ /* The theme system (brand-neutral default palette, @theme inline mapping, dark variant, and runtime
5
+ data-theme switching) is fully provided by akanjs/ui/styles.css. This app works from the import alone.
6
6
 
7
- 앱만의 브랜드 색을 쓰려면 아래처럼 토큰만 override 하면 된다:
7
+ To use this app's own brand colors, override the tokens like this:
8
8
 
9
9
  :root,
10
10
  [data-theme="dark"] {
@@ -3,7 +3,7 @@ import type { AppInfo, LibInfo } from "akanjs";
3
3
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { appName: string }) {
4
4
  return {
5
5
  filename: "AuthGuard.ts",
6
- content: `import type { Guard, SignalContext } from "akanjs/signal";
6
+ content: `import type { Guard, GuardScope, SignalContext } from "akanjs/signal";
7
7
 
8
8
  // ===== AuthGuard.ts =====
9
9
  // Convention: srvkit/ folder — server-only helpers, cannot import from client code.
@@ -14,10 +14,14 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { a
14
14
 
15
15
  export class SignedIn implements Guard {
16
16
  static name = "SignedIn";
17
+ // "account" — the verdict reads the caller and nothing about the call, so an MCP catalogue can evaluate it with
18
+ // no arguments and hide what this caller certainly cannot use. Required: "resource" is never evaluated for a
19
+ // listing, so a guard like this one marked that way would filter nothing.
20
+ static scope: GuardScope = "account";
17
21
 
18
22
  canPass(context: SignalContext): boolean {
19
- const user = context.getHttpContext<{ user?: { id: string } }>().req.user;
20
- return !!user;
23
+ // Reads the account the middleware resolved, so the same guard answers over HTTP, a websocket and MCP alike.
24
+ return !!context.get<{ id?: string }>("account");
21
25
  }
22
26
  }
23
27
 
@@ -25,9 +29,9 @@ export class SignedIn implements Guard {
25
29
  // Role-based guard: only allow users with a specific role
26
30
  // export class IsAdmin implements Guard {
27
31
  // static name = "IsAdmin";
32
+ // static scope: GuardScope = "account";
28
33
  // canPass(context: SignalContext): boolean {
29
- // const user = context.getHttpContext<{ user?: { role: string } }>().req.user;
30
- // return user?.role === "admin";
34
+ // return context.get<{ role?: string }>("account")?.role === "admin";
31
35
  // }
32
36
  // }
33
37
  `,
@@ -15,8 +15,9 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { a
15
15
 
16
16
  export class CurrentUserId implements InternalArg<string | null> {
17
17
  getArg(context: SignalContext): string | null {
18
- const user = context.getHttpContext<{ user?: { id: string } }>().req.user;
19
- return user?.id ?? null;
18
+ // \`context.get\` reads what the account middleware resolved, on every transport. Branching on
19
+ // \`getHttpContext()\` would return null for the same caller arriving over a websocket or MCP.
20
+ return context.get<{ id?: string }>("account")?.id ?? null;
20
21
  }
21
22
  }
22
23
 
@@ -24,7 +25,7 @@ export class CurrentUserId implements InternalArg<string | null> {
24
25
  // Inject current session language/locale
25
26
  // export class CurrentLocale implements InternalArg<string> {
26
27
  // getArg(context: SignalContext): string {
27
- // return context.getHttpContext<{ locale?: string }>().req.locale ?? "en";
28
+ // return context.get<string>("locale") ?? "en";
28
29
  // }
29
30
  // }
30
31
  `,
@@ -30,7 +30,7 @@ export default async function Page({ params }: PageProps) {
30
30
  </div>
31
31
  <Load.Edit
32
32
  className="flex flex-col items-center"
33
- slice={fetch.slice["${dict.model}InPublic"]}
33
+ slice={fetch.slice.${dict.model}InPublic}
34
34
  edit={${dict.model}Edit}
35
35
  type="form"
36
36
  onCancel="back"
@@ -25,7 +25,7 @@ export default function Page() {
25
25
  </div>
26
26
  <Load.Edit
27
27
  className="flex flex-col items-center"
28
- slice={fetch.slice["${dict.model}InPublic"]}
28
+ slice={fetch.slice.${dict.model}InPublic}
29
29
  edit={${dict.model}Form}
30
30
  type="form"
31
31
  onCancel="back"
@@ -20,7 +20,7 @@ export default async function Page() {
20
20
  <>
21
21
  <div className="animate-fadeIn flex items-center gap-4 px-4 pt-4">
22
22
  <div className="text-lg font-bold md:text-4xl">{l("${dict.model}.modelName")}</div>
23
- <Model.New className="inline-flex items-center gap-2 rounded-field px-3 py-1.5 text-sm transition-colors hover:bg-muted" slice={fetch.slice["${dict.model}InPublic"]} renderTitle="id">
23
+ <Model.New className="inline-flex items-center gap-2 rounded-field px-3 py-1.5 text-sm transition-colors hover:bg-muted" slice={fetch.slice.${dict.model}InPublic} renderTitle="id">
24
24
  <${dict.Model}.Template.General />
25
25
  </Model.New>
26
26
  </div>
@@ -5,12 +5,14 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
5
5
  const libs = scanInfo.getLibs();
6
6
  return {
7
7
  filename: "env.server.type.ts",
8
- content: `
9
- ${libs.length ? libs.map((lib) => `import { env as ${lib}Option } from "@libs/${lib}/server";`).join("\n") : 'import { getEnv } from "akanjs/base";'}
8
+ content: libs.length
9
+ ? `
10
+ ${libs.map((lib) => `import { env as ${lib}Option } from "@libs/${lib}/server";`).join("\n")}
10
11
 
11
12
  export const libEnv = {
12
- ${libs.length ? libs.map((lib) => ` ...${lib}Option,`).join("\n") : " ...getEnv(),"}
13
- };
14
- `,
13
+ ${libs.map((lib) => ` ...${lib}Option,`).join("\n")}
14
+ };`
15
+ : `
16
+ export const libEnv = {};`,
15
17
  };
16
18
  }
@@ -13,7 +13,7 @@ ${scalarModules.map((module) => `import { ${capitalize(module)} } from "./__scal
13
13
  ${databaseModules.length ? `import * as cnst from "./cnst";` : ""}
14
14
  ${databaseModules.map((module) => `import * as ${module}Db from "./${module}/${module}.document";`).join("\n")}
15
15
 
16
- ${libs.map((lib) => `export { db as ${lib} } from "@libs/${lib}/server";`).join("\n")}
16
+ ${libs.map((lib) => `export * as ${lib} from "@libs/${lib}/lib/db";`).join("\n")}
17
17
 
18
18
  ${databaseModules.map((module) => `class ${capitalize(module)}Input extends by(cnst.${capitalize(module)}Input) {}`).join("\n")}
19
19
  ${databaseModules.map((module) => `class ${capitalize(module)}Insight extends by(cnst.${capitalize(module)}Insight) {}`).join("\n")}
@@ -9,7 +9,7 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
9
9
  const libs = scanInfo.getLibs();
10
10
  return `
11
11
  import { makeDictionary, makeTrans, registerScalarTrans, registerServiceTrans, registerModelTrans${libs.length === 0 ? `, dictionary as base` : ""} } from "akanjs/dictionary";
12
- ${libs.length ? libs.map((lib) => `import { dictionary as ${lib} } from "@libs/${lib}/server";`).join("\n") : ""}
12
+ ${libs.length ? libs.map((lib) => `import { dictionary as ${lib} } from "@libs/${lib}/lib/dict";`).join("\n") : ""}
13
13
 
14
14
  ${databaseModules.map((module) => `import * as ${module} from "./${module}/${module}.dictionary";`).join("\n")}
15
15
  ${serviceModules.map((module) => `import * as ${module} from "./_${module}/${module}.dictionary";`).join("\n")}
@@ -17,7 +17,7 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
17
17
  return `
18
18
  import { FetchClient, type FetchClientType } from "akanjs/fetch";
19
19
  import { SignalRegistry, serverSignal${libs.length === 0 ? ", fetch as base" : ""} } from "akanjs/signal";
20
- ${libs.map((lib) => `import { fetch as ${lib} } from "@libs/${lib}/server";`).join("\n")}
20
+ ${libs.map((lib) => `import { fetch as ${lib} } from "@libs/${lib}/lib/sig";`).join("\n")}
21
21
 
22
22
  ${[...scanInfo.database.entries()]
23
23
  .filter(([_, files]) => files.has("signal"))
@@ -13,7 +13,11 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
13
13
  const libs = scanInfo.getLibs();
14
14
  return `
15
15
  import { ServiceModel } from "akanjs/service";
16
- ${libs.length ? libs.map((lib) => `import { option as ${lib} } from "@libs/${lib}/server";`).join("\n") : 'import type { BackendEnv } from "akanjs/base";'}
16
+ ${
17
+ libs.length
18
+ ? libs.map((lib) => `import * as ${lib} from "@libs/${lib}/lib/option";`).join("\n")
19
+ : 'import type { BackendEnv } from "akanjs/base";'
20
+ }
17
21
 
18
22
  import * as cnst from "./cnst";
19
23
  import * as db from "./db";
@@ -21,7 +25,7 @@ import * as db from "./db";
21
25
  ${databaseModules.map((module) => `import { ${capitalize(module)}Service } from "./${module}/${module}.service";`).join("\n")}
22
26
  ${serviceModules.map((module) => `import { ${capitalize(module)}Service } from "./_${module}/${module}.service";`).join("\n")}
23
27
 
24
- ${libs.map((lib) => `export { srv as ${lib} } from "@libs/${lib}/server";`).join("\n")}
28
+ ${libs.map((lib) => `export * as ${lib} from "@libs/${lib}/lib/srv";`).join("\n")}
25
29
 
26
30
  ${databaseModules.map((module) => `export { ${capitalize(module)}Service } from "./${module}/${module}.service";`).join("\n")}
27
31
  ${serviceModules.map((module) => `export { ${capitalize(module)}Service } from "./_${module}/${module}.service";`).join("\n")}