@andorra-labs/code 0.1.9 → 0.1.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.
Files changed (212) hide show
  1. package/README.md +28 -208
  2. package/THIRD_PARTY_NOTICES.md +15 -0
  3. package/dist/src/agent-execution.js +56 -0
  4. package/dist/src/app-server/protocol.d.ts +109 -1
  5. package/dist/src/app-server/protocol.js +8 -1
  6. package/dist/src/app-server.d.ts +59 -1
  7. package/dist/src/app-server.js +418 -63
  8. package/dist/src/auth/index.d.ts +1 -1
  9. package/dist/src/auth/index.js +1 -1
  10. package/dist/src/auth/store.d.ts +17 -1
  11. package/dist/src/auth/store.js +25 -2
  12. package/dist/src/automation-service.js +1 -1
  13. package/dist/src/browser-session.d.ts +8 -0
  14. package/dist/src/browser-session.js +27 -1
  15. package/dist/src/browser-ui/app.js +255 -33
  16. package/dist/src/browser-ui/index.html +9 -9
  17. package/dist/src/browser-ui/style.css +110 -65
  18. package/dist/src/browser-ui/tokens.css +27 -26
  19. package/dist/src/cli.js +10 -5
  20. package/dist/src/coding-tools.d.ts +24 -0
  21. package/dist/src/coding-tools.js +71 -8
  22. package/dist/src/command-screens.js +1 -1
  23. package/dist/src/commands.d.ts +1 -1
  24. package/dist/src/commands.js +2 -2
  25. package/dist/src/completion-gates.d.ts +42 -7
  26. package/dist/src/completion-gates.js +55 -9
  27. package/dist/src/completion.d.ts +9 -1
  28. package/dist/src/completion.js +20 -2
  29. package/dist/src/dashboard-view.js +2 -2
  30. package/dist/src/deadline.js +4 -0
  31. package/dist/src/decision/checks.js +1 -1
  32. package/dist/src/file-diff.d.ts +105 -0
  33. package/dist/src/file-diff.js +244 -0
  34. package/dist/src/graph-manager-chat.js +4 -4
  35. package/dist/src/graph-runner.js +39 -2
  36. package/dist/src/graph-sync.d.ts +8 -0
  37. package/dist/src/graph-sync.js +54 -3
  38. package/dist/src/graph-tool.js +1 -1
  39. package/dist/src/graph-ui/app.js +303 -129
  40. package/dist/src/graph-ui/controls.css +43 -22
  41. package/dist/src/graph-ui/controls.js +31 -1
  42. package/dist/src/graph-ui/embed.js +56 -7
  43. package/dist/src/graph-ui/icons.js +5 -0
  44. package/dist/src/graph-ui/index.html +3 -3
  45. package/dist/src/graph-ui/manager-state.js +2 -2
  46. package/dist/src/graph-ui/manager.css +19 -18
  47. package/dist/src/graph-ui/manager.js +5 -5
  48. package/dist/src/graph-ui/skill-picker.js +5 -5
  49. package/dist/src/graph-ui/studio-canvas.js +16 -16
  50. package/dist/src/graph-ui/studio.css +18 -15
  51. package/dist/src/graph-ui/studio.js +99 -42
  52. package/dist/src/graph-ui/style.css +125 -80
  53. package/dist/src/graph-ui/theme.js +2 -2
  54. package/dist/src/graph-ui/tokens.css +33 -29
  55. package/dist/src/graphs.d.ts +10 -3
  56. package/dist/src/graphs.js +15 -4
  57. package/dist/src/mcp.d.ts +75 -0
  58. package/dist/src/mcp.js +240 -8
  59. package/dist/src/membership-errors.d.ts +7 -1
  60. package/dist/src/membership-errors.js +9 -3
  61. package/dist/src/provider-keys.d.ts +5 -1
  62. package/dist/src/provider-keys.js +7 -3
  63. package/dist/src/provider-settings.d.ts +4 -1
  64. package/dist/src/provider-settings.js +46 -5
  65. package/dist/src/pull-requests.d.ts +42 -6
  66. package/dist/src/pull-requests.js +11 -3
  67. package/dist/src/qa/guidance.js +6 -19
  68. package/dist/src/qa/index.d.ts +0 -2
  69. package/dist/src/qa/index.js +0 -2
  70. package/dist/src/qa/profile/QaProfile.d.ts +5 -1
  71. package/dist/src/qa/profile/QaProfile.js +6 -2
  72. package/dist/src/qa/tools.d.ts +19 -1
  73. package/dist/src/qa/tools.js +20 -145
  74. package/dist/src/react-runtime.js +134 -16
  75. package/dist/src/read-document-doc.d.ts +20 -0
  76. package/dist/src/read-document-doc.js +524 -0
  77. package/dist/src/read-document-docx.d.ts +21 -0
  78. package/dist/src/read-document-docx.js +584 -0
  79. package/dist/src/read-document-text.d.ts +29 -0
  80. package/dist/src/read-document-text.js +67 -0
  81. package/dist/src/read-document-tool.d.ts +48 -0
  82. package/dist/src/read-document-tool.js +162 -0
  83. package/dist/src/read-document.d.ts +78 -0
  84. package/dist/src/read-document.js +353 -0
  85. package/dist/src/read-image.d.ts +29 -2
  86. package/dist/src/read-image.js +42 -17
  87. package/dist/src/remote/engine-pool.js +18 -6
  88. package/dist/src/runtime.d.ts +19 -0
  89. package/dist/src/runtime.js +10 -1
  90. package/dist/src/screen-selection.d.ts +38 -0
  91. package/dist/src/screen-selection.js +103 -0
  92. package/dist/src/session-changes.d.ts +122 -0
  93. package/dist/src/session-changes.js +804 -0
  94. package/dist/src/side-panel.d.ts +6 -1
  95. package/dist/src/side-panel.js +12 -10
  96. package/dist/src/skills/bundled/create-skill/SKILL.md +1 -1
  97. package/dist/src/skills/bundled/diagram/SKILL.md +1 -1
  98. package/dist/src/skills/bundled/graph-manager/SKILL.md +37 -3
  99. package/dist/src/skills/bundled/graph-manager/patterns.md +27 -0
  100. package/dist/src/skills/bundled/provenance.json +4 -4
  101. package/dist/src/skills/runtime-skills.js +3 -3
  102. package/dist/src/stall-recovery.d.ts +15 -0
  103. package/dist/src/stall-recovery.js +17 -0
  104. package/dist/src/telemetry/schema.d.ts +1 -1
  105. package/dist/src/telemetry/schema.js +1 -2
  106. package/dist/src/terminal-ui.d.ts +64 -20
  107. package/dist/src/terminal-ui.js +312 -82
  108. package/dist/src/time-limit.d.ts +53 -0
  109. package/dist/src/time-limit.js +79 -0
  110. package/dist/src/tool-diff-stats.d.ts +9 -0
  111. package/dist/src/tool-diff-stats.js +20 -0
  112. package/dist/src/tool-names.d.ts +1 -1
  113. package/dist/src/tool-result-filter.js +1 -1
  114. package/dist/src/tools.js +118 -9
  115. package/dist/src/transcript.d.ts +11 -0
  116. package/dist/src/transcript.js +15 -3
  117. package/dist/src/types.d.ts +12 -0
  118. package/dist/src/usage-analytics.d.ts +3 -1
  119. package/dist/src/usage-analytics.js +16 -2
  120. package/package.json +6 -26
  121. package/dist/src/qa/api/http-runner.d.ts +0 -3
  122. package/dist/src/qa/api/http-runner.js +0 -47
  123. package/dist/src/qa/git/ChangeDetector.d.ts +0 -26
  124. package/dist/src/qa/git/ChangeDetector.js +0 -177
  125. package/dist/src/qa/git/DiffReviewer.d.ts +0 -28
  126. package/dist/src/qa/git/DiffReviewer.js +0 -115
  127. package/dist/src/qa/orchestrator/ChangeClassifier.d.ts +0 -14
  128. package/dist/src/qa/orchestrator/ChangeClassifier.js +0 -28
  129. package/dist/src/qa/orchestrator/MergeGate.d.ts +0 -14
  130. package/dist/src/qa/orchestrator/MergeGate.js +0 -40
  131. package/dist/src/qa/orchestrator/QaOrchestrator.d.ts +0 -79
  132. package/dist/src/qa/orchestrator/QaOrchestrator.js +0 -373
  133. package/dist/src/qa/runners/CommandRunner.d.ts +0 -22
  134. package/dist/src/qa/runners/CommandRunner.js +0 -96
  135. package/dist/src/qa/runners/TestRunner.d.ts +0 -21
  136. package/dist/src/qa/runners/TestRunner.js +0 -66
  137. package/dist/src/qa/runtime/RuntimeSmoke.d.ts +0 -11
  138. package/dist/src/qa/runtime/RuntimeSmoke.js +0 -78
  139. package/dist/src/qa/runtime-detect.d.ts +0 -10
  140. package/dist/src/qa/runtime-detect.js +0 -72
  141. package/dist/src/qa/security/DependencyScanner.d.ts +0 -19
  142. package/dist/src/qa/security/DependencyScanner.js +0 -167
  143. package/dist/src/qa/security/SecretScanner.d.ts +0 -3
  144. package/dist/src/qa/security/SecretScanner.js +0 -55
  145. package/docs/README.md +0 -36
  146. package/docs/agents/README.md +0 -62
  147. package/docs/agents/install-for-agents.md +0 -56
  148. package/docs/agents/mcp-server.md +0 -212
  149. package/docs/agents/subagent-mode.md +0 -149
  150. package/docs/concepts/README.md +0 -47
  151. package/docs/concepts/jev-actionable-routing.md +0 -113
  152. package/docs/concepts/jev-decision-thresholds.md +0 -412
  153. package/docs/concepts/jev-efficiency.md +0 -217
  154. package/docs/concepts/jev-eval-2026-11-01.md +0 -78
  155. package/docs/concepts/limits.md +0 -52
  156. package/docs/concepts/memory.md +0 -10
  157. package/docs/concepts/security.md +0 -50
  158. package/docs/concepts/workspace-instructions.md +0 -29
  159. package/docs/getting-started/README.md +0 -82
  160. package/docs/getting-started/accounts.md +0 -78
  161. package/docs/getting-started/configure-providers.md +0 -132
  162. package/docs/guides/README.md +0 -13
  163. package/docs/guides/browser.md +0 -39
  164. package/docs/guides/desktop-app.md +0 -414
  165. package/docs/guides/extensions.md +0 -102
  166. package/docs/guides/graph-builder.md +0 -116
  167. package/docs/guides/headless.md +0 -46
  168. package/docs/guides/tui.md +0 -75
  169. package/docs/guides/update.md +0 -70
  170. package/docs/guides/web-search.md +0 -51
  171. package/docs/guides/windows-code-signing.md +0 -319
  172. package/docs/llms.txt +0 -45
  173. package/docs/reference/README.md +0 -7
  174. package/docs/reference/cli.md +0 -76
  175. package/docs/reference/config.md +0 -91
  176. package/docs/reference/slash-commands.md +0 -59
  177. package/docs/superpowers/plans/2026-11-01-claude-console-sign-in.md +0 -111
  178. package/docs/superpowers/plans/2026-11-01-jev-node-opt-in.md +0 -910
  179. package/docs/superpowers/plans/2026-11-02-workflow-pane.md +0 -398
  180. package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +0 -125
  181. package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +0 -295
  182. package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +0 -203
  183. package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +0 -79
  184. package/docs/superpowers/specs/2026-10-31-work-line-summary-design.md +0 -50
  185. package/docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md +0 -176
  186. package/docs/superpowers/specs/2026-11-01-jev-node-opt-in-design.md +0 -164
  187. package/docs/superpowers/specs/2026-11-01-pr-section-design.md +0 -111
  188. package/docs/superpowers/specs/2026-11-02-workflow-pane-design.md +0 -130
  189. package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +0 -206
  190. package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +0 -291
  191. package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +0 -182
  192. package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +0 -156
  193. package/scripts/jev-efficiency-eval.mjs +0 -187
  194. package/scripts/jev-efficiency-live.mjs +0 -193
  195. package/scripts/zcode-engine-replay.mjs +0 -223
  196. package/tests/agent-centric-mcp-test-plan.md +0 -208
  197. package/tests/analytics-settings-test-plan.md +0 -165
  198. package/tests/browser-cli-smoke.mjs +0 -276
  199. package/tests/browser-test-plan.md +0 -280
  200. package/tests/chat-side-panel-test-plan.md +0 -309
  201. package/tests/decision-engine-test-plan.md +0 -163
  202. package/tests/default-active-jev-test-plan.md +0 -85
  203. package/tests/harness-extensions-test-plan.md +0 -113
  204. package/tests/jev-all-decisions-test-plan.md +0 -156
  205. package/tests/jev-efficiency/criteria.json +0 -158
  206. package/tests/jev-efficiency/workloads.mjs +0 -242
  207. package/tests/jev-efficiency-test-plan.md +0 -198
  208. package/tests/permissions-sandbox-probe.mjs +0 -74
  209. package/tests/permissions-test-plan.md +0 -191
  210. package/tests/product-telemetry-test-plan.md +0 -536
  211. package/tests/thinking-stream-preview-test-plan.md +0 -136
  212. package/tests/zcode-react-engine-test-plan.md +0 -396
@@ -3,7 +3,7 @@ import type { AuthConfiguration, AuthError } from './types.js';
3
3
  export * from './types.js';
4
4
  export { AuthManager, AUTH_REFRESH_BUDGET_MS } from './AuthManager.js';
5
5
  export { credentialIdentity } from './AuthManager.js';
6
- export { KeyringCredentialStore, KeyringAbsentError, FileCredentialStore, FallbackCredentialStore, createCredentialStore } from './store.js';
6
+ export { KeyringCredentialStore, KeyringAbsentError, KeyringUnreachableError, FileCredentialStore, FallbackCredentialStore, createCredentialStore } from './store.js';
7
7
  export declare function getAuthConfiguration(): AuthConfiguration;
8
8
  /**
9
9
  * Report an automatic sign-out: the account service rejected the stored refresh token, so the
@@ -3,7 +3,7 @@ import { AuthManager } from './AuthManager.js';
3
3
  export * from './types.js';
4
4
  export { AuthManager, AUTH_REFRESH_BUDGET_MS } from './AuthManager.js';
5
5
  export { credentialIdentity } from './AuthManager.js';
6
- export { KeyringCredentialStore, KeyringAbsentError, FileCredentialStore, FallbackCredentialStore, createCredentialStore } from './store.js';
6
+ export { KeyringCredentialStore, KeyringAbsentError, KeyringUnreachableError, FileCredentialStore, FallbackCredentialStore, createCredentialStore } from './store.js';
7
7
  export function getAuthConfiguration() { return { ...AUTH_DEPLOYMENT }; }
8
8
  let manager;
9
9
  let signOutReporter;
@@ -18,6 +18,21 @@ export declare class KeyringAbsentError extends AuthError {
18
18
  cause?: unknown;
19
19
  });
20
20
  }
21
+ /**
22
+ * A keyring that exists but is locked, and that this session has no way to unlock: a desktop Linux
23
+ * machine reached over SSH, whose login keyring nobody unlocked at the console. Its unlock prompt
24
+ * needs a display, so every read fails the same way until someone unlocks it at the machine.
25
+ *
26
+ * It holds nothing this process can reach, so it is handled like a machine without a store: reads
27
+ * and sign-ins fall back to the owner-only file, and a sign-out does not fail on tokens it cannot
28
+ * touch. A session with a display keeps reporting a locked keyring, because there the user can
29
+ * unlock it and a dismissed prompt is a choice.
30
+ */
31
+ export declare class KeyringUnreachableError extends KeyringAbsentError {
32
+ constructor(options?: {
33
+ cause?: unknown;
34
+ });
35
+ }
21
36
  /** The OS credential store service that Andorra sign-ins are saved under, one scope per identity. */
22
37
  export declare const SIGN_IN_SERVICE = "Andorra Code";
23
38
  /** Lazy native loading keeps offline BYOK usable on machines without a credential service. */
@@ -142,7 +157,8 @@ export declare class FallbackCredentialStore implements CredentialStore {
142
157
  * Unlike reads and writes, a keyring clear never falls back just because it failed: a keyring
143
158
  * that committed its tombstone and then could not delete an old token chunk still holds that
144
159
  * token, and switching to the file would report a sign-out that left it behind. Only a keyring
145
- * that cannot even be read holds nothing to clear, which is a machine without one.
160
+ * that cannot even be read holds nothing to clear: a machine without one, or a locked one this
161
+ * session has no display to unlock (its tokens stay for the console to clear).
146
162
  *
147
163
  * The other store is cleared too. A reachable keyring is cleared whether or not a session reads
148
164
  * back from it, because an interrupted keyring write leaves token chunks without the manifest
@@ -21,6 +21,25 @@ export class KeyringAbsentError extends AuthError {
21
21
  * A locked collection, a dismissed unlock prompt or any other failure is a store that exists.
22
22
  */
23
23
  const ABSENT_KEYRING = /not provided by any \.service files|org\.freedesktop\.DBus\.Error\.ServiceUnknown|dbus-daemon autolaunch|set your DBUS_SESSION_BUS_ADDRESS|Failed to connect to socket/i;
24
+ /**
25
+ * A keyring that exists but is locked, and that this session has no way to unlock: a desktop Linux
26
+ * machine reached over SSH, whose login keyring nobody unlocked at the console. Its unlock prompt
27
+ * needs a display, so every read fails the same way until someone unlocks it at the machine.
28
+ *
29
+ * It holds nothing this process can reach, so it is handled like a machine without a store: reads
30
+ * and sign-ins fall back to the owner-only file, and a sign-out does not fail on tokens it cannot
31
+ * touch. A session with a display keeps reporting a locked keyring, because there the user can
32
+ * unlock it and a dismissed prompt is a choice.
33
+ */
34
+ export class KeyringUnreachableError extends KeyringAbsentError {
35
+ constructor(options) { super('The OS credential store is locked, and this session has no display to unlock it on.', options); this.name = 'KeyringUnreachableError'; }
36
+ }
37
+ /** The errors a locked Secret Service collection gives through @napi-rs/keyring, or its dismissed unlock prompt. */
38
+ const LOCKED_KEYRING = /collection is locked|org\.freedesktop\.Secret\.Error\.IsLocked|prompt (?:was )?dismissed/i;
39
+ /** Whether this session can show the Secret Service unlock prompt: only a graphical session can. */
40
+ function canPromptToUnlock(environment = process.env) {
41
+ return Boolean(environment.DISPLAY || environment.WAYLAND_DISPLAY);
42
+ }
24
43
  function errorText(error) {
25
44
  const parts = [];
26
45
  for (let current = error, depth = 0; current && depth < 6; depth++) {
@@ -33,8 +52,11 @@ function errorText(error) {
33
52
  function keyringFailure(error, message) {
34
53
  if (error instanceof KeyringAbsentError)
35
54
  return error;
36
- if (ABSENT_KEYRING.test(errorText(error)))
55
+ const text = errorText(error);
56
+ if (ABSENT_KEYRING.test(text))
37
57
  return new KeyringAbsentError(undefined, { cause: error });
58
+ if (LOCKED_KEYRING.test(text) && !canPromptToUnlock())
59
+ return new KeyringUnreachableError({ cause: error });
38
60
  return new AuthError('storage', message, { cause: error });
39
61
  }
40
62
  const LOCKED_HINT = 'Unlock it and retry, or set ANDORRA_CREDENTIAL_STORE=file to keep the session in an owner-only file instead.';
@@ -374,7 +396,8 @@ export class FallbackCredentialStore {
374
396
  * Unlike reads and writes, a keyring clear never falls back just because it failed: a keyring
375
397
  * that committed its tombstone and then could not delete an old token chunk still holds that
376
398
  * token, and switching to the file would report a sign-out that left it behind. Only a keyring
377
- * that cannot even be read holds nothing to clear, which is a machine without one.
399
+ * that cannot even be read holds nothing to clear: a machine without one, or a locked one this
400
+ * session has no display to unlock (its tokens stay for the console to clear).
378
401
  *
379
402
  * The other store is cleared too. A reachable keyring is cleared whether or not a session reads
380
403
  * back from it, because an interrupted keyring write leaves token chunks without the manifest
@@ -57,7 +57,7 @@ async function status(directory) {
57
57
  const live = await contact(directory, 'status');
58
58
  const registered = await installed(directory);
59
59
  return { running: !!live, installed: registered, installSupported: process.platform === 'win32', ...(live ? { pid: live.pid } : {}),
60
- detail: live ? 'Background scheduler is running. The computer must stay awake and signed in.' : registered ? 'Start at sign-in is installed; the background scheduler is stopped.' : 'Background scheduler is stopped. App-open schedules still run while Andorra is open.' };
60
+ detail: live ? 'Background scheduler is running. The computer must stay awake and signed in.' : registered ? 'Start at sign-in is installed; the background scheduler is stopped.' : 'Background scheduler is stopped. App-open schedules still run while Andorra Code is open.' };
61
61
  }
62
62
  /** Authenticated loopback control avoids signalling an unrelated process after PID reuse. */
63
63
  export async function runAutomationDaemon(directory = configDirectory(), externalSignal) {
@@ -6,6 +6,14 @@ export declare function isBrowserToolName(name: string): boolean;
6
6
  /** Project telemetry before any event consumer can persist a browser input. */
7
7
  export declare function browserEventArguments(args: unknown): unknown;
8
8
  export declare function disposeBrowserSessions(identity?: object): Promise<void>;
9
+ /**
10
+ * Said when no channel has anything to launch. A container or server image often has no browser
11
+ * at all, and "install Chrome/Edge" sent agents off to install one mid-task; the useful answer is
12
+ * to stop calling browser tools and reach the page another way.
13
+ */
14
+ export declare const MISSING_BROWSER_MESSAGE = "Browser unavailable: no Chromium, Chrome or Edge is installed in this environment, so browser tools cannot run here. Do not call them again in this run. Fetch pages with curl or a script instead, and say in your summary that no browser check was possible. Only if the task itself needs a real browser, install one with `npx playwright-core install --with-deps chromium`.";
15
+ /** Forget a remembered "no browser" result; for tests and for a caller that just installed one. */
16
+ export declare function resetBrowserAvailability(): void;
9
17
  /**
10
18
  * Reserve one screenshot against the image budget every browser tool in this
11
19
  * agent tool batch shares. The reservation is a fixed estimate; `commit` trims
@@ -147,6 +147,9 @@ export async function disposeBrowserSessions(identity) {
147
147
  }
148
148
  /** Headless isolated profile; never attaches to the user's existing browser. */
149
149
  async function launch(signal) {
150
+ if (missingBrowser && Date.now() < missingBrowser.until)
151
+ throw new Error(missingBrowser.message);
152
+ missingBrowser = undefined;
150
153
  const specifier = 'playwright-core';
151
154
  const { chromium } = await import(specifier);
152
155
  const failures = [];
@@ -183,8 +186,31 @@ async function launch(signal) {
183
186
  failures.push((error instanceof Error ? error.message : String(error)).split('\n')[0]);
184
187
  }
185
188
  }
186
- throw new Error(`Browser unavailable: install Chrome/Edge or the Chromium version required by playwright-core. ${failures.join('; ').slice(0, 1000)}`);
189
+ const detail = failures.join('; ').slice(0, 1000);
190
+ if (failures.length && failures.every(noBrowserInstalled)) {
191
+ // Nothing to launch is a fact about the machine, not about this call: remember it so the next
192
+ // call answers at once instead of trying three channels again, and tell the model what to do
193
+ // in its place. The memory is short, so a browser installed during the run is still found.
194
+ missingBrowser = { until: Date.now() + MISSING_BROWSER_MEMORY_MS, message: `${MISSING_BROWSER_MESSAGE} ${detail}` };
195
+ throw new Error(missingBrowser.message);
196
+ }
197
+ throw new Error(`Browser unavailable: install Chrome/Edge or the Chromium version required by playwright-core. ${detail}`);
198
+ }
199
+ /** How long a "no browser is installed" result is reused before the machine is asked again. */
200
+ const MISSING_BROWSER_MEMORY_MS = 60_000;
201
+ /**
202
+ * Said when no channel has anything to launch. A container or server image often has no browser
203
+ * at all, and "install Chrome/Edge" sent agents off to install one mid-task; the useful answer is
204
+ * to stop calling browser tools and reach the page another way.
205
+ */
206
+ export const MISSING_BROWSER_MESSAGE = 'Browser unavailable: no Chromium, Chrome or Edge is installed in this environment, so browser tools cannot run here. Do not call them again in this run. Fetch pages with curl or a script instead, and say in your summary that no browser check was possible. Only if the task itself needs a real browser, install one with `npx playwright-core install --with-deps chromium`.';
207
+ let missingBrowser;
208
+ /** Playwright's wording for a channel or bundled build that is not on disk. */
209
+ function noBrowserInstalled(failure) {
210
+ return /Executable doesn't exist|is not found at|distribution '[^']+' is not found|Failed to find|ENOENT/i.test(failure);
187
211
  }
212
+ /** Forget a remembered "no browser" result; for tests and for a caller that just installed one. */
213
+ export function resetBrowserAvailability() { missingBrowser = undefined; }
188
214
  class BrowserOperationTimeoutError extends Error {
189
215
  }
190
216
  /** Own late transport settlement without awaiting an unresponsive browser close. */