@akanjs/cli 3.2.0-rc.0 → 3.2.0-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.
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- 277283badfb3b546b17b9a48c252758f32a9629bd60791e3460ca1e04f4abfad
1
+ 2e3d9766afc7b4160ebe82587951b7c38efbcce8f2b21fec2ea67c3e0c042a96
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  CodeAgent2
4
- } from "./index-jdamtr7e.js";
5
- import"./index-3wjbhj2n.js";
6
- import"./index-tenw3mah.js";
4
+ } from "./index-a8a9ede9.js";
5
+ import"./index-8kczhnmv.js";
6
+ import"./index-23860fej.js";
7
7
  import"./index-35j83zkd.js";
8
8
  import"./index-bns3wcpc.js";
9
9
  export {
@@ -4,7 +4,7 @@ import {
4
4
  McpTokenStore,
5
5
  McpSignIn,
6
6
  AkanCodeCompaction2
7
- } from "./index-3wjbhj2n.js";
7
+ } from "./index-8kczhnmv.js";
8
8
  import"./index-bns3wcpc.js";
9
9
  import"./index-35j83zkd.js";
10
10
  import {
package/akanCode.js CHANGED
@@ -1,4 +1,8 @@
1
1
  // @bun
2
+ import {
3
+ PreviewChrome2,
4
+ PreviewView2
5
+ } from "./index-23860fej.js";
2
6
  import"./index-bns3wcpc.js";
3
7
  import {
4
8
  akanCodePaths2
@@ -30,7 +34,7 @@ import {
30
34
  CodeMailbox2,
31
35
  CodeSessionFork2,
32
36
  CodeAgent2
33
- } from "./index-jdamtr7e.js";
37
+ } from "./index-a8a9ede9.js";
34
38
  import {
35
39
  akanCodeDefaultModel2,
36
40
  akanCodeModel2,
@@ -41,11 +45,7 @@ import {
41
45
  import {
42
46
  SubagentPool2,
43
47
  AkanCodeCompaction2
44
- } from "./index-3wjbhj2n.js";
45
- import {
46
- PreviewChrome2,
47
- PreviewView2
48
- } from "./index-tenw3mah.js";
48
+ } from "./index-8kczhnmv.js";
49
49
  import {
50
50
  CodeAgentRpcHost2
51
51
  } from "./index-s4nvxpzm.js";
@@ -18,10 +18,10 @@ import"./index-1q1cjn8s.js";
18
18
  import"./index-mmym5xmb.js";
19
19
  import"./index-mqntfzv5.js";
20
20
  import"./index-ktb3wcqz.js";
21
+ import"./index-23860fej.js";
21
22
  import {
22
23
  ApplicationScript
23
- } from "./index-ryrm5z2c.js";
24
- import"./index-tenw3mah.js";
24
+ } from "./index-vr68mxj5.js";
25
25
  import {
26
26
  writeOption,
27
27
  nativeTargetOption,
@@ -22,8 +22,8 @@ import {
22
22
  import"./index-p6hjwt2d.js";
23
23
  import"./index-mqntfzv5.js";
24
24
  import"./index-ktb3wcqz.js";
25
- import"./index-ryrm5z2c.js";
26
- import"./index-tenw3mah.js";
25
+ import"./index-23860fej.js";
26
+ import"./index-vr68mxj5.js";
27
27
  import"./index-qd7xn2bk.js";
28
28
  import"./index-7y5yghjg.js";
29
29
  import"./index-abgh0jve.js";
@@ -31,7 +31,7 @@ import"./index-hqrkqxx2.js";
31
31
  import"./index-d4n1wmrz.js";
32
32
  import {
33
33
  CloudScript2
34
- } from "./index-zxsygkda.js";
34
+ } from "./index-v4p1zye8.js";
35
35
  import {
36
36
  writeOption,
37
37
  oneNativeTargetOption,
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudScript2
4
- } from "./index-zxsygkda.js";
4
+ } from "./index-v4p1zye8.js";
5
5
  import"./index-6wpaq392.js";
6
- import"./index-ryrm5z2c.js";
6
+ import"./index-vr68mxj5.js";
7
7
  import"./index-mqntfzv5.js";
8
8
  import"./index-d4n1wmrz.js";
9
9
  import"./index-drz9e84d.js";
@@ -16,7 +16,7 @@ import"./index-zpv14wpy.js";
16
16
  import"./index-m9jj544v.js";
17
17
  import"./index-93ewzmp6.js";
18
18
  import"./index-9bv479q5.js";
19
- import"./index-tenw3mah.js";
19
+ import"./index-23860fej.js";
20
20
  import"./index-abgh0jve.js";
21
21
  import"./index-7y5yghjg.js";
22
22
  import"./index-mmym5xmb.js";
@@ -77,7 +77,7 @@ class CodeRunner extends runner("code") {
77
77
  async serve(options, listen) {
78
78
  await import("./consoleToStderr-h5bryj94.js");
79
79
  const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
80
- import("./CodeAgent-h6g8dg3a.js"),
80
+ import("./CodeAgent-vmd9k4ak.js"),
81
81
  import("./CodeAgentRpcHost-6dzfkvsc.js"),
82
82
  import("./CodeAgentRpcListener-tcwrdvst.js")
83
83
  ]);
@@ -111,8 +111,8 @@ class CodeRunner extends runner("code") {
111
111
  }
112
112
  async tui(options, seed) {
113
113
  const [{ CodeAgent }, { CodeTui }] = await Promise.all([
114
- import("./CodeAgent-h6g8dg3a.js"),
115
- import("./CodeTui-n9gacepn.js")
114
+ import("./CodeAgent-vmd9k4ak.js"),
115
+ import("./CodeTui-zka44v52.js")
116
116
  ]);
117
117
  const start = await CodeRunner.#start(options, { hostAttached: false, interactive: true, ask: true });
118
118
  const agentOptions = start.agent;
@@ -148,7 +148,7 @@ class CodeRunner extends runner("code") {
148
148
  }
149
149
  }
150
150
  async run(prompt, options) {
151
- const { CodeAgent } = await import("./CodeAgent-h6g8dg3a.js");
151
+ const { CodeAgent } = await import("./CodeAgent-vmd9k4ak.js");
152
152
  const ask = !!process.stdin.isTTY && !!process.stderr.isTTY;
153
153
  const start = await CodeRunner.#start(options, { hostAttached: false, interactive: false, ask });
154
154
  for (const warning of start.warnings)
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  stripAnsi
4
- } from "./index-tenw3mah.js";
4
+ } from "./index-23860fej.js";
5
5
  import {
6
6
  writeClipboard
7
7
  } from "./index-p6pbz9n5.js";
@@ -8,10 +8,10 @@ class PreviewChrome2 {
8
8
  static pathEnvKey = "BUN_CHROME_PATH";
9
9
  static backendEnvKey = "AKAN_CODE_WEBVIEW_BACKEND";
10
10
  static executables = [
11
- "chromium",
12
- "chromium-browser",
13
11
  "google-chrome-stable",
14
12
  "google-chrome",
13
+ "chromium-browser",
14
+ "chromium",
15
15
  "brave-browser",
16
16
  "microsoft-edge",
17
17
  "chrome"
@@ -79,6 +79,8 @@ class PreviewChrome2 {
79
79
 
80
80
  // pkgs/@akanjs/devkit/preview/PreviewView.ts
81
81
  class PreviewView2 {
82
+ static startTimeoutMs = 120000;
83
+ static #stalled = new Set;
82
84
  static get available() {
83
85
  return PreviewView2.isAvailable();
84
86
  }
@@ -95,14 +97,22 @@ class PreviewView2 {
95
97
  width = 1280,
96
98
  height = 800,
97
99
  engine = PreviewChrome2.backend,
100
+ startTimeoutMs = PreviewView2.startTimeoutMs,
98
101
  timeoutMs = 30000,
99
102
  settleMs = 0
100
103
  } = {}) {
101
104
  const logs = [];
102
- const deadline = Date.now() + timeoutMs;
103
- const within = (work, what) => PreviewView2.#within(work, deadline, `${what} ${url}`);
104
105
  const view = PreviewView2.#open({ width, height, engine, onConsole: (line) => logs.push(line) });
105
106
  try {
107
+ const startMs = PreviewView2.#stalled.has(engine) ? Math.min(startTimeoutMs, timeoutMs) : startTimeoutMs;
108
+ const stalled = new Error(`Timed out starting the ${engine} browser after ${startMs / 1000} s.`);
109
+ await PreviewView2.#within(view.navigate("about:blank"), Date.now() + startMs, stalled).then(() => PreviewView2.#stalled.delete(engine), (error) => {
110
+ if (error === stalled)
111
+ PreviewView2.#stalled.add(engine);
112
+ throw error;
113
+ });
114
+ const deadline = Date.now() + timeoutMs;
115
+ const within = (work, what) => PreviewView2.#within(work, deadline, new Error(`Timed out ${what} ${url}; the dev server may be rebuilding or stuck.`));
106
116
  let page = await PreviewView2.#load(view, url, settleMs, within);
107
117
  if (page.empty) {
108
118
  logs.length = 0;
@@ -146,10 +156,10 @@ class PreviewView2 {
146
156
  const response = await fetch(href, { redirect: "manual", signal: AbortSignal.timeout(left) }).catch(() => null);
147
157
  return response?.status ?? null;
148
158
  }
149
- static async#within(work, deadline, what) {
159
+ static async#within(work, deadline, expiry) {
150
160
  let timer;
151
161
  const expired = new Promise((_, reject) => {
152
- timer = setTimeout(() => reject(new Error(`Timed out ${what}; the dev server may be rebuilding or stuck.`)), Math.max(0, deadline - Date.now()));
162
+ timer = setTimeout(() => reject(expiry), Math.max(0, deadline - Date.now()));
153
163
  });
154
164
  try {
155
165
  return await Promise.race([work, expired]);
@@ -157,7 +157,7 @@ class SubagentPool2 {
157
157
  }
158
158
  }
159
159
  async#run(id, kind, prompt, signal) {
160
- const { CodeAgent } = await import("./CodeAgent-h6g8dg3a.js");
160
+ const { CodeAgent } = await import("./CodeAgent-vmd9k4ak.js");
161
161
  const budget = this.#options.parent.tools.subagent;
162
162
  const child = SubagentPool2.childOf(this.#options.parent, kind);
163
163
  const model = this.#options.model?.();
@@ -11,15 +11,15 @@ import {
11
11
  McpServerConfig,
12
12
  WorkspaceTrust
13
13
  } from "./index-w15mg3km.js";
14
+ import {
15
+ PreviewView2,
16
+ stripAnsi
17
+ } from "./index-23860fej.js";
14
18
  import {
15
19
  SubagentPool2,
16
20
  McpSignIn,
17
21
  AkanCodeCompaction2
18
- } from "./index-3wjbhj2n.js";
19
- import {
20
- PreviewView2,
21
- stripAnsi
22
- } from "./index-tenw3mah.js";
22
+ } from "./index-8kczhnmv.js";
23
23
  import {
24
24
  codeAgentIsLoopback,
25
25
  codeAgentHostListed,
@@ -18,7 +18,7 @@ import {
18
18
  } from "./index-93ewzmp6.js";
19
19
  import {
20
20
  ApplicationScript
21
- } from "./index-ryrm5z2c.js";
21
+ } from "./index-vr68mxj5.js";
22
22
  import {
23
23
  PackageScript
24
24
  } from "./index-d4n1wmrz.js";
@@ -28,7 +28,7 @@ import {
28
28
  PreviewChrome2,
29
29
  PreviewView2,
30
30
  stripAnsi
31
- } from "./index-tenw3mah.js";
31
+ } from "./index-23860fej.js";
32
32
  import {
33
33
  formatSlicePlan
34
34
  } from "./index-sy481q2x.js";
@@ -1483,7 +1483,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
1483
1483
  throw new Error("No app selected to start");
1484
1484
  const startedDatabase = dbup ? await this.#prepareSharedDatabase(apps) : false;
1485
1485
  const supervisor = new DevSupervisor({ apps, mode, concurrency, open, write, shares });
1486
- const view = mode === "tui" ? new (await import("./devTui-evr3b35y.js")).DevTui(supervisor) : new DevStreamView(apps.map((app) => app.name));
1486
+ const view = mode === "tui" ? new (await import("./devTui-w38ch13a.js")).DevTui(supervisor) : new DevStreamView(apps.map((app) => app.name));
1487
1487
  await supervisor.run(view);
1488
1488
  if (startedDatabase)
1489
1489
  await this.#stopDatabase(workspace);
package/index.js CHANGED
@@ -22,18 +22,18 @@ import path from "path";
22
22
 
23
23
  // pkgs/@akanjs/cli/commandModules.ts
24
24
  var commandModules = {
25
- workspace: async () => (await import("./workspace.command-rw1p0xeq.js")).WorkspaceCommand,
25
+ workspace: async () => (await import("./workspace.command-6z2rh8ze.js")).WorkspaceCommand,
26
26
  agent: async () => (await import("./agent.command-2f657613.js")).AgentCommand,
27
- code: async () => (await import("./code.command-7m67c7zc.js")).CodeCommand,
28
- application: async () => (await import("./application.command-yb8v177e.js")).ApplicationCommand,
27
+ code: async () => (await import("./code.command-7s4ndq2k.js")).CodeCommand,
28
+ application: async () => (await import("./application.command-q6skd3am.js")).ApplicationCommand,
29
29
  library: async () => (await import("./library.command-1gp5qe3r.js")).LibraryCommand,
30
- localRegistry: async () => (await import("./localRegistry.command-v3g21rex.js")).LocalRegistryCommand,
30
+ localRegistry: async () => (await import("./localRegistry.command-x7jptkd3.js")).LocalRegistryCommand,
31
31
  package: async () => (await import("./package.command-s7qpnn1g.js")).PackageCommand,
32
32
  module: async () => (await import("./module.command-4xz9he6h.js")).ModuleCommand,
33
33
  page: async () => (await import("./page.command-fan34c49.js")).PageCommand,
34
34
  context: async () => (await import("./context.command-569z0rqf.js")).ContextCommand,
35
- cloud: async () => (await import("./cloud.command-et06ja22.js")).CloudCommand,
36
- subspace: async () => (await import("./subspace.command-yxtt3v3e.js")).SubspaceCommand,
35
+ cloud: async () => (await import("./cloud.command-7642pks6.js")).CloudCommand,
36
+ subspace: async () => (await import("./subspace.command-qw5ddd6y.js")).SubspaceCommand,
37
37
  guideline: async () => (await import("./guideline.command-gnv3e8p8.js")).GuidelineCommand,
38
38
  scalar: async () => (await import("./scalar.command-cnvfhk0n.js")).ScalarCommand,
39
39
  primitive: async () => (await import("./primitive.command-3fqh8emf.js")).PrimitiveCommand,
@@ -23,10 +23,10 @@ import"./index-1q1cjn8s.js";
23
23
  import"./index-mmym5xmb.js";
24
24
  import"./index-mqntfzv5.js";
25
25
  import"./index-ktb3wcqz.js";
26
+ import"./index-23860fej.js";
26
27
  import {
27
28
  ApplicationScript
28
- } from "./index-ryrm5z2c.js";
29
- import"./index-tenw3mah.js";
29
+ } from "./index-vr68mxj5.js";
30
30
  import"./index-drz9e84d.js";
31
31
  import {
32
32
  CloudRunner
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.2.0-rc.0",
3
+ "version": "3.2.0-rc.1",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "1.3.0",
40
40
  "@inquirer/prompts": "^8.7.3",
41
41
  "@tailwindcss/node": "^4.3.3",
42
- "akanjs": "3.2.0-rc.0",
42
+ "akanjs": "3.2.0-rc.1",
43
43
  "chalk": "^6.0.1",
44
44
  "commander": "^15.0.0",
45
45
  "dayjs": "^1.11.23",
@@ -818,7 +818,7 @@ class SubspaceRunner extends runner("subspace") {
818
818
  if (!asked)
819
819
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
820
820
  const { libs } = await subspace.slice();
821
- const { CloudScript } = await import("./cloud.script-s6rbrwer.js");
821
+ const { CloudScript } = await import("./cloud.script-1sfseznn.js");
822
822
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
823
823
  host,
824
824
  workspaceId,
@@ -43,10 +43,10 @@ import {
43
43
  import {
44
44
  LibraryScript
45
45
  } from "./index-mqntfzv5.js";
46
+ import"./index-23860fej.js";
46
47
  import {
47
48
  ApplicationScript
48
- } from "./index-ryrm5z2c.js";
49
- import"./index-tenw3mah.js";
49
+ } from "./index-vr68mxj5.js";
50
50
  import"./index-drz9e84d.js";
51
51
  import"./index-qd7xn2bk.js";
52
52
  import"./index-abgh0jve.js";
@@ -56,7 +56,7 @@ import {
56
56
  import"./index-6wpaq392.js";
57
57
  import {
58
58
  CloudScript2
59
- } from "./index-zxsygkda.js";
59
+ } from "./index-v4p1zye8.js";
60
60
  import"./index-rc5fvqj2.js";
61
61
  import"./index-w639tvkd.js";
62
62
  import"./index-0fb3cpbt.js";