@akanjs/cli 3.0.0-beta.2 → 3.0.0-beta.21

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 (190) hide show
  1. package/.build-stamp +1 -1
  2. package/CodeAgent-q2m47rqp.js +9 -0
  3. package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
  4. package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
  5. package/CodeTui-pdqhc3sn.js +1457 -0
  6. package/README.md +3 -0
  7. package/TunnelShare-scf4e4pd.js +9 -0
  8. package/{agent.command-d2gfxfck.js → agent.command-ttn09rx3.js} +8 -9
  9. package/akanCode.js +102 -0
  10. package/application.command-7gweenv7.js +179 -0
  11. package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-38exmejd.js} +63 -64
  12. package/buildBatch.proc.js +26 -25
  13. package/cloud.command-bhztw7c2.js +95 -0
  14. package/cloud.script-aabyhgba.js +20 -0
  15. package/code.command-6s8c0k91.js +154 -0
  16. package/commandManifest.json +1 -1
  17. package/consoleToStderr-h5bryj94.js +7 -0
  18. package/context.command-phmgywt2.js +48 -0
  19. package/context.runner-yvyw5g2d.js +21 -0
  20. package/{dependencyScanner-shs82ynp.js → dependencyScanner-ye2e6pdz.js} +2 -2
  21. package/{devTui-40ggmd99.js → devTui-q7k7bakd.js} +122 -40
  22. package/fileSys-5ngz93ga.js +9 -0
  23. package/guideline.command-7jk47fgq.js +42 -0
  24. package/guidelines/agentRule/agentRule.instruction.md +209 -28
  25. package/guidelines/conventions/conventions.instruction.md +96 -29
  26. package/guidelines/fieldRule/fieldRule.instruction.md +1 -0
  27. package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
  28. package/guidelines/queryRule/queryRule.instruction.md +17 -7
  29. package/guidelines/runtimeRule/runtimeRule.instruction.md +77 -3
  30. package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
  31. package/guidelines/transportRule/transportRule.instruction.md +51 -0
  32. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +66 -3
  33. package/incrementalBuilder.proc.js +31 -48
  34. package/{index-h7yw2z9n.js → index-0bq14vr1.js} +8 -14
  35. package/{index-259dsnz3.js → index-1db2cw0y.js} +5 -8
  36. package/index-22d57v4c.js +266 -0
  37. package/index-3hx1z96c.js +87 -0
  38. package/{index-kcxmv48c.js → index-3t7g9e4r.js} +45 -79
  39. package/{index-ne2qy0nk.js → index-4dn1p115.js} +12 -12
  40. package/{index-q0y2jq9j.js → index-5b6tavv3.js} +6 -3
  41. package/index-7cqjvraf.js +69 -0
  42. package/index-7md2g9vw.js +6 -0
  43. package/{index-zry5nz81.js → index-8kb5p54p.js} +51 -30
  44. package/{index-ktb5njgy.js → index-9629w7ns.js} +49 -99
  45. package/index-9dp031by.js +12 -0
  46. package/{index-a64esmtb.js → index-aadpbnt2.js} +172 -308
  47. package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
  48. package/index-c6eggbee.js +123 -0
  49. package/index-d0arnrm8.js +700 -0
  50. package/index-d2242ksy.js +99 -0
  51. package/{index-600zhnve.js → index-dg97qp24.js} +70 -200
  52. package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
  53. package/{index-w8kmx1b6.js → index-fgq75haa.js} +198 -290
  54. package/{index-2tv3fdx4.js → index-ga6hygxr.js} +944 -1333
  55. package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
  56. package/index-hr5n7t4x.js +465 -0
  57. package/{index-hwkygn9s.js → index-khpfpcsd.js} +302 -33
  58. package/{index-7737gxcp.js → index-m0ms3n1c.js} +107 -241
  59. package/{index-ws5e0j51.js → index-mgfx3mfs.js} +43 -26
  60. package/index-p6pbz9n5.js +25 -0
  61. package/index-pp54p5zk.js +53 -0
  62. package/{index-j9yhg404.js → index-q44jbw48.js} +4 -7
  63. package/{index-mak3cd28.js → index-rmcw8yc8.js} +137 -255
  64. package/{index-pnqbkf5p.js → index-rnt66vym.js} +6 -2
  65. package/index-smme4r47.js +49 -0
  66. package/index-tgjy8xf3.js +187 -0
  67. package/index-v5eayqqw.js +2729 -0
  68. package/index-wa5jbxj1.js +760 -0
  69. package/{index-4edzf1gr.js → index-wp43xrjv.js} +77 -150
  70. package/{index-fz5q3gd7.js → index-ya5qbmyg.js} +10 -17
  71. package/index-yjkte9aj.js +1119 -0
  72. package/{index-gyd220p2.js → index-yy4s1j72.js} +554 -577
  73. package/{index-v0qh106m.js → index-z50k041j.js} +580 -862
  74. package/index.js +23 -22
  75. package/{library.command-nbsky672.js → library.command-ccb1cp92.js} +4 -5
  76. package/{localRegistry.command-yeq57wjr.js → localRegistry.command-ajb9n87j.js} +23 -42
  77. package/{module.command-29vqzrh8.js → module.command-5k6h407d.js} +8 -11
  78. package/{package.command-axv0abmn.js → package.command-e6ntvpez.js} +6 -7
  79. package/package.json +14 -6
  80. package/{page.command-vs9s3zrh.js → page.command-v4f90wb8.js} +4 -5
  81. package/{primitive.command-cbxmqbtc.js → primitive.command-g6km57q5.js} +9 -22
  82. package/prompter-ptaa3nk0.js +8 -0
  83. package/{quality.command-gmbs7nws.js → quality.command-de3p36pz.js} +205 -377
  84. package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
  85. package/{repair.command-bqsjptsj.js → repair.command-d3x1javq.js} +11 -35
  86. package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
  87. package/{scalar.command-6k1vhe9s.js → scalar.command-7ezrac2b.js} +7 -10
  88. package/skills/akan-code/SKILL.md +130 -0
  89. package/skills/akan-debug/SKILL.md +42 -0
  90. package/skills/akan-deps/SKILL.md +50 -0
  91. package/skills/akan-err/SKILL.md +39 -0
  92. package/skills/akan-module/SKILL.md +45 -0
  93. package/skills/akan-scaffold/SKILL.md +76 -0
  94. package/skills/akan-scalar/SKILL.md +52 -0
  95. package/skills/akan-service/SKILL.md +34 -0
  96. package/skills/akan-store/SKILL.md +67 -0
  97. package/skills/akan-ui/SKILL.md +63 -0
  98. package/skills/akan-validate/SKILL.md +44 -0
  99. package/{subspace.command-fwjfcts7.js → subspace.command-ps71ynp6.js} +138 -67
  100. package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
  101. package/templates/appSample/lib/__scalar/workHistory/workHistory.abstract.ts +8 -39
  102. package/templates/appSample/lib/_noti/noti.abstract.ts +6 -29
  103. package/templates/appSample/lib/task/task.abstract.ts +12 -32
  104. package/templates/appSample/lib/task/task.signal.spec.ts +15 -18
  105. package/templates/appSample/lib/task/task.signal.test.ts +15 -1
  106. package/templates/appSample/lib/task/task.signal.ts +1 -1
  107. package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +7 -4
  108. package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +6 -4
  109. package/templates/client.ts +7 -30
  110. package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -1
  111. package/templates/crudPages/[__model__Id]/page.tsx +2 -1
  112. package/templates/crudPages/new/page.tsx +2 -1
  113. package/templates/crudPages/page.tsx +2 -1
  114. package/templates/crudSinglePage/page.tsx +2 -1
  115. package/templates/lib/__lib/lib.dictionary.ts +0 -2
  116. package/templates/lib/__lib/lib.document.ts +0 -2
  117. package/templates/lib/sig.ts +8 -30
  118. package/templates/localDev/docker-compose.yaml.template +3 -14
  119. package/templates/module/__model__.signal.ts +12 -4
  120. package/templates/pkgRoot/tsconfig.json.template +2 -7
  121. package/templates/server.ts +0 -2
  122. package/templates/service/__model__.abstract.md.template +8 -0
  123. package/templates/workspaceRoot/.gitignore.template +0 -1
  124. package/tunnel.command-hsrv2mny.js +129 -0
  125. package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
  126. package/typecheck.proc.js +1 -1
  127. package/workflow.command-z2p32nmf.js +79 -0
  128. package/{workspace.command-8s050m0h.js → workspace.command-tmdqkrh0.js} +77 -109
  129. package/abstractCompactor-mjh5ppsq.js +0 -101
  130. package/application.command-pj2m7584.js +0 -204
  131. package/applicationReleasePackager-4yasxwv9.js +0 -244
  132. package/capacitorApp-36rbr858.js +0 -12
  133. package/cloud.command-jshwdq22.js +0 -93
  134. package/context.command-ez8a0zyz.js +0 -80
  135. package/devTuiView-c08ccbat.js +0 -9
  136. package/getDirname-dr3jz1xg.js +0 -7
  137. package/guideline.command-xmqwx8zm.js +0 -359
  138. package/guidelines/agentRule/agentRule.generate.json +0 -31
  139. package/guidelines/componentRule/componentRule.generate.json +0 -31
  140. package/guidelines/conventions/conventions.generate.json +0 -25
  141. package/guidelines/cssRule/cssRule.generate.json +0 -31
  142. package/guidelines/docPageRule/docPageRule.generate.json +0 -31
  143. package/guidelines/docPageRule/docPageRule.instruction.md +0 -25
  144. package/guidelines/docSyncRule/docSyncRule.generate.json +0 -31
  145. package/guidelines/docSyncRule/docSyncRule.instruction.md +0 -25
  146. package/guidelines/enumConstant/enumConstant.generate.json +0 -31
  147. package/guidelines/enumConstant/enumConstant.instruction.md +0 -28
  148. package/guidelines/fieldRule/fieldRule.generate.json +0 -31
  149. package/guidelines/framework/framework.generate.json +0 -32
  150. package/guidelines/mcpRule/mcpRule.generate.json +0 -35
  151. package/guidelines/modelConstant/modelConstant.generate.json +0 -32
  152. package/guidelines/modelDictionary/modelDictionary.generate.json +0 -32
  153. package/guidelines/modelDocument/modelDocument.generate.json +0 -31
  154. package/guidelines/modelService/modelService.generate.json +0 -31
  155. package/guidelines/modelSignal/modelSignal.generate.json +0 -31
  156. package/guidelines/modelStore/modelStore.generate.json +0 -31
  157. package/guidelines/modelTemplate/modelTemplate.generate.json +0 -31
  158. package/guidelines/modelUnit/modelUnit.generate.json +0 -31
  159. package/guidelines/modelUtil/modelUtil.generate.json +0 -31
  160. package/guidelines/modelView/modelView.generate.json +0 -31
  161. package/guidelines/modelZone/modelZone.generate.json +0 -31
  162. package/guidelines/moduleCodegen/moduleCodegen.generate.json +0 -31
  163. package/guidelines/moduleCodegen/moduleCodegen.instruction.md +0 -28
  164. package/guidelines/moduleOverview/moduleOverview.generate.json +0 -31
  165. package/guidelines/queryRule/queryRule.generate.json +0 -31
  166. package/guidelines/recipeRule/recipeRule.generate.json +0 -31
  167. package/guidelines/runtimeRule/runtimeRule.generate.json +0 -25
  168. package/guidelines/scalarConstant/scalarConstant.generate.json +0 -32
  169. package/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -32
  170. package/guidelines/scalarModule/scalarModule.generate.json +0 -31
  171. package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -31
  172. package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -25
  173. package/guidelines/ssrRule/ssrRule.generate.json +0 -31
  174. package/guidelines/transportRule/transportRule.generate.json +0 -31
  175. package/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -31
  176. package/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -25
  177. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +0 -24
  178. package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +0 -33
  179. package/index-2hq52jq3.js +0 -465
  180. package/index-47pj3aee.js +0 -76
  181. package/index-6wwzs1bc.js +0 -7
  182. package/index-8pm30m73.js +0 -841
  183. package/index-kn1h7p1x.js +0 -560
  184. package/index-meh558jy.js +0 -65
  185. package/index-rwg2aa4f.js +0 -229
  186. package/index-wt7qrtd4.js +0 -1516
  187. package/templates/__scalar/__model__/__model__.abstract.md +0 -28
  188. package/templates/module/__model__.abstract.md +0 -28
  189. package/templates/service/__model__.abstract.md +0 -28
  190. package/workflow.command-nwpcdc8p.js +0 -107
package/README.md CHANGED
@@ -74,6 +74,9 @@ artifact is built last and is not overwritten by the root `akan` bootstrap scrip
74
74
  - Use `@akanjs/cli` as the user-facing executable package.
75
75
  - `@akanjs/devkit` is bundled into the CLI for published CLI usage; it is not required as a separate
76
76
  runtime dependency for ordinary CLI users.
77
+ - The `akan code` agent follows that same split: its engine, tools and skills are a devkit facet
78
+ (`@akanjs/devkit/codeAgent`), and `@akanjs/cli/code` is the terminal host plus the SDK entry that
79
+ re-exports both.
77
80
 
78
81
  ## Requirements
79
82
 
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-smme4r47.js";
5
+ import"./index-22d57v4c.js";
6
+ import"./index-5b6tavv3.js";
7
+ export {
8
+ TunnelShare2 as TunnelShare
9
+ };
@@ -2,17 +2,16 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-mak3cd28.js";
6
- import"./index-q0y2jq9j.js";
7
- import"./index-2tv3fdx4.js";
8
- import"./index-6wwzs1bc.js";
9
- import"./index-by5gpp8x.js";
10
- import"./index-gyd220p2.js";
11
- import"./index-ktb5njgy.js";
12
- import"./index-h7yw2z9n.js";
5
+ } from "./index-rmcw8yc8.js";
6
+ import"./index-5b6tavv3.js";
7
+ import"./index-ga6hygxr.js";
8
+ import"./index-hj6w4ka1.js";
9
+ import"./index-yy4s1j72.js";
10
+ import"./index-9629w7ns.js";
11
+ import"./index-0bq14vr1.js";
13
12
  import {
14
13
  AgentScript
15
- } from "./index-ne2qy0nk.js";
14
+ } from "./index-4dn1p115.js";
16
15
 
17
16
  // pkgs/@akanjs/cli/agent/agent.command.ts
18
17
  class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
package/akanCode.js ADDED
@@ -0,0 +1,102 @@
1
+ // @bun
2
+ import {
3
+ AkanEditScope2,
4
+ DevLogFeedback2,
5
+ PreviewChrome2,
6
+ PreviewView2,
7
+ PreviewFeedback2,
8
+ TurnFeedback2,
9
+ AkanCli2,
10
+ AkanVerifier2,
11
+ VerifyFeedback2,
12
+ AkanToolPack2,
13
+ MailToolPack2,
14
+ McpUnauthorized2,
15
+ McpClient2,
16
+ McpToolPack2,
17
+ SessionToolPack2,
18
+ WebToolPack2,
19
+ AkanCodePlugins2,
20
+ AkanEnvKeys2,
21
+ akanSystemPrompt2,
22
+ CodeSessionIndex2,
23
+ AkanCodeServices2,
24
+ CodeAgentAsks2,
25
+ CodeAgentEventMapper2,
26
+ CodeAgentGate2,
27
+ CodeAgentUi2,
28
+ CodeMailbox2,
29
+ CodeSessionFork2,
30
+ CodeAgent2
31
+ } from "./index-v5eayqqw.js";
32
+ import {
33
+ akanCodeDefaultModel2,
34
+ akanCodeModel2,
35
+ akanCodeModelSupportsImages2,
36
+ akanCodeModelWarnings2,
37
+ CodeAgentStreamPrinter2
38
+ } from "./index-c6eggbee.js";
39
+ import {
40
+ SubagentPool2,
41
+ akanCodePaths2
42
+ } from "./index-d0arnrm8.js";
43
+ import"./index-7md2g9vw.js";
44
+ import {
45
+ CodeAgentRpcHost2
46
+ } from "./index-d2242ksy.js";
47
+ import {
48
+ CodeTuiLines2,
49
+ CodeTuiAgents2,
50
+ CodeTuiClipboard2,
51
+ CodeTuiCommands2,
52
+ CodeTuiEditor2,
53
+ CodeTuiFiles2,
54
+ CodeTuiMarkdown2,
55
+ CodeTuiParts2
56
+ } from "./index-wa5jbxj1.js";
57
+ export {
58
+ AkanCli2 as AkanCli,
59
+ AkanCodePlugins2 as AkanCodePlugins,
60
+ AkanCodeServices2 as AkanCodeServices,
61
+ AkanEditScope2 as AkanEditScope,
62
+ AkanEnvKeys2 as AkanEnvKeys,
63
+ AkanToolPack2 as AkanToolPack,
64
+ AkanVerifier2 as AkanVerifier,
65
+ CodeAgent2 as CodeAgent,
66
+ CodeAgentAsks2 as CodeAgentAsks,
67
+ CodeAgentEventMapper2 as CodeAgentEventMapper,
68
+ CodeAgentGate2 as CodeAgentGate,
69
+ CodeAgentRpcHost2 as CodeAgentRpcHost,
70
+ CodeAgentStreamPrinter2 as CodeAgentStreamPrinter,
71
+ CodeAgentUi2 as CodeAgentUi,
72
+ CodeMailbox2 as CodeMailbox,
73
+ CodeSessionFork2 as CodeSessionFork,
74
+ CodeSessionIndex2 as CodeSessionIndex,
75
+ CodeTuiAgents2 as CodeTuiAgents,
76
+ CodeTuiClipboard2 as CodeTuiClipboard,
77
+ CodeTuiCommands2 as CodeTuiCommands,
78
+ CodeTuiEditor2 as CodeTuiEditor,
79
+ CodeTuiFiles2 as CodeTuiFiles,
80
+ CodeTuiLines2 as CodeTuiLines,
81
+ CodeTuiMarkdown2 as CodeTuiMarkdown,
82
+ CodeTuiParts2 as CodeTuiParts,
83
+ DevLogFeedback2 as DevLogFeedback,
84
+ MailToolPack2 as MailToolPack,
85
+ McpClient2 as McpClient,
86
+ McpToolPack2 as McpToolPack,
87
+ McpUnauthorized2 as McpUnauthorized,
88
+ PreviewChrome2 as PreviewChrome,
89
+ PreviewFeedback2 as PreviewFeedback,
90
+ PreviewView2 as PreviewView,
91
+ SessionToolPack2 as SessionToolPack,
92
+ SubagentPool2 as SubagentPool,
93
+ TurnFeedback2 as TurnFeedback,
94
+ VerifyFeedback2 as VerifyFeedback,
95
+ WebToolPack2 as WebToolPack,
96
+ akanCodeDefaultModel2 as akanCodeDefaultModel,
97
+ akanCodeModel2 as akanCodeModel,
98
+ akanCodeModelSupportsImages2 as akanCodeModelSupportsImages,
99
+ akanCodeModelWarnings2 as akanCodeModelWarnings,
100
+ akanCodePaths2 as akanCodePaths,
101
+ akanSystemPrompt2 as akanSystemPrompt
102
+ };
@@ -0,0 +1,179 @@
1
+ // @bun
2
+ import {
3
+ App,
4
+ Apps,
5
+ Sys,
6
+ Exec,
7
+ Workspace,
8
+ command
9
+ } from "./index-rmcw8yc8.js";
10
+ import"./index-5b6tavv3.js";
11
+ import"./index-ga6hygxr.js";
12
+ import {
13
+ getMobileTargetChoices
14
+ } from "./index-hr5n7t4x.js";
15
+ import"./index-khpfpcsd.js";
16
+ import"./index-1db2cw0y.js";
17
+ import {
18
+ ApplicationScript
19
+ } from "./index-z50k041j.js";
20
+ import"./index-7md2g9vw.js";
21
+ import"./index-q44jbw48.js";
22
+
23
+ // pkgs/@akanjs/cli/application/application.command.ts
24
+ var mobileTargetOption = {
25
+ desc: "mobile target name or all",
26
+ ask: "Select mobile target",
27
+ enum: async ({ app }) => await getMobileTargetChoices(app)
28
+ };
29
+ var deviceOption = {
30
+ desc: "simulator, emulator or device to run on: its id or name (e.g. 'iPhone 17' or 'Pixel_10')",
31
+ default: ""
32
+ };
33
+ var teamOption = { flag: "T", desc: "Apple team id the signing is narrowed to", default: "" };
34
+ var devEnvs = ["local", "debug", "develop", "main"];
35
+ var buildEnvOption = { enum: devEnvs, desc: "backend environment", default: "debug" };
36
+ var startEnvOption = { enum: devEnvs, desc: "backend environment", default: "local" };
37
+ var releaseEnvOption = {
38
+ enum: ["debug", "develop", "main", "local"],
39
+ desc: "backend environment",
40
+ default: "main"
41
+ };
42
+
43
+ class ApplicationCommand extends command("application", [ApplicationScript], ({ public: target }) => ({
44
+ createApplication: target({ desc: "Create a new application in the workspace" }).arg("appName", String, { desc: "name of application" }).option("start", Boolean, { desc: "start application", default: false }).with(Workspace).exec(async function(appName, start, workspace) {
45
+ await this.applicationScript.createApplication(appName.toLowerCase().replace(/ /g, "-"), workspace, { start });
46
+ }),
47
+ removeApplication: target({ desc: "Remove an application from the workspace" }).with(App).exec(async function(app) {
48
+ await this.applicationScript.removeApplication(app);
49
+ }),
50
+ planSlice: target({ desc: "List the exact files an app needs to live in a workspace of its own" }).with(App).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).exec(async function(app, format) {
51
+ await this.applicationScript.planSlice(app, format);
52
+ }),
53
+ sync: target({ desc: "Sync dependencies and configuration for an app or library" }).with(Sys).exec(async function(sys) {
54
+ await this.applicationScript.sync(sys);
55
+ }),
56
+ script: target({ desc: "Run a custom script in the application" }).with(App).arg("filename", String, { desc: "name of script", nullable: true }).exec(async function(app, filename) {
57
+ await this.applicationScript.script(app, filename);
58
+ }),
59
+ console: target({ desc: "Open an interactive server console for the application" }).with(App).exec(async function(app) {
60
+ await this.applicationScript.console(app);
61
+ }),
62
+ logs: target({ desc: "Tail the running application's logs, filtered (attaches to akan-control.sock)" }).with(App).option("level", String, { desc: "minimum level: trace, verbose, debug, info, warn, error", nullable: true }).option("grep", String, { desc: "substring the message must contain", nullable: true }).option("endpoint", String, {
63
+ desc: "endpoint glob(s), comma-separated: mutation:*, query:userList",
64
+ nullable: true
65
+ }).option("trace", String, { desc: "one request's traceId", nullable: true }).option("child", String, { desc: "replica index(es), comma-separated", nullable: true }).option("role", String, {
66
+ flag: "R",
67
+ desc: "process role(s): gateway, federation, batch, all, rsc-worker",
68
+ nullable: true
69
+ }).option("origin", String, { desc: "call origin(s): http, websocket, mcp, internal, page", nullable: true }).option("since", String, {
70
+ desc: "only records newer than this: a duration ago in ms, s, m, h or d (30s, 5m, 2h), or an epoch-ms timestamp",
71
+ nullable: true
72
+ }).option("replay", Number, { flag: "n", desc: "records to replay from the buffer before following", default: 0 }).option("json", Boolean, { desc: "print NDJSON records instead of rendered lines", default: false }).option("follow", Boolean, { desc: "keep streaming; pass --follow false for history only", default: true }).option("runtimeDir", String, {
73
+ flag: "d",
74
+ desc: "runtime dir holding akan-control.sock (default: local/apps/<app>/runtime)",
75
+ nullable: true
76
+ }).exec(async function(app, level, grep, endpoint, trace, child, role, origin, since, replay, json, follow, runtimeDir) {
77
+ await this.applicationScript.logs(app, {
78
+ level,
79
+ grep,
80
+ endpoint,
81
+ trace,
82
+ child,
83
+ role,
84
+ origin,
85
+ since,
86
+ replay,
87
+ json,
88
+ follow,
89
+ runtimeDir
90
+ });
91
+ }),
92
+ build: target({ short: true, desc: "Build the application for production (frontend + backend)" }).with(App).option("write", Boolean, { desc: "write code generation", default: true }).option("fast", Boolean, { desc: "fast build", default: false }).option("quiet", Boolean, { desc: "hide build progress output", default: false }).exec(async function(app, write, fast, quiet) {
93
+ await this.applicationScript.build(app, { write, fast, quiet });
94
+ }),
95
+ typecheck: target({ short: true, desc: "Typecheck the application" }).with(App).option("write", Boolean, { desc: "write code generation", default: true }).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).exec(async function(app, write, clean, incremental) {
96
+ await this.applicationScript.typecheck(app, { write, clean, incremental });
97
+ }),
98
+ test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(exec, write) {
99
+ await this.applicationScript.test(exec, { write });
100
+ }),
101
+ buildIos: target({ short: true, desc: "Build the iOS app on the native runtime" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, write) {
102
+ await this.applicationScript.buildIos(app, { target, env, profile: debug ? "debug" : "release", write });
103
+ }),
104
+ buildAndroid: target({ short: true, desc: "Build the Android app (apk) on the native runtime" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, write) {
105
+ await this.applicationScript.buildAndroid(app, { target, env, profile: debug ? "debug" : "release", write });
106
+ }),
107
+ start: target({ short: true, desc: "Start development server(s) (frontend SSR + backend)" }).with(Apps).option("plain", Boolean, { desc: "print prefixed lines instead of the full-screen view", default: false }).option("kill", Boolean, { flag: "k", desc: "free the dev ports first, whoever is holding them", default: false }).option("concurrency", Number, {
108
+ desc: "apps to boot at a time (default: what this machine's memory and cores allow)",
109
+ nullable: true
110
+ }).option("dbup", Boolean, { desc: "start the local database first", default: true }).option("open", Boolean, { desc: "open web browser?", default: false }).option("share", Boolean, { desc: "also share each app on a public URL through an akan tunnel", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(apps, plain, kill, concurrency, dbup, open, share, write) {
111
+ await this.applicationScript.start(apps, { plain, kill, concurrency, dbup, open, share, write });
112
+ }),
113
+ startIos: target({ short: true, desc: "Run the iOS app in a simulator or on an iPhone, following `akan start`" }).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("device", String, deviceOption).option("team", String, teamOption).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, device, team, write) {
114
+ await this.applicationScript.startIos(app, {
115
+ target,
116
+ env,
117
+ operation: release ? "release" : "local",
118
+ device: device || undefined,
119
+ teamId: team || undefined,
120
+ write
121
+ });
122
+ }),
123
+ startAndroid: target({
124
+ short: true,
125
+ desc: "Run the Android app in an emulator or on a device, following `akan start`"
126
+ }).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("device", String, deviceOption).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, device, write) {
127
+ await this.applicationScript.startAndroid(app, {
128
+ target,
129
+ env,
130
+ operation: release ? "release" : "local",
131
+ device: device || undefined,
132
+ write
133
+ });
134
+ }),
135
+ startDesktop: target({
136
+ short: true,
137
+ desc: "Run the desktop app on this computer (macOS, Windows or Linux), following `akan start`"
138
+ }).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, write) {
139
+ await this.applicationScript.startDesktop(app, { target, env, operation: release ? "release" : "local", write });
140
+ }),
141
+ releaseIos: target({ desc: "Build and sign the iOS app for the App Store (.ipa)" }).with(App).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("team", String, teamOption).option("adHoc", Boolean, { desc: "sign with an ad-hoc profile instead of app-store", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, target, env, team, adHoc, write, allowLocalRelease) {
142
+ await this.applicationScript.releaseIos(app, {
143
+ target,
144
+ env,
145
+ teamId: team || undefined,
146
+ adHoc,
147
+ write,
148
+ allowLocalRelease
149
+ });
150
+ }),
151
+ releaseAndroid: target({ desc: "Build and sign the Android app for the Play Store (aab, or apk)" }).with(App).option("assembleType", String, { enum: ["aab", "apk"], default: "aab" }).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, assembleType, target, env, write, allowLocalRelease) {
152
+ await this.applicationScript.releaseAndroid(app, assembleType, {
153
+ target,
154
+ env,
155
+ write,
156
+ allowLocalRelease
157
+ });
158
+ }),
159
+ dbup: target({ desc: "Start local database services for a database mode" }).with(Workspace).option("mode", String, {
160
+ desc: "database mode; left out, every mode the workspace's apps declare",
161
+ enum: ["single", "multiple", "cluster"],
162
+ nullable: true
163
+ }).exec(async function(workspace, mode) {
164
+ await this.applicationScript.dbupDeclared(workspace, mode);
165
+ }),
166
+ dbExport: target({ desc: "Write every model table of an app to one NDJSON file each" }).with(App).option("dir", String, { desc: "directory under the workspace to write", default: "local/transfer" }).exec(async function(app, dir) {
167
+ await this.applicationScript.transferDatabase(app, "export", dir);
168
+ }),
169
+ dbImport: target({ desc: "Read files db-export wrote into an app's database, in the mode the shell names" }).with(App).option("dir", String, { desc: "directory under the workspace to read", default: "local/transfer" }).exec(async function(app, dir) {
170
+ await this.applicationScript.transferDatabase(app, "import", dir);
171
+ }),
172
+ dbdown: target({ desc: "Stop local database services" }).with(Workspace).exec(async function(workspace) {
173
+ await this.applicationScript.dbdown(workspace);
174
+ })
175
+ })) {
176
+ }
177
+ export {
178
+ ApplicationCommand
179
+ };
@@ -1,17 +1,16 @@
1
1
  // @bun
2
2
  import {
3
3
  Spinner
4
- } from "./index-2tv3fdx4.js";
4
+ } from "./index-ga6hygxr.js";
5
5
  import {
6
6
  AllRoutesBuilder,
7
7
  CsrArtifactBuilder,
8
8
  FontPruner,
9
9
  precompressArtifacts,
10
10
  SsrBaseArtifactBuilder
11
- } from "./index-a64esmtb.js";
12
- import"./index-w8kmx1b6.js";
13
- import"./index-q0y2jq9j.js";
14
- import"./index-hwkygn9s.js";
11
+ } from "./index-aadpbnt2.js";
12
+ import"./index-fgq75haa.js";
13
+ import"./index-5b6tavv3.js";
15
14
  import"./index-n68jx79w.js";
16
15
 
17
16
  // pkgs/@akanjs/devkit/applicationBuildRunner.ts
@@ -51,6 +50,7 @@ class ApplicationBuildRunner {
51
50
  #app;
52
51
  #fast;
53
52
  #reporter;
53
+ #spinner;
54
54
  #startedAt = Date.now();
55
55
  #phases = [];
56
56
  constructor(app, { fast = false, reporter } = {}) {
@@ -59,21 +59,17 @@ class ApplicationBuildRunner {
59
59
  this.#reporter = reporter;
60
60
  }
61
61
  async build({ spinner = false } = {}) {
62
- const phaseOptions = { spinner };
62
+ this.#spinner = spinner;
63
63
  const { web, assets } = await this.#app.getConfig();
64
- await this.#runPhase("prepare", "Preparing output directory", () => this.#app.prepareCommand("build"), undefined, {
65
- spinner
66
- });
64
+ await this.#runPhase("prepare", "Preparing output directory", () => this.#app.prepareCommand("build"));
67
65
  if (!this.#fast)
68
- await this.#runPhase("typecheck", "Typechecking", () => this.typecheck(), undefined, phaseOptions);
69
- await this.#runPhase("backend", "Compiling backend", () => this.#buildBackend(), (result) => `${result.entrypoints} entrypoints, ${result.outputs} outputs`, phaseOptions);
70
- await this.#runPhase("ssr", "Building SSR route artifacts", async () => web.ssr ? await this.#buildSsr() : null, (result) => result ? `${result.allRoutes.manifest.routeIds.length} routes, ${result.allRoutes.manifest.knownEntries.length} entries` : web.ssr ? "skipped" : "disabled by akan.config.ts web.ssr", phaseOptions);
71
- await this.#runPhase("csr", "Building CSR assets", async () => web.csr ? await this.#buildCsr() : null, (result) => result?.outputDir ?? (web.csr ? "skipped" : "disabled by akan.config.ts web.csr"), phaseOptions);
72
- await this.#runPhase("assets", "Trimming unread static assets", async () => assets.pruneFonts ? await new FontPruner(this.#app, assets).prune() : null, (result) => result ? `${result.removed.length} font file(s) dropped, ${ApplicationBuildRunner.formatBytes(result.freedBytes)} freed; ${result.kept.length} kept` : "disabled by akan.config.ts assets.pruneFonts", phaseOptions);
73
- await this.#runPhase("compress", "Compressing static assets", () => precompressArtifacts(this.#app), (result) => result.files > 0 ? `${result.files} files, ${ApplicationBuildRunner.formatBytes(result.inputBytes)} -> gzip ${ApplicationBuildRunner.formatBytes(result.outputBytes)} / br ${ApplicationBuildRunner.formatBytes(result.brotliBytes)}` : "no files", phaseOptions);
74
- await this.#runPhase("metadata", "Writing production metadata", () => this.#buildAppMeta(), undefined, {
75
- spinner
76
- });
66
+ await this.#runPhase("typecheck", "Typechecking", () => this.typecheck());
67
+ await this.#runPhase("backend", "Compiling backend", () => this.#buildBackend(), (result) => `${result.entrypoints} entrypoints, ${result.outputs} outputs`);
68
+ await this.#runPhase("ssr", "Building SSR route artifacts", async () => web.ssr ? await this.#buildSsr() : null, (result) => result ? `${result.allRoutes.manifest.routeIds.length} routes, ${result.allRoutes.manifest.knownEntries.length} entries` : web.ssr ? "skipped" : "disabled by akan.config.ts web.ssr");
69
+ await this.#runPhase("csr", "Building CSR assets", async () => web.csr ? await new CsrArtifactBuilder(this.#app, "build").build() : null, (result) => result?.outputDir ?? (web.csr ? "skipped" : "disabled by akan.config.ts web.csr"));
70
+ await this.#runPhase("assets", "Trimming unread static assets", async () => assets.pruneFonts ? await new FontPruner(this.#app, assets).prune() : null, (result) => result ? `${result.removed.length} font file(s) dropped, ${ApplicationBuildRunner.formatBytes(result.freedBytes)} freed; ${result.kept.length} kept` : "disabled by akan.config.ts assets.pruneFonts");
71
+ await this.#runPhase("compress", "Compressing static assets", () => precompressArtifacts(this.#app), (result) => result.files > 0 ? `${result.files} files, ${ApplicationBuildRunner.formatBytes(result.inputBytes)} -> gzip ${ApplicationBuildRunner.formatBytes(result.outputBytes)} / br ${ApplicationBuildRunner.formatBytes(result.brotliBytes)}` : "no files");
72
+ await this.#runPhase("metadata", "Writing production metadata", () => this.#buildAppMeta());
77
73
  return {
78
74
  phases: this.#phases,
79
75
  durationMs: Date.now() - this.#startedAt,
@@ -84,21 +80,20 @@ class ApplicationBuildRunner {
84
80
  async typecheck(options = {}) {
85
81
  const { clean = false, incremental = true } = options;
86
82
  await this.#app.getPageKeys({ refresh: true });
87
- const { typecheckDir, tsconfigPath } = await this.#writeTypecheckTsconfig({ incremental });
83
+ const { typecheckDir, tsconfigPath } = await this.#writeTypecheckTsconfig(incremental);
88
84
  if (clean)
89
85
  await rm(path.join(typecheckDir, "tsconfig.tsbuildinfo"), { force: true });
90
86
  await this.#checkProjectInChildProcess(tsconfigPath);
91
87
  }
92
- async#runPhase(id, label, task, summarize, options = {}) {
88
+ async#runPhase(id, label, task, summarize) {
93
89
  this.#reporter?.phaseStart?.({ id, label });
94
90
  const phaseStartedAt = Date.now();
95
- const spinner = options.spinner ? new Spinner(label, { prefix: `${BUILD_PHASE_EMOJIS[id]} ${id}` }).start() : undefined;
91
+ const spinner = this.#spinner ? new Spinner(label, { prefix: `${BUILD_PHASE_EMOJIS[id]} ${id}` }).start() : undefined;
96
92
  try {
97
93
  const result = await task();
98
94
  const phase = { id, label, durationMs: Date.now() - phaseStartedAt, summary: summarize?.(result) };
99
95
  this.#phases.push(phase);
100
- const summary = phase.summary ? `: ${phase.summary}` : "";
101
- spinner?.succeed(`${label}${summary}`);
96
+ spinner?.succeed(`${label}${phase.summary ? `: ${phase.summary}` : ""}`);
102
97
  this.#reporter?.phaseDone?.(phase);
103
98
  return result;
104
99
  } catch (error) {
@@ -111,59 +106,72 @@ class ApplicationBuildRunner {
111
106
  const akanConfig = await this.#app.getConfig();
112
107
  await Promise.all([
113
108
  this.#app.dist.writeJson("package.json", akanConfig.getProductionPackageJson()),
114
- this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/Dockerfile`, akanConfig.dockerfile)
109
+ this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/Dockerfile`, akanConfig.dockerfile),
110
+ this.#app.dist.writeJson("akan.build.json", {
111
+ buildId: await this.#resolveBuildId(),
112
+ akanVersion: akanConfig.akanVersion,
113
+ builtAt: new Date().toISOString()
114
+ })
115
115
  ]);
116
116
  }
117
+ async#resolveBuildId() {
118
+ const fromEnv = process.env.AKAN_BUILD_ID?.trim();
119
+ if (fromEnv)
120
+ return fromEnv;
121
+ const root = this.#app.workspace.workspaceRoot;
122
+ const sha = Bun.spawnSync(["git", "rev-parse", "--short=12", "HEAD"], { cwd: root, stderr: "ignore" });
123
+ if (sha.exitCode !== 0)
124
+ return null;
125
+ const dirty = Bun.spawnSync(["git", "status", "--porcelain", "--untracked-files=no"], {
126
+ cwd: root,
127
+ stderr: "ignore"
128
+ });
129
+ const suffix = dirty.exitCode === 0 && dirty.stdout.toString().trim() ? "-dirty" : "";
130
+ return `${sha.stdout.toString().trim()}${suffix}`;
131
+ }
117
132
  async#buildBackend() {
118
- const akanConfig = await this.#app.getConfig();
119
- const backendExternals = [
120
- ...new Set([...akanConfig.externalLibs, ...SSR_RENDER_EXTERNALS, ...AKAN_OPTIONAL_BACKEND_EXTERNALS])
121
- ];
122
- const { web } = akanConfig;
133
+ const { externalLibs, web } = await this.#app.getConfig();
123
134
  const backendEntryPoints = [`${this.#app.cwdPath}/main.ts`, `${this.#app.cwdPath}/server.ts`];
124
135
  for (const entrypoint of backendEntryPoints) {
125
136
  if (!await Bun.file(entrypoint).exists())
126
137
  throw new Error(`Backend entrypoint not found: ${entrypoint}`);
127
138
  }
128
- const backendResult = await this.#buildOrThrow("backend", {
129
- entrypoints: backendEntryPoints,
139
+ const sharedConfig = {
130
140
  outdir: this.#app.dist.cwdPath,
131
141
  target: "bun",
132
142
  minify: AKAN_BACKEND_MINIFY,
133
143
  naming: { entry: "[name].[ext]", chunk: "chunk-[hash].[ext]" },
134
- define: { "process.env.NODE_ENV": JSON.stringify("production") },
135
- plugins: backendExternals.length > 0 ? [this.#createExternalSpecifiersPlugin(backendExternals)] : []
136
- });
144
+ define: { "process.env.NODE_ENV": JSON.stringify("production") }
145
+ };
146
+ const backendConfig = { ...sharedConfig, plugins: [this.#createExternalSpecifiersPlugin(externalLibs)] };
147
+ const [mainResult, serverResult] = [
148
+ await this.#buildOrThrow("backend", { ...backendConfig, entrypoints: [backendEntryPoints[0]] }),
149
+ await this.#buildOrThrow("backend", { ...backendConfig, entrypoints: [backendEntryPoints[1]], splitting: true })
150
+ ];
137
151
  const rscWorkerResult = web.ssr ? await this.#buildOrThrow("rsc-worker", {
152
+ ...backendConfig,
138
153
  entrypoints: [this.#resolveRscWorkerBuildEntry()],
139
- outdir: this.#app.dist.cwdPath,
140
- target: "bun",
141
- minify: AKAN_BACKEND_MINIFY,
142
- naming: { entry: "[name].[ext]", chunk: "chunk-[hash].[ext]" },
143
- conditions: ["react-server"],
144
- define: { "process.env.NODE_ENV": JSON.stringify("production") },
145
- plugins: backendExternals.length > 0 ? [this.#createExternalSpecifiersPlugin(backendExternals)] : []
154
+ conditions: ["react-server"]
146
155
  }) : null;
147
156
  const consoleRuntimeResult = await this.#buildOrThrow("console-runtime", {
157
+ ...sharedConfig,
148
158
  entrypoints: [this.#resolveConsoleRuntimeBuildEntry()],
149
- outdir: this.#app.dist.cwdPath,
150
- target: "bun",
151
- minify: AKAN_BACKEND_MINIFY,
152
- naming: { entry: "console-runtime.[ext]", chunk: "chunk-[hash].[ext]" },
153
- define: { "process.env.NODE_ENV": JSON.stringify("production") }
159
+ naming: { entry: "console-runtime.[ext]", chunk: "chunk-[hash].[ext]" }
154
160
  });
155
161
  await this.#writeConsoleShim();
162
+ const results = [mainResult, serverResult, rscWorkerResult, consoleRuntimeResult];
156
163
  return {
157
164
  entrypoints: backendEntryPoints.length + (rscWorkerResult ? 2 : 1),
158
- outputs: backendResult.outputs.length + (rscWorkerResult?.outputs.length ?? 0) + consoleRuntimeResult.outputs.length + 1
165
+ outputs: results.reduce((sum, result) => sum + (result?.outputs.length ?? 0), 1)
159
166
  };
160
167
  }
161
168
  async#writeConsoleShim() {
162
- await Bun.write(path.join(this.#app.dist.cwdPath, "console.js"), `import { cnst, db, dict, option, server, sig, srv } from "./server.js";
163
- import { assertAkanConsoleAllowed, startAkanConsole } from "./console-runtime.js";
169
+ await Bun.write(path.join(this.#app.dist.cwdPath, "console.js"), `process.env.AKAN_COMMAND_TYPE = "console";
170
+ const { cnst, db, dict, option, server, sig, srv } = await import("./server.js");
171
+ const { assertAkanConsoleAllowed, startAkanConsole } = await import("./console-runtime.js");
164
172
 
165
173
  const run = async () => {
166
- assertAkanConsoleAllowed(server.env);
174
+ assertAkanConsoleAllowed();
167
175
  await server.start({ listen: false, web: false });
168
176
  try {
169
177
  await startAkanConsole(server, { globals: { cnst, db, dict, option, sig, srv } });
@@ -192,9 +200,6 @@ void run().catch((error) => {
192
200
  return path.join(this.#app.workspace.workspaceRoot, "pkgs/akanjs/server/console.ts");
193
201
  }
194
202
  }
195
- async#buildCsr() {
196
- return await new CsrArtifactBuilder(this.#app, "build").build();
197
- }
198
203
  async#buildSsr() {
199
204
  const pageKeys = await this.#app.getPageKeys();
200
205
  if (pageKeys.length === 0) {
@@ -205,7 +210,7 @@ void run().catch((error) => {
205
210
  const allRoutes = await new AllRoutesBuilder(this.#app, base.artifact, "build").build();
206
211
  return { base, allRoutes };
207
212
  }
208
- async#writeTypecheckTsconfig({ incremental = true } = {}) {
213
+ async#writeTypecheckTsconfig(incremental) {
209
214
  const typecheckDir = path.join(this.#app.cwdPath, ".akan", "typecheck");
210
215
  await mkdir(typecheckDir, { recursive: true });
211
216
  const libPageIncludes = (await this.#app.getPageRoots()).filter((root) => root.keyPrefix).flatMap((root) => {
@@ -272,9 +277,9 @@ void run().catch((error) => {
272
277
  throw new AggregateError(result.logs, `[${label}] Bun.build failed`);
273
278
  return result;
274
279
  }
275
- #createExternalSpecifiersPlugin(specifiers) {
276
- const uniqueSpecifiers = [...new Set(specifiers)];
277
- const escaped = uniqueSpecifiers.map((specifier) => specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
280
+ #createExternalSpecifiersPlugin(externalLibs) {
281
+ const specifiers = new Set([...externalLibs, ...SSR_RENDER_EXTERNALS, ...AKAN_OPTIONAL_BACKEND_EXTERNALS]);
282
+ const escaped = [...specifiers].map((specifier) => specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
278
283
  const filter = new RegExp(`^(${escaped.join("|")})(?:/.*)?$`);
279
284
  return {
280
285
  name: "akan-backend-externalize-specifiers",
@@ -283,13 +288,7 @@ void run().catch((error) => {
283
288
  }
284
289
  };
285
290
  }
286
- static formatBytes(bytes) {
287
- if (bytes < 1024)
288
- return `${bytes}B`;
289
- if (bytes < 1024 * 1024)
290
- return `${(bytes / 1024).toFixed(1)}KB`;
291
- return `${(bytes / 1024 / 1024).toFixed(1)}MB`;
292
- }
291
+ static formatBytes = FontPruner.formatBytes;
293
292
  }
294
293
  export {
295
294
  ApplicationBuildRunner