@akanjs/cli 3.3.0-rc.0 → 3.3.0-rc.2

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 (91) hide show
  1. package/.build-stamp +2 -2
  2. package/CodeAgent-xdw73nbz.js +11 -0
  3. package/{CodeTui-zee8atsr.js → CodeTui-0gewm71c.js} +4 -4
  4. package/TunnelShare-cccfdgbm.js +16 -0
  5. package/{agent.command-x65f2ags.js → agent.command-g1mj34wz.js} +20 -22
  6. package/akanCode.js +5 -5
  7. package/appExecutor-rrx10jya.js +11 -0
  8. package/{application.command-azbd1pb2.js → application.command-3w4v7t40.js} +17 -19
  9. package/{applicationBuildRunner-trfxv3pd.js → applicationBuildRunner-y5xbetyz.js} +12 -12
  10. package/buildBatch.proc.js +19 -18
  11. package/{cloud.command-gapp4634.js → cloud.command-ph0rz6sw.js} +19 -24
  12. package/cloud.script-8bs9tp4j.js +30 -0
  13. package/{code.command-5smx61yf.js → code.command-9b967qpg.js} +13 -13
  14. package/{context.command-ym5jbkny.js → context.command-ndzs5rbf.js} +20 -22
  15. package/context.runner-bmstpng2.js +32 -0
  16. package/csrArtifactBuilder-gtvff6k7.js +10 -0
  17. package/{index-2ny1e95c.js → dependencyScanner-93g8tk0r.js} +6 -5
  18. package/{fileSys-q22646yc.js → fileSys-e5mwt73x.js} +1 -1
  19. package/frameworkGraph-aneq2nwy.js +8 -0
  20. package/{guideline.command-zwypaqsh.js → guideline.command-y8qz9kxy.js} +8 -8
  21. package/incrementalBuilder.proc.js +24 -18
  22. package/{index-8jtqfye2.js → index-02v45hh9.js} +6 -6
  23. package/{index-2jmvfa62.js → index-0csk6jqm.js} +3 -3
  24. package/{index-nc3br31y.js → index-0wa5z6rm.js} +2 -2
  25. package/{index-9wh04mqy.js → index-0z8sbdme.js} +2 -2
  26. package/{index-zmd9xxgd.js → index-1c2807kg.js} +3 -3
  27. package/{index-4ss4gkv3.js → index-1p9bxjmt.js} +2 -2
  28. package/{index-612fdtbk.js → index-2kh4xj3m.js} +1 -1
  29. package/{index-kfvjzk8r.js → index-2vn0m9z5.js} +3 -3
  30. package/{index-xwwex8rf.js → index-3569fr49.js} +5 -5
  31. package/{index-a860mx0m.js → index-38x8ynrx.js} +24 -24
  32. package/{index-p7beqww9.js → index-3fmzz9sf.js} +18 -18
  33. package/{index-s885g0jj.js → index-45aprybg.js} +3 -3
  34. package/{index-v7ajmsh3.js → index-4a1n0nym.js} +1 -1
  35. package/{index-ybcb9wc8.js → index-4zgm54wf.js} +9 -9
  36. package/{index-2yn3r67f.js → index-652f3bs8.js} +6 -6
  37. package/{index-j6jjmn2r.js → index-6gepp8yn.js} +10 -10
  38. package/{index-dmcpetwe.js → index-6j351de4.js} +98 -23
  39. package/{index-0dm25wvf.js → index-7ssr7wq4.js} +1 -1
  40. package/{index-k6vwww45.js → index-82cmbpxc.js} +7 -7
  41. package/{index-j592zfqc.js → index-9rymt8d6.js} +1 -1
  42. package/{index-275a4r3n.js → index-ankyx6dj.js} +11 -15
  43. package/{index-41a03gkj.js → index-b0t92k71.js} +19 -19
  44. package/{index-z92zm3wd.js → index-b372rck5.js} +17 -6
  45. package/{index-78y75t0a.js → index-cm9rb480.js} +6 -6
  46. package/{index-z96ks033.js → index-d0n78fzc.js} +153 -45
  47. package/{index-gt8phqpt.js → index-dr1carpr.js} +4 -4
  48. package/{index-zfnz878d.js → index-f2arv0mv.js} +1 -1
  49. package/{index-67sd09ag.js → index-gtydr9qc.js} +8 -8
  50. package/{index-knpm8sdm.js → index-j3fqs8rc.js} +1 -1
  51. package/{index-h901f24n.js → index-jdw9m5c4.js} +5 -5
  52. package/{index-dadwp2aw.js → index-jg5rwrf7.js} +49 -22
  53. package/{index-baccvws5.js → index-ktxdfqg5.js} +1 -1
  54. package/{index-w1zexzpx.js → index-mnhrqjjq.js} +1 -1
  55. package/{index-71y6176j.js → index-pc42gxa5.js} +7 -7
  56. package/{index-6dzjer7p.js → index-q8h4eg5y.js} +6 -6
  57. package/{index-j0wr4e32.js → index-qh81drde.js} +9 -9
  58. package/{index-jek2re5k.js → index-scfsqen7.js} +4 -4
  59. package/{index-0s7w2085.js → index-twjgmryg.js} +4 -4
  60. package/{index-7wf8snar.js → index-whvhsb5f.js} +1 -1
  61. package/{index-p5zh7pmc.js → index-xv3pvdw4.js} +1 -1
  62. package/{index-3txdtztz.js → index-y2g0s9tn.js} +1 -1
  63. package/{index-ebn9kgea.js → index-ymgsvhc5.js} +4 -5
  64. package/{index-by2tvsq6.js → index-zyjztrvc.js} +1 -1
  65. package/index.js +30 -28
  66. package/{libExecutor-jc6f8hm6.js → libExecutor-nstr00s7.js} +3 -3
  67. package/{library.command-nxvesvhb.js → library.command-b02aw1hm.js} +8 -8
  68. package/{localRegistry.command-xz62e4ng.js → localRegistry.command-3hg1p4aj.js} +18 -23
  69. package/{module.command-aaws9byg.js → module.command-bd9gz6cv.js} +10 -10
  70. package/{package.command-j7hv26p0.js → package.command-xmr0mxze.js} +9 -12
  71. package/package.json +2 -2
  72. package/{page.command-7yffs7n9.js → page.command-x94qf58g.js} +8 -8
  73. package/{pipeline.command-7yk0zcng.js → pipeline.command-n2843k6t.js} +7 -7
  74. package/{pkgExecutor-arxmvx4t.js → pkgExecutor-cka27e3c.js} +3 -3
  75. package/{primitive.command-7a1pt715.js → primitive.command-cs7v376h.js} +11 -11
  76. package/{projectTypecheck-f4qhbecd.js → projectTypecheck-za2n3nbr.js} +1 -1
  77. package/{prompter-qyggfhqd.js → prompter-d33wmdpa.js} +2 -2
  78. package/{quality.command-c6mvrjh1.js → quality.command-nqngh1jd.js} +9 -9
  79. package/{repair.command-093adzt9.js → repair.command-v2medwsm.js} +10 -10
  80. package/{scalar.command-2ex84spb.js → scalar.command-61cjmxn1.js} +9 -9
  81. package/{subspace.command-4n4n4jpv.js → subspace.command-dtv8nfh7.js} +11 -13
  82. package/{tunnel.command-f7ep1qfa.js → tunnel.command-fmwm5fgb.js} +10 -12
  83. package/{verify.command-zrkxnvct.js → verify.command-4f260t53.js} +15 -17
  84. package/{workflow.command-ks16jegk.js → workflow.command-tm5q9xsm.js} +15 -15
  85. package/{workspace.command-ahhfpaag.js → workspace.command-75gc280j.js} +34 -38
  86. package/CodeAgent-fx6088tv.js +0 -11
  87. package/TunnelShare-9ry4vh0y.js +0 -18
  88. package/appExecutor-79azsb2w.js +0 -11
  89. package/cloud.script-3b401efv.js +0 -35
  90. package/context.runner-kctbfsde.js +0 -34
  91. package/dependencyScanner-ge10gb52.js +0 -8
@@ -4,22 +4,22 @@ import {
4
4
  SysExecutor,
5
5
  AppInfo,
6
6
  WorkspaceExecutor
7
- } from "./index-71y6176j.js";
7
+ } from "./index-pc42gxa5.js";
8
8
  import {
9
9
  FileSys2
10
- } from "./index-by2tvsq6.js";
10
+ } from "./index-zyjztrvc.js";
11
11
  import {
12
12
  CliError
13
13
  } from "./index-j4yvgfhr.js";
14
14
  import {
15
15
  AppExecutor2
16
- } from "./index-z92zm3wd.js";
16
+ } from "./index-b372rck5.js";
17
17
  import {
18
18
  LibExecutor2
19
- } from "./index-zfnz878d.js";
19
+ } from "./index-f2arv0mv.js";
20
20
  import {
21
21
  PkgExecutor2
22
- } from "./index-w1zexzpx.js";
22
+ } from "./index-mnhrqjjq.js";
23
23
  import {
24
24
  UNAVAILABLE_REDIS_HOST,
25
25
  redisTunnelPolicy,
@@ -55,27 +55,27 @@ import {
55
55
  filesChangedSince,
56
56
  HmrWatcher,
57
57
  WatchRootResolver
58
- } from "./index-dmcpetwe.js";
58
+ } from "./index-6j351de4.js";
59
59
  import {
60
60
  runner,
61
61
  assertPromptable
62
- } from "./index-2yn3r67f.js";
62
+ } from "./index-652f3bs8.js";
63
63
  import {
64
64
  UpdatePackFolder,
65
65
  UpdateUploader,
66
66
  NativePublicEnv,
67
67
  NativeApp
68
- } from "./index-ebn9kgea.js";
68
+ } from "./index-ymgsvhc5.js";
69
69
  import {
70
70
  DesktopServerStage
71
- } from "./index-612fdtbk.js";
71
+ } from "./index-2kh4xj3m.js";
72
72
  import {
73
73
  resolveMobileTargets,
74
74
  resolveAppId
75
75
  } from "./index-m9jj544v.js";
76
76
  import {
77
77
  SlicePlanner
78
- } from "./index-j592zfqc.js";
78
+ } from "./index-9rymt8d6.js";
79
79
  import {
80
80
  openBrowser
81
81
  } from "./index-9dp031by.js";
@@ -88,9 +88,11 @@ import {
88
88
 
89
89
  // pkgs/@akanjs/cli/application/application.runner.ts
90
90
  import { existsSync, realpathSync as realpathSync2 } from "fs";
91
- import path7 from "path";
91
+ import path8 from "path";
92
92
 
93
93
  // pkgs/@akanjs/devkit/akanApp/akanApp.host.ts
94
+ import fs2 from "fs";
95
+ import path5 from "path";
94
96
  import { Logger as Logger2 } from "akanjs/common";
95
97
 
96
98
  // pkgs/@akanjs/devkit/tunnel/createTunnel.ts
@@ -740,6 +742,10 @@ class IncrementalBuilderHost {
740
742
  return;
741
743
  if (!msg || typeof msg !== "object")
742
744
  return;
745
+ if (msg.type === "base-built") {
746
+ this.#startOptions.onBaseBuilt?.(msg.phaseMs);
747
+ return;
748
+ }
743
749
  if (msg.type === "build-route-res" || msg.type === "build-csr-res" || msg.type === "build-graph-res")
744
750
  this.#inFlight.delete(msg.id);
745
751
  if (builderMsgTypeSet.has(msg.type))
@@ -1185,7 +1191,7 @@ class DevBackend {
1185
1191
  const backend = Bun.spawn(["bun", `apps/${this.#app.name}/main.ts`], {
1186
1192
  cwd: this.#app.workspace.workspaceRoot,
1187
1193
  stdio: this.#stdio === "pipe" ? ["ignore", "pipe", "pipe"] : ["inherit", "inherit", "inherit"],
1188
- env: this.#env,
1194
+ env: this.#links.awaitsArtifact() ? { ...this.#env, AKAN_DEV_AWAIT_ARTIFACT: "1" } : this.#env,
1189
1195
  ipc: (msg) => {
1190
1196
  if (!msg || typeof msg !== "object")
1191
1197
  return;
@@ -1518,7 +1524,7 @@ class DevBuilder {
1518
1524
  this.#host = builder;
1519
1525
  try {
1520
1526
  await this.#waitForReady(attempt, { announceBootState });
1521
- this.#app.verbose(`[cli] base build ready in ${Date.now() - startTime}ms \u2014 starting backend`);
1527
+ this.#app.verbose(`[cli] base build ready in ${Date.now() - startTime}ms`);
1522
1528
  return this.#host;
1523
1529
  } catch (err) {
1524
1530
  lastError = err;
@@ -1623,6 +1629,9 @@ class DevBuilder {
1623
1629
  settle(resolve);
1624
1630
  this.#links.onReady();
1625
1631
  },
1632
+ onBaseBuilt: (phaseMs) => {
1633
+ this.#links.onBaseBuilt(phaseMs);
1634
+ },
1626
1635
  onRestartReady: () => {
1627
1636
  this.#links.onRestartReady();
1628
1637
  }
@@ -2104,6 +2113,69 @@ class DevRecycler {
2104
2113
  }
2105
2114
  }
2106
2115
 
2116
+ // pkgs/@akanjs/devkit/akanApp/devStartTimeline.ts
2117
+ var BASE_BUILD_PARTS = ["runtime", "routes", "styles", "dictionary", "pages"];
2118
+
2119
+ class DevStartTimeline {
2120
+ #logger;
2121
+ #now;
2122
+ #marks = {};
2123
+ #basePhaseMs = {};
2124
+ #reported = true;
2125
+ constructor(logger, now = () => performance.now()) {
2126
+ this.#logger = logger;
2127
+ this.#now = now;
2128
+ }
2129
+ begin() {
2130
+ this.#marks = { started: this.#now() };
2131
+ this.#basePhaseMs = {};
2132
+ this.#reported = false;
2133
+ }
2134
+ baseBuilt(phaseMs) {
2135
+ if (this.#reported || this.#marks.baseBuilt !== undefined)
2136
+ return;
2137
+ this.#basePhaseMs = phaseMs;
2138
+ this.#marks.baseBuilt = this.#now();
2139
+ }
2140
+ mark(mark) {
2141
+ if (this.#reported)
2142
+ return;
2143
+ if (mark === "backendSpawned")
2144
+ this.#marks.backendSpawned = this.#now();
2145
+ else
2146
+ this.#marks[mark] ??= this.#now();
2147
+ this.#report();
2148
+ }
2149
+ #report() {
2150
+ const { started, baseBuilt, builderReady, backendSpawned, backendReady } = this.#marks;
2151
+ if (started === undefined || builderReady === undefined || backendReady === undefined)
2152
+ return;
2153
+ this.#reported = true;
2154
+ const ms = (value) => Math.round(value).toString();
2155
+ const parts = [`prepare ${ms(started)}`, `builder ${ms(builderReady - started)}${this.#builderParts()}`];
2156
+ if (backendSpawned !== undefined) {
2157
+ const afterArtifact = baseBuilt !== undefined && backendSpawned < baseBuilt && baseBuilt <= backendReady ? ` (${ms(backendReady - baseBuilt)} after the artifact)` : "";
2158
+ parts.push(`backend ${ms(backendReady - backendSpawned)}${afterArtifact}`);
2159
+ }
2160
+ if (baseBuilt !== undefined)
2161
+ parts.push(`first artifact at ${ms(baseBuilt)}`);
2162
+ this.#logger.info(`ready in ${ms(Math.max(builderReady, backendReady))}ms (${parts.join(" \xB7 ")})`);
2163
+ }
2164
+ #builderParts() {
2165
+ const { started, baseBuilt, builderReady } = this.#marks;
2166
+ if (started === undefined || baseBuilt === undefined || builderReady === undefined)
2167
+ return "";
2168
+ const total = this.#basePhaseMs.total ?? 0;
2169
+ const base = BASE_BUILD_PARTS.flatMap((part) => {
2170
+ const partMs = this.#basePhaseMs[part];
2171
+ return partMs === undefined ? [] : [`${part} ${Math.round(partMs)}`];
2172
+ });
2173
+ const spawn = Math.max(0, Math.round(baseBuilt - started - total));
2174
+ const watch = Math.max(0, Math.round(builderReady - baseBuilt));
2175
+ return `: spawn ${spawn} + base build ${Math.round(total)} [${base.join(" \xB7 ")}] + watch ${watch}`;
2176
+ }
2177
+ }
2178
+
2107
2179
  // pkgs/@akanjs/devkit/akanApp/akanApp.host.ts
2108
2180
  class AkanAppHost {
2109
2181
  app;
@@ -2114,6 +2186,7 @@ class AkanAppHost {
2114
2186
  #lastDevState = null;
2115
2187
  #bootLatch = new DevBootLatch(() => this.#onDevEvent?.({ app: this.app.name, booted: true }));
2116
2188
  #stopping = false;
2189
+ #firstArtifact = "settled";
2117
2190
  #builderMessageQueue = Promise.resolve();
2118
2191
  #backendGraph;
2119
2192
  #statuses;
@@ -2124,6 +2197,7 @@ class AkanAppHost {
2124
2197
  #builder;
2125
2198
  #idle;
2126
2199
  #recycler;
2200
+ #timeline;
2127
2201
  constructor(app, {
2128
2202
  env,
2129
2203
  stdio = "inherit",
@@ -2139,13 +2213,20 @@ class AkanAppHost {
2139
2213
  const isStopping = () => this.#stopping;
2140
2214
  const statuses = new DevBuildStatusBoard(logger);
2141
2215
  this.#statuses = statuses;
2216
+ this.#timeline = new DevStartTimeline(logger);
2142
2217
  this.#backend = new DevBackend(app, { env, stdio, logger, statuses, graph }, {
2143
2218
  isStopping,
2144
- emit: (state, detail) => this.#emitDevEvent(state, detail),
2219
+ emit: (state, detail) => {
2220
+ if (state === "ready")
2221
+ this.#timeline.mark("backendReady");
2222
+ this.#emitDevEvent(state, detail);
2223
+ },
2145
2224
  beforeSpawn: () => {
2225
+ this.#timeline.mark("backendSpawned");
2146
2226
  this.#requests.startGeneration();
2147
2227
  this.#requests.discard("the backend restarted while the builder was away");
2148
2228
  },
2229
+ awaitsArtifact: () => this.#firstArtifact === "pending",
2149
2230
  toBuilder: (message) => this.#requests.send(message)
2150
2231
  });
2151
2232
  this.#gap = new BuilderGap({ graph, backend: this.#backend, logger });
@@ -2166,7 +2247,17 @@ class AkanAppHost {
2166
2247
  isStopping,
2167
2248
  onMessage: (message) => this.#enqueueBuilderMessage(message),
2168
2249
  onAway: () => this.#gap.open("builder replacement"),
2169
- onReady: () => this.#requests.flush(),
2250
+ onReady: () => {
2251
+ this.#timeline.mark("builderReady");
2252
+ this.#requests.flush();
2253
+ },
2254
+ onBaseBuilt: (phaseMs) => {
2255
+ this.#timeline.baseBuilt(phaseMs);
2256
+ if (this.#firstArtifact === "built")
2257
+ this.#backend.scheduleRestart({ files: [], roles: [] });
2258
+ else if (this.#firstArtifact === "pending")
2259
+ this.#firstArtifact = "built";
2260
+ },
2170
2261
  onRestartReady: () => {
2171
2262
  this.logger.verbose("[builder-recovery] builder ready after restart; replaying latest state");
2172
2263
  this.#backend.replay();
@@ -2220,13 +2311,30 @@ class AkanAppHost {
2220
2311
  await this.#backend.stop();
2221
2312
  if (this.#builder.current)
2222
2313
  this.#builder.stop();
2223
- const [redisHost] = await Promise.all([
2224
- this.#prepareDatabase("redis"),
2225
- this.#backendGraph.refresh(),
2226
- this.#builder.start()
2227
- ]);
2228
- Object.assign(this.env, { REDIS_HOST: redisHost });
2229
- this.#backend.start();
2314
+ this.#timeline.begin();
2315
+ const artifactFile = path5.join(this.app.cwdPath, ".akan/artifact/base-artifact.json");
2316
+ this.#firstArtifact = fs2.existsSync(artifactFile) ? "settled" : "pending";
2317
+ const prepared = Promise.all([this.#prepareDatabase("redis"), this.#backendGraph.refresh()]).then(([redisHost]) => {
2318
+ Object.assign(this.env, { REDIS_HOST: redisHost });
2319
+ if (this.#firstArtifact !== "settled")
2320
+ this.#backend.start();
2321
+ });
2322
+ try {
2323
+ await Promise.all([this.#builder.start(), prepared]);
2324
+ } catch (error) {
2325
+ this.#firstArtifact = "settled";
2326
+ if (!this.#stopping)
2327
+ await this.#backend.stop();
2328
+ throw error;
2329
+ }
2330
+ const artifactMissing = this.#firstArtifact === "pending" && !fs2.existsSync(artifactFile);
2331
+ this.#firstArtifact = "settled";
2332
+ if (artifactMissing && !this.#stopping) {
2333
+ await this.#backend.restarting;
2334
+ await this.#backend.stop();
2335
+ }
2336
+ if (!this.#backend.running)
2337
+ this.#backend.start();
2230
2338
  this.#idle.arm();
2231
2339
  return this;
2232
2340
  }
@@ -2319,16 +2427,16 @@ class AkanAppHost {
2319
2427
  }
2320
2428
  }
2321
2429
  // pkgs/@akanjs/devkit/app/applicationTestPreload.ts
2322
- import path5 from "path";
2430
+ import path6 from "path";
2323
2431
  var SIGNAL_TEST_PRELOAD_PATH = "test/signalTest.preload.ts";
2324
2432
  async function resolveSignalTestPreloadPath(target) {
2325
2433
  const candidates = [];
2326
- for (const basePath of [target.cwdPath, process.cwd(), path5.dirname(Bun.main), import.meta.dir]) {
2434
+ for (const basePath of [target.cwdPath, process.cwd(), path6.dirname(Bun.main), import.meta.dir]) {
2327
2435
  try {
2328
- candidates.push(path5.join(path5.dirname(Bun.resolveSync("akanjs/package.json", basePath)), SIGNAL_TEST_PRELOAD_PATH));
2436
+ candidates.push(path6.join(path6.dirname(Bun.resolveSync("akanjs/package.json", basePath)), SIGNAL_TEST_PRELOAD_PATH));
2329
2437
  } catch {}
2330
2438
  }
2331
- candidates.push(path5.join(target.cwdPath, "../../node_modules/akanjs", SIGNAL_TEST_PRELOAD_PATH), path5.join(target.cwdPath, "../../pkgs/akanjs", SIGNAL_TEST_PRELOAD_PATH), path5.join(process.cwd(), "node_modules/akanjs", SIGNAL_TEST_PRELOAD_PATH), path5.join(process.cwd(), "pkgs/akanjs", SIGNAL_TEST_PRELOAD_PATH), path5.join(path5.dirname(Bun.main), "../../akanjs", SIGNAL_TEST_PRELOAD_PATH), path5.resolve(import.meta.dir, "../../../akanjs", SIGNAL_TEST_PRELOAD_PATH));
2439
+ candidates.push(path6.join(target.cwdPath, "../../node_modules/akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.join(target.cwdPath, "../../pkgs/akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.join(process.cwd(), "node_modules/akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.join(process.cwd(), "pkgs/akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.join(path6.dirname(Bun.main), "../../akanjs", SIGNAL_TEST_PRELOAD_PATH), path6.resolve(import.meta.dir, "../../../akanjs", SIGNAL_TEST_PRELOAD_PATH));
2332
2440
  const uniqueCandidates = [...new Set(candidates)];
2333
2441
  for (const candidate of uniqueCandidates)
2334
2442
  if (await Bun.file(candidate).exists())
@@ -2344,7 +2452,7 @@ import { Logger as Logger4, toError } from "akanjs/common";
2344
2452
 
2345
2453
  // pkgs/@akanjs/cli/application/testTarget.ts
2346
2454
  import { readdirSync, realpathSync, statSync } from "fs";
2347
- import path6 from "path";
2455
+ import path7 from "path";
2348
2456
  import { Logger as Logger3 } from "akanjs/common";
2349
2457
  var testFileName = /[._](test|spec)\.[cm]?[jt]sx?$/i;
2350
2458
  var hasTestFile = (dir, seen = new Set) => {
@@ -2353,7 +2461,7 @@ var hasTestFile = (dir, seen = new Set) => {
2353
2461
  return false;
2354
2462
  seen.add(real);
2355
2463
  return readdirSync(dir, { withFileTypes: true }).some((entry) => {
2356
- const entryPath = path6.join(dir, entry.name);
2464
+ const entryPath = path7.join(dir, entry.name);
2357
2465
  const isDir = entry.isDirectory() || entry.isSymbolicLink() && statSync(entryPath, { throwIfNoEntry: false })?.isDirectory();
2358
2466
  if (!isDir)
2359
2467
  return testFileName.test(entry.name);
@@ -2362,7 +2470,7 @@ var hasTestFile = (dir, seen = new Set) => {
2362
2470
  };
2363
2471
  var testTargetOf = (exec) => {
2364
2472
  const root = exec instanceof SysExecutor || exec instanceof PkgExecutor2 ? exec.workspace.workspaceRoot : process.cwd();
2365
- return { root, target: path6.relative(root, exec.cwdPath).split(path6.sep).join("/") };
2473
+ return { root, target: path7.relative(root, exec.cwdPath).split(path7.sep).join("/") };
2366
2474
  };
2367
2475
  var reportsNoTestFile = (exec) => {
2368
2476
  if (hasTestFile(exec.cwdPath))
@@ -2373,7 +2481,7 @@ var reportsNoTestFile = (exec) => {
2373
2481
  };
2374
2482
 
2375
2483
  // pkgs/@akanjs/cli/application/application.runner.ts
2376
- var loadBuildRunner = async () => (await import("./applicationBuildRunner-trfxv3pd.js")).ApplicationBuildRunner;
2484
+ var loadBuildRunner = async () => (await import("./applicationBuildRunner-y5xbetyz.js")).ApplicationBuildRunner;
2377
2485
  var loadPrompts = async () => await import("@inquirer/prompts");
2378
2486
 
2379
2487
  class ApplicationRunner extends runner("application") {
@@ -2425,7 +2533,7 @@ class ApplicationRunner extends runner("application") {
2425
2533
  });
2426
2534
  }
2427
2535
  static runtimeDirOf(app, override) {
2428
- return path7.resolve(override ?? process.env.AKAN_RUNTIME_DIR ?? path7.join(app.workspace.workspaceRoot, "local", "apps", app.name, "runtime"));
2536
+ return path8.resolve(override ?? process.env.AKAN_RUNTIME_DIR ?? path8.join(app.workspace.workspaceRoot, "local", "apps", app.name, "runtime"));
2429
2537
  }
2430
2538
  async runLogs(app, options) {
2431
2539
  const { LogControlUnavailableError, LogTailClient } = await import("akanjs/server/logging/logTailClient");
@@ -2451,7 +2559,7 @@ class ApplicationRunner extends runner("application") {
2451
2559
  });
2452
2560
  } catch (error) {
2453
2561
  if (error instanceof LogControlUnavailableError)
2454
- throw new Error(`${app.name} is not running (no ${path7.basename(socketPath)} in ${runtimeDir}). Start it with \`akan start ${app.name}\`, or pass --runtime-dir for a built app.`);
2562
+ throw new Error(`${app.name} is not running (no ${path8.basename(socketPath)} in ${runtimeDir}). Start it with \`akan start ${app.name}\`, or pass --runtime-dir for a built app.`);
2455
2563
  throw error;
2456
2564
  }
2457
2565
  const sinceMs = since ? LogQueryMatcher.parseSince(since) : undefined;
@@ -2513,7 +2621,7 @@ try {
2513
2621
  const serverPath = `${app.cwdPath}/server.ts`;
2514
2622
  if (!await app.exists("server.ts"))
2515
2623
  throw new Error(`Server file not found: apps/${app.name}/server.ts`);
2516
- const target = path7.resolve(app.workspace.workspaceRoot, dir);
2624
+ const target = path8.resolve(app.workspace.workspaceRoot, dir);
2517
2625
  const code = `
2518
2626
  const { server } = await import(${JSON.stringify(serverPath)});
2519
2627
  const { DatabaseAdaptorRole, DocumentTransfer } = await import("akanjs/service");
@@ -2574,7 +2682,7 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
2574
2682
  await new (await loadBuildRunner())(app).typecheck(options);
2575
2683
  }
2576
2684
  async typecheckLibrary(lib, options = {}) {
2577
- const { ProjectTypecheck } = await import("./projectTypecheck-f4qhbecd.js");
2685
+ const { ProjectTypecheck } = await import("./projectTypecheck-za2n3nbr.js");
2578
2686
  const root = lib.workspace.workspaceRoot;
2579
2687
  await new ProjectTypecheck(lib.cwdPath, root, { ...process.env, AKAN_WORKSPACE_ROOT: root }).run([
2580
2688
  "../../server.ts",
@@ -2587,14 +2695,14 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
2587
2695
  }
2588
2696
  resolveTestPaths(exec, files) {
2589
2697
  const { root, target } = testTargetOf(exec);
2590
- const isInside = (relative) => relative !== ".." && !relative.startsWith(`..${path7.sep}`) && !path7.isAbsolute(relative);
2698
+ const isInside = (relative) => relative !== ".." && !relative.startsWith(`..${path8.sep}`) && !path8.isAbsolute(relative);
2591
2699
  return files.map((file) => {
2592
- const candidates = path7.isAbsolute(file) ? [file] : [path7.resolve(exec.cwdPath, file), path7.resolve(root, file)];
2593
- const existing = candidates.filter((candidate) => existsSync(candidate)).map((candidate) => path7.relative(exec.cwdPath, candidate));
2700
+ const candidates = path8.isAbsolute(file) ? [file] : [path8.resolve(exec.cwdPath, file), path8.resolve(root, file)];
2701
+ const existing = candidates.filter((candidate) => existsSync(candidate)).map((candidate) => path8.relative(exec.cwdPath, candidate));
2594
2702
  const found = existing.find(isInside);
2595
2703
  if (found === undefined)
2596
2704
  throw new Error(existing.length ? `${file} is outside ${target}: akan test ${exec.name} runs its own tests only` : `${file} names no file or folder in ${target}`);
2597
- return `./${found.split(path7.sep).join("/")}`;
2705
+ return `./${found.split(path8.sep).join("/")}`;
2598
2706
  });
2599
2707
  }
2600
2708
  async test(exec, testPaths = [], flags = []) {
@@ -2607,7 +2715,7 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
2607
2715
  AKAN_TEST_TARGET_TYPE: exec.type,
2608
2716
  AKAN_TEST_TARGET_NAME: exec.name,
2609
2717
  AKAN_TEST_LIBS: exec.getScanInfo({ allowEmpty: true })?.getLibs().join(",") ?? "",
2610
- AKAN_RUNTIME_DIR: path7.join(exec.workspace.workspaceRoot, "local", `${exec.type}s`, exec.name, "runtime")
2718
+ AKAN_RUNTIME_DIR: path8.join(exec.workspace.workspaceRoot, "local", `${exec.type}s`, exec.name, "runtime")
2611
2719
  } : {};
2612
2720
  const args = ["test", "--isolate", ...flags, ...preloadPath ? ["--preload", preloadPath] : [], ...testPaths];
2613
2721
  await exec.spawn("bun", args, {
@@ -2724,7 +2832,7 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
2724
2832
  try {
2725
2833
  return realpathSync2.native(root);
2726
2834
  } catch {
2727
- return path7.resolve(root);
2835
+ return path8.resolve(root);
2728
2836
  }
2729
2837
  };
2730
2838
  return canonical(reported) === canonical(own);
@@ -2748,13 +2856,13 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
2748
2856
  if (!mobileTarget || targets.length > 1)
2749
2857
  throw new Error("pack-update packs one native target at a time; pass --target <name>.");
2750
2858
  const nativeApp = new NativeApp(app, mobileTarget, env);
2751
- await UpdatePackFolder.clear(path7.resolve(out ?? path7.join(nativeApp.updatesDir, platform)));
2859
+ await UpdatePackFolder.clear(path8.resolve(out ?? path8.join(nativeApp.updatesDir, platform)));
2752
2860
  const pinned = publicEnv ? await NativePublicEnv.load(publicEnv) : against ? await NativePublicEnv.recordedIn(against) : null;
2753
2861
  await this.#buildMobileCsr(app, env, undefined, pinned);
2754
2862
  const { pack } = await nativeApp.packUpdate(platform, { out });
2755
2863
  app.logger.info(`packed ${mobileTarget.name} ${platform} for channel '${pack.channel}' to ${pack.out}: ${pack.files} files, ${(pack.size / 1024).toFixed(0)} KiB, native API ${pack.nativeApi}`);
2756
2864
  if (against) {
2757
- const bundle = path7.join(pack.out, UpdatePackFolder.bundleFile);
2865
+ const bundle = path8.join(pack.out, UpdatePackFolder.bundleFile);
2758
2866
  const compat = await NativeApp.compareBundles(app.cwdPath, against, bundle);
2759
2867
  const envProblem = await NativePublicEnv.problemAgainst(against, bundle);
2760
2868
  await UpdatePackFolder.writeCompat(pack, {
@@ -3001,7 +3109,7 @@ ${detail}`
3001
3109
  }
3002
3110
 
3003
3111
  // pkgs/@akanjs/cli/verify/verifyScope.ts
3004
- import path8 from "path";
3112
+ import path9 from "path";
3005
3113
  import ts from "typescript";
3006
3114
 
3007
3115
  class VerifyScope {
@@ -3045,11 +3153,11 @@ class VerifyScope {
3045
3153
  }
3046
3154
  static async#libImportsIn(workspaceRoot, dir) {
3047
3155
  const libs = new Set;
3048
- const cwd = path8.join(workspaceRoot, dir);
3156
+ const cwd = path9.join(workspaceRoot, dir);
3049
3157
  for await (const file of new Bun.Glob("**/*.{ts,tsx}").scan({ cwd })) {
3050
3158
  if (/(^|[\\/])(node_modules|dist)[\\/]/.test(file))
3051
3159
  continue;
3052
- const text = await Bun.file(path8.join(cwd, file)).text();
3160
+ const text = await Bun.file(path9.join(cwd, file)).text();
3053
3161
  if (!text.includes("@libs/"))
3054
3162
  continue;
3055
3163
  for (const { fileName } of ts.preProcessFile(text, true, true).importedFiles) {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-2yn3r67f.js";
5
+ } from "./index-652f3bs8.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-zmd9xxgd.js";
13
+ } from "./index-1c2807kg.js";
14
14
  import {
15
15
  PageScript
16
- } from "./index-3txdtztz.js";
16
+ } from "./index-y2g0s9tn.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-7wf8snar.js";
25
+ } from "./index-whvhsb5f.js";
26
26
 
27
27
  // pkgs/@akanjs/cli/module/module.script.ts
28
28
  import { capitalize as capitalize2 } from "akanjs/common";
@@ -5,7 +5,7 @@ import {
5
5
  SysExecutor,
6
6
  WorkspaceExecutor,
7
7
  AkanLibConfig
8
- } from "./index-71y6176j.js";
8
+ } from "./index-pc42gxa5.js";
9
9
 
10
10
  // pkgs/@akanjs/devkit/executors/libExecutor.ts
11
11
  class LibExecutor2 extends SysExecutor {
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  CommandContainer,
4
4
  runner
5
- } from "./index-2yn3r67f.js";
5
+ } from "./index-652f3bs8.js";
6
6
  import {
7
7
  WorkspaceExecutor
8
- } from "./index-71y6176j.js";
8
+ } from "./index-pc42gxa5.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-zmd9xxgd.js";
34
+ } from "./index-1c2807kg.js";
35
35
  import {
36
36
  AkanContextAnalyzer
37
- } from "./index-h901f24n.js";
37
+ } from "./index-jdw9m5c4.js";
38
38
  import {
39
39
  ModuleScript
40
- } from "./index-gt8phqpt.js";
40
+ } from "./index-dr1carpr.js";
41
41
  import {
42
42
  PrimitiveScript
43
- } from "./index-6dzjer7p.js";
43
+ } from "./index-q8h4eg5y.js";
44
44
  import {
45
45
  spawnAkan,
46
46
  isWorkspaceTarget
47
- } from "./index-kfvjzk8r.js";
47
+ } from "./index-2vn0m9z5.js";
48
48
  import {
49
49
  ScalarScript
50
- } from "./index-4ss4gkv3.js";
50
+ } from "./index-1p9bxjmt.js";
51
51
  import {
52
52
  workflowSpecs
53
53
  } from "./index-t4d0ckde.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  getDirname2
4
- } from "./index-by2tvsq6.js";
4
+ } from "./index-zyjztrvc.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/guideline/conventionSet.ts
7
7
  import fsPromise from "fs/promises";
@@ -8,21 +8,21 @@ import {
8
8
  isScannedRootEntry,
9
9
  extractBlockVersion,
10
10
  readDevkitVersion
11
- } from "./index-71y6176j.js";
11
+ } from "./index-pc42gxa5.js";
12
12
  import {
13
13
  FileSys2
14
- } from "./index-by2tvsq6.js";
14
+ } from "./index-zyjztrvc.js";
15
15
  import {
16
16
  AppExecutor2
17
- } from "./index-z92zm3wd.js";
17
+ } from "./index-b372rck5.js";
18
18
  import {
19
19
  LibExecutor2
20
- } from "./index-zfnz878d.js";
20
+ } from "./index-f2arv0mv.js";
21
21
  import {
22
22
  workflowPathsForPlan,
23
23
  workflowRunArtifactPath,
24
24
  workflowSyncDir
25
- } from "./index-zmd9xxgd.js";
25
+ } from "./index-1c2807kg.js";
26
26
  import {
27
27
  collectRecipeSources2,
28
28
  scanRecipes2,