@mnemonik/cli 7.131.0 → 7.131.1
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.
- package/dist/auth/claudeCodeSignIn.d.ts +63 -0
- package/dist/auth/claudeCodeSignIn.d.ts.map +1 -0
- package/dist/auth/claudeCodeSignIn.js +106 -0
- package/dist/auth/claudeCodeSignIn.js.map +1 -0
- package/dist/auth/status.d.ts +19 -1
- package/dist/auth/status.d.ts.map +1 -1
- package/dist/auth/status.js +20 -5
- package/dist/auth/status.js.map +1 -1
- package/dist/digests.json +18 -14
- package/dist/router.d.ts +6 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +63 -8
- package/dist/router.js.map +1 -1
- package/dist/sbom.json +21 -21
- package/dist/scanner-release.json +18 -18
- package/dist/status.d.ts +10 -5
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +7 -1
- package/dist/status.js.map +1 -1
- package/package.json +31 -31
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What Claude Code itself holds for Mnemonik's MCP server on this computer.
|
|
3
|
+
*
|
|
4
|
+
* On 2026-10-12 a network outage emptied Claude Code's stored Mnemonik sign-in
|
|
5
|
+
* while the server still held a valid grant, and status said signed in. The
|
|
6
|
+
* server's grant says a sign-in exists; only Claude Code's own store says
|
|
7
|
+
* whether Claude Code can use it. Read the way Claude Code 2.1.296 reads it:
|
|
8
|
+
*
|
|
9
|
+
* - The entry is `mcpOAuth["mnemonik|" + sha256(JSON.stringify({type, url,
|
|
10
|
+
* headers}))[0..16]]`, keyed by the declaration in ~/.claude.json, so a sign-in
|
|
11
|
+
* stored for an older declaration (other headers) is not this one's.
|
|
12
|
+
* - Linux and Windows keep the document in ~/.claude/.credentials.json; a
|
|
13
|
+
* missing file means Claude Code holds nothing.
|
|
14
|
+
* - macOS keeps it in the login Keychain, generic password service
|
|
15
|
+
* `Claude Code-credentials`, account $USER, written and read with
|
|
16
|
+
* /usr/bin/security; the file is read only when that item does not exist.
|
|
17
|
+
* - Windows uses Credential Manager instead when CLAUDE_CODE_FORCE_WINDOWS_CREDMAN
|
|
18
|
+
* is 1 or ~/.claude.json caches `tengu_windows_credman: true`; that store is
|
|
19
|
+
* not read here.
|
|
20
|
+
*
|
|
21
|
+
* Only key names, presence and `expiresAt` are looked at. Token values are never
|
|
22
|
+
* returned, printed or logged, and a parse error (whose message can quote the
|
|
23
|
+
* input) is never passed on.
|
|
24
|
+
*/
|
|
25
|
+
export type StoredSignInState = 'signed_in' | 'refreshable' | 'missing' | 'unreadable';
|
|
26
|
+
export interface StoredSignIn {
|
|
27
|
+
/**
|
|
28
|
+
* `signed_in`: an access token that has not expired. `refreshable`: the access
|
|
29
|
+
* token has expired or is gone, and a refresh token renews it the next time
|
|
30
|
+
* Claude Code connects. `missing`: nothing Claude Code can use; it shows
|
|
31
|
+
* mnemonik as needing authentication. `unreadable`: it could not be read.
|
|
32
|
+
*/
|
|
33
|
+
state: StoredSignInState;
|
|
34
|
+
/** When the stored access token expires or expired; null when unknown. */
|
|
35
|
+
expiresAt: string | null;
|
|
36
|
+
}
|
|
37
|
+
export declare const CLAUDE_CODE_KEYCHAIN_SERVICE = "Claude Code-credentials";
|
|
38
|
+
export type KeychainRead = (service: string, account: string) => Promise<{
|
|
39
|
+
code: number | null;
|
|
40
|
+
stdout: string;
|
|
41
|
+
}>;
|
|
42
|
+
export interface ClaudeCodeStoreOptions {
|
|
43
|
+
home: string;
|
|
44
|
+
platform?: NodeJS.Platform;
|
|
45
|
+
env?: NodeJS.ProcessEnv;
|
|
46
|
+
now?: () => number;
|
|
47
|
+
/** The macOS Keychain read; /usr/bin/security by default. */
|
|
48
|
+
keychain?: KeychainRead;
|
|
49
|
+
}
|
|
50
|
+
/** Claude Code's key for a server's stored sign-in (its `zl(name, config)`). */
|
|
51
|
+
export declare function claudeCodeCredentialKey(name: string, declaration: {
|
|
52
|
+
type: string;
|
|
53
|
+
url: string;
|
|
54
|
+
headers?: unknown;
|
|
55
|
+
}): string;
|
|
56
|
+
/** One stored entry, judged as Claude Code judges it when it connects. */
|
|
57
|
+
export declare function storedSignInState(entry: unknown, now: number): StoredSignIn;
|
|
58
|
+
/**
|
|
59
|
+
* Claude Code's stored Mnemonik sign-in on this computer, or undefined when
|
|
60
|
+
* Claude Code has no Mnemonik HTTP declaration that signs in with OAuth here.
|
|
61
|
+
*/
|
|
62
|
+
export declare function claudeCodeStoredSignIn(options: ClaudeCodeStoreOptions): Promise<StoredSignIn | undefined>;
|
|
63
|
+
//# sourceMappingURL=claudeCodeSignIn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claudeCodeSignIn.d.ts","sourceRoot":"","sources":["../../src/auth/claudeCodeSignIn.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AACvF,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,KAAK,EAAE,iBAAiB,CAAC;IACzB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAID,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAwED,gFAAgF;AAChF,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5D,MAAM,CAMR;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAY3E;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAwCnC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/cli/src/auth/claudeCodeSignIn.ts
|
|
4
|
+
import { execFile } from "node:child_process";
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
import { readFile } from "node:fs/promises";
|
|
7
|
+
import { userInfo } from "node:os";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
var KEYCHAIN_ITEM_NOT_FOUND = 44;
|
|
10
|
+
var CLAUDE_CODE_KEYCHAIN_SERVICE = "Claude Code-credentials";
|
|
11
|
+
var object = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
12
|
+
var present = (value) => typeof value === "string" && value.length > 0;
|
|
13
|
+
var readKeychain = (service, account) => new Promise((resolve) => {
|
|
14
|
+
execFile(
|
|
15
|
+
"/usr/bin/security",
|
|
16
|
+
["find-generic-password", "-a", account, "-w", "-s", service],
|
|
17
|
+
{ encoding: "utf8", timeout: 2e3, maxBuffer: 1024 * 1024, windowsHide: true },
|
|
18
|
+
(error, stdout) => resolve(
|
|
19
|
+
error ? { code: typeof error.code === "number" ? error.code : null, stdout: "" } : { code: 0, stdout }
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
function keychainAccount(env) {
|
|
24
|
+
let name;
|
|
25
|
+
try {
|
|
26
|
+
name = env.USER || userInfo().username;
|
|
27
|
+
} catch {
|
|
28
|
+
name = void 0;
|
|
29
|
+
}
|
|
30
|
+
return name && /^[a-zA-Z0-9._-]+$/u.test(name) ? name : "claude-code-user";
|
|
31
|
+
}
|
|
32
|
+
function parse(text) {
|
|
33
|
+
try {
|
|
34
|
+
const value = JSON.parse(text);
|
|
35
|
+
return object(value) ? value : void 0;
|
|
36
|
+
} catch {
|
|
37
|
+
return void 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function credentialDocument(options, config) {
|
|
41
|
+
const { env, home, platform } = options;
|
|
42
|
+
if (platform === "darwin") {
|
|
43
|
+
const item = await options.keychain(CLAUDE_CODE_KEYCHAIN_SERVICE, keychainAccount(env)).catch(() => void 0);
|
|
44
|
+
if (!item) return void 0;
|
|
45
|
+
if (item.code === 0) return parse(item.stdout.trim());
|
|
46
|
+
if (item.code !== KEYCHAIN_ITEM_NOT_FOUND) return void 0;
|
|
47
|
+
}
|
|
48
|
+
if (platform === "win32" && (env.CLAUDE_CODE_FORCE_WINDOWS_CREDMAN === "1" || object(config.cachedGrowthBookFeatures) && config.cachedGrowthBookFeatures.tengu_windows_credman === true))
|
|
49
|
+
return void 0;
|
|
50
|
+
let text;
|
|
51
|
+
try {
|
|
52
|
+
text = await readFile(join(home, ".claude", ".credentials.json"), "utf8");
|
|
53
|
+
} catch (error) {
|
|
54
|
+
return error.code === "ENOENT" ? null : void 0;
|
|
55
|
+
}
|
|
56
|
+
return parse(text);
|
|
57
|
+
}
|
|
58
|
+
function claudeCodeCredentialKey(name, declaration) {
|
|
59
|
+
const type = declaration.type === "streamable-http" ? "http" : declaration.type;
|
|
60
|
+
const digest = createHash("sha256").update(JSON.stringify({ type, url: declaration.url, headers: declaration.headers || {} })).digest("hex");
|
|
61
|
+
return `${name}|${digest.slice(0, 16)}`;
|
|
62
|
+
}
|
|
63
|
+
function storedSignInState(entry, now) {
|
|
64
|
+
if (!object(entry) || !present(entry.accessToken) && !present(entry.refreshToken))
|
|
65
|
+
return { state: "missing", expiresAt: null };
|
|
66
|
+
const expires = typeof entry.expiresAt === "number" && Number.isFinite(entry.expiresAt) ? entry.expiresAt : void 0;
|
|
67
|
+
const expiresAt = expires === void 0 ? null : new Date(expires).toISOString();
|
|
68
|
+
if (present(entry.accessToken) && (expires === void 0 || expires > now))
|
|
69
|
+
return { state: "signed_in", expiresAt };
|
|
70
|
+
return { state: present(entry.refreshToken) ? "refreshable" : "missing", expiresAt };
|
|
71
|
+
}
|
|
72
|
+
async function claudeCodeStoredSignIn(options) {
|
|
73
|
+
const env = options.env ?? process.env;
|
|
74
|
+
const raw = await readFile(join(options.home, ".claude.json"), "utf8").catch(() => void 0);
|
|
75
|
+
const config = raw === void 0 ? void 0 : parse(raw);
|
|
76
|
+
const declaration = object(config?.mcpServers) ? config.mcpServers.mnemonik : void 0;
|
|
77
|
+
if (!config || !object(declaration) || typeof declaration.url !== "string" || typeof declaration.type !== "string" || !["http", "streamable-http", "sse"].includes(declaration.type))
|
|
78
|
+
return void 0;
|
|
79
|
+
if (declaration.headersHelper !== void 0 || object(declaration.headers) && Object.keys(declaration.headers).some((name) => name.toLowerCase() === "authorization"))
|
|
80
|
+
return void 0;
|
|
81
|
+
const unreadable = { state: "unreadable", expiresAt: null };
|
|
82
|
+
if (env.CLAUDE_CONFIG_DIR || env.CLAUDE_SECURESTORAGE_CONFIG_DIR !== void 0) return unreadable;
|
|
83
|
+
const document = await credentialDocument(
|
|
84
|
+
{
|
|
85
|
+
home: options.home,
|
|
86
|
+
env,
|
|
87
|
+
platform: options.platform ?? process.platform,
|
|
88
|
+
keychain: options.keychain ?? readKeychain
|
|
89
|
+
},
|
|
90
|
+
config
|
|
91
|
+
);
|
|
92
|
+
if (document === void 0) return unreadable;
|
|
93
|
+
const entries = object(document?.mcpOAuth) ? document.mcpOAuth : {};
|
|
94
|
+
const key = claudeCodeCredentialKey("mnemonik", {
|
|
95
|
+
type: declaration.type,
|
|
96
|
+
url: declaration.url,
|
|
97
|
+
headers: declaration.headers
|
|
98
|
+
});
|
|
99
|
+
return storedSignInState(entries[key], (options.now ?? Date.now)());
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
CLAUDE_CODE_KEYCHAIN_SERVICE,
|
|
103
|
+
claudeCodeCredentialKey,
|
|
104
|
+
claudeCodeStoredSignIn,
|
|
105
|
+
storedSignInState
|
|
106
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claudeCodeSignIn.js","sourceRoot":"","sources":["../../src/auth/claudeCodeSignIn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAuCjC,kFAAkF;AAClF,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAyB,CAAC;AAgBtE,MAAM,MAAM,GAAG,CAAC,KAAc,EAAoC,EAAE,CAClE,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChE,MAAM,OAAO,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAElF,MAAM,YAAY,GAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CACtD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACtB,QAAQ,CACN,mBAAmB,EACnB,CAAC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,OAAO,SAAS,CAAC;IACnB,MAAM,UAAU,GAAiB,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC1E,4EAA4E;IAC5E,IAAI,GAAG,CAAC,iBAAiB,IAAI,GAAG,CAAC,+BAA+B,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC;IAClG,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CACvC;QACE,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG;QACH,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ;QAC9C,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,YAAY;KAC3C,EACD,MAAM,CACP,CAAC;IACF,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC;IAC9C,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IACpE,MAAM,GAAG,GAAG,uBAAuB,CAAC,UAAU,EAAE;QAC9C,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,GAAG,EAAE,WAAW,CAAC,GAAG;QACpB,OAAO,EAAE,WAAW,CAAC,OAAO;KAC7B,CAAC,CAAC;IACH,OAAO,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/auth/status.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HostName } from '@mnemonik/shared';
|
|
2
|
+
import type { StoredSignIn } from './claudeCodeSignIn.js';
|
|
2
3
|
export interface AccountGrant {
|
|
3
4
|
deviceInstallationId?: string | null;
|
|
4
5
|
id: string;
|
|
@@ -54,15 +55,32 @@ export declare function codingToolSignIn(host: HostName, here: GrantStatus, ever
|
|
|
54
55
|
state: CodingToolSignInState;
|
|
55
56
|
lastUsedAt: string | null;
|
|
56
57
|
};
|
|
58
|
+
export type CodingToolSignInResult = {
|
|
59
|
+
state: CodingToolSignInState;
|
|
60
|
+
lastUsedAt: string | null;
|
|
61
|
+
/** What the coding tool itself holds here; read for Claude Code only. */
|
|
62
|
+
stored?: StoredSignIn;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Claude Code's sign-in on this machine: the server's verdict, held to what
|
|
66
|
+
* Claude Code itself stores (2026-10-12 outage). The server decides signed out
|
|
67
|
+
* (revoked or expired grants); only the stored credential can say signed in.
|
|
68
|
+
* Holding nothing it can use, Claude Code is signed out where the server knows
|
|
69
|
+
* a sign-in here, otherwise not set up; holding something, it is what the server
|
|
70
|
+
* says. A store that cannot be read, or a server that cannot, vouches for
|
|
71
|
+
* nothing: no claim, unless the server alone already decides signed out.
|
|
72
|
+
*/
|
|
73
|
+
export declare function withStoredSignIn(server: CodingToolSignInResult | undefined, stored: StoredSignIn | undefined): CodingToolSignInResult | undefined;
|
|
57
74
|
/** "just now", "5 minutes ago", "1 hour ago", "3 days ago", or "never". */
|
|
58
75
|
export declare function relativeTime(time: number | null, now: number): string;
|
|
59
76
|
/**
|
|
60
77
|
* One line per host for plain `auth status`: editors first, then the rest,
|
|
61
78
|
* each by most recent use. Grant ids, dates and scopes are for --json.
|
|
79
|
+
* `onThisComputer` rewrites a host's summary with what the tool itself stores here.
|
|
62
80
|
*/
|
|
63
81
|
export declare function grantSummaryLines(grants: readonly (AccountGrant & {
|
|
64
82
|
host: string;
|
|
65
|
-
})[], editors: Readonly<Record<string, string>>, now?: number): string[];
|
|
83
|
+
})[], editors: Readonly<Record<string, string>>, now?: number, onThisComputer?: Readonly<Record<string, (summary: string) => string>>): string[];
|
|
66
84
|
export declare function grantTransport(getBearer: () => Promise<string>, fetcher?: typeof fetch): {
|
|
67
85
|
/** Every machine's unrevoked sign-ins, or with `here` every sign-in on this one. */
|
|
68
86
|
list(options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/auth/status.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/auth/status.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,WAAW,YAAY;IAC3B,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,cAAc,GAAG,SAAS,GAAG,YAAY,CAAC;CAClE;AACD,MAAM,WAAW,WAAW;IAC1B,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,SAAS,UAAW,YAAY,KAAG,Q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K,MAAM,CAAC,CAAM,GACzE,MAAM,EAAE,CA0BV;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,GAAE,OAAO,KAAa;IAc1F,oFAAoF;IAC9E,IAAI,WAAU;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAAQ,OAAO,CAAC,WAAW,CAAC;IA8B5D,MAAM,KAAK,MAAM;EAI1B;AACD,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
package/dist/auth/status.js
CHANGED
|
@@ -5190,6 +5190,18 @@ function codingToolSignIn(host, here, everywhere) {
|
|
|
5190
5190
|
if (remote.length) return { state: "signed_in_elsewhere", lastUsedAt: newest(remote) };
|
|
5191
5191
|
return mine.some((grant) => grant.status !== "incomplete" && grant.activatedAt !== null) ? { state: "signed_out", lastUsedAt: null } : { state: "not_set_up", lastUsedAt: null };
|
|
5192
5192
|
}
|
|
5193
|
+
function withStoredSignIn(server, stored) {
|
|
5194
|
+
if (!stored) return server;
|
|
5195
|
+
if (stored.state === "missing")
|
|
5196
|
+
return {
|
|
5197
|
+
state: server?.state === "signed_in" || server?.state === "signed_out" ? "signed_out" : "not_set_up",
|
|
5198
|
+
lastUsedAt: null,
|
|
5199
|
+
stored
|
|
5200
|
+
};
|
|
5201
|
+
if (!server) return void 0;
|
|
5202
|
+
if (stored.state === "unreadable" && server.state === "signed_in") return void 0;
|
|
5203
|
+
return { ...server, stored };
|
|
5204
|
+
}
|
|
5193
5205
|
function relativeTime(time, now) {
|
|
5194
5206
|
if (time === null) return "never";
|
|
5195
5207
|
const minutes = Math.floor((now - time) / 6e4);
|
|
@@ -5197,10 +5209,11 @@ function relativeTime(time, now) {
|
|
|
5197
5209
|
const [count, unit] = minutes < 60 ? [minutes, "minute"] : minutes < 1440 ? [Math.floor(minutes / 60), "hour"] : [Math.floor(minutes / 1440), "day"];
|
|
5198
5210
|
return `${count} ${unit}${count === 1 ? "" : "s"} ago`;
|
|
5199
5211
|
}
|
|
5200
|
-
function grantSummaryLines(grants, editors, now = Date.now()) {
|
|
5212
|
+
function grantSummaryLines(grants, editors, now = Date.now(), onThisComputer = {}) {
|
|
5201
5213
|
const rows = /* @__PURE__ */ new Map();
|
|
5202
5214
|
for (const grant of grants) {
|
|
5203
5215
|
const row = rows.get(grant.host) ?? {
|
|
5216
|
+
host: grant.host,
|
|
5204
5217
|
name: editors[grant.host] ?? grant.host,
|
|
5205
5218
|
editor: grant.host in editors,
|
|
5206
5219
|
last: null,
|
|
@@ -5215,9 +5228,10 @@ function grantSummaryLines(grants, editors, now = Date.now()) {
|
|
|
5215
5228
|
(a, b) => Number(b.editor) - Number(a.editor) || (b.last ?? 0) - (a.last ?? 0)
|
|
5216
5229
|
);
|
|
5217
5230
|
const width = Math.max(...ordered.map((row) => row.name.length)) + 2;
|
|
5218
|
-
return ordered.map(
|
|
5219
|
-
|
|
5220
|
-
|
|
5231
|
+
return ordered.map((row) => {
|
|
5232
|
+
const summary = `signed in, last used ${relativeTime(row.last, now)} (${row.count} sign-in${row.count === 1 ? "" : "s"})`;
|
|
5233
|
+
return `${row.name.padEnd(width)}${onThisComputer[row.host]?.(summary) ?? summary}`;
|
|
5234
|
+
});
|
|
5221
5235
|
}
|
|
5222
5236
|
function grantTransport(getBearer, fetcher = fetch) {
|
|
5223
5237
|
const resource = apiOrigin();
|
|
@@ -5258,5 +5272,6 @@ export {
|
|
|
5258
5272
|
grantTransport,
|
|
5259
5273
|
relativeTime,
|
|
5260
5274
|
signedInElsewhere,
|
|
5261
|
-
validGrant
|
|
5275
|
+
validGrant,
|
|
5276
|
+
withStoredSignIn
|
|
5262
5277
|
};
|
package/dist/auth/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/auth/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAA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AM,CAAC;oBACxB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;oBAC7C,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;oBACzC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAC9D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,CAC3C;oBACD,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS;wBACrB,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAChF;gBAED,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,EAAU;YACrB,MAAM,OAAO,CAAC,uBAAuB,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAChF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/digests.json
CHANGED
|
@@ -51,20 +51,24 @@
|
|
|
51
51
|
"dist/project.d.ts.map": "4c24413b71eab8c25693dbb5bdb3612fc630b8cdcc151baa682e52cd67a8d8d4",
|
|
52
52
|
"dist/project.js": "38041b01bb535314f381ac3c0f7ff5e55f2c02405cd77ac7aeaee1d085ddbb9f",
|
|
53
53
|
"dist/project.js.map": "b6e26ca0a9367b4861be37273290de30ea949e5dbe42f4b0824215a29c7e3ad8",
|
|
54
|
-
"dist/router.d.ts": "
|
|
55
|
-
"dist/router.d.ts.map": "
|
|
56
|
-
"dist/router.js": "
|
|
57
|
-
"dist/router.js.map": "
|
|
58
|
-
"dist/sbom.json": "
|
|
59
|
-
"dist/scanner-release.json": "
|
|
54
|
+
"dist/router.d.ts": "c8174b608e0ba17df7feca5d7aa477d40ed9814f1e5222a9369b5415cc7cea8c",
|
|
55
|
+
"dist/router.d.ts.map": "94bbe5c802de0f4bc48b44419013106af4ccbf8303164c9f418dafb47f73eeba",
|
|
56
|
+
"dist/router.js": "5789f7e7b3c48dd12ddd323436a88de605942281003609c7ebf375d03193a2ca",
|
|
57
|
+
"dist/router.js.map": "ebc8fbf4ddfde856986060e8ff43ae4d97fde884b83400878ca14dd229b02ae8",
|
|
58
|
+
"dist/sbom.json": "d43c84ff7d955b06939fdd806f9ec18153e5d755e29a9185e5b63c7703422aae",
|
|
59
|
+
"dist/scanner-release.json": "73124c374885b13c25a8e0cdeda703329ab99f8f849c77abbae75ba3430e4b6a",
|
|
60
60
|
"dist/screens.d.ts": "365071231380d4e1513575d6c5196976195836b2983027f626d61ea2951b4cdd",
|
|
61
61
|
"dist/screens.d.ts.map": "f905a74cd814586a12569acedf95b7375f72179ad979f5a6eea6aedc7c8291c3",
|
|
62
62
|
"dist/screens.js": "c4b8e563b6268552e97780460f46fd860c5a323f32df59290615f54ec7e84443",
|
|
63
63
|
"dist/screens.js.map": "92c71902f4eb8086ce0337cadf4ca169eb0377b844b6978b41a55220ffdafb00",
|
|
64
|
-
"dist/status.d.ts": "
|
|
65
|
-
"dist/status.d.ts.map": "
|
|
66
|
-
"dist/status.js": "
|
|
67
|
-
"dist/status.js.map": "
|
|
64
|
+
"dist/status.d.ts": "ef13555b8048d5fc3718351493eb55f9b28162a9a21808bb87d9134f9a149bf5",
|
|
65
|
+
"dist/status.d.ts.map": "3dcafc96c2580a9dc700cdf4aed10f551467148f690799229c1db588e15fbd73",
|
|
66
|
+
"dist/status.js": "ef53cd5e5c3fc5c34ffc9cc5563856eeea81493330e8e435c650f18abd5c65e3",
|
|
67
|
+
"dist/status.js.map": "d6865ed97221153ccdea48a9c34351b61bc37d136161f71d640002b4399744e5",
|
|
68
|
+
"dist/auth/claudeCodeSignIn.d.ts": "c8a35cec0787fc9be519191108d0d0f001f152305220776bf26ae36cf2a1ac6f",
|
|
69
|
+
"dist/auth/claudeCodeSignIn.d.ts.map": "081213141aaa2bcd61037c0d22f96387ce4c2105a1a8d4f802402615dd0e66a3",
|
|
70
|
+
"dist/auth/claudeCodeSignIn.js": "59d7aacd578fb22ae8c62de883eb70099e9ccd9206ab95f03e9fcf6f5fe001ee",
|
|
71
|
+
"dist/auth/claudeCodeSignIn.js.map": "b53a01ce6768840f16f5c4144f465dadeb996121e44414c68a4d8d4780951ed2",
|
|
68
72
|
"dist/auth/credentials.d.ts": "6cbb63a8c50243770046f3d1dd56fb156d96344a5de79eb35b535b6ec0159480",
|
|
69
73
|
"dist/auth/credentials.d.ts.map": "9615a56dfec89fe88d470cded00eabaefd4950fc148e95536da8c5b810a4c27d",
|
|
70
74
|
"dist/auth/credentials.js": "60963cd862f123f27dd2a9551c495681bc1bc438d83611b9f0edbd0ccbc10114",
|
|
@@ -89,10 +93,10 @@
|
|
|
89
93
|
"dist/auth/pkce.d.ts.map": "7837b7ae96006bb05e9a01853b0dd73a714393d64c1d2a117664448b1a9b0462",
|
|
90
94
|
"dist/auth/pkce.js": "dda2fe45e38cba68eede876e4d5c64e0224599ce662080503384b85dfa76f30f",
|
|
91
95
|
"dist/auth/pkce.js.map": "46cfb493a0b3f59d34a3b3214db05b0473f566be8552f629750505de325bfa32",
|
|
92
|
-
"dist/auth/status.d.ts": "
|
|
93
|
-
"dist/auth/status.d.ts.map": "
|
|
94
|
-
"dist/auth/status.js": "
|
|
95
|
-
"dist/auth/status.js.map": "
|
|
96
|
+
"dist/auth/status.d.ts": "4f0f7d55cd90ac9f19880e9532b40cab7fe3e462959f0d3cca555215144f3c43",
|
|
97
|
+
"dist/auth/status.d.ts.map": "a9f40aaa6c57d6eaf04683667d854f2b8539e4ce741b6008962c2a016961b5e8",
|
|
98
|
+
"dist/auth/status.js": "72e31db96d613c667c8309cbe4762d999f5558e68f27ae73d6ba7bc67859b579",
|
|
99
|
+
"dist/auth/status.js.map": "adb47b75cf2d35130891fcd046927d419c3d0d69811c78facb1d2a958b60bbaf",
|
|
96
100
|
"dist/identity/migrate.d.ts": "7493955bc95dd1876cef60481bda4808af7be2a9ccfc4cc02831e41043b16c29",
|
|
97
101
|
"dist/identity/migrate.d.ts.map": "0d3a9da77695c3f39e3c98fcc6089c62bb0518a75f2bde72948cd3d20712b2bf",
|
|
98
102
|
"dist/identity/migrate.js": "2f517f855b29267366ac3ae2a618c6c1e50a07839c6a9d826b8176c5802f6b8c",
|
package/dist/router.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { type PreflightDependencies } from './preflight.js';
|
|
|
9
9
|
import { type InstallSessionTransport } from './installSession.js';
|
|
10
10
|
import { type ProjectExecutor, type ProjectReadTransport } from './project.js';
|
|
11
11
|
import { type ReadinessCondition, resolveProjectIdentity } from '@mnemonik/shared';
|
|
12
|
+
import { type ClaudeCodeStoreOptions } from './auth/claudeCodeSignIn.js';
|
|
12
13
|
import { type EditorLoginOverrides } from './auth/pkce.js';
|
|
13
14
|
import { type ScannerPickerResult } from './scanner/picker.js';
|
|
14
15
|
import { type InstallDependencies } from './install/transaction.js';
|
|
@@ -32,7 +33,9 @@ export declare const CODEX_SIGNED_IN_MESSAGE = "Codex is signed in to Mnemonik."
|
|
|
32
33
|
/** An editor signed in on another of the person's machines (L-182). */
|
|
33
34
|
export declare const signedInElsewhereMessage: (editor: string) => string;
|
|
34
35
|
/** A coding tool with a valid sign-in on this machine; `mnemonik connect` has nothing to do. */
|
|
35
|
-
export declare const alreadySignedInMessage: (editor: string, lastUsedAt: string | null) => string;
|
|
36
|
+
export declare const alreadySignedInMessage: (editor: string, lastUsedAt: string | null, refreshable?: boolean) => string;
|
|
37
|
+
/** The coding tool itself holds no Mnemonik sign-in it can use on this machine. */
|
|
38
|
+
export declare const notSignedInHereMessage: (editor: string) => string;
|
|
36
39
|
/** For the agent running `connect --json`: what to do with the link it was given. */
|
|
37
40
|
export declare const SIGN_IN_LINK_REASON = "Give this link to the person to approve the Codex sign-in. This command finishes when they do.";
|
|
38
41
|
export declare const CONNECT_NOT_APPROVED_MESSAGE = "Sign-in timed out. Run mnemonik connect codex to try again.";
|
|
@@ -84,6 +87,8 @@ export interface CliDependencies {
|
|
|
84
87
|
statusDetails?: StatusDocumentInput['details'];
|
|
85
88
|
codexTrustConditions?: () => Promise<readonly ReadinessCondition[]>;
|
|
86
89
|
diagnostics?: DiagnosticsDependencies;
|
|
90
|
+
/** Where Claude Code's own stored sign-in is read: this platform, environment and Keychain by default. */
|
|
91
|
+
claudeCodeStore?: Omit<ClaudeCodeStoreOptions, 'home'>;
|
|
87
92
|
}
|
|
88
93
|
export declare function runCli(args: string[], deps?: CliDependencies): Promise<number>;
|
|
89
94
|
//# sourceMappingURL=router.d.ts.map
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAU5F,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAML,KAAK,gBAAgB,EAErB,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAiD,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAGpG,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAU,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAiC,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAwB,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CA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AAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACvC,6GAA6G;IAC7G,wBAAwB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7D,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnD,sBAAsB,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACvD,qBAAqB,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACtD,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC/C,oBAAoB,CAAC,EAAE,MAAM,OAAO,CAAC,SAAS,kBAAkB,EAAE,CAAC,CAAC;IACpE,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,0GAA0G;IAC1G,eAAe,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;CACxD;AAuqCD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4pCxF"}
|
package/dist/router.js
CHANGED
|
@@ -7359,6 +7359,19 @@ function apiOrigin(env = process.env) {
|
|
|
7359
7359
|
return new URL(env.MNEMONIK_API_RESOURCE || "https://api.mnemonik.dev").origin;
|
|
7360
7360
|
}
|
|
7361
7361
|
|
|
7362
|
+
// packages/shared/dist/grantHost.js
|
|
7363
|
+
var CODING_TOOL_SIGN_IN = {
|
|
7364
|
+
"claude-code": {
|
|
7365
|
+
kind: "in_tool",
|
|
7366
|
+
step: "In Claude Code, type /mcp, choose mnemonik, then Authenticate."
|
|
7367
|
+
},
|
|
7368
|
+
codex: { kind: "connect" },
|
|
7369
|
+
cursor: {
|
|
7370
|
+
kind: "in_tool",
|
|
7371
|
+
step: "In Cursor, open Cursor Settings, Customize, MCPs, then Authenticate."
|
|
7372
|
+
}
|
|
7373
|
+
};
|
|
7374
|
+
|
|
7362
7375
|
// packages/local-setup/dist/storage.js
|
|
7363
7376
|
init_hookRuntime();
|
|
7364
7377
|
init_hookRuntime();
|
|
@@ -7720,8 +7733,10 @@ import {
|
|
|
7720
7733
|
grantHost,
|
|
7721
7734
|
grantSummaryLines,
|
|
7722
7735
|
relativeTime,
|
|
7723
|
-
validGrant
|
|
7736
|
+
validGrant,
|
|
7737
|
+
withStoredSignIn
|
|
7724
7738
|
} from "./auth/status.js";
|
|
7739
|
+
import { claudeCodeStoredSignIn } from "./auth/claudeCodeSignIn.js";
|
|
7725
7740
|
import { createCliAuth } from "./auth/index.js";
|
|
7726
7741
|
import { OAuthProtocolError, runEditorLogin } from "./auth/pkce.js";
|
|
7727
7742
|
import { currentInstallSession, ensureInstallSession } from "./auth/installSession.js";
|
|
@@ -7744,6 +7759,7 @@ import {
|
|
|
7744
7759
|
mcpTurnOnAction,
|
|
7745
7760
|
renderStatusSummaries,
|
|
7746
7761
|
renderRefusals,
|
|
7762
|
+
renewsMessage,
|
|
7747
7763
|
REPORT_NOT_SENT,
|
|
7748
7764
|
renderScannerFailure,
|
|
7749
7765
|
statusExitCode,
|
|
@@ -7813,7 +7829,8 @@ var stillWatchedLine = (root) => `The folder is still being indexed. Run mnemoni
|
|
|
7813
7829
|
var identityFileKeptLine = "This folder's .mnemonik.json still points at the deleted project. Connecting the folder again creates a new project.";
|
|
7814
7830
|
var CODEX_SIGNED_IN_MESSAGE = "Codex is signed in to Mnemonik.";
|
|
7815
7831
|
var signedInElsewhereMessage = (editor) => `${editor} is already signed in to Mnemonik from another of your machines.`;
|
|
7816
|
-
var alreadySignedInMessage = (editor, lastUsedAt) => `${editor} is already signed in to Mnemonik on this computer${lastUsedAt ? `, last used ${relativeTime(Date.parse(lastUsedAt), Date.now())}` : ""}
|
|
7832
|
+
var alreadySignedInMessage = (editor, lastUsedAt, refreshable = false) => `${editor} is already signed in to Mnemonik on this computer${lastUsedAt ? `, last used ${relativeTime(Date.parse(lastUsedAt), Date.now())}` : ""}.${refreshable ? ` ${renewsMessage(editor)}` : ""}`;
|
|
7833
|
+
var notSignedInHereMessage = (editor) => `${editor} is not signed in to Mnemonik on this computer.`;
|
|
7817
7834
|
var SIGN_IN_LINK_REASON = "Give this link to the person to approve the Codex sign-in. This command finishes when they do.";
|
|
7818
7835
|
var CONNECT_NOT_APPROVED_MESSAGE = "Sign-in timed out. Run mnemonik connect codex to try again.";
|
|
7819
7836
|
function maintenanceExitCode(results) {
|
|
@@ -8690,8 +8707,21 @@ async function installCommand(parsed, deps, output) {
|
|
|
8690
8707
|
function refusalStateDir(deps) {
|
|
8691
8708
|
return deps.projectStateDir ?? deps.installStateDir ?? stateDirectory(process.platform, process.env, deps.home);
|
|
8692
8709
|
}
|
|
8710
|
+
var claudeCodeStored = (deps) => claudeCodeStoredSignIn({ home: deps.home ?? homedir4(), ...deps.claudeCodeStore });
|
|
8693
8711
|
async function codingToolSignIns(deps, output, hosts) {
|
|
8694
8712
|
if (!hosts.length) return /* @__PURE__ */ new Map();
|
|
8713
|
+
const [server, stored] = await Promise.all([
|
|
8714
|
+
serverSignIns(deps, output, hosts),
|
|
8715
|
+
hosts.includes("claude-code") ? claudeCodeStored(deps) : void 0
|
|
8716
|
+
]);
|
|
8717
|
+
if (!stored) return server;
|
|
8718
|
+
const result = new Map(server ?? []);
|
|
8719
|
+
const claudeCode = withStoredSignIn(server?.get("claude-code"), stored);
|
|
8720
|
+
if (claudeCode) result.set("claude-code", claudeCode);
|
|
8721
|
+
else result.delete("claude-code");
|
|
8722
|
+
return server || claudeCode ? result : void 0;
|
|
8723
|
+
}
|
|
8724
|
+
async function serverSignIns(deps, output, hosts) {
|
|
8695
8725
|
const bearer = await auth(deps, output, false).getCliBearer().catch(() => void 0);
|
|
8696
8726
|
if (typeof bearer !== "string") return void 0;
|
|
8697
8727
|
const send = deps.grantFetch ?? globalThis.fetch;
|
|
@@ -8701,7 +8731,9 @@ async function codingToolSignIns(deps, output, hosts) {
|
|
|
8701
8731
|
);
|
|
8702
8732
|
const here = await grants.list({ here: true }).catch(() => void 0);
|
|
8703
8733
|
if (!here) return void 0;
|
|
8704
|
-
const result = new Map(
|
|
8734
|
+
const result = new Map(
|
|
8735
|
+
hosts.map((host) => [host, codingToolSignIn(host, here)])
|
|
8736
|
+
);
|
|
8705
8737
|
if ([...result].some(([host, signIn]) => host === "cursor" && signIn.state !== "signed_in")) {
|
|
8706
8738
|
const everywhere = await grants.list().catch(() => void 0);
|
|
8707
8739
|
if (everywhere) result.set("cursor", codingToolSignIn("cursor", here, everywhere));
|
|
@@ -9383,13 +9415,18 @@ Preview: ${preview.path}
|
|
|
9383
9415
|
const signIn = editor?.mcp === "ready" ? await codingToolSignIns(deps, output, [host]) : void 0;
|
|
9384
9416
|
const current = signIn?.get(host);
|
|
9385
9417
|
if (current?.state === "signed_in" || current?.state === "signed_in_elsewhere") {
|
|
9386
|
-
const message = current.state === "signed_in_elsewhere" ? signedInElsewhereMessage(launchHostLabels[host]) : alreadySignedInMessage(
|
|
9418
|
+
const message = current.state === "signed_in_elsewhere" ? signedInElsewhereMessage(launchHostLabels[host]) : alreadySignedInMessage(
|
|
9419
|
+
launchHostLabels[host],
|
|
9420
|
+
current.lastUsedAt,
|
|
9421
|
+
current.stored?.state === "refreshable"
|
|
9422
|
+
);
|
|
9387
9423
|
if (parsed.flags.has("json"))
|
|
9388
9424
|
output.json(
|
|
9389
9425
|
current.state === "signed_in" ? {
|
|
9390
9426
|
status: "READY",
|
|
9391
9427
|
signIn: current.state,
|
|
9392
9428
|
lastUsedAt: current.lastUsedAt,
|
|
9429
|
+
...current.stored ? { stored: current.stored } : {},
|
|
9393
9430
|
reason: message
|
|
9394
9431
|
} : { status: "READY", reason: message }
|
|
9395
9432
|
);
|
|
@@ -9430,11 +9467,17 @@ Preview: ${preview.path}
|
|
|
9430
9467
|
}
|
|
9431
9468
|
}
|
|
9432
9469
|
}
|
|
9433
|
-
const reason = editor?.mcp === "disabled" ? `${editor.name} connection is turned off.` : editor?.mcp === "ready" ? "Finish signing in to Mnemonik in the coding tool." : `${launchHostLabels[host]} connection is missing.`;
|
|
9470
|
+
const reason = editor?.mcp === "disabled" ? `${editor.name} connection is turned off.` : editor?.mcp === "ready" ? current?.stored?.state === "missing" ? notSignedInHereMessage(launchHostLabels[host]) : "Finish signing in to Mnemonik in the coding tool." : `${launchHostLabels[host]} connection is missing.`;
|
|
9434
9471
|
const actions = editor?.mcp === "ready" ? editorAuthorizationRows([host]) : [
|
|
9435
9472
|
editor?.mcp === "disabled" ? mcpTurnOnAction[host] : "Run mnemonik install to set it up again."
|
|
9436
9473
|
];
|
|
9437
|
-
if (parsed.flags.has("json"))
|
|
9474
|
+
if (parsed.flags.has("json"))
|
|
9475
|
+
output.json({
|
|
9476
|
+
status: "ACTION_REQUIRED",
|
|
9477
|
+
reason,
|
|
9478
|
+
actions,
|
|
9479
|
+
...current?.stored ? { stored: current.stored } : {}
|
|
9480
|
+
});
|
|
9438
9481
|
else {
|
|
9439
9482
|
output.line(reason);
|
|
9440
9483
|
for (const action of actions) output.line(action);
|
|
@@ -9804,14 +9847,25 @@ Preview: ${preview.path}
|
|
|
9804
9847
|
return (!grantHostName || hostOrder.includes(grantHostName)) && (!host || grantHostName === host);
|
|
9805
9848
|
}).map((g) => ({ ...g, host: grantHost(g) ?? g.clientName ?? g.clientId }));
|
|
9806
9849
|
const signedIn = grants.filter(validGrant);
|
|
9807
|
-
|
|
9850
|
+
const stored = !host || host === "claude-code" ? await claudeCodeStored(deps) : void 0;
|
|
9851
|
+
if (parsed.flags.has("json"))
|
|
9852
|
+
output.json({
|
|
9853
|
+
account: status.account,
|
|
9854
|
+
grants,
|
|
9855
|
+
...stored ? { stored: { "claude-code": stored } } : {}
|
|
9856
|
+
});
|
|
9808
9857
|
else if (!signedIn.length)
|
|
9809
9858
|
output.line(
|
|
9810
9859
|
host ? `${launchHostLabels[host]} is not signed in.` : humanReason("not_signed_in")
|
|
9811
9860
|
);
|
|
9812
9861
|
else {
|
|
9813
9862
|
output.signedInAs(status.email);
|
|
9814
|
-
|
|
9863
|
+
const signInStep = CODING_TOOL_SIGN_IN["claude-code"];
|
|
9864
|
+
const claudeCode = (summary2) => stored?.state === "missing" ? `not signed in on this computer.${"step" in signInStep ? ` ${signInStep.step}` : ""}` : stored?.state === "refreshable" ? `${summary2}. ${renewsMessage("Claude Code")}` : summary2;
|
|
9865
|
+
for (const line of grantSummaryLines(signedIn, launchHostLabels, Date.now(), {
|
|
9866
|
+
"claude-code": claudeCode
|
|
9867
|
+
}))
|
|
9868
|
+
output.line(line);
|
|
9815
9869
|
output.line(
|
|
9816
9870
|
"Older sign-ins stay valid until `mnemonik auth logout`. `mnemonik auth status --json` lists every one."
|
|
9817
9871
|
);
|
|
@@ -9866,6 +9920,7 @@ export {
|
|
|
9866
9920
|
help,
|
|
9867
9921
|
identityFileKeptLine,
|
|
9868
9922
|
maintenanceExitCode,
|
|
9923
|
+
notSignedInHereMessage,
|
|
9869
9924
|
projectDeletedLine,
|
|
9870
9925
|
projectDeletionWarning,
|
|
9871
9926
|
removeFolderPrompt,
|