@akanjs/cli 3.1.1 → 3.1.2-rc.1

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 (113) hide show
  1. package/.build-stamp +1 -1
  2. package/CodeAgent-dyc45f5w.js +11 -0
  3. package/{CodeAgentRpcHost-9g27hmer.js → CodeAgentRpcHost-6dzfkvsc.js} +1 -1
  4. package/CodeAgentRpcListener-tcwrdvst.js +182 -0
  5. package/{CodeTui-h6yz2kvq.js → CodeTui-q55b2zrn.js} +25 -8
  6. package/TunnelShare-hdq9h1hr.js +14 -0
  7. package/{agent.command-3r4jsck8.js → agent.command-20zaqe60.js} +18 -15
  8. package/akanCode.js +8 -7
  9. package/{application.command-g7xv6ad0.js → application.command-nd0fshsk.js} +11 -11
  10. package/{applicationBuildRunner-qvjnhr9j.js → applicationBuildRunner-s13x3zqb.js} +10 -9
  11. package/buildBatch.proc.js +6 -6
  12. package/{cloud.command-6ebygmhw.js → cloud.command-8kbddsz9.js} +25 -18
  13. package/cloud.script-hgvvajm3.js +27 -0
  14. package/code.command-625bg8s8.js +345 -0
  15. package/{context.command-svdh6b2w.js → context.command-p6haqjay.js} +19 -18
  16. package/context.runner-rsnqnk9j.js +27 -0
  17. package/{dependencyScanner-3afj2vt1.js → dependencyScanner-78sq8m4q.js} +2 -2
  18. package/{fileSys-wzzrntkw.js → fileSys-zpvt5gtf.js} +1 -1
  19. package/{guideline.command-qwp3tnjx.js → guideline.command-195g0h9a.js} +4 -4
  20. package/guidelines/agentRule/agentRule.instruction.md +22 -8
  21. package/guidelines/conventions/rules/auth.md +5 -4
  22. package/guidelines/conventions/rules/config.md +5 -1
  23. package/guidelines/conventions/rules/gates.md +2 -1
  24. package/guidelines/conventions/rules/module.md +1 -1
  25. package/guidelines/conventions/rules/server.md +8 -3
  26. package/guidelines/conventions/rules/ssr.md +2 -2
  27. package/guidelines/conventions/rules/tsx.md +2 -1
  28. package/guidelines/pageRule/pageRule.instruction.md +4 -4
  29. package/guidelines/runtimeRule/runtimeRule.instruction.md +35 -25
  30. package/guidelines/ssrRule/ssrRule.instruction.md +11 -10
  31. package/guidelines/transportRule/transportRule.instruction.md +5 -4
  32. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +1 -1
  33. package/incrementalBuilder.proc.js +4 -4
  34. package/{index-w4k2ragk.js → index-00a7j05x.js} +7 -7
  35. package/{index-w7q6h97v.js → index-0j1t1h2b.js} +3 -1
  36. package/{index-payhwt51.js → index-1h2jc0x3.js} +141 -67
  37. package/{index-vxmy1p4f.js → index-1qsd8ft1.js} +63 -123
  38. package/{index-s6da8ta9.js → index-2mwjshz5.js} +158 -51
  39. package/index-2nxk8wgs.js +266 -0
  40. package/{index-k5jbcxyh.js → index-2phm56a1.js} +49 -8
  41. package/{index-jje9qzyq.js → index-35j83zkd.js} +37 -3
  42. package/{index-m5n3ka0p.js → index-4am4dvmf.js} +13 -2
  43. package/index-75y7bcz4.js +28 -0
  44. package/{index-b8c289dx.js → index-7apsdr5g.js} +55 -12
  45. package/{index-8559hsz4.js → index-84h43kg6.js} +6 -5
  46. package/{index-eja64h28.js → index-9zy8479y.js} +5 -3
  47. package/{index-96wzdhfh.js → index-a1vb3x7t.js} +209 -36
  48. package/{index-52w0fvh8.js → index-bns3wcpc.js} +15 -0
  49. package/{index-am36s3jh.js → index-cjmjvg4r.js} +157 -117
  50. package/{index-1p0qbq3m.js → index-defp4gmb.js} +1 -1
  51. package/{index-4pdts00b.js → index-ewbmfarf.js} +10 -8
  52. package/{index-9rvcs76p.js → index-fhw7yq2d.js} +10 -10
  53. package/{index-8scw1pjk.js → index-g500c5j9.js} +178 -82
  54. package/{index-qxzrp5xt.js → index-g841cap9.js} +4 -4
  55. package/{index-qkkdhjm6.js → index-gr9thy79.js} +5 -5
  56. package/{index-4pf8g7ff.js → index-h7hehkw6.js} +3 -0
  57. package/{index-4mj92tsh.js → index-hm0tn7qv.js} +73 -68
  58. package/{index-r2wedvqn.js → index-j6eeh5d7.js} +1 -1
  59. package/{index-tgt2fnd6.js → index-j7hwy56s.js} +3 -3
  60. package/{index-rnphv731.js → index-jc2zbwra.js} +2 -2
  61. package/{index-z4b84y6k.js → index-khk05tsf.js} +1 -1
  62. package/{index-tvehn2sp.js → index-qd7xn2bk.js} +1 -1
  63. package/{index-266dewjs.js → index-qw6814m4.js} +53 -15
  64. package/{index-zcf6k8a5.js → index-raz588b3.js} +47 -12
  65. package/{index-at7bz0xq.js → index-s4nvxpzm.js} +2 -0
  66. package/{index-3yz30c07.js → index-sp0qsr7a.js} +114 -12
  67. package/{index-1shvxzt0.js → index-sveq36gh.js} +39 -42
  68. package/{index-r2w2eh93.js → index-t1t9wq9a.js} +4 -4
  69. package/index-t78230d7.js +191 -0
  70. package/{index-r0k3ham2.js → index-tgqameyb.js} +4 -4
  71. package/{index-dd44g6vz.js → index-tp56652m.js} +5 -5
  72. package/index-w15mg3km.js +389 -0
  73. package/{index-xq543a5y.js → index-y4kcmbt2.js} +2 -2
  74. package/index-yf9wc28h.js +52 -0
  75. package/{index-xqgwjz7a.js → index-zbrwnmf1.js} +9 -7
  76. package/{index-xxfy1jp2.js → index-zttm13c3.js} +4 -4
  77. package/index.js +24 -24
  78. package/{library.command-2853y6mk.js → library.command-63hgt9te.js} +4 -4
  79. package/{localRegistry.command-76ds31p4.js → localRegistry.command-g3f8k25t.js} +43 -23
  80. package/{module.command-yfnb0abs.js → module.command-r4sa2khp.js} +7 -6
  81. package/{package.command-d9s86hp9.js → package.command-96eheyvd.js} +5 -5
  82. package/package.json +2 -2
  83. package/{page.command-6a8a8rd1.js → page.command-gs6d841d.js} +4 -4
  84. package/{pipeline.command-rt3rwd2z.js → pipeline.command-wdfvdbfj.js} +3 -3
  85. package/{primitive.command-emcebgrq.js → primitive.command-dfsv4mpe.js} +8 -7
  86. package/{projectTypecheck-51m7eh1f.js → projectTypecheck-kqj1t6hb.js} +1 -1
  87. package/{prompter-hgcta8pb.js → prompter-qrwx1p17.js} +2 -2
  88. package/{quality.command-xtrk0n3x.js → quality.command-webzxee2.js} +6 -4
  89. package/{repair.command-51szxnxx.js → repair.command-3r3j1xre.js} +7 -6
  90. package/{scalar.command-8qv27t82.js → scalar.command-e8y47j6d.js} +6 -5
  91. package/skills/akan-agent/SKILL.md +8 -1
  92. package/skills/akan-code/SKILL.md +37 -11
  93. package/skills/akan-debug/SKILL.md +2 -1
  94. package/skills/akan-err/SKILL.md +2 -1
  95. package/skills/akan-query/SKILL.md +3 -2
  96. package/skills/akan-runtime/SKILL.md +3 -0
  97. package/{subspace.command-pn56pnh8.js → subspace.command-a1sf9n5a.js} +12 -10
  98. package/templates/appSample/lib/task/task.signal.ts +14 -9
  99. package/templates/appSample/srvkit/guards.ts +11 -0
  100. package/templates/service/__model__.dictionary.ts +3 -5
  101. package/templates/workspaceRoot/.gitignore.template +1 -0
  102. package/{tunnel.command-q2h0j2en.js → tunnel.command-dcb0wg93.js} +25 -13
  103. package/{verify.command-z1dsbmrt.js → verify.command-yyepccbh.js} +13 -11
  104. package/{workflow.command-r3y67jeq.js → workflow.command-z5pg9ay0.js} +12 -11
  105. package/{workspace.command-t2f0xsrw.js → workspace.command-d7x5jttw.js} +74 -47
  106. package/CodeAgent-35wnb7w5.js +0 -9
  107. package/CodeAgentRpcListener-7p7z5dd7.js +0 -97
  108. package/TunnelShare-xyjpa7gx.js +0 -14
  109. package/cloud.script-0s1jybd5.js +0 -26
  110. package/code.command-mpkm2emr.js +0 -167
  111. package/context.runner-ch0z3a8g.js +0 -26
  112. package/index-c6eggbee.js +0 -123
  113. package/index-ksfgqq1x.js +0 -49
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- baed8b96dcb1b721166e9b494e8ccfc8d2748a0a4220b6e96628ca5f271663bd
1
+ 794d67dba25af2a8d6ccdf57a9309054c139d32013c90e47afdea66c9d5387ee
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ import {
3
+ CodeAgent2
4
+ } from "./index-a1vb3x7t.js";
5
+ import"./index-1qsd8ft1.js";
6
+ import"./index-tenw3mah.js";
7
+ import"./index-35j83zkd.js";
8
+ import"./index-bns3wcpc.js";
9
+ export {
10
+ CodeAgent2 as CodeAgent
11
+ };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  CodeAgentRpcHost2
4
- } from "./index-at7bz0xq.js";
4
+ } from "./index-s4nvxpzm.js";
5
5
  export {
6
6
  CodeAgentRpcHost2 as CodeAgentRpcHost
7
7
  };
@@ -0,0 +1,182 @@
1
+ // @bun
2
+ import {
3
+ codeAgentIsLoopback
4
+ } from "./index-75y7bcz4.js";
5
+
6
+ // pkgs/@akanjs/devkit/codeAgent/agent/CodeAgentRpcListener.ts
7
+ import { createHash, randomBytes, timingSafeEqual } from "crypto";
8
+ import { chmodSync, existsSync, rmSync } from "fs";
9
+ class CodeAgentRpcListener {
10
+ static prefaceLimit = 4096;
11
+ static prefaceMs = 5000;
12
+ #host;
13
+ #address;
14
+ #token;
15
+ #listener = null;
16
+ #client = null;
17
+ constructor(host, address, options = {}) {
18
+ this.#host = host;
19
+ this.#address = address;
20
+ this.#token = options.token !== undefined ? options.token : ("unix" in address) ? null : CodeAgentRpcListener.newToken();
21
+ }
22
+ static newToken() {
23
+ return randomBytes(32).toString("base64url");
24
+ }
25
+ static parse(spec, { anyHost = false } = {}) {
26
+ if (spec.startsWith("unix:"))
27
+ return { unix: spec.slice("unix:".length) };
28
+ const rest = spec.startsWith("tcp:") ? spec.slice("tcp:".length) : spec;
29
+ const separator = rest.lastIndexOf(":");
30
+ const hostname = (separator >= 0 ? rest.slice(0, separator) : "") || "127.0.0.1";
31
+ const port = Number(separator >= 0 ? rest.slice(separator + 1) : rest);
32
+ if (!Number.isInteger(port) || port < 0 || port > 65535)
33
+ throw new Error(`--rpc-listen takes unix:<path> or tcp:[host:]<port>, not "${spec}"`);
34
+ if (!anyHost && !codeAgentIsLoopback(hostname))
35
+ throw new Error(`--rpc-listen ${spec} would be reachable from other machines. Bind 127.0.0.1, or pass --rpc-bind-any to mean it.`);
36
+ return { hostname, port };
37
+ }
38
+ get port() {
39
+ const port = this.#listener && "port" in this.#listener ? this.#listener.port : null;
40
+ return typeof port === "number" ? port : null;
41
+ }
42
+ get token() {
43
+ return this.#token;
44
+ }
45
+ listen() {
46
+ if ("unix" in this.#address && existsSync(this.#address.unix))
47
+ rmSync(this.#address.unix);
48
+ const socket = {
49
+ open: (client) => this.#open(client),
50
+ data: (client, data) => this.#data(client, data),
51
+ drain: (client) => this.#drain(client),
52
+ close: (client) => this.#close(client),
53
+ error: (client) => this.#close(client)
54
+ };
55
+ if ("unix" in this.#address) {
56
+ const umask = process.umask(127);
57
+ try {
58
+ this.#listener = Bun.listen({ unix: this.#address.unix, socket });
59
+ } finally {
60
+ process.umask(umask);
61
+ }
62
+ chmodSync(this.#address.unix, 384);
63
+ } else
64
+ this.#listener = Bun.listen({ hostname: this.#address.hostname, port: this.#address.port, socket });
65
+ this.#host.start();
66
+ return this;
67
+ }
68
+ async serve() {
69
+ if (!this.#listener)
70
+ this.listen();
71
+ await this.#host.shutdown;
72
+ this.stop();
73
+ }
74
+ stop() {
75
+ this.#client?.end();
76
+ this.#client = null;
77
+ this.#host.attach(null);
78
+ this.#listener?.stop(true);
79
+ this.#listener = null;
80
+ if ("unix" in this.#address && existsSync(this.#address.unix))
81
+ rmSync(this.#address.unix);
82
+ }
83
+ #open(client) {
84
+ client.data = { pending: null, decoder: new TextDecoder, admitted: false, preface: "", timer: null };
85
+ client.data.timer = setTimeout(() => {
86
+ if (!client.data.admitted)
87
+ client.end();
88
+ }, CodeAgentRpcListener.prefaceMs);
89
+ }
90
+ #data(client, data) {
91
+ const text = client.data.decoder.decode(data, { stream: true });
92
+ if (client.data.admitted) {
93
+ if (client === this.#client)
94
+ this.#host.feed(text);
95
+ return;
96
+ }
97
+ client.data.preface += text;
98
+ const preface = client.data.preface.trimStart();
99
+ if (preface && !preface.startsWith("{")) {
100
+ client.end();
101
+ return;
102
+ }
103
+ if (!this.#token) {
104
+ this.#admit(client);
105
+ return void this.#host.feed(preface);
106
+ }
107
+ const newline = preface.indexOf(`
108
+ `);
109
+ if (newline < 0) {
110
+ if (preface.length > CodeAgentRpcListener.prefaceLimit)
111
+ client.end();
112
+ return;
113
+ }
114
+ if (!this.#authenticates(preface.slice(0, newline))) {
115
+ client.write(`${JSON.stringify({ type: "reply", id: "auth", ok: false, error: "unauthorized" })}
116
+ `);
117
+ client.end();
118
+ return;
119
+ }
120
+ this.#admit(client);
121
+ this.#write(client, `${JSON.stringify({ type: "reply", id: "auth", ok: true })}
122
+ `);
123
+ const rest = preface.slice(newline + 1);
124
+ if (rest)
125
+ this.#host.feed(rest);
126
+ }
127
+ #admit(client) {
128
+ if (client.data.timer)
129
+ clearTimeout(client.data.timer);
130
+ client.data.timer = null;
131
+ client.data.admitted = true;
132
+ client.data.preface = "";
133
+ const previous = this.#client;
134
+ this.#client = client;
135
+ previous?.end();
136
+ this.#host.attach((line) => this.#write(client, line));
137
+ }
138
+ #authenticates(line) {
139
+ if (!this.#token)
140
+ return true;
141
+ let auth;
142
+ try {
143
+ auth = JSON.parse(line).auth;
144
+ } catch {
145
+ return false;
146
+ }
147
+ if (typeof auth !== "string")
148
+ return false;
149
+ const digest = (value) => createHash("sha256").update(value).digest();
150
+ return timingSafeEqual(digest(auth), digest(this.#token));
151
+ }
152
+ #write(client, line) {
153
+ if (client !== this.#client)
154
+ return;
155
+ const bytes = Buffer.from(line);
156
+ if (client.data.pending) {
157
+ client.data.pending = Buffer.concat([client.data.pending, bytes]);
158
+ return;
159
+ }
160
+ const written = client.write(bytes);
161
+ if (written < bytes.length)
162
+ client.data.pending = bytes.subarray(Math.max(0, written));
163
+ }
164
+ #drain(client) {
165
+ const pending = client.data.pending;
166
+ if (!pending)
167
+ return;
168
+ const written = client.write(pending);
169
+ client.data.pending = written < pending.length ? pending.subarray(Math.max(0, written)) : null;
170
+ }
171
+ #close(client) {
172
+ if (client.data?.timer)
173
+ clearTimeout(client.data.timer);
174
+ if (client !== this.#client)
175
+ return;
176
+ this.#client = null;
177
+ this.#host.attach(null);
178
+ }
179
+ }
180
+ export {
181
+ CodeAgentRpcListener
182
+ };
@@ -1,11 +1,16 @@
1
1
  // @bun
2
2
  import {
3
3
  SubagentPool2,
4
- McpServerConfig,
5
4
  McpTokenStore,
6
5
  McpSignIn,
7
6
  AkanCodeCompaction2
8
- } from "./index-vxmy1p4f.js";
7
+ } from "./index-1qsd8ft1.js";
8
+ import"./index-bns3wcpc.js";
9
+ import"./index-35j83zkd.js";
10
+ import {
11
+ McpServerConfig,
12
+ WorkspaceTrust
13
+ } from "./index-w15mg3km.js";
9
14
  import {
10
15
  CodeTuiLines2,
11
16
  CodeTuiAgents2,
@@ -421,7 +426,12 @@ class CodeTuiMcp {
421
426
  static #rows(view) {
422
427
  const byName = new Map;
423
428
  for (const entry of view.declared)
424
- byName.set(entry.ref.name, { ref: entry.ref, disabled: entry.disabled, scope: entry.scope });
429
+ byName.set(entry.ref.name, {
430
+ ref: entry.ref,
431
+ disabled: entry.disabled,
432
+ scope: entry.scope,
433
+ unapproved: entry.scope === "workspace" && view.workspaceApproved === false
434
+ });
425
435
  for (const live of view.status)
426
436
  byName.set(live.name, { ...byName.get(live.name), live });
427
437
  return [...byName].sort(([a], [b]) => a.localeCompare(b)).map(([name, entry]) => {
@@ -433,6 +443,8 @@ class CodeTuiMcp {
433
443
  static #stateOf(entry) {
434
444
  if (entry.disabled)
435
445
  return "disabled in the file";
446
+ if (entry.unapproved && !entry.live)
447
+ return "not approved \xB7 restart akan code to approve it";
436
448
  if (!entry.live)
437
449
  return "declared \xB7 /mcp reload to connect";
438
450
  if (entry.live.auth === "required")
@@ -577,16 +589,18 @@ class CodeTui {
577
589
  #clipboardTimer = null;
578
590
  #notice = "";
579
591
  #opening;
592
+ #warnings;
580
593
  #thinking;
581
594
  #noticeTimer = null;
582
595
  #frameTimer = null;
583
596
  #cached = null;
584
597
  #unsubscribe;
585
598
  #exiting = false;
586
- constructor(agent, { thinking = false, notice, ...streams } = {}) {
599
+ constructor(agent, { thinking = false, notice, warnings = [], ...streams } = {}) {
587
600
  this.#agent = agent;
588
601
  this.#thinking = thinking;
589
602
  this.#opening = notice ?? "";
603
+ this.#warnings = warnings;
590
604
  this.#files = new CodeTuiFiles2(agent.profile.paths.root);
591
605
  this.#stdout = streams.stdout ?? process.stdout;
592
606
  this.#stdout.on("resize", this.#onResize);
@@ -620,6 +634,8 @@ class CodeTui {
620
634
  this.#stdout.write(`${CodeTui.pasteOn}${CodeTuiMouse.on}`);
621
635
  if (this.#opening)
622
636
  this.#say(this.#opening);
637
+ for (const warning of this.#warnings)
638
+ this.#transcript.note("warning", warning);
623
639
  this.#unsubscribe = this.#agent.on((event) => {
624
640
  this.#transcript.apply(event);
625
641
  if (event.type === "question")
@@ -1354,7 +1370,7 @@ ${CodeTuiCommands2.help()}`);
1354
1370
  return this.#open("mcp", `"${name}" cannot name a server: letters, digits, dash and underscore only.`);
1355
1371
  try {
1356
1372
  if (verb === "remove") {
1357
- const scope = McpServerConfig.remove(root, name, local ? "workspace" : undefined);
1373
+ const scope = WorkspaceTrust.carry(root, "mcp", () => McpServerConfig.remove(root, name, local ? "workspace" : undefined));
1358
1374
  const remaining = McpServerConfig.declared(root).find((entry) => entry.ref.name === name);
1359
1375
  if (!scope)
1360
1376
  return this.#open("mcp", remaining ? `"${name}" is not declared in this repo's file; the ${remaining.scope} file declares it \u2014 /mcp remove ${name} removes it there.` : `No server named "${name}" is declared.`);
@@ -1363,7 +1379,7 @@ ${CodeTuiCommands2.help()}`);
1363
1379
  return this.#reload(`removed ${name} from the ${scope} file \u2014 the ${remaining.scope} file still declares it, so it still applies; /mcp remove ${name} again to remove it there`);
1364
1380
  }
1365
1381
  const scope = local ? "workspace" : "global";
1366
- const ref = McpServerConfig.add(root, name, rest, scope);
1382
+ const ref = WorkspaceTrust.carry(root, "mcp", () => McpServerConfig.add(root, name, rest, scope));
1367
1383
  const where = scope === "global" ? "every repo" : "this repo";
1368
1384
  return this.#reload(`added ${name} \xB7 ${McpServerConfig.targetOf(ref)} \xB7 ${where}`);
1369
1385
  } catch (error) {
@@ -1375,12 +1391,12 @@ ${CodeTuiCommands2.help()}`);
1375
1391
  if (!name)
1376
1392
  return this.#open("mcp", [`Usage: /mcp ${verb} <name>`, "", ...CodeTuiMcp.usage].join(`
1377
1393
  `));
1394
+ const ref = McpServerConfig.read(root).find((entry) => entry.name === name);
1378
1395
  if (verb === "logout") {
1379
- if (!McpTokenStore.clear(name))
1396
+ if (!McpTokenStore.clear(ref ?? { name }))
1380
1397
  return this.#open("mcp", `"${name}" is not signed in.`);
1381
1398
  return this.#reload(`signed out of ${name}`);
1382
1399
  }
1383
- const ref = McpServerConfig.read(root).find((entry) => entry.name === name);
1384
1400
  if (!ref)
1385
1401
  return this.#open("mcp", `No server named "${name}" is declared.`);
1386
1402
  this.#say(`signing in to ${name} \u2014 finish in the browser`);
@@ -1393,6 +1409,7 @@ ${CodeTuiCommands2.help()}`);
1393
1409
  status: this.#agent.mcpServers(),
1394
1410
  declared: McpServerConfig.declared(root),
1395
1411
  files: McpServerConfig.files(root),
1412
+ workspaceApproved: WorkspaceTrust.isTrusted(root, "mcp"),
1396
1413
  ...problem ? { problem } : {}
1397
1414
  };
1398
1415
  }
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-t78230d7.js";
5
+ import"./index-gr9thy79.js";
6
+ import"./index-sp0qsr7a.js";
7
+ import"./index-m9jj544v.js";
8
+ import"./index-sveq36gh.js";
9
+ import"./index-zbrwnmf1.js";
10
+ import"./index-g500c5j9.js";
11
+ import"./index-bns3wcpc.js";
12
+ export {
13
+ TunnelShare2 as TunnelShare
14
+ };
@@ -2,28 +2,31 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-eja64h28.js";
6
- import"./index-52w0fvh8.js";
7
- import"./index-8scw1pjk.js";
8
- import"./index-r2wedvqn.js";
5
+ } from "./index-9zy8479y.js";
6
+ import"./index-bns3wcpc.js";
7
+ import"./index-g500c5j9.js";
8
+ import"./index-35j83zkd.js";
9
+ import"./index-j6eeh5d7.js";
9
10
  import"./index-hj6w4ka1.js";
10
- import"./index-4mj92tsh.js";
11
- import"./index-tgt2fnd6.js";
12
- import"./index-s6da8ta9.js";
11
+ import"./index-hm0tn7qv.js";
12
+ import"./index-2nxk8wgs.js";
13
+ import"./index-j7hwy56s.js";
14
+ import"./index-2mwjshz5.js";
13
15
  import"./index-p6x5b7hr.js";
14
- import"./index-3yz30c07.js";
15
- import"./index-w7q6h97v.js";
16
+ import"./index-sp0qsr7a.js";
17
+ import"./index-0j1t1h2b.js";
16
18
  import"./index-m9jj544v.js";
17
- import"./index-1shvxzt0.js";
18
- import"./index-xqgwjz7a.js";
19
- import"./index-am36s3jh.js";
19
+ import"./index-zbrwnmf1.js";
20
+ import"./index-sveq36gh.js";
21
+ import"./index-cjmjvg4r.js";
20
22
  import"./index-62md4dwy.js";
23
+ import"./index-4am4dvmf.js";
21
24
  import"./index-fbewhg4g.js";
22
25
  import {
23
26
  AgentScript
24
- } from "./index-9rvcs76p.js";
25
- import"./index-b8c289dx.js";
26
- import"./index-1p0qbq3m.js";
27
+ } from "./index-fhw7yq2d.js";
28
+ import"./index-7apsdr5g.js";
29
+ import"./index-defp4gmb.js";
27
30
 
28
31
  // pkgs/@akanjs/cli/agent/agent.command.ts
29
32
  class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
package/akanCode.js CHANGED
@@ -1,4 +1,8 @@
1
1
  // @bun
2
+ import"./index-bns3wcpc.js";
3
+ import {
4
+ akanCodePaths2
5
+ } from "./index-35j83zkd.js";
2
6
  import {
3
7
  AkanEditScope2,
4
8
  DevLogFeedback2,
@@ -26,25 +30,25 @@ import {
26
30
  CodeMailbox2,
27
31
  CodeSessionFork2,
28
32
  CodeAgent2
29
- } from "./index-96wzdhfh.js";
33
+ } from "./index-a1vb3x7t.js";
30
34
  import {
31
35
  akanCodeDefaultModel2,
32
36
  akanCodeModel2,
33
37
  akanCodeModelSupportsImages2,
34
38
  akanCodeModelWarnings2,
35
39
  CodeAgentStreamPrinter2
36
- } from "./index-c6eggbee.js";
40
+ } from "./index-w15mg3km.js";
37
41
  import {
38
42
  SubagentPool2,
39
43
  AkanCodeCompaction2
40
- } from "./index-vxmy1p4f.js";
44
+ } from "./index-1qsd8ft1.js";
41
45
  import {
42
46
  PreviewChrome2,
43
47
  PreviewView2
44
48
  } from "./index-tenw3mah.js";
45
49
  import {
46
50
  CodeAgentRpcHost2
47
- } from "./index-at7bz0xq.js";
51
+ } from "./index-s4nvxpzm.js";
48
52
  import {
49
53
  CodeTuiLines2,
50
54
  CodeTuiAgents2,
@@ -56,9 +60,6 @@ import {
56
60
  CodeTuiParts2
57
61
  } from "./index-2mrn1mrg.js";
58
62
  import"./index-9bv479q5.js";
59
- import {
60
- akanCodePaths2
61
- } from "./index-jje9qzyq.js";
62
63
  export {
63
64
  AkanCli2 as AkanCli,
64
65
  AkanCodeCompaction2 as AkanCodeCompaction,
@@ -7,20 +7,20 @@ import {
7
7
  Exec,
8
8
  Workspace,
9
9
  command
10
- } from "./index-eja64h28.js";
11
- import"./index-52w0fvh8.js";
12
- import"./index-8scw1pjk.js";
10
+ } from "./index-9zy8479y.js";
11
+ import"./index-bns3wcpc.js";
12
+ import"./index-g500c5j9.js";
13
13
  import"./index-p6x5b7hr.js";
14
- import"./index-3yz30c07.js";
15
- import"./index-w7q6h97v.js";
14
+ import"./index-sp0qsr7a.js";
15
+ import"./index-0j1t1h2b.js";
16
16
  import"./index-m9jj544v.js";
17
- import"./index-1shvxzt0.js";
18
- import"./index-xqgwjz7a.js";
19
- import"./index-xq543a5y.js";
20
- import"./index-s6da8ta9.js";
17
+ import"./index-zbrwnmf1.js";
18
+ import"./index-sveq36gh.js";
19
+ import"./index-y4kcmbt2.js";
20
+ import"./index-2mwjshz5.js";
21
21
  import {
22
22
  ApplicationScript
23
- } from "./index-4pdts00b.js";
23
+ } from "./index-ewbmfarf.js";
24
24
  import"./index-tenw3mah.js";
25
25
  import {
26
26
  writeOption,
@@ -29,7 +29,7 @@ import {
29
29
  allowLocalOption,
30
30
  publicEnvOption
31
31
  } from "./index-mdjc93e1.js";
32
- import"./index-1p0qbq3m.js";
32
+ import"./index-defp4gmb.js";
33
33
  import"./index-9bv479q5.js";
34
34
 
35
35
  // pkgs/@akanjs/cli/application/application.command.ts
@@ -4,24 +4,25 @@ import {
4
4
  Spinner,
5
5
  ProjectTypecheck2,
6
6
  WorkspaceExecutor
7
- } from "./index-8scw1pjk.js";
8
- import"./index-52w0fvh8.js";
9
- import"./index-dd44g6vz.js";
10
- import"./index-xqgwjz7a.js";
7
+ } from "./index-g500c5j9.js";
8
+ import"./index-bns3wcpc.js";
9
+ import"./index-tp56652m.js";
10
+ import"./index-zbrwnmf1.js";
11
11
  import {
12
12
  AllRoutesBuilder,
13
13
  FontPruner,
14
14
  precompressArtifacts,
15
15
  SsrBaseArtifactBuilder
16
- } from "./index-xxfy1jp2.js";
16
+ } from "./index-zttm13c3.js";
17
17
  import {
18
18
  CsrArtifactBuilder
19
- } from "./index-1shvxzt0.js";
19
+ } from "./index-sveq36gh.js";
20
20
  import"./index-62md4dwy.js";
21
21
 
22
22
  // pkgs/@akanjs/devkit/applicationBuildRunner.ts
23
23
  import path3 from "path";
24
24
  import { toError } from "akanjs/common";
25
+ import { BUILD_ENV_FILE } from "akanjs/server/lifecycle/buildEnv";
25
26
 
26
27
  // pkgs/@akanjs/devkit/akanConfig/productionLockfile.ts
27
28
  import { mkdtemp, rm } from "fs/promises";
@@ -234,13 +235,13 @@ class ApplicationBuildRunner {
234
235
  }
235
236
  async buildAppMeta() {
236
237
  const akanConfig = await this.#app.getConfig();
238
+ const environment = this.#environment ?? akanConfig.baseDevEnv.env;
237
239
  const packageJson = akanConfig.getProductionPackageJson();
238
240
  const lockfile = await this.#pruneLockfile(packageJson);
239
- const dockerfile = akanConfig.dockerfileFor(this.#environment ?? akanConfig.baseDevEnv.env, {
240
- lockfile: lockfile !== null
241
- });
241
+ const dockerfile = akanConfig.dockerfileFor(environment, { lockfile: lockfile !== null });
242
242
  await Promise.all([
243
243
  this.#app.dist.writeJson("package.json", packageJson),
244
+ this.#app.dist.writeJson(BUILD_ENV_FILE, akanConfig.getProductionEnv(environment)),
244
245
  ...lockfile !== null ? [this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/${ProductionLockfile.fileName}`, lockfile)] : [],
245
246
  this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/Dockerfile`, dockerfile),
246
247
  this.#app.dist.writeJson("akan.build.json", {
@@ -6,26 +6,26 @@ import {
6
6
  resolveSsrPageEntriesForApp,
7
7
  WorkspaceExecutor,
8
8
  AppExecutor
9
- } from "./index-8scw1pjk.js";
9
+ } from "./index-g500c5j9.js";
10
10
  import {
11
11
  computeRouteSeedIndex,
12
12
  saveRouteSeedIndex,
13
13
  CsrDevBundler,
14
14
  SsrDevBundler
15
- } from "./index-dd44g6vz.js";
16
- import"./index-52w0fvh8.js";
15
+ } from "./index-tp56652m.js";
16
+ import"./index-bns3wcpc.js";
17
17
  import {
18
18
  ServerGraphFile,
19
19
  PagesBundleBuilder
20
- } from "./index-xqgwjz7a.js";
20
+ } from "./index-zbrwnmf1.js";
21
21
  import {
22
22
  CssCompiler,
23
23
  FontOptimizer,
24
24
  SsrBaseArtifactBuilder
25
- } from "./index-xxfy1jp2.js";
25
+ } from "./index-zttm13c3.js";
26
26
  import {
27
27
  CsrArtifactBuilder
28
- } from "./index-1shvxzt0.js";
28
+ } from "./index-sveq36gh.js";
29
29
  import"./index-62md4dwy.js";
30
30
 
31
31
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
@@ -3,28 +3,32 @@ import {
3
3
  App,
4
4
  Workspace,
5
5
  command
6
- } from "./index-eja64h28.js";
7
- import"./index-52w0fvh8.js";
8
- import"./index-8scw1pjk.js";
9
- import"./index-qkkdhjm6.js";
6
+ } from "./index-9zy8479y.js";
7
+ import"./index-bns3wcpc.js";
8
+ import"./index-g500c5j9.js";
9
+ import"./index-gr9thy79.js";
10
10
  import {
11
11
  PlatformTestRun
12
- } from "./index-payhwt51.js";
13
- import"./index-3yz30c07.js";
14
- import"./index-w7q6h97v.js";
12
+ } from "./index-1h2jc0x3.js";
13
+ import"./index-sp0qsr7a.js";
14
+ import"./index-0j1t1h2b.js";
15
15
  import"./index-m9jj544v.js";
16
- import"./index-1shvxzt0.js";
17
- import"./index-xqgwjz7a.js";
16
+ import"./index-zbrwnmf1.js";
17
+ import"./index-sveq36gh.js";
18
+ import {
19
+ npmRegistryFromEnv,
20
+ warnIgnoredNpmRegistry
21
+ } from "./index-4am4dvmf.js";
18
22
  import"./index-p6x5b7hr.js";
19
- import"./index-xq543a5y.js";
20
- import"./index-s6da8ta9.js";
21
- import"./index-4pdts00b.js";
23
+ import"./index-y4kcmbt2.js";
24
+ import"./index-2mwjshz5.js";
25
+ import"./index-ewbmfarf.js";
22
26
  import"./index-tenw3mah.js";
23
- import"./index-tvehn2sp.js";
24
- import"./index-8559hsz4.js";
27
+ import"./index-qd7xn2bk.js";
28
+ import"./index-84h43kg6.js";
25
29
  import {
26
30
  CloudScript2
27
- } from "./index-w4k2ragk.js";
31
+ } from "./index-00a7j05x.js";
28
32
  import {
29
33
  writeOption,
30
34
  oneNativeTargetOption,
@@ -35,12 +39,15 @@ import {
35
39
  hostOption,
36
40
  subspaceOption
37
41
  } from "./index-mdjc93e1.js";
38
- import"./index-1p0qbq3m.js";
42
+ import"./index-defp4gmb.js";
39
43
  import"./index-9bv479q5.js";
40
44
 
41
45
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
42
- var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
43
- var resolveRegistryUrl = (registry) => registry === "local" ? localRegistryUrl() : undefined;
46
+ var localRegistryUrl = () => npmRegistryFromEnv() ?? "http://127.0.0.1:4873";
47
+ var resolveRegistryUrl = (registry) => {
48
+ warnIgnoredNpmRegistry();
49
+ return registry === "local" ? localRegistryUrl() : undefined;
50
+ };
44
51
 
45
52
  class CloudCommand extends command("cloud", [CloudScript2], ({ public: target }) => ({
46
53
  login: target({ desc: "Login to Akan Cloud services" }).option("host", String, hostOption).with(Workspace).exec(async function(host, workspace) {
@@ -0,0 +1,27 @@
1
+ // @bun
2
+ import {
3
+ CloudScript2
4
+ } from "./index-00a7j05x.js";
5
+ import"./index-1h2jc0x3.js";
6
+ import"./index-ewbmfarf.js";
7
+ import"./index-y4kcmbt2.js";
8
+ import"./index-84h43kg6.js";
9
+ import"./index-gr9thy79.js";
10
+ import"./index-4am4dvmf.js";
11
+ import"./index-2mwjshz5.js";
12
+ import"./index-defp4gmb.js";
13
+ import"./index-0j1t1h2b.js";
14
+ import"./index-sp0qsr7a.js";
15
+ import"./index-m9jj544v.js";
16
+ import"./index-9zy8479y.js";
17
+ import"./index-9bv479q5.js";
18
+ import"./index-tenw3mah.js";
19
+ import"./index-sveq36gh.js";
20
+ import"./index-p6x5b7hr.js";
21
+ import"./index-zbrwnmf1.js";
22
+ import"./index-g500c5j9.js";
23
+ import"./index-qd7xn2bk.js";
24
+ import"./index-bns3wcpc.js";
25
+ export {
26
+ CloudScript2 as CloudScript
27
+ };