@akanjs/cli 3.1.2-rc.4 → 3.2.0-rc.1

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 (120) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-z34p8m91.js → CodeAgent-vmd9k4ak.js} +3 -3
  3. package/{CodeTui-nvd9fk3g.js → CodeTui-zka44v52.js} +1 -1
  4. package/README.ko.md +9 -0
  5. package/README.md +9 -0
  6. package/TunnelShare-k3ja4w9x.js +14 -0
  7. package/{agent.command-962mp3kg.js → agent.command-2f657613.js} +19 -17
  8. package/akanCode.js +6 -6
  9. package/{application.command-1nr0bqq1.js → application.command-q6skd3am.js} +36 -22
  10. package/{applicationBuildRunner-xy7hnfzq.js → applicationBuildRunner-sctcmkyx.js} +55 -16
  11. package/buildBatch.proc.js +7 -7
  12. package/{cloud.command-cj7b3m6y.js → cloud.command-7642pks6.js} +36 -19
  13. package/cloud.script-1sfseznn.js +30 -0
  14. package/{code.command-asq7xrr6.js → code.command-7s4ndq2k.js} +6 -6
  15. package/commandManifest.json +1 -1
  16. package/{context.command-fw4g2pw1.js → context.command-569z0rqf.js} +20 -19
  17. package/context.runner-ms8v1rxy.js +29 -0
  18. package/{devTui-evr3b35y.js → devTui-w38ch13a.js} +1 -1
  19. package/{guideline.command-43gfjsjv.js → guideline.command-gnv3e8p8.js} +2 -2
  20. package/guidelines/akanApi/akanApi.instruction.md +317 -0
  21. package/guidelines/conventions/rules/app.md +5 -5
  22. package/guidelines/conventions/rules/config.md +1 -1
  23. package/guidelines/conventions/rules/gates.md +10 -5
  24. package/incrementalBuilder.proc.js +69 -39
  25. package/{index-0tkj05cz.js → index-0fb3cpbt.js} +3 -3
  26. package/{index-6t7fkx73.js → index-1q1cjn8s.js} +21 -11
  27. package/{index-tenw3mah.js → index-23860fej.js} +16 -6
  28. package/{index-6zgt7zmx.js → index-48d5qsj3.js} +4 -4
  29. package/{index-z47rw9ez.js → index-5w9my9qe.js} +8 -8
  30. package/{index-qwe079ww.js → index-6wpaq392.js} +61 -15
  31. package/{index-kc871vpc.js → index-7xdpww43.js} +69 -12
  32. package/index-7y5yghjg.js +2969 -0
  33. package/{index-38patcx6.js → index-8g7tdsk4.js} +249 -696
  34. package/{index-90q0w90q.js → index-8kczhnmv.js} +1 -1
  35. package/{index-kdswbvys.js → index-8pb9yvp8.js} +63 -21
  36. package/{index-hmj94es2.js → index-8ts9774g.js} +4 -4
  37. package/{index-r0q2ka2b.js → index-93ewzmp6.js} +43 -14
  38. package/{index-y0y0pnx8.js → index-9tbgb4d8.js} +1 -1
  39. package/{index-jzpeny42.js → index-a8a9ede9.js} +7 -7
  40. package/index-abgh0jve.js +126 -0
  41. package/{index-t0hk1kxq.js → index-aj3ehkcx.js} +1 -1
  42. package/{index-demt944k.js → index-d4n1wmrz.js} +37 -4
  43. package/{index-sra1a5f8.js → index-drz9e84d.js} +22 -8
  44. package/{index-gfh90r3t.js → index-e3vmjtph.js} +2 -2
  45. package/{index-k64mhwbw.js → index-eajbmk10.js} +2 -1
  46. package/{index-g0yds382.js → index-ed6ea0qp.js} +1 -1
  47. package/{index-ap6ac70m.js → index-fjr4d6yd.js} +444 -368
  48. package/index-hqrkqxx2.js +176 -0
  49. package/{index-ampz4vgv.js → index-kpdv34rq.js} +4 -4
  50. package/{index-kc6ffq0s.js → index-ktb3wcqz.js} +73 -34
  51. package/{index-dcm66hss.js → index-mmym5xmb.js} +4 -2
  52. package/{index-8d9r465x.js → index-mqntfzv5.js} +2 -2
  53. package/{index-4am4dvmf.js → index-ny2k80mv.js} +15 -3
  54. package/index-p6hjwt2d.js +1668 -0
  55. package/{index-53h0053j.js → index-rc5fvqj2.js} +12 -14
  56. package/{index-jzz6ye8x.js → index-s2grpzef.js} +40 -8
  57. package/{index-38by07nw.js → index-sr5da35e.js} +32 -9
  58. package/{index-qev8p5wp.js → index-sy481q2x.js} +1 -1
  59. package/{index-ck64kxrn.js → index-thckcabc.js} +2 -2
  60. package/{index-2yan1ajk.js → index-v4p1zye8.js} +18 -9
  61. package/{index-wymcdsas.js → index-vkzfk7qt.js} +25 -23
  62. package/{index-r8t5sq7z.js → index-vr68mxj5.js} +68 -21
  63. package/{index-vkpqe29t.js → index-w639tvkd.js} +24 -125
  64. package/index-ygdbn9jn.js +122 -0
  65. package/{index-w60zxxye.js → index-zpv14wpy.js} +3 -3
  66. package/index.js +24 -23
  67. package/{library.command-zh29tjdd.js → library.command-1gp5qe3r.js} +3 -3
  68. package/{localRegistry.command-k9pn9ahj.js → localRegistry.command-x7jptkd3.js} +26 -17
  69. package/{module.command-dgpqs9fz.js → module.command-4xz9he6h.js} +6 -6
  70. package/{package.command-1je4hsca.js → package.command-s7qpnn1g.js} +12 -3
  71. package/package.json +2 -2
  72. package/{page.command-cgsasanh.js → page.command-fan34c49.js} +3 -3
  73. package/{pipeline.command-tb46sa8v.js → pipeline.command-ph4fnn9w.js} +2 -2
  74. package/{primitive.command-bzsy23x5.js → primitive.command-3fqh8emf.js} +7 -7
  75. package/{projectTypecheck-h8rgaczy.js → projectTypecheck-vkb40hjc.js} +1 -1
  76. package/{quality.command-120m9h6v.js → quality.command-ecj6exsh.js} +15 -10
  77. package/{repair.command-6m4wd0qv.js → repair.command-fe9jw719.js} +6 -6
  78. package/{scalar.command-3dn5hsc6.js → scalar.command-cnvfhk0n.js} +5 -5
  79. package/skills/akan-debug/SKILL.md +2 -1
  80. package/skills/akan-page/SKILL.md +16 -7
  81. package/skills/akan-service/SKILL.md +48 -19
  82. package/{subspace.command-s8nyfqbn.js → subspace.command-qw5ddd6y.js} +8 -8
  83. package/templates/app/lib/___appName__/__appName__.abstract.md.template +6 -0
  84. package/templates/app/page/_index.tsx +4 -284
  85. package/templates/app/page/_layout.tsx +1 -26
  86. package/templates/app/page/styles.css.template +58 -318
  87. package/templates/appSample/page/_index.tsx +281 -0
  88. package/templates/appSample/page/_layout.tsx +55 -0
  89. package/templates/appSample/page/styles.css.template +327 -0
  90. package/templates/libRoot/lib/___libName__/__libName__.abstract.md.template +6 -0
  91. package/templates/workspaceRoot/package.json.template +1 -12
  92. package/{tunnel.command-8mwrqkr3.js → tunnel.command-ggj38mqf.js} +7 -7
  93. package/{verify.command-2pspfy7k.js → verify.command-w9ttxkdz.js} +16 -14
  94. package/{workflow.command-7sy5vnsj.js → workflow.command-ss8devj0.js} +12 -12
  95. package/{workspace.command-x518tdv4.js → workspace.command-6z2rh8ze.js} +51 -39
  96. package/TunnelShare-jwbb50kz.js +0 -14
  97. package/cloud.script-8kr7qgfa.js +0 -27
  98. package/context.runner-p6m5cxk3.js +0 -28
  99. package/index-d894868w.js +0 -842
  100. package/index-re2kfscb.js +0 -1363
  101. /package/templates/{app → appSample}/page/_overrides.tsx +0 -0
  102. /package/templates/{app → appSample}/public/fonts/Pretendard-Black.woff2 +0 -0
  103. /package/templates/{app → appSample}/public/fonts/Pretendard-Bold.woff2 +0 -0
  104. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraBold.woff2 +0 -0
  105. /package/templates/{app → appSample}/public/fonts/Pretendard-ExtraLight.woff2 +0 -0
  106. /package/templates/{app → appSample}/public/fonts/Pretendard-Light.woff2 +0 -0
  107. /package/templates/{app → appSample}/public/fonts/Pretendard-Medium.woff2 +0 -0
  108. /package/templates/{app → appSample}/public/fonts/Pretendard-Regular.woff2 +0 -0
  109. /package/templates/{app → appSample}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
  110. /package/templates/{app → appSample}/public/fonts/Pretendard-Thin.woff2 +0 -0
  111. /package/templates/{app → appSample}/public/jelly/cloud.webp +0 -0
  112. /package/templates/{app → appSample}/public/jelly/comet.webp +0 -0
  113. /package/templates/{app → appSample}/public/jelly/moon.webp +0 -0
  114. /package/templates/{app → appSample}/public/jelly/planet.webp +0 -0
  115. /package/templates/{app → appSample}/public/jelly/rocket.webp +0 -0
  116. /package/templates/{app → appSample}/public/jelly/star.webp +0 -0
  117. /package/templates/{app → appSample}/public/jelly/sugar.webp +0 -0
  118. /package/templates/{app → appSample}/public/logo.png +0 -0
  119. /package/templates/{app → appSample}/ui/Recipe/index.ts +0 -0
  120. /package/templates/{app → appSample}/ui/Recipe/jellyButton.ts +0 -0
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  AppExecutor
4
- } from "./index-38by07nw.js";
4
+ } from "./index-sr5da35e.js";
5
5
  import {
6
6
  jsonText,
7
7
  createWorkflowBaselineSummary,
8
8
  buildAkanModuleContextIndex,
9
9
  toolingRolloutGate
10
- } from "./index-kdswbvys.js";
10
+ } from "./index-8pb9yvp8.js";
11
11
  import {
12
12
  buildResourceList,
13
13
  codexMcpConfigPath,
@@ -17,16 +17,16 @@ import {
17
17
  upsertCodexMcpServerBlock,
18
18
  renderDoctorText,
19
19
  AkanContextAnalyzer
20
- } from "./index-ck64kxrn.js";
20
+ } from "./index-thckcabc.js";
21
21
  import {
22
22
  runner
23
- } from "./index-r0q2ka2b.js";
23
+ } from "./index-93ewzmp6.js";
24
24
  import {
25
25
  NativeApp
26
- } from "./index-w60zxxye.js";
26
+ } from "./index-zpv14wpy.js";
27
27
  import {
28
28
  isPlaceholderAppId
29
- } from "./index-g0yds382.js";
29
+ } from "./index-ed6ea0qp.js";
30
30
  import {
31
31
  getMobileTargets,
32
32
  appIdsOf
@@ -36,13 +36,13 @@ import {
36
36
  } from "./index-j6eeh5d7.js";
37
37
  import {
38
38
  WorkspaceGraph
39
- } from "./index-vkpqe29t.js";
39
+ } from "./index-w639tvkd.js";
40
40
  import {
41
41
  RepairRunner
42
- } from "./index-0tkj05cz.js";
42
+ } from "./index-0fb3cpbt.js";
43
43
  import {
44
44
  WorkflowRunner
45
- } from "./index-wymcdsas.js";
45
+ } from "./index-vkzfk7qt.js";
46
46
 
47
47
  // pkgs/@akanjs/devkit/akanMcpContract.ts
48
48
  import { lstatSync, realpathSync } from "fs";
@@ -299,7 +299,7 @@ var readonlyMcpTools = [
299
299
  },
300
300
  {
301
301
  name: "get_graph",
302
- description: "Read-only Akan Graph from source, no dev server needed: models with their fields and relations, slices and endpoints with guards, the service methods and queries each calls, the store actions that fetch them, and the components and pages that use them. Every node and edge carries its source location. Pass app and/or module to scope a large workspace. Pass since (a git revision such as main, or HEAD for uncommitted work) for the Change Map instead: what changed since HEAD forked from it, working tree included, with each node, field and edge marked added, removed or changed, the unchanged neighbours they call or are called by, and the changed files no node covers, each marked the same way.",
302
+ description: "Read-only Akan Graph from source, no dev server needed: models with their fields and relations, slices and endpoints with the guards they name (each guard keyed by the app or lib that declares it, with its scope and the comment that says what it checks), the service methods and queries each calls, the store actions that fetch them, and the components and routes that use them. A module's jobs (internal: interval, cron, timeout, initialize, destroy, process) read their schedule and server or operation modes and call service methods like endpoints do; each adaptor a service plugs (an adapt() class, or an akanjs role) is a node, a method that calls it links to it, and an adaptor links to the adaptors it plugs itself. Each page/ file is a route (its URL pattern after the locale) or a layout, layouts wrap what they contain, and a route or layout that runs .guard() reads `guard` and links each function its guard calls; a layout's guard gates every route it wraps. A graph too large to answer unscoped drops first the routes and layouts that neither changed nor use a change; app or module brings them back. Every node and edge carries its source location. Pass app and/or module to scope a large workspace. Pass since (a git revision such as main, or HEAD for uncommitted work) for the Change Map instead: what changed since HEAD forked from it, working tree included, with each node, field and edge marked added, removed or changed, the unchanged neighbours they call or are called by, and the changed files no node covers, each marked the same way.",
303
303
  inputSchema: { type: "object", properties: { app: stringProperty, module: stringProperty, since: stringProperty } }
304
304
  },
305
305
  {
@@ -783,10 +783,8 @@ class ContextRunner2 extends runner("context") {
783
783
  const workflow = stringArg(args, "workflow");
784
784
  const inputs = workflowInputsArg(args);
785
785
  const planPath = typeof args.out === "string" && args.out ? args.out : defaultWorkflowPlanPath(workflow, inputs);
786
- const plan = parseJsonOutput(await new WorkflowRunner().plan(workflow, inputs, {
787
- format: "json",
788
- out: workflowArtifactPath(workspace, planPath)
789
- }));
786
+ const out = workflowArtifactPath(workspace, planPath);
787
+ const plan = parseJsonOutput(await new WorkflowRunner().plan(workflow, inputs, { format: "json", out, workspace }));
790
788
  return {
791
789
  ...plan,
792
790
  planPath,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ApplicationBuildReporter
4
- } from "./index-d894868w.js";
4
+ } from "./index-p6hjwt2d.js";
5
5
  import {
6
6
  parseBiomeReport,
7
7
  Linter,
@@ -10,11 +10,11 @@ import {
10
10
  AppExecutor,
11
11
  LibExecutor,
12
12
  PkgExecutor
13
- } from "./index-38by07nw.js";
13
+ } from "./index-sr5da35e.js";
14
14
  import {
15
15
  WorkspaceRunner,
16
16
  AkanQualityScanner
17
- } from "./index-ap6ac70m.js";
17
+ } from "./index-fjr4d6yd.js";
18
18
 
19
19
  // pkgs/@akanjs/cli/verify/verifyComments.ts
20
20
  import { existsSync } from "fs";
@@ -188,6 +188,7 @@ import { existsSync as existsSync4 } from "fs";
188
188
  import path5 from "path";
189
189
 
190
190
  // pkgs/@akanjs/cli/verify/verifyDiagnostics.ts
191
+ import { readFileSync } from "fs";
191
192
  import path2 from "path";
192
193
 
193
194
  class VerifyDiagnostics {
@@ -222,7 +223,7 @@ class VerifyDiagnostics {
222
223
  fix: `check the spelling, or add ${key}: [en, ko] to .translate({}) in ${dictionaryFile}; one-off text takes l.trans({ en, ko })`
223
224
  };
224
225
  }
225
- static fromBiome(report) {
226
+ static fromBiome(report, root) {
226
227
  return (report.diagnostics ?? []).filter((diagnostic) => diagnostic.severity === "error" || diagnostic.severity === "warning").map((diagnostic) => {
227
228
  const file = diagnostic.location?.path?.replaceAll("\\", "/") ?? null;
228
229
  return {
@@ -232,10 +233,38 @@ class VerifyDiagnostics {
232
233
  col: diagnostic.location?.start?.column ?? 0,
233
234
  code: diagnostic.category ?? "biome",
234
235
  severity: diagnostic.severity === "error" ? "error" : "warning",
235
- ...VerifyDiagnostics.#adapterErrorOf(file, diagnostic.message) ?? { message: diagnostic.message }
236
+ ...VerifyDiagnostics.#adapterErrorOf(file, diagnostic.message) ?? VerifyDiagnostics.#deepImportOf(root, file, diagnostic) ?? { message: diagnostic.message }
236
237
  };
237
238
  });
238
239
  }
240
+ static #deepImport = /^Module files should not import from two or more parent directories/;
241
+ static #deepSpecifier = /["'](\.\.\/\.\.\/[^"']*)["']/g;
242
+ static #layerOf = /^(apps|libs)\/([\w-]+)\/(common|srvkit|webkit|ui)(?:\/|$)/;
243
+ static #deepImportOf(root, file, diagnostic) {
244
+ const start = diagnostic.location?.start;
245
+ if (!root || !file || !start || !VerifyDiagnostics.#deepImport.test(diagnostic.message))
246
+ return null;
247
+ let line;
248
+ try {
249
+ line = readFileSync(path2.join(root, file), "utf8").split(`
250
+ `)[start.line - 1] ?? "";
251
+ } catch {
252
+ return null;
253
+ }
254
+ const specifiers = [...line.matchAll(VerifyDiagnostics.#deepSpecifier)];
255
+ const specifier = (specifiers.find((match) => match.index === start.column - 1) ?? specifiers[0])?.[1];
256
+ if (!specifier)
257
+ return null;
258
+ const target = path2.posix.join(path2.posix.dirname(file), specifier);
259
+ const [, kind, name, layer] = target.match(VerifyDiagnostics.#layerOf) ?? [];
260
+ if (!kind || !name || !layer)
261
+ return null;
262
+ const barrel = `@${kind}/${name}/${layer}`;
263
+ return {
264
+ message: `Module files should not reach ${barrel} through two or more parent directories.`,
265
+ fix: `import from "${barrel}"`
266
+ };
267
+ }
239
268
  static #rawError = /^Do not (throw|construct) a raw `Error`/;
240
269
  static #srvkitFile = /^((?:apps|libs)\/([\w-]+))\/srvkit\//;
241
270
  static #adapterErrorOf(file, message) {
@@ -273,6 +302,9 @@ class VerifyDiagnostics {
273
302
  ...warning.fix ? { fix: warning.fix } : {}
274
303
  }));
275
304
  }
305
+ static fromRouteJsBudget({ file, message, fix }) {
306
+ return { step: "build", file, line: 0, col: 0, code: "akan.budget", severity: "warning", message, fix };
307
+ }
276
308
  static #prefix = /^\[([\w.-]+)\]\s*/;
277
309
  static #location = /((?:apps|libs|pkgs)\/[^\s:()`'"]+\.[a-z]+)(?::(\d+)(?::(\d+))?)?/;
278
310
  static fromMessage(step, message, code = `akan.${step}`) {
@@ -652,7 +684,7 @@ class VerifyPipeline {
652
684
  const report = parseBiomeReport(stdout);
653
685
  const diagnostics = await VerifyStyleClasses.dropDefined(this.#root, report.diagnostics ?? [], cssDirs);
654
686
  return {
655
- diagnostics: VerifyDiagnostics.fromBiome({ ...report, diagnostics }),
687
+ diagnostics: VerifyDiagnostics.fromBiome({ ...report, diagnostics }, this.#root),
656
688
  fixed: report.summary?.changed ?? 0
657
689
  };
658
690
  } catch {
@@ -685,8 +717,8 @@ class VerifyPipeline {
685
717
  }
686
718
  }
687
719
  async#build(target) {
688
- await this.#applicationRunner.build(AppExecutor.from(this.#workspace, target.name), { fast: true });
689
- return { diagnostics: [] };
720
+ const { routeJsWarnings = [] } = await this.#applicationRunner.build(AppExecutor.from(this.#workspace, target.name), { fast: true });
721
+ return { diagnostics: routeJsWarnings.map((warning) => VerifyDiagnostics.fromRouteJsBudget(warning)) };
690
722
  }
691
723
  async#ssr(scope) {
692
724
  const scanned = await new AkanQualityScanner().scan(this.#root);
@@ -1003,7 +1003,7 @@ class AkanAppConfig {
1003
1003
  }
1004
1004
  static localImageGuard = [
1005
1005
  "ARG AKAN_ALLOW_LOCAL_IMAGE",
1006
- `RUN if [ "$AKAN_ALLOW_LOCAL_IMAGE" != "1" ]; then echo "This build ran with AKAN_PUBLIC_ENV=local, which serves the dev routes to every caller. Build with the environment it deploys to, or pass --build-arg AKAN_ALLOW_LOCAL_IMAGE=1." >&2; exit 1; fi`
1006
+ `RUN if [ "$AKAN_ALLOW_LOCAL_IMAGE" != "1" ]; then echo "This build ran with AKAN_PUBLIC_ENV=local, so the server runs without endpoint rate limits and on local defaults for Redis and the database mode. Build for the environment it deploys to with akan build --env, or pass --build-arg AKAN_ALLOW_LOCAL_IMAGE=1." >&2; exit 1; fi`
1007
1007
  ].join(`
1008
1008
  `);
1009
1009
  dockerfileFor(environment, { lockfile = true } = {}) {
@@ -1359,6 +1359,30 @@ class AsyncDefaultExportDetector {
1359
1359
  }
1360
1360
  }
1361
1361
 
1362
+ // pkgs/@akanjs/devkit/artifact/storeBootstrap.ts
1363
+ class StoreBootstrap {
1364
+ static importLines(appName) {
1365
+ return StoreBootstrap.#lines([`@apps/${appName}/lib/useClient`, `@apps/${appName}/lib/st`]);
1366
+ }
1367
+ static source(appName) {
1368
+ return `${StoreBootstrap.importLines(appName).join(`
1369
+ `)}
1370
+ `;
1371
+ }
1372
+ static ofClientBarrel(specifier, exports) {
1373
+ if (!/^@(?:apps|libs)\/[^/]+\/client$/.test(specifier))
1374
+ return null;
1375
+ const runtime = exports.get("usePage");
1376
+ const store = exports.get("st");
1377
+ if (!runtime || runtime.namespace || !store || store.namespace)
1378
+ return StoreBootstrap.#lines([specifier]);
1379
+ return StoreBootstrap.#lines([...new Set([runtime.subpath, store.subpath])]);
1380
+ }
1381
+ static #lines(specifiers) {
1382
+ return specifiers.map((specifier) => `import ${JSON.stringify(specifier)};`);
1383
+ }
1384
+ }
1385
+
1362
1386
  // pkgs/@akanjs/devkit/artifact/implicitRootLayout.ts
1363
1387
  var LAYOUT_KEY_RE = /^\.\/(.+\/)?_layout\.(tsx|ts|jsx|js)$/;
1364
1388
  var IMPLICIT_LAYOUT_DIR = path6.join(".akan", "generated", "root-layouts");
@@ -1467,10 +1491,7 @@ async function writeGeneratedRootLayoutFile(opts) {
1467
1491
  const sourceSpecifier = opts.boundary.sourceAbsPath ? importSpecifier(absPath, opts.boundary.sourceAbsPath) : null;
1468
1492
  const inheritedSourceAbsPath = opts.rootSourceAbsPath && opts.rootSourceAbsPath !== opts.boundary.sourceAbsPath ? opts.rootSourceAbsPath : null;
1469
1493
  const inheritedSourceSpecifier = inheritedSourceAbsPath ? importSpecifier(absPath, inheritedSourceAbsPath) : null;
1470
- const clientImport = opts.includeStInit ? `import { st } from "@apps/${opts.appName}/client";
1471
- void st;
1472
- ` : `import "@apps/${opts.appName}/client";
1473
- `;
1494
+ const storeImport = opts.includeStoreBootstrap ? StoreBootstrap.source(opts.appName) : "";
1474
1495
  const inheritedLabel = inheritedSourceAbsPath ? posixRelative(opts.appCwdPath, inheritedSourceAbsPath) : "";
1475
1496
  const inheritedImport = inheritedSourceSpecifier ? `import * as inheritedModule from ${JSON.stringify(inheritedSourceSpecifier)};
1476
1497
  const inheritedLayout = assertGuardOnChain(${JSON.stringify(inheritedLabel)}, resolveRouteModule(inheritedModule as never, ${JSON.stringify(inheritedLabel)})).module as LayoutModule;
@@ -1518,7 +1539,7 @@ import { System } from "akanjs/ui/System/index.tsx";
1518
1539
  import type { McpAppRootProps } from "akanjs/webkit";
1519
1540
  import { env } from "@apps/${opts.appName}/env/env.client";
1520
1541
  import { allDictionary } from ${JSON.stringify(dictMacroSpecifier)};
1521
- ${clientImport}${inheritedImport}${userImport}
1542
+ ${storeImport}${inheritedImport}${userImport}
1522
1543
  const userFonts = userLayout.fonts ?? inheritedLayout.fonts ?? [];
1523
1544
  const defaultFonts = userFonts.filter((font) => font.default);
1524
1545
  if (defaultFonts.length > 1) throw new Error("[route-convention] only one default font is allowed per root layout");
@@ -1604,7 +1625,7 @@ async function resolveSsrPageEntries(opts) {
1604
1625
  appName: opts.appName,
1605
1626
  boundary,
1606
1627
  rootSourceAbsPath,
1607
- includeStInit: hasSt && boundary.segments.length === 0,
1628
+ includeStoreBootstrap: hasSt,
1608
1629
  includeSystemProvider: !hasAncestorRootBoundary(boundary, rootBoundaries)
1609
1630
  }),
1610
1631
  seedAbsPaths: [...new Set([boundary.sourceAbsPath, rootSourceAbsPath].filter((absPath) => absPath !== null))]
@@ -2380,6 +2401,7 @@ var appRootAllowedFiles = new Set([
2380
2401
  "CLAUDE.md",
2381
2402
  "akan.app.json",
2382
2403
  "akan.baseline.json",
2404
+ "akan.budget.json",
2383
2405
  "akan.config.ts",
2384
2406
  "client.ts",
2385
2407
  "main.ts",
@@ -3563,7 +3585,8 @@ class WorkspaceExecutor extends Executor {
3563
3585
  static localServeDomain = "localhost";
3564
3586
  static getBaseDevEnv(envPath) {
3565
3587
  const sourceEnv = {
3566
- ...envPath ? { ...process.env, ...parseEnvFile(envPath) } : process.env,
3588
+ ...envPath ? parseEnvFile(envPath) : {},
3589
+ ...Object.fromEntries(Object.entries(process.env).filter(([, value]) => value)),
3567
3590
  ...WorkspaceExecutor.publicEnvPin
3568
3591
  };
3569
3592
  const appName = sourceEnv.AKAN_PUBLIC_APP_NAME;
@@ -4482,4 +4505,4 @@ class ModuleExecutor extends Executor {
4482
4505
  }
4483
4506
  }
4484
4507
 
4485
- export { AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, CLAUDE_COMMENT_RULE, binPlatforms, ServerEnvProfile, AkanAppConfig, AkanWorkspaceConfig, AsyncDefaultExportDetector, resolveSsrPageEntriesForApp, CodegenLock, JsonFormatter, parseBiomeReport, Linter, LibSource, formatLibStatuses, rootAllowedFiles, rootAllowedDirs, isAllowedLibFacetRootFile, libFacetRootHintOf, barrelFacetDirs, facetIndexShadowOf, rootEntryHintOf, isScannedRootEntry, AppInfo, Spinner, TypecheckFailure, ProjectTypecheck2, CommandExecutionError, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
4508
+ export { AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, CLAUDE_COMMENT_RULE, binPlatforms, ServerEnvProfile, AkanAppConfig, AkanWorkspaceConfig, AsyncDefaultExportDetector, StoreBootstrap, resolveSsrPageEntriesForApp, CodegenLock, JsonFormatter, parseBiomeReport, Linter, LibSource, formatLibStatuses, rootAllowedFiles, rootAllowedDirs, isAllowedLibFacetRootFile, libFacetRootHintOf, barrelFacetDirs, facetIndexShadowOf, rootEntryHintOf, isScannedRootEntry, AppInfo, Spinner, TypecheckFailure, ProjectTypecheck2, CommandExecutionError, parseEnvFile, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  AppInfo
4
- } from "./index-38by07nw.js";
4
+ } from "./index-sr5da35e.js";
5
5
 
6
6
  // pkgs/@akanjs/devkit/slicePlanner.ts
7
7
  class SlicePlanner {
@@ -10,7 +10,7 @@ import {
10
10
  isScannedRootEntry,
11
11
  AppExecutor,
12
12
  LibExecutor
13
- } from "./index-38by07nw.js";
13
+ } from "./index-sr5da35e.js";
14
14
  import {
15
15
  FileSys2
16
16
  } from "./index-bns3wcpc.js";
@@ -23,7 +23,7 @@ import {
23
23
  workflowPathsForPlan,
24
24
  workflowRunArtifactPath,
25
25
  workflowSyncDir
26
- } from "./index-kdswbvys.js";
26
+ } from "./index-8pb9yvp8.js";
27
27
 
28
28
  // pkgs/@akanjs/devkit/akanContext.ts
29
29
  import { readdir } from "fs/promises";
@@ -4,27 +4,27 @@ import {
4
4
  CloudApi,
5
5
  CloudUpdates,
6
6
  PipelineSecrets
7
- } from "./index-sra1a5f8.js";
7
+ } from "./index-drz9e84d.js";
8
8
  import {
9
9
  PkgExecutor
10
- } from "./index-38by07nw.js";
10
+ } from "./index-sr5da35e.js";
11
11
  import {
12
12
  UpdatePackFolder,
13
13
  NativePublicEnv,
14
14
  NativeApp
15
- } from "./index-w60zxxye.js";
15
+ } from "./index-zpv14wpy.js";
16
16
  import {
17
17
  script
18
- } from "./index-r0q2ka2b.js";
18
+ } from "./index-93ewzmp6.js";
19
19
  import {
20
20
  ApplicationScript
21
- } from "./index-r8t5sq7z.js";
21
+ } from "./index-vr68mxj5.js";
22
22
  import {
23
23
  PackageScript
24
- } from "./index-demt944k.js";
24
+ } from "./index-d4n1wmrz.js";
25
25
  import {
26
26
  CloudRunner
27
- } from "./index-qwe079ww.js";
27
+ } from "./index-6wpaq392.js";
28
28
 
29
29
  // pkgs/@akanjs/cli/cloud/cloud.script.ts
30
30
  import { Logger } from "akanjs/common";
@@ -213,7 +213,10 @@ class CloudScript2 extends script("cloud", [CloudRunner, ApplicationScript, Pack
213
213
  async deployAkan(workspace, {
214
214
  test = true,
215
215
  registryUrl,
216
- platforms = []
216
+ platforms = [],
217
+ prerelease = null,
218
+ yes = false,
219
+ packTo = null
217
220
  } = {}) {
218
221
  const akanPkgs = await this.cloudRunner.getAkanPkgs(workspace);
219
222
  await this.packageScript.updateWorskpaceRootPackageJson(workspace);
@@ -239,7 +242,13 @@ class CloudScript2 extends script("cloud", [CloudRunner, ApplicationScript, Pack
239
242
  for (const pkg of pkgs)
240
243
  await this.packageScript.buildPackage(pkg);
241
244
  await this.packageScript.verifyAkanPublishPackages(workspace);
242
- await this.cloudRunner.deployAkan(workspace, akanPkgs, { registryUrl });
245
+ await this.cloudRunner.deployAkan(workspace, akanPkgs, {
246
+ registryUrl,
247
+ prerelease,
248
+ packTo,
249
+ confirmPublish: !yes,
250
+ npmLogin: !yes
251
+ });
243
252
  }
244
253
  async testPlatforms(workspace, { platforms, pkgs }) {
245
254
  if (!platforms.length)
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  WorkspaceExecutor
4
- } from "./index-38by07nw.js";
4
+ } from "./index-sr5da35e.js";
5
5
  import {
6
6
  jsonText,
7
7
  workflowPlanApproval,
@@ -19,6 +19,7 @@ import {
19
19
  getWorkflowSpec,
20
20
  compactWorkflowInputs,
21
21
  createWorkflowPlan,
22
+ workflowTargetDiagnostics,
22
23
  inspectWorkflowPlan,
23
24
  renderWorkflowList,
24
25
  renderWorkflowExplain,
@@ -26,30 +27,30 @@ import {
26
27
  renderWorkflowApply,
27
28
  renderWorkflowValidation,
28
29
  renderWorkflowRunArtifact
29
- } from "./index-kdswbvys.js";
30
+ } from "./index-8pb9yvp8.js";
30
31
  import {
31
32
  AkanContextAnalyzer
32
- } from "./index-ck64kxrn.js";
33
+ } from "./index-thckcabc.js";
33
34
  import {
34
35
  CommandContainer,
35
36
  runner
36
- } from "./index-r0q2ka2b.js";
37
+ } from "./index-93ewzmp6.js";
37
38
  import {
38
39
  ModuleScript
39
- } from "./index-hmj94es2.js";
40
+ } from "./index-8ts9774g.js";
40
41
  import {
41
42
  PrimitiveScript
42
- } from "./index-6zgt7zmx.js";
43
+ } from "./index-48d5qsj3.js";
43
44
  import {
44
45
  spawnAkan,
45
46
  isWorkspaceTarget
46
- } from "./index-0tkj05cz.js";
47
+ } from "./index-0fb3cpbt.js";
47
48
  import {
48
49
  ScalarScript
49
- } from "./index-gfh90r3t.js";
50
+ } from "./index-e3vmjtph.js";
50
51
  import {
51
52
  workflowSpecs
52
- } from "./index-k64mhwbw.js";
53
+ } from "./index-eajbmk10.js";
53
54
 
54
55
  // pkgs/@akanjs/cli/workflow/workflow.runner.ts
55
56
  import { mkdir, readFile, writeFile } from "fs/promises";
@@ -85,19 +86,17 @@ var failedPlan = (workflow, diagnostics) => ({
85
86
  requiresApproval: true,
86
87
  approval: workflowPlanApproval
87
88
  });
88
- var failedApplyReport = (workflow, code, message, plan) => {
89
- const diagnostics = [{ severity: "error", code, message }];
90
- return createWorkflowApplyReport({
91
- workflow,
92
- mode: "apply",
93
- changedFiles: [],
94
- generatedFiles: [],
95
- commands: [],
96
- diagnostics,
97
- nextActions: [],
98
- plan: plan ?? failedPlan(workflow, diagnostics)
99
- });
100
- };
89
+ var refusedApplyReport = (workflow, diagnostics, { plan, mode = "apply" } = {}) => createWorkflowApplyReport({
90
+ workflow,
91
+ mode,
92
+ changedFiles: [],
93
+ generatedFiles: [],
94
+ commands: [],
95
+ diagnostics,
96
+ nextActions: [],
97
+ plan: plan ?? failedPlan(workflow, diagnostics)
98
+ });
99
+ var failedApplyReport = (workflow, code, message, plan) => refusedApplyReport(workflow, [{ severity: "error", code, message }], { plan });
101
100
  var inferValidationKind = (command) => {
102
101
  if (command.kind)
103
102
  return command.kind;
@@ -280,7 +279,7 @@ class WorkflowRunner extends runner("workflow") {
280
279
  const spec = getWorkflowSpec(workflowSpecs, workflow);
281
280
  if (!spec)
282
281
  throw new Error(`Unknown workflow: ${workflow}. Run \`akan workflow list\` to see available workflows.`);
283
- const plan = await inspectWorkflowPlan(workspace ?? WorkspaceExecutor.fromRoot(), createWorkflowPlan(spec, compactWorkflowInputs(inputs)));
282
+ const plan = await inspectWorkflowPlan(workspace ?? WorkspaceExecutor.fromRoot(), spec, createWorkflowPlan(spec, compactWorkflowInputs(inputs)));
284
283
  if (out) {
285
284
  const outPath = resolvePath(out);
286
285
  await mkdir(path.dirname(outPath), { recursive: true });
@@ -320,6 +319,9 @@ class WorkflowRunner extends runner("workflow") {
320
319
  const message = inputErrors.map((diagnostic) => diagnostic.message).join(" ");
321
320
  return await renderApplyReport(failedApplyReport(plan.workflow, "workflow-plan-inputs-invalid", message, plan));
322
321
  }
322
+ const targetErrors = await workflowTargetDiagnostics(workspace ?? WorkspaceExecutor.fromRoot(), spec, plan.inputs);
323
+ if (targetErrors.length)
324
+ return await renderApplyReport(refusedApplyReport(plan.workflow, targetErrors, { plan, mode: dryRun ? "dry-run" : "apply" }));
323
325
  plan = { ...plan, steps: spec.steps, validation: spec.validation };
324
326
  if (dryRun)
325
327
  return await renderApplyReport(createDryRunWorkflowApplyReport(plan));