@mnemonik/cli 7.111.10 → 7.112.3
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/credentials.d.ts +7 -2
- package/dist/auth/credentials.d.ts.map +1 -1
- package/dist/auth/credentials.js +311 -98
- package/dist/auth/index.d.ts +15 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +72 -15
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/installSession.js +3 -2
- package/dist/auth/status.js +3 -2
- package/dist/diagnostics.js +315 -102
- package/dist/digests.json +53 -53
- package/dist/identity/migrate.js +40 -2
- package/dist/install/hosts.js +3 -2
- package/dist/install/journal.js +40 -2
- package/dist/install/journey.js +40 -2
- package/dist/install/ownership.js +40 -2
- package/dist/install/transaction.d.ts +1 -3
- package/dist/install/transaction.d.ts.map +1 -1
- package/dist/install/transaction.js +67 -16
- package/dist/install/transaction.js.map +1 -1
- package/dist/install/ui.d.ts.map +1 -1
- package/dist/install/ui.js +42 -2
- package/dist/install/ui.js.map +1 -1
- package/dist/installSession.js +3 -2
- package/dist/installation.js +40 -2
- package/dist/launcher.js +40 -2
- package/dist/preflight.js +4 -3
- package/dist/project/eligibility.js +40 -2
- package/dist/project/records.js +40 -2
- package/dist/project.d.ts +11 -2
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +46 -4
- package/dist/project.js.map +1 -1
- package/dist/router.js +41 -3
- package/dist/runtime/releaseSource.js +40 -2
- package/dist/runtime/selfUpdate.js +40 -2
- package/dist/runtime/signers.js +242 -50
- package/dist/runtime/store.js +34 -0
- package/dist/runtime/updateCheck.js +40 -2
- package/dist/sbom.json +21 -21
- package/dist/scanner/control.js +40 -2
- package/dist/scanner/data.js +3 -2
- package/dist/scanner/discover.js +4 -3
- package/dist/scanner/enable.js +40 -2
- package/dist/scanner/picker.js +3 -2
- package/dist/scanner/service.js +40 -2
- package/dist/scanner/update.js +40 -2
- package/dist/scanner-release.json +29 -29
- package/dist/status.js +44 -6
- package/dist/transport/server.d.ts +21 -2
- package/dist/transport/server.d.ts.map +1 -1
- package/dist/transport/server.js +15 -1
- package/dist/transport/server.js.map +1 -1
- package/dist/vendor/local-setup.js +40 -2
- package/package.json +31 -31
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "7.
|
|
3
|
-
"digestsSha256": "
|
|
2
|
+
"version": "7.112.3",
|
|
3
|
+
"digestsSha256": "b02eaea349b7268a945dcd1a60c5cca8c7f36762be939153de4c156f37e4f08b",
|
|
4
4
|
"platforms": {
|
|
5
5
|
"darwin-arm64": {
|
|
6
6
|
"schemaVersion": 1,
|
|
7
7
|
"artifact": "scanner",
|
|
8
|
-
"version": "7.
|
|
8
|
+
"version": "7.112.3",
|
|
9
9
|
"entry": "scanner-darwin-arm64",
|
|
10
10
|
"files": {
|
|
11
11
|
"scanner-darwin-arm64": {
|
|
12
|
-
"sha256": "
|
|
13
|
-
"size":
|
|
12
|
+
"sha256": "433b4754d99766e59ac4bb53f2ec0e4d6944f3fa18e73ce3965f23b3b062708e",
|
|
13
|
+
"size": 155604640,
|
|
14
14
|
"executable": true
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
"totalSize":
|
|
17
|
+
"totalSize": 155604640,
|
|
18
18
|
"source": {
|
|
19
19
|
"kind": "release",
|
|
20
|
-
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.
|
|
20
|
+
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.112.3/"
|
|
21
21
|
},
|
|
22
22
|
"signer": {
|
|
23
23
|
"platform": "darwin",
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
"darwin-x64": {
|
|
30
30
|
"schemaVersion": 1,
|
|
31
31
|
"artifact": "scanner",
|
|
32
|
-
"version": "7.
|
|
32
|
+
"version": "7.112.3",
|
|
33
33
|
"entry": "scanner-darwin-x64",
|
|
34
34
|
"files": {
|
|
35
35
|
"scanner-darwin-x64": {
|
|
36
|
-
"sha256": "
|
|
37
|
-
"size":
|
|
36
|
+
"sha256": "69792dce722f6c25cbb6a528259ae502314885571fc97acf84a1e6013eeb053e",
|
|
37
|
+
"size": 157364080,
|
|
38
38
|
"executable": true
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
-
"totalSize":
|
|
41
|
+
"totalSize": 157364080,
|
|
42
42
|
"source": {
|
|
43
43
|
"kind": "release",
|
|
44
|
-
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.
|
|
44
|
+
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.112.3/"
|
|
45
45
|
},
|
|
46
46
|
"signer": {
|
|
47
47
|
"platform": "darwin",
|
|
@@ -53,24 +53,24 @@
|
|
|
53
53
|
"linux-arm64": {
|
|
54
54
|
"schemaVersion": 1,
|
|
55
55
|
"artifact": "scanner",
|
|
56
|
-
"version": "7.
|
|
56
|
+
"version": "7.112.3",
|
|
57
57
|
"entry": "scanner-linux-arm64",
|
|
58
58
|
"files": {
|
|
59
59
|
"scanner-linux-arm64": {
|
|
60
|
-
"sha256": "
|
|
61
|
-
"size":
|
|
60
|
+
"sha256": "9d56268e62375254da9ee3ca7296f2ae3ece4fd985622c5f1c54e7570b7a0489",
|
|
61
|
+
"size": 156634240,
|
|
62
62
|
"executable": true
|
|
63
63
|
},
|
|
64
64
|
"scanner-linux-arm64.minisig": {
|
|
65
|
-
"sha256": "
|
|
65
|
+
"sha256": "183e696a1393e3dd793e5924c09574f7e2b148e0353bb0d3d6272c16a15f6470",
|
|
66
66
|
"size": 314,
|
|
67
67
|
"executable": false
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
"totalSize":
|
|
70
|
+
"totalSize": 156634554,
|
|
71
71
|
"source": {
|
|
72
72
|
"kind": "release",
|
|
73
|
-
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.
|
|
73
|
+
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.112.3/"
|
|
74
74
|
},
|
|
75
75
|
"signer": {
|
|
76
76
|
"platform": "linux",
|
|
@@ -83,24 +83,24 @@
|
|
|
83
83
|
"linux-x64": {
|
|
84
84
|
"schemaVersion": 1,
|
|
85
85
|
"artifact": "scanner",
|
|
86
|
-
"version": "7.
|
|
86
|
+
"version": "7.112.3",
|
|
87
87
|
"entry": "scanner-linux-x64",
|
|
88
88
|
"files": {
|
|
89
89
|
"scanner-linux-x64": {
|
|
90
|
-
"sha256": "
|
|
91
|
-
"size":
|
|
90
|
+
"sha256": "549668827a3256011751b8d916c3d13c97a0a4224f5961b064936ad47cf9d9a9",
|
|
91
|
+
"size": 160304320,
|
|
92
92
|
"executable": true
|
|
93
93
|
},
|
|
94
94
|
"scanner-linux-x64.minisig": {
|
|
95
|
-
"sha256": "
|
|
95
|
+
"sha256": "10a67411c859627edb19e6ac72cc786aae6b225f7386a4a7f337046a7d7e5c40",
|
|
96
96
|
"size": 312,
|
|
97
97
|
"executable": false
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
"totalSize":
|
|
100
|
+
"totalSize": 160304632,
|
|
101
101
|
"source": {
|
|
102
102
|
"kind": "release",
|
|
103
|
-
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.
|
|
103
|
+
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.112.3/"
|
|
104
104
|
},
|
|
105
105
|
"signer": {
|
|
106
106
|
"platform": "linux",
|
|
@@ -113,19 +113,19 @@
|
|
|
113
113
|
"win-x64": {
|
|
114
114
|
"schemaVersion": 1,
|
|
115
115
|
"artifact": "scanner",
|
|
116
|
-
"version": "7.
|
|
116
|
+
"version": "7.112.3",
|
|
117
117
|
"entry": "scanner-win-x64.exe",
|
|
118
118
|
"files": {
|
|
119
119
|
"scanner-win-x64.exe": {
|
|
120
|
-
"sha256": "
|
|
121
|
-
"size":
|
|
120
|
+
"sha256": "bc63224e96dc9426fd8326cd47b738b567c4518c4625c948cfc4075a237fd16a",
|
|
121
|
+
"size": 127366144,
|
|
122
122
|
"executable": true
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
|
-
"totalSize":
|
|
125
|
+
"totalSize": 127366144,
|
|
126
126
|
"source": {
|
|
127
127
|
"kind": "release",
|
|
128
|
-
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.
|
|
128
|
+
"url": "https://github.com/JayDeeCo-Limited/mnemonik-cli/releases/download/scanner-v7.112.3/"
|
|
129
129
|
},
|
|
130
130
|
"signingStatus": "unsigned",
|
|
131
131
|
"disclosureVersion": "2026.09.1"
|
package/dist/status.js
CHANGED
|
@@ -501,6 +501,13 @@ var require_ignore = __commonJS({
|
|
|
501
501
|
}
|
|
502
502
|
});
|
|
503
503
|
|
|
504
|
+
// packages/shared/dist/hookTimeouts.js
|
|
505
|
+
var init_hookTimeouts = __esm({
|
|
506
|
+
"packages/shared/dist/hookTimeouts.js"() {
|
|
507
|
+
"use strict";
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
|
|
504
511
|
// packages/shared/dist/runtimeSigners.js
|
|
505
512
|
import { basename, dirname as dirname2, join as join2, resolve, sep, win32 } from "node:path";
|
|
506
513
|
import { execFile, execFileSync } from "node:child_process";
|
|
@@ -623,7 +630,7 @@ var init_runtimeReader = __esm({
|
|
|
623
630
|
import { constants } from "node:fs";
|
|
624
631
|
import { lstat, mkdir, open, readdir, realpath, rename, rm } from "node:fs/promises";
|
|
625
632
|
import { tmpdir } from "node:os";
|
|
626
|
-
import { dirname as dirname3, join as join3, relative } from "node:path";
|
|
633
|
+
import { basename as basename2, dirname as dirname3, join as join3, relative } from "node:path";
|
|
627
634
|
async function readPrivate(path) {
|
|
628
635
|
const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
629
636
|
try {
|
|
@@ -663,11 +670,37 @@ async function pendingProjectSetup(root) {
|
|
|
663
670
|
results.sort((a, b) => Date.parse(b.time) - Date.parse(a.time));
|
|
664
671
|
return results[0]?.outcome === "done" ? [] : results.slice(0, 1);
|
|
665
672
|
}
|
|
673
|
+
var PROJECT_ENSURE_TIMEOUT_MS, SUPERVISOR, RUN_STALE_MS;
|
|
666
674
|
var init_projectSetupHandoff = __esm({
|
|
667
675
|
"packages/shared/dist/projectSetupHandoff.js"() {
|
|
668
676
|
"use strict";
|
|
669
677
|
init_runtimeSigners();
|
|
678
|
+
init_hookTimeouts();
|
|
670
679
|
init_runtimeReader();
|
|
680
|
+
PROJECT_ENSURE_TIMEOUT_MS = 3e4;
|
|
681
|
+
SUPERVISOR = `
|
|
682
|
+
const { execFile } = require('node:child_process');
|
|
683
|
+
const { writeFileSync, renameSync } = require('node:fs');
|
|
684
|
+
const [out, bin, ...args] = process.argv.slice(1);
|
|
685
|
+
let input = '';
|
|
686
|
+
process.stdin.setEncoding('utf8');
|
|
687
|
+
process.stdin.on('data', (chunk) => (input += chunk));
|
|
688
|
+
process.stdin.on('end', () => {
|
|
689
|
+
const child = execFile(
|
|
690
|
+
process.execPath,
|
|
691
|
+
[bin, ...args],
|
|
692
|
+
{ shell: false, timeout: ${PROJECT_ENSURE_TIMEOUT_MS}, killSignal: 'SIGKILL', maxBuffer: 64 * 1024, env: process.env },
|
|
693
|
+
(error, stdout) => {
|
|
694
|
+
const result = { code: error ? (typeof error.code === 'number' ? error.code : null) : 0, killed: !!(error && error.killed), stdout: String(stdout) };
|
|
695
|
+
writeFileSync(out + '.tmp', JSON.stringify(result), { mode: 0o600 });
|
|
696
|
+
renameSync(out + '.tmp', out);
|
|
697
|
+
}
|
|
698
|
+
);
|
|
699
|
+
child.stdin.on('error', () => {});
|
|
700
|
+
child.stdin.end(input);
|
|
701
|
+
});
|
|
702
|
+
`;
|
|
703
|
+
RUN_STALE_MS = PROJECT_ENSURE_TIMEOUT_MS + 1e4;
|
|
671
704
|
}
|
|
672
705
|
});
|
|
673
706
|
|
|
@@ -676,6 +709,7 @@ var init_hookRuntime = __esm({
|
|
|
676
709
|
"packages/shared/dist/hookRuntime.js"() {
|
|
677
710
|
"use strict";
|
|
678
711
|
init_runtimeSigners();
|
|
712
|
+
init_hookTimeouts();
|
|
679
713
|
init_repositoryRoot();
|
|
680
714
|
init_runtimeReader();
|
|
681
715
|
init_runtimeSigners();
|
|
@@ -2294,7 +2328,7 @@ Project work items live in tasks. A pending list requires action:"list" and stat
|
|
|
2294
2328
|
|
|
2295
2329
|
Which tool for what:
|
|
2296
2330
|
- memory_get: hydrates exact originals by id.
|
|
2297
|
-
- memory_add: saves a
|
|
2331
|
+
- memory_add: saves a decision, a user's preference, or a root cause.
|
|
2298
2332
|
- memory_state: corrects wrong, outdated, or conflicting memory.
|
|
2299
2333
|
- memory_info: explains confidence or origin when memory looks suspect.
|
|
2300
2334
|
- memory_links: connects related decisions so they surface together.
|
|
@@ -2303,7 +2337,8 @@ Which tool for what:
|
|
|
2303
2337
|
- policy: stores durable enforced rules or preferences, not memories.
|
|
2304
2338
|
- tasks: creates follow-up work and closes completed work.
|
|
2305
2339
|
- code_search: finds conceptual code when source wording differs.
|
|
2306
|
-
- memory_search: finds rationale, intent, decisions, and prior work
|
|
2340
|
+
- memory_search: finds rationale, intent, decisions, and prior work.
|
|
2341
|
+
- memory_ingest: brings the project's docs and code comments into memory when asked.`;
|
|
2307
2342
|
function getMcpInstructions() {
|
|
2308
2343
|
const process2 = globalThis.process;
|
|
2309
2344
|
if (!process2?.env) {
|
|
@@ -6465,6 +6500,9 @@ var DEFAULT_OPTIONS = {
|
|
|
6465
6500
|
};
|
|
6466
6501
|
var BUILT_IN_IGNORE_DIR_SET = new Set(BUILT_IN_IGNORE_DIRS);
|
|
6467
6502
|
|
|
6503
|
+
// packages/shared/dist/index.js
|
|
6504
|
+
init_hookTimeouts();
|
|
6505
|
+
|
|
6468
6506
|
// packages/shared/dist/jitDeliveryAck.js
|
|
6469
6507
|
init_runtimeSigners();
|
|
6470
6508
|
|
|
@@ -7501,7 +7539,7 @@ function parse(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
|
|
|
7501
7539
|
// packages/cli/src/status.ts
|
|
7502
7540
|
init_hookRuntime();
|
|
7503
7541
|
import { devReadiness, expectedScannerDisclosureVersion } from "./runtime/releaseSource.js";
|
|
7504
|
-
import { basename as
|
|
7542
|
+
import { basename as basename3, isAbsolute, relative as relative2, resolve as resolve2 } from "node:path";
|
|
7505
7543
|
import { Output } from "./output.js";
|
|
7506
7544
|
import {
|
|
7507
7545
|
runProjectCommand
|
|
@@ -7711,7 +7749,7 @@ function buildStatusDocument(input) {
|
|
|
7711
7749
|
projects: [
|
|
7712
7750
|
{
|
|
7713
7751
|
projectId: project.projectId,
|
|
7714
|
-
displayName:
|
|
7752
|
+
displayName: basename3(project.resolvedRoot),
|
|
7715
7753
|
repositoryMatch: project.identity,
|
|
7716
7754
|
identityFile: null,
|
|
7717
7755
|
summary: { conditions },
|
|
@@ -7810,7 +7848,7 @@ function renderStatusSummaries(document, output, options = {}) {
|
|
|
7810
7848
|
document.conditions,
|
|
7811
7849
|
options.agent
|
|
7812
7850
|
);
|
|
7813
|
-
const connected = [...new Set(document.scanner?.roots?.map((root) =>
|
|
7851
|
+
const connected = [...new Set(document.scanner?.roots?.map((root) => basename3(root)) ?? [])].sort(
|
|
7814
7852
|
(left, right) => left.toLocaleLowerCase().localeCompare(right.toLocaleLowerCase())
|
|
7815
7853
|
);
|
|
7816
7854
|
if (connected.length) {
|
|
@@ -21,7 +21,21 @@ export interface ServerTransportOptions {
|
|
|
21
21
|
issueContext(input: Evidence & {
|
|
22
22
|
projectId?: string;
|
|
23
23
|
}): Promise<CliIssueContext>;
|
|
24
|
+
/** Each request's own bound (PROJECT_REQUEST_TIMEOUT_MS). */
|
|
25
|
+
requestTimeoutMs?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Epoch ms after which no request is sent and each in flight is cut short
|
|
28
|
+
* (`project ensure --agent` sets it inside its supervisor's 30 s limit).
|
|
29
|
+
*/
|
|
30
|
+
deadline?: number;
|
|
24
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* A project-setup request that has not answered by then is abandoned and
|
|
34
|
+
* reported `unreachable` (the command's retryable failure). Without it a
|
|
35
|
+
* server that accepted the connection and never answered held the command,
|
|
36
|
+
* and the hook's detached `project ensure` helper, indefinitely.
|
|
37
|
+
*/
|
|
38
|
+
export declare const PROJECT_REQUEST_TIMEOUT_MS = 5000;
|
|
25
39
|
type AccountContext = {
|
|
26
40
|
owner: Owner;
|
|
27
41
|
userId: string;
|
|
@@ -56,13 +70,18 @@ export declare function createServerTransport(options: ServerTransportOptions):
|
|
|
56
70
|
reason: string;
|
|
57
71
|
}>;
|
|
58
72
|
credentials: {
|
|
59
|
-
putCliOAuth: (metadata: import("@mnemonik/credentials").CliOAuthMetadata, tokens: import("@mnemonik/credentials").CliOAuthTokens | string) => Promise<{
|
|
73
|
+
putCliOAuth: (metadata: import("@mnemonik/credentials").CliOAuthMetadata, tokens: import("@mnemonik/credentials").CliOAuthTokens | string) => ReturnType<(metadata: import("@mnemonik/credentials").CliOAuthMetadata, tokens: import("@mnemonik/credentials").CliOAuthTokens | string) => Promise<{
|
|
60
74
|
store: string;
|
|
61
|
-
}
|
|
75
|
+
}>>;
|
|
62
76
|
readCliOAuth: () => Promise<CliOAuthCredential | null>;
|
|
63
77
|
rotateCli: (transport: CliCredentialTransport) => Promise<import("@mnemonik/credentials").ActionRequired | import("@mnemonik/credentials").RetryLater | CliOAuthCredential>;
|
|
64
78
|
withCliCredential: <T>(transport: CliCredentialTransport, work: (accessToken: string) => Promise<import("@mnemonik/credentials").WorkResponse<T>>) => Promise<import("@mnemonik/credentials").WorkResponse<T> | import("@mnemonik/credentials").ActionRequired | import("@mnemonik/credentials").RetryLater>;
|
|
65
79
|
removeCliOAuth: () => Promise<void>;
|
|
80
|
+
revokeCli: (transport: import("@mnemonik/credentials").CliRevocationTransport) => Promise<import("@mnemonik/credentials").ActionRequired | import("@mnemonik/credentials").RetryLater | {
|
|
81
|
+
status: 'revoked';
|
|
82
|
+
familyId: string;
|
|
83
|
+
}>;
|
|
84
|
+
waitForCliLease: () => Promise<void>;
|
|
66
85
|
putFamily: (componentKind: import("@mnemonik/credentials").ComponentKind, response: import("@mnemonik/credentials").ComponentCredentialResponse) => Promise<import("@mnemonik/credentials").FamilyCredential>;
|
|
67
86
|
readFamily: (familyId: string) => Promise<import("@mnemonik/credentials").FamilyCredential | null>;
|
|
68
87
|
rotateFamily: (familyId: string, transport: import("@mnemonik/credentials").CredentialTransport) => Promise<import("@mnemonik/credentials").RotationResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/transport/server.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,QAAQ,EAAE,KAAK,GAAG,kBAAkB,GAAG,YAAY,CAAC;IACpD,aAAa,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC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credentials.js";
|
|
|
5
5
|
import { URLSearchParams } from "node:url";
|
|
6
6
|
import { createCliAuth } from "../auth/index.js";
|
|
7
7
|
var DEFAULT_API = "https://api.mnemonik.dev/";
|
|
8
|
+
var PROJECT_REQUEST_TIMEOUT_MS = 5e3;
|
|
8
9
|
var action = (state, allowedActions = ["retry", "cancel"]) => ({
|
|
9
10
|
status: "ACTION_REQUIRED",
|
|
10
11
|
state,
|
|
@@ -41,6 +42,13 @@ function createServerTransport(options) {
|
|
|
41
42
|
const fetchImpl = options.fetch ?? fetch;
|
|
42
43
|
const credentials = options.credentials ?? createCliCredentials();
|
|
43
44
|
const getCliBearer = options.getCliBearer ?? createCliAuth({ resource, fetch: fetchImpl, credentials }).getCliBearer;
|
|
45
|
+
const requestBudget = () => Math.max(
|
|
46
|
+
0,
|
|
47
|
+
Math.min(
|
|
48
|
+
options.requestTimeoutMs ?? PROJECT_REQUEST_TIMEOUT_MS,
|
|
49
|
+
(options.deadline ?? Infinity) - Date.now()
|
|
50
|
+
)
|
|
51
|
+
);
|
|
44
52
|
const rotation = {
|
|
45
53
|
async rotateCli(current) {
|
|
46
54
|
const response = await fetchImpl(`${current.issuer.replace(/\/$/u, "")}/oauth/token`, {
|
|
@@ -51,7 +59,9 @@ function createServerTransport(options) {
|
|
|
51
59
|
client_id: current.clientId,
|
|
52
60
|
refresh_token: current.refreshToken,
|
|
53
61
|
resource
|
|
54
|
-
})
|
|
62
|
+
}),
|
|
63
|
+
// A timeout throws: the credential adapter treats it as a lost response.
|
|
64
|
+
signal: AbortSignal.timeout(Math.max(1, requestBudget()))
|
|
55
65
|
});
|
|
56
66
|
return {
|
|
57
67
|
status: response.status,
|
|
@@ -64,8 +74,11 @@ function createServerTransport(options) {
|
|
|
64
74
|
const firstBearer = suppliedBearer ?? await getCliBearer();
|
|
65
75
|
if (typeof firstBearer !== "string") return signInAction(firstBearer);
|
|
66
76
|
const send = async (bearer) => {
|
|
77
|
+
const budget = requestBudget();
|
|
78
|
+
if (budget <= 0) return { status: 503, body: action("unreachable") };
|
|
67
79
|
try {
|
|
68
80
|
const response = await fetchImpl(`${apiBase}${path}`, {
|
|
81
|
+
signal: AbortSignal.timeout(budget),
|
|
69
82
|
method,
|
|
70
83
|
headers: {
|
|
71
84
|
authorization: `Bearer ${bearer}`,
|
|
@@ -147,6 +160,7 @@ function createServerTransport(options) {
|
|
|
147
160
|
};
|
|
148
161
|
}
|
|
149
162
|
export {
|
|
163
|
+
PROJECT_REQUEST_TIMEOUT_MS,
|
|
150
164
|
ServerActionRequiredError,
|
|
151
165
|
accountActions,
|
|
152
166
|
createServerTransport,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/transport/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAe3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,GAAG,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/transport/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAe3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,GAAG,2BAA2B,CAAC;AA2BhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAWhD,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAkB,EAAE,CAAC,CAAC;IACvF,MAAM,EAAE,iBAAiB;IACzB,KAAK;IACL,cAAc;CACf,CAAC,CAAC;AACH,MAAM,QAAQ,GAAG,CAAC,KAAc,EAA2B,EAA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CAAC;YACtD,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAE,UAAoB,CAAC,CAAC,CAAE,MAAM,CAAC,KAAsB,EAAE,CAAC;QACtF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -501,6 +501,13 @@ var require_ignore = __commonJS({
|
|
|
501
501
|
}
|
|
502
502
|
});
|
|
503
503
|
|
|
504
|
+
// packages/shared/dist/hookTimeouts.js
|
|
505
|
+
var init_hookTimeouts = __esm({
|
|
506
|
+
"packages/shared/dist/hookTimeouts.js"() {
|
|
507
|
+
"use strict";
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
|
|
504
511
|
// packages/shared/dist/runtimeSigners.js
|
|
505
512
|
import { lstatSync, mkdirSync, readFileSync, writeFileSync, renameSync, unlinkSync } from "node:fs";
|
|
506
513
|
import { basename, dirname as dirname2, join as join2, resolve, sep, win32 } from "node:path";
|
|
@@ -750,11 +757,37 @@ var init_runtimeReader = __esm({
|
|
|
750
757
|
});
|
|
751
758
|
|
|
752
759
|
// packages/shared/dist/projectSetupHandoff.js
|
|
760
|
+
var PROJECT_ENSURE_TIMEOUT_MS, SUPERVISOR, RUN_STALE_MS;
|
|
753
761
|
var init_projectSetupHandoff = __esm({
|
|
754
762
|
"packages/shared/dist/projectSetupHandoff.js"() {
|
|
755
763
|
"use strict";
|
|
756
764
|
init_runtimeSigners();
|
|
765
|
+
init_hookTimeouts();
|
|
757
766
|
init_runtimeReader();
|
|
767
|
+
PROJECT_ENSURE_TIMEOUT_MS = 3e4;
|
|
768
|
+
SUPERVISOR = `
|
|
769
|
+
const { execFile } = require('node:child_process');
|
|
770
|
+
const { writeFileSync, renameSync } = require('node:fs');
|
|
771
|
+
const [out, bin, ...args] = process.argv.slice(1);
|
|
772
|
+
let input = '';
|
|
773
|
+
process.stdin.setEncoding('utf8');
|
|
774
|
+
process.stdin.on('data', (chunk) => (input += chunk));
|
|
775
|
+
process.stdin.on('end', () => {
|
|
776
|
+
const child = execFile(
|
|
777
|
+
process.execPath,
|
|
778
|
+
[bin, ...args],
|
|
779
|
+
{ shell: false, timeout: ${PROJECT_ENSURE_TIMEOUT_MS}, killSignal: 'SIGKILL', maxBuffer: 64 * 1024, env: process.env },
|
|
780
|
+
(error, stdout) => {
|
|
781
|
+
const result = { code: error ? (typeof error.code === 'number' ? error.code : null) : 0, killed: !!(error && error.killed), stdout: String(stdout) };
|
|
782
|
+
writeFileSync(out + '.tmp', JSON.stringify(result), { mode: 0o600 });
|
|
783
|
+
renameSync(out + '.tmp', out);
|
|
784
|
+
}
|
|
785
|
+
);
|
|
786
|
+
child.stdin.on('error', () => {});
|
|
787
|
+
child.stdin.end(input);
|
|
788
|
+
});
|
|
789
|
+
`;
|
|
790
|
+
RUN_STALE_MS = PROJECT_ENSURE_TIMEOUT_MS + 1e4;
|
|
758
791
|
}
|
|
759
792
|
});
|
|
760
793
|
|
|
@@ -763,6 +796,7 @@ var init_hookRuntime = __esm({
|
|
|
763
796
|
"packages/shared/dist/hookRuntime.js"() {
|
|
764
797
|
"use strict";
|
|
765
798
|
init_runtimeSigners();
|
|
799
|
+
init_hookTimeouts();
|
|
766
800
|
init_repositoryRoot();
|
|
767
801
|
init_runtimeReader();
|
|
768
802
|
init_runtimeSigners();
|
|
@@ -2361,7 +2395,7 @@ Project work items live in tasks. A pending list requires action:"list" and stat
|
|
|
2361
2395
|
|
|
2362
2396
|
Which tool for what:
|
|
2363
2397
|
- memory_get: hydrates exact originals by id.
|
|
2364
|
-
- memory_add: saves a
|
|
2398
|
+
- memory_add: saves a decision, a user's preference, or a root cause.
|
|
2365
2399
|
- memory_state: corrects wrong, outdated, or conflicting memory.
|
|
2366
2400
|
- memory_info: explains confidence or origin when memory looks suspect.
|
|
2367
2401
|
- memory_links: connects related decisions so they surface together.
|
|
@@ -2370,7 +2404,8 @@ Which tool for what:
|
|
|
2370
2404
|
- policy: stores durable enforced rules or preferences, not memories.
|
|
2371
2405
|
- tasks: creates follow-up work and closes completed work.
|
|
2372
2406
|
- code_search: finds conceptual code when source wording differs.
|
|
2373
|
-
- memory_search: finds rationale, intent, decisions, and prior work
|
|
2407
|
+
- memory_search: finds rationale, intent, decisions, and prior work.
|
|
2408
|
+
- memory_ingest: brings the project's docs and code comments into memory when asked.`;
|
|
2374
2409
|
function getMcpInstructions() {
|
|
2375
2410
|
const process2 = globalThis.process;
|
|
2376
2411
|
if (!process2?.env) {
|
|
@@ -6532,6 +6567,9 @@ var DEFAULT_OPTIONS = {
|
|
|
6532
6567
|
};
|
|
6533
6568
|
var BUILT_IN_IGNORE_DIR_SET = new Set(BUILT_IN_IGNORE_DIRS);
|
|
6534
6569
|
|
|
6570
|
+
// packages/shared/dist/index.js
|
|
6571
|
+
init_hookTimeouts();
|
|
6572
|
+
|
|
6535
6573
|
// packages/shared/dist/jitDeliveryAck.js
|
|
6536
6574
|
init_runtimeSigners();
|
|
6537
6575
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mnemonik/cli",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.112.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/JayDeeCo-Limited/mnemonik-cli.git"
|
|
@@ -34,27 +34,27 @@
|
|
|
34
34
|
"hosts": {
|
|
35
35
|
"claude-code": {
|
|
36
36
|
"package": "@mnemonik/claude-code-hooks",
|
|
37
|
-
"version": "0.9.
|
|
37
|
+
"version": "0.9.256",
|
|
38
38
|
"closure": [
|
|
39
39
|
{
|
|
40
40
|
"name": "@mnemonik/claude-code-hooks",
|
|
41
|
-
"version": "0.9.
|
|
42
|
-
"integrity": "sha512-
|
|
41
|
+
"version": "0.9.256",
|
|
42
|
+
"integrity": "sha512-bh/Hec6xDZtT1U7DLBsghnM7tYLDSkSe5jvhCh2t5k3zXqU/zpJ10jEpC7r8qVws1lvWUWkJHIcP2sgaUgIcIw=="
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"name": "@mnemonik/credentials",
|
|
46
|
-
"version": "0.1.
|
|
47
|
-
"integrity": "sha512-
|
|
46
|
+
"version": "0.1.77",
|
|
47
|
+
"integrity": "sha512-N3btMaQri4QQpskUkfJ1NH1C+8xW1JX4X+NI2HSWOBT8VyvxehhfTOx66pDqZtl29GZbi7tXmGfrsOKMxXD69A=="
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"name": "@mnemonik/local-setup",
|
|
51
|
-
"version": "0.1.
|
|
52
|
-
"integrity": "sha512-
|
|
51
|
+
"version": "0.1.77",
|
|
52
|
+
"integrity": "sha512-cG3QRHMxuodNeFLI9lcCVSwI6xK2jeUBhmoQvE5Zuxn0ulTe2IC4MoDcOOfreM5IX+Hhl8GowCKbvdcgyEKWPg=="
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"name": "@mnemonik/shared",
|
|
56
|
-
"version": "7.
|
|
57
|
-
"integrity": "sha512-
|
|
56
|
+
"version": "7.112.3",
|
|
57
|
+
"integrity": "sha512-a1Ms/ETi+37D328OIL67ySzC8h6pcwZeIVbtZ27RGWfHCRV8bWfablblz6KPaCW1nGh35CjuNoK8nWJ1RgBKpQ=="
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"name": "ignore",
|
|
@@ -87,31 +87,31 @@
|
|
|
87
87
|
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
|
88
88
|
}
|
|
89
89
|
],
|
|
90
|
-
"releaseVersion": "7.
|
|
90
|
+
"releaseVersion": "7.112.3"
|
|
91
91
|
},
|
|
92
92
|
"codex": {
|
|
93
93
|
"package": "@mnemonik/codex-hooks",
|
|
94
|
-
"version": "0.8.
|
|
94
|
+
"version": "0.8.225",
|
|
95
95
|
"closure": [
|
|
96
96
|
{
|
|
97
97
|
"name": "@mnemonik/codex-hooks",
|
|
98
|
-
"version": "0.8.
|
|
99
|
-
"integrity": "sha512-
|
|
98
|
+
"version": "0.8.225",
|
|
99
|
+
"integrity": "sha512-G5TnYKFoOlVCj0Pn286LvLNui8CPYrOTSeno1XxEylYyEKIdTbZj0GhxIL4Jxk43EgT2k457vm3I7O0372UyMw=="
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "@mnemonik/credentials",
|
|
103
|
-
"version": "0.1.
|
|
104
|
-
"integrity": "sha512-
|
|
103
|
+
"version": "0.1.77",
|
|
104
|
+
"integrity": "sha512-N3btMaQri4QQpskUkfJ1NH1C+8xW1JX4X+NI2HSWOBT8VyvxehhfTOx66pDqZtl29GZbi7tXmGfrsOKMxXD69A=="
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
"name": "@mnemonik/local-setup",
|
|
108
|
-
"version": "0.1.
|
|
109
|
-
"integrity": "sha512-
|
|
108
|
+
"version": "0.1.77",
|
|
109
|
+
"integrity": "sha512-cG3QRHMxuodNeFLI9lcCVSwI6xK2jeUBhmoQvE5Zuxn0ulTe2IC4MoDcOOfreM5IX+Hhl8GowCKbvdcgyEKWPg=="
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
"name": "@mnemonik/shared",
|
|
113
|
-
"version": "7.
|
|
114
|
-
"integrity": "sha512-
|
|
113
|
+
"version": "7.112.3",
|
|
114
|
+
"integrity": "sha512-a1Ms/ETi+37D328OIL67ySzC8h6pcwZeIVbtZ27RGWfHCRV8bWfablblz6KPaCW1nGh35CjuNoK8nWJ1RgBKpQ=="
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
"name": "ignore",
|
|
@@ -144,31 +144,31 @@
|
|
|
144
144
|
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
|
145
145
|
}
|
|
146
146
|
],
|
|
147
|
-
"releaseVersion": "7.
|
|
147
|
+
"releaseVersion": "7.112.3"
|
|
148
148
|
},
|
|
149
149
|
"cursor": {
|
|
150
150
|
"package": "@mnemonik/cursor-hooks",
|
|
151
|
-
"version": "0.7.
|
|
151
|
+
"version": "0.7.212",
|
|
152
152
|
"closure": [
|
|
153
153
|
{
|
|
154
154
|
"name": "@mnemonik/cursor-hooks",
|
|
155
|
-
"version": "0.7.
|
|
156
|
-
"integrity": "sha512-
|
|
155
|
+
"version": "0.7.212",
|
|
156
|
+
"integrity": "sha512-FGMu7a8Zjr3WmKSD0SZKNM8WH7lCFfm66OauNeKqYw4YzxqmJD9hRhFfTJbIsbJBZoP94tZqtmuYjNGiYNvL8g=="
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
159
|
"name": "@mnemonik/credentials",
|
|
160
|
-
"version": "0.1.
|
|
161
|
-
"integrity": "sha512-
|
|
160
|
+
"version": "0.1.77",
|
|
161
|
+
"integrity": "sha512-N3btMaQri4QQpskUkfJ1NH1C+8xW1JX4X+NI2HSWOBT8VyvxehhfTOx66pDqZtl29GZbi7tXmGfrsOKMxXD69A=="
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
164
|
"name": "@mnemonik/local-setup",
|
|
165
|
-
"version": "0.1.
|
|
166
|
-
"integrity": "sha512-
|
|
165
|
+
"version": "0.1.77",
|
|
166
|
+
"integrity": "sha512-cG3QRHMxuodNeFLI9lcCVSwI6xK2jeUBhmoQvE5Zuxn0ulTe2IC4MoDcOOfreM5IX+Hhl8GowCKbvdcgyEKWPg=="
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
"name": "@mnemonik/shared",
|
|
170
|
-
"version": "7.
|
|
171
|
-
"integrity": "sha512-
|
|
170
|
+
"version": "7.112.3",
|
|
171
|
+
"integrity": "sha512-a1Ms/ETi+37D328OIL67ySzC8h6pcwZeIVbtZ27RGWfHCRV8bWfablblz6KPaCW1nGh35CjuNoK8nWJ1RgBKpQ=="
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
174
|
"name": "ignore",
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
|
202
202
|
}
|
|
203
203
|
],
|
|
204
|
-
"releaseVersion": "7.
|
|
204
|
+
"releaseVersion": "7.112.3"
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
}
|