@memnexus-ai/mx-agent-cli 0.1.297 → 0.1.299
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/agent-config/hooks/gh-pr-edit-guard.sh +21 -9
- package/dist/agent-config/settings.json +7 -1
- package/dist/commands/bootstrap.d.ts.map +1 -1
- package/dist/commands/bootstrap.js +5 -0
- package/dist/commands/bootstrap.js.map +1 -1
- package/dist/commands/check.d.ts +20 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +30 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +5 -0
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/gh.d.ts +38 -0
- package/dist/commands/gh.d.ts.map +1 -0
- package/dist/commands/gh.js +162 -0
- package/dist/commands/gh.js.map +1 -0
- package/dist/commands/git-credential.d.ts +22 -0
- package/dist/commands/git-credential.d.ts.map +1 -0
- package/dist/commands/git-credential.js +53 -0
- package/dist/commands/git-credential.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/new.d.ts +24 -0
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +68 -6
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/pr-set-body.d.ts +120 -35
- package/dist/commands/pr-set-body.d.ts.map +1 -1
- package/dist/commands/pr-set-body.js +343 -108
- package/dist/commands/pr-set-body.js.map +1 -1
- package/dist/commands/pr-sync.d.ts +2 -1
- package/dist/commands/pr-sync.d.ts.map +1 -1
- package/dist/commands/pr-sync.js +129 -32
- package/dist/commands/pr-sync.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +82 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/check-run.d.ts +131 -0
- package/dist/lib/check-run.d.ts.map +1 -0
- package/dist/lib/check-run.js +291 -0
- package/dist/lib/check-run.js.map +1 -0
- package/dist/lib/coordination-token.d.ts +39 -1
- package/dist/lib/coordination-token.d.ts.map +1 -1
- package/dist/lib/coordination-token.js +149 -9
- package/dist/lib/coordination-token.js.map +1 -1
- package/dist/lib/creation-login.d.ts +42 -0
- package/dist/lib/creation-login.d.ts.map +1 -0
- package/dist/lib/creation-login.js +62 -0
- package/dist/lib/creation-login.js.map +1 -0
- package/dist/lib/gh-remote.d.ts +46 -5
- package/dist/lib/gh-remote.d.ts.map +1 -1
- package/dist/lib/gh-remote.js +80 -16
- package/dist/lib/gh-remote.js.map +1 -1
- package/dist/lib/gh-token-run.d.ts +551 -0
- package/dist/lib/gh-token-run.d.ts.map +1 -0
- package/dist/lib/gh-token-run.js +1246 -0
- package/dist/lib/gh-token-run.js.map +1 -0
- package/dist/lib/git-credential.d.ts +120 -0
- package/dist/lib/git-credential.d.ts.map +1 -0
- package/dist/lib/git-credential.js +204 -0
- package/dist/lib/git-credential.js.map +1 -0
- package/dist/lib/github-app-token.d.ts +288 -0
- package/dist/lib/github-app-token.d.ts.map +1 -0
- package/dist/lib/github-app-token.js +519 -0
- package/dist/lib/github-app-token.js.map +1 -0
- package/dist/lib/memory.d.ts.map +1 -1
- package/dist/lib/memory.js +35 -2
- package/dist/lib/memory.js.map +1 -1
- package/dist/lib/repo-guard-state-dirs.d.ts +39 -0
- package/dist/lib/repo-guard-state-dirs.d.ts.map +1 -0
- package/dist/lib/repo-guard-state-dirs.js +170 -0
- package/dist/lib/repo-guard-state-dirs.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mx-agent gh <args...>
|
|
3
|
+
*
|
|
4
|
+
* Runs /usr/bin/gh with an mx-bott `gh` token in the child's environment only
|
|
5
|
+
* (#440, v56). The work is in lib/gh-token-run.ts. This file wires the real
|
|
6
|
+
* mint, the real revoke, the real filesystem, the real spawn and the real
|
|
7
|
+
* signals.
|
|
8
|
+
*
|
|
9
|
+
* The mint is mintInstallationToken and the revoke is revokeInstallationToken
|
|
10
|
+
* (v59), both fixed here. No environment variable, flag
|
|
11
|
+
* or parameter selects another mint, gh binary, host, vault or secret.
|
|
12
|
+
*
|
|
13
|
+
* Not enabled anywhere by this command. Plain `gh` still uses the product
|
|
14
|
+
* owner's saved login. See docs/agent-github-identity-setup.md.
|
|
15
|
+
*/
|
|
16
|
+
import { type GhRunDeps } from '../lib/gh-token-run.js';
|
|
17
|
+
/** Bound on `gh --version`, so a hung binary cannot stall the wrapper. */
|
|
18
|
+
export declare const GH_VERSION_TIMEOUT_MS = 10000;
|
|
19
|
+
/**
|
|
20
|
+
* The gh arguments from the process argv. Only `mx-agent gh ...` with `gh` as
|
|
21
|
+
* the first argument is read. Any other shape returns no arguments, which the
|
|
22
|
+
* wrapper refuses with `no-command`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ghArgsFromArgv(argv: readonly string[]): string[];
|
|
25
|
+
/**
|
|
26
|
+
* True only for `mx-agent gh --help` or `mx-agent gh -h` with nothing else.
|
|
27
|
+
* The CLI then prints the wrapper's own help, mints nothing and runs no gh.
|
|
28
|
+
* Any other use of a help flag goes to the allowlist, which refuses it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isWrapperHelp(args: readonly string[]): boolean;
|
|
31
|
+
/** The dependencies the shipped command uses. Exported so a test can check the mint is the real one. */
|
|
32
|
+
export declare function realGhDeps(): GhRunDeps;
|
|
33
|
+
/**
|
|
34
|
+
* Run the wrapper and turn any unexpected error into exit 1 with one fixed
|
|
35
|
+
* stderr line. The error's own text is never printed.
|
|
36
|
+
*/
|
|
37
|
+
export declare function runGhCommand(args: readonly string[], deps?: GhRunDeps): Promise<number>;
|
|
38
|
+
//# sourceMappingURL=gh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh.d.ts","sourceRoot":"","sources":["../../src/commands/gh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EAAiD,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEvG,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAsF5C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE9D;AAED,wGAAwG;AACxG,wBAAgB,UAAU,IAAI,SAAS,CAqBtC;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,GAAE,SAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAO3G"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mx-agent gh <args...>
|
|
3
|
+
*
|
|
4
|
+
* Runs /usr/bin/gh with an mx-bott `gh` token in the child's environment only
|
|
5
|
+
* (#440, v56). The work is in lib/gh-token-run.ts. This file wires the real
|
|
6
|
+
* mint, the real revoke, the real filesystem, the real spawn and the real
|
|
7
|
+
* signals.
|
|
8
|
+
*
|
|
9
|
+
* The mint is mintInstallationToken and the revoke is revokeInstallationToken
|
|
10
|
+
* (v59), both fixed here. No environment variable, flag
|
|
11
|
+
* or parameter selects another mint, gh binary, host, vault or secret.
|
|
12
|
+
*
|
|
13
|
+
* Not enabled anywhere by this command. Plain `gh` still uses the product
|
|
14
|
+
* owner's saved login. See docs/agent-github-identity-setup.md.
|
|
15
|
+
*/
|
|
16
|
+
import { execFileSync, spawn } from 'node:child_process';
|
|
17
|
+
import { accessSync, chmodSync, constants as fsConstants, mkdtempSync, rmSync, statSync } from 'node:fs';
|
|
18
|
+
import { tmpdir } from 'node:os';
|
|
19
|
+
import { join, resolve } from 'node:path';
|
|
20
|
+
import { mintInstallationToken, revokeInstallationToken } from '../lib/github-app-token.js';
|
|
21
|
+
import { FIXED_CHILD_ENV, runGhWithToken } from '../lib/gh-token-run.js';
|
|
22
|
+
/** Bound on `gh --version`, so a hung binary cannot stall the wrapper. */
|
|
23
|
+
export const GH_VERSION_TIMEOUT_MS = 10_000;
|
|
24
|
+
/** True when `path` is a regular file this user can execute. No PATH lookup. */
|
|
25
|
+
function isExecutableFile(path) {
|
|
26
|
+
try {
|
|
27
|
+
if (!statSync(path).isFile())
|
|
28
|
+
return false;
|
|
29
|
+
accessSync(path, fsConstants.X_OK);
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `gh --version`, run with no token and only the fixed child variables.
|
|
38
|
+
* HOME and GH_CONFIG_DIR are a new empty 0700 temp dir, removed afterwards,
|
|
39
|
+
* so no saved login is read and no fixed /tmp path is used (lead decision
|
|
40
|
+
* after the PR #705 gates). stderr is ignored.
|
|
41
|
+
*
|
|
42
|
+
* It runs in that temp dir (v71, #759 V69-4), not in the caller's working
|
|
43
|
+
* directory. The env sets no GIT_CEILING_DIRECTORIES: `gh --version` starts
|
|
44
|
+
* no git, so this call runs outside the ceiling.
|
|
45
|
+
*/
|
|
46
|
+
function readGhVersion(path) {
|
|
47
|
+
let dir;
|
|
48
|
+
try {
|
|
49
|
+
dir = makeTempDir();
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
return execFileSync(path, ['--version'], {
|
|
56
|
+
encoding: 'utf-8',
|
|
57
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
58
|
+
timeout: GH_VERSION_TIMEOUT_MS,
|
|
59
|
+
cwd: dir,
|
|
60
|
+
env: { ...FIXED_CHILD_ENV, HOME: dir, GH_CONFIG_DIR: dir },
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
removeTempDir(dir);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* An empty directory only this user can read, write or enter. Returned as an
|
|
72
|
+
* absolute path (v71, #759 V69-1): a relative `TMPDIR` would otherwise give gh
|
|
73
|
+
* a relative HOME, GH_CONFIG_DIR and cwd.
|
|
74
|
+
*/
|
|
75
|
+
function makeTempDir() {
|
|
76
|
+
const dir = mkdtempSync(join(tmpdir(), 'mx-agent-gh-'));
|
|
77
|
+
chmodSync(dir, 0o700);
|
|
78
|
+
return resolve(dir);
|
|
79
|
+
}
|
|
80
|
+
function removeTempDir(dir) {
|
|
81
|
+
try {
|
|
82
|
+
rmSync(dir, { recursive: true, force: true });
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// Nothing more can be done here; the directory held no token.
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Start gh by absolute path, no shell, stdio inherited, the given env only,
|
|
90
|
+
* in the given directory (v69, #763: the wrapper's temp dir).
|
|
91
|
+
*/
|
|
92
|
+
function spawnGh(path, args, env, cwd) {
|
|
93
|
+
const child = spawn(path, [...args], { env, cwd, stdio: 'inherit', shell: false });
|
|
94
|
+
const done = new Promise((resolve) => {
|
|
95
|
+
child.once('error', () => resolve({ code: null, signal: null, error: true }));
|
|
96
|
+
child.once('close', (code, signal) => resolve({ code, signal }));
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
done,
|
|
100
|
+
kill: (signal) => {
|
|
101
|
+
try {
|
|
102
|
+
child.kill(signal);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// already gone
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The gh arguments from the process argv. Only `mx-agent gh ...` with `gh` as
|
|
112
|
+
* the first argument is read. Any other shape returns no arguments, which the
|
|
113
|
+
* wrapper refuses with `no-command`.
|
|
114
|
+
*/
|
|
115
|
+
export function ghArgsFromArgv(argv) {
|
|
116
|
+
return argv[2] === 'gh' ? argv.slice(3) : [];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* True only for `mx-agent gh --help` or `mx-agent gh -h` with nothing else.
|
|
120
|
+
* The CLI then prints the wrapper's own help, mints nothing and runs no gh.
|
|
121
|
+
* Any other use of a help flag goes to the allowlist, which refuses it.
|
|
122
|
+
*/
|
|
123
|
+
export function isWrapperHelp(args) {
|
|
124
|
+
return args.length === 1 && (args[0] === '--help' || args[0] === '-h');
|
|
125
|
+
}
|
|
126
|
+
/** The dependencies the shipped command uses. Exported so a test can check the mint is the real one. */
|
|
127
|
+
export function realGhDeps() {
|
|
128
|
+
return {
|
|
129
|
+
mint: mintInstallationToken,
|
|
130
|
+
ghExists: isExecutableFile,
|
|
131
|
+
ghVersion: readGhVersion,
|
|
132
|
+
makeTempDir,
|
|
133
|
+
removeTempDir,
|
|
134
|
+
spawn: spawnGh,
|
|
135
|
+
onSignal: (signal, handler) => {
|
|
136
|
+
process.on(signal, handler);
|
|
137
|
+
return () => void process.off(signal, handler);
|
|
138
|
+
},
|
|
139
|
+
exit: (code) => process.exit(code),
|
|
140
|
+
parentEnv: () => process.env,
|
|
141
|
+
writeStderr: (text) => void process.stderr.write(text),
|
|
142
|
+
revoke: revokeInstallationToken,
|
|
143
|
+
setTimer: (ms, fn) => {
|
|
144
|
+
const t = setTimeout(fn, ms);
|
|
145
|
+
return () => clearTimeout(t);
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Run the wrapper and turn any unexpected error into exit 1 with one fixed
|
|
151
|
+
* stderr line. The error's own text is never printed.
|
|
152
|
+
*/
|
|
153
|
+
export async function runGhCommand(args, deps = realGhDeps()) {
|
|
154
|
+
try {
|
|
155
|
+
return await runGhWithToken(args, deps);
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
deps.writeStderr('mx-agent gh: internal-error\n');
|
|
159
|
+
return 1;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=gh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh.js","sourceRoot":"","sources":["../../src/commands/gh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,IAAI,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,cAAc,EAAgC,MAAM,wBAAwB,CAAC;AAEvG,0EAA0E;AAC1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE5C,gFAAgF;AAChF,SAAS,gBAAgB,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE;YAAE,OAAO,KAAK,CAAC;QAC3C,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,WAAW,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;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C;YAC5B,OAAO,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAClC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG;QAC5B,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;QACtD,MAAM,EAAE,uBAAuB;QAC/B,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;YACnB,MAAM,CAAC,GAAG,UAAU,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC7B,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAuB,EAAE,OAAkB,UAAU,EAAE;IACxF,IAAI,CAAC;QACH,OAAO,MAAM,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,CAAC;QAClD,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mx-agent git-credential <get|store|erase>
|
|
3
|
+
*
|
|
4
|
+
* A git credential helper that answers with an mx-bott `push` token for
|
|
5
|
+
* memnexus-ai/mx-agent-framework only (#440, v54). The work is in
|
|
6
|
+
* lib/git-credential.ts. This file wires the real mint and the real stdio.
|
|
7
|
+
*
|
|
8
|
+
* The mint is mintInstallationToken, fixed here. No environment variable, flag
|
|
9
|
+
* or parameter selects another mint, host, vault or secret.
|
|
10
|
+
*
|
|
11
|
+
* Not enabled anywhere by this command. See docs/agent-github-identity-setup.md.
|
|
12
|
+
*/
|
|
13
|
+
import { type GitCredentialDeps } from '../lib/git-credential.js';
|
|
14
|
+
/** The dependencies the shipped command uses. Exported so a test can check the mint is the real one. */
|
|
15
|
+
export declare function realGitCredentialDeps(): GitCredentialDeps;
|
|
16
|
+
/**
|
|
17
|
+
* Run the helper and turn any unexpected error into exit 1. stdout gets only
|
|
18
|
+
* `quit=1`, so git stops and asks no askpass program. stderr gets one fixed
|
|
19
|
+
* line; the error's own text is never printed.
|
|
20
|
+
*/
|
|
21
|
+
export declare function runGitCredentialCommand(operation: string, deps?: GitCredentialDeps): Promise<number>;
|
|
22
|
+
//# sourceMappingURL=git-credential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-credential.d.ts","sourceRoot":"","sources":["../../src/commands/git-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAqC,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAerG,wGAAwG;AACxG,wBAAgB,qBAAqB,IAAI,iBAAiB,CAQzD;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,iBAA2C,GAChD,OAAO,CAAC,MAAM,CAAC,CAQjB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mx-agent git-credential <get|store|erase>
|
|
3
|
+
*
|
|
4
|
+
* A git credential helper that answers with an mx-bott `push` token for
|
|
5
|
+
* memnexus-ai/mx-agent-framework only (#440, v54). The work is in
|
|
6
|
+
* lib/git-credential.ts. This file wires the real mint and the real stdio.
|
|
7
|
+
*
|
|
8
|
+
* The mint is mintInstallationToken, fixed here. No environment variable, flag
|
|
9
|
+
* or parameter selects another mint, host, vault or secret.
|
|
10
|
+
*
|
|
11
|
+
* Not enabled anywhere by this command. See docs/agent-github-identity-setup.md.
|
|
12
|
+
*/
|
|
13
|
+
import { mintInstallationToken } from '../lib/github-app-token.js';
|
|
14
|
+
import { MAX_INPUT_BYTES, runGitCredential } from '../lib/git-credential.js';
|
|
15
|
+
/** Read stdin to EOF, stopping once the bound is passed (the parser then refuses). */
|
|
16
|
+
async function readStdin() {
|
|
17
|
+
const chunks = [];
|
|
18
|
+
let total = 0;
|
|
19
|
+
for await (const chunk of process.stdin) {
|
|
20
|
+
const buf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk));
|
|
21
|
+
chunks.push(buf);
|
|
22
|
+
total += buf.length;
|
|
23
|
+
if (total > MAX_INPUT_BYTES)
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
return Buffer.concat(chunks).toString('utf-8');
|
|
27
|
+
}
|
|
28
|
+
/** The dependencies the shipped command uses. Exported so a test can check the mint is the real one. */
|
|
29
|
+
export function realGitCredentialDeps() {
|
|
30
|
+
return {
|
|
31
|
+
mint: mintInstallationToken,
|
|
32
|
+
stdinIsTerminal: () => process.stdin.isTTY === true,
|
|
33
|
+
readInput: readStdin,
|
|
34
|
+
writeStdout: (text) => void process.stdout.write(text),
|
|
35
|
+
writeStderr: (text) => void process.stderr.write(text),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Run the helper and turn any unexpected error into exit 1. stdout gets only
|
|
40
|
+
* `quit=1`, so git stops and asks no askpass program. stderr gets one fixed
|
|
41
|
+
* line; the error's own text is never printed.
|
|
42
|
+
*/
|
|
43
|
+
export async function runGitCredentialCommand(operation, deps = realGitCredentialDeps()) {
|
|
44
|
+
try {
|
|
45
|
+
return await runGitCredential(operation, deps);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
deps.writeStdout('quit=1\n');
|
|
49
|
+
deps.writeStderr('mx-agent git-credential: internal-error\n');
|
|
50
|
+
return 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=git-credential.js.map
|
|
@@ -0,0 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ED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,SAAiB,EACjB,OAA0B,qBAAqB,EAAE;IAEjD,IAAI,CAAC;QACH,OAAO,MAAM,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7B,IAAI,CAAC,WAAW,CAAC,2CAA2C,CAAC,CAAC;QAC9D,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAgBH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA2BD,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAmIjE"}
|
package/dist/commands/init.js
CHANGED
|
@@ -27,6 +27,7 @@ import { basename, join } from 'path';
|
|
|
27
27
|
import chalk from 'chalk';
|
|
28
28
|
import { findProjectRoot } from '../lib/worktree.js';
|
|
29
29
|
import { recordProjectQuietly } from '../lib/projects-registry.js';
|
|
30
|
+
import { requireCreationLogin } from '../lib/creation-login.js';
|
|
30
31
|
import { SETTINGS_JSON_TEMPLATE, WORKTREE_GUARD_SH_TEMPLATE, CLAUDE_MD_TEMPLATE } from '../lib/templates.js';
|
|
31
32
|
import { runBootstrap } from './bootstrap.js';
|
|
32
33
|
import { validateCoordinationServiceUrl, validateProjectConfig, } from '../lib/project-config.js';
|
|
@@ -78,6 +79,12 @@ export async function runInit(options) {
|
|
|
78
79
|
const coordinationServiceUrl = options.coordinationServiceUrl
|
|
79
80
|
? validateCoordinationServiceUrl(options.coordinationServiceUrl)
|
|
80
81
|
: '';
|
|
82
|
+
// Before the first write (#818). Skipped under `skipBootstrap`: a scaffold with
|
|
83
|
+
// no team reaches none of rows 3, 4, 5 or 10, and the one caller that sets it,
|
|
84
|
+
// `runNew`, has already checked. `new project --with-remote` with no name reaches
|
|
85
|
+
// this function, which creates no remote, so `gh` is not asked about.
|
|
86
|
+
if (!options.skipBootstrap)
|
|
87
|
+
requireCreationLogin({ withRemote: false });
|
|
81
88
|
console.log();
|
|
82
89
|
console.log(chalk.cyan.bold('Initialising mx-agent'));
|
|
83
90
|
console.log(chalk.dim('─'.repeat(50)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAA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AK,MAAM,SAAS,IAAI,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC;gBAClD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;gBAC5D,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;oBAAE,SAAS;gBACrC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;gBAC3C,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBACxC,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC3E,KAAK,EAAE,CAAC;YACV,CAAC;YACD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;gBACd,UAAU,CAAC,oBAAoB,KAAK,mBAAmB,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/commands/new.d.ts
CHANGED
|
@@ -65,6 +65,30 @@ export interface NewOptions {
|
|
|
65
65
|
* so a response body cannot select or forge any branch.
|
|
66
66
|
*/
|
|
67
67
|
export declare function credentialFailureStep(failure: string): string[] | null;
|
|
68
|
+
/**
|
|
69
|
+
* The failure text step 7b stores when provisioning the first team throws (#631).
|
|
70
|
+
*
|
|
71
|
+
* Never empty, and never throws. Step 9 used to test the stored message for
|
|
72
|
+
* truthiness, so a throw whose message was empty read as a success: "Project
|
|
73
|
+
* created!", the team-builder footer, exit 0, and step 7c committing a catalog
|
|
74
|
+
* entry for a team that did not provision. Step 9 now tests for null, and this
|
|
75
|
+
* function makes sure the string it tests is never empty either.
|
|
76
|
+
*
|
|
77
|
+
* A non-empty message passes through unchanged. Anything else gets a fixed
|
|
78
|
+
* fallback naming the error's kind: `err.name` for an Error, `typeof` for any
|
|
79
|
+
* other value. A thrown `null`, `undefined` or symbol carries no message, so
|
|
80
|
+
* `String()` turning them into the non-empty words "null", "undefined" and
|
|
81
|
+
* "Symbol()" does not count as one. The fallback matches neither
|
|
82
|
+
* `credentialFailureStep` nor `isCatalogPreconditionRefusal`, so both take
|
|
83
|
+
* their default path.
|
|
84
|
+
*
|
|
85
|
+
* Each read is inside its own try: a thrown value can be hostile, with a
|
|
86
|
+
* throwing getter, a Proxy trap, or `Object.create(null)`, which `String()`
|
|
87
|
+
* refuses. The kind reaches the terminal, so it keeps only `[A-Za-z0-9_.-]`
|
|
88
|
+
* and at most 40 characters. `.trim()` does not strip zero-width characters
|
|
89
|
+
* such as U+200B, so a message made only of those prints as itself.
|
|
90
|
+
*/
|
|
91
|
+
export declare function provisionFailureMessage(err: unknown): string;
|
|
68
92
|
/**
|
|
69
93
|
* The numbered lines under "Next steps:" at step 9 (#613 item 1).
|
|
70
94
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAiBH,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAiBH,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAmB/E,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,2FAA2F;IAC3F,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAmCtE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAmB5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,EAAE,CAarF;AAyBD,wBAAsB,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA8XpF"}
|
package/dist/commands/new.js
CHANGED
|
@@ -36,6 +36,7 @@ import { runCreate, isCatalogPreconditionRefusal, SELF_SERVICE_REFUSED_DETAIL }
|
|
|
36
36
|
import { shellSingleQuote } from '../lib/memory.js';
|
|
37
37
|
import { PROJECT_CONFIG_DEFAULTS, validateCoordinationServiceUrl, validateProjectConfig, } from '../lib/project-config.js';
|
|
38
38
|
import { maybeCreateRemote } from '../lib/gh-remote.js';
|
|
39
|
+
import { requireCreationLogin } from '../lib/creation-login.js';
|
|
39
40
|
import { CREDENTIAL_LIMIT_REACHED_DETAIL, CREDENTIAL_NO_USER_KEY_DETAIL, CREDENTIAL_NOT_AUTHORIZED_DETAIL, } from '../lib/coordination-token.js';
|
|
40
41
|
import { findTeamWorktree } from '../lib/worktree.js';
|
|
41
42
|
import { TEAM_BUILDER_ROLEGUIDE, newProjectDockerfileTemplate, newProjectDevcontainerJsonTemplate, newProjectPostCreateShTemplate, newProjectPostStartShTemplate, newProjectGitignoreTemplate, newProjectMxAgentCliVersionPinTemplate, } from '../lib/templates.js';
|
|
@@ -102,6 +103,53 @@ export function credentialFailureStep(failure) {
|
|
|
102
103
|
}
|
|
103
104
|
return null;
|
|
104
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* The failure text step 7b stores when provisioning the first team throws (#631).
|
|
108
|
+
*
|
|
109
|
+
* Never empty, and never throws. Step 9 used to test the stored message for
|
|
110
|
+
* truthiness, so a throw whose message was empty read as a success: "Project
|
|
111
|
+
* created!", the team-builder footer, exit 0, and step 7c committing a catalog
|
|
112
|
+
* entry for a team that did not provision. Step 9 now tests for null, and this
|
|
113
|
+
* function makes sure the string it tests is never empty either.
|
|
114
|
+
*
|
|
115
|
+
* A non-empty message passes through unchanged. Anything else gets a fixed
|
|
116
|
+
* fallback naming the error's kind: `err.name` for an Error, `typeof` for any
|
|
117
|
+
* other value. A thrown `null`, `undefined` or symbol carries no message, so
|
|
118
|
+
* `String()` turning them into the non-empty words "null", "undefined" and
|
|
119
|
+
* "Symbol()" does not count as one. The fallback matches neither
|
|
120
|
+
* `credentialFailureStep` nor `isCatalogPreconditionRefusal`, so both take
|
|
121
|
+
* their default path.
|
|
122
|
+
*
|
|
123
|
+
* Each read is inside its own try: a thrown value can be hostile, with a
|
|
124
|
+
* throwing getter, a Proxy trap, or `Object.create(null)`, which `String()`
|
|
125
|
+
* refuses. The kind reaches the terminal, so it keeps only `[A-Za-z0-9_.-]`
|
|
126
|
+
* and at most 40 characters. `.trim()` does not strip zero-width characters
|
|
127
|
+
* such as U+200B, so a message made only of those prints as itself.
|
|
128
|
+
*/
|
|
129
|
+
export function provisionFailureMessage(err) {
|
|
130
|
+
let msg = '';
|
|
131
|
+
let kind = 'unknown';
|
|
132
|
+
try {
|
|
133
|
+
const raw = err instanceof Error
|
|
134
|
+
? err.message
|
|
135
|
+
: err === null || err === undefined || typeof err === 'symbol' ? '' : String(err);
|
|
136
|
+
if (typeof raw === 'string')
|
|
137
|
+
msg = raw;
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
// A hostile thrown value. The fallback below covers it.
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
const n = err instanceof Error ? err.name : err === null ? 'null' : typeof err;
|
|
144
|
+
if (typeof n === 'string')
|
|
145
|
+
kind = n;
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
// A hostile thrown value. `kind` stays 'unknown'.
|
|
149
|
+
}
|
|
150
|
+
kind = kind.replace(/[^A-Za-z0-9_.-]/g, '').slice(0, 40) || 'unknown';
|
|
151
|
+
return msg.trim() !== '' ? msg : `first-team provisioning failed with no message (${kind})`;
|
|
152
|
+
}
|
|
105
153
|
/**
|
|
106
154
|
* The numbered lines under "Next steps:" at step 9 (#613 item 1).
|
|
107
155
|
*
|
|
@@ -177,6 +225,9 @@ export async function runNew(projectName, options) {
|
|
|
177
225
|
process.exit(1);
|
|
178
226
|
}
|
|
179
227
|
}
|
|
228
|
+
// After the checks above, so a bad name is reported as a bad name, and before
|
|
229
|
+
// `mkdirSync` below, so a missing login leaves nothing to clean up (#818).
|
|
230
|
+
requireCreationLogin({ withRemote: options.withRemote === true });
|
|
180
231
|
console.log();
|
|
181
232
|
console.log(chalk.cyan.bold('Creating new mx-agent project'));
|
|
182
233
|
console.log(chalk.dim('─'.repeat(50)));
|
|
@@ -330,7 +381,7 @@ export async function runNew(projectName, options) {
|
|
|
330
381
|
console.log(chalk.green(' ✓ team-builder provisioned'));
|
|
331
382
|
}
|
|
332
383
|
catch (err) {
|
|
333
|
-
provisionFailure =
|
|
384
|
+
provisionFailure = provisionFailureMessage(err);
|
|
334
385
|
console.log(chalk.yellow(` ⚠ Could not provision team-builder: ${provisionFailure}`));
|
|
335
386
|
// The SAME command, which is now a resume rather than a refusal (#5, #316).
|
|
336
387
|
// It used to print an instruction that met `Worktree already exists` and
|
|
@@ -353,7 +404,7 @@ export async function runNew(projectName, options) {
|
|
|
353
404
|
// remotes, provisioning's own step 8 now commits the entry and fast-forwards
|
|
354
405
|
// the team worktree to that commit, so there is nothing left here to commit.
|
|
355
406
|
// This step still runs when step 8 fell back to an uncommitted entry.
|
|
356
|
-
if (
|
|
407
|
+
if (provisionFailure === null) {
|
|
357
408
|
const catalogEntryRel = join(PROJECT_CONFIG_DEFAULTS.teamsDir, 'team-builder.md');
|
|
358
409
|
const tracked = spawnSync('git', ['ls-files', '--error-unmatch', '--', catalogEntryRel], {
|
|
359
410
|
cwd: outputDir, stdio: 'pipe',
|
|
@@ -366,7 +417,8 @@ export async function runNew(projectName, options) {
|
|
|
366
417
|
}
|
|
367
418
|
}
|
|
368
419
|
// 7d. Optional GitHub remote auto-setup (opt-in via --with-remote).
|
|
369
|
-
//
|
|
420
|
+
// A missing gh login refused before the first write above (#818). What can still
|
|
421
|
+
// fail here fails open: any gh-related failure downgrades to a warning.
|
|
370
422
|
//
|
|
371
423
|
// AFTER provisioning and its commit above, so the first push carries the
|
|
372
424
|
// team-builder catalog entry and the next `provision` in this project finds
|
|
@@ -391,9 +443,15 @@ export async function runNew(projectName, options) {
|
|
|
391
443
|
else if (remoteResult.reason === 'gh-missing') {
|
|
392
444
|
console.log(chalk.yellow(' ⚠ gh not found; skipping remote setup'));
|
|
393
445
|
}
|
|
446
|
+
else if (remoteResult.reason === 'gh-version-failed') {
|
|
447
|
+
console.log(chalk.yellow(' ⚠ gh --version failed; skipping remote setup'));
|
|
448
|
+
}
|
|
394
449
|
else if (remoteResult.reason === 'gh-unauthenticated') {
|
|
395
450
|
console.log(chalk.yellow(' ⚠ gh not authenticated (run: gh auth login); skipping remote setup'));
|
|
396
451
|
}
|
|
452
|
+
else if (remoteResult.reason === 'gh-timed-out') {
|
|
453
|
+
console.log(chalk.yellow(' ⚠ the check of gh timed out; skipping remote setup'));
|
|
454
|
+
}
|
|
397
455
|
else if (remoteResult.reason === 'gh-failed') {
|
|
398
456
|
console.log(chalk.yellow(' ⚠ gh repo create failed; skipping remote setup'));
|
|
399
457
|
if (remoteResult.stderr) {
|
|
@@ -409,7 +467,11 @@ export async function runNew(projectName, options) {
|
|
|
409
467
|
// this whole iteration exists to remove (#48). The project stays on disk, because
|
|
410
468
|
// everything else about it is usable and deleting it would destroy work; what
|
|
411
469
|
// changes is that the summary says so and the exit code carries it.
|
|
412
|
-
|
|
470
|
+
//
|
|
471
|
+
// NULL, NOT TRUTHINESS (#631), here and at the three other reads of
|
|
472
|
+
// `provisionFailure`. Null means provisioning returned; any string means it
|
|
473
|
+
// threw. A truthiness test read an empty message as a success.
|
|
474
|
+
if (provisionFailure !== null) {
|
|
413
475
|
console.log();
|
|
414
476
|
console.error(chalk.red.bold('Project created, but its first team did NOT provision.'));
|
|
415
477
|
console.error(chalk.dim('─'.repeat(50)));
|
|
@@ -457,7 +519,7 @@ export async function runNew(projectName, options) {
|
|
|
457
519
|
process.exitCode = 1;
|
|
458
520
|
}
|
|
459
521
|
console.log();
|
|
460
|
-
console.log(provisionFailure ? chalk.yellow.bold('Project created (incomplete).') : chalk.green.bold('Project created!'));
|
|
522
|
+
console.log(provisionFailure !== null ? chalk.yellow.bold('Project created (incomplete).') : chalk.green.bold('Project created!'));
|
|
461
523
|
console.log(chalk.dim('─'.repeat(50)));
|
|
462
524
|
if (configSyncResult.status === 0) {
|
|
463
525
|
console.log(chalk.green(' ✓ Full agent configuration deployed'));
|
|
@@ -465,7 +527,7 @@ export async function runNew(projectName, options) {
|
|
|
465
527
|
console.log(chalk.green(' ✓ Coordination queue pre-configured'));
|
|
466
528
|
console.log();
|
|
467
529
|
console.log(chalk.bold(' Next steps:'));
|
|
468
|
-
for (const line of nextStepLines(projectName, provisionFailure ? null : 'team-builder'))
|
|
530
|
+
for (const line of nextStepLines(projectName, provisionFailure !== null ? null : 'team-builder'))
|
|
469
531
|
console.log(line);
|
|
470
532
|
console.log();
|
|
471
533
|
console.log(chalk.dim(' Or open in VS Code and use Dev Containers: Reopen in Container,'));
|