@akanjs/cli 3.1.0-rc.2 → 3.1.0-rc.20

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 (100) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-q50k4s45.js → CodeAgent-n3tzjm91.js} +2 -2
  3. package/{CodeAgentRpcHost-p7h6n2hp.js → CodeAgentRpcHost-9g27hmer.js} +1 -1
  4. package/{CodeTui-62g35ztk.js → CodeTui-fnm9ft4d.js} +47 -4
  5. package/TunnelShare-661cxz5e.js +14 -0
  6. package/{agent.command-adfd5299.js → agent.command-3qxf4xcj.js} +5 -5
  7. package/akanCode.js +7 -5
  8. package/{application.command-hj3gv1rx.js → application.command-zfja7x4r.js} +12 -11
  9. package/{applicationBuildRunner-by10r9gf.js → applicationBuildRunner-vh4j6vdv.js} +16 -9
  10. package/buildBatch.proc.js +7 -7
  11. package/{cloud.command-k2fhaape.js → cloud.command-fcc8e8tp.js} +17 -16
  12. package/cloud.script-1xt3tnts.js +24 -0
  13. package/{code.command-kt5zgcc2.js → code.command-130bdmhe.js} +25 -12
  14. package/{context.command-8fgn42jw.js → context.command-0qx447mb.js} +17 -16
  15. package/context.runner-1vsjztjg.js +25 -0
  16. package/{dependencyScanner-06z2dmrr.js → dependencyScanner-3afj2vt1.js} +1 -1
  17. package/{guideline.command-3yxxr2mm.js → guideline.command-cv5bmrx2.js} +2 -2
  18. package/guidelines/agentRule/agentRule.instruction.md +25 -10
  19. package/guidelines/conventions/conventions.instruction.md +463 -1084
  20. package/guidelines/cssRule/cssRule.instruction.md +16 -1
  21. package/guidelines/fieldRule/fieldRule.instruction.md +74 -0
  22. package/guidelines/framework/framework.instruction.md +4 -7
  23. package/guidelines/mcpRule/mcpRule.instruction.md +16 -9
  24. package/guidelines/modelConstant/modelConstant.instruction.md +2 -1
  25. package/guidelines/modelStore/modelStore.instruction.md +16 -0
  26. package/guidelines/pageRule/pageRule.instruction.md +80 -0
  27. package/guidelines/queryRule/queryRule.instruction.md +47 -12
  28. package/guidelines/runtimeRule/runtimeRule.instruction.md +89 -2
  29. package/guidelines/ssrRule/ssrRule.instruction.md +13 -0
  30. package/guidelines/transportRule/transportRule.instruction.md +107 -8
  31. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +4 -4
  32. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +70 -7
  33. package/incrementalBuilder.proc.js +4 -4
  34. package/{index-nq045px5.js → index-192ha4xh.js} +356 -307
  35. package/{index-t7nws9mx.js → index-1djcjcre.js} +661 -448
  36. package/{index-h85cxfkg.js → index-1p98exm2.js} +2 -2
  37. package/{index-hnby7p9n.js → index-1xj2t7cb.js} +7 -7
  38. package/{index-wa5jbxj1.js → index-2mrn1mrg.js} +1 -0
  39. package/{index-58vvz603.js → index-35hc95h5.js} +1 -1
  40. package/{index-tv8fjaba.js → index-4mhy6qme.js} +4 -4
  41. package/{index-rk9sdys3.js → index-5edzv8fn.js} +5 -5
  42. package/{index-k9rrten6.js → index-5nd1wtkv.js} +92 -94
  43. package/index-62md4dwy.js +260 -0
  44. package/{index-kc8z134d.js → index-665zp9rs.js} +38 -15
  45. package/{index-jwqtchha.js → index-86jt2a0e.js} +1 -1
  46. package/{index-d2242ksy.js → index-at7bz0xq.js} +3 -0
  47. package/{index-sqfdmb5b.js → index-awbdfcf2.js} +4 -4
  48. package/{index-azh29dc8.js → index-axs61rna.js} +19 -14
  49. package/{index-3hx1z96c.js → index-bqbf654f.js} +1 -1
  50. package/{index-6726qr1m.js → index-cpb3nvma.js} +57 -58
  51. package/{index-pyxn1b53.js → index-d72hfmdm.js} +13 -13
  52. package/{index-8zdwpxef.js → index-dye8pnxx.js} +119 -81
  53. package/{index-z507nzhg.js → index-fmzcs8v6.js} +4 -4
  54. package/{index-3reaaa1h.js → index-fyq1z6kt.js} +29 -27
  55. package/{index-0909wckt.js → index-g1mbppa9.js} +238 -236
  56. package/{index-fjsv10hd.js → index-hsadfb6c.js} +7 -7
  57. package/{index-tz5evhdr.js → index-j237xtew.js} +6 -6
  58. package/{index-nq2ja5e0.js → index-j4mkhz93.js} +3 -3
  59. package/{index-31ce9vhg.js → index-jw1zm273.js} +28 -30
  60. package/{index-q958tqqg.js → index-m9jj544v.js} +1 -1
  61. package/{index-8935h3n1.js → index-mdjc93e1.js} +1 -1
  62. package/{index-bea2gwc6.js → index-pydbnfez.js} +2 -2
  63. package/{index-20cebtth.js → index-qtfmtcrw.js} +17 -15
  64. package/{index-sby8fe1p.js → index-qwa5k1j8.js} +1 -1
  65. package/{index-e9prnmyt.js → index-tamvyvj3.js} +3 -3
  66. package/{index-rhbabmja.js → index-trpasv9q.js} +260 -259
  67. package/{index-2ahj896a.js → index-tvehn2sp.js} +1 -1
  68. package/{index-2etqq75t.js → index-va06nr10.js} +1090 -1078
  69. package/{index-g0vwzy9m.js → index-vk0pa0mn.js} +20 -21
  70. package/{index-xpdgxsj5.js → index-w44cy4vs.js} +2216 -2216
  71. package/index.js +22 -22
  72. package/{library.command-8tw59xzj.js → library.command-erp2f56n.js} +3 -3
  73. package/{localRegistry.command-tf3dmznd.js → localRegistry.command-hj3p16p5.js} +15 -14
  74. package/{module.command-9vm8hffy.js → module.command-gs2r615e.js} +5 -5
  75. package/{package.command-erbxe2tz.js → package.command-j10r76ax.js} +4 -4
  76. package/package.json +21 -21
  77. package/{page.command-jpavcj0p.js → page.command-4h4a8pnh.js} +3 -3
  78. package/{pipeline.command-b8rzvjvv.js → pipeline.command-a2nrk26m.js} +3 -3
  79. package/{primitive.command-sm32chzk.js → primitive.command-w6t0asqz.js} +6 -6
  80. package/{projectTypecheck-jamtx95x.js → projectTypecheck-f534enqj.js} +1 -1
  81. package/{quality.command-pkd17n6y.js → quality.command-77x7vbbx.js} +4 -4
  82. package/{repair.command-8y4mq6hs.js → repair.command-y6sstev7.js} +5 -5
  83. package/{scalar.command-q8khmyx5.js → scalar.command-20b8cy0k.js} +4 -4
  84. package/skills/akan-code/SKILL.md +4 -0
  85. package/skills/akan-store/SKILL.md +2 -1
  86. package/{subspace.command-51n0ykbx.js → subspace.command-baz73jpk.js} +11 -10
  87. package/templates/appSample/lib/task/Task.Util.tsx +7 -7
  88. package/templates/appSample/lib/task/Task.Zone.tsx +1 -1
  89. package/templates/appSample/ui/QuantityControl.tsx +2 -2
  90. package/templates/crudSinglePage/page.tsx +1 -1
  91. package/templates/lib/cnst.ts +0 -1
  92. package/templates/workspaceRoot/.gitignore.template +23 -52
  93. package/templates/workspaceRoot/biome.json.template +1 -1
  94. package/{tunnel.command-7820vtxq.js → tunnel.command-2kw8vt9g.js} +8 -7
  95. package/{workflow.command-n5sv4wqz.js → workflow.command-2djwmpqf.js} +10 -10
  96. package/{workspace.command-zdy60jh8.js → workspace.command-jqs7vjhe.js} +29 -28
  97. package/TunnelShare-f1egrktx.js +0 -13
  98. package/cloud.script-z8p5dz7e.js +0 -23
  99. package/context.runner-hnh0rg7m.js +0 -24
  100. package/index-n68jx79w.js +0 -120
@@ -1,17 +1,40 @@
1
1
  // @bun
2
2
  import {
3
3
  resolveSsrPageEntriesForApp
4
- } from "./index-2etqq75t.js";
4
+ } from "./index-va06nr10.js";
5
5
  import {
6
6
  bundleDefine,
7
7
  CsrEntryFiles,
8
8
  PagesEntrySourceGenerator,
9
9
  PagesBundleBuilder
10
- } from "./index-nq045px5.js";
10
+ } from "./index-192ha4xh.js";
11
11
 
12
12
  // pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
13
13
  import { mkdir, rm, unlink } from "fs/promises";
14
+ import path2 from "path";
15
+
16
+ // pkgs/@akanjs/devkit/transforms/browserDirnamePlugin.ts
14
17
  import path from "path";
18
+ var vendorScript = /[\\/]node_modules[\\/].+\.[cm]?js$/;
19
+ var createBrowserDirnamePlugin = () => ({
20
+ name: "akan-browser-dirname",
21
+ setup(build) {
22
+ build.onLoad({ filter: vendorScript }, async (args) => {
23
+ const source = await Bun.file(args.path).text();
24
+ if (!source.includes("__dirname") && !source.includes("__filename"))
25
+ return;
26
+ const posixPath = args.path.replaceAll("\\", "/");
27
+ const filename = posixPath.slice(posixPath.indexOf("/node_modules/"));
28
+ const define = { __dirname: JSON.stringify(path.posix.dirname(filename)), __filename: JSON.stringify(filename) };
29
+ return {
30
+ loader: "js",
31
+ contents: new Bun.Transpiler({ loader: "js", target: "browser", define }).transformSync(source)
32
+ };
33
+ });
34
+ }
35
+ });
36
+
37
+ // pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
15
38
  class CsrArtifactBuilder {
16
39
  #app;
17
40
  #command;
@@ -67,11 +90,11 @@ ${logs}` : ""}`);
67
90
  minify: true,
68
91
  define: bundleDefine(app, command, "csr"),
69
92
  optimizeImports,
70
- plugins: [PagesBundleBuilder.createCssStubPlugin()]
93
+ plugins: [PagesBundleBuilder.createCssStubPlugin(), createBrowserDirnamePlugin()]
71
94
  };
72
95
  }
73
96
  static publicEnvPath(app) {
74
- return path.join(app.dist.cwdPath, ".akan", "artifact", "csr-public-env.json");
97
+ return path2.join(app.dist.cwdPath, ".akan", "artifact", "csr-public-env.json");
75
98
  }
76
99
  static async writePublicEnv(app, define) {
77
100
  const prefix = "process.env.";
@@ -89,20 +112,20 @@ ${logs}` : ""}`);
89
112
  return CsrEntryFiles.entryFilename(basePath);
90
113
  }
91
114
  static basePathOfHtml(htmlPath) {
92
- const name = path.basename(htmlPath, ".html");
115
+ const name = path2.basename(htmlPath, ".html");
93
116
  return name === "index" ? "" : name;
94
117
  }
95
118
  get #outputDir() {
96
- return path.join(this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath, this.#command === "build" ? "csr" : ".akan/artifact/csr");
119
+ return path2.join(this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath, this.#command === "build" ? "csr" : ".akan/artifact/csr");
97
120
  }
98
121
  get #generatedDir() {
99
- return path.join(this.#app.cwdPath, ".akan/generated/csr");
122
+ return path2.join(this.#app.cwdPath, ".akan/generated/csr");
100
123
  }
101
124
  get #artifactDir() {
102
- return path.join(this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath, ".akan/artifact");
125
+ return path2.join(this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath, ".akan/artifact");
103
126
  }
104
127
  #generatedPath(filename) {
105
- return path.join(this.#generatedDir, filename);
128
+ return path2.join(this.#generatedDir, filename);
106
129
  }
107
130
  async#createEntryFile(basePath, pageEntries) {
108
131
  return [
@@ -135,7 +158,7 @@ void bootCsr(pages);
135
158
  async#loadCssAssets() {
136
159
  if (this.#cssAssets)
137
160
  return this.#cssAssets;
138
- const artifactFile = Bun.file(path.join(this.#artifactDir, "base-artifact.json"));
161
+ const artifactFile = Bun.file(path2.join(this.#artifactDir, "base-artifact.json"));
139
162
  if (!await artifactFile.exists())
140
163
  return {};
141
164
  const artifact = await artifactFile.json();
@@ -150,7 +173,7 @@ void bootCsr(pages);
150
173
  const basePath = CsrArtifactBuilder.basePathOfHtml(htmlPath);
151
174
  const cssAsset = cssAssets[basePath];
152
175
  if (!cssAsset) {
153
- this.#app.logger.warn(`[csr-build] base-artifact.json has no compiled stylesheet for ${basePath || "root"}; ${path.basename(htmlPath)} ships without CSS`);
176
+ this.#app.logger.warn(`[csr-build] base-artifact.json has no compiled stylesheet for ${basePath || "root"}; ${path2.basename(htmlPath)} ships without CSS`);
154
177
  }
155
178
  const inlined = await this.#inlineHtmlAssets(await htmlFile.text(), htmlPath, cssAsset);
156
179
  for (const filePath of inlined.jsFiles)
@@ -171,7 +194,7 @@ ${remainingAssets.join(`
171
194
  async#inlineHtmlAssets(html, htmlPath, cssAsset) {
172
195
  let next = html;
173
196
  if (cssAsset) {
174
- const css = await Bun.file(path.join(this.#artifactDir, cssAsset.cssRelPath)).text();
197
+ const css = await Bun.file(path2.join(this.#artifactDir, cssAsset.cssRelPath)).text();
175
198
  next = CsrArtifactBuilder.injectBeforeHeadEnd(next, CsrArtifactBuilder.createInlineStyle(css));
176
199
  }
177
200
  const jsFiles = [];
@@ -189,7 +212,7 @@ ${remainingAssets.join(`
189
212
  if (predicate(filePath))
190
213
  files.push(filePath);
191
214
  }
192
- return files.sort();
215
+ return files.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
193
216
  }
194
217
  static injectBeforeHeadEnd(html, snippet) {
195
218
  const scannable = CsrArtifactBuilder.blankEmbeddedContent(html);
@@ -205,7 +228,7 @@ ${html.slice(bodyStart)}`;
205
228
  ${snippet}`;
206
229
  }
207
230
  static blankEmbeddedContent(html) {
208
- return html.replace(/<script\b[^>]*>[\s\S]*?<\/script\s*>|<style\b[^>]*>[\s\S]*?<\/style\s*>|<!--[\s\S]*?-->/gi, (match) => " ".repeat(match.length));
231
+ return html.replace(/<script\b[^>]*>[\s\S]*?(?:<\/script(?:[\s/][^<>]*)?>|$)|<style\b[^>]*>[\s\S]*?(?:<\/style(?:[\s/][^<>]*)?>|$)|<!--[\s\S]*?(?:--!?>|$)/gi, (match) => " ".repeat(match.length));
209
232
  }
210
233
  static createInlineStyle(css) {
211
234
  return `<style data-akan-css="active">
@@ -241,7 +264,7 @@ ${CsrArtifactBuilder.escapeInlineScript(await loadScript(src))}
241
264
  throw new Error(`[csr-build] cannot inline external script: ${src}`);
242
265
  }
243
266
  const normalized = src.startsWith("/") ? src.slice(1) : src;
244
- return path.resolve(path.dirname(htmlPath), normalized);
267
+ return path2.resolve(path2.dirname(htmlPath), normalized);
245
268
  }
246
269
  }
247
270
 
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-31ce9vhg.js";
5
+ } from "./index-jw1zm273.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -77,6 +77,9 @@ class CodeAgentRpcHost2 {
77
77
  case "set_model":
78
78
  await this.#agent.setModel({ provider: command.provider, id: command.modelId });
79
79
  return await this.#agent.state();
80
+ case "set_auto_compact":
81
+ this.#agent.setAutoCompactAt(command.percent);
82
+ return await this.#agent.state();
80
83
  case "get_state":
81
84
  return await this.#agent.state(command.sinceSeq === undefined ? {} : { sinceSeq: command.sinceSeq });
82
85
  case "shutdown":
@@ -1,12 +1,12 @@
1
1
  // @bun
2
2
  import {
3
3
  script
4
- } from "./index-31ce9vhg.js";
4
+ } from "./index-jw1zm273.js";
5
5
  import {
6
6
  AppExecutor,
7
7
  LibExecutor,
8
8
  ModuleExecutor
9
- } from "./index-2etqq75t.js";
9
+ } from "./index-va06nr10.js";
10
10
  import {
11
11
  workflowStatus,
12
12
  compactDiagnostics,
@@ -41,10 +41,10 @@ import {
41
41
  hasSignalFactoryEntry,
42
42
  insertSignalFactoryEntry,
43
43
  addFieldUiPolicyForType
44
- } from "./index-rhbabmja.js";
44
+ } from "./index-trpasv9q.js";
45
45
  import {
46
46
  ModuleScript
47
- } from "./index-z507nzhg.js";
47
+ } from "./index-fmzcs8v6.js";
48
48
 
49
49
  // pkgs/@akanjs/cli/primitive/primitive.script.ts
50
50
  import { capitalize, lowerlize } from "akanjs/common";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  resolveSsrPageEntriesForApp
4
- } from "./index-2etqq75t.js";
4
+ } from "./index-va06nr10.js";
5
5
  import {
6
6
  computeRouteSeedIndex,
7
7
  saveRouteSeedIndex,
@@ -9,17 +9,20 @@ import {
9
9
  ClientEntriesBundler,
10
10
  VENDOR_SPECIFIERS,
11
11
  RouteClientBuilder
12
- } from "./index-xpdgxsj5.js";
12
+ } from "./index-w44cy4vs.js";
13
13
  import {
14
14
  SOURCE_EXTS
15
- } from "./index-k9rrten6.js";
15
+ } from "./index-5nd1wtkv.js";
16
16
  import {
17
17
  CsrEntryFiles,
18
18
  BarrelAnalyzer,
19
19
  createTsconfigPackageResolver,
20
20
  rewriteBarrelImports,
21
21
  PagesBundleBuilder
22
- } from "./index-nq045px5.js";
22
+ } from "./index-192ha4xh.js";
23
+ import {
24
+ CssBlockParser
25
+ } from "./index-62md4dwy.js";
23
26
  var __require = import.meta.require;
24
27
 
25
28
  // pkgs/@akanjs/devkit/frontendBuild/allRoutesBuilder.ts
@@ -127,7 +130,6 @@ class AllRoutesBuilder {
127
130
  this.#knownSet.add(abs);
128
131
  }
129
132
  }
130
-
131
133
  // pkgs/@akanjs/devkit/frontendBuild/cssCompiler.ts
132
134
  import path3 from "path";
133
135
  import { Logger } from "akanjs/common";
@@ -135,10 +137,10 @@ import { compile } from "tailwindcss";
135
137
 
136
138
  // pkgs/@akanjs/devkit/frontendBuild/cssCandidateCache.ts
137
139
  import { stat } from "fs/promises";
138
- var CANDIDATE_RE = /-?(?:[\w@]|\[[^\]\s]+\])[\w:/.-]*(?:(?:\[[^\]\s]+\]|\((?:[a-z-]+:)?--[^)\s]+\))[\w:/.-]*)*/g;
140
+ var CANDIDATE_RE = /-?(?:[\w@]|\[(?:[^[\]\s]|\[[^[\]\s]+\])+\])[\w:/.-]*(?:(?:\[(?:[^[\]\s]|\[[^[\]\s]+\])+\]|\((?:[a-z-]+:)?--[^)\s]+\))[\w:/.-]*)*/g;
139
141
 
140
142
  class CssCandidateCache {
141
- static #version = 4;
143
+ static #version = 5;
142
144
  #path;
143
145
  #entries = new Map;
144
146
  #dirty = false;
@@ -651,13 +653,19 @@ function isIgnoredNodeModuleSource(filePath) {
651
653
  return NODE_MODULES_RE.test(filePath) && !AKANJS_NODE_MODULE_RE.test(filePath);
652
654
  }
653
655
  function declaredCustomProperties(css) {
654
- const withoutThemeBlocks = css.replace(/@theme[^{]*\{[^}]*\}/g, "");
655
- return [...new Set([...withoutThemeBlocks.matchAll(/(?:^|[\s;{])(--[\w-]+)\s*:/g)].map(([, name]) => name))].filter((name) => !!name);
656
+ const names = new Set;
657
+ CssBlockParser.walk(CssBlockParser.parse(css), true, (node) => {
658
+ if (node.kind === "block")
659
+ return node.atRule === "@theme" ? null : true;
660
+ if (node.property.startsWith("--"))
661
+ names.add(node.property);
662
+ return null;
663
+ });
664
+ return [...names];
656
665
  }
657
666
  function getPageKeyBasePath(pageKey, basePaths) {
658
667
  return CsrEntryFiles.basePathOfPageKey(pageKey, basePaths);
659
668
  }
660
-
661
669
  // pkgs/@akanjs/devkit/frontendBuild/fontOptimizer.ts
662
670
  import { mkdir, stat as stat2 } from "fs/promises";
663
671
  import path4 from "path";
@@ -1045,7 +1053,7 @@ class FontOptimizer {
1045
1053
  const filePaths = [];
1046
1054
  for await (const filePath of glob.scan({ cwd: root, absolute: true }))
1047
1055
  filePaths.push(filePath);
1048
- for (const filePath of filePaths.sort())
1056
+ for (const filePath of filePaths.sort((a, b) => a < b ? -1 : a > b ? 1 : 0))
1049
1057
  parts.push(await Bun.file(filePath).text());
1050
1058
  }
1051
1059
  return parts.join("");
@@ -1146,7 +1154,6 @@ ${declarations.map(([prop, value]) => ` ${prop}: ${value};`).join(`
1146
1154
  return JSON.stringify(value);
1147
1155
  }
1148
1156
  }
1149
-
1150
1157
  // pkgs/@akanjs/devkit/frontendBuild/fontPruner.ts
1151
1158
  import { rm, rmdir, stat as stat3 } from "fs/promises";
1152
1159
  import path5 from "path";
@@ -1310,7 +1317,6 @@ class FontPruner {
1310
1317
  return await stat3(dir).then((entry) => entry.isDirectory(), () => false);
1311
1318
  }
1312
1319
  }
1313
-
1314
1320
  // pkgs/@akanjs/devkit/frontendBuild/precompressArtifacts.ts
1315
1321
  import fs from "fs";
1316
1322
  import path6 from "path";
@@ -1370,7 +1376,6 @@ async function shouldPrecompress(filePath) {
1370
1376
  return false;
1371
1377
  return file.size >= MIN_COMPRESS_BYTES;
1372
1378
  }
1373
-
1374
1379
  // pkgs/@akanjs/devkit/frontendBuild/ssrBaseArtifactBuilder.ts
1375
1380
  import path7 from "path";
1376
1381
  import { optimize } from "@tailwindcss/node";
@@ -26,7 +26,7 @@ class ConfigLock {
26
26
  }
27
27
  static async#take(lockPath) {
28
28
  const handle = await open(lockPath, "wx", 384).catch((error) => {
29
- if (error.code === "EEXIST")
29
+ if (error.code === "EEXIST" || process.platform === "win32" && error.code === "EPERM")
30
30
  return null;
31
31
  throw error;
32
32
  });
@@ -2,23 +2,73 @@
2
2
  import {
3
3
  FileSys2
4
4
  } from "./index-52w0fvh8.js";
5
+ import {
6
+ resolveMobileTargets
7
+ } from "./index-m9jj544v.js";
5
8
  import {
6
9
  NativePublicEnv,
7
10
  UpdatePackFolder,
8
11
  NativeApp
9
- } from "./index-0909wckt.js";
10
- import {
11
- resolveMobileTargets
12
- } from "./index-q958tqqg.js";
12
+ } from "./index-g1mbppa9.js";
13
13
  import {
14
14
  ExitCodeError
15
- } from "./index-31ce9vhg.js";
15
+ } from "./index-jw1zm273.js";
16
16
  import {
17
17
  ConfigLock
18
- } from "./index-3hx1z96c.js";
18
+ } from "./index-bqbf654f.js";
19
+
20
+ // pkgs/@akanjs/devkit/cloud/cloudHttpError.ts
21
+ import { isRecord } from "akanjs/common";
22
+
23
+ class CloudHttpError extends Error {
24
+ status;
25
+ statusText;
26
+ url;
27
+ body;
28
+ headers;
29
+ static #errKey = /^[\w$-]+\.error\.[\w$-]+$/;
30
+ name = "CloudHttpError";
31
+ constructor(status, statusText, url, body, headers = new Headers) {
32
+ super(`${status} ${statusText} from ${url}: ${body.slice(0, 200)}`);
33
+ this.status = status;
34
+ this.statusText = statusText;
35
+ this.url = url;
36
+ this.body = body;
37
+ this.headers = headers;
38
+ }
39
+ static async of(response, url) {
40
+ return new CloudHttpError(response.status, response.statusText, url, await response.text(), response.headers);
41
+ }
42
+ static statusOf(error) {
43
+ return error instanceof CloudHttpError ? error.status : null;
44
+ }
45
+ get error() {
46
+ try {
47
+ const parsed = JSON.parse(this.body);
48
+ return isRecord(parsed) && typeof parsed.error === "string" ? parsed.error : null;
49
+ } catch {
50
+ return null;
51
+ }
52
+ }
53
+ get errKey() {
54
+ const { error } = this;
55
+ return error && CloudHttpError.#errKey.test(error) ? error : null;
56
+ }
57
+ get retryAfterMs() {
58
+ return CloudHttpError.retryAfterMs(this.headers.get("retry-after"));
59
+ }
60
+ static retryAfterMs(header) {
61
+ const value = header?.trim() ?? "";
62
+ if (!value)
63
+ return null;
64
+ const ms = /^\d+$/.test(value) ? Number(value) * 1000 : Date.parse(value) - Date.now();
65
+ return Number.isFinite(ms) ? Math.max(0, ms) : null;
66
+ }
67
+ }
19
68
 
20
69
  // pkgs/@akanjs/devkit/cloud/globalConfig.ts
21
70
  import { mkdir, rm, writeFile } from "fs/promises";
71
+ import { trimTrailingSlashes } from "akanjs/common";
22
72
  import dayjs from "dayjs";
23
73
 
24
74
  // pkgs/@akanjs/devkit/cloud/constants.ts
@@ -68,7 +118,7 @@ class GlobalConfig {
68
118
  }
69
119
  static #normalizeHost(host) {
70
120
  const url = URL.canParse(host) ? new URL(host) : null;
71
- return url && (url.protocol === "https:" || url.protocol === "http:") ? `${url.origin}${url.pathname.replace(/\/+$/, "")}` : host.replace(/\/+$/, "");
121
+ return url && (url.protocol === "https:" || url.protocol === "http:") ? `${url.origin}${trimTrailingSlashes(url.pathname)}` : trimTrailingSlashes(host);
72
122
  }
73
123
  static async getHostConfig(host = GlobalConfig.akanCloudHost) {
74
124
  const akanConfig = await GlobalConfig.#getAkanGlobalConfig();
@@ -169,55 +219,6 @@ class GlobalConfig {
169
219
  }
170
220
  }
171
221
 
172
- // pkgs/@akanjs/devkit/cloud/cloudHttpError.ts
173
- import { isRecord } from "akanjs/common";
174
-
175
- class CloudHttpError extends Error {
176
- status;
177
- statusText;
178
- url;
179
- body;
180
- headers;
181
- static #errKey = /^[\w$-]+\.error\.[\w$-]+$/;
182
- name = "CloudHttpError";
183
- constructor(status, statusText, url, body, headers = new Headers) {
184
- super(`${status} ${statusText} from ${url}: ${body.slice(0, 200)}`);
185
- this.status = status;
186
- this.statusText = statusText;
187
- this.url = url;
188
- this.body = body;
189
- this.headers = headers;
190
- }
191
- static async of(response, url) {
192
- return new CloudHttpError(response.status, response.statusText, url, await response.text(), response.headers);
193
- }
194
- static statusOf(error) {
195
- return error instanceof CloudHttpError ? error.status : null;
196
- }
197
- get error() {
198
- try {
199
- const parsed = JSON.parse(this.body);
200
- return isRecord(parsed) && typeof parsed.error === "string" ? parsed.error : null;
201
- } catch {
202
- return null;
203
- }
204
- }
205
- get errKey() {
206
- const { error } = this;
207
- return error && CloudHttpError.#errKey.test(error) ? error : null;
208
- }
209
- get retryAfterMs() {
210
- return CloudHttpError.retryAfterMs(this.headers.get("retry-after"));
211
- }
212
- static retryAfterMs(header) {
213
- const value = header?.trim() ?? "";
214
- if (!value)
215
- return null;
216
- const ms = /^\d+$/.test(value) ? Number(value) * 1000 : Date.parse(value) - Date.now();
217
- return Number.isFinite(ms) ? Math.max(0, ms) : null;
218
- }
219
- }
220
-
221
222
  // pkgs/@akanjs/devkit/cloud/cloudApi.ts
222
223
  class HttpClient {
223
224
  baseUrl;
@@ -370,7 +371,6 @@ class CloudApi {
370
371
  }
371
372
  }
372
373
  }
373
-
374
374
  // pkgs/@akanjs/devkit/cloud/cloudUpdates.ts
375
375
  import path2 from "path";
376
376
  import { Logger as Logger2 } from "akanjs/common";
@@ -585,7 +585,6 @@ ${(release.problems ?? []).map((problem) => ` - ${problem}`).join(`
585
585
  });
586
586
  }
587
587
  }
588
-
589
588
  // pkgs/@akanjs/devkit/cloud/pipelineSecrets.ts
590
589
  import { capitalize, Logger as Logger3, PipelineNames } from "akanjs/common";
591
590
  class PipelineSecrets {
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  AppExecutor
4
- } from "./index-2etqq75t.js";
4
+ } from "./index-va06nr10.js";
5
5
  import {
6
6
  jsonText,
7
7
  createWorkflowBaselineSummary,
8
8
  buildAkanModuleContextIndex,
9
9
  toolingRolloutGate
10
- } from "./index-rhbabmja.js";
10
+ } from "./index-trpasv9q.js";
11
11
  import {
12
12
  buildResourceList,
13
13
  codexMcpConfigPath,
@@ -17,29 +17,29 @@ import {
17
17
  upsertCodexMcpServerBlock,
18
18
  renderDoctorText,
19
19
  AkanContextAnalyzer
20
- } from "./index-rk9sdys3.js";
20
+ } from "./index-5edzv8fn.js";
21
21
  import {
22
22
  runner
23
- } from "./index-31ce9vhg.js";
23
+ } from "./index-jw1zm273.js";
24
24
  import {
25
25
  isPlaceholderAppId
26
- } from "./index-g0vwzy9m.js";
26
+ } from "./index-vk0pa0mn.js";
27
+ import {
28
+ getMobileTargets,
29
+ appIdsOf
30
+ } from "./index-m9jj544v.js";
27
31
  import {
28
32
  NativeApp
29
- } from "./index-0909wckt.js";
33
+ } from "./index-g1mbppa9.js";
30
34
  import {
31
35
  Prompter2
32
36
  } from "./index-zzvvc845.js";
33
37
  import {
34
38
  RepairRunner
35
- } from "./index-nq2ja5e0.js";
39
+ } from "./index-j4mkhz93.js";
36
40
  import {
37
41
  WorkflowRunner
38
- } from "./index-hnby7p9n.js";
39
- import {
40
- getMobileTargets,
41
- appIdsOf
42
- } from "./index-q958tqqg.js";
42
+ } from "./index-1xj2t7cb.js";
43
43
 
44
44
  // pkgs/@akanjs/devkit/akanMcpContract.ts
45
45
  import path from "path";
@@ -127,7 +127,7 @@ var inspectAkanContextInputSchema = {
127
127
  },
128
128
  required: ["question", "draft", "review", "request"]
129
129
  };
130
- var slugPart = (value) => typeof value === "string" ? value.trim().replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase() : "";
130
+ var slugPart = (value) => typeof value === "string" ? value.trim().replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-|-$/g, "").toLowerCase() : "";
131
131
  var optionalString = (args, key) => {
132
132
  const value = args[key];
133
133
  return typeof value === "string" && value ? value : undefined;