@memnexus-ai/mx-agent-cli 0.1.297 → 0.1.298

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/agent-config/hooks/gh-pr-edit-guard.sh +21 -9
  2. package/dist/agent-config/settings.json +7 -1
  3. package/dist/commands/check.d.ts +20 -0
  4. package/dist/commands/check.d.ts.map +1 -0
  5. package/dist/commands/check.js +30 -0
  6. package/dist/commands/check.js.map +1 -0
  7. package/dist/commands/gh.d.ts +38 -0
  8. package/dist/commands/gh.d.ts.map +1 -0
  9. package/dist/commands/gh.js +162 -0
  10. package/dist/commands/gh.js.map +1 -0
  11. package/dist/commands/git-credential.d.ts +22 -0
  12. package/dist/commands/git-credential.d.ts.map +1 -0
  13. package/dist/commands/git-credential.js +53 -0
  14. package/dist/commands/git-credential.js.map +1 -0
  15. package/dist/commands/new.d.ts +24 -0
  16. package/dist/commands/new.d.ts.map +1 -1
  17. package/dist/commands/new.js +56 -5
  18. package/dist/commands/new.js.map +1 -1
  19. package/dist/commands/pr-set-body.d.ts +120 -35
  20. package/dist/commands/pr-set-body.d.ts.map +1 -1
  21. package/dist/commands/pr-set-body.js +343 -108
  22. package/dist/commands/pr-set-body.js.map +1 -1
  23. package/dist/commands/pr-sync.d.ts +2 -1
  24. package/dist/commands/pr-sync.d.ts.map +1 -1
  25. package/dist/commands/pr-sync.js +129 -32
  26. package/dist/commands/pr-sync.js.map +1 -1
  27. package/dist/index.d.ts +3 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +82 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/lib/check-run.d.ts +131 -0
  32. package/dist/lib/check-run.d.ts.map +1 -0
  33. package/dist/lib/check-run.js +291 -0
  34. package/dist/lib/check-run.js.map +1 -0
  35. package/dist/lib/coordination-token.d.ts +33 -1
  36. package/dist/lib/coordination-token.d.ts.map +1 -1
  37. package/dist/lib/coordination-token.js +138 -9
  38. package/dist/lib/coordination-token.js.map +1 -1
  39. package/dist/lib/gh-remote.d.ts +20 -0
  40. package/dist/lib/gh-remote.d.ts.map +1 -1
  41. package/dist/lib/gh-remote.js +26 -0
  42. package/dist/lib/gh-remote.js.map +1 -1
  43. package/dist/lib/gh-token-run.d.ts +551 -0
  44. package/dist/lib/gh-token-run.d.ts.map +1 -0
  45. package/dist/lib/gh-token-run.js +1246 -0
  46. package/dist/lib/gh-token-run.js.map +1 -0
  47. package/dist/lib/git-credential.d.ts +120 -0
  48. package/dist/lib/git-credential.d.ts.map +1 -0
  49. package/dist/lib/git-credential.js +204 -0
  50. package/dist/lib/git-credential.js.map +1 -0
  51. package/dist/lib/github-app-token.d.ts +288 -0
  52. package/dist/lib/github-app-token.d.ts.map +1 -0
  53. package/dist/lib/github-app-token.js +519 -0
  54. package/dist/lib/github-app-token.js.map +1 -0
  55. package/dist/lib/memory.d.ts.map +1 -1
  56. package/dist/lib/memory.js +35 -2
  57. package/dist/lib/memory.js.map +1 -1
  58. package/dist/lib/repo-guard-state-dirs.d.ts +39 -0
  59. package/dist/lib/repo-guard-state-dirs.d.ts.map +1 -0
  60. package/dist/lib/repo-guard-state-dirs.js +170 -0
  61. package/dist/lib/repo-guard-state-dirs.js.map +1 -0
  62. package/package.json +1 -1
@@ -293,20 +293,32 @@ refuse() {
293
293
  echo "BLOCKED: gh pr edit ($flags)"
294
294
  echo " Command: $safe_cmd"
295
295
  echo ""
296
- echo "WHY: our gh is 2.46.0, where every \`gh pr edit\` aborts in a prefetch that"
296
+ echo "WHY: This block applies on every gh version."
297
+ echo "On gh older than 2.73.0, every \`gh pr edit\` aborts in a prefetch that"
297
298
  echo "asks for deprecated Projects-classic data. It NEVER SENDS THE MUTATION, exits"
298
- echo "1, and prints only a GraphQL deprecation notice — so it looks like an unrelated"
299
- echo "warning while your edit silently does not happen. Fixed upstream in gh 2.73.0;"
300
- echo "Debian trixie has no such package. Measured for --body, --body-file, --title,"
301
- echo "--add-label, --remove-label, --add-assignee and --milestone alike."
299
+ echo "1, and prints only a GraphQL deprecation notice, so it looks like an unrelated"
300
+ echo "warning while your edit silently does not happen. Measured on gh 2.46.0 for"
301
+ echo "--body, --body-file, --title, --add-label, --remove-label, --add-assignee and"
302
+ echo "--milestone alike. Fixed upstream in gh 2.73.0."
303
+ echo ".devcontainer/Dockerfile pins gh 2.97.0, but Debian's 2.46.0 may remain in a"
304
+ echo "devcontainer that was not rebuilt since the pin. This block is kept as policy"
305
+ echo "even at the pinned 2.97.0. Separately, the mx-agent gh wrapper below refuses"
306
+ echo "pr edit on any gh older than 2.97.0, its own minimum."
302
307
  echo ""
303
308
  echo "USE INSTEAD:"
304
309
  echo " replace a PR body mx-agent pr set-body <pr> --body-file <file>"
305
- echo " (PATCHes via the REST API, then verifies the stored body"
306
- echo " twice and exits non-zero if it did not land)"
310
+ echo " (writes through mx-agent gh pr edit --body-file as mx-bott,"
311
+ echo " then reads the body back and exits non-zero if the write"
312
+ echo " did not land; needs an az login)"
307
313
  echo " append to a PR gh pr comment <pr> --body-file <file>"
308
- echo " title / other fields gh api -X PATCH repos/{owner}/{repo}/pulls/<pr> -f title=..."
309
- echo " labels gh api -X POST repos/{owner}/{repo}/issues/<pr>/labels -f 'labels[]=...'"
314
+ echo " change the title mx-agent gh pr edit <pr> --title \"...\""
315
+ echo " (accepted by the mx-agent gh allowlist; needs gh 2.97.0"
316
+ echo " and an az login; not yet run live, only the body edit has)"
317
+ echo " labels none measured working:"
318
+ echo " gh api -X POST repos/{owner}/{repo}/issues/<pr>/labels -f 'labels[]=...'"
319
+ echo " is refused by mx-agent gh and the subagent write guard;"
320
+ echo " mx-agent gh pr edit <pr> --add-label is allowlisted but"
321
+ echo " not measured under mx-bott (#770)"
310
322
  echo ""
311
323
  echo "gh pr create, gh pr comment, gh pr view and gh issue edit are all unaffected."
312
324
  echo ""
@@ -225,7 +225,13 @@
225
225
  "Edit(.claude/settings.json)",
226
226
  "Edit(.claude/hooks/**)",
227
227
  "Edit(.claude.staging-*/**)",
228
- "Edit(.claude.prev-*/**)"
228
+ "Edit(.claude.prev-*/**)",
229
+ "Read(~/.claude/.credentials.json)",
230
+ "Read(~/.config/gh/**)",
231
+ "Read(~/.ssh/**)",
232
+ "Read(~/.mx-agent/config.json)",
233
+ "Read(~/.npmrc)",
234
+ "Read(~/.azure/**)"
229
235
  ],
230
236
  "ask": [
231
237
  "Bash(sudo *)",
@@ -0,0 +1,20 @@
1
+ /**
2
+ * mx-agent check post --name <check> --sha <40-hex> --conclusion <c>
3
+ * --summary-file <path> [--verdict-comment <id>]
4
+ *
5
+ * Posts one of the four gate check runs on a commit as mx-bott (#440, v51).
6
+ * The work is in lib/check-run.ts and lib/github-app-token.ts. This prints the
7
+ * check run id and URL on success and nothing else; no token is ever printed.
8
+ *
9
+ * The line is printed from onPosted, before the check-write token's revoke
10
+ * starts (red-team Should Fix 1 on PR #719), so a check run that exists is
11
+ * confirmed even if the revoke hangs. The command still waits for the revoke
12
+ * before it returns.
13
+ *
14
+ * A 201 whose body is not received within BODY_TIMEOUT_MS prints
15
+ * `Posted check run <name> (<conclusion>) on <sha>: id unreadable` and exits 0
16
+ * (#440 v61): the check run exists, and a retry would post a duplicate.
17
+ */
18
+ import { type CheckRunDeps, type PostCheckRunOptions } from '../lib/check-run.js';
19
+ export declare function runCheckPost(opts: PostCheckRunOptions, deps?: Partial<CheckRunDeps>): Promise<void>;
20
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEhG,wBAAsB,YAAY,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,GAAE,OAAO,CAAC,YAAY,CAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU7G"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * mx-agent check post --name <check> --sha <40-hex> --conclusion <c>
3
+ * --summary-file <path> [--verdict-comment <id>]
4
+ *
5
+ * Posts one of the four gate check runs on a commit as mx-bott (#440, v51).
6
+ * The work is in lib/check-run.ts and lib/github-app-token.ts. This prints the
7
+ * check run id and URL on success and nothing else; no token is ever printed.
8
+ *
9
+ * The line is printed from onPosted, before the check-write token's revoke
10
+ * starts (red-team Should Fix 1 on PR #719), so a check run that exists is
11
+ * confirmed even if the revoke hangs. The command still waits for the revoke
12
+ * before it returns.
13
+ *
14
+ * A 201 whose body is not received within BODY_TIMEOUT_MS prints
15
+ * `Posted check run <name> (<conclusion>) on <sha>: id unreadable` and exits 0
16
+ * (#440 v61): the check run exists, and a retry would post a duplicate.
17
+ */
18
+ import { postCheckRun } from '../lib/check-run.js';
19
+ export async function runCheckPost(opts, deps = {}) {
20
+ await postCheckRun(opts, {
21
+ ...deps,
22
+ onPosted: (posted) => {
23
+ // id null: 201 received, body not received in time (#440 v61). The check
24
+ // run exists; the caller checks the commit's checks instead of retrying.
25
+ const what = posted.id === null ? 'id unreadable' : `id ${posted.id} ${posted.htmlUrl}`;
26
+ process.stdout.write(`Posted check run ${opts.name} (${opts.conclusion}) on ${opts.sha}: ${what}\n`);
27
+ },
28
+ });
29
+ }
30
+ //# sourceMappingURL=check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,YAAY,EAA+C,MAAM,qBAAqB,CAAC;AAEhG,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAyB,EAAE,OAA8B,EAAE;IAC5F,MAAM,YAAY,CAAC,IAAI,EAAE;QACvB,GAAG,IAAI;QACP,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;YACnB,yEAAyE;YACzE,yEAAyE;YACzE,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACxF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,UAAU,QAAQ,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC;QACvG,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -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,CAA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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 +1 @@
1
+ {"version":3,"file":"git-credential.js","sourceRoot":"","sources":["../../src/commands/git-credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAA0B,MAAM,0BAA0B,CAAC;AAErG,sFAAsF;AACtF,KAAK,UAAU,SAAS;IACtB,MAAM,MAAM,GAA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,CAAC;QAC9D,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
@@ -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;AAkB/E,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,sBAAsB,CAAC,EAAE,MAAM,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AG,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,CAqXpF"}
@@ -102,6 +102,53 @@ export function credentialFailureStep(failure) {
102
102
  }
103
103
  return null;
104
104
  }
105
+ /**
106
+ * The failure text step 7b stores when provisioning the first team throws (#631).
107
+ *
108
+ * Never empty, and never throws. Step 9 used to test the stored message for
109
+ * truthiness, so a throw whose message was empty read as a success: "Project
110
+ * created!", the team-builder footer, exit 0, and step 7c committing a catalog
111
+ * entry for a team that did not provision. Step 9 now tests for null, and this
112
+ * function makes sure the string it tests is never empty either.
113
+ *
114
+ * A non-empty message passes through unchanged. Anything else gets a fixed
115
+ * fallback naming the error's kind: `err.name` for an Error, `typeof` for any
116
+ * other value. A thrown `null`, `undefined` or symbol carries no message, so
117
+ * `String()` turning them into the non-empty words "null", "undefined" and
118
+ * "Symbol()" does not count as one. The fallback matches neither
119
+ * `credentialFailureStep` nor `isCatalogPreconditionRefusal`, so both take
120
+ * their default path.
121
+ *
122
+ * Each read is inside its own try: a thrown value can be hostile, with a
123
+ * throwing getter, a Proxy trap, or `Object.create(null)`, which `String()`
124
+ * refuses. The kind reaches the terminal, so it keeps only `[A-Za-z0-9_.-]`
125
+ * and at most 40 characters. `.trim()` does not strip zero-width characters
126
+ * such as U+200B, so a message made only of those prints as itself.
127
+ */
128
+ export function provisionFailureMessage(err) {
129
+ let msg = '';
130
+ let kind = 'unknown';
131
+ try {
132
+ const raw = err instanceof Error
133
+ ? err.message
134
+ : err === null || err === undefined || typeof err === 'symbol' ? '' : String(err);
135
+ if (typeof raw === 'string')
136
+ msg = raw;
137
+ }
138
+ catch {
139
+ // A hostile thrown value. The fallback below covers it.
140
+ }
141
+ try {
142
+ const n = err instanceof Error ? err.name : err === null ? 'null' : typeof err;
143
+ if (typeof n === 'string')
144
+ kind = n;
145
+ }
146
+ catch {
147
+ // A hostile thrown value. `kind` stays 'unknown'.
148
+ }
149
+ kind = kind.replace(/[^A-Za-z0-9_.-]/g, '').slice(0, 40) || 'unknown';
150
+ return msg.trim() !== '' ? msg : `first-team provisioning failed with no message (${kind})`;
151
+ }
105
152
  /**
106
153
  * The numbered lines under "Next steps:" at step 9 (#613 item 1).
107
154
  *
@@ -330,7 +377,7 @@ export async function runNew(projectName, options) {
330
377
  console.log(chalk.green(' ✓ team-builder provisioned'));
331
378
  }
332
379
  catch (err) {
333
- provisionFailure = err instanceof Error ? err.message : String(err);
380
+ provisionFailure = provisionFailureMessage(err);
334
381
  console.log(chalk.yellow(` ⚠ Could not provision team-builder: ${provisionFailure}`));
335
382
  // The SAME command, which is now a resume rather than a refusal (#5, #316).
336
383
  // It used to print an instruction that met `Worktree already exists` and
@@ -353,7 +400,7 @@ export async function runNew(projectName, options) {
353
400
  // remotes, provisioning's own step 8 now commits the entry and fast-forwards
354
401
  // the team worktree to that commit, so there is nothing left here to commit.
355
402
  // This step still runs when step 8 fell back to an uncommitted entry.
356
- if (!provisionFailure) {
403
+ if (provisionFailure === null) {
357
404
  const catalogEntryRel = join(PROJECT_CONFIG_DEFAULTS.teamsDir, 'team-builder.md');
358
405
  const tracked = spawnSync('git', ['ls-files', '--error-unmatch', '--', catalogEntryRel], {
359
406
  cwd: outputDir, stdio: 'pipe',
@@ -409,7 +456,11 @@ export async function runNew(projectName, options) {
409
456
  // this whole iteration exists to remove (#48). The project stays on disk, because
410
457
  // everything else about it is usable and deleting it would destroy work; what
411
458
  // changes is that the summary says so and the exit code carries it.
412
- if (provisionFailure) {
459
+ //
460
+ // NULL, NOT TRUTHINESS (#631), here and at the three other reads of
461
+ // `provisionFailure`. Null means provisioning returned; any string means it
462
+ // threw. A truthiness test read an empty message as a success.
463
+ if (provisionFailure !== null) {
413
464
  console.log();
414
465
  console.error(chalk.red.bold('Project created, but its first team did NOT provision.'));
415
466
  console.error(chalk.dim('─'.repeat(50)));
@@ -457,7 +508,7 @@ export async function runNew(projectName, options) {
457
508
  process.exitCode = 1;
458
509
  }
459
510
  console.log();
460
- console.log(provisionFailure ? chalk.yellow.bold('Project created (incomplete).') : chalk.green.bold('Project created!'));
511
+ console.log(provisionFailure !== null ? chalk.yellow.bold('Project created (incomplete).') : chalk.green.bold('Project created!'));
461
512
  console.log(chalk.dim('─'.repeat(50)));
462
513
  if (configSyncResult.status === 0) {
463
514
  console.log(chalk.green(' ✓ Full agent configuration deployed'));
@@ -465,7 +516,7 @@ export async function runNew(projectName, options) {
465
516
  console.log(chalk.green(' ✓ Coordination queue pre-configured'));
466
517
  console.log();
467
518
  console.log(chalk.bold(' Next steps:'));
468
- for (const line of nextStepLines(projectName, provisionFailure ? null : 'team-builder'))
519
+ for (const line of nextStepLines(projectName, provisionFailure !== null ? null : 'team-builder'))
469
520
  console.log(line);
470
521
  console.log();
471
522
  console.log(chalk.dim(' Or open in VS Code and use Dev Containers: Reopen in Container,'));