@mnemonik/cli 7.111.2 → 7.111.4
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/status.d.ts +37 -11
- package/dist/auth/status.d.ts.map +1 -1
- package/dist/auth/status.js +39 -12
- package/dist/auth/status.js.map +1 -1
- package/dist/digests.json +14 -14
- package/dist/router.d.ts +4 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +98 -25
- package/dist/router.js.map +1 -1
- package/dist/sbom.json +21 -21
- package/dist/scanner-release.json +25 -25
- package/dist/status.d.ts +58 -0
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +94 -1
- package/dist/status.js.map +1 -1
- package/package.json +31 -31
package/dist/auth/status.d.ts
CHANGED
|
@@ -9,8 +9,20 @@ export interface AccountGrant {
|
|
|
9
9
|
resource: string;
|
|
10
10
|
createdAt: string;
|
|
11
11
|
activatedAt: string | null;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* When the coding tool last renewed this sign-in (about once an hour while it
|
|
14
|
+
* is in use); the server does not record each MCP request. Dates use only.
|
|
15
|
+
*/
|
|
13
16
|
lastUsedAt: string | null;
|
|
17
|
+
/** When the sign-in's refresh token expires; absent from older servers. */
|
|
18
|
+
expiresAt?: string | null;
|
|
19
|
+
/** The coding tool, by the shared mapping; absent from older servers. */
|
|
20
|
+
host?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* The console's validity rule, decided by the server: `connected` is a
|
|
23
|
+
* valid sign-in. Absent from older servers, which listed only unrevoked ones.
|
|
24
|
+
*/
|
|
25
|
+
status?: 'connected' | 'disconnected' | 'expired' | 'incomplete';
|
|
14
26
|
}
|
|
15
27
|
export interface GrantStatus {
|
|
16
28
|
deviceInstallationId?: string | null;
|
|
@@ -19,18 +31,29 @@ export interface GrantStatus {
|
|
|
19
31
|
email?: string;
|
|
20
32
|
grants: AccountGrant[];
|
|
21
33
|
}
|
|
22
|
-
export declare const grantHost: (grant: AccountGrant) => HostName;
|
|
23
|
-
/**
|
|
24
|
-
export declare const
|
|
34
|
+
export declare const grantHost: (grant: AccountGrant) => HostName | undefined;
|
|
35
|
+
/** A sign-in that works: the server's status, or activated on a server too old to say. */
|
|
36
|
+
export declare const validGrant: (grant: AccountGrant) => boolean;
|
|
25
37
|
/**
|
|
26
38
|
* An editor that opens this machine remotely (Cursor on a Mac over SSH) signs in
|
|
27
|
-
* where it runs, while its hooks run here. A sign-in for the host on
|
|
28
|
-
* the account's installations
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* The listing already leaves out revoked grants.
|
|
39
|
+
* where it runs, while its hooks run here. A valid sign-in for the host on
|
|
40
|
+
* another of the account's installations is that editor's sign-in, for the
|
|
41
|
+
* editors above only (L-182; the server's computeMachineHealth reads the same
|
|
42
|
+
* rule). How long ago it was used says nothing about whether it is valid.
|
|
32
43
|
*/
|
|
33
|
-
export declare function signedInElsewhere(status: GrantStatus, host: HostName
|
|
44
|
+
export declare function signedInElsewhere(status: GrantStatus, host: HostName): boolean;
|
|
45
|
+
export type CodingToolSignInState = 'signed_in' | 'signed_in_elsewhere' | 'signed_out' | 'not_set_up';
|
|
46
|
+
/**
|
|
47
|
+
* One coding tool's sign-in on this machine, from the server's listing of this
|
|
48
|
+
* installation's sign-ins (`?installation=current`, revoked ones included).
|
|
49
|
+
* Signed out only when it had sign-ins here and none of them is valid; never
|
|
50
|
+
* because of idle time. `everywhere`, the account-wide listing, is read only
|
|
51
|
+
* for editors that can sign in on another machine.
|
|
52
|
+
*/
|
|
53
|
+
export declare function codingToolSignIn(host: HostName, here: GrantStatus, everywhere?: GrantStatus): {
|
|
54
|
+
state: CodingToolSignInState;
|
|
55
|
+
lastUsedAt: string | null;
|
|
56
|
+
};
|
|
34
57
|
/** "just now", "5 minutes ago", "1 hour ago", "3 days ago", or "never". */
|
|
35
58
|
export declare function relativeTime(time: number | null, now: number): string;
|
|
36
59
|
/**
|
|
@@ -41,7 +64,10 @@ export declare function grantSummaryLines(grants: readonly (AccountGrant & {
|
|
|
41
64
|
host: string;
|
|
42
65
|
})[], editors: Readonly<Record<string, string>>, now?: number): string[];
|
|
43
66
|
export declare function grantTransport(getBearer: () => Promise<string>, fetcher?: typeof fetch): {
|
|
44
|
-
|
|
67
|
+
/** Every machine's unrevoked sign-ins, or with `here` every sign-in on this one. */
|
|
68
|
+
list(options?: {
|
|
69
|
+
here?: boolean;
|
|
70
|
+
}): Promise<GrantStatus>;
|
|
45
71
|
revoke(id: string): Promise<void>;
|
|
46
72
|
};
|
|
47
73
|
export type GrantTransport = ReturnType<typeof grantTransport>;
|
|
@@ -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;AAEjD,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
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/auth/status.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,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,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AE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAWrE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,CAAC,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,EACpD,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,GAAG,SAAa,GACf,MAAM,EAAE,CAyBV;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
|
@@ -4683,8 +4683,8 @@ function apiOrigin(env = process.env) {
|
|
|
4683
4683
|
return new URL(env.MNEMONIK_API_RESOURCE || "https://api.mnemonik.dev").origin;
|
|
4684
4684
|
}
|
|
4685
4685
|
|
|
4686
|
-
// packages/
|
|
4687
|
-
var
|
|
4686
|
+
// packages/shared/dist/grantHost.js
|
|
4687
|
+
var BY_NAME = {
|
|
4688
4688
|
"claude code": "claude-code",
|
|
4689
4689
|
"claude-code": "claude-code",
|
|
4690
4690
|
codex: "codex",
|
|
@@ -4696,14 +4696,37 @@ var hosts = {
|
|
|
4696
4696
|
"vs code copilot": "vscode-copilot",
|
|
4697
4697
|
"vscode-copilot": "vscode-copilot"
|
|
4698
4698
|
};
|
|
4699
|
-
var
|
|
4699
|
+
var BY_CLIENT_HOST = {
|
|
4700
|
+
"claude.ai": "claude-code",
|
|
4701
|
+
"chatgpt.com": "codex"
|
|
4702
|
+
};
|
|
4703
|
+
function hostForGrantClient(client) {
|
|
4704
|
+
return BY_NAME[client.softwareId?.toLowerCase() ?? ""] ?? BY_NAME[client.clientName?.toLowerCase() ?? ""] ?? BY_CLIENT_HOST[URL.canParse(client.clientId) ? new URL(client.clientId).hostname : ""];
|
|
4705
|
+
}
|
|
4706
|
+
|
|
4707
|
+
// packages/cli/src/auth/status.ts
|
|
4708
|
+
var grantHost = (grant) => hostForGrantClient(grant);
|
|
4709
|
+
var validGrant = (grant) => grant.status ? grant.status === "connected" : grant.activatedAt !== null;
|
|
4700
4710
|
var REMOTE_EDITOR_HOSTS = /* @__PURE__ */ new Set(["cursor", "vscode-copilot"]);
|
|
4701
|
-
var
|
|
4702
|
-
|
|
4711
|
+
var newest = (grants) => grants.map((grant) => grant.lastUsedAt).filter((at) => !!at).sort((a, b) => Date.parse(b) - Date.parse(a))[0] ?? null;
|
|
4712
|
+
var elsewhereGrants = (status, host) => {
|
|
4703
4713
|
const here = status.deviceInstallationId;
|
|
4704
|
-
return REMOTE_EDITOR_HOSTS.has(host) &&
|
|
4705
|
-
(grant) => grantHost(grant) === host && grant
|
|
4714
|
+
return REMOTE_EDITOR_HOSTS.has(host) && here ? status.grants.filter(
|
|
4715
|
+
(grant) => grantHost(grant) === host && validGrant(grant) && !!grant.deviceInstallationId && grant.deviceInstallationId !== here
|
|
4716
|
+
) : [];
|
|
4717
|
+
};
|
|
4718
|
+
function signedInElsewhere(status, host) {
|
|
4719
|
+
return elsewhereGrants(status, host).length > 0;
|
|
4720
|
+
}
|
|
4721
|
+
function codingToolSignIn(host, here, everywhere) {
|
|
4722
|
+
const mine = here.grants.filter(
|
|
4723
|
+
(grant) => grantHost(grant) === host && (!here.deviceInstallationId || grant.deviceInstallationId === here.deviceInstallationId)
|
|
4706
4724
|
);
|
|
4725
|
+
const valid = mine.filter(validGrant);
|
|
4726
|
+
if (valid.length) return { state: "signed_in", lastUsedAt: newest(valid) };
|
|
4727
|
+
const remote = everywhere ? elsewhereGrants(everywhere, host) : [];
|
|
4728
|
+
if (remote.length) return { state: "signed_in_elsewhere", lastUsedAt: newest(remote) };
|
|
4729
|
+
return mine.some((grant) => grant.status !== "incomplete" && grant.activatedAt !== null) ? { state: "signed_out", lastUsedAt: null } : { state: "not_set_up", lastUsedAt: null };
|
|
4707
4730
|
}
|
|
4708
4731
|
function relativeTime(time, now) {
|
|
4709
4732
|
if (time === null) return "never";
|
|
@@ -4748,12 +4771,15 @@ function grantTransport(getBearer, fetcher = fetch) {
|
|
|
4748
4771
|
return response.json();
|
|
4749
4772
|
}
|
|
4750
4773
|
return {
|
|
4751
|
-
|
|
4752
|
-
|
|
4774
|
+
/** Every machine's unrevoked sign-ins, or with `here` every sign-in on this one. */
|
|
4775
|
+
async list(options = {}) {
|
|
4776
|
+
const body2 = await request(
|
|
4777
|
+
options.here ? "/api/v1/auth/grants?installation=current" : "/api/v1/auth/grants"
|
|
4778
|
+
);
|
|
4753
4779
|
if (!body2 || typeof body2.account !== "string" || !body2.account || body2.deviceInstallationId != null && typeof body2.deviceInstallationId !== "string" || !Array.isArray(body2.grants) || body2.grants.some(
|
|
4754
4780
|
(g) => !g || typeof g.id !== "string" || typeof g.clientId !== "string" || typeof g.resource !== "string" || g.deviceInstallationId != null && typeof g.deviceInstallationId !== "string" || !Array.isArray(g.scopes) || !g.scopes.every((s) => typeof s === "string") || !Number.isFinite(Date.parse(g.createdAt)) || ![g.clientName, g.softwareId, g.activatedAt, g.lastUsedAt].every(
|
|
4755
4781
|
(v) => v === null || typeof v === "string"
|
|
4756
|
-
)
|
|
4782
|
+
) || g.status !== void 0 && !["connected", "disconnected", "expired", "incomplete"].includes(g.status)
|
|
4757
4783
|
))
|
|
4758
4784
|
throw new Error("invalid_grant_status");
|
|
4759
4785
|
return body2;
|
|
@@ -4764,10 +4790,11 @@ function grantTransport(getBearer, fetcher = fetch) {
|
|
|
4764
4790
|
};
|
|
4765
4791
|
}
|
|
4766
4792
|
export {
|
|
4767
|
-
|
|
4793
|
+
codingToolSignIn,
|
|
4768
4794
|
grantHost,
|
|
4769
4795
|
grantSummaryLines,
|
|
4770
4796
|
grantTransport,
|
|
4771
4797
|
relativeTime,
|
|
4772
|
-
signedInElsewhere
|
|
4798
|
+
signedInElsewhere,
|
|
4799
|
+
validGrant
|
|
4773
4800
|
};
|
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,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/auth/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAmCjE,+FAA+F;AAC/F,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAmB,EAAwB,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAElG,0FAA0F;AAC1F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAW,EAAE,CACzD,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC;AAE3E;;;;GAIG;AACH,MAAM,mBAAmB,GAA0B,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEzF,MAAM,MAAM,GAAG,CAAC,MAA+B,EAAE,EAAE,CACjD,MAAM;KACH,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;KAChC,MAAM,CAAC,CAAC,EAAE,EAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,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AAM,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,20 @@
|
|
|
51
51
|
"dist/project.d.ts.map": "9a845ded7332744a1d4752652657488f3a706e89d745742817086d8759a87b84",
|
|
52
52
|
"dist/project.js": "cbb324abfa69c7e03c29abc628370259abe94fa7f3b5b6b936ad25744f308f3b",
|
|
53
53
|
"dist/project.js.map": "18be2461ebf116f5c4a0897ddaebb59885fc7752107e7742471a8bbedd6053aa",
|
|
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": "f69a88d25aa5b6f2c18f9d397e5642ae8125f07d5e32bc2773c12b2391d2b5b0",
|
|
55
|
+
"dist/router.d.ts.map": "e4eab25d0b76bf63e4f67ff45b5dbc1c475fc9cef3c2942db917c9f26f85852b",
|
|
56
|
+
"dist/router.js": "23b303f4aa096472139403f226f0babd1f2491052fb2d242af735c2765e3be1d",
|
|
57
|
+
"dist/router.js.map": "b4646fae412a6218fe897030a5d90b5a1d2476450fc4589e45b859f22c39c3a3",
|
|
58
|
+
"dist/sbom.json": "6af7f4e98a045357d9427380a6d0e6f2ccfd72008d1b2c132f86fed0da5e8739",
|
|
59
|
+
"dist/scanner-release.json": "da62dc7f8fab683be0db53c4f65b85df97f6ad86df6d0e5e059cec7142f7755d",
|
|
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": "8411210db130f581dd5a60da97a5e1c18ae3f5e6a1e7de77133bcb05add3d5ed",
|
|
65
|
+
"dist/status.d.ts.map": "ff1c77904d8d426e419eaab7c86845b5736a8a5daacf3bfb175983f669253c9b",
|
|
66
|
+
"dist/status.js": "fdbb052d5b2a9235ef4aef915fd0a1ef60ac47949ec0c038ae58650bb6842cd7",
|
|
67
|
+
"dist/status.js.map": "5d84737be8a198ea9e4fff2053bd600606f422041194d2f20e39a1ddd41a3ea0",
|
|
68
68
|
"dist/auth/credentials.d.ts": "7401116a8cc2d40281073796097dfd66e99a8f9090103cbf96f2370153d447bd",
|
|
69
69
|
"dist/auth/credentials.d.ts.map": "a9f8b62a688a9dc40c0c330d1dd88c94c4294f1a951e0579d555949e1dc06cdf",
|
|
70
70
|
"dist/auth/credentials.js": "585365ab6f4ac36f0b75747db8e8fd32f68f742ab82c650a2706c716abb03925",
|
|
@@ -89,10 +89,10 @@
|
|
|
89
89
|
"dist/auth/pkce.d.ts.map": "3fba695c28a087a3675ccd64e8d0c450086162df62d8d1e31629157b8776e8e9",
|
|
90
90
|
"dist/auth/pkce.js": "35cbb229e0cf4370040b67b06d2b7d7aefb24be1acdbed1ad65c9f2b8a05b26f",
|
|
91
91
|
"dist/auth/pkce.js.map": "a926f8d197dfcffa0865fccff82f3dff446b32b2066bd34c05726ad4b6853996",
|
|
92
|
-
"dist/auth/status.d.ts": "
|
|
93
|
-
"dist/auth/status.d.ts.map": "
|
|
94
|
-
"dist/auth/status.js": "
|
|
95
|
-
"dist/auth/status.js.map": "
|
|
92
|
+
"dist/auth/status.d.ts": "d64b29231cd09b80119c6d95408e206e5649c8f77a1fe29a5bbb841973ec955a",
|
|
93
|
+
"dist/auth/status.d.ts.map": "4beb3d419db8620fa22d655e349302764635ab81d992acec284f3834a93a45b6",
|
|
94
|
+
"dist/auth/status.js": "91af230c7517f06fcb3741fda88ef3d6dbb3c24ea42232edb47a565838dacb9c",
|
|
95
|
+
"dist/auth/status.js.map": "20aab010ca552302109327db7a2dac16331ac59c534f7a8278eb4b5a5a7bc7d2",
|
|
96
96
|
"dist/identity/migrate.d.ts": "7493955bc95dd1876cef60481bda4808af7be2a9ccfc4cc02831e41043b16c29",
|
|
97
97
|
"dist/identity/migrate.d.ts.map": "0d3a9da77695c3f39e3c98fcc6089c62bb0518a75f2bde72948cd3d20712b2bf",
|
|
98
98
|
"dist/identity/migrate.js": "0f47c7929b6700abd1c453be7f312553a0fff7badfbd0f2ac54785b73b76d3aa",
|
package/dist/router.d.ts
CHANGED
|
@@ -31,6 +31,10 @@ export declare const identityFileKeptLine = "This folder's .mnemonik.json still
|
|
|
31
31
|
export declare const CODEX_SIGNED_IN_MESSAGE = "Codex is signed in to Mnemonik.";
|
|
32
32
|
/** An editor signed in on another of the person's machines (L-182). */
|
|
33
33
|
export declare const signedInElsewhereMessage: (editor: string) => string;
|
|
34
|
+
/** 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
|
+
/** For the agent running `connect --json`: what to do with the link it was given. */
|
|
37
|
+
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.";
|
|
34
38
|
export declare const CONNECT_NOT_APPROVED_MESSAGE = "Sign-in timed out. Run mnemonik connect codex to try again.";
|
|
35
39
|
export declare function maintenanceExitCode(results: readonly Pick<HostResult, 'status'>[]): number;
|
|
36
40
|
export declare const help: string;
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAWA,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAU5F,OAAO,EAGL,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,CAAC;AACzF,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAKL,KAAK,kBAAkB,EACvB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAWA,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAU5F,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAML,KAAK,gBAAg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,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;CACvC;AA8+BD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAknCxF"}
|
package/dist/router.js
CHANGED
|
@@ -7182,7 +7182,14 @@ import {
|
|
|
7182
7182
|
} from "./project.js";
|
|
7183
7183
|
import { evaluateRoot } from "./project/eligibility.js";
|
|
7184
7184
|
import { accountActions } from "./transport/server.js";
|
|
7185
|
-
import {
|
|
7185
|
+
import {
|
|
7186
|
+
codingToolSignIn,
|
|
7187
|
+
grantTransport,
|
|
7188
|
+
grantHost,
|
|
7189
|
+
grantSummaryLines,
|
|
7190
|
+
relativeTime,
|
|
7191
|
+
validGrant
|
|
7192
|
+
} from "./auth/status.js";
|
|
7186
7193
|
import { createCliAuth } from "./auth/index.js";
|
|
7187
7194
|
import { runEditorLogin } from "./auth/pkce.js";
|
|
7188
7195
|
import { currentInstallSession, ensureInstallSession } from "./auth/installSession.js";
|
|
@@ -7196,7 +7203,10 @@ import {
|
|
|
7196
7203
|
import { chooseHostProfile, simulatedInstall, terminalInstallUI } from "./install/ui.js";
|
|
7197
7204
|
import {
|
|
7198
7205
|
CODEX_TRUST_MESSAGE,
|
|
7206
|
+
codingToolLines,
|
|
7207
|
+
codingToolStatuses,
|
|
7199
7208
|
collectStatusDocument,
|
|
7209
|
+
installedCodingTools,
|
|
7200
7210
|
localEditorStatus,
|
|
7201
7211
|
localInstallationConditions,
|
|
7202
7212
|
mcpTurnOnAction,
|
|
@@ -7204,7 +7214,8 @@ import {
|
|
|
7204
7214
|
renderRefusals,
|
|
7205
7215
|
REPORT_NOT_SENT,
|
|
7206
7216
|
renderScannerFailure,
|
|
7207
|
-
statusExitCode
|
|
7217
|
+
statusExitCode,
|
|
7218
|
+
withCodingTools
|
|
7208
7219
|
} from "./status.js";
|
|
7209
7220
|
import { editorAuthorizationRows } from "./screens/journey.js";
|
|
7210
7221
|
import {
|
|
@@ -7270,6 +7281,8 @@ var stillWatchedLine = (root) => `The folder is still being indexed. Run mnemoni
|
|
|
7270
7281
|
var identityFileKeptLine = "This folder's .mnemonik.json still points at the deleted project. Connecting the folder again creates a new project.";
|
|
7271
7282
|
var CODEX_SIGNED_IN_MESSAGE = "Codex is signed in to Mnemonik.";
|
|
7272
7283
|
var signedInElsewhereMessage = (editor) => `${editor} is already signed in to Mnemonik from another of your machines.`;
|
|
7284
|
+
var alreadySignedInMessage = (editor, lastUsedAt) => `${editor} is already signed in to Mnemonik on this computer${lastUsedAt ? `, last used ${relativeTime(Date.parse(lastUsedAt), Date.now())}` : ""}.`;
|
|
7285
|
+
var SIGN_IN_LINK_REASON = "Give this link to the person to approve the Codex sign-in. This command finishes when they do.";
|
|
7273
7286
|
var CONNECT_NOT_APPROVED_MESSAGE = "Sign-in timed out. Run mnemonik connect codex to try again.";
|
|
7274
7287
|
function maintenanceExitCode(results) {
|
|
7275
7288
|
if (results.some((result) => result.status === "FAILED")) return 1;
|
|
@@ -7996,6 +8009,24 @@ async function installCommand(parsed, deps, output) {
|
|
|
7996
8009
|
function refusalStateDir(deps) {
|
|
7997
8010
|
return deps.projectStateDir ?? deps.installStateDir ?? stateDirectory(process.platform, process.env, deps.home);
|
|
7998
8011
|
}
|
|
8012
|
+
async function codingToolSignIns(deps, output, hosts) {
|
|
8013
|
+
if (!hosts.length) return /* @__PURE__ */ new Map();
|
|
8014
|
+
const bearer = await auth(deps, output, false).getCliBearer().catch(() => void 0);
|
|
8015
|
+
if (typeof bearer !== "string") return void 0;
|
|
8016
|
+
const send = deps.grantFetch ?? globalThis.fetch;
|
|
8017
|
+
const grants = grantTransport(
|
|
8018
|
+
async () => bearer,
|
|
8019
|
+
(url, options) => send(url, { ...options, signal: AbortSignal.timeout(2500) })
|
|
8020
|
+
);
|
|
8021
|
+
const here = await grants.list({ here: true }).catch(() => void 0);
|
|
8022
|
+
if (!here) return void 0;
|
|
8023
|
+
const result = new Map(hosts.map((host) => [host, codingToolSignIn(host, here)]));
|
|
8024
|
+
if ([...result].some(([host, signIn]) => host === "cursor" && signIn.state !== "signed_in")) {
|
|
8025
|
+
const everywhere = await grants.list().catch(() => void 0);
|
|
8026
|
+
if (everywhere) result.set("cursor", codingToolSignIn("cursor", here, everywhere));
|
|
8027
|
+
}
|
|
8028
|
+
return result;
|
|
8029
|
+
}
|
|
7999
8030
|
async function doctorCommand(parsed, deps, output) {
|
|
8000
8031
|
const invalid = allowed(parsed, []);
|
|
8001
8032
|
if (invalid) return flagError(output, parsed, invalid);
|
|
@@ -8611,17 +8642,36 @@ Preview: ${preview.path}
|
|
|
8611
8642
|
output,
|
|
8612
8643
|
parsed.flags.has("json") ? void 0 : (line) => output.line(line)
|
|
8613
8644
|
);
|
|
8645
|
+
const editors = await installedCodingTools(
|
|
8646
|
+
deps.home ?? homedir4(),
|
|
8647
|
+
deps.hostManagement?.stateDir ?? deps.installStateDir ?? stateDirectory(process.platform, process.env, deps.home)
|
|
8648
|
+
);
|
|
8649
|
+
const shown = withCodingTools(
|
|
8650
|
+
document,
|
|
8651
|
+
codingToolStatuses(
|
|
8652
|
+
editors,
|
|
8653
|
+
document.conditions ?? [],
|
|
8654
|
+
await codingToolSignIns(
|
|
8655
|
+
deps,
|
|
8656
|
+
output,
|
|
8657
|
+
editors.map((editor) => editor.host).filter(
|
|
8658
|
+
(host) => hostOrder.includes(host)
|
|
8659
|
+
)
|
|
8660
|
+
)
|
|
8661
|
+
)
|
|
8662
|
+
);
|
|
8614
8663
|
const version = await packageVersion();
|
|
8615
8664
|
const store = new RuntimeStore(
|
|
8616
8665
|
deps.installStateDir ?? stateDirectory(process.platform, process.env, deps.home)
|
|
8617
8666
|
);
|
|
8618
8667
|
if (!parsed.flags.has("json")) {
|
|
8619
|
-
renderStatusSummaries(
|
|
8668
|
+
renderStatusSummaries(shown, output);
|
|
8669
|
+
for (const line of codingToolLines(shown.codingTools)) output.line(line);
|
|
8620
8670
|
await renderRefusals(refusalStateDir(deps), output);
|
|
8621
8671
|
}
|
|
8622
8672
|
const hint = await cliUpdateHint(store, version);
|
|
8623
8673
|
if (parsed.flags.has("json"))
|
|
8624
|
-
output.json({ ...
|
|
8674
|
+
output.json({ ...shown, cli: { version, ...hint ? { updateAvailable: hint } : {} } });
|
|
8625
8675
|
else if (hint) output.line(hint);
|
|
8626
8676
|
const reported = await reportCurrentInstallation(deps, output, document);
|
|
8627
8677
|
if (reported === "signed_out" && !parsed.flags.has("json")) {
|
|
@@ -8629,7 +8679,7 @@ Preview: ${preview.path}
|
|
|
8629
8679
|
output.line(REPORT_NOT_SENT.nextStep);
|
|
8630
8680
|
} else if (typeof reported === "object" && !parsed.flags.has("json"))
|
|
8631
8681
|
output.line(humanReason(reported.refused));
|
|
8632
|
-
return statusExitCode(
|
|
8682
|
+
return statusExitCode(shown);
|
|
8633
8683
|
}
|
|
8634
8684
|
if (command === "connect") {
|
|
8635
8685
|
const invalid = allowed(parsed, []);
|
|
@@ -8640,7 +8690,24 @@ Preview: ${preview.path}
|
|
|
8640
8690
|
const editor = (await localEditorStatus(deps.home ?? homedir4())).find(
|
|
8641
8691
|
(candidate) => candidate.host === host
|
|
8642
8692
|
);
|
|
8643
|
-
|
|
8693
|
+
const signIn = editor?.mcp === "ready" ? await codingToolSignIns(deps, output, [host]) : void 0;
|
|
8694
|
+
const current = signIn?.get(host);
|
|
8695
|
+
if (current?.state === "signed_in" || current?.state === "signed_in_elsewhere") {
|
|
8696
|
+
const message = current.state === "signed_in_elsewhere" ? signedInElsewhereMessage(launchHostLabels[host]) : alreadySignedInMessage(launchHostLabels[host], current.lastUsedAt);
|
|
8697
|
+
if (parsed.flags.has("json"))
|
|
8698
|
+
output.json(
|
|
8699
|
+
current.state === "signed_in" ? {
|
|
8700
|
+
status: "READY",
|
|
8701
|
+
signIn: current.state,
|
|
8702
|
+
lastUsedAt: current.lastUsedAt,
|
|
8703
|
+
reason: message
|
|
8704
|
+
} : { status: "READY", reason: message }
|
|
8705
|
+
);
|
|
8706
|
+
else output.line(message);
|
|
8707
|
+
return 0;
|
|
8708
|
+
}
|
|
8709
|
+
const json = parsed.flags.has("json");
|
|
8710
|
+
if (host === "codex" && editor?.mcp === "ready") {
|
|
8644
8711
|
const bearer = await auth(deps, output, false).getCliBearer().catch(() => void 0);
|
|
8645
8712
|
if (typeof bearer === "string") {
|
|
8646
8713
|
const outcome = await runEditorLogin({
|
|
@@ -8648,26 +8715,29 @@ Preview: ${preview.path}
|
|
|
8648
8715
|
apiOrigin: apiOrigin(),
|
|
8649
8716
|
issuer: process.env.MNEMONIK_OAUTH_ISSUER ?? "https://auth.mnemonik.ai",
|
|
8650
8717
|
bearer: () => Promise.resolve(bearer),
|
|
8651
|
-
print: (line) =>
|
|
8718
|
+
print: (line) => {
|
|
8719
|
+
if (!json) output.line(line);
|
|
8720
|
+
else if (/^https?:\/\//u.test(line))
|
|
8721
|
+
output.json({ status: "SIGN_IN_LINK", url: line, reason: SIGN_IN_LINK_REASON });
|
|
8722
|
+
},
|
|
8652
8723
|
fetch: deps.grantFetch,
|
|
8653
8724
|
...deps.editorLogin
|
|
8654
8725
|
});
|
|
8655
|
-
if (outcome === "signed_in")
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
return 0;
|
|
8726
|
+
if (outcome === "signed_in") {
|
|
8727
|
+
if (json) output.json({ status: "READY", reason: CODEX_SIGNED_IN_MESSAGE });
|
|
8728
|
+
else output.line(CODEX_SIGNED_IN_MESSAGE);
|
|
8729
|
+
return 0;
|
|
8730
|
+
}
|
|
8731
|
+
if (outcome === "not_approved") {
|
|
8732
|
+
if (json)
|
|
8733
|
+
output.json({
|
|
8734
|
+
status: "ACTION_REQUIRED",
|
|
8735
|
+
reason: CONNECT_NOT_APPROVED_MESSAGE,
|
|
8736
|
+
actions: ["mnemonik connect codex"]
|
|
8737
|
+
});
|
|
8738
|
+
else output.line(CONNECT_NOT_APPROVED_MESSAGE);
|
|
8739
|
+
return 1;
|
|
8740
|
+
}
|
|
8671
8741
|
}
|
|
8672
8742
|
}
|
|
8673
8743
|
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.`;
|
|
@@ -9043,14 +9113,15 @@ Preview: ${preview.path}
|
|
|
9043
9113
|
const grantHostName = grantHost(g);
|
|
9044
9114
|
return (!grantHostName || hostOrder.includes(grantHostName)) && (!host || grantHostName === host);
|
|
9045
9115
|
}).map((g) => ({ ...g, host: grantHost(g) ?? g.clientName ?? g.clientId }));
|
|
9116
|
+
const signedIn = grants.filter(validGrant);
|
|
9046
9117
|
if (parsed.flags.has("json")) output.json({ account: status.account, grants });
|
|
9047
|
-
else if (!
|
|
9118
|
+
else if (!signedIn.length)
|
|
9048
9119
|
output.line(
|
|
9049
9120
|
host ? `${launchHostLabels[host]} is not signed in.` : humanReason("not_signed_in")
|
|
9050
9121
|
);
|
|
9051
9122
|
else {
|
|
9052
9123
|
output.signedInAs(status.email);
|
|
9053
|
-
for (const line of grantSummaryLines(
|
|
9124
|
+
for (const line of grantSummaryLines(signedIn, launchHostLabels)) output.line(line);
|
|
9054
9125
|
output.line(
|
|
9055
9126
|
"Older sign-ins stay valid until `mnemonik auth logout`. `mnemonik auth status --json` lists every one."
|
|
9056
9127
|
);
|
|
@@ -9096,7 +9167,9 @@ export {
|
|
|
9096
9167
|
NOTHING_REMOVED_LINE,
|
|
9097
9168
|
SCANNER_REMOVED_LINE,
|
|
9098
9169
|
SCANNER_UNINSTALL_PROMPT,
|
|
9170
|
+
SIGN_IN_LINK_REASON,
|
|
9099
9171
|
alreadyConnectedFolderLine,
|
|
9172
|
+
alreadySignedInMessage,
|
|
9100
9173
|
connectFolderPrompt,
|
|
9101
9174
|
connectedFolderLine,
|
|
9102
9175
|
dataDeletePrompt,
|