@akanjs/cli 3.2.0-rc.30 → 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 (95) 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/akanApi/akanApi.instruction.md +1 -1
  20. package/guidelines/errorCodes/errorCodes.instruction.md +7 -0
  21. package/guidelines/mcpRule/mcpRule.instruction.md +155 -20
  22. package/guidelines/queryRule/queryRule.instruction.md +3 -1
  23. package/guidelines/runtimeRule/runtimeRule.instruction.md +7 -3
  24. package/guidelines/transportRule/transportRule.instruction.md +28 -0
  25. package/incrementalBuilder.proc.js +12 -9
  26. package/{index-5d57kx0s.js → index-275a4r3n.js} +3 -3
  27. package/{index-6zb17wcm.js → index-2jmvfa62.js} +3 -3
  28. package/{index-9rv2zt48.js → index-2yn3r67f.js} +78 -25
  29. package/{index-6pxmcaq8.js → index-3txdtztz.js} +1 -1
  30. package/{index-nm7nt9vm.js → index-4ss4gkv3.js} +2 -2
  31. package/{index-9wab2ngg.js → index-612fdtbk.js} +1 -1
  32. package/{index-7bs463x7.js → index-6dzjer7p.js} +6 -6
  33. package/{index-qssq2d41.js → index-71y6176j.js} +11 -6
  34. package/{index-4st0hq72.js → index-73x6z7ym.js} +24 -17
  35. package/{index-vjbne22r.js → index-7wf8snar.js} +1 -1
  36. package/{index-yvzm8mby.js → index-9wh04mqy.js} +1 -1
  37. package/{index-yxkjsyx8.js → index-a860mx0m.js} +2 -2
  38. package/{index-42jhx2ya.js → index-b2sdtgc7.js} +3 -3
  39. package/{index-1pjwsh2g.js → index-baccvws5.js} +1 -1
  40. package/{index-99kjwyma.js → index-c669pbyb.js} +4 -3
  41. package/{index-prgvqqxe.js → index-cd839jw2.js} +126 -113
  42. package/{index-6469101k.js → index-dadwp2aw.js} +33 -98
  43. package/{index-7v7tvgt7.js → index-dmcpetwe.js} +123 -43
  44. package/{index-ba2xd32s.js → index-e9w8wq0a.js} +27 -22
  45. package/{index-fp5xf6ef.js → index-ebn9kgea.js} +3 -3
  46. package/{index-s3m89wt2.js → index-exzkev4k.js} +7 -7
  47. package/{index-m5gg0wzv.js → index-gec8q5z9.js} +57 -30
  48. package/{index-m3t28rt3.js → index-gt8phqpt.js} +4 -4
  49. package/{index-g7jgd4xs.js → index-j592zfqc.js} +1 -1
  50. package/{index-cb91b6d8.js → index-jek2re5k.js} +3 -3
  51. package/{index-ffa52fwf.js → index-jf4vk1s0.js} +8 -1
  52. package/{index-v929w7j7.js → index-kykky4re.js} +59 -15
  53. package/{index-9wjrwjgz.js → index-nk374pqd.js} +8 -8
  54. package/{index-28nk8w3j.js → index-pk2ja04e.js} +8 -8
  55. package/{index-jgj31xvw.js → index-qcp6e2ht.js} +22 -5
  56. package/{index-at6haq2x.js → index-qyhr8wst.js} +61 -18
  57. package/{index-f16kr6vj.js → index-s885g0jj.js} +2 -2
  58. package/{index-bj8s07s7.js → index-t2zhw8c7.js} +4 -4
  59. package/{index-11d7nh8a.js → index-v7ajmsh3.js} +1 -1
  60. package/{index-dss3ds74.js → index-w1zexzpx.js} +1 -1
  61. package/{index-g45y5f3e.js → index-wzp3yg01.js} +1 -1
  62. package/{index-ze48c0vd.js → index-z92zm3wd.js} +2 -2
  63. package/{index-na8r4a27.js → index-zfnz878d.js} +1 -1
  64. package/{index-0gaj78wn.js → index-zmd9xxgd.js} +3 -3
  65. package/{index-p06kfhdf.js → index-zzebpyr0.js} +4 -4
  66. package/index.js +27 -27
  67. package/{libExecutor-tq994592.js → libExecutor-jc6f8hm6.js} +2 -2
  68. package/{library.command-x219mhcx.js → library.command-nxvesvhb.js} +11 -8
  69. package/{localRegistry.command-zvdcejhn.js → localRegistry.command-4a655xnq.js} +20 -20
  70. package/{module.command-k6cwcm7g.js → module.command-aaws9byg.js} +9 -9
  71. package/{package.command-vw7x09f8.js → package.command-j7hv26p0.js} +10 -10
  72. package/package.json +8 -8
  73. package/{page.command-gf06paq2.js → page.command-7yffs7n9.js} +7 -7
  74. package/{pipeline.command-y07dgj9b.js → pipeline.command-7yk0zcng.js} +8 -7
  75. package/{pkgExecutor-stde3yc3.js → pkgExecutor-arxmvx4t.js} +2 -2
  76. package/{primitive.command-edydvh07.js → primitive.command-7a1pt715.js} +10 -10
  77. package/{projectTypecheck-mk8wefvd.js → projectTypecheck-f4qhbecd.js} +1 -1
  78. package/{quality.command-mdb45vyr.js → quality.command-08bn42t4.js} +13 -10
  79. package/{repair.command-kvtaeecy.js → repair.command-r59jat74.js} +9 -9
  80. package/{scalar.command-sjt9p5e1.js → scalar.command-2ex84spb.js} +8 -8
  81. package/skills/akan-mcp/SKILL.md +9 -2
  82. package/skills/akan-validate/SKILL.md +3 -3
  83. package/{subspace.command-mkkqync4.js → subspace.command-2nxakmk3.js} +16 -13
  84. package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
  85. package/templates/workspaceRoot/README.ts +4 -2
  86. package/{tunnel.command-tr5b3030.js → tunnel.command-f7ep1qfa.js} +12 -12
  87. package/{typeChecker-bfrd1n9n.js → typeChecker-7jt6abrs.js} +1 -1
  88. package/typecheck.proc.js +3 -2
  89. package/{verify.command-0p9h8tpp.js → verify.command-xbztwp1r.js} +17 -17
  90. package/{workflow.command-9mfcwqzj.js → workflow.command-pmyx55y4.js} +18 -15
  91. package/{workspace.command-5hjtmcfs.js → workspace.command-89p90zvb.js} +36 -36
  92. package/TunnelShare-mbfcaqg0.js +0 -18
  93. package/cloud.script-9kmbr3d6.js +0 -35
  94. package/context.command-php852kf.js +0 -61
  95. package/context.runner-nngmn7c0.js +0 -34
@@ -6,28 +6,29 @@ import {
6
6
  CloudApi,
7
7
  CloudUpdates,
8
8
  PipelineSecrets
9
- } from "./index-f16kr6vj.js";
9
+ } from "./index-s885g0jj.js";
10
10
  import {
11
11
  resolveMobileTargets
12
12
  } from "./index-m9jj544v.js";
13
13
  import {
14
14
  WorkspaceExecutor
15
- } from "./index-qssq2d41.js";
15
+ } from "./index-71y6176j.js";
16
16
  import {
17
17
  AppExecutor2
18
- } from "./index-ze48c0vd.js";
18
+ } from "./index-z92zm3wd.js";
19
19
  import {
20
20
  NativeApp
21
- } from "./index-fp5xf6ef.js";
21
+ } from "./index-ebn9kgea.js";
22
22
  import {
23
23
  runner,
24
24
  assertPromptable
25
- } from "./index-9rv2zt48.js";
25
+ } from "./index-2yn3r67f.js";
26
26
  import {
27
27
  getNpmRegistryUrl,
28
28
  getPublishedVersions,
29
- getLatestPackageVersion
30
- } from "./index-ffa52fwf.js";
29
+ getLatestPackageVersion,
30
+ getPublishedPeerDependencies
31
+ } from "./index-jf4vk1s0.js";
31
32
  import {
32
33
  SubspaceConfig
33
34
  } from "./index-xczjdng6.js";
@@ -1242,27 +1243,31 @@ ${run.format(results)}
1242
1243
  }
1243
1244
  async update(workspace, tag = "latest", { registryUrl } = {}) {
1244
1245
  const registry = registryUrl ? getNpmRegistryUrl(registryUrl) : undefined;
1245
- const registryArgs = this.#getRegistryArgs(registry);
1246
- const env = this.#getRegistryEnv(registry);
1247
- const globalCliArgs = ["add", "-g", `@akanjs/cli@${tag}`, ...registryArgs];
1248
- if (!await workspace.exists("package.json"))
1249
- await workspace.spawn("bun", globalCliArgs, { env });
1250
- else
1251
- await Promise.all([
1252
- workspace.spawn("bun", globalCliArgs, { env }),
1253
- this.#updateAkanPkgs(workspace, tag, registry)
1254
- ]);
1246
+ const hasPackageJson = await workspace.exists("package.json");
1247
+ const version = hasPackageJson ? await getLatestPackageVersion("akanjs", tag, registry) : tag;
1248
+ const peers = hasPackageJson ? await getPublishedPeerDependencies("akanjs", version, registry) : null;
1249
+ await Promise.all([
1250
+ workspace.spawn("bun", ["add", "-g", `@akanjs/cli@${version}`, ...this.#getRegistryArgs(registry)], {
1251
+ env: this.#getRegistryEnv(registry)
1252
+ }),
1253
+ peers && this.#updateAkanPkgs(workspace, version, peers, registry)
1254
+ ]);
1255
1255
  }
1256
- async#updateAkanPkgs(workspace, tag = "latest", registryUrl) {
1257
- const latestPublishedVersion = await getLatestPackageVersion("akanjs", tag, registryUrl);
1256
+ async#updateAkanPkgs(workspace, akanVersion, peers, registryUrl) {
1258
1257
  const rootPackageJson = await workspace.getPackageJson();
1259
1258
  if (!rootPackageJson.dependencies)
1260
1259
  throw new Error("No dependencies found in package.json");
1261
- for (const name of ["akanjs", "@akanjs/devkit", "@akanjs/cli", "@akanjs/language"]) {
1260
+ const pins = Object.fromEntries(["akanjs", "@akanjs/devkit", "@akanjs/cli", "@akanjs/language"].map((name) => [name, akanVersion]));
1261
+ for (const peer of ["react", "react-dom", "react-server-dom-webpack"]) {
1262
+ const version = peers[peer];
1263
+ if (version)
1264
+ pins[peer] = version;
1265
+ }
1266
+ for (const [name, version] of Object.entries(pins)) {
1262
1267
  if (rootPackageJson.dependencies[name])
1263
- rootPackageJson.dependencies[name] = latestPublishedVersion;
1268
+ rootPackageJson.dependencies[name] = version;
1264
1269
  if (rootPackageJson.devDependencies?.[name])
1265
- rootPackageJson.devDependencies[name] = latestPublishedVersion;
1270
+ rootPackageJson.devDependencies[name] = version;
1266
1271
  }
1267
1272
  await workspace.setPackageJson(rootPackageJson);
1268
1273
  await workspace.spawn("bun", ["install", ...this.#getRegistryArgs(registryUrl)], {
@@ -5,17 +5,17 @@ import {
5
5
  WorkspaceExecutor,
6
6
  ServerEnvProfile,
7
7
  AkanAppConfig
8
- } from "./index-qssq2d41.js";
8
+ } from "./index-71y6176j.js";
9
9
  import {
10
10
  resolveAppId,
11
11
  targetHtmlFilename
12
12
  } from "./index-m9jj544v.js";
13
13
  import {
14
14
  CsrArtifactBuilder
15
- } from "./index-yxkjsyx8.js";
15
+ } from "./index-a860mx0m.js";
16
16
  import {
17
17
  ExitCodeError
18
- } from "./index-9rv2zt48.js";
18
+ } from "./index-2yn3r67f.js";
19
19
 
20
20
  // pkgs/@akanjs/devkit/mobile/desktopBin.ts
21
21
  import { chmod, mkdir, rename, rm, writeFile } from "fs/promises";
@@ -4,27 +4,27 @@ import {
4
4
  CloudApi,
5
5
  CloudUpdates,
6
6
  PipelineSecrets
7
- } from "./index-f16kr6vj.js";
7
+ } from "./index-s885g0jj.js";
8
8
  import {
9
9
  PkgExecutor2
10
- } from "./index-dss3ds74.js";
10
+ } from "./index-w1zexzpx.js";
11
11
  import {
12
12
  UpdatePackFolder,
13
13
  NativePublicEnv,
14
14
  NativeApp
15
- } from "./index-fp5xf6ef.js";
15
+ } from "./index-ebn9kgea.js";
16
16
  import {
17
17
  script
18
- } from "./index-9rv2zt48.js";
18
+ } from "./index-2yn3r67f.js";
19
19
  import {
20
20
  ApplicationScript
21
- } from "./index-v929w7j7.js";
21
+ } from "./index-kykky4re.js";
22
22
  import {
23
23
  PackageScript
24
- } from "./index-5d57kx0s.js";
24
+ } from "./index-275a4r3n.js";
25
25
  import {
26
26
  CloudRunner
27
- } from "./index-ba2xd32s.js";
27
+ } from "./index-e9w8wq0a.js";
28
28
 
29
29
  // pkgs/@akanjs/cli/cloud/cloud.script.ts
30
30
  import { Logger } from "akanjs/common";
@@ -1,28 +1,31 @@
1
1
  // @bun
2
2
  import {
3
3
  ApplicationBuildReporter
4
- } from "./index-7v7tvgt7.js";
4
+ } from "./index-dmcpetwe.js";
5
5
  import {
6
6
  parseBiomeReport,
7
7
  Linter,
8
8
  ProjectTypecheck2
9
- } from "./index-qssq2d41.js";
9
+ } from "./index-71y6176j.js";
10
10
  import {
11
11
  TypecheckFailure
12
12
  } from "./index-j4yvgfhr.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
  WorkspaceRunner,
24
24
  AkanQualityScanner
25
- } from "./index-prgvqqxe.js";
25
+ } from "./index-cd839jw2.js";
26
+ import {
27
+ VerifyScope
28
+ } from "./index-qyhr8wst.js";
26
29
 
27
30
  // pkgs/@akanjs/cli/verify/verifyComments.ts
28
31
  import { existsSync } from "fs";
@@ -196,6 +199,7 @@ class VerifyComments {
196
199
 
197
200
  // pkgs/@akanjs/cli/verify/verifyPipeline.ts
198
201
  import { existsSync as existsSync4 } from "fs";
202
+ import os from "os";
199
203
  import path5 from "path";
200
204
 
201
205
  // pkgs/@akanjs/cli/verify/verifyDiagnostics.ts
@@ -569,6 +573,10 @@ class VerifyStyleClasses {
569
573
 
570
574
  // pkgs/@akanjs/cli/verify/verifyPipeline.ts
571
575
  class VerifyPipeline {
576
+ static concurrencyOf(cpus, memoryBytes) {
577
+ return Math.max(1, Math.min(4, Math.max(2, cpus - 1), Math.floor(memoryBytes / 2 ** 32)));
578
+ }
579
+ static #concurrency = VerifyPipeline.concurrencyOf(os.availableParallelism(), os.totalmem());
572
580
  #workspace;
573
581
  #workspaceRunner;
574
582
  #applicationRunner;
@@ -582,20 +590,22 @@ class VerifyPipeline {
582
590
  get #root() {
583
591
  return this.#workspace.workspaceRoot;
584
592
  }
585
- async run(scope, { lintOnly = false, build = true } = {}) {
593
+ async run(changed, { lintOnly = false, build = true } = {}) {
586
594
  const startedAt = performance.now();
595
+ const scope = lintOnly ? changed : await this.#withDependents(changed);
587
596
  const systems = scope.targets.filter((target) => target.type !== "pkg");
597
+ const edited = scope.targets.filter((target) => !target.dependent);
588
598
  if (!lintOnly)
589
599
  await this.#each("sync", systems, (target) => this.#sync(target));
590
600
  const synced = !this.#failed("sync");
591
601
  const renames = new Map;
592
- for (const target of systems)
602
+ for (const target of edited.filter((target) => target.type !== "pkg"))
593
603
  renames.set(target, await VerifyPrivateMethods.fix(this.#root, target.dir, target.files).catch(() => new Map));
594
604
  await Promise.all([
595
- this.#each("lint", scope.targets, (target) => this.#lint(target, { comments: !lintOnly, rewritten: renames.get(target) ?? new Map })),
596
- lintOnly || !synced ? null : this.#each("typecheck", scope.targets, (target) => this.#typecheck(target))
605
+ this.#each("lint", edited, (target) => this.#lint(target, { comments: !lintOnly, rewritten: renames.get(target) ?? new Map }), VerifyPipeline.#concurrency),
606
+ lintOnly || !synced ? null : this.#each("typecheck", scope.targets, (target) => this.#typecheck(target), VerifyPipeline.#concurrency)
597
607
  ]);
598
- const apps = scope.targets.filter((target) => target.type === "app");
608
+ const apps = edited.filter((target) => target.type === "app");
599
609
  const clean = !this.#diagnostics.some((diagnostic) => diagnostic.severity === "error");
600
610
  if (!lintOnly && build && apps.length) {
601
611
  if (clean)
@@ -613,20 +623,34 @@ class VerifyPipeline {
613
623
  diagnostics: this.#diagnostics
614
624
  };
615
625
  }
616
- async#each(name, items, step) {
626
+ async#withDependents(scope) {
627
+ if (!scope.changedLibs.length)
628
+ return scope;
629
+ const [apps, libs, pkgs] = await this.#workspace.getExecs();
630
+ const names = { apps, libs, pkgs };
631
+ return scope.withDependents(names, await VerifyScope.libDepsIn(this.#root, names));
632
+ }
633
+ async#each(name, items, step, concurrency = 1) {
617
634
  if (!items.length)
618
635
  return;
619
636
  const startedAt = performance.now();
620
- let fixed = 0;
621
- let failed = false;
622
- for (const item of items) {
623
- const outcome = await step(item).catch((error) => ({
624
- diagnostics: [VerifyDiagnostics.fromMessage(name, ApplicationBuildReporter.formatError(error, this.#root))]
625
- }));
626
- fixed += outcome.fixed ?? 0;
627
- failed ||= outcome.diagnostics.some((diagnostic) => diagnostic.severity === "error");
628
- this.#diagnostics.push(...outcome.diagnostics);
629
- }
637
+ const outcomes = [];
638
+ let next = 0;
639
+ const worker = async () => {
640
+ while (next < items.length) {
641
+ const idx = next++;
642
+ outcomes[idx] = await step(items[idx]).catch((error) => ({
643
+ diagnostics: [VerifyDiagnostics.fromMessage(name, ApplicationBuildReporter.formatError(error, this.#root))]
644
+ }));
645
+ }
646
+ };
647
+ await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, worker));
648
+ const fixed = outcomes.reduce((sum, outcome) => sum + (outcome.fixed ?? 0), 0);
649
+ const diagnostics = [
650
+ ...new Map(outcomes.flatMap((outcome) => outcome.diagnostics).map((entry) => [JSON.stringify(entry), entry])).values()
651
+ ];
652
+ this.#diagnostics.push(...diagnostics);
653
+ const failed = diagnostics.some((diagnostic) => diagnostic.severity === "error");
630
654
  const ms = Math.round(performance.now() - startedAt);
631
655
  this.#steps.set(name, { name, status: failed ? "fail" : "pass", ms, fixed });
632
656
  }
@@ -718,7 +742,7 @@ class VerifyPipeline {
718
742
  const tsconfigPath = path5.join(this.#root, target.dir, "tsconfig.json");
719
743
  if (!existsSync4(tsconfigPath))
720
744
  return { diagnostics: [] };
721
- await new ProjectTypecheck2(path5.join(this.#root, target.dir), this.#root, process.env).check(tsconfigPath, "records");
745
+ await new ProjectTypecheck2(path5.join(this.#root, target.dir), this.#root, process.env).checkIncremental(tsconfigPath, path5.join(this.#root, ".akan", "typecheck", target.dir), "records");
722
746
  }
723
747
  return { diagnostics: [] };
724
748
  } catch (error) {
@@ -728,12 +752,12 @@ class VerifyPipeline {
728
752
  }
729
753
  }
730
754
  async#build(target) {
731
- const { routeJsWarnings = [] } = await this.#applicationRunner.build(AppExecutor2.from(this.#workspace, target.name), { fast: true });
755
+ const { routeJsWarnings = [] } = await this.#applicationRunner.build(AppExecutor2.from(this.#workspace, target.name), { verify: true });
732
756
  return { diagnostics: routeJsWarnings.map((warning) => VerifyDiagnostics.fromRouteJsBudget(warning)) };
733
757
  }
734
758
  async#ssr(scope) {
735
- const scanned = await new AkanQualityScanner().scan(this.#root);
736
- const warnings = scanned.warnings.filter((warning) => warning.scope === "ssr");
759
+ const dirs = scope.targets.filter((target) => target.type !== "pkg" && target.files.some((file) => file.endsWith(".tsx"))).map((target) => target.dir);
760
+ const warnings = await new AkanQualityScanner().scanSsr(this.#root, dirs);
737
761
  return { diagnostics: VerifyDiagnostics.fromQuality(warnings, scope.changedFiles) };
738
762
  }
739
763
  #execOf(target) {
@@ -762,18 +786,21 @@ class VerifyReport {
762
786
  static #header(result) {
763
787
  const ran = result.steps.filter((step) => step.name !== "sync" || step.status === "fail");
764
788
  const fixed = result.steps.reduce((sum, step) => sum + step.fixed, 0);
765
- const seconds = `${(result.ms / 1000).toFixed(1)}s`;
789
+ const seconds = VerifyReport.#seconds(result.ms);
766
790
  const fixedNote = fixed ? `fixed ${fixed} file${fixed === 1 ? "" : "s"}` : null;
767
- const steps = result.ok ? ran.filter((step) => step.status === "pass").map((step) => step.name).join(" ") : ran.map((step) => VerifyReport.#stepLabel(step, result.diagnostics)).join(" \xB7 ");
791
+ const steps = result.ok ? ran.filter((step) => step.status === "pass").map((step) => `${step.name} ${VerifyReport.#seconds(step.ms)}`).join(" ") : ran.map((step) => VerifyReport.#stepLabel(step, result.diagnostics)).join(" \xB7 ");
768
792
  return [`verify ${result.ok ? "ok" : "fail"}`, result.targets.join(", "), steps, fixedNote, seconds].filter(Boolean).join(" \xB7 ");
769
793
  }
770
794
  static #stepLabel(step, diagnostics) {
771
795
  if (step.status === "skip")
772
796
  return `${step.name} skipped`;
773
797
  if (step.status === "pass")
774
- return `${step.name} ok`;
798
+ return `${step.name} ok ${VerifyReport.#seconds(step.ms)}`;
775
799
  const errors = diagnostics.filter((entry) => entry.step === step.name && entry.severity === "error").length;
776
- return `${step.name} ${errors} error${errors === 1 ? "" : "s"}`;
800
+ return `${step.name} ${errors} error${errors === 1 ? "" : "s"} ${VerifyReport.#seconds(step.ms)}`;
801
+ }
802
+ static #seconds(ms) {
803
+ return `${(ms / 1000).toFixed(1)}s`;
777
804
  }
778
805
  static #diagnosticLines(diagnostics, max) {
779
806
  const groups = new Map;
@@ -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
  import {
7
7
  bilingualLabelForField,
8
8
  bilingualDescriptionForField,
@@ -10,10 +10,10 @@ import {
10
10
  sourceFile,
11
11
  generatedFilesForSync,
12
12
  createPassedPrimitiveReport
13
- } from "./index-0gaj78wn.js";
13
+ } from "./index-zmd9xxgd.js";
14
14
  import {
15
15
  PageScript
16
- } from "./index-6pxmcaq8.js";
16
+ } from "./index-3txdtztz.js";
17
17
  import {
18
18
  pluralizeName
19
19
  } from "./index-nz8prx9g.js";
@@ -22,7 +22,7 @@ import {
22
22
  } from "./index-va90m8nd.js";
23
23
  import {
24
24
  ModuleExecutor
25
- } from "./index-vjbne22r.js";
25
+ } from "./index-7wf8snar.js";
26
26
 
27
27
  // pkgs/@akanjs/cli/module/module.script.ts
28
28
  import { capitalize as capitalize2 } from "akanjs/common";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  AppInfo
4
- } from "./index-qssq2d41.js";
4
+ } from "./index-71y6176j.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/workspace/slicePlanner.ts
7
7
  class SlicePlanner {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  SOURCE_EXTS,
4
4
  WatchRootResolver
5
- } from "./index-7v7tvgt7.js";
5
+ } from "./index-dmcpetwe.js";
6
6
  import {
7
7
  loaderFor,
8
8
  BarrelAnalyzer,
@@ -18,7 +18,7 @@ import {
18
18
  CsrDevPaths,
19
19
  PagesEntrySourceGenerator,
20
20
  PagesBundleBuilder
21
- } from "./index-yvzm8mby.js";
21
+ } from "./index-9wh04mqy.js";
22
22
  import {
23
23
  FileSys2
24
24
  } from "./index-by2tvsq6.js";
@@ -26,7 +26,7 @@ import {
26
26
  AsyncDefaultExportDetector,
27
27
  StoreBootstrap,
28
28
  resolveSsrPageEntriesForApp
29
- } from "./index-ze48c0vd.js";
29
+ } from "./index-z92zm3wd.js";
30
30
 
31
31
  // pkgs/@akanjs/devkit/frontendBuild/clientEntryDiscovery.ts
32
32
  import fs from "fs";
@@ -37,5 +37,12 @@ async function getLatestPackageVersion(packageName, tag = "latest", registryUrl)
37
37
  throw new Error(`No npm dist-tag "${tag}" found for ${packageName}`);
38
38
  return version;
39
39
  }
40
+ async function getPublishedPeerDependencies(packageName, version, registryUrl) {
41
+ const registry = getNpmRegistryUrl(registryUrl);
42
+ const res = await fetch(`${packageUrl(registry, packageName)}/${encodeURIComponent(version)}`);
43
+ if (!res.ok)
44
+ throw new Error(`Failed to fetch ${packageName}@${version} metadata from ${registry} (${res.status})`);
45
+ return (await res.json()).peerDependencies ?? {};
46
+ }
40
47
 
41
- export { npmRegistryFromEnv, warnIgnoredNpmRegistry, getNpmRegistryUrl, getPublishedVersions, getLatestPackageVersion };
48
+ export { npmRegistryFromEnv, warnIgnoredNpmRegistry, getNpmRegistryUrl, getPublishedVersions, getLatestPackageVersion, getPublishedPeerDependencies };
@@ -1,37 +1,37 @@
1
1
  // @bun
2
2
  import {
3
3
  ApplicationBuildReporter
4
- } from "./index-7v7tvgt7.js";
4
+ } from "./index-dmcpetwe.js";
5
5
  import {
6
6
  script,
7
7
  markCliErrorPrinted,
8
8
  assertPromptable
9
- } from "./index-9rv2zt48.js";
9
+ } from "./index-2yn3r67f.js";
10
10
  import {
11
11
  CliError
12
12
  } from "./index-j4yvgfhr.js";
13
13
  import {
14
14
  SysExecutor
15
- } from "./index-qssq2d41.js";
15
+ } from "./index-71y6176j.js";
16
16
  import {
17
17
  AppExecutor2
18
- } from "./index-ze48c0vd.js";
18
+ } from "./index-z92zm3wd.js";
19
19
  import {
20
20
  LibExecutor2
21
- } from "./index-na8r4a27.js";
21
+ } from "./index-zfnz878d.js";
22
22
  import {
23
23
  PkgExecutor2
24
- } from "./index-dss3ds74.js";
24
+ } from "./index-w1zexzpx.js";
25
25
  import {
26
26
  DesktopServerStage
27
- } from "./index-9wab2ngg.js";
27
+ } from "./index-612fdtbk.js";
28
28
  import {
29
29
  LibraryScript
30
- } from "./index-6zb17wcm.js";
30
+ } from "./index-2jmvfa62.js";
31
31
  import {
32
32
  ApplicationRunner,
33
33
  VerifyScope
34
- } from "./index-at6haq2x.js";
34
+ } from "./index-qyhr8wst.js";
35
35
  import {
36
36
  PreviewChrome2,
37
37
  PreviewView2,
@@ -39,7 +39,7 @@ import {
39
39
  } from "./index-rwgqba9p.js";
40
40
  import {
41
41
  formatSlicePlan
42
- } from "./index-g7jgd4xs.js";
42
+ } from "./index-j592zfqc.js";
43
43
  import {
44
44
  assertPlainName
45
45
  } from "./index-va90m8nd.js";
@@ -48,6 +48,7 @@ import {
48
48
  } from "./index-9dp031by.js";
49
49
 
50
50
  // pkgs/@akanjs/cli/application/application.script.ts
51
+ import { mkdir as mkdir3, rm } from "fs/promises";
51
52
  import path3 from "path";
52
53
  import { confirm } from "@inquirer/prompts";
53
54
  import { Logger as Logger3, toError } from "akanjs/common";
@@ -1474,9 +1475,21 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
1474
1475
  throw error;
1475
1476
  }
1476
1477
  }
1477
- async test(exec, { write = true, files = [], coverage = false } = {}) {
1478
+ async test(exec, {
1479
+ write = true,
1480
+ files = [],
1481
+ coverage = false,
1482
+ parallel = 1,
1483
+ junit
1484
+ } = {}) {
1485
+ if (!Number.isInteger(parallel) || parallel < 1)
1486
+ throw new CliError("usage", `--parallel takes a whole number of bun processes, 1 or more; got ${parallel}`);
1478
1487
  const testPaths = this.applicationRunner.resolveTestPaths(exec, files);
1479
- const flags = coverage ? ApplicationScript.#coverageFlagsOf(exec) : [];
1488
+ const flags = [
1489
+ ...coverage ? ApplicationScript.#coverageFlagsOf(exec) : [],
1490
+ ...parallel > 1 ? await ApplicationScript.#parallelFlagsOf(exec, parallel) : [],
1491
+ ...junit ? await ApplicationScript.#junitFlagsOf(junit) : []
1492
+ ];
1480
1493
  if (exec instanceof LibExecutor2) {
1481
1494
  if (write)
1482
1495
  await this.libraryScript.syncLibrary(exec);
@@ -1499,11 +1512,42 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
1499
1512
  }
1500
1513
  await this.applicationRunner.test(exec, testPaths, flags);
1501
1514
  }
1502
- static #coverageFlagsOf(exec) {
1515
+ static #localDirOf(exec, kind) {
1503
1516
  const root = exec instanceof SysExecutor || exec instanceof PkgExecutor2 ? exec.workspace.workspaceRoot : null;
1504
- const dir = root ? path3.join(root, "local", "coverage", path3.relative(root, exec.cwdPath)) : "local/coverage";
1517
+ return root ? path3.join(root, "local", kind, path3.relative(root, exec.cwdPath)) : `local/${kind}`;
1518
+ }
1519
+ static #coverageFlagsOf(exec) {
1520
+ const dir = ApplicationScript.#localDirOf(exec, "coverage");
1505
1521
  return ["--coverage", "--coverage-reporter=text", "--coverage-reporter=lcov", `--coverage-dir=${dir}`];
1506
1522
  }
1523
+ static async#parallelFlagsOf(exec, parallel) {
1524
+ const timings = path3.join(ApplicationScript.#localDirOf(exec, "test-timings"), "timings.json");
1525
+ if (!await ApplicationScript.#readsAsTimings(timings)) {
1526
+ await rm(timings, { force: true });
1527
+ Logger3.warn(`${timings} was not a timings file bun reads, so it was dropped; this run records it again`);
1528
+ }
1529
+ return [`--parallel=${parallel}`, `--timings=${timings}`, "--update-timings"];
1530
+ }
1531
+ static async#readsAsTimings(timings) {
1532
+ const file = Bun.file(timings);
1533
+ if (!await file.exists())
1534
+ return true;
1535
+ const text = await file.text();
1536
+ if (text === "")
1537
+ return true;
1538
+ try {
1539
+ const parsed = JSON.parse(text);
1540
+ const files = parsed?.files;
1541
+ return parsed?.version === 1 && typeof files === "object" && files !== null && !Array.isArray(files) && Object.values(files).every((ms) => typeof ms !== "string");
1542
+ } catch {
1543
+ return false;
1544
+ }
1545
+ }
1546
+ static async#junitFlagsOf(junit) {
1547
+ const outfile = path3.resolve(junit);
1548
+ await mkdir3(path3.dirname(outfile), { recursive: true });
1549
+ return ["--reporter=junit", `--reporter-outfile=${outfile}`];
1550
+ }
1507
1551
  async start(apps, {
1508
1552
  open = false,
1509
1553
  dbup = true,
@@ -1735,7 +1779,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
1735
1779
  await Promise.all(shares.map(async (share) => await share.close()));
1736
1780
  }, "Abandoning the tunnel release; the shares expire on their own.");
1737
1781
  await Promise.all(apps.map(async (app) => {
1738
- const { TunnelShare } = await import("./TunnelShare-mbfcaqg0.js");
1782
+ const { TunnelShare } = await import("./TunnelShare-9ry4vh0y.js");
1739
1783
  const share = await TunnelShare.open(app, { workspace: app.workspace });
1740
1784
  shares.push(share);
1741
1785
  urls.set(app.name, share.url);
@@ -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
  AppExecutor2
7
- } from "./index-ze48c0vd.js";
7
+ } from "./index-z92zm3wd.js";
8
8
  import {
9
9
  jsonText,
10
10
  workflowStatus,
11
11
  createWorkflowBaselineSummary,
12
12
  buildAkanModuleContextIndex,
13
13
  toolingRolloutGate
14
- } from "./index-0gaj78wn.js";
14
+ } from "./index-zmd9xxgd.js";
15
15
  import {
16
16
  buildResourceList,
17
17
  codexMcpConfigPath,
@@ -21,16 +21,16 @@ import {
21
21
  upsertCodexMcpServerBlock,
22
22
  renderDoctorText,
23
23
  AkanContextAnalyzer
24
- } from "./index-bj8s07s7.js";
24
+ } from "./index-t2zhw8c7.js";
25
25
  import {
26
26
  Prompter2
27
27
  } from "./index-knpm8sdm.js";
28
28
  import {
29
29
  NativeApp
30
- } from "./index-fp5xf6ef.js";
30
+ } from "./index-ebn9kgea.js";
31
31
  import {
32
32
  isPlaceholderAppId
33
- } from "./index-9wab2ngg.js";
33
+ } from "./index-612fdtbk.js";
34
34
  import {
35
35
  getMobileTargets,
36
36
  appIdsOf
@@ -40,10 +40,10 @@ import {
40
40
  } from "./index-xs9a3ddt.js";
41
41
  import {
42
42
  RepairRunner
43
- } from "./index-42jhx2ya.js";
43
+ } from "./index-b2sdtgc7.js";
44
44
  import {
45
45
  WorkflowRunner
46
- } from "./index-28nk8w3j.js";
46
+ } from "./index-pk2ja04e.js";
47
47
 
48
48
  // pkgs/@akanjs/devkit/context/akanMcpContract.ts
49
49
  import { lstatSync, realpathSync } from "fs";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  CommandContainer,
4
4
  runner
5
- } from "./index-9rv2zt48.js";
5
+ } from "./index-2yn3r67f.js";
6
6
  import {
7
7
  WorkspaceExecutor
8
- } from "./index-qssq2d41.js";
8
+ } from "./index-71y6176j.js";
9
9
  import {
10
10
  jsonText,
11
11
  workflowPlanApproval,
@@ -31,23 +31,23 @@ import {
31
31
  renderWorkflowApply,
32
32
  renderWorkflowValidation,
33
33
  renderWorkflowRunArtifact
34
- } from "./index-0gaj78wn.js";
34
+ } from "./index-zmd9xxgd.js";
35
35
  import {
36
36
  AkanContextAnalyzer
37
- } from "./index-bj8s07s7.js";
37
+ } from "./index-t2zhw8c7.js";
38
38
  import {
39
39
  ModuleScript
40
- } from "./index-m3t28rt3.js";
40
+ } from "./index-gt8phqpt.js";
41
41
  import {
42
42
  PrimitiveScript
43
- } from "./index-7bs463x7.js";
43
+ } from "./index-6dzjer7p.js";
44
44
  import {
45
45
  spawnAkan,
46
46
  isWorkspaceTarget
47
- } from "./index-42jhx2ya.js";
47
+ } from "./index-b2sdtgc7.js";
48
48
  import {
49
49
  ScalarScript
50
- } from "./index-nm7nt9vm.js";
50
+ } from "./index-4ss4gkv3.js";
51
51
  import {
52
52
  workflowSpecs
53
53
  } from "./index-t4d0ckde.js";