@akanjs/cli 3.0.1 → 3.0.2-rc.0

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 (74) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-zfab7pkn.js → CodeAgent-szbjv4gv.js} +2 -2
  3. package/{CodeTui-0zhnr0pw.js → CodeTui-5nw86ab6.js} +1 -1
  4. package/{agent.command-aja6z9mn.js → agent.command-np1dffkb.js} +5 -5
  5. package/akanCode.js +2 -2
  6. package/{application.command-049ehgx3.js → application.command-fyjy9ryc.js} +7 -7
  7. package/{applicationBuildRunner-75n5rpwp.js → applicationBuildRunner-etrzfwjj.js} +3 -3
  8. package/buildBatch.proc.js +3 -3
  9. package/{cloud.command-gw4kqxt8.js → cloud.command-c0rnwy65.js} +9 -9
  10. package/cloud.script-6ba8e9v8.js +20 -0
  11. package/{code.command-x9t6z5nw.js → code.command-hmtx14b2.js} +6 -6
  12. package/{context.command-yfbe1rtd.js → context.command-6aqvdx43.js} +13 -13
  13. package/context.runner-hnkvv3z3.js +21 -0
  14. package/{guideline.command-kq9gp690.js → guideline.command-axvf68gc.js} +2 -2
  15. package/guidelines/conventions/conventions.instruction.md +89 -17
  16. package/guidelines/queryRule/queryRule.instruction.md +4 -2
  17. package/guidelines/runtimeRule/runtimeRule.instruction.md +10 -5
  18. package/guidelines/transportRule/transportRule.instruction.md +40 -4
  19. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +1 -1
  20. package/incrementalBuilder.proc.js +2 -2
  21. package/{index-66yspb67.js → index-1bjkfvm9.js} +29 -27
  22. package/{index-b95yhqjr.js → index-1gs9g12n.js} +3 -3
  23. package/{index-y7hx1ygz.js → index-3xmzr1p1.js} +2 -2
  24. package/{index-mzjb6zp4.js → index-50jjwg8y.js} +1 -1
  25. package/{index-150s07n8.js → index-50wb2a26.js} +313 -93
  26. package/{index-qe71g4ze.js → index-61mmsdjg.js} +6 -6
  27. package/{index-8b639zes.js → index-6keyf4sg.js} +4 -4
  28. package/{index-vs8mefhy.js → index-bsv901fd.js} +7 -7
  29. package/{index-5pvxf7z0.js → index-cb6yc5mb.js} +2 -2
  30. package/{index-fkvb79qe.js → index-d95tfg3n.js} +14 -10
  31. package/{index-rfcz04w9.js → index-f4e08ptp.js} +4 -4
  32. package/{index-25fvrxmy.js → index-g38nhv87.js} +1 -1
  33. package/{index-br8pkrk1.js → index-gvpvxdm1.js} +5 -5
  34. package/{index-mb59b8x0.js → index-h9ht6s60.js} +1 -1
  35. package/{index-5g4rkrvt.js → index-hp3stk1m.js} +3 -3
  36. package/{index-h54yj9wr.js → index-hxnnfy57.js} +6 -5
  37. package/{index-kn5d4jmg.js → index-j38qkvkk.js} +7 -7
  38. package/{index-y5ga5w9t.js → index-jb0hmt3k.js} +3 -3
  39. package/{index-7p4c0yer.js → index-jk9xnck6.js} +33 -11
  40. package/{index-m3xsb1ms.js → index-krjcg4y6.js} +28 -10
  41. package/{index-a37by9hn.js → index-q6ft9fkc.js} +4 -4
  42. package/{index-c14nsvnv.js → index-xwprn9nr.js} +1 -1
  43. package/{index-5q14pwzd.js → index-zwd84m0w.js} +4 -4
  44. package/{index-8kvy8qb4.js → index-zyw622y1.js} +12 -2
  45. package/index.js +21 -21
  46. package/{library.command-keqjevpp.js → library.command-9m2rdwwz.js} +3 -3
  47. package/{localRegistry.command-pydeq5zf.js → localRegistry.command-vacc2njh.js} +8 -8
  48. package/{module.command-dkrnqx3v.js → module.command-q63dffya.js} +5 -5
  49. package/{package.command-wmc0ys5y.js → package.command-y2jh0m99.js} +3 -3
  50. package/package.json +2 -2
  51. package/{page.command-tf3erhrv.js → page.command-f3e4cwhh.js} +3 -3
  52. package/{primitive.command-7hqpegj4.js → primitive.command-r4kq75qj.js} +6 -6
  53. package/{quality.command-8122axq3.js → quality.command-f7gzh26z.js} +9 -2
  54. package/{repair.command-mcy12h0n.js → repair.command-0qmyr6qa.js} +5 -5
  55. package/{scalar.command-vvvbzttc.js → scalar.command-kddn7av4.js} +4 -4
  56. package/{subspace.command-pzvqfy5h.js → subspace.command-j7ayp382.js} +5 -7
  57. package/templates/app/ui/Recipe/jellyButton.ts +1 -0
  58. package/templates/facetIndex/index.ts +21 -6
  59. package/templates/lib/dict.ts +9 -1
  60. package/templates/lib/srv.ts +2 -3
  61. package/templates/libRoot/common/index.ts +2 -7
  62. package/templates/libRoot/srvkit/index.ts +2 -7
  63. package/templates/libRoot/ui/index.ts +2 -7
  64. package/templates/libRoot/webkit/index.ts +2 -7
  65. package/templates/moduleRoot/index.tsx +3 -3
  66. package/{tunnel.command-82zz5xnq.js → tunnel.command-b3ymdk4f.js} +2 -2
  67. package/{workflow.command-y8x3kgjv.js → workflow.command-z1srcdfw.js} +10 -10
  68. package/{workspace.command-jvsb7brc.js → workspace.command-17c46dbp.js} +20 -20
  69. package/cloud.script-c723cpcb.js +0 -20
  70. package/context.runner-erfe68j5.js +0 -21
  71. package/index-bjwxs904.js +0 -77
  72. package/templates/libRoot/common/commonLogic.ts +0 -14
  73. package/templates/libRoot/srvkit/backendLogic.ts +0 -13
  74. package/templates/libRoot/webkit/frontendLogic.ts +0 -13
@@ -37,29 +37,29 @@ import {
37
37
  import {
38
38
  runner,
39
39
  script
40
- } from "./index-a37by9hn.js";
40
+ } from "./index-q6ft9fkc.js";
41
41
  import {
42
42
  WorkspaceExecutor,
43
43
  AppExecutor,
44
44
  LibExecutor,
45
45
  PkgExecutor
46
- } from "./index-150s07n8.js";
46
+ } from "./index-50wb2a26.js";
47
47
  import {
48
48
  DesktopServerStage,
49
49
  resolveMobileTargets,
50
50
  resolveAppId,
51
51
  NativeApp
52
- } from "./index-7p4c0yer.js";
52
+ } from "./index-jk9xnck6.js";
53
53
  import {
54
54
  LibraryScript
55
- } from "./index-66yspb67.js";
55
+ } from "./index-1bjkfvm9.js";
56
56
  import {
57
57
  stripAnsi
58
58
  } from "./index-7md2g9vw.js";
59
59
  import {
60
60
  SlicePlanner,
61
61
  formatSlicePlan
62
- } from "./index-mzjb6zp4.js";
62
+ } from "./index-50jjwg8y.js";
63
63
  import {
64
64
  openBrowser
65
65
  } from "./index-9dp031by.js";
@@ -1867,7 +1867,7 @@ ${uniqueCandidates.map((candidate) => ` - ${candidate}`).join(`
1867
1867
 
1868
1868
  // pkgs/@akanjs/cli/application/application.runner.ts
1869
1869
  import { Logger as Logger3 } from "akanjs/common";
1870
- var loadBuildRunner = async () => (await import("./applicationBuildRunner-75n5rpwp.js")).ApplicationBuildRunner;
1870
+ var loadBuildRunner = async () => (await import("./applicationBuildRunner-etrzfwjj.js")).ApplicationBuildRunner;
1871
1871
  var loadPrompts = async () => await import("@inquirer/prompts");
1872
1872
 
1873
1873
  class ApplicationRunner extends runner("application") {
@@ -1,12 +1,12 @@
1
1
  // @bun
2
2
  import {
3
3
  script
4
- } from "./index-a37by9hn.js";
4
+ } from "./index-q6ft9fkc.js";
5
5
  import {
6
6
  AppExecutor,
7
7
  LibExecutor,
8
8
  ModuleExecutor
9
- } from "./index-150s07n8.js";
9
+ } from "./index-50wb2a26.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-mb59b8x0.js";
44
+ } from "./index-h9ht6s60.js";
45
45
  import {
46
46
  ModuleScript
47
- } from "./index-rfcz04w9.js";
47
+ } from "./index-f4e08ptp.js";
48
48
 
49
49
  // pkgs/@akanjs/cli/primitive/primitive.script.ts
50
50
  import { capitalize, lowerlize } from "akanjs/common";
@@ -22,26 +22,26 @@ import {
22
22
  renderWorkflowApply,
23
23
  renderWorkflowValidation,
24
24
  renderWorkflowRunArtifact
25
- } from "./index-mb59b8x0.js";
25
+ } from "./index-h9ht6s60.js";
26
26
  import {
27
27
  AkanContextAnalyzer
28
- } from "./index-8kvy8qb4.js";
28
+ } from "./index-zyw622y1.js";
29
29
  import {
30
30
  CommandContainer,
31
31
  runner
32
- } from "./index-a37by9hn.js";
32
+ } from "./index-q6ft9fkc.js";
33
33
  import {
34
34
  ModuleScript
35
- } from "./index-rfcz04w9.js";
35
+ } from "./index-f4e08ptp.js";
36
36
  import {
37
37
  PrimitiveScript
38
- } from "./index-8b639zes.js";
38
+ } from "./index-6keyf4sg.js";
39
39
  import {
40
40
  spawnShell
41
- } from "./index-5g4rkrvt.js";
41
+ } from "./index-hp3stk1m.js";
42
42
  import {
43
43
  ScalarScript
44
- } from "./index-5pvxf7z0.js";
44
+ } from "./index-cb6yc5mb.js";
45
45
 
46
46
  // pkgs/@akanjs/cli/workflow/workflow.runner.ts
47
47
  import { mkdir, readFile, writeFile } from "fs/promises";
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-a37by9hn.js";
5
+ } from "./index-q6ft9fkc.js";
6
6
  import {
7
7
  generatedFilesForSync,
8
8
  createPassedPrimitiveReport,
9
9
  scalarChangedFiles
10
- } from "./index-mb59b8x0.js";
10
+ } from "./index-h9ht6s60.js";
11
11
  import {
12
12
  pluralizeName
13
13
  } from "./index-nz8prx9g.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  resolveSsrPageEntriesForApp
4
- } from "./index-150s07n8.js";
4
+ } from "./index-50wb2a26.js";
5
5
  import {
6
6
  computeRouteSeedIndex,
7
7
  saveRouteSeedIndex,
@@ -16,7 +16,7 @@ import {
16
16
  CsrEntryFiles,
17
17
  PagesEntrySourceGenerator,
18
18
  PagesBundleBuilder
19
- } from "./index-m3xsb1ms.js";
19
+ } from "./index-krjcg4y6.js";
20
20
  import {
21
21
  SOURCE_EXTS
22
22
  } from "./index-senscydg.js";
@@ -158,17 +158,11 @@ class CsrArtifactBuilder {
158
158
  await this.#createEntryFile(basePath, CsrArtifactBuilder.pageEntriesForBasePath(pageEntries, basePath, basePaths))
159
159
  ]))).flat());
160
160
  const result = await Bun.build({
161
- target: "browser",
161
+ ...CsrArtifactBuilder.bundleOptions(this.#app, this.#command, akanConfig.optimizeImports),
162
162
  entrypoints: htmlBasePaths.map((basePath) => this.#generatedPath(CsrArtifactBuilder.htmlFilename(basePath))),
163
163
  files: generatedFiles,
164
164
  root: this.#generatedDir,
165
- outdir: this.#outputDir,
166
- splitting: false,
167
- minify: true,
168
- env: "AKAN_PUBLIC_*",
169
- define: bundleDefine(this.#app, this.#command, "csr"),
170
- optimizeImports: akanConfig.optimizeImports,
171
- plugins: [PagesBundleBuilder.createCssStubPlugin()]
165
+ outdir: this.#outputDir
172
166
  });
173
167
  if (!result.success) {
174
168
  const logs = result.logs.map((log) => log.message).join(`
@@ -180,6 +174,16 @@ ${logs}` : ""}`);
180
174
  this.#app.verbose(`[csr-build] output -> ${this.#outputDir}`);
181
175
  return { outputDir: this.#outputDir };
182
176
  }
177
+ static bundleOptions(app, command, optimizeImports = []) {
178
+ return {
179
+ target: "browser",
180
+ splitting: false,
181
+ minify: true,
182
+ define: bundleDefine(app, command, "csr"),
183
+ optimizeImports,
184
+ plugins: [PagesBundleBuilder.createCssStubPlugin()]
185
+ };
186
+ }
183
187
  static pageEntriesForBasePath(pageEntries, basePath, basePaths) {
184
188
  return CsrEntryFiles.pageEntriesForBasePath(pageEntries, basePath, basePaths);
185
189
  }
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-a37by9hn.js";
5
+ } from "./index-q6ft9fkc.js";
6
6
  import {
7
7
  ModuleExecutor
8
- } from "./index-150s07n8.js";
8
+ } from "./index-50wb2a26.js";
9
9
  import {
10
10
  sourceFile,
11
11
  moduleSourcePaths,
@@ -13,10 +13,10 @@ import {
13
13
  createPassedPrimitiveReport,
14
14
  bilingualLabelForField,
15
15
  bilingualDescriptionForField
16
- } from "./index-mb59b8x0.js";
16
+ } from "./index-h9ht6s60.js";
17
17
  import {
18
18
  PageScript
19
- } from "./index-25fvrxmy.js";
19
+ } from "./index-g38nhv87.js";
20
20
  import {
21
21
  pluralizeName
22
22
  } from "./index-nz8prx9g.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-a37by9hn.js";
5
+ } from "./index-q6ft9fkc.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -5,19 +5,19 @@ import {
5
5
  } from "./index-94s080qm.js";
6
6
  import {
7
7
  script
8
- } from "./index-a37by9hn.js";
8
+ } from "./index-q6ft9fkc.js";
9
9
  import {
10
10
  PkgExecutor
11
- } from "./index-150s07n8.js";
11
+ } from "./index-50wb2a26.js";
12
12
  import {
13
13
  ApplicationScript
14
- } from "./index-qe71g4ze.js";
14
+ } from "./index-61mmsdjg.js";
15
15
  import {
16
16
  PackageScript
17
- } from "./index-y7hx1ygz.js";
17
+ } from "./index-3xmzr1p1.js";
18
18
  import {
19
19
  CloudRunner
20
- } from "./index-h54yj9wr.js";
20
+ } from "./index-hxnnfy57.js";
21
21
 
22
22
  // pkgs/@akanjs/cli/cloud/cloud.script.ts
23
23
  import { Logger } from "akanjs/common";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AppExecutor,
4
4
  LibExecutor
5
- } from "./index-150s07n8.js";
5
+ } from "./index-50wb2a26.js";
6
6
 
7
7
  // pkgs/@akanjs/devkit/workflow/utils.ts
8
8
  var jsonText = (value, { trailingNewline = true } = {}) => `${JSON.stringify(value, null, 2)}${trailingNewline ? `
@@ -5,13 +5,13 @@ import {
5
5
  writeGeneratedSyncState,
6
6
  createRepairReport,
7
7
  renderRepairReport
8
- } from "./index-mb59b8x0.js";
8
+ } from "./index-h9ht6s60.js";
9
9
  import {
10
10
  AkanContextAnalyzer
11
- } from "./index-8kvy8qb4.js";
11
+ } from "./index-zyw622y1.js";
12
12
  import {
13
13
  runner
14
- } from "./index-a37by9hn.js";
14
+ } from "./index-q6ft9fkc.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/repair/repair.runner.ts
17
17
  var spawnShell = async (workspace, command) => await workspace.spawn("bash", ["-lc", command.startsWith("akan ") ? `bun run ${command}` : command], {
@@ -6,11 +6,11 @@ import {
6
6
  } from "./index-94s080qm.js";
7
7
  import {
8
8
  runner
9
- } from "./index-a37by9hn.js";
9
+ } from "./index-q6ft9fkc.js";
10
10
  import {
11
11
  WorkspaceExecutor,
12
12
  AppExecutor
13
- } from "./index-150s07n8.js";
13
+ } from "./index-50wb2a26.js";
14
14
  import {
15
15
  openBrowser
16
16
  } from "./index-9dp031by.js";
@@ -145,7 +145,8 @@ class BunTestReport {
145
145
  class PlatformTestTarget {
146
146
  static installIdleMs = 5 * 60000;
147
147
  static testIdleMs = 2 * 60000;
148
- static gitIdentityEnv = {
148
+ static remoteEnv = {
149
+ PUPPETEER_SKIP_DOWNLOAD: "true",
149
150
  GIT_AUTHOR_NAME: "akan-test",
150
151
  GIT_AUTHOR_EMAIL: "akan-test@localhost",
151
152
  GIT_COMMITTER_NAME: "akan-test",
@@ -290,7 +291,7 @@ class LinuxDockerTarget extends PlatformTestTarget {
290
291
  return await new IdleWatchedProcess([
291
292
  "docker",
292
293
  "exec",
293
- ...Object.entries(PlatformTestTarget.gitIdentityEnv).flatMap(([key, value]) => ["-e", `${key}=${value}`]),
294
+ ...Object.entries(PlatformTestTarget.remoteEnv).flatMap(([key, value]) => ["-e", `${key}=${value}`]),
294
295
  container,
295
296
  "sh",
296
297
  "-c",
@@ -461,7 +462,7 @@ class WindowsSshTarget extends PlatformTestTarget {
461
462
  "$ProgressPreference = 'SilentlyContinue'",
462
463
  "[Console]::OutputEncoding = [Text.Encoding]::UTF8",
463
464
  "'PID=' + $PID",
464
- ...Object.entries(PlatformTestTarget.gitIdentityEnv).map(([key, value]) => `$env:${key} = '${value}'`),
465
+ ...Object.entries(PlatformTestTarget.remoteEnv).map(([key, value]) => `$env:${key} = '${value}'`),
465
466
  `Set-Location -LiteralPath '${runDir}\\w'`,
466
467
  `cmd /c "${command} 2>&1"`,
467
468
  "exit $LASTEXITCODE"
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  AppExecutor
4
- } from "./index-150s07n8.js";
4
+ } from "./index-50wb2a26.js";
5
5
  import {
6
6
  jsonText,
7
7
  createWorkflowBaselineSummary,
8
8
  buildAkanModuleContextIndex,
9
9
  toolingRolloutGate
10
- } from "./index-mb59b8x0.js";
10
+ } from "./index-h9ht6s60.js";
11
11
  import {
12
12
  buildResourceList,
13
13
  codexMcpConfigPath,
@@ -17,25 +17,25 @@ import {
17
17
  upsertCodexMcpServerBlock,
18
18
  renderDoctorText,
19
19
  AkanContextAnalyzer
20
- } from "./index-8kvy8qb4.js";
20
+ } from "./index-zyw622y1.js";
21
21
  import {
22
22
  runner
23
- } from "./index-a37by9hn.js";
23
+ } from "./index-q6ft9fkc.js";
24
24
  import {
25
25
  getMobileTargets,
26
26
  appIdsOf,
27
27
  NativeApp,
28
28
  isPlaceholderAppId
29
- } from "./index-7p4c0yer.js";
29
+ } from "./index-jk9xnck6.js";
30
30
  import {
31
31
  Prompter2
32
32
  } from "./index-zzvvc845.js";
33
33
  import {
34
34
  RepairRunner
35
- } from "./index-5g4rkrvt.js";
35
+ } from "./index-hp3stk1m.js";
36
36
  import {
37
37
  WorkflowRunner
38
- } from "./index-vs8mefhy.js";
38
+ } from "./index-bsv901fd.js";
39
39
 
40
40
  // pkgs/@akanjs/devkit/akanMcpContract.ts
41
41
  import path from "path";
@@ -4,7 +4,7 @@ import {
4
4
  akanCodePaths2,
5
5
  McpServerConfig,
6
6
  McpSignIn
7
- } from "./index-c14nsvnv.js";
7
+ } from "./index-xwprn9nr.js";
8
8
  import {
9
9
  stripAnsi
10
10
  } from "./index-7md2g9vw.js";
@@ -511,7 +511,7 @@ class AkanToolPack2 {
511
511
  return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
512
512
  }
513
513
  async names() {
514
- const { ContextRunner } = await import("./context.runner-erfe68j5.js");
514
+ const { ContextRunner } = await import("./context.runner-hnkvv3z3.js");
515
515
  return [
516
516
  ...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
517
517
  AkanToolPack2.verifyToolName
@@ -519,7 +519,7 @@ class AkanToolPack2 {
519
519
  }
520
520
  static verifyToolName = "akan_verify";
521
521
  async#register(pi) {
522
- const { ContextRunner } = await import("./context.runner-erfe68j5.js");
522
+ const { ContextRunner } = await import("./context.runner-hnkvv3z3.js");
523
523
  const runner = new ContextRunner;
524
524
  const guidelineNames = await AkanToolPack2.#guidelineNames();
525
525
  for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  binPlatforms,
4
4
  Executor
5
- } from "./index-150s07n8.js";
5
+ } from "./index-50wb2a26.js";
6
6
 
7
7
  // pkgs/@akanjs/devkit/mobile/mobileTarget.ts
8
8
  var trimSlashes = (value) => value.replace(/^\/+|\/+$/g, "");
@@ -419,7 +419,8 @@ class NativeConfig {
419
419
  screenCapture: target.desktop?.screenCapture,
420
420
  window: NativeConfig.#compact({ ...target.desktop?.window }),
421
421
  server: desktopServer,
422
- bin: desktopBin
422
+ bin: desktopBin,
423
+ dmg: NativeConfig.#dmg(target.desktop?.dmg, abs)
423
424
  });
424
425
  const config = {
425
426
  app: {
@@ -468,6 +469,16 @@ class NativeConfig {
468
469
  return { image: abs(splash) };
469
470
  return { ...splash, ...splash.image ? { image: abs(splash.image) } : {} };
470
471
  }
472
+ static #dmg(dmg, abs) {
473
+ if (!dmg)
474
+ return;
475
+ const { background, background2x, ...layout } = dmg;
476
+ return {
477
+ ...layout,
478
+ ...background === undefined ? {} : { background: background === false ? false : abs(background) },
479
+ ...background2x ? { background2x: abs(background2x) } : {}
480
+ };
481
+ }
471
482
  static #updates(target, env) {
472
483
  const { url, publicKey, channel = env, ...rest } = target.updates ?? {};
473
484
  return url && publicKey ? { ...rest, url, publicKey, ...channel ? { channel } : {} } : undefined;
@@ -615,7 +626,7 @@ class NativeApp {
615
626
  this.app = app;
616
627
  this.target = target;
617
628
  this.env = env;
618
- this.targetRoot = path6.join(app.cwdPath, ".akan", "native", target.name);
629
+ this.targetRoot = path6.join(app.workspace.workspaceRoot, "dist", "native", app.name, target.name);
619
630
  this.web = new NativeWebDir(path6.join(this.targetRoot, "web"));
620
631
  }
621
632
  outDir(platform) {
@@ -690,13 +701,14 @@ class NativeApp {
690
701
  else
691
702
  this.app.logger[read.level](read.message);
692
703
  };
693
- #task(platform, config, outDir = this.outDir(platform)) {
704
+ #task(platform, config, { outDir = this.outDir(platform), env = {} } = {}) {
694
705
  return {
695
706
  appDir: this.app.cwdPath,
696
707
  config,
697
708
  platform,
698
709
  outDir,
699
710
  envFiles: false,
711
+ env,
700
712
  skipWebBuild: true,
701
713
  log: (event) => {
702
714
  if (event.level === "error")
@@ -712,13 +724,18 @@ class NativeApp {
712
724
  }
713
725
  };
714
726
  }
727
+ async#runtimeEnv(server) {
728
+ if (this.env !== "local" || server || process.env.AKAN_PUBLIC_SERVER_URL)
729
+ return {};
730
+ return { PUBLIC_AKAN_SERVER_URL: `http://localhost:${await this.app.getDevPort()}` };
731
+ }
715
732
  async build(platform, { profile = "release", server, installer = false, arch } = {}) {
716
733
  NativeApp.#assertServerPlatform(platform, server);
717
734
  NativeApp.assertInstaller(platform, installer);
718
735
  await this.assembleWeb(platform);
719
736
  const { api, config } = await this.prepare(platform, server, arch);
720
737
  return await api.build({
721
- ...this.#task(platform, config),
738
+ ...this.#task(platform, config, { env: await this.#runtimeEnv(server) }),
722
739
  profile,
723
740
  ...arch ? { arch } : {},
724
741
  ...platform === "windows" ? {
@@ -741,7 +758,7 @@ class NativeApp {
741
758
  await this.assembleWeb(platform);
742
759
  const { api, config } = await this.prepare(platform, server);
743
760
  return await api.run({
744
- ...this.#task(platform, config),
761
+ ...this.#task(platform, config, { env: await this.#runtimeEnv(server) }),
745
762
  profile,
746
763
  onLine: this.#appLine,
747
764
  ...device ? { device } : {},
@@ -756,7 +773,7 @@ class NativeApp {
756
773
  await this.web.clear();
757
774
  const [{ api, config }, { api: routes }] = await Promise.all([this.prepare(platform), this.app.getConfig()]);
758
775
  const session = await api.dev({
759
- ...this.#task(platform, config, this.devOutDir(platform)),
776
+ ...this.#task(platform, config, { outDir: this.devOutDir(platform) }),
760
777
  upstream,
761
778
  hmrPath: "/_akan/hmr",
762
779
  wsPaths: [`${routes.prefix}${routes.websocketPrefix}`],
@@ -792,7 +809,7 @@ class NativeApp {
792
809
  await this.assembleWeb("ios");
793
810
  const { api, config } = await this.prepare("ios");
794
811
  return await api.release({
795
- ...this.#task("ios", config),
812
+ ...this.#task("ios", config, { env: await this.#runtimeEnv() }),
796
813
  platform: "ios",
797
814
  signing: { ...teamId ? { teamId } : {}, ...adHoc ? { distribution: "ad-hoc" } : {} }
798
815
  });
@@ -806,7 +823,7 @@ class NativeApp {
806
823
  await this.assembleWeb(platform);
807
824
  const { api, config } = await this.prepare(platform, server);
808
825
  return await api.publishUpdate({
809
- ...this.#task(platform, config),
826
+ ...this.#task(platform, config, { env: await this.#runtimeEnv(server) }),
810
827
  platform,
811
828
  out: this.updatesDir,
812
829
  ...channel ? { channel } : {},
@@ -851,7 +868,12 @@ class NativeApp {
851
868
  const signing = NativeApp.androidSigning();
852
869
  await this.assembleWeb("android");
853
870
  const { api, config } = await this.prepare("android");
854
- return await api.release({ ...this.#task("android", config), platform: "android", signing, formats });
871
+ return await api.release({
872
+ ...this.#task("android", config, { env: await this.#runtimeEnv() }),
873
+ platform: "android",
874
+ signing,
875
+ formats
876
+ });
855
877
  }
856
878
  async packUpdate(platform, { out } = {}) {
857
879
  await this.assembleWeb(platform);
@@ -861,7 +883,7 @@ class NativeApp {
861
883
  const packed = await api.packUpdate({
862
884
  ...this.#task(platform, config),
863
885
  platform,
864
- out: out ?? path6.join(this.targetRoot, "updates", platform)
886
+ out: out ?? path6.join(this.updatesDir, platform)
865
887
  });
866
888
  return { ...packed, channel: config.updates.channel ?? "production" };
867
889
  }
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  AsyncDefaultExportDetector,
11
11
  resolveSsrPageEntriesForApp
12
- } from "./index-150s07n8.js";
12
+ } from "./index-50wb2a26.js";
13
13
 
14
14
  // pkgs/@akanjs/devkit/artifact/routeSeedIndex.ts
15
15
  import path from "path";
@@ -2493,7 +2493,6 @@ class CsrDevResolver {
2493
2493
  target: "browser",
2494
2494
  metafile: true,
2495
2495
  external: [...this.#context.externals ?? []],
2496
- env: "AKAN_PUBLIC_*",
2497
2496
  define: this.#context.define,
2498
2497
  optimizeImports: this.#context.optimizeImports,
2499
2498
  plugins: [PagesBundleBuilder.createCssStubPlugin()]
@@ -2516,7 +2515,6 @@ class CsrDevResolver {
2516
2515
  metafile: true,
2517
2516
  throw: false,
2518
2517
  external: [...this.#context.externals ?? []],
2519
- env: "AKAN_PUBLIC_*",
2520
2518
  define: this.#context.define,
2521
2519
  plugins: [
2522
2520
  {
@@ -3489,7 +3487,6 @@ class CsrDevModuleCompiler {
3489
3487
  naming: { entry: "[dir]/[name].[ext]", asset: "assets/[name]-[hash].[ext]" },
3490
3488
  publicPath: this.#routePrefix,
3491
3489
  metafile: true,
3492
- env: "AKAN_PUBLIC_*",
3493
3490
  define: { ...this.#context.define, "import.meta": "__akanMeta" },
3494
3491
  optimizeImports: this.#context.optimizeImports,
3495
3492
  plugins: [this.#registryPlugin(vendor, misses, macroOutputs)]
@@ -4186,7 +4183,9 @@ class DevGeneratedIndexSync {
4186
4183
  }
4187
4184
  async#facetContent(dir) {
4188
4185
  const nameCasePattern = path23.basename(dir) === "ui" ? FACET_PASCAL_CASE_RE : FACET_CAMEL_CASE_RE;
4189
- const entries = await readdir3(dir, { withFileTypes: true }).catch(() => []);
4186
+ const entries = await readdir3(dir, { withFileTypes: true }).catch(() => null);
4187
+ if (!entries)
4188
+ return null;
4190
4189
  const exportNames = entries.flatMap((entry) => {
4191
4190
  const name = entry.name;
4192
4191
  if (name.startsWith("."))
@@ -4199,9 +4198,10 @@ class DevGeneratedIndexSync {
4199
4198
  return [];
4200
4199
  const exportName = name.replace(FACET_SOURCE_FILE_RE, "");
4201
4200
  return nameCasePattern.test(exportName) ? [exportName] : [];
4202
- }).sort();
4201
+ }).sort(compareExportNames);
4203
4202
  if (exportNames.length === 0)
4204
- return null;
4203
+ return `export {};
4204
+ `;
4205
4205
  return `${exportNames.map((name) => `export * from "./${name}";`).join(`
4206
4206
  `)}
4207
4207
  `;
@@ -4225,13 +4225,31 @@ class DevGeneratedIndexSync {
4225
4225
  }
4226
4226
  if (fileTypes.length === 0)
4227
4227
  return null;
4228
- return `
4229
- ${fileTypes.map((type) => `import * as ${type} from "./${modelName}.${type}";`).join(`
4228
+ return `${fileTypes.map((type) => `import * as ${type} from "./${modelName}.${type}";`).join(`
4230
4229
  `)}
4231
4230
 
4232
- export const ${modelName} = { ${fileTypes.join(", ")} };`;
4231
+ export const ${modelName} = { ${fileTypes.join(", ")} };
4232
+ `;
4233
4233
  }
4234
4234
  }
4235
+ var letterRankOf = (char) => char.toLowerCase().charCodeAt(0) * 2 + (char === char.toLowerCase() ? 1 : 0);
4236
+ var digitRunAt = (name, idx) => /^\d+/.exec(name.slice(idx))?.[0] ?? "";
4237
+ var compareExportNames = (a, b) => {
4238
+ for (let idx = 0;idx < a.length && idx < b.length; ) {
4239
+ const [runA, runB] = [digitRunAt(a, idx), digitRunAt(b, idx)];
4240
+ if (runA && runB && runA !== runB)
4241
+ return runA.length - runB.length || (runA < runB ? -1 : 1);
4242
+ if (runA && runB)
4243
+ idx += runA.length;
4244
+ else if (runA || runB)
4245
+ return runA ? -1 : 1;
4246
+ else if (a.charAt(idx) !== b.charAt(idx))
4247
+ return letterRankOf(a.charAt(idx)) - letterRankOf(b.charAt(idx));
4248
+ else
4249
+ idx++;
4250
+ }
4251
+ return a.length - b.length;
4252
+ };
4235
4253
  var exists = async (file) => stat2(file).then(() => true).catch(() => false);
4236
4254
  var formatError2 = (err) => err instanceof Error ? err.message : String(err);
4237
4255
 
@@ -10,7 +10,7 @@ import {
10
10
  LibExecutor,
11
11
  PkgExecutor,
12
12
  ModuleExecutor
13
- } from "./index-150s07n8.js";
13
+ } from "./index-50wb2a26.js";
14
14
 
15
15
  // pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
16
16
  var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
@@ -373,14 +373,14 @@ var getOptionValue = async (argMeta, opt, context) => {
373
373
  return convertArgValue(opt[argMeta.name], type ?? "string");
374
374
  } else if (defaultValue !== undefined)
375
375
  return defaultValue;
376
+ else if (nullable)
377
+ return null;
376
378
  if (enumChoices) {
377
379
  const choices = normalizeEnumChoices((typeof enumChoices === "function" ? await enumChoices(context) : enumChoices) ?? []);
378
380
  if (choices.length === 1)
379
381
  return choices[0]?.value;
380
382
  return await select({ message: ask ?? desc ?? `Select the ${name} value`, choices });
381
- } else if (nullable)
382
- return null;
383
- else if (type === "boolean") {
383
+ } else if (type === "boolean") {
384
384
  const message = ask ?? desc ?? `Do you want to set ${name}? ${desc ? ` (${desc})` : ""}: `;
385
385
  return await confirm({ message });
386
386
  } else
@@ -116,7 +116,7 @@ class SubagentPool2 {
116
116
  }
117
117
  }
118
118
  async#run(id, kind, prompt, signal) {
119
- const { CodeAgent } = await import("./CodeAgent-zfab7pkn.js");
119
+ const { CodeAgent } = await import("./CodeAgent-szbjv4gv.js");
120
120
  const budget = this.#options.parent.tools.subagent;
121
121
  const child = SubagentPool2.childOf(this.#options.parent, kind);
122
122
  const agent = await CodeAgent.create({
@@ -1,16 +1,16 @@
1
1
  // @bun
2
2
  import {
3
3
  jsonText
4
- } from "./index-mb59b8x0.js";
4
+ } from "./index-h9ht6s60.js";
5
5
  import {
6
6
  akanMcpInstallTargets
7
- } from "./index-8kvy8qb4.js";
7
+ } from "./index-zyw622y1.js";
8
8
  import {
9
9
  script
10
- } from "./index-a37by9hn.js";
10
+ } from "./index-q6ft9fkc.js";
11
11
  import {
12
12
  ContextRunner2
13
- } from "./index-kn5d4jmg.js";
13
+ } from "./index-j38qkvkk.js";
14
14
 
15
15
  // pkgs/@akanjs/cli/context/context.script.ts
16
16
  import { Logger } from "akanjs/common";