@akanjs/cli 3.0.0-alpha.2 → 3.0.0-alpha.20

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 (100) 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-rwkzxp5h.js} +8 -7
  6. package/{application.command-0qsczf4k.js → application.command-256kb89w.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-q8j5fsyj.js} +29 -26
  11. package/{cloud.command-dxfv18sa.js → cloud.command-nf3hwrqv.js} +10 -9
  12. package/{context.command-8d9e3k6b.js → context.command-cxhznb92.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-8hvqd21e.js} +7 -6
  16. package/guidelines/conventions/conventions.generate.json +25 -0
  17. package/guidelines/conventions/conventions.instruction.md +909 -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 +4 -3
  23. package/index-1577bej2.js +7 -0
  24. package/{index-1pvex4az.js → index-2gja8hqt.js} +13 -13
  25. package/{index-2q1f5j9k.js → index-4d30h52j.js} +3 -3
  26. package/{index-8hsbnyes.js → index-9bwhn99r.js} +5 -3
  27. package/{index-t3723f99.js → index-9e5tk85e.js} +86 -17
  28. package/{index-e16gnn26.js → index-a31wqqae.js} +13 -10
  29. package/{index-nm6wghb6.js → index-bv4f7dda.js} +6 -6
  30. package/{index-rzwcpcc3.js → index-daxfkf9r.js} +1 -1
  31. package/{index-ej426mcr.js → index-ewnssrss.js} +37 -6
  32. package/{index-yzmhasdb.js → index-gcfaehrb.js} +8 -8
  33. package/{index-a00jg8x8.js → index-gnbq9gjc.js} +49 -32
  34. package/{index-pyt2b4nw.js → index-hg0qvhmx.js} +152 -241
  35. package/{index-tdbas9r0.js → index-j37qq1f2.js} +1 -1
  36. package/{index-7c6k4yvg.js → index-kqxgymh9.js} +15 -7
  37. package/{index-ec09pws3.js → index-m82smx4n.js} +4 -4
  38. package/{index-rh16j3c7.js → index-qnv0aqmm.js} +12 -8
  39. package/{index-bbkek1bp.js → index-rnqk559q.js} +1 -1
  40. package/{index-hgna5rjy.js → index-scn3prb2.js} +142 -65
  41. package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
  42. package/{index-zasydjxd.js → index-w1a16c42.js} +9 -11
  43. package/{index-bekddz9q.js → index-wvkgs5sw.js} +4 -4
  44. package/{index-mr5s7mqd.js → index-x34wfyzw.js} +3 -3
  45. package/{index-k95xkh4p.js → index-xnan3a0m.js} +8 -4
  46. package/index.js +20 -19
  47. package/{library.command-ebdj1vnm.js → library.command-1399w0n2.js} +5 -4
  48. package/{localRegistry.command-gb178ne8.js → localRegistry.command-y5c91pbh.js} +9 -8
  49. package/{module.command-9c1bnsx4.js → module.command-qtyhk1m1.js} +9 -8
  50. package/{package.command-t93p4jkj.js → package.command-f8090yy2.js} +5 -4
  51. package/package.json +3 -4
  52. package/{page.command-k3k0meh2.js → page.command-cjf93cyj.js} +5 -4
  53. package/{primitive.command-de6nktdt.js → primitive.command-am2xjbgn.js} +10 -9
  54. package/{quality.command-z5kth2wa.js → quality.command-kxh7w9yy.js} +11 -41
  55. package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
  56. package/{repair.command-ehf2g112.js → repair.command-varzs4ry.js} +7 -6
  57. package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-7fycdqyv.js} +3 -39
  58. package/{scalar.command-7a2jtv33.js → scalar.command-0ag0zp8h.js} +8 -7
  59. package/templates/app/page/styles.css.template +3 -3
  60. package/templates/appSample/srvkit/AuthGuard.ts +9 -5
  61. package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
  62. package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
  63. package/templates/crudPages/new/page.tsx +1 -1
  64. package/templates/crudSinglePage/page.tsx +1 -1
  65. package/templates/lib/db.ts +1 -1
  66. package/templates/lib/dict.ts +1 -1
  67. package/templates/lib/sig.ts +1 -1
  68. package/templates/lib/srv.ts +6 -2
  69. package/templates/lib/useClient.ts +9 -3
  70. package/templates/module/__Model__.Util.tsx +1 -1
  71. package/templates/module/__Model__.Zone.tsx +3 -5
  72. package/templates/workspaceRoot/AGENTS.md.template +0 -955
  73. package/templates/workspaceRoot/CLAUDE.md.template +19 -0
  74. package/templates/workspaceRoot/biome.json.template +4 -198
  75. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
  76. package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
  77. package/typecheck.proc.js +1 -1
  78. package/{workflow.command-e0tt0vk2.js → workflow.command-ex77wvdb.js} +15 -14
  79. package/{workspace.command-fpda0evj.js → workspace.command-atxnxxea.js} +69 -51
  80. package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
  81. package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -33
  82. package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
  83. package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
  84. package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
  85. package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
  86. package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
  87. package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
  88. package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
  89. package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -18
  90. package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -61
  91. package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
  92. package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
  93. package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
  94. package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -58
  95. package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
  96. package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
  97. package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
  98. package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
  99. package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
  100. /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
@@ -4,19 +4,19 @@ import {
4
4
  } from "./index-ss469dec.js";
5
5
  import {
6
6
  AiSession
7
- } from "./index-0cj2zxbm.js";
7
+ } from "./index-sh01r3pm.js";
8
8
  import {
9
9
  createPassedPrimitiveReport,
10
10
  generatedFilesForSync,
11
11
  scalarChangedFiles
12
- } from "./index-rzwcpcc3.js";
12
+ } from "./index-daxfkf9r.js";
13
13
  import {
14
14
  Prompter
15
- } from "./index-tdbas9r0.js";
15
+ } from "./index-j37qq1f2.js";
16
16
  import {
17
17
  runner,
18
18
  script
19
- } from "./index-8hsbnyes.js";
19
+ } from "./index-9bwhn99r.js";
20
20
 
21
21
  // pkgs/@akanjs/cli/scalar/scalar.prompt.ts
22
22
  import { input } from "@inquirer/prompts";
@@ -849,6 +849,7 @@ class ClientEntriesBundler {
849
849
  #externalSubpaths;
850
850
  #externalAliases;
851
851
  #command;
852
+ #target;
852
853
  #outputSubdir;
853
854
  #reactFastRefresh;
854
855
  #artifactDir;
@@ -870,6 +871,7 @@ class ClientEntriesBundler {
870
871
  this.#externalSubpaths = options.externalSubpaths ?? [];
871
872
  this.#externalAliases = options.externalAliases ?? {};
872
873
  this.#command = options.command ?? "start";
874
+ this.#target = options.target ?? "browser";
873
875
  this.#outputSubdir = options.outputSubdir ?? "client";
874
876
  this.#reactFastRefresh = options.reactFastRefresh ?? false;
875
877
  this.#artifactDir = `${this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath}/.akan/artifact`;
@@ -883,7 +885,7 @@ class ClientEntriesBundler {
883
885
  entrypoints: this.#opaqueEntries.entries,
884
886
  outdir: this.#outdir,
885
887
  splitting: true,
886
- target: "browser",
888
+ target: this.#target,
887
889
  format: "esm",
888
890
  naming: CLIENT_BUNDLE_NAMING,
889
891
  metafile: true,
@@ -1117,7 +1119,8 @@ var VENDOR_SPECIFIERS = [
1117
1119
  "akanjs/store",
1118
1120
  "akanjs/base",
1119
1121
  "akanjs/common",
1120
- "akanjs/constant"
1122
+ "akanjs/constant",
1123
+ "akanjs/fetch"
1121
1124
  ];
1122
1125
 
1123
1126
  // pkgs/@akanjs/devkit/frontendBuild/routeClientBuilder.ts
@@ -1143,16 +1146,17 @@ class RouteClientBuilder {
1143
1146
  #knownEntries;
1144
1147
  #command;
1145
1148
  #discovery;
1149
+ #entries;
1146
1150
  constructor(options) {
1147
1151
  this.#app = options.app;
1148
1152
  this.#seeds = options.seeds;
1149
1153
  this.#knownEntries = options.knownEntries ?? new Set;
1150
1154
  this.#command = options.command ?? "start";
1151
1155
  this.#discovery = options.discovery;
1156
+ this.#entries = options.entries;
1152
1157
  }
1153
1158
  async build() {
1154
- const discovery = this.#discovery ?? await GraphClientEntryDiscovery.create(this.#app);
1155
- const discovered = await discovery.discover(this.#seeds);
1159
+ const discovered = this.#entries ?? await (this.#discovery ?? await GraphClientEntryDiscovery.create(this.#app)).discover(this.#seeds);
1156
1160
  const entries = discovered.filter((e) => !this.#knownEntries.has(e));
1157
1161
  if (entries.length === 0)
1158
1162
  return this.#emptyResult(discovered);
@@ -1225,12 +1229,11 @@ class RouteClientBuilder {
1225
1229
  }).bundle();
1226
1230
  }
1227
1231
  async#buildSsrBundle(bootstrapEntries) {
1228
- const externalOptions = RouteClientBuilder.resolveSsrClientExternalOptions(this.#command);
1229
1232
  return new ClientEntriesBundler({
1230
1233
  app: this.#app,
1231
1234
  entries: bootstrapEntries.buildEntries,
1232
1235
  plugins: [await createBarrelImportsPlugin(this.#app)],
1233
- ...externalOptions,
1236
+ ...RouteClientBuilder.resolveSsrClientBundleOptions(this.#command),
1234
1237
  outputSubdir: "client-ssr",
1235
1238
  command: this.#command
1236
1239
  }).bundle();
@@ -1292,15 +1295,16 @@ ${defaultNames.map((name) => `export default ${name};`).join(`
1292
1295
  const serverEntry = RouteClientBuilder.resolveAkanServerEntry();
1293
1296
  return { [Bun.resolveSync("akanjs/fetch", serverEntry)]: "akanjs/fetch" };
1294
1297
  }
1295
- static resolveSsrClientExternalOptions(command) {
1298
+ static resolveSsrClientBundleOptions(command) {
1296
1299
  if (command === "start") {
1297
1300
  return {
1301
+ target: "bun",
1298
1302
  external: SSR_CLIENT_EXTERNALS,
1299
1303
  externalSubpaths: ["akanjs/fetch"],
1300
1304
  externalAliases: RouteClientBuilder.resolveSsrClientRuntimeAliases()
1301
1305
  };
1302
1306
  }
1303
- return { external: SSR_CLIENT_ALIAS_EXTERNALS };
1307
+ return { target: "bun", external: SSR_CLIENT_ALIAS_EXTERNALS };
1304
1308
  }
1305
1309
  static resolveAkanServerEntry() {
1306
1310
  try {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-8hsbnyes.js";
5
+ } from "./index-9bwhn99r.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -2,12 +2,15 @@
2
2
  import {
3
3
  Spinner
4
4
  } from "./index-mxvakhsm.js";
5
+ import {
6
+ getDirname
7
+ } from "./index-1577bej2.js";
5
8
  import {
6
9
  FileSys
7
10
  } from "./index-67546d0j.js";
8
11
  import {
9
12
  __require
10
- } from "./index-r24hmh0q.js";
13
+ } from "./index-yb2wsc7f.js";
11
14
 
12
15
  // pkgs/@akanjs/devkit/executors.ts
13
16
  import {
@@ -41,9 +44,24 @@ import chalk2 from "chalk";
41
44
 
42
45
  // pkgs/@akanjs/devkit/agentsIndex.ts
43
46
  var recipeScannerLoad = null;
44
- var loadRecipeScanner = () => recipeScannerLoad ??= import("./recipeScanner-tghkzrrt.js");
47
+ var loadRecipeScanner = () => recipeScannerLoad ??= import("./recipeScanner-zrzev25x.js");
45
48
  var AGENT_BLOCK_START = "<!-- akan:agent:start -->";
46
49
  var AGENT_BLOCK_END = "<!-- akan:agent:end -->";
50
+ var AGENT_VERSION_PREFIX = "<!-- akan:agent:version ";
51
+ var stampBlockVersion = (block, version) => `${AGENT_VERSION_PREFIX}${version} -->
52
+
53
+ ${block}`;
54
+ var extractBlockVersion = (content) => content.match(/<!-- akan:agent:version ([^\s]+) -->/)?.[1] ?? null;
55
+ var readDevkitVersion = async () => {
56
+ const { readFile } = await import("fs/promises");
57
+ const { getDirname: getDirname2 } = await import("./getDirname-ka11hm7e.js");
58
+ try {
59
+ const raw = await readFile(`${getDirname2(import.meta.url)}/package.json`, "utf-8");
60
+ return JSON.parse(raw).version ?? null;
61
+ } catch {
62
+ return null;
63
+ }
64
+ };
47
65
  var upsertAgentBlock = (existing, block) => {
48
66
  const managed = `${AGENT_BLOCK_START}
49
67
  ${block}
@@ -137,9 +155,29 @@ ${AGENT_BLOCK_START}
137
155
  ${block}
138
156
  ${AGENT_BLOCK_END}
139
157
  `;
158
+ var CLAUDE_COMMENT_RULE = `## Comments \u2014 Overrides Your Default
159
+
160
+ Write **no comments** unless the comment passes the test below. This is the rule agents break most often here, so it
161
+ is repeated outside the guide: a diff that adds a comment the test rejects is a diff to redo.
162
+
163
+ Before typing \`//\`, \`/*\`, or a doc block, ask \u2014 **does this sentence carry a fact that is nowhere in the code?**
164
+
165
+ - Restates the identifier, the signature, or the line under it \u2192 delete it.
166
+ - Labels a section (\`// helpers\`, \`// state\`) or narrates a step (\`// fetch the user\`, \`// then save\`) \u2192 delete it.
167
+ - JSDoc on an ordinary function, or a why/how preamble on ordinary logic \u2192 delete it.
168
+ - Explains the edit you just made, for whoever reads the diff \u2192 say it in your reply, not in the file.
169
+ - Names a vendor or protocol quirk, an infrastructure constraint, a library gotcha, security reasoning, a math
170
+ derivation, a domain field's business meaning, a state transition, or why an obvious alternative was rejected \u2192
171
+ keep it, one line.
172
+
173
+ That keep-list is exact \u2014 \`Comments\` in the guide is the full version. "It aids readability" and "this logic is
174
+ subtle" are not on it: rename or split the code instead. When you edit an existing file, match its density; if the
175
+ surrounding code carries none, your diff carries none.`;
140
176
  var renderScopeClaudeMd = (scope) => `# ${scope.name} \u2014 Claude Code Guide
141
177
 
142
178
  @AGENTS.md
179
+
180
+ ${CLAUDE_COMMENT_RULE}
143
181
  `;
144
182
 
145
183
  // pkgs/@akanjs/devkit/akanConfig/akanConfig.ts
@@ -182,8 +220,6 @@ var DEFAULT_OPTIMIZE_IMPORTS = [
182
220
  ];
183
221
  var WORKSPACE_BARREL_FACETS = ["ui", "webkit", "common", "client", "server"];
184
222
  var SSR_RUNTIME_PACKAGES = ["react", "react-dom", "react-server-dom-webpack"];
185
- var NATIVE_RUNTIME_PACKAGES = ["sharp"];
186
- var DEFAULT_BACKEND_RUNTIME_PACKAGES = ["croner"];
187
223
  var MOBILE_RUNTIME_PACKAGES = [
188
224
  "@capacitor/cli",
189
225
  "@capacitor/core",
@@ -212,8 +248,6 @@ var DATABASE_MODE_RUNTIME_PACKAGES = {
212
248
  };
213
249
  var AKAN_RUNTIME_PACKAGES = new Set([
214
250
  ...SSR_RUNTIME_PACKAGES,
215
- ...NATIVE_RUNTIME_PACKAGES,
216
- ...DEFAULT_BACKEND_RUNTIME_PACKAGES,
217
251
  ...MOBILE_RUNTIME_PACKAGES,
218
252
  ...Object.values(DATABASE_MODE_RUNTIME_PACKAGES).flat()
219
253
  ]);
@@ -505,13 +539,7 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
505
539
  return akanPackageJson.dependencies?.[lib] ?? akanPackageJson.peerDependencies?.[lib];
506
540
  }
507
541
  #getProductionRuntimePackages() {
508
- return [
509
- ...this.externalLibs,
510
- ...SSR_RUNTIME_PACKAGES,
511
- ...NATIVE_RUNTIME_PACKAGES,
512
- ...DEFAULT_BACKEND_RUNTIME_PACKAGES,
513
- ...this.getDatabaseModeRuntimePackages()
514
- ];
542
+ return [...this.externalLibs, ...SSR_RUNTIME_PACKAGES, ...this.getDatabaseModeRuntimePackages()];
515
543
  }
516
544
  getDatabaseModeRuntimePackages(databaseMode = this.defaultDatabaseMode) {
517
545
  return [...DATABASE_MODE_RUNTIME_PACKAGES[databaseMode]];
@@ -627,42 +655,47 @@ var decreaseBuildNum = async (app) => {
627
655
  const akanConfigContent = akanConfig.replace(`buildNum: ${appConfig.mobile.buildNum}`, `buildNum: ${appConfig.mobile.buildNum - 1}`);
628
656
  fs.writeFileSync(akanConfigPath, akanConfigContent);
629
657
  };
630
- // pkgs/@akanjs/devkit/getDirname.ts
631
- import path2 from "path";
632
- import { fileURLToPath as fileURLToPath2 } from "url";
633
- var getDirname = (url) => path2.dirname(fileURLToPath2(url));
634
-
635
658
  // pkgs/@akanjs/devkit/linter.ts
636
659
  import { spawn } from "child_process";
637
660
  import { existsSync, readFileSync } from "fs";
638
- import path3 from "path";
661
+ import path2 from "path";
639
662
  import chalk from "chalk";
663
+ var BIOME_CONFIG_FILES = ["biome.json", "biome.jsonc"];
640
664
 
641
665
  class Linter {
642
666
  lintRoot;
667
+ configPath;
643
668
  #biomeBin;
644
669
  constructor(cwdPath) {
645
670
  this.lintRoot = this.#findBiomeRootPath(cwdPath);
646
- const localBiomeBin = path3.join(this.lintRoot, "node_modules/.bin/biome");
671
+ this.configPath = Linter.#configPathIn(this.lintRoot) ?? path2.join(this.lintRoot, "biome.json");
672
+ const localBiomeBin = path2.join(this.lintRoot, "node_modules/.bin/biome");
647
673
  this.#biomeBin = existsSync(localBiomeBin) ? localBiomeBin : "biome";
648
674
  }
675
+ static #configPathIn(dir) {
676
+ for (const fileName of BIOME_CONFIG_FILES) {
677
+ const configPath = path2.join(dir, fileName);
678
+ if (existsSync(configPath))
679
+ return configPath;
680
+ }
681
+ return null;
682
+ }
649
683
  #findBiomeRootPath(dir) {
650
- const configPath = path3.join(dir, "biome.json");
651
- if (existsSync(configPath))
684
+ if (Linter.#configPathIn(dir))
652
685
  return dir;
653
- const parentDir = path3.dirname(dir);
686
+ const parentDir = path2.dirname(dir);
654
687
  if (parentDir === dir)
655
688
  throw new Error(`biome.json not found from ${dir}`);
656
689
  return this.#findBiomeRootPath(parentDir);
657
690
  }
658
691
  #toBiomePath(filePath) {
659
- const relativePath = path3.relative(this.lintRoot, filePath);
660
- if (!relativePath.startsWith("..") && !path3.isAbsolute(relativePath))
692
+ const relativePath = path2.relative(this.lintRoot, filePath);
693
+ if (!relativePath.startsWith("..") && !path2.isAbsolute(relativePath))
661
694
  return relativePath;
662
695
  return filePath;
663
696
  }
664
697
  #resolveFilePath(filePath) {
665
- return path3.isAbsolute(filePath) ? filePath : path3.join(this.lintRoot, filePath);
698
+ return path2.isAbsolute(filePath) ? filePath : path2.join(this.lintRoot, filePath);
666
699
  }
667
700
  async#runBiome(args, input) {
668
701
  return await new Promise((resolve, reject) => {
@@ -694,7 +727,7 @@ class Linter {
694
727
  const diagnosticPath = diagnostic.location?.path;
695
728
  if (!diagnosticPath)
696
729
  return fallbackFilePath;
697
- return path3.isAbsolute(diagnosticPath) ? diagnosticPath : path3.join(this.lintRoot, diagnosticPath);
730
+ return path2.isAbsolute(diagnosticPath) ? diagnosticPath : path2.join(this.lintRoot, diagnosticPath);
698
731
  }
699
732
  #createLintMessage(diagnostic) {
700
733
  const start = diagnostic.location?.start;
@@ -759,7 +792,7 @@ class Linter {
759
792
  "--max-diagnostics=none",
760
793
  "--no-errors-on-unmatched",
761
794
  "--config-path",
762
- path3.join(this.lintRoot, "biome.json"),
795
+ this.configPath,
763
796
  this.#toBiomePath(filePath)
764
797
  ]);
765
798
  const report = this.#parseBiomeReport(stdout || stderr);
@@ -880,14 +913,7 @@ ${errorText}, ${warningText} found`];
880
913
  if (!dryRun)
881
914
  return await this.#checkFile(resolvedFilePath, { write: true });
882
915
  const source = readFileSync(resolvedFilePath, "utf8");
883
- const { stdout } = await this.#runBiome([
884
- "check",
885
- "--write",
886
- "--config-path",
887
- path3.join(this.lintRoot, "biome.json"),
888
- "--stdin-file-path",
889
- this.#toBiomePath(resolvedFilePath)
890
- ], source);
916
+ const { stdout } = await this.#runBiome(["check", "--write", "--config-path", this.configPath, "--stdin-file-path", this.#toBiomePath(resolvedFilePath)], source);
891
917
  const lintResult = await this.lintFile(resolvedFilePath);
892
918
  return { ...lintResult, fixed: stdout !== source, output: stdout };
893
919
  }
@@ -895,7 +921,7 @@ ${errorText}, ${warningText} found`];
895
921
  const resolvedFilePath = this.#resolveFilePath(filePath);
896
922
  if (!existsSync(resolvedFilePath))
897
923
  throw new Error(`File not found: ${filePath}`);
898
- return JSON.parse(readFileSync(path3.join(this.lintRoot, "biome.json"), "utf8"));
924
+ return JSON.parse(readFileSync(this.configPath, "utf8"));
899
925
  }
900
926
  async getProblematicRules(filePath) {
901
927
  const { results } = await this.lintFile(filePath);
@@ -910,22 +936,36 @@ ${errorText}, ${warningText} found`];
910
936
  }
911
937
  }
912
938
 
939
+ // pkgs/@akanjs/devkit/repoIdentity.ts
940
+ import { execFileSync } from "child_process";
941
+ import path3 from "path";
942
+ var resolved = new Map;
943
+ var readRemoteName = (workspaceRoot) => {
944
+ try {
945
+ const url = execFileSync("git", ["config", "--get", "remote.origin.url"], {
946
+ cwd: workspaceRoot,
947
+ encoding: "utf-8",
948
+ stdio: ["ignore", "pipe", "ignore"]
949
+ }).trim();
950
+ return url.replace(/\.git$/, "").split(/[/:]/).pop() || null;
951
+ } catch {
952
+ return null;
953
+ }
954
+ };
955
+ var resolveRepoName = (workspaceRoot) => {
956
+ const cached = resolved.get(workspaceRoot);
957
+ if (cached)
958
+ return cached;
959
+ const repoName = readRemoteName(workspaceRoot) ?? path3.basename(workspaceRoot);
960
+ resolved.set(workspaceRoot, repoName);
961
+ return repoName;
962
+ };
963
+
913
964
  // pkgs/@akanjs/devkit/scanInfo.ts
914
965
  import { rm } from "fs/promises";
915
966
  import path4 from "path";
916
- var databaseFileTypes = [
917
- "constant",
918
- "dictionary",
919
- "document",
920
- "service",
921
- "signal",
922
- "store",
923
- "template",
924
- "unit",
925
- "util",
926
- "view",
927
- "zone"
928
- ];
967
+
968
+ // pkgs/@akanjs/devkit/workspaceLayout.ts
929
969
  var appRootAllowedFiles = new Set([
930
970
  "AGENTS.md",
931
971
  "CLAUDE.md",
@@ -939,25 +979,25 @@ var appRootAllowedFiles = new Set([
939
979
  "tsconfig.json",
940
980
  "tsconfig.tsbuildinfo"
941
981
  ]);
942
- var generatedRootCapacitorConfigFiles = ["capacitor.config.js", "capacitor.config.json"];
943
982
  var appRootAllowedDirs = new Set([
944
983
  ".akan",
945
984
  "android",
985
+ "common",
946
986
  "env",
947
987
  "ios",
948
988
  "lib",
949
989
  "mobile",
950
990
  "page",
991
+ "plugin",
951
992
  "private",
952
993
  "public",
953
994
  "script",
954
- "ui",
995
+ "secrets",
955
996
  "srvkit",
956
- "webkit",
957
- "common",
958
- "secrets"
997
+ "ui",
998
+ "webkit"
959
999
  ]);
960
- var libRootAllowedFiles = new Set([
1000
+ var libFacetRootAllowedFiles = new Set([
961
1001
  "cnst.ts",
962
1002
  "db.ts",
963
1003
  "dict.ts",
@@ -968,6 +1008,23 @@ var libRootAllowedFiles = new Set([
968
1008
  "useClient.ts",
969
1009
  "useServer.ts"
970
1010
  ]);
1011
+ var isScannedAppRootEntry = (name) => !name.startsWith(".") || appRootAllowedDirs.has(name);
1012
+
1013
+ // pkgs/@akanjs/devkit/scanInfo.ts
1014
+ var databaseFileTypes = [
1015
+ "constant",
1016
+ "dictionary",
1017
+ "document",
1018
+ "service",
1019
+ "signal",
1020
+ "store",
1021
+ "template",
1022
+ "unit",
1023
+ "util",
1024
+ "view",
1025
+ "zone"
1026
+ ];
1027
+ var generatedRootCapacitorConfigFiles = ["capacitor.config.js", "capacitor.config.json"];
971
1028
  var internalLibDirs = new Set(["__lib", "__scalar"]);
972
1029
  var moduleNonUiFileTypes = {
973
1030
  database: new Set(["constant", "dictionary", "document", "service", "signal", "store"]),
@@ -981,9 +1038,9 @@ var moduleUiFileTypes = {
981
1038
  };
982
1039
  var testFilePattern = /\.(test|spec)\.(ts|tsx)$/;
983
1040
  var rootSignalTestFilePattern = /^[A-Za-z][A-Za-z0-9_-]*\.signal\.(test|spec)\.(ts|tsx)$/;
984
- var createDependencyScanner = async (exec) => (await import("./dependencyScanner-f6grrep3.js")).TypeScriptDependencyScanner.from(exec);
1041
+ var createDependencyScanner = async (exec) => (await import("./dependencyScanner-rbs2407b.js")).TypeScriptDependencyScanner.from(exec);
985
1042
  var isAllowedTestFile = (filename) => testFilePattern.test(filename);
986
- var isAllowedLibRootFile = (filename) => libRootAllowedFiles.has(filename) || rootSignalTestFilePattern.test(filename);
1043
+ var isAllowedLibRootFile = (filename) => libFacetRootAllowedFiles.has(filename) || rootSignalTestFilePattern.test(filename);
987
1044
  var getScanPath = (exec, relativePath) => path4.posix.join(`${exec.type}s`, exec.name, relativePath.split(path4.sep).join("/"));
988
1045
  async function clearGeneratedRootCapacitorConfigs(exec) {
989
1046
  if (exec.type !== "app")
@@ -1628,7 +1685,7 @@ class Executor {
1628
1685
  }));
1629
1686
  });
1630
1687
  proc.on("exit", (code, signal) => {
1631
- if (!!code || signal)
1688
+ if (code || signal)
1632
1689
  reject(new CommandExecutionError({
1633
1690
  command,
1634
1691
  cwd,
@@ -1726,7 +1783,7 @@ class Executor {
1726
1783
  }));
1727
1784
  });
1728
1785
  proc.on("exit", (code, signal) => {
1729
- if (!!code || signal)
1786
+ if (code || signal)
1730
1787
  reject(new CommandExecutionError({
1731
1788
  command: modulePath,
1732
1789
  args,
@@ -2022,7 +2079,7 @@ class Executor {
2022
2079
  return this._applyTemplate({ ...options, dict });
2023
2080
  }
2024
2081
  async getTypeChecker() {
2025
- const { TypeChecker } = await import("./typeChecker-kravn7ns.js");
2082
+ const { TypeChecker } = await import("./typeChecker-g6bh0xfv.js");
2026
2083
  this.typeChecker ??= new TypeChecker(this);
2027
2084
  return this.typeChecker;
2028
2085
  }
@@ -2103,7 +2160,7 @@ class WorkspaceExecutor extends Executor {
2103
2160
  static #execs = new Map;
2104
2161
  static fromRoot({
2105
2162
  workspaceRoot = process.cwd(),
2106
- repoName = path5.basename(process.cwd())
2163
+ repoName = resolveRepoName(workspaceRoot)
2107
2164
  } = {}) {
2108
2165
  return WorkspaceExecutor.#execs.get(repoName) ?? new WorkspaceExecutor({ workspaceRoot, repoName });
2109
2166
  }
@@ -2475,11 +2532,12 @@ class SysExecutor extends Executor {
2475
2532
  return fileContents;
2476
2533
  }
2477
2534
  }
2535
+ var bootAppName = process.env.AKAN_PUBLIC_APP_NAME;
2478
2536
 
2479
2537
  class AppExecutor extends SysExecutor {
2480
2538
  static #routeSourceValidator = null;
2481
2539
  static async#getRouteSourceValidator() {
2482
- AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-cncd92fv.js")).RouteSourceValidator;
2540
+ AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-7fycdqyv.js")).RouteSourceValidator;
2483
2541
  return AppExecutor.#routeSourceValidator;
2484
2542
  }
2485
2543
  dist;
@@ -2527,6 +2585,23 @@ class AppExecutor extends SysExecutor {
2527
2585
  ...env
2528
2586
  };
2529
2587
  }
2588
+ static shouldRelaunchForAppEnv(appName, bootName = bootAppName, marker = process.env.AKAN_BUILD_RELAUNCHED) {
2589
+ if (marker === "1")
2590
+ return false;
2591
+ return bootName !== appName;
2592
+ }
2593
+ async relaunchWithAppEnv() {
2594
+ if (!AppExecutor.shouldRelaunchForAppEnv(this.name))
2595
+ return null;
2596
+ console.info(`Relaunching with AKAN_PUBLIC_APP_NAME=${this.name} so bundler macros see the app env.`);
2597
+ const child = Bun.spawn([process.execPath, ...process.argv.slice(1)], {
2598
+ env: { ...this.getCommandEnv(), AKAN_PUBLIC_APP_NAME: this.name, AKAN_BUILD_RELAUNCHED: "1" },
2599
+ stdin: "inherit",
2600
+ stdout: "inherit",
2601
+ stderr: "inherit"
2602
+ });
2603
+ return await child.exited;
2604
+ }
2530
2605
  async prepareCommand(type) {
2531
2606
  const akanConfig2 = await this.getConfig();
2532
2607
  const databaseMode = process.env.AKAN_DATABASE_MODE ?? akanConfig2.defaultDatabaseMode ?? "single";
@@ -2547,6 +2622,8 @@ class AppExecutor extends SysExecutor {
2547
2622
  ]);
2548
2623
  } else
2549
2624
  await this.removeDir(".akan");
2625
+ if (type === "start")
2626
+ process.env.NODE_ENV = "development";
2550
2627
  const devPort = type === "start" ? (await this.getDevPort()).toString() : undefined;
2551
2628
  const env = this.getCommandEnv({
2552
2629
  AKAN_COMMAND_TYPE: type,
@@ -2960,7 +3037,7 @@ class PkgExecutor extends Executor {
2960
3037
  default: "./index.ts"
2961
3038
  }
2962
3039
  },
2963
- engines: { bun: ">=1.3.13" },
3040
+ engines: { bun: ">=1.4.0" },
2964
3041
  ...dependencyMaps
2965
3042
  };
2966
3043
  await Promise.all([this.dist.writeJson("package.json", distPkgJson), this.writeJson("package.json", distPkgJson)]);
@@ -3003,4 +3080,4 @@ class ModuleExecutor extends Executor {
3003
3080
  }
3004
3081
  }
3005
3082
 
3006
- export { AGENT_BLOCK_START, AGENT_BLOCK_END, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, getDirname, CommandExecutionError, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
3083
+ export { AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, CLAUDE_COMMENT_RULE, appRootAllowedFiles, appRootAllowedDirs, libFacetRootAllowedFiles, isScannedAppRootEntry, CommandExecutionError, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
@@ -240,7 +240,7 @@ import { ChatOpenAI } from "@langchain/openai";
240
240
  import { Logger } from "akanjs/common";
241
241
  import chalk from "chalk";
242
242
  var MAX_ASK_TRY = 300;
243
- var deepSeekLlmModels = ["deepseek-chat", "deepseek-reasoner"];
243
+ var deepSeekLlmModels = ["deepseek-v4-flash", "deepseek-v4-pro"];
244
244
  var openAiLlmModels = ["gpt-5.5"];
245
245
  var supportedLlmModels = [...deepSeekLlmModels, ...openAiLlmModels];
246
246
  var isOpenAiLlmModel = (model) => openAiLlmModels.includes(model);
@@ -4,24 +4,17 @@ import {
4
4
  CloudApi,
5
5
  GlobalConfig,
6
6
  getDefaultHostConfig
7
- } from "./index-0cj2zxbm.js";
7
+ } from "./index-sh01r3pm.js";
8
8
  import {
9
9
  openBrowser
10
- } from "./index-e16gnn26.js";
10
+ } from "./index-a31wqqae.js";
11
11
  import {
12
12
  runner
13
- } from "./index-8hsbnyes.js";
13
+ } from "./index-9bwhn99r.js";
14
14
  import {
15
15
  AppExecutor,
16
16
  WorkspaceExecutor
17
- } from "./index-hgna5rjy.js";
18
-
19
- // pkgs/@akanjs/cli/cloud/cloud.runner.ts
20
- import path from "path";
21
- import { confirm, input, select } from "@inquirer/prompts";
22
- import { Logger, sleep } from "akanjs/common";
23
- import chalk from "chalk";
24
- import * as QRcode from "qrcode";
17
+ } from "./index-scn3prb2.js";
25
18
 
26
19
  // pkgs/@akanjs/cli/npmRegistry.ts
27
20
  var defaultNpmRegistry = "https://registry.npmjs.org";
@@ -40,6 +33,11 @@ async function getLatestPackageVersion(packageName, tag = "latest", registryUrl)
40
33
  }
41
34
 
42
35
  // pkgs/@akanjs/cli/cloud/cloud.runner.ts
36
+ import path from "path";
37
+ import { confirm, input, select } from "@inquirer/prompts";
38
+ import { Logger, sleep } from "akanjs/common";
39
+ import chalk from "chalk";
40
+ import * as QRcode from "qrcode";
43
41
  var addRemoteEnvServerValue = "__addRemoteEnvServer";
44
42
  var removeRemoteEnvServerValue = "__removeRemoteEnvServer";
45
43
 
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ModuleScript
4
- } from "./index-yzmhasdb.js";
4
+ } from "./index-gcfaehrb.js";
5
5
  import {
6
6
  addFieldUiPolicyForType,
7
7
  coerceFieldDefault,
@@ -34,15 +34,15 @@ import {
34
34
  sourceFile,
35
35
  validationCommandsForTarget,
36
36
  viaBuilderParameterName
37
- } from "./index-rzwcpcc3.js";
37
+ } from "./index-daxfkf9r.js";
38
38
  import {
39
39
  script
40
- } from "./index-8hsbnyes.js";
40
+ } from "./index-9bwhn99r.js";
41
41
  import {
42
42
  AppExecutor,
43
43
  LibExecutor,
44
44
  ModuleExecutor
45
- } from "./index-hgna5rjy.js";
45
+ } from "./index-scn3prb2.js";
46
46
 
47
47
  // pkgs/@akanjs/cli/primitive/primitive.script.ts
48
48
  import { capitalize } from "akanjs/common";
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  AkanContextAnalyzer
4
- } from "./index-a00jg8x8.js";
4
+ } from "./index-gnbq9gjc.js";
5
5
  import {
6
6
  createRepairReport,
7
7
  generatedFilePathsForTarget,
8
8
  renderRepairReport,
9
9
  writeGeneratedSyncState,
10
10
  writeWorkflowRunArtifact
11
- } from "./index-rzwcpcc3.js";
11
+ } from "./index-daxfkf9r.js";
12
12
  import {
13
13
  runner
14
- } from "./index-8hsbnyes.js";
14
+ } from "./index-9bwhn99r.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/repair/repair.runner.ts
17
17
  var commandForShell = (command) => command.startsWith("akan ") ? `bun run ${command}` : command;
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-8hsbnyes.js";
5
+ } from "./index-9bwhn99r.js";
6
6
  import {
7
7
  PkgExecutor
8
- } from "./index-hgna5rjy.js";
8
+ } from "./index-scn3prb2.js";
9
9
  import {
10
10
  TypeScriptDependencyScanner
11
11
  } from "./index-46tjzh6s.js";
@@ -163,13 +163,17 @@ class PackageRunner extends runner("package") {
163
163
  "tailwind-scrollbar"
164
164
  ].filter((dep) => dep !== "akanjs" && dep !== "@akanjs/devkit");
165
165
  }
166
- const bundledRuntimeDeps = new Set(pkg.name === "@akanjs/cli" ? ["@akanjs/devkit"] : []);
166
+ const packageBundledRuntimeDependencies = {
167
+ "@akanjs/cli": ["@akanjs/devkit"],
168
+ akanjs: ["use-agentic"]
169
+ };
170
+ const bundledRuntimeDeps = new Set(packageBundledRuntimeDependencies[pkg.name] ?? []);
167
171
  const forcedRuntimeDeps = packageRuntimeDependencies[pkg.name] ?? [];
168
172
  const forcedRuntimeDevDeps = packageRuntimeDevDependencies[pkg.name] ?? [];
169
173
  const [rootPackageJson, pkgJson] = await Promise.all([pkg.workspace.getPackageJson(), pkg.getPackageJson()]);
170
174
  const optionalPeerDeps = new Set(Object.entries(pkgJson.peerDependenciesMeta ?? {}).filter(([, meta]) => meta.optional).map(([dep]) => dep));
171
175
  const packageRuntimeDeps = [...new Set([...npmDeps, ...forcedRuntimeDeps])].filter((dep) => !optionalPeerDeps.has(dep) && !bundledRuntimeDeps.has(dep));
172
- const packageRuntimeDevDeps = [...new Set([...npmDevDeps, ...forcedRuntimeDevDeps])].filter((dep) => !optionalPeerDeps.has(dep));
176
+ const packageRuntimeDevDeps = [...new Set([...npmDevDeps, ...forcedRuntimeDevDeps])].filter((dep) => !optionalPeerDeps.has(dep) && !bundledRuntimeDeps.has(dep));
173
177
  const rootDeps = { ...rootPackageJson.dependencies, ...rootPackageJson.devDependencies };
174
178
  const missingForcedDeps = forcedRuntimeDeps.filter((dep) => !rootDeps[dep]);
175
179
  const missingForcedDevDeps = forcedRuntimeDevDeps.filter((dep) => !rootDeps[dep]);