@akanjs/cli 3.3.0-rc.1 → 3.3.0-rc.10

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 (115) hide show
  1. package/.build-stamp +2 -2
  2. package/CodeAgent-cqbf9gsv.js +11 -0
  3. package/{CodeAgentRpcHost-6dzfkvsc.js → CodeAgentRpcHost-pwps2d67.js} +1 -1
  4. package/{CodeTui-zee8atsr.js → CodeTui-ehdr4hgw.js} +46 -6
  5. package/TunnelShare-0p4dy89e.js +16 -0
  6. package/{agent.command-x65f2ags.js → agent.command-x55ncdjm.js} +20 -22
  7. package/akanCode.js +7 -7
  8. package/appExecutor-1ctzymwa.js +11 -0
  9. package/{application.command-azbd1pb2.js → application.command-xpntxnh8.js} +18 -20
  10. package/{applicationBuildRunner-trfxv3pd.js → applicationBuildRunner-19c76791.js} +16 -13
  11. package/buildBatch.proc.js +19 -19
  12. package/{cloud.command-gapp4634.js → cloud.command-p3ybjes7.js} +19 -24
  13. package/cloud.script-0dsyd10v.js +30 -0
  14. package/{code.command-5smx61yf.js → code.command-m6skj1kj.js} +34 -19
  15. package/{context.command-ym5jbkny.js → context.command-3c3nv0d6.js} +20 -22
  16. package/context.runner-yyp7a112.js +32 -0
  17. package/csrArtifactBuilder-mdh9ykn2.js +9 -0
  18. package/{index-2ny1e95c.js → dependencyScanner-93g8tk0r.js} +6 -5
  19. package/{fileSys-q22646yc.js → fileSys-e5mwt73x.js} +1 -1
  20. package/frameworkGraph-aneq2nwy.js +8 -0
  21. package/{guideline.command-zwypaqsh.js → guideline.command-725fq5p0.js} +8 -8
  22. package/guidelines/agentRule/agentRule.instruction.md +46 -7
  23. package/guidelines/akanApi/akanApi.instruction.md +7 -2
  24. package/guidelines/conventions/core.md +6 -11
  25. package/guidelines/conventions/rules/app.md +1 -2
  26. package/guidelines/conventions/rules/auth.md +18 -27
  27. package/guidelines/conventions/rules/config.md +15 -46
  28. package/guidelines/conventions/rules/page.md +19 -34
  29. package/guidelines/conventions/rules/server.md +1 -4
  30. package/guidelines/conventions/rules/ssr.md +3 -4
  31. package/guidelines/conventions/rules/ts.md +2 -1
  32. package/guidelines/cssRule/cssRule.instruction.md +3 -0
  33. package/guidelines/errorCodes/errorCodes.instruction.md +4 -0
  34. package/guidelines/mcpRule/mcpRule.instruction.md +11 -4
  35. package/guidelines/pageRule/pageRule.instruction.md +6 -53
  36. package/guidelines/runtimeRule/runtimeRule.instruction.md +68 -4
  37. package/incrementalBuilder.proc.js +24 -18
  38. package/{index-nc3br31y.js → index-22bwg8hy.js} +2 -2
  39. package/{index-9f3reh2y.js → index-2v38x3ad.js} +12 -1
  40. package/{index-67sd09ag.js → index-3a3vy2xy.js} +8 -8
  41. package/{index-p7beqww9.js → index-3fmzz9sf.js} +18 -18
  42. package/{index-9wh04mqy.js → index-3mj5trqc.js} +65 -11
  43. package/{index-7wf8snar.js → index-3r1crbct.js} +1 -1
  44. package/{index-41a03gkj.js → index-3zkhg65e.js} +19 -19
  45. package/{index-2jmvfa62.js → index-4r8dgm4x.js} +3 -3
  46. package/{index-jek2re5k.js → index-4yvtqcme.js} +8 -8
  47. package/{index-j0wr4e32.js → index-5ahe641t.js} +9 -9
  48. package/{index-0dm25wvf.js → index-7ssr7wq4.js} +1 -1
  49. package/{index-dmcpetwe.js → index-8bta5pnr.js} +98 -23
  50. package/{index-z92zm3wd.js → index-9a9t77hz.js} +29 -11
  51. package/{index-3txdtztz.js → index-9gjcbp2g.js} +1 -1
  52. package/{index-8jtqfye2.js → index-a4gcdffy.js} +488 -53
  53. package/{index-xwwex8rf.js → index-cbm9gzgx.js} +5 -5
  54. package/{index-j6jjmn2r.js → index-ckcc9ab3.js} +62 -21
  55. package/{index-w1zexzpx.js → index-crd99zqs.js} +1 -1
  56. package/{index-612fdtbk.js → index-f4jydw2x.js} +1 -1
  57. package/{index-4ss4gkv3.js → index-fagjtk6m.js} +2 -2
  58. package/{index-ebn9kgea.js → index-fjqapyex.js} +45 -16
  59. package/{index-h901f24n.js → index-h8w1n11r.js} +5 -5
  60. package/{index-275a4r3n.js → index-hxg6ctk2.js} +12 -16
  61. package/{index-78y75t0a.js → index-j2wq064m.js} +6 -7
  62. package/{index-knpm8sdm.js → index-j3fqs8rc.js} +1 -1
  63. package/{index-kfvjzk8r.js → index-kbnvyhy4.js} +3 -3
  64. package/{index-6dzjer7p.js → index-m303nhv6.js} +6 -6
  65. package/{index-dadwp2aw.js → index-nmdmkjt2.js} +271 -39
  66. package/{index-2yn3r67f.js → index-nnmw56fz.js} +6 -6
  67. package/{index-a860mx0m.js → index-pr9nypg7.js} +24 -24
  68. package/{index-s885g0jj.js → index-pyjkbg8e.js} +3 -3
  69. package/{index-zmd9xxgd.js → index-q63nbpv7.js} +3 -3
  70. package/{index-v7ajmsh3.js → index-qecrqpt6.js} +4 -21
  71. package/{index-gt8phqpt.js → index-rdcgz02t.js} +4 -4
  72. package/{index-j592zfqc.js → index-rt7q20sj.js} +1 -1
  73. package/{index-baccvws5.js → index-se7n78fh.js} +1 -1
  74. package/{index-s4nvxpzm.js → index-sxbsrndq.js} +1 -1
  75. package/{index-k6vwww45.js → index-t23dgyaf.js} +7 -7
  76. package/{index-71y6176j.js → index-v16gj2as.js} +86 -66
  77. package/{index-0s7w2085.js → index-vnk1qwgr.js} +4 -4
  78. package/{index-z96ks033.js → index-wkwe91sn.js} +169 -51
  79. package/{index-ybcb9wc8.js → index-wxqp1amd.js} +9 -9
  80. package/{index-p5zh7pmc.js → index-xv3pvdw4.js} +1 -1
  81. package/{index-zfnz878d.js → index-yey1envc.js} +1 -1
  82. package/{index-by2tvsq6.js → index-zyjztrvc.js} +1 -1
  83. package/index.js +30 -28
  84. package/{libExecutor-jc6f8hm6.js → libExecutor-n8hpm8s7.js} +3 -3
  85. package/{library.command-nxvesvhb.js → library.command-8abb26pg.js} +8 -8
  86. package/{localRegistry.command-xz62e4ng.js → localRegistry.command-sa211m1z.js} +18 -23
  87. package/{module.command-aaws9byg.js → module.command-z3cwjf0p.js} +10 -10
  88. package/{package.command-j7hv26p0.js → package.command-akynhtee.js} +9 -12
  89. package/package.json +3 -2
  90. package/{page.command-7yffs7n9.js → page.command-3fpdavk9.js} +8 -8
  91. package/{pipeline.command-7yk0zcng.js → pipeline.command-ca95n8rd.js} +7 -7
  92. package/{pkgExecutor-arxmvx4t.js → pkgExecutor-a73q41vx.js} +3 -3
  93. package/{primitive.command-7a1pt715.js → primitive.command-xwe9ggnf.js} +11 -11
  94. package/{projectTypecheck-f4qhbecd.js → projectTypecheck-7g542ymk.js} +1 -1
  95. package/{prompter-qyggfhqd.js → prompter-d33wmdpa.js} +2 -2
  96. package/{quality.command-c6mvrjh1.js → quality.command-7wz7y8z1.js} +9 -9
  97. package/{repair.command-093adzt9.js → repair.command-dej1qtfq.js} +10 -10
  98. package/{scalar.command-2ex84spb.js → scalar.command-z9qfxnvm.js} +9 -9
  99. package/skills/akan-agent/SKILL.md +8 -1
  100. package/skills/akan-code/SKILL.md +38 -3
  101. package/skills/akan-page/SKILL.md +18 -13
  102. package/skills/akan-runtime/SKILL.md +21 -16
  103. package/skills/akan-service/SKILL.md +2 -2
  104. package/{subspace.command-4n4n4jpv.js → subspace.command-9wekm4gn.js} +11 -13
  105. package/templates/localDev/docker-compose.yaml.template +2 -2
  106. package/{tunnel.command-f7ep1qfa.js → tunnel.command-cxc4h3j8.js} +10 -12
  107. package/{verify.command-zrkxnvct.js → verify.command-j0w9dr5c.js} +15 -17
  108. package/{workflow.command-ks16jegk.js → workflow.command-yt4sz04b.js} +15 -15
  109. package/{workspace.command-ahhfpaag.js → workspace.command-8mp4mcp2.js} +34 -38
  110. package/CodeAgent-fx6088tv.js +0 -11
  111. package/TunnelShare-9ry4vh0y.js +0 -18
  112. package/appExecutor-79azsb2w.js +0 -11
  113. package/cloud.script-3b401efv.js +0 -35
  114. package/context.runner-kctbfsde.js +0 -34
  115. package/dependencyScanner-ge10gb52.js +0 -8
@@ -257,6 +257,7 @@ class CodeTuiCommands2 {
257
257
  { name: "fork", desc: "continue this conversation twice; the copy takes over here", arg: "[name]" },
258
258
  { name: "agents", desc: "what a sub-agent may be, and what one may spend" },
259
259
  { name: "mcp", desc: "the MCP servers this session reached", arg: "[add|remove|login|reload]" },
260
+ { name: "allowed", desc: "the commands this session runs without asking", arg: "[clear]" },
260
261
  { name: "peers", desc: "the other akan code sessions running here" },
261
262
  { name: "msg", desc: "hand a message to another session", arg: "<peer> <text>" },
262
263
  { name: "quit", desc: "leave the session" }
@@ -662,7 +663,12 @@ class CodeTuiParts2 {
662
663
  case "approval":
663
664
  return [
664
665
  { prefix: { text: "? ", color: "yellow" }, spans: [{ text: part.request.summary, color: "yellow" }] },
665
- ...part.approved === undefined ? [] : [{ prefix: { text: " " }, spans: [{ text: part.approved ? "approved" : "denied", dim: true }] }]
666
+ ...part.approved === undefined ? [] : [
667
+ {
668
+ prefix: { text: " " },
669
+ spans: [{ text: CodeTuiParts2.#verdict(part.approved, part.remembered), dim: true }]
670
+ }
671
+ ]
666
672
  ];
667
673
  case "host":
668
674
  return [{ prefix: { text: " ", dim: true }, spans: [{ text: `${part.hostKind} ${part.text}`, dim: true }] }];
@@ -749,6 +755,11 @@ class CodeTuiParts2 {
749
755
  ...part.rendered === undefined ? [] : [{ prefix: { text: " = ", color: "green" }, spans: [{ text: part.rendered, color: "green" }] }]
750
756
  ];
751
757
  }
758
+ static #verdict(approved, remembered) {
759
+ if (!approved)
760
+ return "denied";
761
+ return remembered?.length ? `approved \xB7 ${remembered.join(", ")} runs unasked until this session ends` : "approved";
762
+ }
752
763
  static #noticeStyle(level) {
753
764
  if (level === "error")
754
765
  return { color: "red" };
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  CommandContainer,
4
4
  runner
5
- } from "./index-2yn3r67f.js";
5
+ } from "./index-nnmw56fz.js";
6
6
  import {
7
7
  WorkspaceExecutor
8
- } from "./index-71y6176j.js";
8
+ } from "./index-v16gj2as.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-q63nbpv7.js";
35
35
  import {
36
36
  AkanContextAnalyzer
37
- } from "./index-h901f24n.js";
37
+ } from "./index-h8w1n11r.js";
38
38
  import {
39
39
  ModuleScript
40
- } from "./index-gt8phqpt.js";
40
+ } from "./index-rdcgz02t.js";
41
41
  import {
42
42
  PrimitiveScript
43
- } from "./index-6dzjer7p.js";
43
+ } from "./index-m303nhv6.js";
44
44
  import {
45
45
  spawnAkan,
46
46
  isWorkspaceTarget
47
- } from "./index-kfvjzk8r.js";
47
+ } from "./index-kbnvyhy4.js";
48
48
  import {
49
49
  ScalarScript
50
- } from "./index-4ss4gkv3.js";
50
+ } from "./index-fagjtk6m.js";
51
51
  import {
52
52
  workflowSpecs
53
53
  } from "./index-t4d0ckde.js";
@@ -21,23 +21,23 @@ var channelSpecs = [
21
21
  ];
22
22
  var skippedDirs = new Set(["node_modules", "vendor", "types", "integration", "csrE2e", "platformTest"]);
23
23
 
24
- class FrameworkGraph {
24
+ class FrameworkGraph2 {
25
25
  static architectureFile = "pkgs/akanjs/ARCHITECTURE.md";
26
26
  static #cache = new Map;
27
27
  static #edits = new Map;
28
28
  static async packagesOf(workspaceRoot) {
29
29
  const found = await Promise.all(packageSpecs.map(async ({ name, split }) => {
30
- const root = await FrameworkGraph.#isDir(path.join(workspaceRoot, "pkgs", name)) ? `pkgs/${name}` : await FrameworkGraph.#installedRoot(workspaceRoot, name);
30
+ const root = await FrameworkGraph2.#isDir(path.join(workspaceRoot, "pkgs", name)) ? `pkgs/${name}` : await FrameworkGraph2.#installedRoot(workspaceRoot, name);
31
31
  return root ? [{ name, root, split }] : [];
32
32
  }));
33
33
  return found.flat();
34
34
  }
35
35
  static async build(workspaceRoot) {
36
- const packages = await FrameworkGraph.packagesOf(workspaceRoot);
36
+ const packages = await FrameworkGraph2.packagesOf(workspaceRoot);
37
37
  const akanjs = packages.find(({ name }) => name === "akanjs");
38
38
  if (!akanjs)
39
39
  return null;
40
- const files = (await Promise.all(packages.map(({ root }) => FrameworkGraph.#filesUnder(workspaceRoot, root)))).flat();
40
+ const files = (await Promise.all(packages.map(({ root }) => FrameworkGraph2.#filesUnder(workspaceRoot, root)))).flat();
41
41
  const texts = await Promise.all(files.map(async (file) => [file, await readFile(path.join(workspaceRoot, file), "utf8")]));
42
42
  return new FrameworkMapBuilder({
43
43
  ts,
@@ -47,13 +47,13 @@ class FrameworkGraph {
47
47
  }).build();
48
48
  }
49
49
  static async architecture(workspaceRoot) {
50
- const file = path.join(workspaceRoot, FrameworkGraph.architectureFile);
50
+ const file = path.join(workspaceRoot, FrameworkGraph2.architectureFile);
51
51
  const current = await readFile(file, "utf8").then((text) => text.replace(/\r\n/g, `
52
52
  `)).catch(() => null);
53
- const map = current === null ? null : await FrameworkGraph.build(workspaceRoot);
53
+ const map = current === null ? null : await FrameworkGraph2.build(workspaceRoot);
54
54
  if (current === null || !map || map.packages.find(({ name }) => name === "akanjs")?.root !== "pkgs/akanjs")
55
55
  return null;
56
- const next = FrameworkMapDoc.splice(current, FrameworkMapDoc.render(map, path.posix.dirname(FrameworkGraph.architectureFile)));
56
+ const next = FrameworkMapDoc.splice(current, FrameworkMapDoc.render(map, path.posix.dirname(FrameworkGraph2.architectureFile)));
57
57
  return {
58
58
  file,
59
59
  current,
@@ -65,31 +65,31 @@ class FrameworkGraph {
65
65
  static touched(workspaceRoot, files) {
66
66
  const roots = packageSpecs.map(({ name }) => path.join(workspaceRoot, "pkgs", name) + path.sep);
67
67
  if (files.some((file) => roots.some((root) => path.resolve(workspaceRoot, file).startsWith(root))))
68
- FrameworkGraph.#edits.set(workspaceRoot, (FrameworkGraph.#edits.get(workspaceRoot) ?? 0) + 1);
68
+ FrameworkGraph2.#edits.set(workspaceRoot, (FrameworkGraph2.#edits.get(workspaceRoot) ?? 0) + 1);
69
69
  }
70
70
  static async cached(workspaceRoot) {
71
- const packages = await FrameworkGraph.packagesOf(workspaceRoot);
72
- const stamps = await Promise.all(packages.map(async ({ name, root }) => root.startsWith("pkgs/") ? `${name}#${FrameworkGraph.#edits.get(workspaceRoot) ?? 0}` : `${name}@${await FrameworkGraph.#versionOf(path.join(workspaceRoot, root))}`));
71
+ const packages = await FrameworkGraph2.packagesOf(workspaceRoot);
72
+ const stamps = await Promise.all(packages.map(async ({ name, root }) => root.startsWith("pkgs/") ? `${name}#${FrameworkGraph2.#edits.get(workspaceRoot) ?? 0}` : `${name}@${await FrameworkGraph2.#versionOf(path.join(workspaceRoot, root))}`));
73
73
  const cacheKey = [workspaceRoot, ...stamps].join(`
74
74
  `);
75
- const existing = FrameworkGraph.#cache.get(cacheKey);
75
+ const existing = FrameworkGraph2.#cache.get(cacheKey);
76
76
  if (existing)
77
77
  return await existing;
78
- const built = FrameworkGraph.build(workspaceRoot);
79
- built.catch(() => FrameworkGraph.#cache.delete(cacheKey));
80
- FrameworkGraph.#cache.clear();
81
- FrameworkGraph.#cache.set(cacheKey, built);
78
+ const built = FrameworkGraph2.build(workspaceRoot);
79
+ built.catch(() => FrameworkGraph2.#cache.delete(cacheKey));
80
+ FrameworkGraph2.#cache.clear();
81
+ FrameworkGraph2.#cache.set(cacheKey, built);
82
82
  return await built;
83
83
  }
84
84
  static async#installedRoot(workspaceRoot, name) {
85
- if (!await FrameworkGraph.#isDir(path.join(workspaceRoot, "node_modules")))
85
+ if (!await FrameworkGraph2.#isDir(path.join(workspaceRoot, "node_modules")))
86
86
  return null;
87
87
  const resolved = await (async () => {
88
88
  try {
89
89
  return path.dirname(await realpath(Bun.resolveSync(`${name}/package.json`, workspaceRoot)));
90
90
  } catch {
91
91
  const dir = path.join(workspaceRoot, "node_modules", name);
92
- return await FrameworkGraph.#isDir(dir) ? await realpath(dir) : null;
92
+ return await FrameworkGraph2.#isDir(dir) ? await realpath(dir) : null;
93
93
  }
94
94
  })();
95
95
  if (!resolved)
@@ -123,4 +123,4 @@ class FrameworkGraph {
123
123
  }
124
124
  }
125
125
 
126
- export { FrameworkGraph };
126
+ export { FrameworkGraph2 };
@@ -3,10 +3,10 @@ import {
3
3
  AsyncDefaultExportDetector,
4
4
  StoreBootstrap,
5
5
  resolveSsrPageEntriesForApp
6
- } from "./index-z92zm3wd.js";
6
+ } from "./index-9a9t77hz.js";
7
7
  import {
8
8
  FileSys2
9
- } from "./index-by2tvsq6.js";
9
+ } from "./index-zyjztrvc.js";
10
10
 
11
11
  // pkgs/@akanjs/devkit/transforms/barrelAnalyzer.ts
12
12
  import fs from "fs";
@@ -207,7 +207,7 @@ class BarrelAnalyzer {
207
207
  if (!rel || rel.startsWith("..") || path.isAbsolute(rel))
208
208
  return null;
209
209
  if (pkg.preserveFilePath)
210
- return `${pkg.pkgName}/${rel.split(path.sep).join("/")}`;
210
+ return absFile.split(path.sep).join("/");
211
211
  const ext = CANDIDATE_EXTS.find((candidate) => rel.endsWith(candidate));
212
212
  const parts = (ext ? rel.slice(0, -ext.length) : rel).split(path.sep);
213
213
  if (parts[parts.length - 1] === "index")
@@ -771,7 +771,7 @@ class CsrEntryFiles {
771
771
 
772
772
  // pkgs/@akanjs/devkit/frontendBuild/pagesBundleBuilder.ts
773
773
  import fs4 from "fs";
774
- import path9 from "path";
774
+ import path10 from "path";
775
775
  import ts3 from "typescript";
776
776
 
777
777
  // pkgs/@akanjs/devkit/transforms/externalizeFrameworkPlugin.ts
@@ -981,14 +981,67 @@ ${entries.join(`
981
981
  }
982
982
  }
983
983
 
984
+ // pkgs/@akanjs/devkit/frontendBuild/rscServerRendererGuard.ts
985
+ import { realpathSync } from "fs";
986
+ import path8 from "path";
987
+ var SERVER_RENDERER_RE = /^react-dom\/server(?:\.\w+)?$/;
988
+
989
+ class RscServerRendererGuard {
990
+ static offenders(metafile) {
991
+ const offenders = [];
992
+ const included = new Set(Object.values(metafile.outputs).flatMap((output) => Object.entries(output.inputs).filter(([, { bytesInOutput }]) => bytesInOutput > 0).map(([input]) => input)));
993
+ for (const input of included)
994
+ for (const edge of metafile.inputs[input]?.imports ?? [])
995
+ if (edge.external && edge.kind === "import-statement" && SERVER_RENDERER_RE.test(edge.path))
996
+ offenders.push({ input, specifier: edge.path });
997
+ return offenders;
998
+ }
999
+ static chain(metafile, target) {
1000
+ const entries = Object.values(metafile.outputs).flatMap((output) => output.entryPoint ? [output.entryPoint] : []);
1001
+ const reached = new Map(entries.map((entry) => [entry, null]));
1002
+ const queue = [...entries];
1003
+ for (let input = queue.shift();input !== undefined && !reached.has(target); input = queue.shift())
1004
+ for (const edge of metafile.inputs[input]?.imports ?? []) {
1005
+ if (edge.external || reached.has(edge.path))
1006
+ continue;
1007
+ reached.set(edge.path, {
1008
+ from: input,
1009
+ dynamic: edge.kind === "dynamic-import" || edge.kind === "require-call"
1010
+ });
1011
+ queue.push(edge.path);
1012
+ }
1013
+ const chain = [];
1014
+ for (let input = target;input !== undefined; ) {
1015
+ const edge = reached.get(input);
1016
+ chain.unshift({ input, dynamic: edge?.dynamic ?? false });
1017
+ input = edge?.from;
1018
+ }
1019
+ return chain;
1020
+ }
1021
+ static assert(metafile, workspaceRoot) {
1022
+ const [offender] = metafile ? RscServerRendererGuard.offenders(metafile) : [];
1023
+ if (!metafile || !offender)
1024
+ return;
1025
+ const root = realpathSync(workspaceRoot);
1026
+ const shown = (input) => path8.relative(root, path8.resolve(input)) || input;
1027
+ const lines = RscServerRendererGuard.chain(metafile, offender.input).map(({ input, dynamic }, idx) => ` ${idx === 0 ? "" : dynamic ? "\u2192 import() " : "\u2192 "}${shown(input)}`);
1028
+ throw new Error([
1029
+ `[PagesBundleBuilder] The server pages bundle imports ${offender.specifier} as it loads, and the RSC worker runs under the react-server condition, where that import throws. It is reached through:`,
1030
+ ...lines,
1031
+ "A module in the page graph that imports the app's server entry, or anything that starts the server, brings the SSR renderer with it: import only what that module uses, or hand it in from the code that boots the server."
1032
+ ].join(`
1033
+ `));
1034
+ }
1035
+ }
1036
+
984
1037
  // pkgs/@akanjs/devkit/frontendBuild/serverGraphFile.ts
985
1038
  import fs3 from "fs";
986
- import path8 from "path";
1039
+ import path9 from "path";
987
1040
  class ServerGraphFile {
988
1041
  static fileName = "server-graph.json";
989
1042
  static #cache = null;
990
1043
  static async read(artifactDir) {
991
- const file = path8.join(artifactDir, ServerGraphFile.fileName);
1044
+ const file = path9.join(artifactDir, ServerGraphFile.fileName);
992
1045
  const stat = fs3.statSync(file, { throwIfNoEntry: false });
993
1046
  if (!stat)
994
1047
  return null;
@@ -1002,7 +1055,7 @@ class ServerGraphFile {
1002
1055
  return graph;
1003
1056
  }
1004
1057
  static async write(artifactDir, graph) {
1005
- const file = path8.join(artifactDir, ServerGraphFile.fileName);
1058
+ const file = path9.join(artifactDir, ServerGraphFile.fileName);
1006
1059
  const temp = `${file}.${process.pid}.tmp`;
1007
1060
  await Bun.write(temp, JSON.stringify(graph));
1008
1061
  await FileSys2.replace(temp, file);
@@ -1087,7 +1140,7 @@ class PagesBundleBuilder {
1087
1140
  asset: "assets/[name]-[hash].[ext]"
1088
1141
  },
1089
1142
  define: bundleDefine(this.#app, this.#command, "ssr"),
1090
- metafile: dev,
1143
+ metafile: true,
1091
1144
  plugins: [
1092
1145
  ...this.#serverEnv ? [this.#serverEnv] : [],
1093
1146
  PagesBundleBuilder.createPagesEntryPlugin(entrySource),
@@ -1105,16 +1158,17 @@ class PagesBundleBuilder {
1105
1158
  });
1106
1159
  if (!result.success)
1107
1160
  throw new AggregateError(result.logs, "[PagesBundleBuilder] Bun.build failed");
1161
+ RscServerRendererGuard.assert(result.metafile, workspaceRoot);
1108
1162
  const entryArtifact = result.outputs.find((a) => a.kind === "entry-point");
1109
1163
  if (!entryArtifact)
1110
1164
  throw new Error("[PagesBundleBuilder] Bun.build emitted no entry-point artifact");
1111
- const bundlePath = path9.resolve(entryArtifact.path);
1165
+ const bundlePath = path10.resolve(entryArtifact.path);
1112
1166
  const buildId = Date.now();
1113
1167
  if (dev && result.metafile)
1114
1168
  await ServerGraphFile.write(this.#artifactDir, this.#serverGraph(result.metafile, clientExports));
1115
1169
  const outputBytes = result.outputs.reduce((sum, output) => sum + output.size, 0);
1116
1170
  const chunkCount = result.outputs.filter((output) => output.kind === "chunk").length;
1117
- this.#app.verbose(`[PagesBundleBuilder] ${path9.basename(bundlePath)} emitted in ${Date.now() - this.#started}ms splitting=${this.#splitting} entry=${entryArtifact.size} bytes outputs=${result.outputs.length} chunks=${chunkCount} total=${outputBytes} bytes`);
1171
+ this.#app.verbose(`[PagesBundleBuilder] ${path10.basename(bundlePath)} emitted in ${Date.now() - this.#started}ms splitting=${this.#splitting} entry=${entryArtifact.size} bytes outputs=${result.outputs.length} chunks=${chunkCount} total=${outputBytes} bytes`);
1118
1172
  return {
1119
1173
  bundlePath,
1120
1174
  buildId,
@@ -1126,7 +1180,7 @@ class PagesBundleBuilder {
1126
1180
  };
1127
1181
  }
1128
1182
  #serverGraph(metafile, clientExports) {
1129
- const inputs = Object.keys(metafile.inputs).filter((input) => !input.includes("node_modules")).map((input) => path9.resolve(input)).filter((input) => fs4.existsSync(input)).map((input) => CsrDevPaths.realpath(input));
1183
+ const inputs = Object.keys(metafile.inputs).filter((input) => !input.includes("node_modules")).map((input) => path10.resolve(input)).filter((input) => fs4.existsSync(input)).map((input) => CsrDevPaths.realpath(input));
1130
1184
  return { inputs, clientExports };
1131
1185
  }
1132
1186
  get #artifactDir() {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  execEmoji,
4
4
  Executor
5
- } from "./index-71y6176j.js";
5
+ } from "./index-v16gj2as.js";
6
6
  // pkgs/@akanjs/devkit/executors/moduleExecutor.ts
7
7
  class ModuleExecutor extends Executor {
8
8
  sys;
@@ -1,37 +1,37 @@
1
1
  // @bun
2
+ import {
3
+ SysExecutor
4
+ } from "./index-v16gj2as.js";
5
+ import {
6
+ CliError
7
+ } from "./index-j4yvgfhr.js";
2
8
  import {
3
9
  ApplicationBuildReporter
4
- } from "./index-dmcpetwe.js";
10
+ } from "./index-8bta5pnr.js";
5
11
  import {
6
12
  script,
7
13
  markCliErrorPrinted,
8
14
  assertPromptable
9
- } from "./index-2yn3r67f.js";
10
- import {
11
- CliError
12
- } from "./index-j4yvgfhr.js";
13
- import {
14
- SysExecutor
15
- } from "./index-71y6176j.js";
15
+ } from "./index-nnmw56fz.js";
16
16
  import {
17
17
  AppExecutor2
18
- } from "./index-z92zm3wd.js";
18
+ } from "./index-9a9t77hz.js";
19
19
  import {
20
20
  LibExecutor2
21
- } from "./index-zfnz878d.js";
21
+ } from "./index-yey1envc.js";
22
22
  import {
23
23
  PkgExecutor2
24
- } from "./index-w1zexzpx.js";
24
+ } from "./index-crd99zqs.js";
25
25
  import {
26
26
  DesktopServerStage
27
- } from "./index-612fdtbk.js";
27
+ } from "./index-f4jydw2x.js";
28
28
  import {
29
29
  LibraryScript
30
- } from "./index-2jmvfa62.js";
30
+ } from "./index-4r8dgm4x.js";
31
31
  import {
32
32
  ApplicationRunner,
33
33
  VerifyScope
34
- } from "./index-z96ks033.js";
34
+ } from "./index-wkwe91sn.js";
35
35
  import {
36
36
  PreviewChrome2,
37
37
  PreviewView2,
@@ -39,13 +39,13 @@ import {
39
39
  } from "./index-rwgqba9p.js";
40
40
  import {
41
41
  formatSlicePlan
42
- } from "./index-j592zfqc.js";
43
- import {
44
- assertPlainName
45
- } from "./index-va90m8nd.js";
42
+ } from "./index-rt7q20sj.js";
46
43
  import {
47
44
  openBrowser
48
45
  } from "./index-9dp031by.js";
46
+ import {
47
+ assertPlainName
48
+ } from "./index-va90m8nd.js";
49
49
 
50
50
  // pkgs/@akanjs/cli/application/application.script.ts
51
51
  import { mkdir as mkdir3, rm } from "fs/promises";
@@ -1779,7 +1779,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
1779
1779
  await Promise.all(shares.map(async (share) => await share.close()));
1780
1780
  }, "Abandoning the tunnel release; the shares expire on their own.");
1781
1781
  await Promise.all(apps.map(async (app) => {
1782
- const { TunnelShare } = await import("./TunnelShare-9ry4vh0y.js");
1782
+ const { TunnelShare } = await import("./TunnelShare-0p4dy89e.js");
1783
1783
  const share = await TunnelShare.open(app, { workspace: app.workspace });
1784
1784
  shares.push(share);
1785
1785
  urls.set(app.name, share.url);
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-2yn3r67f.js";
5
+ } from "./index-nnmw56fz.js";
6
6
  import {
7
7
  CommandExecutionError,
8
8
  LibSource,
9
9
  formatLibStatuses
10
- } from "./index-71y6176j.js";
10
+ } from "./index-v16gj2as.js";
11
11
  import {
12
12
  LibExecutor2
13
- } from "./index-zfnz878d.js";
13
+ } from "./index-yey1envc.js";
14
14
  import {
15
15
  assertPlainName
16
16
  } from "./index-va90m8nd.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  SOURCE_EXTS,
4
4
  WatchRootResolver
5
- } from "./index-dmcpetwe.js";
5
+ } from "./index-8bta5pnr.js";
6
6
  import {
7
7
  loaderFor,
8
8
  BarrelAnalyzer,
@@ -18,15 +18,15 @@ import {
18
18
  CsrDevPaths,
19
19
  PagesEntrySourceGenerator,
20
20
  PagesBundleBuilder
21
- } from "./index-9wh04mqy.js";
21
+ } from "./index-3mj5trqc.js";
22
22
  import {
23
23
  FileSys2
24
- } from "./index-by2tvsq6.js";
24
+ } from "./index-zyjztrvc.js";
25
25
  import {
26
26
  AsyncDefaultExportDetector,
27
27
  StoreBootstrap,
28
28
  resolveSsrPageEntriesForApp
29
- } from "./index-z92zm3wd.js";
29
+ } from "./index-9a9t77hz.js";
30
30
 
31
31
  // pkgs/@akanjs/devkit/frontendBuild/clientEntryDiscovery.ts
32
32
  import fs from "fs";
@@ -193,8 +193,8 @@ class GraphClientEntryDiscovery {
193
193
  async#resolveSpecifier(spec, importerDir) {
194
194
  const cacheKey = `${importerDir}\x00${spec}`;
195
195
  return await this.#lookup(this.#resolvedSpecifierCache, cacheKey, async () => {
196
- if (spec.startsWith(".") || spec.startsWith("/")) {
197
- const abs = spec.startsWith("/") ? spec : path.resolve(importerDir, spec);
196
+ if (spec.startsWith(".") || path.isAbsolute(spec)) {
197
+ const abs = path.resolve(importerDir, spec);
198
198
  return await this.#resolveFileCandidate(abs);
199
199
  }
200
200
  const pkg = await this.#resolvePackage(spec);
@@ -2292,9 +2292,9 @@ class DevBarrelImports {
2292
2292
  }
2293
2293
  static #fileOf(subpath, packages) {
2294
2294
  const pkg = packages.find(({ pkgName }) => subpath === pkgName || subpath.startsWith(`${pkgName}/`));
2295
- if (!pkg)
2295
+ if (!pkg && !path9.isAbsolute(subpath))
2296
2296
  return null;
2297
- const file = CsrDevPaths.resolveOnDisk(path9.join(pkg.pkgDir, subpath.slice(pkg.pkgName.length)));
2297
+ const file = CsrDevPaths.resolveOnDisk(pkg ? path9.join(pkg.pkgDir, subpath.slice(pkg.pkgName.length)) : subpath);
2298
2298
  return file ? CsrDevPaths.realpath(file) : null;
2299
2299
  }
2300
2300
  static #relative(subpath, from, packages) {
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  runner
4
- } from "./index-2yn3r67f.js";
4
+ } from "./index-nnmw56fz.js";
5
5
  import {
6
6
  AppExecutor2
7
- } from "./index-z92zm3wd.js";
7
+ } from "./index-9a9t77hz.js";
8
8
  import {
9
9
  jsonText,
10
10
  workflowStatus,
11
11
  createWorkflowBaselineSummary,
12
12
  buildAkanModuleContextIndex,
13
13
  toolingRolloutGate
14
- } from "./index-zmd9xxgd.js";
14
+ } from "./index-q63nbpv7.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-h901f24n.js";
24
+ } from "./index-h8w1n11r.js";
25
25
  import {
26
26
  Prompter2
27
- } from "./index-knpm8sdm.js";
27
+ } from "./index-j3fqs8rc.js";
28
28
  import {
29
29
  NativeApp
30
- } from "./index-ebn9kgea.js";
30
+ } from "./index-fjqapyex.js";
31
31
  import {
32
32
  isPlaceholderAppId
33
- } from "./index-612fdtbk.js";
33
+ } from "./index-f4jydw2x.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-kfvjzk8r.js";
43
+ } from "./index-kbnvyhy4.js";
44
44
  import {
45
45
  WorkflowRunner
46
- } from "./index-67sd09ag.js";
46
+ } from "./index-3a3vy2xy.js";
47
47
 
48
48
  // pkgs/@akanjs/devkit/context/akanMcpContract.ts
49
49
  import { lstatSync, realpathSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  akanCodePaths2
4
- } from "./index-p5zh7pmc.js";
4
+ } from "./index-xv3pvdw4.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/codeAgent/agent/WorkspaceTrust.ts
7
7
  import { createHash } from "crypto";