@isomorph.ai/cli 0.7.1 → 0.7.3

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.
@@ -78,6 +78,15 @@ export async function login(mcpUrl, tenant, output) {
78
78
  callback.close();
79
79
  }
80
80
  }
81
+ /**
82
+ * The account this device is already signed in as, or undefined: a stored
83
+ * token that still answers the userinfo endpoint. `login` stops here instead
84
+ * of opening the browser again.
85
+ */
86
+ export async function alreadySignedIn(mcpUrl, tenant, path = tokenStorePath()) {
87
+ const token = await refreshStoredToken(mcpUrl, tenant, path).catch(() => undefined);
88
+ return token ? connectedAccount(mcpUrl, tenant, token, path) : undefined;
89
+ }
81
90
  /** Refresh only when the access token is within this margin of expiry. */
82
91
  const REFRESH_MARGIN_MS = 5 * 60_000;
83
92
  /**
@@ -3,7 +3,7 @@ import { appCallsAi, deploy, readDeployNote } from "./deploy.js";
3
3
  import { continueCommand, follow, promoteToProduction, retryDeployment, statusFetch, summarize } from "./operations.js";
4
4
  import { CliError, failureEnvelope, operationEnvelope, renderFailure, renderSummary } from "./output.js";
5
5
  import { CLI_VERSION } from "./version.js";
6
- import { connectedAccount, login, logout, refreshStoredToken } from "./auth.js";
6
+ import { alreadySignedIn, connectedAccount, login, logout, refreshStoredToken } from "./auth.js";
7
7
  import { assertCliCurrent, companyLabel, connect, loadConfig, resolveConfig } from "./config.js";
8
8
  import { EMBEDDED_KIT_BUNDLE } from "./kit-bundle.js";
9
9
  import { appRoot, assertLockCompany, readAppProfile, readKitLock, requestResourceName } from "./kit.js";
@@ -216,7 +216,15 @@ else {
216
216
  const url = config.mcpUrl;
217
217
  const tenant = config.tenantId;
218
218
  if (command === "login") {
219
- await login(url, tenant, progress);
219
+ // Already signed in: say so and stop. Opening the browser again cost
220
+ // every unattended builder five minutes (auth.ts loopbackCallback), and
221
+ // when the sign-in could not complete, agents escalated to `logout`
222
+ // — which signs the whole machine out (bench, 2026-09-16).
223
+ const already = await alreadySignedIn(url, tenant);
224
+ if (!already)
225
+ await login(url, tenant, progress);
226
+ else
227
+ progress(`Already signed in to ${companyLabel(config)} as ${already}; nothing to do. Run \`isomorph logout\` first to sign in as someone else.`);
220
228
  const signedIn = await signedInDetails(config);
221
229
  emit(summaryEnvelope({ tenantId: tenant, displayName: config.displayName, ...signedIn }), signedIn ? `Signed in to ${companyLabel(config)} as ${signedIn.account}. ${companySystemsLine(signedIn.connections)}\n` : "Isomorph sign-in complete.\n");
222
230
  }
@@ -48,6 +48,17 @@ export async function runJob(root, name, scheduledAt, run = runCommand, real = f
48
48
  const gatewayUrl = real ? lock.origin : `http://127.0.0.1:${lock.ports.gateway}`;
49
49
  const result = await run(process.execPath, ["--experimental-strip-types", "--input-type=module", "--eval", runner], { cwd: root, env: { ...env, ISOMORPH_GATEWAY_URL: gatewayUrl, ISOMORPH_SCHEDULED_AT: timestamp } });
50
50
  if (result.code !== 0)
51
- throw new CliError("JOB_FAILED", `Job ${name} failed: ${result.stderr.trim().split("\n").at(-1) ?? "process exited non-zero"}`);
51
+ throw new CliError("JOB_FAILED", `Job ${name} failed: ${jobFailureReason(result.stderr)}`, undefined, "Fix what the error names in jobs/<name>.ts, then run this again; `details.stderr` carries the last lines.", undefined, { details: { stderr: result.stderr.trim().split("\n").slice(-20) } });
52
52
  return { name, schedule: job.schedule, scheduledAt: timestamp, mode: real ? "real" : "local" };
53
53
  }
54
+ /**
55
+ * The line of a failed job's stderr that says what went wrong. Node prints
56
+ * the stack first and its own version last, so the last line — what this
57
+ * used to report — was `Node.js v24.19.0` ten times in one build (bench
58
+ * s19, 2026-09-16). The first line naming an error wins; failing that, the
59
+ * first non-empty line.
60
+ */
61
+ export function jobFailureReason(stderr) {
62
+ const lines = stderr.split("\n").map(line => line.trim()).filter(Boolean);
63
+ return lines.find(line => /\b(?:error|exception|failed|cannot|unexpected|invalid|denied|refused)\b/i.test(line)) ?? lines[0] ?? "process exited non-zero";
64
+ }
@@ -1,6 +1,6 @@
1
1
  export const PUBLISHED_KIT_BUNDLE = {
2
2
  "schema": "isomorph.kit-bundle/1.0",
3
- "kitVersion": "0.7.1",
3
+ "kitVersion": "0.7.2",
4
4
  "sdk": {
5
5
  "package": "@isomorph.ai/app-sdk",
6
6
  "version": "1.2.2",
@@ -8,21 +8,21 @@ export const PUBLISHED_KIT_BUNDLE = {
8
8
  "url": "https://public.ecr.aws/v2/y6t4p3i8/harbour-kit-bundle/blobs/sha256:8953bb7eb6846bcddf48fd5407c098a13c8ad2cf249d702c35b5666d5af0ad53"
9
9
  },
10
10
  "images": {
11
- "appGateway": "public.ecr.aws/y6t4p3i8/harbour-app-gateway@sha256:9d5510db8396cc27c509047f668b63a85ec3892db83cb658c045b2db2d7bddeb",
12
- "sessionFixture": "public.ecr.aws/y6t4p3i8/harbour-session-fixture@sha256:aec4aa7dfc5128e31448f50088f15550846836ec7ef920368ca2d82b31dbf486"
11
+ "appGateway": "public.ecr.aws/y6t4p3i8/harbour-app-gateway@sha256:2779990e78ff2bd9802c0bce5dc8487a95e6ac7148621e26709df201d93eda80",
12
+ "sessionFixture": "public.ecr.aws/y6t4p3i8/harbour-session-fixture@sha256:efe143ca983fc450cf598e28738a48c7f83e91631b5ab2af5148b919d68e8f78"
13
13
  },
14
14
  "nativeRuntime": {
15
15
  "darwinArm64": {
16
- "url": "https://public.ecr.aws/v2/y6t4p3i8/harbour-kit-bundle/blobs/sha256:3f4bbf08b814888f7ff64ff968362a944dfba742668927f04a331f8c4850da21",
17
- "sha256": "3f4bbf08b814888f7ff64ff968362a944dfba742668927f04a331f8c4850da21"
16
+ "url": "https://public.ecr.aws/v2/y6t4p3i8/harbour-kit-bundle/blobs/sha256:98857d8c93689295c63060f29ceae7d4879164fa6299fb53411dc61e4bcd487a",
17
+ "sha256": "98857d8c93689295c63060f29ceae7d4879164fa6299fb53411dc61e4bcd487a"
18
18
  },
19
19
  "linuxX64": {
20
- "url": "https://public.ecr.aws/v2/y6t4p3i8/harbour-kit-bundle/blobs/sha256:eea2faf265666cfe46c168d42b60cd0fc5431b43a72b3f409aa63dab7fee8524",
21
- "sha256": "eea2faf265666cfe46c168d42b60cd0fc5431b43a72b3f409aa63dab7fee8524"
20
+ "url": "https://public.ecr.aws/v2/y6t4p3i8/harbour-kit-bundle/blobs/sha256:c7f04ac6e9c1ec03a5204a5c80b5ac9a5d1a45e07191ecf25cc904256fee90a2",
21
+ "sha256": "c7f04ac6e9c1ec03a5204a5c80b5ac9a5d1a45e07191ecf25cc904256fee90a2"
22
22
  },
23
23
  "windowsX64": {
24
- "url": "https://public.ecr.aws/v2/y6t4p3i8/harbour-kit-bundle/blobs/sha256:3e1876f0ba701b838a707aa45e6cf4620e06f40aa8c855ce2a65437c752c369a",
25
- "sha256": "3e1876f0ba701b838a707aa45e6cf4620e06f40aa8c855ce2a65437c752c369a"
24
+ "url": "https://public.ecr.aws/v2/y6t4p3i8/harbour-kit-bundle/blobs/sha256:bf38cccfec86624a622284cfede1288ff1f353f0767f560d1068785595d72a02",
25
+ "sha256": "bf38cccfec86624a622284cfede1288ff1f353f0767f560d1068785595d72a02"
26
26
  }
27
27
  },
28
28
  "brief": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isomorph.ai/cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Isomorph development kit CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "harbour": {
38
38
  "kitBundle": {
39
39
  "repository": "public.ecr.aws/y6t4p3i8/harbour-kit-bundle",
40
- "version": "0.7.1"
40
+ "version": "0.7.2"
41
41
  }
42
42
  }
43
43
  }