@akanjs/cli 3.1.1-rc.1 → 3.1.1-rc.11

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 (75) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-4pnxwptq.js → CodeAgent-5t8m16w8.js} +2 -2
  3. package/{CodeTui-hhndze8h.js → CodeTui-drgacyvs.js} +1 -1
  4. package/TunnelShare-26ty9skr.js +14 -0
  5. package/{agent.command-p02330r6.js → agent.command-h82gepwn.js} +5 -5
  6. package/akanCode.js +2 -2
  7. package/{application.command-1117fgq9.js → application.command-j1reb9p1.js} +11 -11
  8. package/{applicationBuildRunner-9cnnsdm5.js → applicationBuildRunner-w20x63mz.js} +74 -26
  9. package/buildBatch.proc.js +5 -5
  10. package/{cloud.command-ttb2s2x6.js → cloud.command-zd2mfkm0.js} +22 -17
  11. package/cloud.script-vdj8ymch.js +24 -0
  12. package/{code.command-16pm1p2v.js → code.command-w1rt357h.js} +6 -6
  13. package/{context.command-6ys86sqf.js → context.command-d35ppstw.js} +16 -16
  14. package/context.runner-azvkkzdr.js +25 -0
  15. package/{guideline.command-3zay3d8g.js → guideline.command-xwkskvky.js} +2 -2
  16. package/guidelines/agentRule/agentRule.instruction.md +21 -4
  17. package/guidelines/conventions/conventions.instruction.md +10 -7
  18. package/guidelines/pageRule/pageRule.instruction.md +9 -0
  19. package/guidelines/queryRule/queryRule.instruction.md +13 -1
  20. package/guidelines/runtimeRule/runtimeRule.instruction.md +12 -0
  21. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +2 -1
  22. package/incrementalBuilder.proc.js +3 -3
  23. package/{index-rr7jk14m.js → index-1e2955yd.js} +23 -10
  24. package/{index-z9xepn8t.js → index-2qzzp0c9.js} +557 -142
  25. package/{index-e9e9cebg.js → index-4rwfh2de.js} +3 -3
  26. package/{index-fmder14z.js → index-553xyb55.js} +1 -1
  27. package/{index-9hbhm6cs.js → index-657908e5.js} +1 -1
  28. package/{index-1mfyyxh5.js → index-6pzt55w3.js} +3 -3
  29. package/{index-4w3skd33.js → index-6y1991s6.js} +3 -3
  30. package/{index-zn6bn1s2.js → index-7abjzny1.js} +4 -4
  31. package/{index-2ar6tffh.js → index-7ktk2hnz.js} +67 -19
  32. package/{index-bb4hj03s.js → index-7yzcaymm.js} +10 -10
  33. package/{index-ngpn9hzy.js → index-8jb5ep2e.js} +2 -2
  34. package/{index-ekpp5tax.js → index-8rvwgd1r.js} +4 -97
  35. package/{index-sww1x1mv.js → index-brpk7gd8.js} +56 -9
  36. package/{index-7f0edwsj.js → index-ch1sv7ke.js} +57 -12
  37. package/{index-jgs8z8xb.js → index-cz9g85xh.js} +1 -1
  38. package/{index-tk3jg2bm.js → index-hdzjaq7s.js} +4 -3
  39. package/{index-sng3vt0p.js → index-kbbyzs6j.js} +2 -2
  40. package/{index-z6v7k9sb.js → index-kr62ph5a.js} +24 -2
  41. package/{index-b5vptvnt.js → index-nmy1rana.js} +4 -4
  42. package/{index-ynqxpwx6.js → index-pqdz7rat.js} +1 -1
  43. package/{index-p4dnj2wc.js → index-qmeh0s05.js} +63 -8
  44. package/{index-qkcwsg6r.js → index-rshwdv9w.js} +2 -2
  45. package/{index-jaa81e9r.js → index-trvk51ht.js} +4 -4
  46. package/{index-1cq1hq12.js → index-tzzs52h0.js} +26 -15
  47. package/{index-qfzfaq96.js → index-wvvwdzfw.js} +3 -3
  48. package/{index-vcpbrrf2.js → index-xeh7m2j5.js} +1 -1
  49. package/{index-sh9mmp5v.js → index-y5m4j2w6.js} +7 -7
  50. package/{index-g2s33373.js → index-ygy8c12j.js} +1 -1
  51. package/{index-q8age5az.js → index-yknrmkmt.js} +2 -2
  52. package/index.js +22 -22
  53. package/{library.command-a8n9h8j4.js → library.command-td8t85kb.js} +3 -3
  54. package/{localRegistry.command-c2mxqf4h.js → localRegistry.command-jx9zkmxf.js} +12 -12
  55. package/{module.command-b6f1p1xa.js → module.command-j70mqgpp.js} +5 -5
  56. package/{package.command-tc27ftmy.js → package.command-1b1v6k5v.js} +3 -3
  57. package/package.json +2 -2
  58. package/{page.command-m5wyqfkd.js → page.command-m31w2tsz.js} +3 -3
  59. package/{pipeline.command-4qxyafpz.js → pipeline.command-q7b8wy55.js} +2 -2
  60. package/{primitive.command-9yaatk0d.js → primitive.command-4zrbhkb9.js} +6 -6
  61. package/{projectTypecheck-87k6z6ab.js → projectTypecheck-synx6qff.js} +1 -1
  62. package/{quality.command-fxn07zwp.js → quality.command-cy0pgqjz.js} +3 -3
  63. package/{repair.command-evg9g911.js → repair.command-98n6zxg7.js} +5 -5
  64. package/{scalar.command-xsejjeq1.js → scalar.command-rak5pjk3.js} +4 -4
  65. package/{subspace.command-4mjjxgmf.js → subspace.command-ej0rk116.js} +8 -8
  66. package/templates/app/tsconfig.json.template +2 -7
  67. package/templates/env/_env.server.type.ts +10 -5
  68. package/templates/facetIndex/index.ts +2 -2
  69. package/templates/workspaceRoot/bunfig.toml.template +0 -4
  70. package/{tunnel.command-7f41pm7y.js → tunnel.command-kdx3amrc.js} +7 -7
  71. package/{workflow.command-qpyq0ya5.js → workflow.command-gffk9nj9.js} +10 -10
  72. package/{workspace.command-qvwdqmnd.js → workspace.command-j1680trm.js} +33 -32
  73. package/TunnelShare-8qtffcex.js +0 -14
  74. package/cloud.script-fqp3zh02.js +0 -24
  75. package/context.runner-3jrypwe3.js +0 -25
@@ -6,15 +6,21 @@ import {
6
6
  CloudApi,
7
7
  CloudUpdates,
8
8
  PipelineSecrets
9
- } from "./index-2ar6tffh.js";
9
+ } from "./index-7ktk2hnz.js";
10
+ import {
11
+ resolveMobileTargets
12
+ } from "./index-m9jj544v.js";
10
13
  import {
11
14
  WorkspaceExecutor,
12
15
  AppExecutor
13
- } from "./index-rr7jk14m.js";
16
+ } from "./index-1e2955yd.js";
17
+ import {
18
+ NativeApp
19
+ } from "./index-2qzzp0c9.js";
14
20
  import {
15
21
  runner,
16
22
  assertPromptable
17
- } from "./index-p4dnj2wc.js";
23
+ } from "./index-qmeh0s05.js";
18
24
  import {
19
25
  SubspaceConfig
20
26
  } from "./index-4pf8g7ff.js";
@@ -288,6 +294,7 @@ class LinuxDockerTarget extends PlatformTestTarget {
288
294
  "run",
289
295
  "-d",
290
296
  "--rm",
297
+ "--init",
291
298
  "--name",
292
299
  container,
293
300
  "--cpus",
@@ -737,7 +744,7 @@ ${chalk2.green("\u27A4")} Authentication Required`));
737
744
  }
738
745
  Logger.rawLog(`
739
746
  ${chalk2.bold("Your code:")} ${chalk2.bold.inverse(` ${await RemoteAuthCode.of(remoteId)} `)}`);
740
- Logger.rawLog(chalk2.dim(`Enter this code on the sign-in page, and approve only if it matches what this terminal shows.
747
+ Logger.rawLog(chalk2.dim(`Enter this code on the sign-in page. Never enter a code that did not come from your own terminal.
741
748
  `));
742
749
  }
743
750
  async#awaitApproval(remoteId, loginId) {
@@ -772,17 +779,20 @@ ${chalk2.bold("Your code:")} ${chalk2.bold.inverse(` ${await RemoteAuthCode.of(r
772
779
  async#readSelf() {
773
780
  let reason = "";
774
781
  for (let attempt = 1;attempt <= this.#selfAttempts; attempt++) {
782
+ let self;
775
783
  try {
776
- const self = await this.#api.getRemoteSelf();
777
- if (self)
778
- return self;
779
- reason = "the server did not take the new session";
780
- break;
784
+ self = await this.#api.getRemoteSelf();
781
785
  } catch (error) {
782
786
  reason = RemoteLogin.#reasonOf(error);
787
+ if (attempt < this.#selfAttempts)
788
+ await this.#wait(Backoff.delay(attempt, { min: 1000, max: 8000 }));
789
+ continue;
783
790
  }
784
- if (attempt < this.#selfAttempts)
785
- await this.#wait(Backoff.delay(attempt, { min: 1000, max: 8000 }));
791
+ if (self)
792
+ return self;
793
+ const { host } = this.#api;
794
+ await GlobalConfig.setHostConfig(getDefaultHostConfig(host));
795
+ throw new Error(chalk2.red(`\u2716 ${host} did not take the session it handed out. Run akan login again.`));
786
796
  }
787
797
  Logger.rawLog(chalk2.yellow(`Could not read the signed-in account (${reason}).`));
788
798
  return null;
@@ -1098,7 +1108,7 @@ ${run.format(results)}
1098
1108
  const rootPackageJson = await workspace.getPackageJson();
1099
1109
  if (!rootPackageJson.dependencies)
1100
1110
  throw new Error("No dependencies found in package.json");
1101
- for (const name of ["akanjs", "@akanjs/devkit"]) {
1111
+ for (const name of ["akanjs", "@akanjs/devkit", "@akanjs/cli"]) {
1102
1112
  if (rootPackageJson.dependencies[name])
1103
1113
  rootPackageJson.dependencies[name] = latestPublishedVersion;
1104
1114
  if (rootPackageJson.devDependencies?.[name])
@@ -1242,6 +1252,41 @@ ${run.format(results)}
1242
1252
  async pushUpdate(cloudApi, devProjectId, pack, options) {
1243
1253
  return await new CloudUpdates(cloudApi, devProjectId).push(pack, options);
1244
1254
  }
1255
+ async readRelease(app, {
1256
+ platform,
1257
+ arch,
1258
+ target,
1259
+ env,
1260
+ channel
1261
+ }) {
1262
+ const targets = await resolveMobileTargets(app, target ?? undefined);
1263
+ const [mobileTarget] = targets;
1264
+ if (!mobileTarget || targets.length > 1)
1265
+ throw new Error("push-update uploads one native target's release at a time; pass --target <name>.");
1266
+ const { release, url, exeName } = await new NativeApp(app, mobileTarget, env).publishedRelease(platform, {
1267
+ arch,
1268
+ channel
1269
+ });
1270
+ const { signer, unread } = await release.signer({ exeName });
1271
+ if (unread)
1272
+ app.logger.warn(`release.json names no signer: ${unread}.`);
1273
+ return { release, url, signer, target: mobileTarget.name };
1274
+ }
1275
+ async pushRelease(cloudApi, devProjectId, app, {
1276
+ release,
1277
+ url,
1278
+ signer,
1279
+ target,
1280
+ notes
1281
+ }) {
1282
+ return await new CloudUpdates(cloudApi, devProjectId).pushRelease(release, {
1283
+ appName: app.name,
1284
+ target,
1285
+ notes,
1286
+ signer,
1287
+ url
1288
+ });
1289
+ }
1245
1290
  async registerBinary(cloudApi, devProjectId, app, pack, options) {
1246
1291
  return await new CloudUpdates(cloudApi, devProjectId).registerBinary(app, pack, options);
1247
1292
  }
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AsyncDefaultExportDetector,
4
4
  resolveSsrPageEntriesForApp
5
- } from "./index-rr7jk14m.js";
5
+ } from "./index-1e2955yd.js";
6
6
  import {
7
7
  FileSys2
8
8
  } from "./index-52w0fvh8.js";
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-p4dnj2wc.js";
5
+ } from "./index-qmeh0s05.js";
6
6
  import {
7
7
  FileSys2
8
8
  } from "./index-52w0fvh8.js";
9
9
  import {
10
10
  PkgExecutor
11
- } from "./index-rr7jk14m.js";
11
+ } from "./index-1e2955yd.js";
12
12
  import {
13
13
  TypeScriptDependencyScanner2
14
14
  } from "./index-tvehn2sp.js";
@@ -233,7 +233,8 @@ class PackageRunner extends runner("package") {
233
233
  const specifierPattern = new RegExp(`["'](${alternatives.join("|")})((?:/[^"'\\s]*)?)["']`, "g");
234
234
  const glob = new Bun.Glob(PackageRunner.#scannableDistFiles);
235
235
  const imports = new Map;
236
- for await (const relative of glob.scan({ cwd: distPath })) {
236
+ for await (const scanned of glob.scan({ cwd: distPath })) {
237
+ const relative = scanned.split(path2.sep).join("/");
237
238
  if (relative.includes("node_modules/") || relative.endsWith(".d.ts"))
238
239
  continue;
239
240
  if (/\.(test|spec)\.[a-z]+$/.test(relative))
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-p4dnj2wc.js";
5
+ } from "./index-qmeh0s05.js";
6
6
  import {
7
7
  generatedFilesForSync,
8
8
  createPassedPrimitiveReport,
9
9
  scalarChangedFiles
10
- } from "./index-ynqxpwx6.js";
10
+ } from "./index-pqdz7rat.js";
11
11
  import {
12
12
  pluralizeName
13
13
  } from "./index-nz8prx9g.js";
@@ -10,7 +10,7 @@ import {
10
10
  isScannedRootEntry,
11
11
  AppExecutor,
12
12
  LibExecutor
13
- } from "./index-rr7jk14m.js";
13
+ } from "./index-1e2955yd.js";
14
14
  import {
15
15
  FileSys2
16
16
  } from "./index-52w0fvh8.js";
@@ -23,7 +23,7 @@ import {
23
23
  workflowPathsForPlan,
24
24
  workflowRunArtifactPath,
25
25
  workflowSyncDir
26
- } from "./index-ynqxpwx6.js";
26
+ } from "./index-pqdz7rat.js";
27
27
 
28
28
  // pkgs/@akanjs/devkit/akanContext.ts
29
29
  import { readdir } from "fs/promises";
@@ -372,6 +372,25 @@ class AkanContextAnalyzer {
372
372
  hint
373
373
  };
374
374
  }
375
+ static async#configLeftovers(workspace, sysPaths) {
376
+ const leftovers = [];
377
+ for (const sysPath of sysPaths) {
378
+ const tsconfigPath = `${sysPath}/tsconfig.json`;
379
+ const tsconfig = await safeReadText(path.join(workspace.workspaceRoot, tsconfigPath));
380
+ if (tsconfig && (/"name"\s*:\s*"next"/.test(tsconfig) || tsconfig.includes(".next/types")))
381
+ leftovers.push({
382
+ path: tsconfigPath,
383
+ message: `${tsconfigPath} still names the Next.js TS plugin or .next/types, which Akan never uses \u2014 delete the "next" plugin entry and the ".next/types/**/*.ts" include.`
384
+ });
385
+ }
386
+ const bunfig = await safeReadText(path.join(workspace.workspaceRoot, "bunfig.toml"));
387
+ if (bunfig?.includes("bun-plugin-tailwind"))
388
+ leftovers.push({
389
+ path: "bunfig.toml",
390
+ message: "bunfig.toml still loads bun-plugin-tailwind, which is not installed and which Akan never uses (it compiles Tailwind itself) \u2014 delete the [serve.static] section, which Akan never reads."
391
+ });
392
+ return leftovers;
393
+ }
375
394
  static async doctor(workspace, {
376
395
  strict = false,
377
396
  runIdOrPlan = null,
@@ -415,6 +434,9 @@ class AkanContextAnalyzer {
415
434
  const agentDrift = await AkanContextAnalyzer.#agentGuideDrift(workspace);
416
435
  if (agentDrift)
417
436
  report({ severity: "warning", code: agentDrift.code, path: "AGENTS.md", message: agentDrift.message }, repairAction("generated", "akan agent install agents-md", agentDrift.hint, true));
437
+ const sysPaths = [...context.apps, ...context.libs].map((sys) => sys.path);
438
+ for (const leftover of await AkanContextAnalyzer.#configLeftovers(workspace, sysPaths))
439
+ diagnostics.push({ severity: "warning", code: "config-leftover", ...leftover });
418
440
  for (const sys of [...context.apps, ...context.libs]) {
419
441
  for (const module of sys.modules) {
420
442
  const moduleShapeCommand = `akan repair module-shape --app ${sys.name} --module ${module.name}`;
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-p4dnj2wc.js";
5
+ } from "./index-qmeh0s05.js";
6
6
  import {
7
7
  ModuleExecutor
8
- } from "./index-rr7jk14m.js";
8
+ } from "./index-1e2955yd.js";
9
9
  import {
10
10
  sourceFile,
11
11
  moduleSourcePaths,
@@ -13,10 +13,10 @@ import {
13
13
  createPassedPrimitiveReport,
14
14
  bilingualLabelForField,
15
15
  bilingualDescriptionForField
16
- } from "./index-ynqxpwx6.js";
16
+ } from "./index-pqdz7rat.js";
17
17
  import {
18
18
  PageScript
19
- } from "./index-g2s33373.js";
19
+ } from "./index-ygy8c12j.js";
20
20
  import {
21
21
  pluralizeName
22
22
  } from "./index-nz8prx9g.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AppExecutor,
4
4
  LibExecutor
5
- } from "./index-rr7jk14m.js";
5
+ } from "./index-1e2955yd.js";
6
6
 
7
7
  // pkgs/@akanjs/devkit/workflow/artifacts.ts
8
8
  import { capitalize } from "akanjs/common";
@@ -10,7 +10,7 @@ import {
10
10
  LibExecutor,
11
11
  PkgExecutor,
12
12
  ModuleExecutor
13
- } from "./index-rr7jk14m.js";
13
+ } from "./index-1e2955yd.js";
14
14
 
15
15
  // pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
16
16
  var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
@@ -60,7 +60,7 @@ var Pkg = createInternalArgToken("Pkg");
60
60
  var Module = createInternalArgToken("Module");
61
61
  var Workspace = createInternalArgToken("Workspace");
62
62
  // pkgs/@akanjs/devkit/commandDecorators/command.ts
63
- import path2 from "path";
63
+ import path3 from "path";
64
64
  import { Logger } from "akanjs/common";
65
65
  import chalk2 from "chalk";
66
66
  import { program } from "commander";
@@ -299,6 +299,63 @@ var formatCommandHelp = (command, key) => {
299
299
  `);
300
300
  };
301
301
 
302
+ // pkgs/@akanjs/devkit/commandDecorators/workspaceVersionCheck.ts
303
+ import { existsSync, readFileSync, realpathSync } from "fs";
304
+ import path2 from "path";
305
+
306
+ class WorkspaceVersionCheck {
307
+ static #exemptCommands = new Set(["update", "create-workspace"]);
308
+ static #infoFlags = new Set(["--help", "-h", "--version", "-V"]);
309
+ static #updateTags = new Set(["dev", "canary", "beta", "rc", "alpha"]);
310
+ 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)
318
+ 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}` : ""}`;
325
+ const lines = [
326
+ `This akan is @akanjs/cli ${cliVersion}, but this workspace has akanjs ${installed}: what it generates may not match the installed framework.`,
327
+ `Run the matching CLI: ${rerun}`
328
+ ];
329
+ if (Bun.semver.order(cliVersion, installed) > 0)
330
+ lines.push(`Or move the workspace and this CLI to the newest release of the line together: ${update}`);
331
+ else if (pinnedCli !== installed)
332
+ lines.push(`Pin it so \`bunx akan\` runs it: bun add -d @akanjs/cli@${installed}`);
333
+ return lines.join(`
334
+ `);
335
+ }
336
+ static installedAkanVersion(workspaceRoot) {
337
+ const packageDir = path2.join(workspaceRoot, "node_modules", "akanjs");
338
+ if (!existsSync(packageDir))
339
+ return null;
340
+ if (!realpathSync(packageDir).split(path2.sep).includes("node_modules"))
341
+ return null;
342
+ return WorkspaceVersionCheck.#versionAt(packageDir);
343
+ }
344
+ static #versionAt(packageDir) {
345
+ const packageJsonPath = path2.join(packageDir, "package.json");
346
+ if (!existsSync(packageJsonPath))
347
+ return null;
348
+ return JSON.parse(readFileSync(packageJsonPath, "utf8")).version ?? null;
349
+ }
350
+ static #quote(arg) {
351
+ if (/^[\w@%+=:,./-]+$/.test(arg))
352
+ return arg;
353
+ if (process.platform === "win32")
354
+ return `"${arg.replaceAll('"', "\\\"")}"`;
355
+ return `'${arg.replaceAll("'", `'\\''`)}'`;
356
+ }
357
+ }
358
+
302
359
  // pkgs/@akanjs/devkit/commandDecorators/command.ts
303
360
  var loggedCliErrorObjects = new WeakSet;
304
361
  var loggedCliErrorMessages = new Set;
@@ -607,7 +664,7 @@ var runCommands = async (...commands) => {
607
664
  process.exit(ExitCodeError.codeOf(error) ?? failureExitCode);
608
665
  });
609
666
  const __dirname2 = getDirname2(import.meta.url);
610
- const packageJsonCandidates = [`${path2.dirname(Bun.main)}/package.json`, `${__dirname2}/../package.json`];
667
+ const packageJsonCandidates = [`${path3.dirname(Bun.main)}/package.json`, `${__dirname2}/../package.json`];
611
668
  let cliPackageJson = null;
612
669
  for (const packageJsonPath of packageJsonCandidates) {
613
670
  if (!await FileSys2.fileExists(packageJsonPath))
@@ -627,12 +684,10 @@ var runCommands = async (...commands) => {
627
684
  program.version(process.env.AKAN_VERSION).description("Akan CLI").configureHelp({
628
685
  helpWidth: 100
629
686
  });
630
- const installedAkanPackageJson = await FileSys2.fileExists("./node_modules/akanjs/package.json") ? await FileSys2.readJson("./node_modules/akanjs/package.json") : null;
631
- if (installedAkanPackageJson && installedAkanPackageJson.version !== process.env.AKAN_VERSION) {
687
+ const versionWarning = WorkspaceVersionCheck.warning(cliPackageJson?.version, process.argv, process.cwd());
688
+ if (versionWarning)
632
689
  Logger.rawLog(chalk2.yellow(`
633
- Akan CLI version is mismatch with installed package. ${process.env.AKAN_VERSION} (global) vs ${installedAkanPackageJson.version} (akanjs)
634
- It may cause unexpected behavior. Run \`akan update\` to update latest akanjs.`), undefined, "error");
635
- }
690
+ ${versionWarning}`), undefined, "error");
636
691
  for (const command of commands) {
637
692
  const targetMetas = getTargetMetas(command);
638
693
  for (const targetMeta of targetMetas) {
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-p4dnj2wc.js";
5
+ } from "./index-qmeh0s05.js";
6
6
  import {
7
7
  LibSource,
8
8
  formatLibStatuses,
9
9
  CommandExecutionError,
10
10
  LibExecutor
11
- } from "./index-rr7jk14m.js";
11
+ } from "./index-1e2955yd.js";
12
12
 
13
13
  // pkgs/@akanjs/cli/library/library.script.ts
14
14
  import { Logger } from "akanjs/common";
@@ -1,16 +1,16 @@
1
1
  // @bun
2
2
  import {
3
3
  jsonText
4
- } from "./index-ynqxpwx6.js";
4
+ } from "./index-pqdz7rat.js";
5
5
  import {
6
6
  akanMcpInstallTargets
7
- } from "./index-z6v7k9sb.js";
7
+ } from "./index-kr62ph5a.js";
8
8
  import {
9
9
  script
10
- } from "./index-p4dnj2wc.js";
10
+ } from "./index-qmeh0s05.js";
11
11
  import {
12
12
  ContextRunner2
13
- } from "./index-bb4hj03s.js";
13
+ } from "./index-7yzcaymm.js";
14
14
 
15
15
  // pkgs/@akanjs/cli/context/context.script.ts
16
16
  import { Logger } from "akanjs/common";
@@ -41,7 +41,7 @@ import {
41
41
  script,
42
42
  markCliErrorPrinted,
43
43
  assertPromptable
44
- } from "./index-p4dnj2wc.js";
44
+ } from "./index-qmeh0s05.js";
45
45
  import {
46
46
  AppInfo,
47
47
  CommandExecutionError,
@@ -50,30 +50,30 @@ import {
50
50
  AppExecutor,
51
51
  LibExecutor,
52
52
  PkgExecutor
53
- } from "./index-rr7jk14m.js";
53
+ } from "./index-1e2955yd.js";
54
54
  import {
55
- DesktopServerStage,
56
- UpdateUploader
57
- } from "./index-ekpp5tax.js";
55
+ UpdatePackFolder,
56
+ UpdateUploader,
57
+ NativePublicEnv,
58
+ NativeApp
59
+ } from "./index-2qzzp0c9.js";
60
+ import {
61
+ DesktopServerStage
62
+ } from "./index-8rvwgd1r.js";
58
63
  import {
59
64
  resolveMobileTargets,
60
65
  resolveAppId
61
66
  } from "./index-m9jj544v.js";
62
- import {
63
- NativePublicEnv,
64
- UpdatePackFolder,
65
- NativeApp
66
- } from "./index-z9xepn8t.js";
67
67
  import {
68
68
  LibraryScript
69
- } from "./index-qkcwsg6r.js";
69
+ } from "./index-rshwdv9w.js";
70
70
  import {
71
71
  stripAnsi
72
72
  } from "./index-7md2g9vw.js";
73
73
  import {
74
74
  SlicePlanner,
75
75
  formatSlicePlan
76
- } from "./index-fmder14z.js";
76
+ } from "./index-553xyb55.js";
77
77
  import {
78
78
  openBrowser
79
79
  } from "./index-9dp031by.js";
@@ -1271,6 +1271,11 @@ ${this.#backendStderrTail.join(`
1271
1271
  static async readProcessRssBytes(pid) {
1272
1272
  if (process.platform === "win32")
1273
1273
  return await AkanAppHost.#readRssKbVia(["tasklist", "/FI", `PID eq ${pid}`, "/FO", "CSV", "/NH"], AkanAppHost.#tasklistRssKb);
1274
+ if (process.platform === "darwin") {
1275
+ const footprintBytes = await AkanAppHost.#readRssKbVia(["footprint", "-p", String(pid), "-f", "bytes"], AkanAppHost.#footprintKb);
1276
+ if (footprintBytes !== null)
1277
+ return footprintBytes;
1278
+ }
1274
1279
  const status = await Bun.file(`/proc/${pid}/status`).text().catch(() => null);
1275
1280
  const vmRssKb = status === null ? null : /VmRSS:\s+(\d+) kB/.exec(status)?.[1];
1276
1281
  if (vmRssKb)
@@ -1300,6 +1305,10 @@ ${this.#backendStderrTail.join(`
1300
1305
  const memUsage = /"([^"]*)"\s*$/m.exec(output)?.[1];
1301
1306
  return memUsage ? Number(memUsage.replace(/\D/g, "")) : Number.NaN;
1302
1307
  }
1308
+ static #footprintKb(output) {
1309
+ const bytes = /Footprint: (\d+) B\b/.exec(output)?.[1];
1310
+ return bytes ? Number(bytes) / 1024 : Number.NaN;
1311
+ }
1303
1312
  #cancelRssRecycle() {
1304
1313
  this.#rssRecycleReason = null;
1305
1314
  this.#rssRecycleOver = null;
@@ -1900,7 +1909,7 @@ ${uniqueCandidates.map((candidate) => ` - ${candidate}`).join(`
1900
1909
 
1901
1910
  // pkgs/@akanjs/cli/application/application.runner.ts
1902
1911
  import { Logger as Logger3, toError } from "akanjs/common";
1903
- var loadBuildRunner = async () => (await import("./applicationBuildRunner-9cnnsdm5.js")).ApplicationBuildRunner;
1912
+ var loadBuildRunner = async () => (await import("./applicationBuildRunner-w20x63mz.js")).ApplicationBuildRunner;
1904
1913
  var loadPrompts = async () => await import("@inquirer/prompts");
1905
1914
 
1906
1915
  class ApplicationRunner extends runner("application") {
@@ -2101,7 +2110,7 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
2101
2110
  await new (await loadBuildRunner())(app).typecheck(options);
2102
2111
  }
2103
2112
  async typecheckLibrary(lib, options = {}) {
2104
- const { ProjectTypecheck } = await import("./projectTypecheck-87k6z6ab.js");
2113
+ const { ProjectTypecheck } = await import("./projectTypecheck-synx6qff.js");
2105
2114
  const root = lib.workspace.workspaceRoot;
2106
2115
  await new ProjectTypecheck(lib.cwdPath, root, { ...process.env, AKAN_WORKSPACE_ROOT: root }).run([
2107
2116
  "../../server.ts",
@@ -2309,6 +2318,8 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
2309
2318
  const { publicKey, keyId, keyPath, created } = await new NativeApp(app, mobileTarget).updateKeygen(nativePlatform);
2310
2319
  app.log(`${appId}: ${created ? "made" : "read"} ${keyPath}${created ? " (keep it private and backed up: without it, installed apps take no more updates)" : ""}`);
2311
2320
  app.log(` native: { updates: { url: "https://\u2026/${app.name}", publicKeys: [${JSON.stringify(publicKey)}] } }`);
2321
+ if (platform === "desktop")
2322
+ app.log(" url: hosted on Akan Cloud, register this public key as an external key on the release screen and use the URL it gives; self-hosted, the public address you upload the release to");
2312
2323
  app.log(` keyId ${keyId}: what publish-update --revoke and updates.revokedKeys name this key by`);
2313
2324
  const { publicKey: one, publicKeys } = mobileTarget.config.updates ?? {};
2314
2325
  const declared = publicKeys ?? (one ? [one] : null);
@@ -3706,7 +3717,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
3706
3717
  await Promise.all(shares.map(async (share) => await share.close()));
3707
3718
  }, "Abandoning the tunnel release; the shares expire on their own.");
3708
3719
  await Promise.all(apps.map(async (app) => {
3709
- const { TunnelShare } = await import("./TunnelShare-8qtffcex.js");
3720
+ const { TunnelShare } = await import("./TunnelShare-26ty9skr.js");
3710
3721
  const share = await TunnelShare.open(app, { workspace: app.workspace });
3711
3722
  shares.push(share);
3712
3723
  urls.set(app.name, share.url);
@@ -5,13 +5,13 @@ import {
5
5
  writeGeneratedSyncState,
6
6
  createRepairReport,
7
7
  renderRepairReport
8
- } from "./index-ynqxpwx6.js";
8
+ } from "./index-pqdz7rat.js";
9
9
  import {
10
10
  AkanContextAnalyzer
11
- } from "./index-z6v7k9sb.js";
11
+ } from "./index-kr62ph5a.js";
12
12
  import {
13
13
  runner
14
- } from "./index-p4dnj2wc.js";
14
+ } from "./index-qmeh0s05.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/repair/repair.runner.ts
17
17
  var spawnShell = async (workspace, command) => await workspace.spawn("bash", ["-lc", command.startsWith("akan ") ? `bun run ${command}` : command], {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  GlobalConfig,
4
4
  CloudApi
5
- } from "./index-2ar6tffh.js";
5
+ } from "./index-7ktk2hnz.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/tunnel/TunnelShare.ts
8
8
  import { TunnelAgent } from "akanjs/server/tunnel";
@@ -22,26 +22,26 @@ import {
22
22
  renderWorkflowApply,
23
23
  renderWorkflowValidation,
24
24
  renderWorkflowRunArtifact
25
- } from "./index-ynqxpwx6.js";
25
+ } from "./index-pqdz7rat.js";
26
26
  import {
27
27
  AkanContextAnalyzer
28
- } from "./index-z6v7k9sb.js";
28
+ } from "./index-kr62ph5a.js";
29
29
  import {
30
30
  CommandContainer,
31
31
  runner
32
- } from "./index-p4dnj2wc.js";
32
+ } from "./index-qmeh0s05.js";
33
33
  import {
34
34
  ModuleScript
35
- } from "./index-b5vptvnt.js";
35
+ } from "./index-nmy1rana.js";
36
36
  import {
37
37
  PrimitiveScript
38
- } from "./index-zn6bn1s2.js";
38
+ } from "./index-7abjzny1.js";
39
39
  import {
40
40
  spawnShell
41
- } from "./index-qfzfaq96.js";
41
+ } from "./index-wvvwdzfw.js";
42
42
  import {
43
43
  ScalarScript
44
- } from "./index-sng3vt0p.js";
44
+ } from "./index-kbbyzs6j.js";
45
45
 
46
46
  // pkgs/@akanjs/cli/workflow/workflow.runner.ts
47
47
  import { mkdir, readFile, writeFile } from "fs/promises";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-p4dnj2wc.js";
5
+ } from "./index-qmeh0s05.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  resolveSsrPageEntriesForApp
4
- } from "./index-rr7jk14m.js";
4
+ } from "./index-1e2955yd.js";
5
5
  import {
6
6
  bundleDefine,
7
7
  CsrEntryFiles,
8
8
  PagesEntrySourceGenerator,
9
9
  PagesBundleBuilder
10
- } from "./index-jgs8z8xb.js";
10
+ } from "./index-cz9g85xh.js";
11
11
 
12
12
  // pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
13
13
  import { mkdir as mkdir2, rm as rm2, unlink as unlink2 } from "fs/promises";