@mnemonik/cli 7.131.0 → 7.132.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 (49) hide show
  1. package/dist/auth/claudeCodeSignIn.d.ts +54 -0
  2. package/dist/auth/claudeCodeSignIn.d.ts.map +1 -0
  3. package/dist/auth/claudeCodeSignIn.js +108 -0
  4. package/dist/auth/claudeCodeSignIn.js.map +1 -0
  5. package/dist/auth/codexAuthorization.d.ts +47 -0
  6. package/dist/auth/codexAuthorization.d.ts.map +1 -0
  7. package/dist/auth/codexAuthorization.js +882 -0
  8. package/dist/auth/codexAuthorization.js.map +1 -0
  9. package/dist/auth/cursorAuthorization.d.ts +47 -0
  10. package/dist/auth/cursorAuthorization.d.ts.map +1 -0
  11. package/dist/auth/cursorAuthorization.js +116 -0
  12. package/dist/auth/cursorAuthorization.js.map +1 -0
  13. package/dist/auth/status.d.ts +65 -11
  14. package/dist/auth/status.d.ts.map +1 -1
  15. package/dist/auth/status.js +41 -12
  16. package/dist/auth/status.js.map +1 -1
  17. package/dist/auth/storedAuthorization.d.ts +50 -0
  18. package/dist/auth/storedAuthorization.d.ts.map +1 -0
  19. package/dist/auth/storedAuthorization.js +24 -0
  20. package/dist/auth/storedAuthorization.js.map +1 -0
  21. package/dist/authorizationWords.d.ts +69 -0
  22. package/dist/authorizationWords.d.ts.map +1 -0
  23. package/dist/authorizationWords.js +5275 -0
  24. package/dist/authorizationWords.js.map +1 -0
  25. package/dist/digests.json +47 -27
  26. package/dist/humanReason.js +6 -6
  27. package/dist/humanReason.js.map +1 -1
  28. package/dist/install/hosts.d.ts.map +1 -1
  29. package/dist/install/hosts.js +2 -1
  30. package/dist/install/hosts.js.map +1 -1
  31. package/dist/installation.d.ts +2 -0
  32. package/dist/installation.d.ts.map +1 -1
  33. package/dist/installation.js +12 -0
  34. package/dist/installation.js.map +1 -1
  35. package/dist/output.d.ts +5 -2
  36. package/dist/output.d.ts.map +1 -1
  37. package/dist/output.js +7 -3
  38. package/dist/output.js.map +1 -1
  39. package/dist/router.d.ts +12 -7
  40. package/dist/router.d.ts.map +1 -1
  41. package/dist/router.js +145 -62
  42. package/dist/router.js.map +1 -1
  43. package/dist/sbom.json +21 -21
  44. package/dist/scanner-release.json +18 -18
  45. package/dist/status.d.ts +67 -30
  46. package/dist/status.d.ts.map +1 -1
  47. package/dist/status.js +140 -33
  48. package/dist/status.js.map +1 -1
  49. package/package.json +31 -31
@@ -1,15 +1,15 @@
1
1
  {
2
- "version": "7.131.0",
3
- "digestsSha256": "5eac83ef2e5a95620a3c81f3683c390c8945e11cf4b086b64177ae58cccaf44e",
2
+ "version": "7.132.0",
3
+ "digestsSha256": "843daf7483f1c9697b3bb176f25bd5c7eb86c16f9cd408eee3414addbc426eb7",
4
4
  "platforms": {
5
5
  "darwin-arm64": {
6
6
  "schemaVersion": 1,
7
7
  "artifact": "scanner",
8
- "version": "7.131.0",
8
+ "version": "7.132.0",
9
9
  "entry": "scanner-darwin-arm64",
10
10
  "files": {
11
11
  "scanner-darwin-arm64": {
12
- "sha256": "e693be43123bf3c965591527a488958664da6c66f94a5a0fa2fe3bf2d3083c81",
12
+ "sha256": "cb5afa5922c38a27f75e48972a854b9493a7db55ae064771aad4d332df323ba5",
13
13
  "size": 154586464,
14
14
  "executable": true
15
15
  }
@@ -17,7 +17,7 @@
17
17
  "totalSize": 154586464,
18
18
  "source": {
19
19
  "kind": "release",
20
- "url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.131.0/"
20
+ "url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.132.0/"
21
21
  },
22
22
  "signer": {
23
23
  "platform": "darwin",
@@ -29,16 +29,16 @@
29
29
  "linux-arm64": {
30
30
  "schemaVersion": 1,
31
31
  "artifact": "scanner",
32
- "version": "7.131.0",
32
+ "version": "7.132.0",
33
33
  "entry": "scanner-linux-arm64",
34
34
  "files": {
35
35
  "scanner-linux-arm64": {
36
- "sha256": "4fe478b6d180a37dc9a282ed48f5693609776a01b1c511a91da430f52ffc5a79",
36
+ "sha256": "d58df75fb113b8073de04447701e43d875b6d637f5fde12fa8696d8f4e5d31c3",
37
37
  "size": 156961920,
38
38
  "executable": true
39
39
  },
40
40
  "scanner-linux-arm64.minisig": {
41
- "sha256": "ed6b9fd16dbfa92f00c181556b0e9ebc9ed8ce920fbf05b376f86ab850c54672",
41
+ "sha256": "365c96b9bca1136e03c052e679401ad55ad8908d715e0cf6ab474f12eb12c9df",
42
42
  "size": 314,
43
43
  "executable": false
44
44
  }
@@ -46,7 +46,7 @@
46
46
  "totalSize": 156962234,
47
47
  "source": {
48
48
  "kind": "release",
49
- "url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.131.0/"
49
+ "url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.132.0/"
50
50
  },
51
51
  "signer": {
52
52
  "platform": "linux",
@@ -59,16 +59,16 @@
59
59
  "linux-x64": {
60
60
  "schemaVersion": 1,
61
61
  "artifact": "scanner",
62
- "version": "7.131.0",
62
+ "version": "7.132.0",
63
63
  "entry": "scanner-linux-x64",
64
64
  "files": {
65
65
  "scanner-linux-x64": {
66
- "sha256": "8c09101fb138324f3d67d73417a2db5907f3a28ceaff6b30de54a4b04c6fa755",
66
+ "sha256": "da4b839814ab7bb5fdc3a01d19233552b13e78ec35c7a4c28a05c92eaa70967a",
67
67
  "size": 155192512,
68
68
  "executable": true
69
69
  },
70
70
  "scanner-linux-x64.minisig": {
71
- "sha256": "18e39b6c9fc1a96a122eb6643a4450afd264bf853ce776c9199a9904f6ed82be",
71
+ "sha256": "b7edc0866d2567ed9a470bb493ebfaa5a46b07c9cb44ea24c7e7e6c029e86969",
72
72
  "size": 312,
73
73
  "executable": false
74
74
  }
@@ -76,7 +76,7 @@
76
76
  "totalSize": 155192824,
77
77
  "source": {
78
78
  "kind": "release",
79
- "url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.131.0/"
79
+ "url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.132.0/"
80
80
  },
81
81
  "signer": {
82
82
  "platform": "linux",
@@ -89,19 +89,19 @@
89
89
  "win-x64": {
90
90
  "schemaVersion": 1,
91
91
  "artifact": "scanner",
92
- "version": "7.131.0",
92
+ "version": "7.132.0",
93
93
  "entry": "scanner-win-x64.exe",
94
94
  "files": {
95
95
  "scanner-win-x64.exe": {
96
- "sha256": "e76a7518fa38da93bf98f4605be2393c6bd2780dcf2a2bc299319faf0e44f2d5",
97
- "size": 127676416,
96
+ "sha256": "090592373a694c44e24cfaafb1ee592b684ca0638055c504f52174024cf1dd7d",
97
+ "size": 127678464,
98
98
  "executable": true
99
99
  }
100
100
  },
101
- "totalSize": 127676416,
101
+ "totalSize": 127678464,
102
102
  "source": {
103
103
  "kind": "release",
104
- "url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.131.0/"
104
+ "url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.132.0/"
105
105
  },
106
106
  "signingStatus": "unsigned",
107
107
  "disclosureVersion": "2026.09.1"
package/dist/status.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { CODEX_TRUST_MESSAGE } from './humanReason.js';
2
2
  import { cliCredentialStatus } from './auth/credentials.js';
3
- import type { CodingToolSignInState } from './auth/status.js';
3
+ import { type McpAuthorization, type McpState } from './auth/status.js';
4
+ import { type CliSignIn, type HooksState, type ScannerAuthorizationState } from './authorizationWords.js';
4
5
  import { type ScannerReceipt } from './scanner/control.js';
5
6
  import { type ScannerServiceOptions } from './scanner/service.js';
6
7
  import type { Readable } from 'node:stream';
@@ -16,6 +17,7 @@ export declare function localEditorStatus(home: string): Promise<{
16
17
  name: "Claude Code" | "Codex" | "Cursor";
17
18
  marked: boolean;
18
19
  hooks: boolean;
20
+ credentialFamily?: string | undefined;
19
21
  mcp: string;
20
22
  }[]>;
21
23
  /** What a person can really do to switch a declared connection back on. */
@@ -77,13 +79,12 @@ export declare function buildStatusDocument(input: StatusDocumentInput): Readine
77
79
  conditions: ReadinessCondition[];
78
80
  };
79
81
  /**
80
- * `status` could not tell the console about this machine because this
81
- * computer's sign-in is unusable (L-166). Wording decided 2026-09-25; the fix
82
- * is the approved renew step.
82
+ * `status` could not tell the console about this machine because the CLI's own
83
+ * sign-in could not be used (L-166): expired, revoked, or locked in the macOS
84
+ * Keychain over SSH. The CLI line of the authorization block gives the step.
83
85
  */
84
86
  export declare const REPORT_NOT_SENT: {
85
87
  sentence: string;
86
- nextStep: string;
87
88
  };
88
89
  export declare function renderStatusSummaries(document: ReadinessDocument & {
89
90
  cliCredential?: Awaited<ReturnType<typeof cliCredentialStatus>>;
@@ -124,56 +125,92 @@ export declare function collectStatusDocument(input: CollectStatusInput): Promis
124
125
  export interface CodingToolStatus {
125
126
  host: string;
126
127
  name: string;
127
- /** From this machine's own files and the tool's own trust records. */
128
- hooks: 'installed' | 'missing' | 'approval_pending';
129
- /**
130
- * From the server, by the console's rule. `unknown` when it could not be
131
- * read (Mnemonik unreachable, or this computer's own sign-in unusable).
132
- */
133
- signIn: CodingToolSignInState | 'unknown';
134
- /** When the tool last renewed its sign-in; dates use, never decides it. */
135
- lastUsedAt: string | null;
128
+ /** Its MCP connection's authorization; the evidence is in `authorizations`. */
129
+ mcp: McpState;
130
+ /** Its hooks' own authorization, from this machine's files and the tool's own trust records. */
131
+ hooks: HooksState;
136
132
  /** Commands the agent runs to fix what is wrong with this tool, in order; empty when none. */
137
133
  actions: string[];
138
134
  /**
139
135
  * Steps only the person can take, inside the coding tool, in plain words
140
- * (Claude Code and Cursor sign in only there); empty when none.
136
+ * (Claude Code and Cursor authorize MCP only there); empty when none.
141
137
  */
142
138
  personSteps: string[];
143
139
  }
140
+ /** One line of the authorization block, with the evidence behind it. */
141
+ export type AuthorizationEntry = ({
142
+ component: 'mcp';
143
+ host: string;
144
+ line: string;
145
+ } & McpAuthorization) | {
146
+ component: 'hooks';
147
+ host: string;
148
+ state: HooksState;
149
+ line: string;
150
+ } | {
151
+ component: 'scanner';
152
+ state: ScannerAuthorizationState;
153
+ line: string;
154
+ } | ({
155
+ component: 'cli';
156
+ line: string;
157
+ } & CliSignIn);
144
158
  /** The coding tools installed on this machine: chosen at install or marked in their own settings. */
145
159
  export declare function installedCodingTools(home: string, stateDir: string): Promise<{
146
160
  host: "claude-code" | "codex" | "cursor";
147
161
  name: "Claude Code" | "Codex" | "Cursor";
148
162
  marked: boolean;
149
163
  hooks: boolean;
164
+ credentialFamily?: string | undefined;
150
165
  mcp: string;
151
166
  }[]>;
167
+ /** The hooks' own authorization, as hookAuthorizations reads it. */
168
+ export type HookCredentialState = 'authorized' | 'not_authorized' | 'unchecked';
169
+ /**
170
+ * Each tool's hooks' own authorization: the credential the installer recorded
171
+ * for them (or their command names), stored here and inside its refresh
172
+ * window. Hooks that name none sign in some other way, which is not read here.
173
+ */
174
+ export declare function hookAuthorizations(stateDir: string, editors: ReadonlyArray<{
175
+ host: string;
176
+ credentialFamily?: string;
177
+ }>, now?: number): Promise<Map<string, HookCredentialState>>;
152
178
  export declare function codingToolStatuses(editors: ReadonlyArray<{
153
179
  host: string;
154
180
  name: string;
155
181
  hooks: boolean;
156
- }>, conditions: readonly ReadinessCondition[], signIns: ReadonlyMap<string, {
157
- state: CodingToolSignInState;
158
- lastUsedAt: string | null;
159
- }> | undefined): CodingToolStatus[];
182
+ }>, conditions: readonly ReadinessCondition[], mcp: ReadonlyMap<string, McpAuthorization>, hookCredentials?: ReadonlyMap<string, HookCredentialState>): CodingToolStatus[];
160
183
  /**
161
- * The status document with each tool's sign-in added. A tool signed out on
162
- * this machine is a condition of the installation: status never says the
163
- * machine is working while one is. A tool never signed in here is not (it may
164
- * simply be unused); its line says how to sign in.
184
+ * The status document with each tool's state added. A tool whose MCP
185
+ * authorization here was revoked, expired, or is no longer held by the tool,
186
+ * hooks or a scanner whose own authorization is missing, expired or refused,
187
+ * is a condition of the installation: status never says the machine is
188
+ * working while one is. A tool never authorized here is not (it may simply be
189
+ * unused); its line says how to authorize it.
165
190
  */
166
191
  export declare function withCodingTools<T extends ReadinessDocument & {
167
192
  conditions?: readonly ReadinessCondition[];
168
- }>(document: T, tools: readonly CodingToolStatus[]): T & {
193
+ }>(document: T, tools: readonly CodingToolStatus[], mcp: ReadonlyMap<string, McpAuthorization>,
194
+ /** The scanner's own authorization; one that is gone is a condition too, said once. */
195
+ scanner?: ScannerAuthorizationState): T & {
169
196
  codingTools: CodingToolStatus[];
170
197
  };
171
198
  /**
172
- * One line per tool, for a person, at a glance: signed in or not, and the one
173
- * short command when there is something to do. Hooks, last use and the rest
174
- * are in `--json`. A signed-out tool is already the installation's attention
175
- * line, with its command, so it is not said twice; a tool whose sign-in could
176
- * not be read gets no line.
199
+ * Background indexing's own authorization on this computer: set up, its
200
+ * credential stored here and inside its refresh window, and no refusal
201
+ * reported by the running scanner. The server's record of it is not asked.
202
+ */
203
+ export declare function scannerAuthorization(stateDir: string, now?: number): Promise<ScannerAuthorizationState>;
204
+ /**
205
+ * The authorization block of `status`: each tool's MCP connection and hooks,
206
+ * then the scanner and the CLI, one line each, never dropped. A state the
207
+ * installation's attention lines already give a step for says only what is wrong.
177
208
  */
178
- export declare function codingToolLines(tools: readonly CodingToolStatus[]): string[];
209
+ export declare function authorizationEntries(input: {
210
+ tools: readonly CodingToolStatus[];
211
+ mcp: ReadonlyMap<string, McpAuthorization>;
212
+ conditions: readonly ReadinessCondition[];
213
+ scanner: ScannerAuthorizationState;
214
+ cli: CliSignIn;
215
+ }): AuthorizationEntry[];
179
216
  //# sourceMappingURL=status.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO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C,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC3C,UAAU,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC1C,OAAO,EAAE,yBAAyB,CAAC;IACnC,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,kBAAkB,EAAE,CA4BvB"}
package/dist/status.js CHANGED
@@ -2707,6 +2707,16 @@ import {
2707
2707
  } from "./humanReason.js";
2708
2708
  import { CODEX_TRUST_MESSAGE } from "./humanReason.js";
2709
2709
  import { cliCredentialStatus } from "./auth/credentials.js";
2710
+ import { createCliCredentials } from "./auth/credentials.js";
2711
+ import { mcpAuthorization } from "./auth/status.js";
2712
+ import {
2713
+ cliLine,
2714
+ hooksLine,
2715
+ mcpLine,
2716
+ hooksNotAuthorizedReason,
2717
+ mcpNotAuthorizedReason,
2718
+ scannerLine
2719
+ } from "./authorizationWords.js";
2710
2720
  import { readOwnership } from "./install/ownership.js";
2711
2721
  import {
2712
2722
  pausedForConsent,
@@ -8196,6 +8206,7 @@ async function localEditorStatus(home) {
8196
8206
  declaration = object(config.mcp_servers) ? config.mcp_servers.mnemonik : object(config.mcpServers) ? config.mcpServers.mnemonik : void 0;
8197
8207
  } catch {
8198
8208
  }
8209
+ const credentialFamily = commands.map((command) => /--credential-family (\S+)/u.exec(command)?.[1]).find((id) => !!id);
8199
8210
  return {
8200
8211
  host,
8201
8212
  name: name2,
@@ -8203,6 +8214,7 @@ async function localEditorStatus(home) {
8203
8214
  // presence of ~/.codex or a project-local .cursor is not a choice.
8204
8215
  marked: commands.length > 0 || object(declaration),
8205
8216
  hooks,
8217
+ ...credentialFamily ? { credentialFamily } : {},
8206
8218
  mcp: !object(declaration) ? "missing" : declaration.enabled === false || declaration.disabled === true ? "disabled" : "ready"
8207
8219
  };
8208
8220
  })
@@ -8407,8 +8419,7 @@ ${message.nextStep}`;
8407
8419
  return lines;
8408
8420
  }
8409
8421
  var REPORT_NOT_SENT = {
8410
- sentence: "The console has not heard from this machine because its sign-in no longer works.",
8411
- nextStep: humanMessageFor("renew").nextStep
8422
+ sentence: "The console has not heard from this computer because the CLI sign-in could not be used."
8412
8423
  };
8413
8424
  function renderStatusSummaries(document, output, options = {}) {
8414
8425
  if (options.diagnostics && document.cliCredential)
@@ -8477,7 +8488,7 @@ function refusalLines(batches, withPaths = false) {
8477
8488
  function scannerFailureCause(failure) {
8478
8489
  switch (failure.kind) {
8479
8490
  case "credential_refused":
8480
- return "The server refused this computer's indexing sign-in. Run mnemonik repair.";
8491
+ return "Mnemonik no longer accepts the scanner authorization on this computer. Run mnemonik repair.";
8481
8492
  case "push_rejected":
8482
8493
  return `The server rejected an upload from this computer.${failure.reason ? ` The server said: ${failure.reason}.` : ""}`;
8483
8494
  case "watcher_error":
@@ -8722,29 +8733,70 @@ async function installedCodingTools(home, stateDir) {
8722
8733
  (editor) => editor.marked || owned.includes(editor.host)
8723
8734
  );
8724
8735
  }
8725
- function codingToolStatuses(editors, conditions, signIns) {
8736
+ var hookConditionKinds = /* @__PURE__ */ new Set([
8737
+ "hooks_missing",
8738
+ "hook_not_verified",
8739
+ "host_trust_pending",
8740
+ "selected_component_failed"
8741
+ ]);
8742
+ async function hookAuthorizations(stateDir, editors, now = Date.now()) {
8743
+ const owned = (await readOwnership(stateDir)).targets;
8744
+ const credentials = createCliCredentials({ stateDir });
8745
+ return new Map(
8746
+ await Promise.all(
8747
+ editors.map(async (editor) => {
8748
+ const id = owned.find((target) => target.host === editor.host && target.component === "hooks")?.credentialFamily || editor.credentialFamily;
8749
+ if (!id) return [editor.host, "unchecked"];
8750
+ const family = await credentials.readFamily(id).catch(() => null);
8751
+ return [
8752
+ editor.host,
8753
+ family && Date.parse(family.refreshExpiresAt) > now ? "authorized" : "not_authorized"
8754
+ ];
8755
+ })
8756
+ )
8757
+ );
8758
+ }
8759
+ function hooksState(host, installed, credential, conditions) {
8760
+ const mine = conditions.filter(
8761
+ (condition) => condition.component === host && hookConditionKinds.has(condition.kind)
8762
+ );
8763
+ if (mine.some((condition) => condition.kind === "host_trust_pending")) return "trust_pending";
8764
+ const missing = mine.find(
8765
+ (condition) => condition.kind === "hooks_missing" || condition.kind === "selected_component_failed" && /hooks/u.test(condition.reason)
8766
+ );
8767
+ if (missing && !/sign-in/u.test(missing.reason)) return "not_installed";
8768
+ if (!installed) return "not_installed";
8769
+ if (missing || credential === "not_authorized") return "not_authorized";
8770
+ const unverified = mine.find((condition) => condition.kind === "hook_not_verified");
8771
+ if (unverified) return /not installed/u.test(unverified.reason) ? "not_installed" : "unchecked";
8772
+ return credential === "unchecked" ? "unchecked" : "authorized";
8773
+ }
8774
+ var ended = (mcp) => mcp?.state === "not_authorized" && (mcp.reason === "revoked_or_expired" || mcp.reason === "not_held");
8775
+ function codingToolStatuses(editors, conditions, mcp, hookCredentials = /* @__PURE__ */ new Map()) {
8726
8776
  return editors.map((editor) => {
8777
+ const hooks = hooksState(
8778
+ editor.host,
8779
+ editor.hooks,
8780
+ hookCredentials.get(editor.host),
8781
+ conditions
8782
+ );
8727
8783
  const trust = conditions.find(
8728
8784
  (condition) => condition.kind === "host_trust_pending" && condition.component === editor.host
8729
8785
  );
8730
- const hooks = trust ? "approval_pending" : editor.hooks && !conditions.some(
8731
- (condition) => condition.kind === "hooks_missing" && condition.component === editor.host
8732
- ) ? "installed" : "missing";
8733
- const signIn = signIns?.get(editor.host);
8734
- const signInNeeded = signIn?.state === "signed_out" || signIn?.state === "not_set_up";
8786
+ const authorization = mcp.get(editor.host);
8787
+ const authorizeNeeded = authorization?.state === "not_authorized";
8735
8788
  const fix = signInFix(editor.host);
8736
8789
  return {
8737
8790
  host: editor.host,
8738
8791
  name: editor.name,
8792
+ mcp: authorization?.state ?? "unchecked",
8739
8793
  hooks,
8740
- signIn: signIn?.state ?? "unknown",
8741
- lastUsedAt: signIn?.lastUsedAt ?? null,
8742
8794
  actions: [
8743
- ...hooks === "missing" ? ["mnemonik repair"] : [],
8744
- ...hooks === "approval_pending" && trust?.action ? [trust.action] : [],
8745
- ...signInNeeded && "command" in fix ? [fix.command] : []
8795
+ ...hooks === "not_installed" || hooks === "not_authorized" ? ["mnemonik repair"] : [],
8796
+ ...hooks === "trust_pending" && trust?.action ? [trust.action] : [],
8797
+ ...authorizeNeeded && "command" in fix ? [fix.command] : []
8746
8798
  ],
8747
- personSteps: signInNeeded && "step" in fix ? [fix.step] : []
8799
+ personSteps: authorizeNeeded && "step" in fix ? [fix.step] : []
8748
8800
  };
8749
8801
  });
8750
8802
  }
@@ -8754,16 +8806,39 @@ var stateRank = {
8754
8806
  ACTION_REQUIRED: 2,
8755
8807
  FAILED: 3
8756
8808
  };
8757
- function withCodingTools(document, tools) {
8758
- const signedOut = tools.filter((tool) => tool.signIn === "signed_out").map((tool) => {
8759
- const fix = signInFix(tool.host);
8760
- return {
8761
- kind: "login_pending",
8809
+ function withCodingTools(document, tools, mcp, scanner) {
8810
+ const scannerSaid = (document.conditions ?? []).some(
8811
+ (condition) => condition.component === "scanner" && condition.kind === "login_pending"
8812
+ );
8813
+ const signedOut = [
8814
+ ...(scanner === "not_authorized" || scanner === "refused") && !scannerSaid ? [
8815
+ {
8816
+ kind: "login_pending",
8817
+ component: "scanner",
8818
+ reason: "scanner_signed_out",
8819
+ action: "mnemonik repair"
8820
+ }
8821
+ ] : [],
8822
+ ...tools.filter((tool) => ended(mcp.get(tool.host))).map((tool) => {
8823
+ const fix = signInFix(tool.host);
8824
+ return {
8825
+ kind: "login_pending",
8826
+ component: tool.host,
8827
+ reason: mcpNotAuthorizedReason(tool.name),
8828
+ action: "step" in fix ? fix.step : fix.command
8829
+ };
8830
+ }),
8831
+ ...tools.filter(
8832
+ (tool) => tool.hooks === "not_authorized" && !(document.conditions ?? []).some(
8833
+ (condition) => condition.component === tool.host && condition.kind === "hooks_missing"
8834
+ )
8835
+ ).map((tool) => ({
8836
+ kind: "hooks_missing",
8762
8837
  component: tool.host,
8763
- reason: `${tool.name} is signed out of Mnemonik.`,
8764
- action: "step" in fix ? fix.step : fix.command
8765
- };
8766
- });
8838
+ reason: hooksNotAuthorizedReason(tool.name),
8839
+ action: "mnemonik repair"
8840
+ }))
8841
+ ];
8767
8842
  if (!signedOut.length) return { ...document, codingTools: [...tools] };
8768
8843
  const added = reduceReadiness(signedOut);
8769
8844
  const installation = document.installation;
@@ -8778,23 +8853,54 @@ function withCodingTools(document, tools) {
8778
8853
  codingTools: [...tools]
8779
8854
  };
8780
8855
  }
8781
- function codingToolLines(tools) {
8782
- return tools.flatMap((tool) => {
8783
- if (tool.signIn === "signed_in") return [`${tool.name}: signed in.`];
8784
- if (tool.signIn === "signed_in_elsewhere")
8785
- return [`${tool.name}: signed in on another of your machines.`];
8786
- if (tool.signIn !== "not_set_up") return [];
8787
- const fix = signInFix(tool.host);
8788
- return [`${tool.name}: not signed in. ${"step" in fix ? fix.step : `Run ${fix.command}.`}`];
8856
+ async function scannerAuthorization(stateDir, now = Date.now()) {
8857
+ const state = JSON.parse(
8858
+ await readFile2(join6(stateDir, "scanner/state.json"), "utf8").catch(() => "null")
8859
+ );
8860
+ if (!state) return "not_set_up";
8861
+ const receipt = await scannerReceipt(stateDir).catch(() => null);
8862
+ if (receipt?.snapshot?.lifecycle?.reason === "credential_revoked") return "refused";
8863
+ const id = state.config?.credentialFamilyId;
8864
+ if (typeof id !== "string") return "unchecked";
8865
+ const family = await createCliCredentials({ stateDir }).readFamily(id).catch(() => null);
8866
+ return family && Date.parse(family.refreshExpiresAt) > now ? "authorized" : "not_authorized";
8867
+ }
8868
+ function authorizationEntries(input) {
8869
+ const stepped = (component, kinds) => input.conditions.some(
8870
+ (condition) => condition.component === component && kinds.has(condition.kind)
8871
+ );
8872
+ const entries = [];
8873
+ for (const tool of input.tools) {
8874
+ const mcp = input.mcp.get(tool.host) ?? mcpAuthorization(void 0, void 0);
8875
+ entries.push({
8876
+ component: "mcp",
8877
+ host: tool.host,
8878
+ ...mcp,
8879
+ line: mcpLine(tool.name, tool.host, mcp)
8880
+ });
8881
+ entries.push({
8882
+ component: "hooks",
8883
+ host: tool.host,
8884
+ state: tool.hooks,
8885
+ line: hooksLine(tool.name, tool.hooks, stepped(tool.host, hookConditionKinds))
8886
+ });
8887
+ }
8888
+ entries.push({
8889
+ component: "scanner",
8890
+ state: input.scanner,
8891
+ line: scannerLine(input.scanner, stepped("scanner", /* @__PURE__ */ new Set(["login_pending"])))
8789
8892
  });
8893
+ entries.push({ component: "cli", ...input.cli, line: cliLine(input.cli) });
8894
+ return entries;
8790
8895
  }
8791
8896
  export {
8792
8897
  CODEX_TRUST_MESSAGE,
8793
8898
  REPORT_NOT_SENT,
8899
+ authorizationEntries,
8794
8900
  buildStatusDocument,
8795
- codingToolLines,
8796
8901
  codingToolStatuses,
8797
8902
  collectStatusDocument,
8903
+ hookAuthorizations,
8798
8904
  installedCodingTools,
8799
8905
  localEditorStatus,
8800
8906
  localInstallationConditions,
@@ -8804,6 +8910,7 @@ export {
8804
8910
  renderRefusals,
8805
8911
  renderScannerFailure,
8806
8912
  renderStatusSummaries,
8913
+ scannerAuthorization,
8807
8914
  scannerFailureCause,
8808
8915
  statusExitCode,
8809
8916
  withCodingTools