@akanjs/cli 3.0.0-beta.19 → 3.0.0-beta.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 (95) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-6cm97kay.js → CodeAgent-awv258wb.js} +2 -2
  3. package/{CodeTui-za4jsm41.js → CodeTui-1nqh35ez.js} +20 -22
  4. package/TunnelShare-scf4e4pd.js +9 -0
  5. package/{agent.command-e0wpbbyg.js → agent.command-1s9ag7sb.js} +8 -9
  6. package/akanCode.js +4 -4
  7. package/{application.command-8wyxqc8q.js → application.command-49hwy6va.js} +25 -56
  8. package/{applicationBuildRunner-n9gzaxd0.js → applicationBuildRunner-ybyp97pv.js} +33 -59
  9. package/{applicationReleasePackager-vpggfqgq.js → applicationReleasePackager-esnrphw8.js} +40 -60
  10. package/buildBatch.proc.js +19 -24
  11. package/{capacitorApp-q3z0qht0.js → capacitorApp-1synz4en.js} +3 -4
  12. package/{cloud.command-4zwa5dsx.js → cloud.command-d7rqtzt9.js} +16 -26
  13. package/cloud.script-bkbpcr96.js +19 -0
  14. package/{code.command-468c9d7s.js → code.command-nn48xzej.js} +22 -37
  15. package/context.command-s3mcmvpa.js +48 -0
  16. package/context.runner-k99nb5pk.js +21 -0
  17. package/{dependencyScanner-0z2h2tks.js → dependencyScanner-ye2e6pdz.js} +2 -2
  18. package/{devTui-ffjsarqa.js → devTui-q7k7bakd.js} +5 -9
  19. package/fileSys-5ngz93ga.js +9 -0
  20. package/{guideline.command-vhw13pqr.js → guideline.command-sct4qnt5.js} +4 -5
  21. package/guidelines/conventions/conventions.instruction.md +5 -1
  22. package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
  23. package/incrementalBuilder.proc.js +30 -48
  24. package/{index-s5rhm04y.js → index-0bq14vr1.js} +1 -1
  25. package/{index-10dkrrww.js → index-13ffe9wp.js} +4 -4
  26. package/{index-srmay5jw.js → index-22d57v4c.js} +84 -67
  27. package/{index-53176s7j.js → index-31yr441d.js} +10 -17
  28. package/index-3hx1z96c.js +87 -0
  29. package/{index-4m929vvn.js → index-3sq321ak.js} +10 -18
  30. package/{index-bhtmj233.js → index-3t7g9e4r.js} +41 -78
  31. package/{index-q0y2jq9j.js → index-5b6tavv3.js} +6 -3
  32. package/{index-47pj3aee.js → index-5e0n4hqx.js} +11 -12
  33. package/{index-7ep8qtvp.js → index-5pc1qrbv.js} +5 -8
  34. package/{index-esk82rvk.js → index-8mna0947.js} +34 -71
  35. package/{index-sq2dzkzm.js → index-8sf7wmdr.js} +6 -6
  36. package/{index-crmeqnmf.js → index-9d9bgcx4.js} +283 -722
  37. package/{index-bwf965h6.js → index-ahemdr5n.js} +6 -6
  38. package/{index-ab0c38ea.js → index-as7xmyz8.js} +20 -20
  39. package/{index-bc88j1ry.js → index-axzjaqve.js} +94 -142
  40. package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
  41. package/{index-667w0yah.js → index-c6eggbee.js} +2 -5
  42. package/{index-a1w6934z.js → index-ddxvdd1p.js} +169 -305
  43. package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
  44. package/{index-22xtgmhn.js → index-dzf3r49a.js} +1 -1
  45. package/{index-89hy31kf.js → index-fgq75haa.js} +172 -287
  46. package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
  47. package/{index-hwkygn9s.js → index-khpfpcsd.js} +302 -33
  48. package/{index-vqx8bdxz.js → index-mxav6j3c.js} +78 -231
  49. package/{index-2446k7b4.js → index-myhc3c1j.js} +512 -588
  50. package/{index-3jrp517k.js → index-nv5976x3.js} +45 -128
  51. package/{index-zqgj2rt2.js → index-przybvy5.js} +69 -147
  52. package/{index-n3cv0tm4.js → index-smme4r47.js} +1 -1
  53. package/{index-qdgzsnhg.js → index-w2zdcw3k.js} +110 -231
  54. package/{index-14zrtgfa.js → index-wa5jbxj1.js} +6 -39
  55. package/{index-bftkz6cp.js → index-ww4z397j.js} +198 -555
  56. package/{index-kwaq3n9n.js → index-xqjwd384.js} +4 -7
  57. package/{index-txr7dj2g.js → index-xqpzbab5.js} +106 -240
  58. package/{index-e4v6vhxq.js → index-xsjh6nzh.js} +178 -165
  59. package/{index-18zybgkc.js → index-ygn77a5w.js} +47 -99
  60. package/{index-9d6nvkz2.js → index-ztp3e73t.js} +79 -35
  61. package/index.js +23 -24
  62. package/{library.command-cqr175dy.js → library.command-1gx04jgn.js} +4 -5
  63. package/{localRegistry.command-49z55qqz.js → localRegistry.command-zndxj1q6.js} +21 -42
  64. package/{module.command-9p8mm3b0.js → module.command-3waddk95.js} +6 -7
  65. package/{package.command-wxyz909t.js → package.command-zrc7br1y.js} +5 -6
  66. package/package.json +2 -2
  67. package/{page.command-gsrsfqqs.js → page.command-vpjgardh.js} +4 -5
  68. package/{primitive.command-ns1mptje.js → primitive.command-sz84tk4t.js} +9 -20
  69. package/{prompter-1f8d9pcc.js → prompter-ptaa3nk0.js} +2 -2
  70. package/{quality.command-e76k2q9k.js → quality.command-g869hafs.js} +129 -363
  71. package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
  72. package/{repair.command-pkrsm3cw.js → repair.command-chsnjvvv.js} +11 -35
  73. package/{scalar.command-0cpt3fc8.js → scalar.command-2v21newx.js} +5 -6
  74. package/skills/akan-code/SKILL.md +12 -4
  75. package/{subspace.command-fktpwp0g.js → subspace.command-ckcbwfp1.js} +39 -58
  76. package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +3 -3
  77. package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +3 -3
  78. package/templates/client.ts +7 -30
  79. package/templates/lib/__lib/lib.dictionary.ts +0 -2
  80. package/templates/lib/__lib/lib.document.ts +0 -2
  81. package/templates/lib/sig.ts +8 -30
  82. package/templates/server.ts +0 -2
  83. package/{tunnel.command-d5jy9gk8.js → tunnel.command-kd2yr4fx.js} +5 -6
  84. package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
  85. package/typecheck.proc.js +1 -1
  86. package/workflow.command-44252cqv.js +79 -0
  87. package/{workspace.command-gv84eh1p.js → workspace.command-fqcztt5p.js} +72 -107
  88. package/TunnelShare-2j6s511d.js +0 -9
  89. package/cloud.script-fwx3vb34.js +0 -20
  90. package/context.command-dsnw0jby.js +0 -80
  91. package/context.runner-rs4rj15d.js +0 -22
  92. package/devTuiView-1q1mdgrv.js +0 -9
  93. package/getDirname-dr3jz1xg.js +0 -7
  94. package/index-6wwzs1bc.js +0 -7
  95. package/workflow.command-6tkcysmx.js +0 -105
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
- FileSys
4
- } from "./index-q0y2jq9j.js";
3
+ FileSys2
4
+ } from "./index-5b6tavv3.js";
5
5
  import {
6
6
  Spinner
7
- } from "./index-crmeqnmf.js";
7
+ } from "./index-9d9bgcx4.js";
8
8
 
9
9
  // pkgs/@akanjs/devkit/applicationReleasePackager.ts
10
10
  import { cp, mkdir, rm } from "fs/promises";
@@ -12,10 +12,7 @@ import path from "path";
12
12
 
13
13
  // pkgs/@akanjs/devkit/uploadRelease.ts
14
14
  import { Logger, RestClient } from "akanjs/common";
15
- var spinning = (message) => {
16
- const spinner = new Spinner(message, { prefix: message, enableSpin: true }).start();
17
- return spinner;
18
- };
15
+ var spinning = (message) => new Spinner(message, { prefix: message, enableSpin: true }).start();
19
16
  var uploadRelease = async (appName, {
20
17
  workspaceRoot,
21
18
  environment,
@@ -27,28 +24,20 @@ var uploadRelease = async (appName, {
27
24
  const logger = new Logger("uploadRelease");
28
25
  const basePath = local ? "http://localhost:8282/backend" : "https://cloud.akanjs.com/backend";
29
26
  const httpClient = new RestClient(basePath);
30
- const buildPath = `${workspaceRoot}/releases/builds/${appName}-release.tar.gz`;
31
- const appBuildPath = `${workspaceRoot}/releases/builds/${appName}-appBuild.zip`;
32
- const sourcePath = `${workspaceRoot}/releases/sources/${appName}-source.tar.gz`;
33
27
  const readingFilesSpinner = spinning("Reading files...");
34
28
  try {
35
- const buildFile = Bun.file(buildPath);
36
- const sourceFile = Bun.file(sourcePath);
37
- const appBuildFile = Bun.file(appBuildPath);
38
- const buildStat = { mtime: new Date(buildFile.lastModified), size: buildFile.size };
39
- const sourceStat = { mtime: new Date(sourceFile.lastModified), size: sourceFile.size };
40
- const appBuildStat = { mtime: new Date(appBuildFile.lastModified), size: appBuildFile.size };
29
+ const uploads = [
30
+ [`builds/${appName}-release.tar.gz`, `${appName}-release.tar.gz`],
31
+ [`sources/${appName}-source.tar.gz`, `${appName}-source.tar.gz`],
32
+ [`builds/${appName}-appBuild.zip`, `${appName}-appBuild.zip`]
33
+ ].map(([relativePath, name]) => ({ file: Bun.file(`${workspaceRoot}/releases/${relativePath}`), name }));
34
+ const metas = uploads.map(({ file }) => ({ lastModifiedAt: new Date(file.lastModified), size: file.size }));
41
35
  readingFilesSpinner.succeed("Reading files... done");
42
36
  const preparingFormSpinner = spinning("Preparing form data...");
43
37
  const formData = new FormData;
44
- formData.append("files", buildFile, `${appName}-release.tar.gz`);
45
- formData.append("files", sourceFile, `${appName}-source.tar.gz`);
46
- formData.append("files", appBuildFile, `${appName}-appBuild.zip`);
47
- formData.append("metas", JSON.stringify([
48
- { lastModifiedAt: buildStat.mtime, size: buildStat.size },
49
- { lastModifiedAt: sourceStat.mtime, size: sourceStat.size },
50
- { lastModifiedAt: appBuildStat.mtime, size: appBuildStat.size }
51
- ]));
38
+ for (const { file, name } of uploads)
39
+ formData.append("files", file, name);
40
+ formData.append("metas", JSON.stringify(metas));
52
41
  formData.append("type", "release");
53
42
  preparingFormSpinner.succeed("Preparing form data... done");
54
43
  try {
@@ -113,10 +102,10 @@ class ApplicationReleasePackager {
113
102
  const akanConfig = await this.#app.getConfig();
114
103
  const platformVersion = akanConfig.mobile.version;
115
104
  const buildRoot = `${this.#app.workspace.workspaceRoot}/releases/builds/${this.#app.name}`;
116
- if (await FileSys.dirExists(buildRoot))
105
+ if (await FileSys2.dirExists(buildRoot))
117
106
  await rm(buildRoot, { recursive: true, force: true });
118
107
  await mkdir(buildRoot, { recursive: true });
119
- if (rebuild || !await FileSys.dirExists(`${this.#app.dist.cwdPath}/backend`))
108
+ if (rebuild || !await FileSys2.dirExists(`${this.#app.dist.cwdPath}/backend`))
120
109
  await this.#build();
121
110
  const buildVersion = `${platformVersion}-${buildNum}`;
122
111
  const buildPath = `${buildRoot}/${buildVersion}`;
@@ -125,13 +114,12 @@ class ApplicationReleasePackager {
125
114
  await cp(this.#app.dist.cwdPath, buildRoot, { recursive: true });
126
115
  await rm(`${buildRoot}/frontend/.next`, { recursive: true, force: true });
127
116
  const releaseRoot = this.#app.workspace.workspaceRoot;
128
- const releaseArchivePath = path.relative(releaseRoot, `${releaseRoot}/releases/builds/${this.#app.name}-release.tar.gz`).split(path.sep).join("/");
129
- await this.#app.workspace.spawn("tar", ["-zcf", releaseArchivePath, "-C", buildRoot, "./"], { cwd: releaseRoot });
117
+ await this.#tar(releaseRoot, `${releaseRoot}/releases/builds/${this.#app.name}-release.tar.gz`, buildRoot);
130
118
  await this.#writeCsrZipIfPresent();
131
119
  return { platformVersion };
132
120
  }
133
121
  async#writeCsrZipIfPresent() {
134
- if (!await FileSys.dirExists(`${this.#app.dist.cwdPath}/csr`))
122
+ if (!await FileSys2.dirExists(`${this.#app.dist.cwdPath}/csr`))
135
123
  return;
136
124
  await cp(`${this.#app.dist.cwdPath}/csr`, "./csr", { recursive: true });
137
125
  await this.#app.workspace.spawn("zip", [
@@ -149,7 +137,7 @@ class ApplicationReleasePackager {
149
137
  await Promise.all(libDeps.map((lib) => cp(`${this.#app.workspace.cwdPath}/libs/${lib}`, `${sourceRoot}/libs/${lib}`, { recursive: true })));
150
138
  await Promise.all([".next", "ios", "android", "public/libs"].map(async (path2) => {
151
139
  const targetPath = `${sourceRoot}/apps/${this.#app.name}/${path2}`;
152
- if (await FileSys.dirExists(targetPath))
140
+ if (await FileSys2.dirExists(targetPath))
153
141
  await rm(targetPath, { recursive: true, force: true });
154
142
  }));
155
143
  const syncPaths = [".husky", ".gitignore", "package.json"];
@@ -157,18 +145,18 @@ class ApplicationReleasePackager {
157
145
  await this.#writeSourceTsconfig(sourceRoot, libDeps);
158
146
  await Bun.write(`${sourceRoot}/README.md`, readme);
159
147
  const sourceCwd = this.#app.workspace.cwdPath;
160
- const sourceArchivePath = path.relative(sourceCwd, `${sourceCwd}/releases/sources/${this.#app.name}-source.tar.gz`).split(path.sep).join("/");
161
- await this.#app.workspace.spawn("tar", ["-zcf", sourceArchivePath, "-C", sourceRoot, "./"], { cwd: sourceCwd });
148
+ await this.#tar(sourceCwd, `${sourceCwd}/releases/sources/${this.#app.name}-source.tar.gz`, sourceRoot);
149
+ }
150
+ async#tar(cwd, archivePath, sourceDir) {
151
+ const relativeArchivePath = path.relative(cwd, archivePath).split(path.sep).join("/");
152
+ await this.#app.workspace.spawn("tar", ["-zcf", relativeArchivePath, "-C", sourceDir, "./"], { cwd });
162
153
  }
163
154
  async#resetSourceRoot(sourceRoot) {
164
- if (await FileSys.dirExists(sourceRoot)) {
165
- const maxRetry = 3;
166
- for (let i = 0;i < maxRetry; i++) {
167
- try {
168
- await rm(sourceRoot, { recursive: true, force: true });
169
- } catch {}
170
- }
171
- }
155
+ if (await FileSys2.dirExists(sourceRoot))
156
+ for (let attempt = 0;attempt < 3; attempt++)
157
+ await rm(sourceRoot, { recursive: true, force: true }).catch(() => {
158
+ return;
159
+ });
172
160
  await mkdir(sourceRoot, { recursive: true });
173
161
  }
174
162
  async#writeSourceTsconfig(sourceRoot, libDeps) {
@@ -180,6 +168,16 @@ class ApplicationReleasePackager {
180
168
  tsconfig.compilerOptions.paths = Object.fromEntries(pathEntries);
181
169
  await Bun.write(`${sourceRoot}/tsconfig.json`, JSON.stringify(tsconfig, null, 2));
182
170
  }
171
+ static #envSetup = ` cat <<EOF >> .env
172
+ # ENV For Server => debug | debug.local | develop | develop.local | main | main.local
173
+ SERVER_ENV=debug.local
174
+ # Run Mode For Server => federation | batch | all
175
+ SERVER_MODE=federation
176
+ # ENV For Client => debug | debug.local | develop | develop.local | main | main.local
177
+ AKAN_PUBLIC_CLIENT_ENV=debug.local
178
+ ANALYZE=false
179
+ EOF
180
+ `;
183
181
  #confidentialReadme() {
184
182
  return `# ${this.#app.name}
185
183
  \uBCF8 \uD504\uB85C\uC81D\uD2B8\uC758 \uC18C\uC2A4\uCF54\uB4DC \uBC0F \uAD00\uB828\uC790\uB8CC\uB294 \uBAA8\uB450 \uBE44\uBC00\uC815\uBCF4\uB85C \uAD00\uB9AC\uB429\uB2C8\uB2E4.
@@ -190,16 +188,7 @@ class ApplicationReleasePackager {
190
188
  bun install -g bun
191
189
  bun i
192
190
 
193
- cat <<EOF >> .env
194
- # ENV For Server => debug | debug.local | develop | develop.local | main | main.local
195
- SERVER_ENV=debug.local
196
- # Run Mode For Server => federation | batch | all
197
- SERVER_MODE=federation
198
- # ENV For Client => debug | debug.local | develop | develop.local | main | main.local
199
- AKAN_PUBLIC_CLIENT_ENV=debug.local
200
- ANALYZE=false
201
- EOF
202
-
191
+ ${ApplicationReleasePackager.#envSetup}
203
192
  akn start-backend ${this.#app.name}
204
193
  # or akn start-frontend ${this.#app.name}, etc
205
194
  \`\`\`
@@ -217,16 +206,7 @@ class ApplicationReleasePackager {
217
206
  ## Get Started
218
207
  Run the code below.
219
208
  \`\`\`
220
- cat <<EOF >> .env
221
- # ENV For Server => debug | debug.local | develop | develop.local | main | main.local
222
- SERVER_ENV=debug.local
223
- # Run Mode For Server => federation | batch | all
224
- SERVER_MODE=federation
225
- # ENV For Client => debug | debug.local | develop | develop.local | main | main.local
226
- AKAN_PUBLIC_CLIENT_ENV=debug.local
227
- ANALYZE=false
228
- EOF
229
-
209
+ ${ApplicationReleasePackager.#envSetup}
230
210
  akan start ${this.#app.name}
231
211
  \`\`\`
232
212
 
@@ -1,19 +1,20 @@
1
1
  // @bun
2
+ import {
3
+ ApplicationBuildReporter
4
+ } from "./index-khpfpcsd.js";
2
5
  import {
3
6
  WorkspaceExecutor,
4
7
  AppExecutor
5
- } from "./index-crmeqnmf.js";
6
- import"./index-q0y2jq9j.js";
7
- import"./index-6wwzs1bc.js";
8
+ } from "./index-9d9bgcx4.js";
9
+ import"./index-5b6tavv3.js";
8
10
  import {
9
11
  CssCompiler,
10
12
  PagesBundleBuilder,
11
13
  CsrArtifactBuilder,
12
14
  FontOptimizer,
13
15
  SsrBaseArtifactBuilder
14
- } from "./index-a1w6934z.js";
15
- import"./index-89hy31kf.js";
16
- import"./index-hwkygn9s.js";
16
+ } from "./index-ddxvdd1p.js";
17
+ import"./index-fgq75haa.js";
17
18
  import"./index-n68jx79w.js";
18
19
 
19
20
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
@@ -56,6 +57,13 @@ class BuildBatch {
56
57
  }
57
58
  });
58
59
  }
60
+ #fail(need, label, err) {
61
+ const message = ApplicationBuildReporter.formatError(err, this.#request.workspaceRoot);
62
+ this.#logger.error(`${label} failed: ${message}`);
63
+ this.#result.errors[need] = message;
64
+ if (need !== "base")
65
+ this.#emitStatus(need, message);
66
+ }
59
67
  async#buildBase() {
60
68
  const started = Date.now();
61
69
  try {
@@ -64,9 +72,7 @@ class BuildBatch {
64
72
  this.#result.optimizedFonts = optimizedFonts;
65
73
  this.#logger.verbose(`base-artifact ok buildId=${artifact.pagesBundleBuildId} (${Date.now() - started}ms)`);
66
74
  } catch (err) {
67
- const message = err instanceof Error ? err.message : String(err);
68
- this.#logger.error(`base-artifact failed: ${message}`);
69
- this.#result.errors.base = message;
75
+ this.#fail("base", "base-artifact", err);
70
76
  }
71
77
  }
72
78
  async#buildCsr() {
@@ -76,10 +82,7 @@ class BuildBatch {
76
82
  this.#logger.verbose(`csr-rebundle ok (${Date.now() - started}ms)`);
77
83
  this.#emitStatus("csr");
78
84
  } catch (err) {
79
- const message = err instanceof Error ? err.message : String(err);
80
- this.#logger.error(`csr-rebundle failed: ${message}`);
81
- this.#result.errors.csr = message;
82
- this.#emitStatus("csr", message);
85
+ this.#fail("csr", "csr-rebundle", err);
83
86
  }
84
87
  }
85
88
  async#buildPages() {
@@ -98,10 +101,7 @@ class BuildBatch {
98
101
  this.#emitStatus("pages");
99
102
  this.#logger.verbose(`pages-rebundle ok buildId=${next.buildId} (${Date.now() - started}ms)`);
100
103
  } catch (err) {
101
- const message = err instanceof Error ? err.message : String(err);
102
- this.#logger.error(`pages-rebundle failed: ${message}`);
103
- this.#result.errors.pages = message;
104
- this.#emitStatus("pages", message);
104
+ this.#fail("pages", "pages-rebundle", err);
105
105
  }
106
106
  }
107
107
  async#buildCss() {
@@ -143,10 +143,7 @@ ${cssText}`).toString(36);
143
143
  });
144
144
  this.#logger.verbose(`css-compile ok assets=${Object.keys(cssAssets).length} (${Date.now() - started}ms)`);
145
145
  } catch (err) {
146
- const message = err instanceof Error ? err.message : String(err);
147
- this.#logger.error(`css-rebuild failed: ${message}`);
148
- this.#result.errors.css = message;
149
- this.#emitStatus("css", message);
146
+ this.#fail("css", "css-rebuild", err);
150
147
  }
151
148
  }
152
149
  async#optimizeFonts() {
@@ -162,8 +159,6 @@ ${cssText}`).toString(36);
162
159
  return optimizedFonts;
163
160
  }
164
161
  static #shouldReoptimizeFonts(previous, changedFiles) {
165
- if (changedFiles.length === 0)
166
- return false;
167
162
  return changedFiles.some((file) => {
168
163
  const normalized = path.resolve(file);
169
164
  if (/\.(woff2?|ttf|otf)$/i.test(normalized))
@@ -187,7 +182,7 @@ ${cssText}`).toString(36);
187
182
  process.send?.({ type: "build-batch-result", data: result });
188
183
  }
189
184
  }
190
- BuildBatch.main().catch((err) => {
185
+ await BuildBatch.main().catch((err) => {
191
186
  console.error(err);
192
187
  process.exit(1);
193
188
  });
@@ -2,10 +2,9 @@
2
2
  import {
3
3
  isPlaceholderAppId2,
4
4
  CapacitorApp2
5
- } from "./index-vqx8bdxz.js";
6
- import"./index-crmeqnmf.js";
7
- import"./index-6wwzs1bc.js";
8
- import"./index-q0y2jq9j.js";
5
+ } from "./index-mxav6j3c.js";
6
+ import"./index-9d9bgcx4.js";
7
+ import"./index-5b6tavv3.js";
9
8
  export {
10
9
  CapacitorApp2 as CapacitorApp,
11
10
  isPlaceholderAppId2 as isPlaceholderAppId
@@ -1,27 +1,26 @@
1
1
  // @bun
2
- import"./index-q0y2jq9j.js";
2
+ import"./index-5b6tavv3.js";
3
3
  import {
4
4
  GlobalConfig
5
- } from "./index-srmay5jw.js";
5
+ } from "./index-22d57v4c.js";
6
6
  import {
7
7
  Workspace,
8
8
  command
9
- } from "./index-qdgzsnhg.js";
10
- import"./index-crmeqnmf.js";
11
- import"./index-6wwzs1bc.js";
9
+ } from "./index-w2zdcw3k.js";
10
+ import"./index-9d9bgcx4.js";
12
11
  import {
13
12
  PlatformTestRun
14
- } from "./index-bc88j1ry.js";
15
- import"./index-bftkz6cp.js";
16
- import"./index-7ep8qtvp.js";
17
- import"./index-hwkygn9s.js";
13
+ } from "./index-axzjaqve.js";
14
+ import"./index-khpfpcsd.js";
15
+ import"./index-5pc1qrbv.js";
16
+ import"./index-ww4z397j.js";
18
17
  import"./index-7md2g9vw.js";
19
- import"./index-bhtmj233.js";
20
- import"./index-ab0c38ea.js";
18
+ import"./index-3t7g9e4r.js";
19
+ import"./index-as7xmyz8.js";
21
20
  import {
22
21
  CloudScript2
23
- } from "./index-sq2dzkzm.js";
24
- import"./index-kwaq3n9n.js";
22
+ } from "./index-8sf7wmdr.js";
23
+ import"./index-xqjwd384.js";
25
24
 
26
25
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
27
26
  var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
@@ -34,10 +33,7 @@ class CloudCommand extends command("cloud", [CloudScript2], ({ public: target })
34
33
  logout: target({ desc: "Logout from Akan Cloud services" }).option("host", String, { desc: "host of the cloud", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
35
34
  await this.cloudScript.logout(workspace, host);
36
35
  }),
37
- deployAkan: target({
38
- devOnly: true,
39
- desc: "Deploy Akan.js framework to cloud (internal use)"
40
- }).option("test", Boolean, { desc: "test the deployment", default: true }).option("registry", String, {
36
+ deployAkan: target({ devOnly: true, desc: "Deploy Akan.js framework to cloud (internal use)" }).option("test", Boolean, { desc: "test the deployment", default: true }).option("registry", String, {
41
37
  desc: "registry target for publishing Akan packages",
42
38
  ask: "Select a registry target",
43
39
  enum: [
@@ -83,18 +79,12 @@ class CloudCommand extends command("cloud", [CloudScript2], ({ public: target })
83
79
  ],
84
80
  default: process.env.USE_AKANJS_PKGS === "true" ? undefined : "npm"
85
81
  }).exec(async function(workspace, tag, registry) {
86
- await this.cloudScript.update(workspace, tag, {
87
- registryUrl: resolveRegistryUrl(registry)
88
- });
82
+ await this.cloudScript.update(workspace, tag, { registryUrl: resolveRegistryUrl(registry) });
89
83
  }),
90
- downloadEnv: target({
91
- desc: "Download environment variables from cloud or SCP server"
92
- }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
84
+ downloadEnv: target({ desc: "Download environment variables from cloud or SCP server" }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
93
85
  await this.cloudScript.downloadEnv(workspace, undefined, { host });
94
86
  }),
95
- uploadEnv: target({
96
- desc: "Upload environment variables to cloud or SCP server"
97
- }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
87
+ uploadEnv: target({ desc: "Upload environment variables to cloud or SCP server" }).option("host", String, { desc: "host of the cloud to target", default: GlobalConfig.akanCloudHost }).with(Workspace).exec(async function(host, workspace) {
98
88
  await this.cloudScript.uploadEnv(workspace, { host });
99
89
  })
100
90
  })) {
@@ -0,0 +1,19 @@
1
+ // @bun
2
+ import {
3
+ CloudScript2
4
+ } from "./index-8sf7wmdr.js";
5
+ import"./index-axzjaqve.js";
6
+ import"./index-ww4z397j.js";
7
+ import"./index-xqjwd384.js";
8
+ import"./index-5pc1qrbv.js";
9
+ import"./index-as7xmyz8.js";
10
+ import"./index-22d57v4c.js";
11
+ import"./index-w2zdcw3k.js";
12
+ import"./index-7md2g9vw.js";
13
+ import"./index-khpfpcsd.js";
14
+ import"./index-9d9bgcx4.js";
15
+ import"./index-3t7g9e4r.js";
16
+ import"./index-5b6tavv3.js";
17
+ export {
18
+ CloudScript2 as CloudScript
19
+ };
@@ -4,14 +4,13 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-qdgzsnhg.js";
8
- import"./index-q0y2jq9j.js";
9
- import"./index-crmeqnmf.js";
10
- import"./index-6wwzs1bc.js";
7
+ } from "./index-w2zdcw3k.js";
8
+ import"./index-5b6tavv3.js";
9
+ import"./index-9d9bgcx4.js";
11
10
  import {
12
11
  akanCodeDefaultModel2,
13
12
  CodeAgentStreamPrinter2
14
- } from "./index-667w0yah.js";
13
+ } from "./index-c6eggbee.js";
15
14
 
16
15
  // pkgs/@akanjs/cli/code/code.runner.ts
17
16
  import { codeAgentPresets, isCodeAgentPresetName } from "akanjs/common";
@@ -20,20 +19,12 @@ class CodeRunner extends runner("code") {
20
19
  async serve(options, listen) {
21
20
  await import("./consoleToStderr-h5bryj94.js");
22
21
  const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
23
- import("./CodeAgent-6cm97kay.js"),
22
+ import("./CodeAgent-awv258wb.js"),
24
23
  import("./CodeAgentRpcHost-p7h6n2hp.js"),
25
24
  import("./CodeAgentRpcListener-7p7z5dd7.js")
26
25
  ]);
27
26
  const address = listen ? CodeAgentRpcListener.parse(listen) : null;
28
- const profile = CodeRunner.profileOf(options, { hostAttached: true });
29
- const agent = await CodeAgent.create({
30
- workspace: options.workspace,
31
- cwd: profile.paths.root,
32
- profile,
33
- apps: options.app ? [options.app] : await options.workspace.getApps(),
34
- model: CodeRunner.modelOf(options.model),
35
- mode: "rpc"
36
- });
27
+ const agent = await CodeAgent.create({ ...await CodeRunner.#agentOptions(options, true), mode: "rpc" });
37
28
  if (!address)
38
29
  return await new CodeAgentRpcHost(agent).serve();
39
30
  const listener = new CodeAgentRpcListener(new CodeAgentRpcHost(agent, null), address).listen();
@@ -43,24 +34,15 @@ class CodeRunner extends runner("code") {
43
34
  }
44
35
  async tui(options, seed) {
45
36
  const [{ CodeAgent }, { CodeTui }] = await Promise.all([
46
- import("./CodeAgent-6cm97kay.js"),
47
- import("./CodeTui-za4jsm41.js")
37
+ import("./CodeAgent-awv258wb.js"),
38
+ import("./CodeTui-1nqh35ez.js")
48
39
  ]);
49
- const profile = CodeRunner.profileOf(options, { hostAttached: false });
50
- const apps = options.app ? [options.app] : await options.workspace.getApps();
40
+ const agentOptions = await CodeRunner.#agentOptions(options, false);
51
41
  let resume = options.resume;
52
42
  let prompt = seed;
53
43
  let notice;
54
44
  for (;; ) {
55
- const agent = await CodeAgent.create({
56
- workspace: options.workspace,
57
- cwd: profile.paths.root,
58
- profile,
59
- apps,
60
- model: CodeRunner.modelOf(options.model),
61
- mode: "tui",
62
- ...resume ? { resume } : {}
63
- });
45
+ const agent = await CodeAgent.create({ ...agentOptions, mode: "tui", ...resume ? { resume } : {} });
64
46
  let next;
65
47
  try {
66
48
  next = await new CodeTui(agent, {
@@ -78,15 +60,8 @@ class CodeRunner extends runner("code") {
78
60
  }
79
61
  }
80
62
  async run(prompt, options) {
81
- const { CodeAgent } = await import("./CodeAgent-6cm97kay.js");
82
- const profile = CodeRunner.profileOf(options, { hostAttached: false });
83
- const agent = await CodeAgent.create({
84
- workspace: options.workspace,
85
- cwd: profile.paths.root,
86
- profile,
87
- apps: options.app ? [options.app] : await options.workspace.getApps(),
88
- model: CodeRunner.modelOf(options.model)
89
- });
63
+ const { CodeAgent } = await import("./CodeAgent-awv258wb.js");
64
+ const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
90
65
  const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
91
66
  agent.on((event) => printer.print(event));
92
67
  agent.announce();
@@ -98,6 +73,16 @@ class CodeRunner extends runner("code") {
98
73
  agent.dispose();
99
74
  }
100
75
  }
76
+ static async#agentOptions(options, hostAttached) {
77
+ const profile = CodeRunner.profileOf(options, { hostAttached });
78
+ return {
79
+ workspace: options.workspace,
80
+ cwd: profile.paths.root,
81
+ profile,
82
+ apps: options.app ? [options.app] : await options.workspace.getApps(),
83
+ model: CodeRunner.modelOf(options.model)
84
+ };
85
+ }
101
86
  static profileOf(options, { hostAttached }) {
102
87
  if (!isCodeAgentPresetName(options.profile))
103
88
  throw new Error(`Unknown profile: ${options.profile}. Use local, pod, review, or web.`);
@@ -0,0 +1,48 @@
1
+ // @bun
2
+ import {
3
+ Workspace,
4
+ command
5
+ } from "./index-w2zdcw3k.js";
6
+ import"./index-5b6tavv3.js";
7
+ import"./index-9d9bgcx4.js";
8
+ import"./index-hj6w4ka1.js";
9
+ import"./index-myhc3c1j.js";
10
+ import"./index-ygn77a5w.js";
11
+ import"./index-nv5976x3.js";
12
+ import"./index-mxav6j3c.js";
13
+ import"./index-0bq14vr1.js";
14
+ import"./index-31yr441d.js";
15
+ import"./index-dzf3r49a.js";
16
+ import"./index-8mna0947.js";
17
+ import"./index-przybvy5.js";
18
+ import"./index-3sq321ak.js";
19
+ import"./index-xqpzbab5.js";
20
+ import {
21
+ ContextScript
22
+ } from "./index-13ffe9wp.js";
23
+
24
+ // pkgs/@akanjs/cli/context/context.command.ts
25
+ class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
26
+ context: target({ desc: "Print agent-readable Akan workspace context" }).option("format", String, { desc: "output format", default: "markdown", enum: ["markdown", "json"] }).option("app", String, { desc: "app name to include", nullable: true }).option("module", String, { desc: "module name to include with abstract content", nullable: true }).with(Workspace).exec(async function(format, app, module, workspace) {
27
+ await this.contextScript.context(workspace, { format, app, module });
28
+ }),
29
+ doctor: target({ desc: "Report Akan workspace convention diagnostics" }).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).option("strict", Boolean, { desc: "treat recommended conventions as errors", default: false }).option("ios", Boolean, {
30
+ desc: "report iOS/mobile config diagnostics (placeholder bundle ids, etc.)",
31
+ default: false
32
+ }).with(Workspace).exec(async function(format, strict, ios, workspace) {
33
+ await this.contextScript.doctor(workspace, { format, strict, ios });
34
+ }),
35
+ mcpInstall: target({ desc: "Install the Akan MCP server config for Cursor, Claude Code, and Codex" }).arg("target", String, { desc: "cursor, claude, codex, or all", nullable: true }).option("force", Boolean, { desc: "overwrite an existing Akan MCP server entry", default: false }).option("mode", String, { desc: "MCP permission mode", default: "apply", enum: ["readonly", "plan", "apply"] }).with(Workspace).exec(async function(targetName, force, mode, workspace) {
36
+ await this.contextScript.mcpInstall(workspace, targetName, { force, mode });
37
+ }),
38
+ mcp: target({ desc: "Start the Akan MCP server over stdio", stdio: true }).option("mode", String, { desc: "MCP permission mode", default: "readonly", enum: ["readonly", "plan", "apply"] }).with(Workspace).exec(async function(mode, workspace) {
39
+ await this.contextScript.mcp(workspace, { mode });
40
+ }),
41
+ mcpCall: target({ desc: "Call one Akan MCP tool for debugging without stdio JSON-RPC" }).arg("tool", String, { desc: "MCP tool name" }).option("mode", String, { desc: "MCP permission mode", default: "readonly", enum: ["readonly", "plan", "apply"] }).option("args", String, { desc: "JSON object to pass as MCP tool arguments", nullable: true }).option("format", String, { desc: "output format", default: "json", enum: ["json"] }).with(Workspace).exec(async function(tool, mode, args, format, workspace) {
42
+ await this.contextScript.mcpCall(workspace, tool, { mode, args, format });
43
+ })
44
+ })) {
45
+ }
46
+ export {
47
+ ContextCommand
48
+ };
@@ -0,0 +1,21 @@
1
+ // @bun
2
+ import {
3
+ ContextRunner2
4
+ } from "./index-nv5976x3.js";
5
+ import"./index-xqpzbab5.js";
6
+ import"./index-3sq321ak.js";
7
+ import"./index-przybvy5.js";
8
+ import"./index-31yr441d.js";
9
+ import"./index-8mna0947.js";
10
+ import"./index-dzf3r49a.js";
11
+ import"./index-ygn77a5w.js";
12
+ import"./index-myhc3c1j.js";
13
+ import"./index-0bq14vr1.js";
14
+ import"./index-mxav6j3c.js";
15
+ import"./index-w2zdcw3k.js";
16
+ import"./index-9d9bgcx4.js";
17
+ import"./index-hj6w4ka1.js";
18
+ import"./index-5b6tavv3.js";
19
+ export {
20
+ ContextRunner2 as ContextRunner
21
+ };
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  TypeScriptDependencyScanner2
4
- } from "./index-bhtmj233.js";
5
- import"./index-q0y2jq9j.js";
4
+ } from "./index-3t7g9e4r.js";
5
+ import"./index-5b6tavv3.js";
6
6
  export {
7
7
  TypeScriptDependencyScanner2 as TypeScriptDependencyScanner
8
8
  };
@@ -469,7 +469,7 @@ class DevTui {
469
469
  const logRows = Math.max(1, bodyHeight - DevTui.paneChromeRows);
470
470
  const rows = this.#railRows();
471
471
  const view = windowOf(this.#filtered(this.#target), logRows, this.#anchor);
472
- const status = this.#statuses.find((candidate) => candidate.name === this.#target.app);
472
+ const status = this.#selectedStatus();
473
473
  const railLabelWidth = rows.reduce((max, row) => Math.max(max, row.label.length + row.depth * 2), 0);
474
474
  this.#cachedSnapshot = {
475
475
  rows,
@@ -534,8 +534,7 @@ class DevTui {
534
534
  };
535
535
  #setTarget(target) {
536
536
  this.#target = { app: target.app ?? null, source: target.source ?? null };
537
- this.#anchor = null;
538
- this.#renderNow();
537
+ this.#follow();
539
538
  }
540
539
  #scroll = (delta) => {
541
540
  this.#anchor = scrollAnchor(this.#filtered(this.#target), this.#snapshot().logRows, this.#anchor, delta);
@@ -547,8 +546,7 @@ class DevTui {
547
546
  };
548
547
  #setGrep = (grep) => {
549
548
  this.#grep = grep;
550
- this.#anchor = null;
551
- this.#renderNow();
549
+ this.#follow();
552
550
  };
553
551
  #setEditingGrep = (editing) => {
554
552
  this.#editingGrep = editing;
@@ -556,13 +554,11 @@ class DevTui {
556
554
  };
557
555
  #toggleErrorsOnly = () => {
558
556
  this.#errorsOnly = !this.#errorsOnly;
559
- this.#anchor = null;
560
- this.#renderNow();
557
+ this.#follow();
561
558
  };
562
559
  #clear = () => {
563
560
  this.#buffer.clear(this.#target.app ?? null);
564
- this.#anchor = null;
565
- this.#renderNow();
561
+ this.#follow();
566
562
  };
567
563
  #copyLines = () => {
568
564
  const lines = this.#filtered(this.#target);
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ import {
3
+ getDirname2,
4
+ FileSys2
5
+ } from "./index-5b6tavv3.js";
6
+ export {
7
+ FileSys2 as FileSys,
8
+ getDirname2 as getDirname
9
+ };
@@ -2,13 +2,12 @@
2
2
  import {
3
3
  script,
4
4
  command
5
- } from "./index-qdgzsnhg.js";
6
- import"./index-q0y2jq9j.js";
7
- import"./index-crmeqnmf.js";
8
- import"./index-6wwzs1bc.js";
5
+ } from "./index-w2zdcw3k.js";
6
+ import"./index-5b6tavv3.js";
7
+ import"./index-9d9bgcx4.js";
9
8
  import {
10
9
  Prompter2
11
- } from "./index-s5rhm04y.js";
10
+ } from "./index-0bq14vr1.js";
12
11
 
13
12
  // pkgs/@akanjs/cli/guideline/guideline.script.ts
14
13
  import { Logger } from "akanjs/common";