@akanjs/cli 3.0.0-alpha.3 → 3.0.0-alpha.31

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 (105) hide show
  1. package/.build-stamp +1 -1
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/{abstractCompactor-e5yq60qz.js → abstractCompactor-20e0cwbs.js} +2 -2
  5. package/{agent.command-yv00p0s0.js → agent.command-e835fjem.js} +8 -7
  6. package/{application.command-0qsczf4k.js → application.command-sjtbk6tr.js} +6 -5
  7. package/{applicationBuildRunner-ct2pxyvw.js → applicationBuildRunner-7gnfz7ww.js} +6 -7
  8. package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-93nzdfsy.js} +1 -1
  9. package/buildBatch.proc.js +5 -4
  10. package/{capacitorApp-4r9sm3qg.js → capacitorApp-qv7g3dp2.js} +29 -26
  11. package/{cloud.command-dxfv18sa.js → cloud.command-y0e4eyqz.js} +10 -9
  12. package/{context.command-8d9e3k6b.js → context.command-vn87jb08.js} +16 -15
  13. package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
  14. package/getDirname-ka11hm7e.js +8 -0
  15. package/{guideline.command-3jbkxzh6.js → guideline.command-s4hn2bsy.js} +7 -6
  16. package/guidelines/conventions/conventions.generate.json +25 -0
  17. package/guidelines/conventions/conventions.instruction.md +986 -0
  18. package/guidelines/cssRule/cssRule.instruction.md +7 -0
  19. package/guidelines/framework/framework.instruction.md +1 -0
  20. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
  21. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +972 -0
  22. package/incrementalBuilder.proc.js +6 -5
  23. package/{index-1pvex4az.js → index-0h212yqe.js} +13 -13
  24. package/index-1577bej2.js +7 -0
  25. package/{index-k95xkh4p.js → index-33zce8gt.js} +8 -4
  26. package/{index-2q1f5j9k.js → index-3dp7x6rc.js} +3 -3
  27. package/{index-7c6k4yvg.js → index-73rnbwgg.js} +15 -7
  28. package/{index-e16gnn26.js → index-8d2sv6pw.js} +13 -13
  29. package/{index-hgna5rjy.js → index-8vkkm7v0.js} +124 -65
  30. package/{index-bekddz9q.js → index-9jsnb4vw.js} +4 -4
  31. package/{index-nm6wghb6.js → index-becx1t0k.js} +6 -6
  32. package/{index-a00jg8x8.js → index-g9e2fhw2.js} +49 -32
  33. package/{index-pyt2b4nw.js → index-hg0qvhmx.js} +152 -241
  34. package/{index-tdbas9r0.js → index-j37qq1f2.js} +1 -1
  35. package/{index-ej426mcr.js → index-k6fvbcj1.js} +37 -6
  36. package/{index-yzmhasdb.js → index-mykmf6wd.js} +8 -8
  37. package/{index-t3723f99.js → index-mz5jtaq7.js} +86 -17
  38. package/{index-8hsbnyes.js → index-n706txcv.js} +5 -3
  39. package/{index-bbkek1bp.js → index-qc0tnhs2.js} +1 -1
  40. package/{index-rh16j3c7.js → index-qnv0aqmm.js} +12 -8
  41. package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
  42. package/{index-zasydjxd.js → index-t71zvmt9.js} +9 -11
  43. package/{index-rzwcpcc3.js → index-tsmjxph2.js} +1 -1
  44. package/{index-ec09pws3.js → index-x33gnap3.js} +4 -4
  45. package/{index-mr5s7mqd.js → index-xyrb7pk5.js} +3 -3
  46. package/index.js +20 -19
  47. package/{library.command-ebdj1vnm.js → library.command-v5cyaw9t.js} +5 -4
  48. package/{localRegistry.command-gb178ne8.js → localRegistry.command-53t758pt.js} +9 -8
  49. package/{module.command-9c1bnsx4.js → module.command-pq6w84xg.js} +9 -8
  50. package/{package.command-t93p4jkj.js → package.command-qkcs60ts.js} +5 -4
  51. package/package.json +3 -4
  52. package/{page.command-k3k0meh2.js → page.command-qj5bfnh9.js} +5 -4
  53. package/{primitive.command-de6nktdt.js → primitive.command-bw0nes6x.js} +10 -9
  54. package/{quality.command-z5kth2wa.js → quality.command-f8drhx6c.js} +11 -41
  55. package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
  56. package/{repair.command-ehf2g112.js → repair.command-mzwtejpk.js} +7 -6
  57. package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-7fycdqyv.js} +3 -39
  58. package/{scalar.command-7a2jtv33.js → scalar.command-rm6k3c65.js} +8 -7
  59. package/templates/app/env/env.server.debug.ts.template +1 -5
  60. package/templates/app/env/env.server.develop.ts.template +1 -5
  61. package/templates/app/env/env.server.local.ts.template +1 -5
  62. package/templates/app/env/env.server.main.ts.template +1 -5
  63. package/templates/app/page/styles.css.template +3 -3
  64. package/templates/appSample/srvkit/AuthGuard.ts +9 -5
  65. package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
  66. package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
  67. package/templates/crudPages/new/page.tsx +1 -1
  68. package/templates/crudSinglePage/page.tsx +1 -1
  69. package/templates/env/_env.server.type.ts +7 -5
  70. package/templates/lib/db.ts +1 -1
  71. package/templates/lib/dict.ts +1 -1
  72. package/templates/lib/sig.ts +1 -1
  73. package/templates/lib/srv.ts +6 -2
  74. package/templates/lib/useClient.ts +9 -3
  75. package/templates/module/__Model__.Util.tsx +1 -1
  76. package/templates/module/__Model__.Zone.tsx +3 -5
  77. package/templates/workspaceRoot/AGENTS.md.template +0 -963
  78. package/templates/workspaceRoot/CLAUDE.md.template +19 -0
  79. package/templates/workspaceRoot/biome.json.template +4 -198
  80. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
  81. package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
  82. package/typecheck.proc.js +1 -1
  83. package/{workflow.command-e0tt0vk2.js → workflow.command-g2cgcgxn.js} +15 -14
  84. package/{workspace.command-fpda0evj.js → workspace.command-f7jerqb2.js} +69 -51
  85. package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
  86. package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -33
  87. package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
  88. package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
  89. package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
  90. package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
  91. package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
  92. package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
  93. package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
  94. package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -18
  95. package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -61
  96. package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
  97. package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
  98. package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
  99. package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -58
  100. package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
  101. package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
  102. package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
  103. package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
  104. package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
  105. /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
@@ -1,22 +1,25 @@
1
1
  // @bun
2
2
  import {
3
3
  AkanContextAnalyzer
4
- } from "./index-a00jg8x8.js";
4
+ } from "./index-g9e2fhw2.js";
5
5
  import {
6
6
  Prompter
7
- } from "./index-tdbas9r0.js";
7
+ } from "./index-j37qq1f2.js";
8
8
  import {
9
9
  runner,
10
10
  script
11
- } from "./index-8hsbnyes.js";
11
+ } from "./index-n706txcv.js";
12
12
  import {
13
13
  AGENT_BLOCK_END,
14
14
  AGENT_BLOCK_START,
15
15
  AppExecutor,
16
+ CLAUDE_COMMENT_RULE,
16
17
  LibExecutor,
18
+ readDevkitVersion,
17
19
  renderRecipeEntries,
20
+ stampBlockVersion,
18
21
  upsertAgentBlock
19
- } from "./index-hgna5rjy.js";
22
+ } from "./index-8vkkm7v0.js";
20
23
  import {
21
24
  collectRecipeSources,
22
25
  scanRecipes
@@ -103,19 +106,33 @@ ${scopeIndexPointer}
103
106
 
104
107
  `;
105
108
  };
109
+ var renderGuides = async (context) => {
110
+ const conventions = (await Prompter.getInstruction("conventions")).trim();
111
+ if (context.pkgs.some((pkg) => pkg.name === "akanjs"))
112
+ return conventions;
113
+ const onboarding = (await Prompter.getInstruction("workspaceOnboarding")).trim();
114
+ const appName = context.apps[0]?.name ?? "app";
115
+ return `${conventions}
116
+
117
+ ${onboarding.replaceAll("<%= appName %>", appName)}`;
118
+ };
106
119
  var renderManagedBlock = async (workspace) => {
107
120
  const context = await AkanContextAnalyzer.analyze(workspace);
108
121
  const frameworkGuide = await Prompter.getInstruction("framework");
109
122
  const appNames = context.apps.map((app) => app.name);
110
123
  const sampleCleanup = await renderSampleCleanup(workspace, appNames);
111
124
  const recipeIndex = await renderRecipeIndex(workspace);
112
- return `## Workspace
125
+ const guides = await renderGuides(context);
126
+ const version = await readDevkitVersion();
127
+ const block = `## Workspace
113
128
 
114
129
  - Repo: ${context.repoName}
115
130
  - Apps: ${context.apps.map((app) => app.name).join(", ") || "none"}
116
131
  - Libraries: ${context.libs.map((lib) => lib.name).join(", ") || "none"}
117
132
  - Packages: ${context.pkgs.map((pkg) => pkg.name).join(", ") || "none"}
118
133
 
134
+ ${guides}
135
+
119
136
  ${sampleCleanup}## Akan Module Abstracts
120
137
 
121
138
  - Before changing a domain, service, or scalar module, read its \`*.abstract.md\` file first.
@@ -148,7 +165,19 @@ ${context.validationCommands.map((command) => `- \`${command}\``).join(`
148
165
 
149
166
  ## Framework Guide
150
167
 
151
- ${frameworkGuide.trim()}`;
168
+ ${frameworkGuide.trim()}
169
+
170
+ ## Before You Finish
171
+
172
+ 1. \`bun run akan lint <appName>\` \u2014 Tailwind class order, \`Err\`, \`console\`, \`#private\` scope, unused imports.
173
+ 2. \`bun run akan typecheck <appName>\` \u2014 server/client boundary violations.
174
+ 3. \`bun run akan sync <appName>\` if you added, renamed, or deleted any file.
175
+ 4. Did you write or change a \`.tsx\` file? \`bun run akan quality ssr\` \u2014 did the server share hold, and did you add
176
+ a \`"use client"\` you cannot justify?
177
+ 5. Re-read the file you wrote against its section above.
178
+ 6. Did you add a comment? Delete it unless it documents an external constraint or a security decision.
179
+ 7. Did behavior or an invariant change? Update the module's \`*.abstract.md\`.`;
180
+ return version ? stampBlockVersion(block, version) : block;
152
181
  };
153
182
  var renderAgentsMd = async (workspace, existing) => {
154
183
  const block = await renderManagedBlock(workspace);
@@ -171,6 +200,8 @@ var renderClaudeMd = async (workspace) => {
171
200
  return `# ${context.repoName} \u2014 Claude Code Guide
172
201
 
173
202
  @AGENTS.md
203
+
204
+ ${CLAUDE_COMMENT_RULE}
174
205
  `;
175
206
  };
176
207
  var renderCursorRule = () => `---
@@ -1,13 +1,13 @@
1
1
  // @bun
2
- import {
3
- PageScript
4
- } from "./index-bbkek1bp.js";
5
2
  import {
6
3
  pluralizeName
7
4
  } from "./index-ss469dec.js";
5
+ import {
6
+ PageScript
7
+ } from "./index-qc0tnhs2.js";
8
8
  import {
9
9
  AiSession
10
- } from "./index-0cj2zxbm.js";
10
+ } from "./index-sh01r3pm.js";
11
11
  import {
12
12
  bilingualDescriptionForField,
13
13
  bilingualLabelForField,
@@ -15,17 +15,17 @@ import {
15
15
  generatedFilesForSync,
16
16
  moduleSourcePaths,
17
17
  sourceFile
18
- } from "./index-rzwcpcc3.js";
18
+ } from "./index-tsmjxph2.js";
19
19
  import {
20
20
  Prompter
21
- } from "./index-tdbas9r0.js";
21
+ } from "./index-j37qq1f2.js";
22
22
  import {
23
23
  runner,
24
24
  script
25
- } from "./index-8hsbnyes.js";
25
+ } from "./index-n706txcv.js";
26
26
  import {
27
27
  ModuleExecutor
28
- } from "./index-hgna5rjy.js";
28
+ } from "./index-8vkkm7v0.js";
29
29
  import {
30
30
  FileSys
31
31
  } from "./index-67546d0j.js";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./index-76rn3g2c.js";
6
6
  import {
7
7
  CommandExecutionError
8
- } from "./index-hgna5rjy.js";
8
+ } from "./index-8vkkm7v0.js";
9
9
 
10
10
  // pkgs/@akanjs/devkit/capacitorApp.ts
11
11
  import { cp, mkdir, readFile, rm, writeFile } from "fs/promises";
@@ -514,6 +514,10 @@ function getAdbDeviceStateIssues(output) {
514
514
  return [];
515
515
  });
516
516
  }
517
+ function getAndroidLocalServerHost(adbDevicesOutput, fallbackHost) {
518
+ const onlineDeviceIds = adbDevicesOutput?.split(/\r?\n/).map((line) => line.trim().split(/\s+/)).filter(([id, state]) => id && state === "device").map(([id]) => id) ?? [];
519
+ return onlineDeviceIds.length === 1 && onlineDeviceIds[0]?.startsWith("emulator-") ? "10.0.2.2" : fallbackHost;
520
+ }
517
521
  var ANDROID_MIN_SDK_VERSION = 26;
518
522
  function raiseGradleMinSdkVersion(content, floor = ANDROID_MIN_SDK_VERSION) {
519
523
  const match = content.match(/minSdkVersion\s*=\s*(\d+)/);
@@ -691,7 +695,7 @@ class CapacitorApp {
691
695
  async save() {
692
696
  await this.project.commit();
693
697
  }
694
- async#prepareIos({ operation, env, regenerate = false }) {
698
+ async#prepareIos({ operation, env, regenerate = false, iosRunTargetKind }) {
695
699
  await this.init({ platform: "ios", operation, env, regenerate });
696
700
  await this.#prepareTargetAssets();
697
701
  await this.#prepareExternalFiles("ios");
@@ -700,9 +704,10 @@ class CapacitorApp {
700
704
  await this.#applyDeepLinks("ios", { operation, env });
701
705
  await this.#flushIosEntitlements();
702
706
  await this.project.commit();
707
+ await this.#setCodeSignEntitlementsInIosIfExists("App/App.entitlements");
703
708
  await this.#generateAssets({ operation, env });
704
709
  this.app.verbose(`syncing iOS`);
705
- await this.#spawnMobile("npx", ["cap", "sync", "ios"], { operation, env });
710
+ await this.#spawnMobile("npx", ["cap", "sync", "ios"], { operation, env }, { iosRunTargetKind });
706
711
  this.app.verbose(`sync completed.`);
707
712
  }
708
713
  async buildIos({ env = "debug", regenerate = false } = {}) {
@@ -721,10 +726,10 @@ class CapacitorApp {
721
726
  async runIos({ operation, env, regenerate = false, noAllowProvisioningUpdates = false, iosDeviceId }) {
722
727
  if (operation === "release")
723
728
  await this.prepareWww();
724
- await this.#prepareIos({ operation, env, regenerate });
725
729
  const runTarget = await this.#selectIosRunTarget(iosDeviceId);
730
+ await this.#prepareIos({ operation, env, regenerate, iosRunTargetKind: runTarget.kind });
726
731
  if (runTarget.kind === "simulator") {
727
- await this.#spawnMobile("npx", ["cap", "run", "ios", "--target", runTarget.id], { operation, env }, { stdio: "inherit" });
732
+ await this.#spawnMobile("npx", ["cap", "run", "ios", "--target", runTarget.id, "--no-sync"], { operation, env }, { stdio: "inherit", platform: "ios", iosRunTargetKind: runTarget.kind });
728
733
  return;
729
734
  }
730
735
  await this.#runIosPhysicalDevice({ operation, env, runTarget, noAllowProvisioningUpdates });
@@ -800,7 +805,7 @@ ${textError instanceof Error ? textError.message : ""}`);
800
805
  noAllowProvisioningUpdates
801
806
  }) {
802
807
  const mobileEnv = sanitizeIosNativeRunEnv(await this.#commandEnv(operation, env));
803
- const configContent = await this.#writeCapacitorConfig({ operation }, mobileEnv);
808
+ const configContent = await this.#writeCapacitorConfig({ operation, platform: "ios", iosRunTargetKind: runTarget.kind }, mobileEnv);
804
809
  await this.#writeRootCapacitorConfig(configContent);
805
810
  const scheme = this.#iosScheme();
806
811
  const command = buildIosNativeRunCommand({
@@ -857,6 +862,7 @@ ${error.message}`;
857
862
  await this.#applyAndroidMinSdkVersion();
858
863
  await this.#applyPermissions({ operation, env });
859
864
  await this.#applyDeepLinks("android", { operation, env });
865
+ await this.#disableNativeKeyboardResizeInAndroid();
860
866
  await this.project.commit();
861
867
  await this.#generateAssets({ operation, env });
862
868
  await this.#ensureAndroidAssetsDir();
@@ -916,6 +922,23 @@ ${error.message}`;
916
922
  async openAndroid() {
917
923
  await this.#spawnMobile("npx", ["cap", "open", "android"], { operation: "local", env: "local" });
918
924
  }
925
+ async#disableNativeKeyboardResizeInAndroid() {
926
+ const manifestPath = path.join(this.app.cwdPath, this.androidRootPath, "app/src/main/AndroidManifest.xml");
927
+ let manifest = await readFile(manifestPath, "utf8");
928
+ let changed = false;
929
+ manifest = manifest.replace(/<activity\b[^>]*android:name="\.MainActivity"[^>]*>/, (activityTag) => {
930
+ if (activityTag.includes("android:windowSoftInputMode=")) {
931
+ const nextTag = activityTag.replace(/android:windowSoftInputMode="[^"]*"/, 'android:windowSoftInputMode="adjustNothing"');
932
+ changed ||= nextTag !== activityTag;
933
+ return nextTag;
934
+ }
935
+ changed = true;
936
+ return activityTag.replace(/>$/, `
937
+ android:windowSoftInputMode="adjustNothing">`);
938
+ });
939
+ if (changed)
940
+ await writeFile(manifestPath, manifest);
941
+ }
919
942
  async#ensureAndroidAssetsDir() {
920
943
  await mkdir(path.join(this.app.cwdPath, this.androidAssetsPath), { recursive: true });
921
944
  }
@@ -1005,12 +1028,16 @@ ${error.message}`;
1005
1028
  return html.replace(/<\/head\s*>/i, `${script}
1006
1029
  </head>`);
1007
1030
  }
1008
- async#writeCapacitorConfig({ operation }, commandEnv) {
1031
+ async#writeCapacitorConfig({
1032
+ operation,
1033
+ platform,
1034
+ iosRunTargetKind
1035
+ }, commandEnv) {
1009
1036
  await mkdir(this.targetRoot, { recursive: true });
1010
1037
  let localIp;
1011
1038
  if (operation === "local") {
1012
1039
  const override = commandEnv.AKAN_PUBLIC_CLIENT_HOST ?? process.env.AKAN_PUBLIC_CLIENT_HOST;
1013
- const resolution = selectLocalDevHost(os.networkInterfaces(), { override });
1040
+ const resolution = await this.#resolveLocalDevHost({ override, platform, iosRunTargetKind });
1014
1041
  localIp = resolution.host;
1015
1042
  this.#logDevHostResolution(resolution, commandEnv);
1016
1043
  }
@@ -1024,9 +1051,29 @@ ${error.message}`;
1024
1051
  await Bun.write(path.join(this.targetRoot, "capacitor.config.json"), content);
1025
1052
  return content;
1026
1053
  }
1054
+ async#resolveLocalDevHost({
1055
+ override,
1056
+ platform,
1057
+ iosRunTargetKind
1058
+ }) {
1059
+ const resolution = selectLocalDevHost(os.networkInterfaces(), { override });
1060
+ if (resolution.source === "override")
1061
+ return resolution;
1062
+ if (platform === "ios" && iosRunTargetKind === "simulator")
1063
+ return { ...resolution, host: "localhost", source: "platform" };
1064
+ if (platform === "android") {
1065
+ try {
1066
+ const host = getAndroidLocalServerHost(await this.#spawn("adb", ["devices"]), resolution.host);
1067
+ return host === resolution.host ? resolution : { ...resolution, host, source: "platform" };
1068
+ } catch {
1069
+ return resolution;
1070
+ }
1071
+ }
1072
+ return resolution;
1073
+ }
1027
1074
  #logDevHostResolution(resolution, commandEnv) {
1028
1075
  this.app.log(`Mobile live-reload server: ${this.#localCsrUrl(resolution.host, commandEnv)}`);
1029
- if (resolution.source === "override")
1076
+ if (resolution.source === "override" || resolution.source === "platform")
1030
1077
  return;
1031
1078
  const suspicious = resolution.host === "127.0.0.1" || resolution.host.startsWith("169.254.");
1032
1079
  const alternatives = resolution.candidates.filter((candidate) => candidate.address !== resolution.host);
@@ -1226,18 +1273,26 @@ ${error.message}`;
1226
1273
  return await this.app.spawn(command, args, { cwd: this.app.cwdPath, ...options });
1227
1274
  }
1228
1275
  async#spawnMobile(command, args = [], { operation, env }, options = {}) {
1276
+ const { iosRunTargetKind, platform, ...spawnOptions } = options;
1229
1277
  const mobileEnv = { ...await this.#commandEnv(operation, env), ...options.env };
1230
- const configContent = await this.#writeCapacitorConfig({ operation }, mobileEnv);
1278
+ const configContent = await this.#writeCapacitorConfig({ operation, platform: platform ?? this.#inferMobilePlatform(args), iosRunTargetKind }, mobileEnv);
1231
1279
  await this.#writeRootCapacitorConfig(configContent);
1232
1280
  try {
1233
1281
  return await this.#spawn(command, args, {
1234
- ...options,
1282
+ ...spawnOptions,
1235
1283
  env: mobileEnv
1236
1284
  });
1237
1285
  } finally {
1238
1286
  await this.#clearRootCapacitorConfigs();
1239
1287
  }
1240
1288
  }
1289
+ #inferMobilePlatform(args) {
1290
+ if (args.includes("android"))
1291
+ return "android";
1292
+ if (args.includes("ios"))
1293
+ return "ios";
1294
+ return;
1295
+ }
1241
1296
  async addCamera() {
1242
1297
  await this.#setPermissionInIos({
1243
1298
  cameraUsageDescription: "$(PRODUCT_NAME) requires access to the camera to take photos.",
@@ -1339,17 +1394,31 @@ ${error.message}`;
1339
1394
  while (end < lines.length && !/^\s*\};\s*$/.test(lines[end] ?? ""))
1340
1395
  end++;
1341
1396
  const settings = lines.slice(start, end + 1);
1342
- if (settings.some((setting) => setting.includes("CODE_SIGN_ENTITLEMENTS")))
1343
- continue;
1397
+ const configName = lines.slice(end + 1, end + 8).find((setting) => setting.includes("name = ")) ?? "";
1344
1398
  const indent = line.match(/^\s*/)?.[0] ?? "";
1345
- lines.splice(index, 0, `${indent}CODE_SIGN_ENTITLEMENTS = ${entitlementsRelPath};`);
1346
- index++;
1347
- changed = true;
1399
+ const insertSettings = [];
1400
+ if (!settings.some((setting) => setting.includes("CODE_SIGN_ENTITLEMENTS"))) {
1401
+ insertSettings.push(`${indent}CODE_SIGN_ENTITLEMENTS = ${entitlementsRelPath};`);
1402
+ }
1403
+ if (configName.includes("name = Debug;") && !settings.some((setting) => setting.includes("CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION"))) {
1404
+ insertSettings.push(`${indent}CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;`);
1405
+ }
1406
+ if (insertSettings.length > 0) {
1407
+ lines.splice(index, 0, ...insertSettings);
1408
+ index += insertSettings.length;
1409
+ changed = true;
1410
+ }
1348
1411
  }
1349
1412
  if (changed)
1350
1413
  await writeFile(pbxprojPath, lines.join(`
1351
1414
  `));
1352
1415
  }
1416
+ async#setCodeSignEntitlementsInIosIfExists(entitlementsRelPath) {
1417
+ const entitlementsPath = path.join(this.app.cwdPath, this.iosProjectPath, entitlementsRelPath);
1418
+ if (!await Bun.file(entitlementsPath).exists())
1419
+ return;
1420
+ await this.#setCodeSignEntitlementsInIos(entitlementsRelPath);
1421
+ }
1353
1422
  async#setUrlSchemesInAndroid(schemes) {
1354
1423
  const manifestPath = path.join(this.app.cwdPath, this.androidRootPath, "app/src/main/AndroidManifest.xml");
1355
1424
  let manifest = await readFile(manifestPath, "utf8");
@@ -1444,4 +1513,4 @@ ${filter}$1`);
1444
1513
  }
1445
1514
  }
1446
1515
 
1447
- export { SWIFTUICORE_MIN_IOS_MAJOR, rootCapacitorConfigFilenames, rootCapacitorConfigPaths, clearRootCapacitorConfigs, writeRootCapacitorConfig, selectLocalDevHost, parseIosRuntimeMajor, sortIosRunTargets, parseDevicectlDevices, parseSimctlDevices, buildIosNativeRunCommand, classifyIosRunFailure, formatIosRunFailureMessage, sanitizeIosNativeRunEnv, PLACEHOLDER_APP_IDS, isPlaceholderAppId, getMissingAndroidReleaseSigningKeys, formatAndroidReleaseSigningError, getAdbDeviceStateIssues, ANDROID_MIN_SDK_VERSION, raiseGradleMinSdkVersion, assertJsonSerializable, materializeCapacitorConfig, CapacitorApp };
1516
+ export { SWIFTUICORE_MIN_IOS_MAJOR, rootCapacitorConfigFilenames, rootCapacitorConfigPaths, clearRootCapacitorConfigs, writeRootCapacitorConfig, selectLocalDevHost, parseIosRuntimeMajor, sortIosRunTargets, parseDevicectlDevices, parseSimctlDevices, buildIosNativeRunCommand, classifyIosRunFailure, formatIosRunFailureMessage, sanitizeIosNativeRunEnv, PLACEHOLDER_APP_IDS, isPlaceholderAppId, getMissingAndroidReleaseSigningKeys, formatAndroidReleaseSigningError, getAdbDeviceStateIssues, getAndroidLocalServerHost, ANDROID_MIN_SDK_VERSION, raiseGradleMinSdkVersion, assertJsonSerializable, materializeCapacitorConfig, CapacitorApp };
@@ -5,15 +5,17 @@ import {
5
5
  LibExecutor,
6
6
  ModuleExecutor,
7
7
  PkgExecutor,
8
- WorkspaceExecutor,
8
+ WorkspaceExecutor
9
+ } from "./index-8vkkm7v0.js";
10
+ import {
9
11
  getDirname
10
- } from "./index-hgna5rjy.js";
12
+ } from "./index-1577bej2.js";
11
13
  import {
12
14
  FileSys
13
15
  } from "./index-67546d0j.js";
14
16
  import {
15
17
  __require
16
- } from "./index-r24hmh0q.js";
18
+ } from "./index-yb2wsc7f.js";
17
19
 
18
20
  // pkgs/@akanjs/devkit/commandDecorators/targetMeta.ts
19
21
  var COMMAND_META = Symbol("akan.command.meta");
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-8hsbnyes.js";
5
+ } from "./index-n706txcv.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -849,6 +849,7 @@ class ClientEntriesBundler {
849
849
  #externalSubpaths;
850
850
  #externalAliases;
851
851
  #command;
852
+ #target;
852
853
  #outputSubdir;
853
854
  #reactFastRefresh;
854
855
  #artifactDir;
@@ -870,6 +871,7 @@ class ClientEntriesBundler {
870
871
  this.#externalSubpaths = options.externalSubpaths ?? [];
871
872
  this.#externalAliases = options.externalAliases ?? {};
872
873
  this.#command = options.command ?? "start";
874
+ this.#target = options.target ?? "browser";
873
875
  this.#outputSubdir = options.outputSubdir ?? "client";
874
876
  this.#reactFastRefresh = options.reactFastRefresh ?? false;
875
877
  this.#artifactDir = `${this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath}/.akan/artifact`;
@@ -883,7 +885,7 @@ class ClientEntriesBundler {
883
885
  entrypoints: this.#opaqueEntries.entries,
884
886
  outdir: this.#outdir,
885
887
  splitting: true,
886
- target: "browser",
888
+ target: this.#target,
887
889
  format: "esm",
888
890
  naming: CLIENT_BUNDLE_NAMING,
889
891
  metafile: true,
@@ -1117,7 +1119,8 @@ var VENDOR_SPECIFIERS = [
1117
1119
  "akanjs/store",
1118
1120
  "akanjs/base",
1119
1121
  "akanjs/common",
1120
- "akanjs/constant"
1122
+ "akanjs/constant",
1123
+ "akanjs/fetch"
1121
1124
  ];
1122
1125
 
1123
1126
  // pkgs/@akanjs/devkit/frontendBuild/routeClientBuilder.ts
@@ -1143,16 +1146,17 @@ class RouteClientBuilder {
1143
1146
  #knownEntries;
1144
1147
  #command;
1145
1148
  #discovery;
1149
+ #entries;
1146
1150
  constructor(options) {
1147
1151
  this.#app = options.app;
1148
1152
  this.#seeds = options.seeds;
1149
1153
  this.#knownEntries = options.knownEntries ?? new Set;
1150
1154
  this.#command = options.command ?? "start";
1151
1155
  this.#discovery = options.discovery;
1156
+ this.#entries = options.entries;
1152
1157
  }
1153
1158
  async build() {
1154
- const discovery = this.#discovery ?? await GraphClientEntryDiscovery.create(this.#app);
1155
- const discovered = await discovery.discover(this.#seeds);
1159
+ const discovered = this.#entries ?? await (this.#discovery ?? await GraphClientEntryDiscovery.create(this.#app)).discover(this.#seeds);
1156
1160
  const entries = discovered.filter((e) => !this.#knownEntries.has(e));
1157
1161
  if (entries.length === 0)
1158
1162
  return this.#emptyResult(discovered);
@@ -1225,12 +1229,11 @@ class RouteClientBuilder {
1225
1229
  }).bundle();
1226
1230
  }
1227
1231
  async#buildSsrBundle(bootstrapEntries) {
1228
- const externalOptions = RouteClientBuilder.resolveSsrClientExternalOptions(this.#command);
1229
1232
  return new ClientEntriesBundler({
1230
1233
  app: this.#app,
1231
1234
  entries: bootstrapEntries.buildEntries,
1232
1235
  plugins: [await createBarrelImportsPlugin(this.#app)],
1233
- ...externalOptions,
1236
+ ...RouteClientBuilder.resolveSsrClientBundleOptions(this.#command),
1234
1237
  outputSubdir: "client-ssr",
1235
1238
  command: this.#command
1236
1239
  }).bundle();
@@ -1292,15 +1295,16 @@ ${defaultNames.map((name) => `export default ${name};`).join(`
1292
1295
  const serverEntry = RouteClientBuilder.resolveAkanServerEntry();
1293
1296
  return { [Bun.resolveSync("akanjs/fetch", serverEntry)]: "akanjs/fetch" };
1294
1297
  }
1295
- static resolveSsrClientExternalOptions(command) {
1298
+ static resolveSsrClientBundleOptions(command) {
1296
1299
  if (command === "start") {
1297
1300
  return {
1301
+ target: "bun",
1298
1302
  external: SSR_CLIENT_EXTERNALS,
1299
1303
  externalSubpaths: ["akanjs/fetch"],
1300
1304
  externalAliases: RouteClientBuilder.resolveSsrClientRuntimeAliases()
1301
1305
  };
1302
1306
  }
1303
- return { external: SSR_CLIENT_ALIAS_EXTERNALS };
1307
+ return { target: "bun", external: SSR_CLIENT_ALIAS_EXTERNALS };
1304
1308
  }
1305
1309
  static resolveAkanServerEntry() {
1306
1310
  try {
@@ -240,7 +240,7 @@ import { ChatOpenAI } from "@langchain/openai";
240
240
  import { Logger } from "akanjs/common";
241
241
  import chalk from "chalk";
242
242
  var MAX_ASK_TRY = 300;
243
- var deepSeekLlmModels = ["deepseek-chat", "deepseek-reasoner"];
243
+ var deepSeekLlmModels = ["deepseek-v4-flash", "deepseek-v4-pro"];
244
244
  var openAiLlmModels = ["gpt-5.5"];
245
245
  var supportedLlmModels = [...deepSeekLlmModels, ...openAiLlmModels];
246
246
  var isOpenAiLlmModel = (model) => openAiLlmModels.includes(model);
@@ -4,24 +4,17 @@ import {
4
4
  CloudApi,
5
5
  GlobalConfig,
6
6
  getDefaultHostConfig
7
- } from "./index-0cj2zxbm.js";
7
+ } from "./index-sh01r3pm.js";
8
8
  import {
9
9
  openBrowser
10
- } from "./index-e16gnn26.js";
10
+ } from "./index-8d2sv6pw.js";
11
11
  import {
12
12
  runner
13
- } from "./index-8hsbnyes.js";
13
+ } from "./index-n706txcv.js";
14
14
  import {
15
15
  AppExecutor,
16
16
  WorkspaceExecutor
17
- } from "./index-hgna5rjy.js";
18
-
19
- // pkgs/@akanjs/cli/cloud/cloud.runner.ts
20
- import path from "path";
21
- import { confirm, input, select } from "@inquirer/prompts";
22
- import { Logger, sleep } from "akanjs/common";
23
- import chalk from "chalk";
24
- import * as QRcode from "qrcode";
17
+ } from "./index-8vkkm7v0.js";
25
18
 
26
19
  // pkgs/@akanjs/cli/npmRegistry.ts
27
20
  var defaultNpmRegistry = "https://registry.npmjs.org";
@@ -40,6 +33,11 @@ async function getLatestPackageVersion(packageName, tag = "latest", registryUrl)
40
33
  }
41
34
 
42
35
  // pkgs/@akanjs/cli/cloud/cloud.runner.ts
36
+ import path from "path";
37
+ import { confirm, input, select } from "@inquirer/prompts";
38
+ import { Logger, sleep } from "akanjs/common";
39
+ import chalk from "chalk";
40
+ import * as QRcode from "qrcode";
43
41
  var addRemoteEnvServerValue = "__addRemoteEnvServer";
44
42
  var removeRemoteEnvServerValue = "__removeRemoteEnvServer";
45
43
 
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AppExecutor,
4
4
  LibExecutor
5
- } from "./index-hgna5rjy.js";
5
+ } from "./index-8vkkm7v0.js";
6
6
 
7
7
  // pkgs/@akanjs/devkit/workflow/utils.ts
8
8
  var jsonText = (value, { trailingNewline = true } = {}) => `${JSON.stringify(value, null, 2)}${trailingNewline ? `
@@ -4,19 +4,19 @@ import {
4
4
  } from "./index-ss469dec.js";
5
5
  import {
6
6
  AiSession
7
- } from "./index-0cj2zxbm.js";
7
+ } from "./index-sh01r3pm.js";
8
8
  import {
9
9
  createPassedPrimitiveReport,
10
10
  generatedFilesForSync,
11
11
  scalarChangedFiles
12
- } from "./index-rzwcpcc3.js";
12
+ } from "./index-tsmjxph2.js";
13
13
  import {
14
14
  Prompter
15
- } from "./index-tdbas9r0.js";
15
+ } from "./index-j37qq1f2.js";
16
16
  import {
17
17
  runner,
18
18
  script
19
- } from "./index-8hsbnyes.js";
19
+ } from "./index-n706txcv.js";
20
20
 
21
21
  // pkgs/@akanjs/cli/scalar/scalar.prompt.ts
22
22
  import { input } from "@inquirer/prompts";
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  AkanContextAnalyzer
4
- } from "./index-a00jg8x8.js";
4
+ } from "./index-g9e2fhw2.js";
5
5
  import {
6
6
  createRepairReport,
7
7
  generatedFilePathsForTarget,
8
8
  renderRepairReport,
9
9
  writeGeneratedSyncState,
10
10
  writeWorkflowRunArtifact
11
- } from "./index-rzwcpcc3.js";
11
+ } from "./index-tsmjxph2.js";
12
12
  import {
13
13
  runner
14
- } from "./index-8hsbnyes.js";
14
+ } from "./index-n706txcv.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/repair/repair.runner.ts
17
17
  var commandForShell = (command) => command.startsWith("akan ") ? `bun run ${command}` : command;
package/index.js CHANGED
@@ -4,35 +4,36 @@ import {
4
4
  getTargetCommandNames,
5
5
  getTargetMetas,
6
6
  runCommands
7
- } from "./index-8hsbnyes.js";
8
- import"./index-hgna5rjy.js";
7
+ } from "./index-n706txcv.js";
8
+ import"./index-8vkkm7v0.js";
9
9
  import"./index-mxvakhsm.js";
10
+ import"./index-1577bej2.js";
10
11
  import"./index-67546d0j.js";
11
12
  import {
12
13
  __require
13
- } from "./index-r24hmh0q.js";
14
+ } from "./index-yb2wsc7f.js";
14
15
 
15
16
  // pkgs/@akanjs/cli/commandManifest.ts
16
17
  import path from "path";
17
18
 
18
19
  // pkgs/@akanjs/cli/commandModules.ts
19
20
  var commandModules = {
20
- workspace: async () => (await import("./workspace.command-fpda0evj.js")).WorkspaceCommand,
21
- agent: async () => (await import("./agent.command-yv00p0s0.js")).AgentCommand,
22
- application: async () => (await import("./application.command-0qsczf4k.js")).ApplicationCommand,
23
- library: async () => (await import("./library.command-ebdj1vnm.js")).LibraryCommand,
24
- localRegistry: async () => (await import("./localRegistry.command-gb178ne8.js")).LocalRegistryCommand,
25
- package: async () => (await import("./package.command-t93p4jkj.js")).PackageCommand,
26
- module: async () => (await import("./module.command-9c1bnsx4.js")).ModuleCommand,
27
- page: async () => (await import("./page.command-k3k0meh2.js")).PageCommand,
28
- context: async () => (await import("./context.command-8d9e3k6b.js")).ContextCommand,
29
- cloud: async () => (await import("./cloud.command-dxfv18sa.js")).CloudCommand,
30
- guideline: async () => (await import("./guideline.command-3jbkxzh6.js")).GuidelineCommand,
31
- scalar: async () => (await import("./scalar.command-7a2jtv33.js")).ScalarCommand,
32
- primitive: async () => (await import("./primitive.command-de6nktdt.js")).PrimitiveCommand,
33
- quality: async () => (await import("./quality.command-z5kth2wa.js")).QualityCommand,
34
- repair: async () => (await import("./repair.command-ehf2g112.js")).RepairCommand,
35
- workflow: async () => (await import("./workflow.command-e0tt0vk2.js")).WorkflowCommand
21
+ workspace: async () => (await import("./workspace.command-f7jerqb2.js")).WorkspaceCommand,
22
+ agent: async () => (await import("./agent.command-e835fjem.js")).AgentCommand,
23
+ application: async () => (await import("./application.command-sjtbk6tr.js")).ApplicationCommand,
24
+ library: async () => (await import("./library.command-v5cyaw9t.js")).LibraryCommand,
25
+ localRegistry: async () => (await import("./localRegistry.command-53t758pt.js")).LocalRegistryCommand,
26
+ package: async () => (await import("./package.command-qkcs60ts.js")).PackageCommand,
27
+ module: async () => (await import("./module.command-pq6w84xg.js")).ModuleCommand,
28
+ page: async () => (await import("./page.command-qj5bfnh9.js")).PageCommand,
29
+ context: async () => (await import("./context.command-vn87jb08.js")).ContextCommand,
30
+ cloud: async () => (await import("./cloud.command-y0e4eyqz.js")).CloudCommand,
31
+ guideline: async () => (await import("./guideline.command-s4hn2bsy.js")).GuidelineCommand,
32
+ scalar: async () => (await import("./scalar.command-rm6k3c65.js")).ScalarCommand,
33
+ primitive: async () => (await import("./primitive.command-bw0nes6x.js")).PrimitiveCommand,
34
+ quality: async () => (await import("./quality.command-f8drhx6c.js")).QualityCommand,
35
+ repair: async () => (await import("./repair.command-mzwtejpk.js")).RepairCommand,
36
+ workflow: async () => (await import("./workflow.command-g2cgcgxn.js")).WorkflowCommand
36
37
  };
37
38
  var commandModuleIds = Object.keys(commandModules);
38
39
 
@@ -1,16 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  LibraryScript
4
- } from "./index-7c6k4yvg.js";
4
+ } from "./index-73rnbwgg.js";
5
5
  import {
6
6
  Lib,
7
7
  Workspace,
8
8
  command
9
- } from "./index-8hsbnyes.js";
10
- import"./index-hgna5rjy.js";
9
+ } from "./index-n706txcv.js";
10
+ import"./index-8vkkm7v0.js";
11
11
  import"./index-mxvakhsm.js";
12
+ import"./index-1577bej2.js";
12
13
  import"./index-67546d0j.js";
13
- import"./index-r24hmh0q.js";
14
+ import"./index-yb2wsc7f.js";
14
15
 
15
16
  // pkgs/@akanjs/cli/library/library.command.ts
16
17
  class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({