@akanjs/cli 3.2.0-rc.31 → 3.2.0-rc.32

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 (94) hide show
  1. package/.build-stamp +2 -2
  2. package/{CodeAgent-c17abdbf.js → CodeAgent-7m6cmdf8.js} +2 -2
  3. package/{CodeTui-jed1nj82.js → CodeTui-c6de37ea.js} +1 -1
  4. package/README.ko.md +7 -0
  5. package/README.md +7 -0
  6. package/TunnelShare-9ry4vh0y.js +18 -0
  7. package/{agent.command-9whnc6vb.js → agent.command-3qstwjef.js} +26 -21
  8. package/akanCode.js +2 -2
  9. package/{appExecutor-020cyesq.js → appExecutor-79azsb2w.js} +3 -3
  10. package/{application.command-4eqvyxkw.js → application.command-8y4kxzvc.js} +36 -24
  11. package/{applicationBuildRunner-frtcrqfd.js → applicationBuildRunner-trfxv3pd.js} +43 -15
  12. package/buildBatch.proc.js +10 -10
  13. package/{cloud.command-hbvmeezn.js → cloud.command-zczv575c.js} +28 -28
  14. package/cloud.script-t268m15f.js +35 -0
  15. package/{code.command-0ayrenk4.js → code.command-069wchwn.js} +10 -10
  16. package/context.command-v3e98f2h.js +64 -0
  17. package/context.runner-3jr6chgz.js +34 -0
  18. package/{guideline.command-w1grfwh7.js → guideline.command-zwypaqsh.js} +7 -7
  19. package/guidelines/errorCodes/errorCodes.instruction.md +1 -0
  20. package/guidelines/mcpRule/mcpRule.instruction.md +87 -27
  21. package/guidelines/queryRule/queryRule.instruction.md +3 -1
  22. package/guidelines/runtimeRule/runtimeRule.instruction.md +7 -3
  23. package/guidelines/transportRule/transportRule.instruction.md +28 -0
  24. package/incrementalBuilder.proc.js +12 -9
  25. package/{index-5d57kx0s.js → index-275a4r3n.js} +3 -3
  26. package/{index-6zb17wcm.js → index-2jmvfa62.js} +3 -3
  27. package/{index-9rv2zt48.js → index-2yn3r67f.js} +78 -25
  28. package/{index-6pxmcaq8.js → index-3txdtztz.js} +1 -1
  29. package/{index-nm7nt9vm.js → index-4ss4gkv3.js} +2 -2
  30. package/{index-9wab2ngg.js → index-612fdtbk.js} +1 -1
  31. package/{index-7bs463x7.js → index-6dzjer7p.js} +6 -6
  32. package/{index-qssq2d41.js → index-71y6176j.js} +11 -6
  33. package/{index-4st0hq72.js → index-73x6z7ym.js} +24 -17
  34. package/{index-vjbne22r.js → index-7wf8snar.js} +1 -1
  35. package/{index-yvzm8mby.js → index-9wh04mqy.js} +1 -1
  36. package/{index-yxkjsyx8.js → index-a860mx0m.js} +2 -2
  37. package/{index-42jhx2ya.js → index-b2sdtgc7.js} +3 -3
  38. package/{index-1pjwsh2g.js → index-baccvws5.js} +1 -1
  39. package/{index-99kjwyma.js → index-c669pbyb.js} +4 -3
  40. package/{index-prgvqqxe.js → index-cd839jw2.js} +126 -113
  41. package/{index-6469101k.js → index-dadwp2aw.js} +33 -98
  42. package/{index-7v7tvgt7.js → index-dmcpetwe.js} +123 -43
  43. package/{index-ba2xd32s.js → index-e9w8wq0a.js} +27 -22
  44. package/{index-fp5xf6ef.js → index-ebn9kgea.js} +3 -3
  45. package/{index-s3m89wt2.js → index-exzkev4k.js} +7 -7
  46. package/{index-m5gg0wzv.js → index-gec8q5z9.js} +57 -30
  47. package/{index-m3t28rt3.js → index-gt8phqpt.js} +4 -4
  48. package/{index-g7jgd4xs.js → index-j592zfqc.js} +1 -1
  49. package/{index-cb91b6d8.js → index-jek2re5k.js} +3 -3
  50. package/{index-ffa52fwf.js → index-jf4vk1s0.js} +8 -1
  51. package/{index-v929w7j7.js → index-kykky4re.js} +59 -15
  52. package/{index-9wjrwjgz.js → index-nk374pqd.js} +8 -8
  53. package/{index-28nk8w3j.js → index-pk2ja04e.js} +8 -8
  54. package/{index-jgj31xvw.js → index-qcp6e2ht.js} +22 -5
  55. package/{index-at6haq2x.js → index-qyhr8wst.js} +61 -18
  56. package/{index-f16kr6vj.js → index-s885g0jj.js} +2 -2
  57. package/{index-bj8s07s7.js → index-t2zhw8c7.js} +4 -4
  58. package/{index-11d7nh8a.js → index-v7ajmsh3.js} +1 -1
  59. package/{index-dss3ds74.js → index-w1zexzpx.js} +1 -1
  60. package/{index-g45y5f3e.js → index-wzp3yg01.js} +1 -1
  61. package/{index-ze48c0vd.js → index-z92zm3wd.js} +2 -2
  62. package/{index-na8r4a27.js → index-zfnz878d.js} +1 -1
  63. package/{index-0gaj78wn.js → index-zmd9xxgd.js} +3 -3
  64. package/{index-p06kfhdf.js → index-zzebpyr0.js} +4 -4
  65. package/index.js +27 -27
  66. package/{libExecutor-tq994592.js → libExecutor-jc6f8hm6.js} +2 -2
  67. package/{library.command-x219mhcx.js → library.command-nxvesvhb.js} +11 -8
  68. package/{localRegistry.command-zvdcejhn.js → localRegistry.command-4a655xnq.js} +20 -20
  69. package/{module.command-k6cwcm7g.js → module.command-aaws9byg.js} +9 -9
  70. package/{package.command-vw7x09f8.js → package.command-j7hv26p0.js} +10 -10
  71. package/package.json +8 -8
  72. package/{page.command-gf06paq2.js → page.command-7yffs7n9.js} +7 -7
  73. package/{pipeline.command-y07dgj9b.js → pipeline.command-7yk0zcng.js} +8 -7
  74. package/{pkgExecutor-stde3yc3.js → pkgExecutor-arxmvx4t.js} +2 -2
  75. package/{primitive.command-edydvh07.js → primitive.command-7a1pt715.js} +10 -10
  76. package/{projectTypecheck-mk8wefvd.js → projectTypecheck-f4qhbecd.js} +1 -1
  77. package/{quality.command-mdb45vyr.js → quality.command-08bn42t4.js} +13 -10
  78. package/{repair.command-kvtaeecy.js → repair.command-r59jat74.js} +9 -9
  79. package/{scalar.command-sjt9p5e1.js → scalar.command-2ex84spb.js} +8 -8
  80. package/skills/akan-mcp/SKILL.md +6 -2
  81. package/skills/akan-validate/SKILL.md +3 -3
  82. package/{subspace.command-mkkqync4.js → subspace.command-2nxakmk3.js} +16 -13
  83. package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
  84. package/templates/workspaceRoot/README.ts +4 -2
  85. package/{tunnel.command-tr5b3030.js → tunnel.command-f7ep1qfa.js} +12 -12
  86. package/{typeChecker-bfrd1n9n.js → typeChecker-7jt6abrs.js} +1 -1
  87. package/typecheck.proc.js +3 -2
  88. package/{verify.command-0p9h8tpp.js → verify.command-xbztwp1r.js} +17 -17
  89. package/{workflow.command-9mfcwqzj.js → workflow.command-pmyx55y4.js} +18 -15
  90. package/{workspace.command-5hjtmcfs.js → workspace.command-89p90zvb.js} +36 -36
  91. package/TunnelShare-mbfcaqg0.js +0 -18
  92. package/cloud.script-9kmbr3d6.js +0 -35
  93. package/context.command-php852kf.js +0 -61
  94. package/context.runner-nngmn7c0.js +0 -34
@@ -5,24 +5,24 @@ import {
5
5
  import {
6
6
  Executor,
7
7
  WorkspaceExecutor
8
- } from "./index-qssq2d41.js";
8
+ } from "./index-71y6176j.js";
9
9
  import {
10
10
  getDirname2,
11
11
  FileSys2
12
12
  } from "./index-by2tvsq6.js";
13
13
  import {
14
14
  AppExecutor2
15
- } from "./index-ze48c0vd.js";
15
+ } from "./index-z92zm3wd.js";
16
16
  import {
17
17
  LibExecutor2
18
- } from "./index-na8r4a27.js";
18
+ } from "./index-zfnz878d.js";
19
19
  import {
20
20
  PkgExecutor2
21
- } from "./index-dss3ds74.js";
21
+ } from "./index-w1zexzpx.js";
22
22
  import {
23
23
  ModuleExecutor,
24
24
  ErrorReport
25
- } from "./index-vjbne22r.js";
25
+ } from "./index-7wf8snar.js";
26
26
 
27
27
  // pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
28
28
  var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
@@ -304,35 +304,46 @@ import { existsSync, readFileSync, realpathSync } from "fs";
304
304
  import path2 from "path";
305
305
 
306
306
  class WorkspaceVersionCheck {
307
+ static overrideEnv = "AKAN_ALLOW_VERSION_MISMATCH";
307
308
  static #exemptCommands = new Set(["update", "create-workspace"]);
308
309
  static #infoFlags = new Set(["--help", "-h", "--version", "-V"]);
309
310
  static #updateTags = new Set(["dev", "canary", "beta", "rc", "alpha"]);
310
311
  static warning(cliVersion, argv, workspaceRoot) {
311
- const args = argv.slice(2);
312
- if (!cliVersion || WorkspaceVersionCheck.#exemptCommands.has(args[0] ?? ""))
313
- return null;
314
- if (args.some((arg) => WorkspaceVersionCheck.#infoFlags.has(arg)))
315
- return null;
316
- const installed = WorkspaceVersionCheck.installedAkanVersion(workspaceRoot);
317
- if (!installed || installed === cliVersion)
312
+ const mismatch = WorkspaceVersionCheck.#mismatchOf(cliVersion, argv, workspaceRoot);
313
+ if (!mismatch)
318
314
  return null;
319
- const pinnedCli = WorkspaceVersionCheck.#versionAt(path2.join(workspaceRoot, "node_modules/@akanjs/cli"));
320
- const runner = pinnedCli === installed ? ["bunx"] : ["bunx", "-p", `@akanjs/cli@${installed}`];
321
- const rerun = [...runner, "akan", ...args].map(WorkspaceVersionCheck.#quote).join(" ");
322
- const [, prerelease = ""] = cliVersion.split("-");
323
- const tag = prerelease.split(".")[0];
324
- const update = `akan update${WorkspaceVersionCheck.#updateTags.has(tag) ? ` --tag ${tag}` : ""}`;
315
+ const { cliVersion: cli, installed, pinnedCli, rerun, update } = mismatch;
325
316
  const lines = [
326
- `This akan is @akanjs/cli ${cliVersion}, but this workspace has akanjs ${installed}: what it generates may not match the installed framework.`,
317
+ `This akan is @akanjs/cli ${cli}, but this workspace has akanjs ${installed}: what it generates may not match the installed framework.`,
327
318
  `Run the matching CLI: ${rerun}`
328
319
  ];
329
- if (Bun.semver.order(cliVersion, installed) > 0)
320
+ if (Bun.semver.order(cli, installed) > 0)
330
321
  lines.push(`Or move the workspace and this CLI to the newest release of the line together: ${update}`);
331
322
  else if (pinnedCli !== installed)
332
323
  lines.push(`Pin it so \`bunx akan\` runs it: bun add -d @akanjs/cli@${installed}`);
333
324
  return lines.join(`
334
325
  `);
335
326
  }
327
+ static refusal(cliVersion, argv, workspaceRoot, env = process.env) {
328
+ const mismatch = WorkspaceVersionCheck.#mismatchOf(cliVersion, argv, workspaceRoot);
329
+ if (!mismatch || ["1", "true"].includes(env[WorkspaceVersionCheck.overrideEnv] ?? ""))
330
+ return null;
331
+ const { args, cliVersion: cli, installed, rerun, update } = mismatch;
332
+ if (WorkspaceVersionCheck.#lineOf(cli) === WorkspaceVersionCheck.#lineOf(installed))
333
+ return null;
334
+ const realign = Bun.semver.order(cli, installed) > 0 ? `Move the workspace and this CLI to one release together: ${update}` : `Install the CLI this workspace was moved to: bun add -g @akanjs/cli@${installed}`;
335
+ return [
336
+ `This akan is @akanjs/cli ${cli}, but this workspace has akanjs ${installed}, another major.minor, so \`akan ${args[0]}\` is refused: it writes to the workspace, and what it writes would not match the installed framework.`,
337
+ realign,
338
+ `Or run the matching CLI once: ${rerun}`,
339
+ `Or set ${WorkspaceVersionCheck.overrideEnv}=1 to run it anyway.`
340
+ ].join(`
341
+ `);
342
+ }
343
+ static readsOnly(targetOption, values) {
344
+ const { readOnly = false } = targetOption;
345
+ return typeof readOnly === "function" ? readOnly(values) : readOnly;
346
+ }
336
347
  static installedAkanVersion(workspaceRoot) {
337
348
  const packageDir = path2.join(workspaceRoot, "node_modules", "akanjs");
338
349
  if (!existsSync(packageDir))
@@ -341,6 +352,26 @@ class WorkspaceVersionCheck {
341
352
  return null;
342
353
  return WorkspaceVersionCheck.#versionAt(packageDir);
343
354
  }
355
+ static #mismatchOf(cliVersion, argv, workspaceRoot) {
356
+ const args = argv.slice(2);
357
+ if (!cliVersion || WorkspaceVersionCheck.#exemptCommands.has(args[0] ?? ""))
358
+ return null;
359
+ if (args.some((arg) => WorkspaceVersionCheck.#infoFlags.has(arg)))
360
+ return null;
361
+ const installed = WorkspaceVersionCheck.installedAkanVersion(workspaceRoot);
362
+ if (!installed || installed === cliVersion)
363
+ return null;
364
+ const pinnedCli = WorkspaceVersionCheck.#versionAt(path2.join(workspaceRoot, "node_modules/@akanjs/cli"));
365
+ const runner = pinnedCli === installed ? ["bunx"] : ["bunx", "-p", `@akanjs/cli@${installed}`];
366
+ const rerun = [...runner, "akan", ...args].map(WorkspaceVersionCheck.#quote).join(" ");
367
+ const [, prerelease = ""] = cliVersion.split("-");
368
+ const tag = prerelease.split(".")[0];
369
+ const update = `akan update${WorkspaceVersionCheck.#updateTags.has(tag) ? ` --tag ${tag}` : ""}`;
370
+ return { args, cliVersion, installed, pinnedCli, rerun, update };
371
+ }
372
+ static #lineOf(version) {
373
+ return version.split("-")[0]?.split(".").slice(0, 2).join(".");
374
+ }
344
375
  static #versionAt(packageDir) {
345
376
  const packageJsonPath = path2.join(packageDir, "package.json");
346
377
  if (!existsSync(packageJsonPath))
@@ -452,6 +483,29 @@ var givenOptionsOf = (argMetas, opt) => {
452
483
  }
453
484
  return given;
454
485
  };
486
+ var argValuesOf = (argMetas, cmdArgs, opt) => {
487
+ const values = givenOptionsOf(argMetas, opt);
488
+ for (const argMeta of argMetas) {
489
+ if (argMeta.type === "Argument")
490
+ values[argMeta.name] = cmdArgs[argMeta.idx] ?? argMeta.argsOption.default;
491
+ else if (argMeta.type === "Option")
492
+ values[argMeta.name] ??= argMeta.argsOption.default;
493
+ }
494
+ return values;
495
+ };
496
+ var resolvedValuesOf = (argMetas, commandArgs) => Object.fromEntries(argMetas.flatMap((argMeta) => argMeta.type === "Option" || argMeta.type === "Argument" ? [[argMeta.name, commandArgs[argMeta.idx]]] : []));
497
+ var versionGateOf = (cliVersion) => {
498
+ let warning = WorkspaceVersionCheck.warning(cliVersion, process.argv, process.cwd());
499
+ const refusal = WorkspaceVersionCheck.refusal(cliVersion, process.argv, process.cwd());
500
+ return (targetOption, values) => {
501
+ if (refusal && !WorkspaceVersionCheck.readsOnly(targetOption, values))
502
+ throw new CliError("refused", refusal);
503
+ if (warning)
504
+ Logger.rawLog(chalk2.yellow(`
505
+ ${warning}`), undefined, "error");
506
+ warning = null;
507
+ };
508
+ };
455
509
  var normalizeEnumChoices = (enumChoices) => enumChoices.map((choice) => typeof choice === "object" ? { value: choice.value, name: choice.label } : { value: choice, name: choice.toString() });
456
510
  var prompts = async () => await import("@inquirer/prompts");
457
511
  var select = (config, context) => prompts().then((m) => m.select(config, context));
@@ -773,10 +827,7 @@ var runCommands = async (...commands) => {
773
827
  program.version(process.env.AKAN_VERSION).description("Akan CLI").configureHelp({
774
828
  helpWidth: 100
775
829
  });
776
- const versionWarning = WorkspaceVersionCheck.warning(cliPackageJson?.version, process.argv, process.cwd());
777
- if (versionWarning)
778
- Logger.rawLog(chalk2.yellow(`
779
- ${versionWarning}`), undefined, "error");
830
+ const checkVersion = versionGateOf(cliPackageJson?.version);
780
831
  for (const command of commands) {
781
832
  const targetMetas = getTargetMetas(command);
782
833
  for (const targetMeta of targetMetas) {
@@ -828,6 +879,7 @@ ${versionWarning}`), undefined, "error");
828
879
  usage: false,
829
880
  given: givenOptionsOf(allArgMetas, opt)
830
881
  });
882
+ checkVersion(targetMeta.targetOption, argValuesOf(allArgMetas, cmdArgs, opt));
831
883
  const commandArgs = [];
832
884
  if (targetMeta.targetOption.runsOnWorkspaceRoot) {
833
885
  await assertCurrentDirectoryIsWorkspaceRoot();
@@ -856,6 +908,7 @@ ${versionWarning}`), undefined, "error");
856
908
  if (opt.verbose)
857
909
  Executor.setVerbose(true);
858
910
  }
911
+ checkVersion(targetMeta.targetOption, resolvedValuesOf(allArgMetas, commandArgs));
859
912
  const cmd = CommandContainer.get(command);
860
913
  try {
861
914
  await targetMeta.handler.call(cmd, ...commandArgs);
@@ -960,4 +1013,4 @@ class ExitCodeError extends CliError {
960
1013
  return CliError.exitCodeOf(error);
961
1014
  }
962
1015
  }
963
- export { camelToKebabCase, getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, ModuleOrService, Workspace, CommandContainer, runner, script, markCliErrorPrinted, assertPromptable, runCommands, command, ExitCodeError };
1016
+ export { camelToKebabCase, getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, ModuleOrService, Workspace, CommandContainer, runner, script, WorkspaceVersionCheck, markCliErrorPrinted, assertPromptable, runCommands, command, ExitCodeError };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-9rv2zt48.js";
5
+ } from "./index-2yn3r67f.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-9rv2zt48.js";
5
+ } from "./index-2yn3r67f.js";
6
6
  import {
7
7
  generatedFilesForSync,
8
8
  createPassedPrimitiveReport,
9
9
  scalarChangedFiles
10
- } from "./index-0gaj78wn.js";
10
+ } from "./index-zmd9xxgd.js";
11
11
  import {
12
12
  pluralizeName
13
13
  } from "./index-nz8prx9g.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  DesktopBin
4
- } from "./index-fp5xf6ef.js";
4
+ } from "./index-ebn9kgea.js";
5
5
  // pkgs/@akanjs/devkit/mobile/desktopServerStage.ts
6
6
  import { cp, mkdir, readdir, rm, writeFile } from "fs/promises";
7
7
  import path from "path";
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  script
4
- } from "./index-9rv2zt48.js";
4
+ } from "./index-2yn3r67f.js";
5
5
  import {
6
6
  AppExecutor2
7
- } from "./index-ze48c0vd.js";
7
+ } from "./index-z92zm3wd.js";
8
8
  import {
9
9
  LibExecutor2
10
- } from "./index-na8r4a27.js";
10
+ } from "./index-zfnz878d.js";
11
11
  import {
12
12
  InteractionScaffold,
13
13
  workflowStatus,
@@ -46,16 +46,16 @@ import {
46
46
  nextActionsForTarget,
47
47
  createPrimitiveWriteReport,
48
48
  insertTemplateField
49
- } from "./index-0gaj78wn.js";
49
+ } from "./index-zmd9xxgd.js";
50
50
  import {
51
51
  ModuleScript
52
- } from "./index-m3t28rt3.js";
52
+ } from "./index-gt8phqpt.js";
53
53
  import {
54
54
  plainNameProblem
55
55
  } from "./index-va90m8nd.js";
56
56
  import {
57
57
  ModuleExecutor
58
- } from "./index-vjbne22r.js";
58
+ } from "./index-7wf8snar.js";
59
59
 
60
60
  // pkgs/@akanjs/cli/primitive/primitive.script.ts
61
61
  import { capitalize, lowerlize } from "akanjs/common";
@@ -216,7 +216,7 @@ var rootEntryHintOf = (type, name) => type === "app" && retiredAppRootEntries.ha
216
216
  var isScannedRootEntry = (type, name) => !name.startsWith(".") || rootAllowedDirs[type].has(name);
217
217
 
218
218
  // pkgs/@akanjs/devkit/workspace/scanInfo.ts
219
- var loadLibExecutor = () => import("./libExecutor-tq994592.js");
219
+ var loadLibExecutor = () => import("./libExecutor-jc6f8hm6.js");
220
220
  var serviceFileTypes = [
221
221
  "dictionary",
222
222
  "service",
@@ -623,9 +623,9 @@ class WorkspaceInfo {
623
623
  return existingWorkspaceInfo;
624
624
  const [appNames, libNames, pkgNames] = await Promise.all([exec.getApps(), exec.getLibs(), exec.getPkgs()]);
625
625
  const [appModule, libModule, pkgModule] = await Promise.all([
626
- import("./appExecutor-020cyesq.js"),
626
+ import("./appExecutor-79azsb2w.js"),
627
627
  loadLibExecutor(),
628
- import("./pkgExecutor-stde3yc3.js")
628
+ import("./pkgExecutor-arxmvx4t.js")
629
629
  ]);
630
630
  const [appInfos, libInfos, pkgInfos] = await Promise.all([
631
631
  Promise.all(appNames.map(async (appName) => await appModule.AppExecutor.from(exec, appName).scan())),
@@ -1036,13 +1036,18 @@ class ProjectTypecheck2 {
1036
1036
  await this.check(tsconfigPath, report);
1037
1037
  return tsconfigPath;
1038
1038
  }
1039
- async check(tsconfigPath, report = "pretty") {
1039
+ async checkIncremental(tsconfigPath, cacheDir, report = "pretty") {
1040
+ await mkdir(cacheDir, { recursive: true });
1041
+ await this.check(tsconfigPath, report, path5.join(cacheDir, "tsconfig.tsbuildinfo"));
1042
+ }
1043
+ async check(tsconfigPath, report = "pretty", tsBuildInfoFile) {
1040
1044
  const proc = Bun.spawn([process.execPath, await ProjectTypecheck2.workerEntry(this.workspaceRoot)], {
1041
1045
  cwd: this.workspaceRoot,
1042
1046
  env: {
1043
1047
  ...this.env,
1044
1048
  AKAN_COMMAND_TYPE: "typecheck",
1045
1049
  AKAN_TYPECHECK_TSCONFIG: tsconfigPath,
1050
+ ...tsBuildInfoFile ? { AKAN_TYPECHECK_BUILDINFO: tsBuildInfoFile } : {},
1046
1051
  ...report === "records" ? { AKAN_TYPECHECK_FORMAT: "json", AKAN_TYPECHECK_ROOT: this.workspaceRoot } : {}
1047
1052
  },
1048
1053
  stdout: "pipe",
@@ -1643,7 +1648,7 @@ class Executor {
1643
1648
  }
1644
1649
  }
1645
1650
  async getTypeChecker() {
1646
- const { TypeChecker } = await import("./typeChecker-bfrd1n9n.js");
1651
+ const { TypeChecker } = await import("./typeChecker-7jt6abrs.js");
1647
1652
  this.typeChecker ??= new TypeChecker(this);
1648
1653
  return this.typeChecker;
1649
1654
  }
@@ -3383,7 +3388,7 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
3383
3388
  return new AkanAppConfig(app, libs, rootPackageJson, config, baseDevEnv, plugins ?? [], libContributions);
3384
3389
  }
3385
3390
  static async#collectLibContributions(app, libs, bustImportCache) {
3386
- const { LibExecutor } = await import("./libExecutor-tq994592.js");
3391
+ const { LibExecutor } = await import("./libExecutor-jc6f8hm6.js");
3387
3392
  const libConfigs = await Promise.all(libs.map(async (libName) => AkanLibConfig.from(LibExecutor.from(app, libName), { bustImportCache }).catch((error) => {
3388
3393
  if (error instanceof LibConfigRefusal)
3389
3394
  throw error;
@@ -2,8 +2,9 @@
2
2
  import {
3
3
  runner,
4
4
  script,
5
+ WorkspaceVersionCheck,
5
6
  markCliErrorPrinted
6
- } from "./index-9rv2zt48.js";
7
+ } from "./index-2yn3r67f.js";
7
8
  import {
8
9
  CliError
9
10
  } from "./index-j4yvgfhr.js";
@@ -15,16 +16,16 @@ import {
15
16
  upsertAgentBlock,
16
17
  renderRecipeEntries,
17
18
  CLAUDE_COMMENT_RULE
18
- } from "./index-qssq2d41.js";
19
+ } from "./index-71y6176j.js";
19
20
  import {
20
21
  AppExecutor2
21
- } from "./index-ze48c0vd.js";
22
+ } from "./index-z92zm3wd.js";
22
23
  import {
23
24
  LibExecutor2
24
- } from "./index-na8r4a27.js";
25
+ } from "./index-zfnz878d.js";
25
26
  import {
26
27
  AkanContextAnalyzer
27
- } from "./index-bj8s07s7.js";
28
+ } from "./index-t2zhw8c7.js";
28
29
  import {
29
30
  collectRecipeSources2,
30
31
  scanRecipes2
@@ -39,15 +40,15 @@ import {
39
40
  import {
40
41
  ApplicationRunner,
41
42
  VerifyScope
42
- } from "./index-at6haq2x.js";
43
+ } from "./index-qyhr8wst.js";
43
44
  import {
44
45
  WorkspaceRunner
45
- } from "./index-prgvqqxe.js";
46
+ } from "./index-cd839jw2.js";
46
47
  import {
47
48
  VerifyComments,
48
49
  VerifyPipeline,
49
50
  VerifyReport
50
- } from "./index-m5gg0wzv.js";
51
+ } from "./index-gec8q5z9.js";
51
52
 
52
53
  // pkgs/@akanjs/cli/agent/agent.script.ts
53
54
  import { Logger as Logger3 } from "akanjs/common";
@@ -241,8 +242,10 @@ class AgentHook {
241
242
  "{apps,libs}/*/{ui,webkit,srvkit,common,plugin}/index.ts"
242
243
  ];
243
244
  #workspace;
244
- constructor(workspace) {
245
+ #cliVersion;
246
+ constructor(workspace, { cliVersion = process.env.AKAN_VERSION } = {}) {
245
247
  this.#workspace = workspace;
248
+ this.#cliVersion = cliVersion;
246
249
  }
247
250
  static isEvent(value) {
248
251
  return AgentHook.events.some((event) => event === value);
@@ -278,14 +281,22 @@ class AgentHook {
278
281
  return { ...existing, hooks };
279
282
  }
280
283
  async run(event, input) {
284
+ const file = event === "stop" ? null : this.#relative(input.tool_input?.file_path);
285
+ if (event === "pre-edit")
286
+ return file ? this.#preEdit(file) : { block: false, message: "" };
287
+ if (file)
288
+ await this.#record(input.session_id, file);
289
+ const refusal = WorkspaceVersionCheck.refusal(this.#cliVersion, ["bun", "akan", "verify"], this.#workspace.workspaceRoot);
290
+ if (refusal) {
291
+ process.stderr.write(`${refusal}
292
+ `);
293
+ return { block: false, message: refusal };
294
+ }
281
295
  if (event === "stop")
282
296
  return await this.#stop(input);
283
- const file = this.#relative(input.tool_input?.file_path);
284
297
  if (!file)
285
298
  return { block: false, message: "" };
286
- if (event === "pre-edit")
287
- return this.#preEdit(file);
288
- return await this.#postEdit(file, input.session_id);
299
+ return await this.#verify([file], { lintOnly: true });
289
300
  }
290
301
  #preEdit(file) {
291
302
  const pattern = AgentHook.generated.find((glob) => new Bun.Glob(glob).match(file));
@@ -296,10 +307,6 @@ class AgentHook {
296
307
  message: `${file} is generated (${pattern}). Edit the source file it is generated from, then run \`akan sync <app-or-lib>\`.`
297
308
  };
298
309
  }
299
- async#postEdit(file, session) {
300
- await this.#record(session, file);
301
- return await this.#verify([file], { lintOnly: true });
302
- }
303
310
  async#stop(input) {
304
311
  const ledger = this.#ledgerPath(input.session_id);
305
312
  const files = await this.#workspace.exists(ledger) ? (await this.#workspace.readFile(ledger)).split(`
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  execEmoji,
4
4
  Executor
5
- } from "./index-qssq2d41.js";
5
+ } from "./index-71y6176j.js";
6
6
  // pkgs/@akanjs/devkit/executors/moduleExecutor.ts
7
7
  class ModuleExecutor extends Executor {
8
8
  sys;
@@ -3,7 +3,7 @@ import {
3
3
  AsyncDefaultExportDetector,
4
4
  StoreBootstrap,
5
5
  resolveSsrPageEntriesForApp
6
- } from "./index-ze48c0vd.js";
6
+ } from "./index-z92zm3wd.js";
7
7
  import {
8
8
  FileSys2
9
9
  } from "./index-by2tvsq6.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  resolveSsrPageEntriesForApp
4
- } from "./index-ze48c0vd.js";
4
+ } from "./index-z92zm3wd.js";
5
5
  import {
6
6
  createBarrelImportsPlugin,
7
7
  workspaceBarrels,
@@ -10,7 +10,7 @@ import {
10
10
  CsrEntryFiles,
11
11
  PagesEntrySourceGenerator,
12
12
  PagesBundleBuilder
13
- } from "./index-yvzm8mby.js";
13
+ } from "./index-9wh04mqy.js";
14
14
 
15
15
  // pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
16
16
  import { mkdir as mkdir2, rm as rm2, unlink as unlink2 } from "fs/promises";
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  runner
4
- } from "./index-9rv2zt48.js";
4
+ } from "./index-2yn3r67f.js";
5
5
  import {
6
6
  writeWorkflowRunArtifact,
7
7
  generatedFilePathsForTarget,
8
8
  writeGeneratedSyncState,
9
9
  createRepairReport,
10
10
  renderRepairReport
11
- } from "./index-0gaj78wn.js";
11
+ } from "./index-zmd9xxgd.js";
12
12
  import {
13
13
  AkanContextAnalyzer
14
- } from "./index-bj8s07s7.js";
14
+ } from "./index-t2zhw8c7.js";
15
15
  import {
16
16
  isWorkflowSysName,
17
17
  isWorkflowModuleName
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  JsonFormatter
4
- } from "./index-qssq2d41.js";
4
+ } from "./index-71y6176j.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/quality/maintainabilityBaseline.ts
7
7
  class MaintainabilityBaseline {
@@ -132,12 +132,13 @@ ${summary.join(", ")} found${output.join(`
132
132
  return false;
133
133
  }
134
134
  }
135
- static checkProject(configPath) {
135
+ static checkProject(configPath, overrides = {}) {
136
136
  const parsedConfig = TypeChecker2.parseConfig(configPath);
137
- const host = ts.createIncrementalCompilerHost(parsedConfig.options);
137
+ const options = { ...parsedConfig.options, ...overrides };
138
+ const host = ts.createIncrementalCompilerHost(options);
138
139
  const builderProgram = ts.createIncrementalProgram({
139
140
  rootNames: parsedConfig.fileNames,
140
- options: parsedConfig.options,
141
+ options,
141
142
  projectReferences: parsedConfig.projectReferences,
142
143
  configFileParsingDiagnostics: parsedConfig.errors,
143
144
  host