indusagi-coding-agent 0.2.10 → 0.2.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.11]
4
+
5
+ ### Fixed
6
+ - **Fatal startup visibility**: uncaught boot failures now print their actual message and exit with status `1` instead of producing an empty failure log.
7
+
3
8
  ## [0.2.10]
4
9
 
5
10
  ### Fixed
package/dist/entry.js CHANGED
@@ -18,7 +18,7 @@ var BRAND = Object.freeze({
18
18
  envShareViewer: "INDUSAGI_SHARE_VIEWER_URL",
19
19
  shareViewerUrl: "https://buildwithindusagi.ai/session/"
20
20
  });
21
- var VERSION = "0.2.10";
21
+ var VERSION = "0.2.11";
22
22
 
23
23
  // src/launch/credentials.ts
24
24
  import { createInterface as createInterface2 } from "node:readline/promises";
@@ -16812,13 +16812,26 @@ function isProgramEntry() {
16812
16812
  return false;
16813
16813
  }
16814
16814
  }
16815
+ async function resolveBoot(result) {
16816
+ try {
16817
+ return await result;
16818
+ } catch (error) {
16819
+ const message = error instanceof Error ? error.message : String(error);
16820
+ process.stderr.write(`${BRAND.name}: ${message}
16821
+ `);
16822
+ return 1;
16823
+ }
16824
+ }
16815
16825
  process.title = BRAND.binNames[0];
16816
16826
  installMcpNoiseFilter();
16817
16827
  if (isProgramEntry()) {
16818
16828
  ensureHeapHeadroom();
16819
- void boot(processArgv.slice(2)).then((code) => {
16829
+ void resolveBoot(boot(processArgv.slice(2))).then((code) => {
16820
16830
  process.exitCode = code;
16821
16831
  process.stdout.write("", () => process.exit(code));
16822
16832
  setTimeout(() => process.exit(code), 1e3).unref();
16823
16833
  });
16824
16834
  }
16835
+ export {
16836
+ resolveBoot
16837
+ };
package/dist/index.js CHANGED
@@ -50,7 +50,7 @@ var BRAND = Object.freeze({
50
50
  envShareViewer: "INDUSAGI_SHARE_VIEWER_URL",
51
51
  shareViewerUrl: "https://buildwithindusagi.ai/session/"
52
52
  });
53
- var VERSION = "0.2.10";
53
+ var VERSION = "0.2.11";
54
54
 
55
55
  // src/launch/credentials.ts
56
56
  import { createInterface as createInterface2 } from "node:readline/promises";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indusagi-coding-agent",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Indusagi coding agent — a terminal-first AI coding agent, built from scratch on the indusagi framework.",
5
5
  "author": "Varun Israni",
6
6
  "license": "AGPL-3.0",
@@ -0,0 +1,17 @@
1
+ import { afterEach, describe, expect, it, vi } from "vitest";
2
+ import { resolveBoot } from "./entry.js";
3
+
4
+ describe("resolveBoot", () => {
5
+ afterEach(() => vi.restoreAllMocks());
6
+
7
+ it("prints fatal boot errors and returns a failing exit code", async () => {
8
+ const stderr = vi.spyOn(process.stderr, "write").mockReturnValue(true);
9
+
10
+ await expect(resolveBoot(Promise.reject(new Error("startup failed")))).resolves.toBe(1);
11
+ expect(stderr).toHaveBeenCalledWith("indusagi: startup failed\n");
12
+ });
13
+
14
+ it("preserves successful exit codes", async () => {
15
+ await expect(resolveBoot(Promise.resolve(0))).resolves.toBe(0);
16
+ });
17
+ });
package/src/entry.ts CHANGED
@@ -43,11 +43,21 @@ function isProgramEntry(): boolean {
43
43
  }
44
44
  }
45
45
 
46
+ export async function resolveBoot(result: Promise<number>): Promise<number> {
47
+ try {
48
+ return await result;
49
+ } catch (error) {
50
+ const message = error instanceof Error ? error.message : String(error);
51
+ process.stderr.write(`${BRAND.name}: ${message}\n`);
52
+ return 1;
53
+ }
54
+ }
55
+
46
56
  process.title = BRAND.binNames[0];
47
57
  installMcpNoiseFilter();
48
58
  if (isProgramEntry()) {
49
59
  ensureHeapHeadroom();
50
- void boot(processArgv.slice(2)).then((code) => {
60
+ void resolveBoot(boot(processArgv.slice(2))).then((code) => {
51
61
  process.exitCode = code;
52
62
  process.stdout.write("", () => process.exit(code));
53
63
  setTimeout(() => process.exit(code), 1e3).unref();
@@ -26,4 +26,4 @@ export const BRAND: Brand = Object.freeze({
26
26
  /**
27
27
  * The product version — printed by `--version` and shown on the startup banner.
28
28
  */
29
- export const VERSION = "0.2.10";
29
+ export const VERSION = "0.2.11";