litmus-cli 1.5.0-beta.1 → 1.5.0-beta.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 (151) hide show
  1. package/README.md +26 -4
  2. package/dist/commands/connect.d.ts +23 -0
  3. package/dist/commands/connect.d.ts.map +1 -1
  4. package/dist/commands/connect.js +267 -50
  5. package/dist/commands/connect.js.map +1 -1
  6. package/dist/commands/doctor.d.ts +1 -1
  7. package/dist/commands/doctor.d.ts.map +1 -1
  8. package/dist/commands/doctor.js +16 -4
  9. package/dist/commands/doctor.js.map +1 -1
  10. package/dist/commands/init.d.ts.map +1 -1
  11. package/dist/commands/init.js +25 -6
  12. package/dist/commands/init.js.map +1 -1
  13. package/dist/commands/pause.d.ts.map +1 -1
  14. package/dist/commands/pause.js +12 -2
  15. package/dist/commands/pause.js.map +1 -1
  16. package/dist/cursor-session/extension.cjs +12 -3
  17. package/dist/cursor-session/package.json +3 -3
  18. package/dist/cursor-session/session.cjs +29 -6
  19. package/dist/index.js +10 -232
  20. package/dist/index.js.map +1 -1
  21. package/dist/lib/ai-tracking.d.ts +4 -0
  22. package/dist/lib/ai-tracking.d.ts.map +1 -1
  23. package/dist/lib/ai-tracking.js +68 -0
  24. package/dist/lib/ai-tracking.js.map +1 -1
  25. package/dist/lib/api.d.ts +2 -0
  26. package/dist/lib/api.d.ts.map +1 -1
  27. package/dist/lib/api.js +33 -8
  28. package/dist/lib/api.js.map +1 -1
  29. package/dist/lib/capture-notice-ping.d.ts +7 -27
  30. package/dist/lib/capture-notice-ping.d.ts.map +1 -1
  31. package/dist/lib/capture-notice-ping.js +10 -42
  32. package/dist/lib/capture-notice-ping.js.map +1 -1
  33. package/dist/lib/capture-nudge.d.ts +5 -7
  34. package/dist/lib/capture-nudge.d.ts.map +1 -1
  35. package/dist/lib/capture-nudge.js +19 -35
  36. package/dist/lib/capture-nudge.js.map +1 -1
  37. package/dist/lib/capture-selftest.d.ts +11 -0
  38. package/dist/lib/capture-selftest.d.ts.map +1 -1
  39. package/dist/lib/capture-selftest.js +44 -5
  40. package/dist/lib/capture-selftest.js.map +1 -1
  41. package/dist/lib/capture-startup-diagnostics.d.ts +15 -0
  42. package/dist/lib/capture-startup-diagnostics.d.ts.map +1 -0
  43. package/dist/lib/capture-startup-diagnostics.js +134 -0
  44. package/dist/lib/capture-startup-diagnostics.js.map +1 -0
  45. package/dist/lib/capture-storage-error.d.ts +10 -0
  46. package/dist/lib/capture-storage-error.d.ts.map +1 -0
  47. package/dist/lib/capture-storage-error.js +18 -0
  48. package/dist/lib/capture-storage-error.js.map +1 -0
  49. package/dist/lib/codex-capture-health.d.ts +21 -0
  50. package/dist/lib/codex-capture-health.d.ts.map +1 -0
  51. package/dist/lib/codex-capture-health.js +82 -0
  52. package/dist/lib/codex-capture-health.js.map +1 -0
  53. package/dist/lib/cursor-session.d.ts +4 -0
  54. package/dist/lib/cursor-session.d.ts.map +1 -1
  55. package/dist/lib/cursor-session.js +26 -10
  56. package/dist/lib/cursor-session.js.map +1 -1
  57. package/dist/lib/editor-foreground.d.ts +9 -1
  58. package/dist/lib/editor-foreground.d.ts.map +1 -1
  59. package/dist/lib/editor-foreground.js +15 -0
  60. package/dist/lib/editor-foreground.js.map +1 -1
  61. package/dist/lib/environment-checks.d.ts +1 -3
  62. package/dist/lib/environment-checks.d.ts.map +1 -1
  63. package/dist/lib/environment-checks.js +2 -16
  64. package/dist/lib/environment-checks.js.map +1 -1
  65. package/dist/lib/errors.d.ts +2 -0
  66. package/dist/lib/errors.d.ts.map +1 -1
  67. package/dist/lib/errors.js +7 -0
  68. package/dist/lib/errors.js.map +1 -1
  69. package/dist/lib/file-monitor.d.ts +18 -0
  70. package/dist/lib/file-monitor.d.ts.map +1 -0
  71. package/dist/lib/file-monitor.js +87 -0
  72. package/dist/lib/file-monitor.js.map +1 -0
  73. package/dist/lib/hook-logger.cjs +76 -11
  74. package/dist/lib/hosted-capture.d.ts +4 -2
  75. package/dist/lib/hosted-capture.d.ts.map +1 -1
  76. package/dist/lib/hosted-capture.js +121 -26
  77. package/dist/lib/hosted-capture.js.map +1 -1
  78. package/dist/lib/hosted-watcher.js +9 -1
  79. package/dist/lib/hosted-watcher.js.map +1 -1
  80. package/dist/lib/init-location.d.ts +4 -0
  81. package/dist/lib/init-location.d.ts.map +1 -0
  82. package/dist/lib/init-location.js +36 -0
  83. package/dist/lib/init-location.js.map +1 -0
  84. package/dist/lib/installed-tools.d.ts +3 -0
  85. package/dist/lib/installed-tools.d.ts.map +1 -1
  86. package/dist/lib/installed-tools.js +31 -18
  87. package/dist/lib/installed-tools.js.map +1 -1
  88. package/dist/lib/launcher-cleanup-journal.d.ts +44 -0
  89. package/dist/lib/launcher-cleanup-journal.d.ts.map +1 -0
  90. package/dist/lib/launcher-cleanup-journal.js +196 -0
  91. package/dist/lib/launcher-cleanup-journal.js.map +1 -0
  92. package/dist/lib/launcher-inventory-cache.d.ts +44 -0
  93. package/dist/lib/launcher-inventory-cache.d.ts.map +1 -0
  94. package/dist/lib/launcher-inventory-cache.js +126 -0
  95. package/dist/lib/launcher-inventory-cache.js.map +1 -0
  96. package/dist/lib/launcher-preparation-cache.d.ts +46 -0
  97. package/dist/lib/launcher-preparation-cache.d.ts.map +1 -0
  98. package/dist/lib/launcher-preparation-cache.js +131 -0
  99. package/dist/lib/launcher-preparation-cache.js.map +1 -0
  100. package/dist/lib/mac-notifier.d.ts +4 -0
  101. package/dist/lib/mac-notifier.d.ts.map +1 -0
  102. package/dist/lib/mac-notifier.js +72 -0
  103. package/dist/lib/mac-notifier.js.map +1 -0
  104. package/dist/lib/node-version.d.ts +8 -0
  105. package/dist/lib/node-version.d.ts.map +1 -0
  106. package/dist/lib/node-version.js +23 -0
  107. package/dist/lib/node-version.js.map +1 -0
  108. package/dist/lib/notify.d.ts +4 -5
  109. package/dist/lib/notify.d.ts.map +1 -1
  110. package/dist/lib/notify.js +24 -25
  111. package/dist/lib/notify.js.map +1 -1
  112. package/dist/lib/portal-launcher-background.d.ts +2 -0
  113. package/dist/lib/portal-launcher-background.d.ts.map +1 -1
  114. package/dist/lib/portal-launcher-background.js.map +1 -1
  115. package/dist/lib/portal-launcher.d.ts +44 -5
  116. package/dist/lib/portal-launcher.d.ts.map +1 -1
  117. package/dist/lib/portal-launcher.js +425 -77
  118. package/dist/lib/portal-launcher.js.map +1 -1
  119. package/dist/lib/prepared-editor.d.ts.map +1 -1
  120. package/dist/lib/prepared-editor.js +20 -5
  121. package/dist/lib/prepared-editor.js.map +1 -1
  122. package/dist/lib/session-over.d.ts +2 -0
  123. package/dist/lib/session-over.d.ts.map +1 -1
  124. package/dist/lib/session-over.js +71 -12
  125. package/dist/lib/session-over.js.map +1 -1
  126. package/dist/lib/ssh-config-file.d.ts +13 -2
  127. package/dist/lib/ssh-config-file.d.ts.map +1 -1
  128. package/dist/lib/ssh-config-file.js +32 -27
  129. package/dist/lib/ssh-config-file.js.map +1 -1
  130. package/dist/lib/tool-installation-watcher.d.ts +20 -0
  131. package/dist/lib/tool-installation-watcher.d.ts.map +1 -0
  132. package/dist/lib/tool-installation-watcher.js +112 -0
  133. package/dist/lib/tool-installation-watcher.js.map +1 -0
  134. package/dist/lib/tracker.d.ts +1 -0
  135. package/dist/lib/tracker.d.ts.map +1 -1
  136. package/dist/lib/tracker.js +29 -4
  137. package/dist/lib/tracker.js.map +1 -1
  138. package/dist/lib/watcher.js +152 -101
  139. package/dist/lib/watcher.js.map +1 -1
  140. package/dist/lib/workspace-start-wait.d.ts +3 -1
  141. package/dist/lib/workspace-start-wait.d.ts.map +1 -1
  142. package/dist/lib/workspace-start-wait.js +36 -1
  143. package/dist/lib/workspace-start-wait.js.map +1 -1
  144. package/dist/notification-assets/litmus.icns +0 -0
  145. package/dist/notification-assets/litmus.png +0 -0
  146. package/dist/notification-assets/notifier.js +12 -0
  147. package/dist/program.d.ts +2 -0
  148. package/dist/program.d.ts.map +1 -0
  149. package/dist/program.js +244 -0
  150. package/dist/program.js.map +1 -0
  151. package/package.json +5 -5
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const WORKSPACE = "/home/candidate/workspace";
3
3
  const HANDOFF = "cursor.openOrFocusGlassWindow";
4
- const CLOSE = "workbench.action.remote.close";
4
+ const CLOSE_WINDOW = "workbench.action.closeWindow";
5
5
  const REMOVE = "vscode.removeFromRecentlyOpened";
6
6
 
7
7
  function targetFolder(vscode) {
@@ -38,19 +38,42 @@ async function handoff(vscode, expectedUri) {
38
38
  function hasUnsavedWork(vscode) {
39
39
  return vscode.workspace.textDocuments.some(d => d.isDirty) ||
40
40
  (vscode.workspace.notebookDocuments ?? []).some(d => d.isDirty) ||
41
- (vscode.window?.tabGroups?.all ?? []).some(group => group.tabs.some(tab => tab.isDirty));
41
+ (vscode.window?.tabGroups?.all ?? []).some(group => group.tabs.some(tab => tab.isDirty && !isEmptyCursorAgent(tab)));
42
42
  }
43
- async function detach(vscode, expectedUri) {
43
+ function isEmptyCursorAgent(tab) {
44
+ if (tab.label !== "New Agent") return false;
45
+ const input = tab.input;
46
+ // Cursor exposes its empty composer as a resource-less dirty tab. It is UI
47
+ // state, not candidate work. A text, notebook, diff, or custom editor has a
48
+ // resource on its input and must continue to block automatic disconnection.
49
+ return !input || (typeof input === "object" && !("uri" in input) && !("original" in input) && !("modified" in input));
50
+ }
51
+ async function detach(vscode, expectedUri, stillOwned = async () => true, wait = ms => new Promise(resolve => setTimeout(resolve, ms))) {
44
52
  const matches = () => targetFolder(vscode)?.toString() === expectedUri.toString();
45
53
  if (!matches()) return false;
46
54
  const commands = await vscode.commands.getCommands(true);
47
- // Agents Window is global/multi-workspace: never close it through an IDE command.
48
- if (commands.includes("glass.newAgent") || !commands.includes(CLOSE) || !commands.includes(REMOVE)) return false;
55
+ // This extension is executing inside the exact remote window selected above.
56
+ // Closing the current workbench cannot target Cursor's global Agents Window:
57
+ // that surface has no matching Remote-SSH workspace root. Capability-check
58
+ // the public workbench command and fail closed on unsupported editor builds.
59
+ if (!commands.includes(CLOSE_WINDOW) || !commands.includes(REMOVE)) return false;
49
60
  if (hasUnsavedWork(vscode)) return false;
50
61
  if (!matches()) return false;
51
62
  await vscode.commands.executeCommand(REMOVE, expectedUri);
52
63
  if (!matches() || hasUnsavedWork(vscode)) return false;
53
- await vscode.commands.executeCommand(CLOSE);
64
+ if (!await stillOwned()) return false;
65
+ if (!matches() || hasUnsavedWork(vscode)) return false;
66
+ // VS Code closes on the first command. Cursor can first detach its remote
67
+ // workbench while leaving the exact native window alive, so give it one
68
+ // bounded retry while the same clean, ended registration still owns it.
69
+ for (let attempt = 0; attempt < 2; attempt++) {
70
+ await vscode.commands.executeCommand(CLOSE_WINDOW);
71
+ if (attempt === 1) break;
72
+ await wait(250);
73
+ if (!matches()) return true;
74
+ if (hasUnsavedWork(vscode) || !await stillOwned()) return false;
75
+ if (!matches() || hasUnsavedWork(vscode)) return false;
76
+ }
54
77
  return true;
55
78
  }
56
79
 
package/dist/index.js CHANGED
@@ -1,236 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import { runDiagnoseConnection } from "./commands/diagnose-connection.js";
3
- import { program } from "commander";
4
- import { cursorSessionFlags } from "./lib/cursor-session.js";
5
- import { runInit } from "./commands/init.js";
6
- import { runConnect } from "./commands/connect.js";
7
- import { runSsh } from "./commands/ssh.js";
8
- import { runForward } from "./commands/forward.js";
9
- import { runPush } from "./commands/push.js";
10
- import { runSubmit } from "./commands/submit.js";
11
- import { runPause } from "./commands/pause.js";
12
- import { runStatus } from "./commands/status.js";
13
- import { runDoctor } from "./commands/doctor.js";
14
- import { runSetupCheck } from "./commands/setup-check.js";
15
- import { runEnv } from "./commands/env.js";
16
- import { FatalError } from "./lib/errors.js";
17
- import { CLI_VERSION } from "./lib/version.js";
18
- import { checkNodeVersion } from "./lib/environment-checks.js";
19
- import { MISSING_TOKEN_HELP, readTokenArgument } from "./lib/workspace-token.js";
20
- /**
21
- * The token for a command that takes one (ENG-3035): the argument, `-` for
22
- * stdin, or LITMUS_ASSESSMENT_TOKEN. Exits with the help line when none is given.
23
- */
24
- async function tokenOrExit(arg) {
25
- const token = await readTokenArgument(arg);
26
- if (!token) {
27
- console.error(MISSING_TOKEN_HELP);
28
- process.exit(1);
29
- }
30
- return token;
2
+ import { checkNodeVersion } from "./lib/node-version.js";
3
+ // Keep the runtime check ahead of Commander and every command import. Commander 15
4
+ // requires Node 22.12+, and this package promises Node 24+, so an older candidate
5
+ // gets an actionable message instead of an ESM loader failure.
6
+ const node = checkNodeVersion();
7
+ if (node.status === "fail") {
8
+ console.error(node.detail);
9
+ process.exitCode = 1;
31
10
  }
32
- // Refuse before token handling or any request that can start the assessment clock.
33
- function requireSupportedNode() {
34
- const check = checkNodeVersion();
35
- if (check.status === "fail")
36
- throw new Error(check.detail);
11
+ else {
12
+ await import("./program.js");
37
13
  }
38
- program
39
- .name("litmus")
40
- .description("Litmus engineering assessment CLI")
41
- .version(CLI_VERSION);
42
- program
43
- .command("init [token]")
44
- .description("Download and set up a Litmus assessment")
45
- .action(async (token) => {
46
- try {
47
- requireSupportedNode();
48
- await runInit(await tokenOrExit(token));
49
- }
50
- catch (err) {
51
- if (err instanceof FatalError)
52
- return;
53
- console.error(err instanceof Error ? err.message : String(err));
54
- process.exit(1);
55
- }
56
- });
57
- cursorSessionFlags(program.command("connect [token]"))
58
- .description("Open your assessment workspace in your editor of choice (codespace)")
59
- .option("--ide <editor>", "Where to open: vscode (native VS Code), cursor (native Cursor), browser, or ssh")
60
- .option("--verbose", "Print what your editor wrote while opening, for support")
61
- .option("--skills", "Import your AI skills (~/.claude/skills, ~/.agents/skills, ...) into the workspace without asking")
62
- .option("--no-skills", "Don't offer to import your AI skills")
63
- .action(async (token, opts) => {
64
- try {
65
- requireSupportedNode();
66
- await runConnect(token, opts.ide, { verbose: opts.verbose, skills: opts.skills, cursorAgentWindow: opts.cursorAgentWindow, cursorSessionCleanup: opts.cursorSessionCleanup });
67
- }
68
- catch (err) {
69
- if (err instanceof FatalError)
70
- return;
71
- console.error(err instanceof Error ? err.message : String(err));
72
- process.exit(1);
73
- }
74
- });
75
- program
76
- .command("ssh <alias>")
77
- .description("Open a configured workspace SSH shell with automatic localhost forwarding")
78
- .action(async (alias) => {
79
- try {
80
- await runSsh(alias);
81
- }
82
- catch (err) {
83
- console.error(err instanceof Error ? err.message : String(err));
84
- process.exitCode = 1;
85
- }
86
- });
87
- program
88
- .command("diagnose-connection [token]")
89
- .description("Collect connection diagnostics without changing your editor or workspace")
90
- .option("--ide <editor>", "Editor to inspect: cursor or vscode", "cursor")
91
- .option("--log <file>", "Classify the last 64 KiB of a Remote-SSH log locally; raw contents are not uploaded")
92
- .action(async (token, opts) => {
93
- try {
94
- await runDiagnoseConnection(await tokenOrExit(token), opts);
95
- }
96
- catch (err) {
97
- console.error(err instanceof Error ? err.message : String(err));
98
- process.exitCode = 1;
99
- }
100
- });
101
- program
102
- .command("forward [token] [ports...]")
103
- .description("Automatically forward workspace apps to localhost; optionally choose ports (5173, or 5174:5173)")
104
- .option("--verbose", "Print more detail, for support")
105
- .action(async (token, ports, opts) => {
106
- try {
107
- await runForward(await tokenOrExit(token), ports, { verbose: opts.verbose });
108
- }
109
- catch (err) {
110
- if (err instanceof FatalError)
111
- return;
112
- console.error(err instanceof Error ? err.message : String(err));
113
- process.exit(1);
114
- }
115
- });
116
- program
117
- .command("push")
118
- .description("Submit your VM workspace (codespace) for grading")
119
- // OPTIONAL, unlike `init`/`connect` (ENG-2064). Inside the workspace the token
120
- // comes from the environment the host injected at container start, so a candidate
121
- // in their own terminal types `litmus push` and nothing else. On a laptop it is
122
- // still required in practice: with no argument and no injected token the command
123
- // says so and points at the assessment page.
124
- .argument("[token]", "Assessment token — only needed outside the workspace (it is pre-set inside one)")
125
- .option("-y, --yes", "Skip confirmation prompt")
126
- .action(async (token, opts) => {
127
- try {
128
- await runPush(token, opts);
129
- }
130
- catch (err) {
131
- if (err instanceof FatalError)
132
- return;
133
- console.error(err instanceof Error ? err.message : String(err));
134
- process.exit(1);
135
- }
136
- });
137
- program
138
- .command("pause [token]")
139
- .description("Pause your workspace (codespace) and come back later - your work is kept")
140
- .action(async (token) => {
141
- try {
142
- await runPause(await tokenOrExit(token));
143
- }
144
- catch (err) {
145
- if (err instanceof FatalError)
146
- return;
147
- console.error(err instanceof Error ? err.message : String(err));
148
- process.exit(1);
149
- }
150
- });
151
- program
152
- .command("submit")
153
- .description("Submit your assessment code (walkthrough recording happens in the browser)")
154
- .option("-y, --yes", "Skip confirmation prompt")
155
- .action(async (opts) => {
156
- try {
157
- await runSubmit(opts);
158
- }
159
- catch (err) {
160
- if (err instanceof FatalError)
161
- return;
162
- console.error(err instanceof Error ? err.message : String(err));
163
- process.exit(1);
164
- }
165
- });
166
- program
167
- .command("doctor")
168
- .description("Check your assessment setup and repair activity tracking")
169
- // Positional like `litmus init <token>`, but optional: with a healthy
170
- // config the token comes from the settings file and nobody types it.
171
- // Doctor only needs it to restore a missing/corrupted settings file, and
172
- // prompts for it interactively when it does.
173
- .argument("[token]", "Assessment token, only needed to restore a missing settings file (doctor asks for it otherwise)")
174
- .option("--verbose", "Show diagnostic details for support")
175
- .option("--backfill-prompts", "Recover missed AI prompts from the whole assessment window (recovery also runs automatically when doctor repairs broken tracking)")
176
- .option("--since <timestamp>", "Only recover prompts after this time (ISO format, e.g. 2026-08-07T19:00:00Z)")
177
- .option("--all-sessions", "Recover from every AI session on this machine (Claude, Gemini, Copilot, Cursor), not just this folder's")
178
- .option("--no-backfill", "Skip automatic prompt recovery")
179
- .option("--here", "Restore a missing settings file in this folder, without looking for your assessment folder below it")
180
- .action(async (token, opts) => {
181
- try {
182
- await runDoctor({ ...opts, token });
183
- }
184
- catch (err) {
185
- if (err instanceof FatalError)
186
- return;
187
- console.error(err instanceof Error ? err.message : String(err));
188
- process.exit(1);
189
- }
190
- });
191
- program
192
- .command("setup-check")
193
- .description("Check this machine can run the Litmus CLI, before you start an assessment")
194
- .option("--verbose", "Show diagnostic details for support")
195
- .action(async (opts) => {
196
- try {
197
- await runSetupCheck(opts);
198
- }
199
- catch (err) {
200
- if (err instanceof FatalError)
201
- return;
202
- console.error(err instanceof Error ? err.message : String(err));
203
- process.exit(1);
204
- }
205
- });
206
- program
207
- .command("status")
208
- .description("Show assessment status and stats")
209
- .action(async () => {
210
- try {
211
- await runStatus();
212
- }
213
- catch (err) {
214
- if (err instanceof FatalError)
215
- return;
216
- console.error(err instanceof Error ? err.message : String(err));
217
- process.exit(1);
218
- }
219
- });
220
- program
221
- .command("env")
222
- .description("Set the assessment's environment variables in this shell: eval \"$(litmus env)\"")
223
- .option("--powershell", "Print PowerShell assignments, for: litmus env --powershell | Invoke-Expression")
224
- .action(async (opts) => {
225
- try {
226
- await runEnv(opts);
227
- }
228
- catch (err) {
229
- if (err instanceof FatalError)
230
- return;
231
- console.error(err instanceof Error ? err.message : String(err));
232
- process.exit(1);
233
- }
234
- });
235
- program.parse();
236
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO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;IAC3B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC1B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;AACtB,CAAC;KAAM,CAAC;IACN,MAAM,MAAM,CAAC,cAAc,CAAC,CAAA;AAC9B,CAAC"}
@@ -275,6 +275,10 @@ export declare function pruneOrphanedCaptureRegistrations(): void;
275
275
  * before deciding to reinstall via `setupAiTracking`.
276
276
  */
277
277
  export declare function detectInstalledHooks(assessmentDir: string): InstalledHooks;
278
+ /** A missing conversation is not evidence of a permission problem. Read the
279
+ * actual setup files before asking the candidate to do anything. Unknown
280
+ * configuration formats are left to the explicit doctor command. */
281
+ export declare function notificationSetupAction(assessmentDir: string, tool: "codex" | "copilot" | "claude_code"): "approve_codex" | "trust_copilot" | "repair" | null;
278
282
  export type HookCapturableTool = "claude" | "codex" | "cursor" | "gemini" | "copilot";
279
283
  export declare const HOOK_CAPTURABLE_TOOLS: readonly HookCapturableTool[];
280
284
  export interface InstalledHookCommands {
@@ -1 +1 @@
1
- {"version":3,"file":"ai-tracking.d.ts","sourceRoot":"","sources":["../../src/lib/ai-tracking.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,iBAAiB,QAA2C,CAAA;AAczE;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG/C;AAiBD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAWlD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAUnE;AAwCD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIxD;AAoCD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAYrE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAA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CAK5E;AA2DD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,iBAAiB,CAErH;AAgCD,sFAAsF;AACtF,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAK3E;AAyCD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAwCxE"}
@@ -1429,6 +1429,74 @@ export function detectInstalledHooks(assessmentDir) {
1429
1429
  loggerPresent: existsSync(USER_SCOPE_LOGGER),
1430
1430
  };
1431
1431
  }
1432
+ /** A missing conversation is not evidence of a permission problem. Read the
1433
+ * actual setup files before asking the candidate to do anything. Unknown
1434
+ * configuration formats are left to the explicit doctor command. */
1435
+ export function notificationSetupAction(assessmentDir, tool) {
1436
+ const hooks = detectInstalledHooks(assessmentDir);
1437
+ const installed = tool === "codex" ? hooks.codex : tool === "copilot" ? hooks.copilot : hooks.claude !== null;
1438
+ if (!installed)
1439
+ return "repair";
1440
+ // Project-scoped Claude is a supported fallback and intentionally does not
1441
+ // use the HOME logger or active-assessment registry.
1442
+ const projectClaude = tool === "claude_code" && hooks.claude === "project";
1443
+ if (projectClaude) {
1444
+ return existsSync(path.join(assessmentDir, ".litmus", "hook-logger.cjs")) ? null : "repair";
1445
+ }
1446
+ if (tool === "copilot") {
1447
+ // Copilot receives the assessment path explicitly, so neither logger
1448
+ // location needs an active-assessment registry entry.
1449
+ const commands = readOurHookCommands(copilotHooksFile(assessmentDir), COPILOT_PROMPT_EVENT).commands;
1450
+ const projectLogger = path.join(assessmentDir, ".litmus", "hook-logger.cjs");
1451
+ const loggers = [projectLogger, USER_SCOPE_LOGGER].filter(candidate => commands.includes(buildCopilotHookEntry(candidate, assessmentDir).command));
1452
+ if (!loggers.length)
1453
+ return null; // a command shape we cannot diagnose safely
1454
+ if (!loggers.some(logger => existsSync(logger)))
1455
+ return "repair";
1456
+ }
1457
+ else if (!hooks.loggerPresent || !hooks.registered)
1458
+ return "repair";
1459
+ if (tool === "codex") {
1460
+ const config = readJsonObjectOrNull(CODEX_HOOKS);
1461
+ const groups = config?.hooks?.UserPromptSubmit;
1462
+ if (!Array.isArray(groups))
1463
+ return null;
1464
+ let toml;
1465
+ try {
1466
+ toml = readFileSync(CODEX_CONFIG, "utf8");
1467
+ }
1468
+ catch {
1469
+ return null;
1470
+ }
1471
+ for (let index = 0; index < groups.length; index++) {
1472
+ if (!isOurEntry(groups[index]))
1473
+ continue;
1474
+ const commandHook = groups[index]?.hooks?.[0];
1475
+ if (typeof commandHook?.command !== "string" || typeof commandHook?.timeout !== "number")
1476
+ return null;
1477
+ const key = codexHookStateKey("UserPromptSubmit", index);
1478
+ if (codexKeyAppearsElsewhere(toml, key))
1479
+ return null;
1480
+ const table = codexStateTableForKey(key).exec(toml)?.[0] ?? "";
1481
+ const hash = codexHookTrustHash("UserPromptSubmit", commandHook.command, commandHook.timeout);
1482
+ const trusted = /^[ \t]*trusted_hash[ \t]*=[ \t]*["'](sha256:[a-f0-9]+)["']/m.exec(table)?.[1];
1483
+ return trusted === hash ? null : "approve_codex";
1484
+ }
1485
+ }
1486
+ if (tool === "copilot") {
1487
+ try {
1488
+ const config = JSON.parse(splitCopilotConfig(readFileSync(COPILOT_CONFIG, "utf8")).body);
1489
+ if (!Array.isArray(config.trustedFolders))
1490
+ return null;
1491
+ return config.trustedFolders.some((folder) => typeof folder === "string" && samePath(folder, assessmentDir))
1492
+ ? null : "trust_copilot";
1493
+ }
1494
+ catch {
1495
+ return null;
1496
+ }
1497
+ }
1498
+ return null;
1499
+ }
1432
1500
  export const HOOK_CAPTURABLE_TOOLS = ["claude", "codex", "cursor", "gemini", "copilot"];
1433
1501
  function readOurHookCommands(file, event) {
1434
1502
  if (!existsSync(file))