litmus-cli 1.4.71 → 1.4.72-capturetest.0

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 (71) hide show
  1. package/README.md +52 -9
  2. package/dist/commands/connect.d.ts +18 -1
  3. package/dist/commands/connect.d.ts.map +1 -1
  4. package/dist/commands/connect.js +88 -40
  5. package/dist/commands/connect.js.map +1 -1
  6. package/dist/commands/forward.d.ts +7 -16
  7. package/dist/commands/forward.d.ts.map +1 -1
  8. package/dist/commands/forward.js +97 -75
  9. package/dist/commands/forward.js.map +1 -1
  10. package/dist/commands/ssh.d.ts +3 -0
  11. package/dist/commands/ssh.d.ts.map +1 -0
  12. package/dist/commands/ssh.js +50 -0
  13. package/dist/commands/ssh.js.map +1 -0
  14. package/dist/index.js +16 -5
  15. package/dist/index.js.map +1 -1
  16. package/dist/lib/api.d.ts +7 -1
  17. package/dist/lib/api.d.ts.map +1 -1
  18. package/dist/lib/api.js +38 -8
  19. package/dist/lib/api.js.map +1 -1
  20. package/dist/lib/auto-forward.d.ts +31 -0
  21. package/dist/lib/auto-forward.d.ts.map +1 -0
  22. package/dist/lib/auto-forward.js +258 -0
  23. package/dist/lib/auto-forward.js.map +1 -0
  24. package/dist/lib/config.d.ts +1 -0
  25. package/dist/lib/config.d.ts.map +1 -1
  26. package/dist/lib/config.js.map +1 -1
  27. package/dist/lib/connection-attempt.d.ts +13 -2
  28. package/dist/lib/connection-attempt.d.ts.map +1 -1
  29. package/dist/lib/connection-attempt.js +16 -3
  30. package/dist/lib/connection-attempt.js.map +1 -1
  31. package/dist/lib/cursor-session.d.ts +6 -0
  32. package/dist/lib/cursor-session.d.ts.map +1 -1
  33. package/dist/lib/cursor-session.js +21 -1
  34. package/dist/lib/cursor-session.js.map +1 -1
  35. package/dist/lib/environment-checks.d.ts +1 -2
  36. package/dist/lib/environment-checks.d.ts.map +1 -1
  37. package/dist/lib/environment-checks.js +4 -9
  38. package/dist/lib/environment-checks.js.map +1 -1
  39. package/dist/lib/hook-logger.cjs +79 -22
  40. package/dist/lib/hosted-capture.d.ts +21 -0
  41. package/dist/lib/hosted-capture.d.ts.map +1 -0
  42. package/dist/lib/hosted-capture.js +229 -0
  43. package/dist/lib/hosted-capture.js.map +1 -0
  44. package/dist/lib/hosted-watcher.d.ts +2 -0
  45. package/dist/lib/hosted-watcher.d.ts.map +1 -0
  46. package/dist/lib/hosted-watcher.js +176 -0
  47. package/dist/lib/hosted-watcher.js.map +1 -0
  48. package/dist/lib/install-ssh-forward-hook.d.ts +6 -0
  49. package/dist/lib/install-ssh-forward-hook.d.ts.map +1 -0
  50. package/dist/lib/install-ssh-forward-hook.js +57 -0
  51. package/dist/lib/install-ssh-forward-hook.js.map +1 -0
  52. package/dist/lib/port-forward.d.ts +16 -0
  53. package/dist/lib/port-forward.d.ts.map +1 -0
  54. package/dist/lib/port-forward.js +46 -0
  55. package/dist/lib/port-forward.js.map +1 -0
  56. package/dist/lib/session-state.d.ts +61 -0
  57. package/dist/lib/session-state.d.ts.map +1 -0
  58. package/dist/lib/session-state.js +92 -0
  59. package/dist/lib/session-state.js.map +1 -0
  60. package/dist/lib/ssh-client.d.ts +11 -2
  61. package/dist/lib/ssh-client.d.ts.map +1 -1
  62. package/dist/lib/ssh-client.js +66 -7
  63. package/dist/lib/ssh-client.js.map +1 -1
  64. package/dist/lib/ssh-forward-hook.d.ts +13 -0
  65. package/dist/lib/ssh-forward-hook.d.ts.map +1 -0
  66. package/dist/lib/ssh-forward-hook.js +93 -0
  67. package/dist/lib/ssh-forward-hook.js.map +1 -0
  68. package/dist/lib/tracker.d.ts.map +1 -1
  69. package/dist/lib/tracker.js +7 -2
  70. package/dist/lib/tracker.js.map +1 -1
  71. package/package.json +2 -2
package/README.md CHANGED
@@ -8,7 +8,7 @@ Official CLI for [Litmus](https://www.litmushiring.com) engineering assessments.
8
8
  npm install -g litmus-cli
9
9
  ```
10
10
 
11
- Requires Node.js 18+.
11
+ Requires Node.js 20.19+.
12
12
 
13
13
  ## Usage
14
14
 
@@ -86,6 +86,16 @@ as `litmus push <token>` with the token from your assessment page. Either way it
86
86
  captures the workspace exactly as it stands, so there is nothing to commit or push
87
87
  first. The Submit button on your assessment page does the same thing.
88
88
 
89
+ `litmus connect` also asks permission to record supported local AI-agent prompts
90
+ and responses across folders during the assessment, alongside hosted capture.
91
+ A background capture watcher stays on your computer after connect returns. It
92
+ checks for submission independently of prompts and pauses local capture within
93
+ ten seconds if it loses contact with Litmus. Accepted submission (including the
94
+ website Submit button) retires the capture hooks; a work-trial checkpoint does not.
95
+ Restart already running local tools so they load the hooks. This local hook path
96
+ covers Claude Code, Codex, Cursor and Gemini where supported; browser AI and
97
+ project-scoped Copilot sessions are not covered machine-wide.
98
+
89
99
  If the assessment allows it, `litmus connect` also offers to bring your own AI
90
100
  skills into the workspace. It looks for skill folders (each with a `SKILL.md`) in
91
101
  `~/.claude/skills`, `~/.agents/skills`, `~/.codex/skills`, `~/.copilot/skills`,
@@ -93,17 +103,38 @@ skills into the workspace. It looks for skill folders (each with a `SKILL.md`) i
93
103
  again only when your skills change. Add `--skills` to import without being asked, or
94
104
  `--no-skills` to skip the offer.
95
105
 
96
- To open the app you run in the workspace at `localhost` on your own computer, run
97
- this on your computer and leave it open:
106
+ Connecting with `litmus connect <token> --ide ssh` opens a normal SSH shell and
107
+ forwards app ports automatically. Start a dev server in that shell, then open its
108
+ `http://localhost:<port>` on your laptop. Ctrl+C interrupts the remote command;
109
+ forwarding stays active until the SSH shell exits. Reconnect to an already configured
110
+ workspace with bare `ssh litmus-<workspace-id>` or `litmus ssh litmus-<workspace-id>`
111
+ for the same behavior. Setup installs a local SSH connection hook and a durable
112
+ forwarding helper under `~/.ssh/litmus-forward/`; no separate command is needed.
113
+ Existing aliases need the updated connection setup once. The helper stops within
114
+ seconds of the SSH connection closing, and skips connections with piped output
115
+ (such as VS Code/Cursor). Use `ssh -o PermitLocalCommand=no <alias>` to disable the hook for a connection.
116
+ The generated workspace alias disables SSH multiplexing so closing its shell
117
+ also closes its forwards; other hosts retain their existing settings.
118
+
119
+ When working in the browser editor, you can instead open just the forwarding
120
+ connection on your computer and leave it open:
98
121
 
99
122
  ```bash
100
- npx -y litmus-cli@latest forward <token> 5173 3001
123
+ npx -y litmus-cli@latest forward <token>
101
124
  ```
102
125
 
103
- Then start your app in the workspace terminal and open `http://localhost:5173`. Any
104
- port works, including one your app only listens on at `localhost`. With no ports
105
- named, it forwards the ones your assessment lists, or asks. `5174:5173` opens the
106
- workspace's 5173 on your 5174. Ctrl+C stops it.
126
+ Start apps in the workspace terminal whenever you need them. Each discovered TCP
127
+ listener gets a `http://localhost:<port>` link without restarting the command, including
128
+ servers bound only to workspace localhost. Platform ports and ports below 1024 are
129
+ skipped. A busy laptop port is reported without interrupting other forwards.
130
+
131
+ To forward only specific ports, append `5173 3001`. `5174:5173` opens the workspace's
132
+ 5173 on your 5174. Explicit ports also work with older workspace images that do not
133
+ support discovery. Up to 256 ports are retained per automatic session, including
134
+ through app restarts. Ctrl+C stops all its forwards.
135
+ If a connection drops it reconnects on its own. Once your assessment is submitted,
136
+ over, or locked, forwarding stops and explains why.
137
+
107
138
 
108
139
  ## How it works
109
140
 
@@ -174,7 +205,7 @@ at any time by deleting the Litmus entries from the files above.
174
205
 
175
206
  ## Requirements
176
207
 
177
- - Node.js 18+
208
+ - Node.js 20.19+
178
209
  - Git (recommended — without it, analysis loses commit history, iteration patterns, and process scoring signals; code quality scoring still works)
179
210
 
180
211
  ## Releasing (maintainers)
@@ -236,3 +267,15 @@ Notes:
236
267
  - The tag version must match `package.json` or the publish job fails its verify step.
237
268
  - npm rejects re-publishing an existing version — never re-tag a version that is
238
269
  already on the registry; bump to a new version instead.
270
+
271
+ ### Cursor Agents Window
272
+
273
+ On macOS and Windows, `litmus connect <token> --ide cursor` opens the remote IDE
274
+ and hands its assessment workspace to Cursor's Agents Window, without sending a
275
+ prompt or restarting Cursor. Use `--no-cursor-agent-window` for the IDE only.
276
+ Linux users can opt in with `--cursor-agent-window`.
277
+
278
+ The bundled Litmus companion is installed for this handoff. If it is unavailable,
279
+ continue in the IDE and open Agents Window manually. Submission cleanup remains
280
+ opt-in with `--cursor-session-cleanup`; it disconnects the ended IDE and removes
281
+ its Open Recent entry, but does not delete saved chats or Agents sidebar entries.
@@ -1,3 +1,4 @@
1
+ import { ConnectionAttempt } from "../lib/connection-attempt.js";
1
2
  import { type ResolvedEditorCommand } from "../lib/editor-binary.js";
2
3
  import type { NativeIde } from "../lib/editor-ide.js";
3
4
  import { type EditorVersion, type SeedVerdict, type VerifyVerdict, type WorkspaceProbe } from "../lib/editor-server.js";
@@ -135,6 +136,7 @@ export declare function controlPathFor(platform: NodeJS.Platform): string;
135
136
  export declare function upsertSshConfigContent(existing: string, alias: string, block: string, controlBlock?: string, platform?: NodeJS.Platform): string;
136
137
  /** Short, stable alias from the workspace hostname (or token as a fallback). */
137
138
  export declare function aliasFor(sshHostname: string | null | undefined, token: string): string;
139
+ export declare function upsertSshForwardHook(existing: string, alias: string, block: string, controlBlock: string, command: string): string;
138
140
  /**
139
141
  * The native editors `litmus connect` can drive, and everything about them that is
140
142
  * not shared. Both are VS Code-family, so one set of helpers serves both: the CLI
@@ -659,6 +661,10 @@ export declare function keepWaitingForWorkspace(elapsedMs: number, status: strin
659
661
  * both spellings are well-formed URLs that render a page.
660
662
  */
661
663
  export declare function candidatePageUrl(apiBase: string, assessmentId: string): string;
664
+ export declare function endedInitRefusal(err: unknown): {
665
+ state: "submitted" | "over";
666
+ hint?: string;
667
+ } | null;
662
668
  /** Remote hooks initialize in the remote window; no desktop restart is required (ENG-3176). */
663
669
  export declare function cursorSelectionNoticeLines(_platform?: NodeJS.Platform): string[];
664
670
  /** How long a freshly started Cursor gets to finish restoring its session (ENG-2884). */
@@ -767,7 +773,18 @@ export interface ConnectOptions {
767
773
  * place of the interactive shell: it gets the alias and the ports the workspace
768
774
  * publishes. Set, the route needs no terminal, because nothing is handed a shell.
769
775
  */
770
- tunnel?: (alias: string, publishedPorts: number[]) => Promise<void>;
776
+ tunnel?: (alias: string, publishedPorts: number[], session: TunnelSession) => Promise<void>;
777
+ }
778
+ /**
779
+ * ENG-3265: what a tunnel needs to tell a closed assessment from a broken connection,
780
+ * and to record which it was on the connection attempt that opened it.
781
+ */
782
+ export interface TunnelSession {
783
+ backendUrl: string;
784
+ token: string;
785
+ /** The assessment page, which carries only the assessment id. */
786
+ pageUrl: string;
787
+ attempt: ConnectionAttempt;
771
788
  }
772
789
  export declare function runConnect(token: string, ideOpt?: string, opts?: ConnectOptions): Promise<void>;
773
790
  //# sourceMappingURL=connect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/commands/connect.ts"],"names":[],"mappings":"AAeA,OAAO,EAA4C,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE9G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAA;AAoDhC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAQD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAwBtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,CAAC,EAAE,SAAS,EACZ,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,MAAM,CAkCR;AAED;;;;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AM,CAAA;IACf,OAAO,EAAE,iBAAiB,CAAA;CAC3B;AAaD,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCzG"}
@@ -1,5 +1,9 @@
1
- import { prepareCursorSession } from "../lib/cursor-session.js";
1
+ import { startHostedCapture } from "../lib/hosted-capture.js";
2
+ import { installSshForwardHook } from "../lib/install-ssh-forward-hook.js";
3
+ import { runSsh } from "./ssh.js";
4
+ import { cursorSessionOptions, prepareCursorSession } from "../lib/cursor-session.js";
2
5
  import { ConnectionAttempt } from "../lib/connection-attempt.js";
6
+ import { closedState } from "../lib/session-state.js";
3
7
  import { updateSshConfig } from "../lib/ssh-config-file.js";
4
8
  import os from "os";
5
9
  import path from "path";
@@ -17,7 +21,7 @@ import { editorInstallCandidates, editorSpawnSpec } from "../lib/editor-binary.j
17
21
  import { isWsl, whichOnPath, windowsSideEditor, wslEditorHint } from "../lib/wsl.js";
18
22
  import { parseEditorVersion, parseWorkspaceProbe, remoteProbeCommand, seedVerdict, verifyVerdict, VERIFY_SCHEDULE_MS, } from "../lib/editor-server.js";
19
23
  import { fatal, holdExitFor, success, info, warn, setErrorContext, reportEvent } from "../lib/errors.js";
20
- import { oldWindowsSshHint, openSshSession, parseOpenSshVersion, proxyJumpBroken, readEditorSettings, readSshVersionBanner, SSH_CONNECTION_FAILED, sshExecutableFor, sshPreflight, sshPreflightHint, } from "../lib/ssh-client.js";
24
+ import { oldWindowsSshHint, parseOpenSshVersion, proxyJumpBroken, readEditorSettings, readSshVersionBanner, sshExecutableFor, sshPreflight, sshPreflightHint, } from "../lib/ssh-client.js";
21
25
  import { editorEndingForewarning } from "../lib/session-end.js";
22
26
  import { attemptRelaunch, platformSupportsGracefulCursorRestart, realCursorProcessIo, } from "../lib/cursor-restart.js";
23
27
  /**
@@ -325,9 +329,28 @@ function ensureSshKey(keyPath) {
325
329
  }
326
330
  async function writeSshConfig(alias, block, controlBlock) {
327
331
  const cfgPath = path.join(os.homedir(), ".ssh", "config");
328
- await updateSshConfig(cfgPath, (existing) => upsertSshConfigContent(existing, alias, block, controlBlock));
332
+ let command;
333
+ try {
334
+ command = installSshForwardHook(alias);
335
+ }
336
+ catch {
337
+ warn("Could not install automatic forwarding for bare SSH. Use npx -y litmus-cli@latest ssh with this alias, or rerun setup to repair it.");
338
+ await updateSshConfig(cfgPath, (existing) => upsertSshConfigContent(existing, alias, block, controlBlock));
339
+ return cfgPath;
340
+ }
341
+ await updateSshConfig(cfgPath, (existing) => upsertSshForwardHook(existing, alias, block, controlBlock, command));
329
342
  return cfgPath;
330
343
  }
344
+ export function upsertSshForwardHook(existing, alias, block, controlBlock, command) {
345
+ const begin = `# >>> litmus forwarding ${alias}`;
346
+ const end = `# <<< litmus forwarding ${alias}`;
347
+ // LocalCommand does not run for mux clients, and ControlPersist outlives
348
+ // the shell. This alias needs its own connection to own forwarding cleanup.
349
+ // Bastion sharing and all unrelated hosts retain their existing settings.
350
+ const hook = `${begin}\nHost ${alias}\n ControlMaster no\n ControlPersist no\n ControlPath none\n PermitLocalCommand yes\n LocalCommand ${command}\nHost *\n${end}\n`;
351
+ const clean = withoutRegion(existing, begin, end);
352
+ return prepend(upsertSshConfigContent(clean, alias, block, controlBlock), hook);
353
+ }
331
354
  /**
332
355
  * The two editors, and the one place every measured difference between them lives.
333
356
  *
@@ -1053,6 +1076,28 @@ export function keepWaitingForWorkspace(elapsedMs, status) {
1053
1076
  export function candidatePageUrl(apiBase, assessmentId) {
1054
1077
  return `${apiBase}/candidate/${assessmentId}`;
1055
1078
  }
1079
+ /**
1080
+ * ENG-3265: `/api/cli/init`'s refusals for an assessment that has closed, by the stable
1081
+ * `error` code each sends (frontend/app/api/cli/init/route.ts and
1082
+ * frontend/lib/candidate-terminal.ts). Each message already says what happened, and the
1083
+ * ones that can be undone say to contact the company, so the hint never offers a retry.
1084
+ */
1085
+ const ENDED_INIT_REFUSALS = {
1086
+ "Already submitted": {
1087
+ state: "submitted",
1088
+ hint: "Your workspace closed when the assessment was submitted. Open the assessment page from your invitation email to see its status.",
1089
+ },
1090
+ "Session over": { state: "over", hint: "Open the assessment page from your invitation email to see its status." },
1091
+ "Assessment expired": { state: "over" },
1092
+ "Time's up": { state: "over" },
1093
+ "Deadline passed": { state: "over" },
1094
+ "Invitation withdrawn": { state: "over" },
1095
+ };
1096
+ export function endedInitRefusal(err) {
1097
+ if (!(err instanceof ServerError) || !err.errorCode)
1098
+ return null;
1099
+ return Object.prototype.hasOwnProperty.call(ENDED_INIT_REFUSALS, err.errorCode) ? ENDED_INIT_REFUSALS[err.errorCode] : null;
1100
+ }
1056
1101
  /** Remote hooks initialize in the remote window; no desktop restart is required (ENG-3176). */
1057
1102
  export function cursorSelectionNoticeLines(_platform = process.platform) {
1058
1103
  return [];
@@ -1294,7 +1339,7 @@ export async function runConnect(token, ideOpt, opts = {}) {
1294
1339
  // last read is where they are and what the session ending looks like.
1295
1340
  setErrorContext({ token, apiBase: resolveApiBase(process.env.LITMUS_API_URL) });
1296
1341
  const attempt = new ConnectionAttempt();
1297
- const skillImport = { report: null, footer: [], sshAlias: null, publishedPorts: [] };
1342
+ const skillImport = { report: null, footer: [], sshAlias: null, publishedPorts: [], tunnelSession: null };
1298
1343
  // Register before entering the flow: a fast fatal report can settle before the
1299
1344
  // caller's finally begins, especially while an async SSH config write is unwinding.
1300
1345
  let releaseExitHold;
@@ -1303,7 +1348,10 @@ export async function runConnect(token, ideOpt, opts = {}) {
1303
1348
  await connectFlow(token, ideOpt, opts, skillImport, attempt);
1304
1349
  }
1305
1350
  catch (error) {
1306
- attempt.finish("failed");
1351
+ // ENG-3265: a closed assessment refuses the connect on purpose; that stays recorded
1352
+ // as the expected outcome it is, not as a failed connection.
1353
+ if (attempt.outcome !== "session_ended")
1354
+ attempt.finish("failed");
1307
1355
  attempt.evidence(error instanceof Error ? error.message : null);
1308
1356
  throw error;
1309
1357
  }
@@ -1324,32 +1372,11 @@ export async function runConnect(token, ideOpt, opts = {}) {
1324
1372
  // The ssh route's session runs last, so nothing we print lands inside the remote shell.
1325
1373
  if (!skillImport.sshAlias)
1326
1374
  return;
1327
- if (opts.tunnel)
1328
- await opts.tunnel(skillImport.sshAlias, skillImport.publishedPorts);
1329
- else
1330
- await openSshRoute(skillImport.sshAlias);
1331
- }
1332
- /**
1333
- * The ssh route: the candidate ran one command from the assessment page and lands in the
1334
- * workspace's shell, rather than being handed a second command to run. ssh owns the
1335
- * terminal until it exits, and its exit status becomes ours.
1336
- *
1337
- * Exit 255 is ssh's connection failure, but a remote shell can exit 255 too, so that case
1338
- * offers a reconnect without claiming the connection failed. When ssh could not be
1339
- * started at all, the command is printed and the exit status is a failure.
1340
- */
1341
- async function openSshRoute(alias) {
1342
- const status = await openSshSession(alias, sshExecutableFor("ssh", null));
1343
- if (status === null) {
1344
- console.log(` Connect from your terminal: ${chalk.cyan(`ssh ${alias}`)}`);
1345
- process.exitCode = 1;
1346
- return;
1375
+ if (opts.tunnel && skillImport.tunnelSession) {
1376
+ await opts.tunnel(skillImport.sshAlias, skillImport.publishedPorts, skillImport.tunnelSession);
1347
1377
  }
1348
- if (status === SSH_CONNECTION_FAILED) {
1349
- console.log(` If the connection dropped, reconnect with: ${chalk.cyan(`ssh ${alias}`)}`);
1350
- }
1351
- if (status)
1352
- process.exitCode = status;
1378
+ else
1379
+ await runSsh(skillImport.sshAlias);
1353
1380
  }
1354
1381
  async function connectFlow(token, ideOpt, opts, skillImport, attempt) {
1355
1382
  const verbose = Boolean(opts.verbose);
@@ -1380,6 +1407,15 @@ async function connectFlow(token, ideOpt, opts, skillImport, attempt) {
1380
1407
  fatal("Couldn't reach Litmus.", "Check your internet connection, then run the same litmus connect command again.", { internalDetail: msg, severity });
1381
1408
  return;
1382
1409
  }
1410
+ // ENG-3265: the server's sentence already says the assessment is closed and what to
1411
+ // do; "try again in a moment" under it would send the candidate round again.
1412
+ const ended = endedInitRefusal(err);
1413
+ if (ended) {
1414
+ attempt.finish("session_ended");
1415
+ attempt.fact("sessionState", ended.state);
1416
+ fatal(msg, ended.hint, { internalDetail: detail, severity: "warning" });
1417
+ return;
1418
+ }
1383
1419
  fatal(msg, hintForError(err), { internalDetail: detail, severity });
1384
1420
  return;
1385
1421
  }
@@ -1431,6 +1467,14 @@ async function connectFlow(token, ideOpt, opts, skillImport, attempt) {
1431
1467
  return;
1432
1468
  }
1433
1469
  if (code === "assessment_closed") {
1470
+ // ENG-3265: closed is also what a submitted assessment answers, so ask which.
1471
+ const closed = await closedState(backendUrl, token);
1472
+ attempt.finish("session_ended");
1473
+ attempt.fact("sessionState", closed.kind);
1474
+ if (closed.kind === "submitted") {
1475
+ fatal("This assessment has been submitted, so its workspace is closed.", `Open the assessment page to see its status: ${pageUrl}`, { severity: "warning" });
1476
+ return;
1477
+ }
1434
1478
  fatal("This assessment is closed. Its deadline has passed.", "Contact the company if you need an extension.", { severity: "warning" });
1435
1479
  return;
1436
1480
  }
@@ -1502,6 +1546,7 @@ async function connectFlow(token, ideOpt, opts, skillImport, attempt) {
1502
1546
  return;
1503
1547
  }
1504
1548
  }
1549
+ await startHostedCapture(meta, token, apiBase);
1505
1550
  if (ide === "browser" && conn.browser_ide_url) {
1506
1551
  attempt.stage("browser_open");
1507
1552
  attempt.finish("browser_requested");
@@ -1617,6 +1662,7 @@ async function connectFlow(token, ideOpt, opts, skillImport, attempt) {
1617
1662
  if (opts.tunnel) {
1618
1663
  skillImport.sshAlias = alias;
1619
1664
  skillImport.publishedPorts = (conn.forwarded_ports ?? []).map((p) => p.port);
1665
+ skillImport.tunnelSession = { backendUrl, token, pageUrl, attempt };
1620
1666
  return;
1621
1667
  }
1622
1668
  if (process.stdin.isTTY && process.stdout.isTTY) {
@@ -1848,19 +1894,21 @@ async function connectFlow(token, ideOpt, opts, skillImport, attempt) {
1848
1894
  const launchPlan = editorLaunchPlan(editor, alias);
1849
1895
  const launches = resendableLaunch((logPath) => launchEditor(editor, resolved.command, alias, logPath));
1850
1896
  // Local UI extension: it survives a remote-host disconnect. Never installed on
1851
- // default connect, VS Code, browser or plain SSH paths.
1852
- if (editor.ide === "cursor" && (opts.cursorAgentWindow || opts.cursorSessionCleanup)) {
1853
- info("Setting up the experimental Litmus Cursor companion for this workspace.");
1897
+ // VS Code, browser or plain SSH paths. Handoff defaults on for Mac/Windows.
1898
+ if (editor.ide === "cursor") {
1899
+ const sessionOptions = cursorSessionOptions(opts);
1900
+ const enabled = sessionOptions.handoff || sessionOptions.cleanup;
1901
+ if (enabled)
1902
+ info("Setting up the Litmus Cursor companion for this workspace.");
1854
1903
  try {
1855
- const ready = await prepareCursorSession(resolved.command, alias, backendUrl, token, {
1856
- handoff: Boolean(opts.cursorAgentWindow), cleanup: Boolean(opts.cursorSessionCleanup),
1857
- });
1858
- skillImport.footer.push(ready
1859
- ? "Cursor companion enabled. Handoff targets this IDE workspace; optional cleanup disconnects the ended IDE and removes its Open Recent entry. Saved chats and Agents Window entries are not deleted."
1860
- : "Cursor companion unavailable. Continue in the IDE; use Open Agents Window or Close Remote Connection manually.");
1904
+ const ready = await prepareCursorSession(resolved.command, alias, backendUrl, token, sessionOptions);
1905
+ if (enabled)
1906
+ skillImport.footer.push(ready
1907
+ ? "Cursor companion enabled. Handoff targets this IDE workspace; optional cleanup disconnects the ended IDE and removes its Open Recent entry. Saved chats and Agents Window entries are not deleted."
1908
+ : "Cursor companion unavailable. Continue in the IDE; use Open Agents Window or Close Remote Connection manually.");
1861
1909
  }
1862
1910
  catch {
1863
- skillImport.footer.push("Cursor companion setup failed. Your normal IDE connection is unaffected.");
1911
+ skillImport.footer.push("Cursor companion setup failed. Your normal IDE connection is unaffected; automatic Agents handoff preferences may not have been updated.");
1864
1912
  }
1865
1913
  }
1866
1914
  const outcome = await attemptEditorLaunch(editor, {