@imdeadpool/guardex 8.4.15 → 8.4.17
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/CONTRIBUTING.md +2 -33
- package/README.md +7 -174
- package/SECURITY.md +1 -1
- package/package.json +6 -39
- package/scripts/prepublish-bump-version.js +11 -1
- package/src/agents/start.js +1 -1
- package/src/cli/commands/branch.js +7 -7
- package/src/cli/commands/claude.js +6 -13
- package/src/cli/commands/pr.js +2 -2
- package/src/cli/commands/release.js +7 -1
- package/src/cli/commands/review.js +2 -2
- package/src/cli/commands/worktree-copy-ignored.js +1 -1
- package/src/cli/commands/worktree-estimate.js +2 -2
- package/src/cli/commands/worktree-hooks.js +1 -1
- package/src/cli/commands/worktree-navigation.js +3 -3
- package/src/cli/shared-locks.js +1 -1
- package/src/context.js +8 -1
- package/src/finish/index.js +1 -1
- package/src/finish/post-branch-finish-cleanup.js +2 -2
- package/src/finish/review-gate.js +3 -3
- package/src/finish/review-receipt.js +9 -5
- package/src/{github-api.js → github/api.js} +2 -2
- package/src/mcp/collect.js +2 -2
- package/src/pr-review.js +2 -1178
- package/src/pr-value.js +2 -111
- package/src/provider-binary.js +2 -122
- package/src/{pr.js → pull-request/index.js} +5 -5
- package/src/{pr-lens-publish.js → pull-request/lens-publish.js} +2 -2
- package/src/{pr-lens.js → pull-request/lens.js} +2 -2
- package/src/{pr-respond.js → pull-request/respond.js} +8 -8
- package/src/pull-request/value.js +111 -0
- package/src/review/bug-hunter.js +75 -0
- package/src/{review-fix.js → review/fix.js} +2 -2
- package/src/review/provider-binary.js +122 -0
- package/src/review/pull-request.js +1217 -0
- package/src/{worktree-copy-ignored.js → worktree/copy-ignored.js} +3 -3
- package/src/{worktree-hook-worker.js → worktree/hook-worker.js} +1 -1
- package/src/{worktree-hooks.js → worktree/hooks.js} +5 -5
- package/src/{worktree-navigation.js → worktree/navigation.js} +2 -2
- package/src/{worktree-picker.js → worktree/picker.js} +1 -1
- package/src/{worktree-quota.js → worktree/quota.js} +1 -1
- package/src/{worktree-start.js → worktree/start.js} +4 -4
- package/src/{worktree-tasks.js → worktree/tasks.js} +6 -6
- /package/src/{shared-git-state.js → git/shared-state.js} +0 -0
- /package/src/{pr-checks.js → pull-request/checks.js} +0 -0
- /package/src/{review-diff-context.js → review/diff-context.js} +0 -0
- /package/src/{review-diff.js → review/diff.js} +0 -0
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
const fs = require('node:fs');
|
|
6
6
|
const path = require('node:path');
|
|
7
7
|
const { execFileSync } = require('node:child_process');
|
|
8
|
-
const { applyCopy } = require('
|
|
9
|
-
const sharedGitState = require('
|
|
8
|
+
const { applyCopy } = require('../scaffold/provision-config');
|
|
9
|
+
const sharedGitState = require('../git/shared-state');
|
|
10
10
|
|
|
11
11
|
function git(root, args) {
|
|
12
12
|
return execFileSync('git', ['-C', root, ...args], {
|
|
@@ -170,7 +170,7 @@ function copyIgnoredFiles(sourceDirectory, targetDirectory, options = {}) {
|
|
|
170
170
|
const output = execFileSync(
|
|
171
171
|
'python3',
|
|
172
172
|
[
|
|
173
|
-
path.join(__dirname, 'finish/with-claims-lock.py'),
|
|
173
|
+
path.join(__dirname, '../finish/with-claims-lock.py'),
|
|
174
174
|
path.join(common, 'agent-file-locks.lock'),
|
|
175
175
|
process.execPath,
|
|
176
176
|
__filename,
|
|
@@ -7,9 +7,9 @@ const path = require('node:path');
|
|
|
7
7
|
const { createHash, randomUUID } = require('node:crypto');
|
|
8
8
|
const { spawn, spawnSync } = require('node:child_process');
|
|
9
9
|
const jsonc = require('jsonc-parser');
|
|
10
|
-
const { GUARDEX_HOME_DIR } = require('
|
|
11
|
-
const approvals = require('
|
|
12
|
-
const { provisioningMode } = require('
|
|
10
|
+
const { GUARDEX_HOME_DIR } = require('../context');
|
|
11
|
+
const approvals = require('../scaffold/provision-approvals');
|
|
12
|
+
const { provisioningMode } = require('../scaffold/provision-config');
|
|
13
13
|
|
|
14
14
|
const EVENTS = ['start', 'switch', 'commit', 'merge', 'remove'].flatMap((name) => [
|
|
15
15
|
`pre-${name}`,
|
|
@@ -261,7 +261,7 @@ async function runLifecycleHook(repoRoot, event, context = {}, deps = {}) {
|
|
|
261
261
|
try {
|
|
262
262
|
const child = spawn(
|
|
263
263
|
process.execPath,
|
|
264
|
-
[path.join(__dirname, '
|
|
264
|
+
[path.join(__dirname, 'hook-worker.js'), jobFile],
|
|
265
265
|
{
|
|
266
266
|
detached: true,
|
|
267
267
|
stdio: ['ignore', fd, fd]
|
|
@@ -304,7 +304,7 @@ function runLifecycleHookSync(repoRoot, event, context = {}, deps = {}) {
|
|
|
304
304
|
const child = spawnSync(
|
|
305
305
|
process.execPath,
|
|
306
306
|
[
|
|
307
|
-
path.join(__dirname, '
|
|
307
|
+
path.join(__dirname, 'hook-worker.js'),
|
|
308
308
|
'--run',
|
|
309
309
|
JSON.stringify({ repoRoot, event, context, stateDir: deps.stateDir })
|
|
310
310
|
],
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
const fs = require('node:fs');
|
|
3
3
|
const path = require('node:path');
|
|
4
4
|
const crypto = require('node:crypto');
|
|
5
|
-
const { run } = require('
|
|
6
|
-
const { runTaskStart } = require('./
|
|
5
|
+
const { run } = require('../core/runtime');
|
|
6
|
+
const { runTaskStart } = require('./start');
|
|
7
7
|
|
|
8
8
|
function checkedRun(command, args, repoRoot, deps = {}) {
|
|
9
9
|
const result = (deps.run || run)(command, args, { cwd: repoRoot, timeout: 30000 });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const readline = require('node:readline/promises');
|
|
2
|
-
const { listWorktrees, checkedRun } = require('./
|
|
2
|
+
const { listWorktrees, checkedRun } = require('./navigation');
|
|
3
3
|
|
|
4
4
|
function terminalText(value) {
|
|
5
5
|
return String(value).replace(/[\x00-\x1f\x7f-\x9f]/g, '');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require('node:fs');
|
|
2
2
|
const path = require('node:path');
|
|
3
3
|
const crypto = require('node:crypto');
|
|
4
|
-
const { run, packageAssetPath, packageAssetEnv } = require('
|
|
4
|
+
const { run, packageAssetPath, packageAssetEnv } = require('../core/runtime');
|
|
5
5
|
|
|
6
6
|
function validateTaskId(id) {
|
|
7
7
|
if (!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(id || '')) {
|
|
@@ -82,13 +82,13 @@ function runTaskStart(repoRoot, args) {
|
|
|
82
82
|
throw new Error('--task-id must appear once');
|
|
83
83
|
const id = taskFlags ? validateTaskId(args[args.indexOf('--task-id') + 1]) : '';
|
|
84
84
|
const locks = [];
|
|
85
|
-
if (Object.keys(require('./
|
|
85
|
+
if (Object.keys(require('./quota').readWorktreeQuota(repoRoot)).length) {
|
|
86
86
|
locks.push(path.join(commonGitDirectory(repoRoot), 'gitguardex-worktree-quota.lock'));
|
|
87
87
|
}
|
|
88
88
|
if (id) locks.push(taskLock(repoRoot, id));
|
|
89
89
|
let command = ['bash', packageAssetPath('branchStart'), ...args];
|
|
90
90
|
for (const lock of locks.reverse()) {
|
|
91
|
-
command = ['python3', path.join(__dirname, 'finish/with-claims-lock.py'), lock, ...command];
|
|
91
|
+
command = ['python3', path.join(__dirname, '../finish/with-claims-lock.py'), lock, ...command];
|
|
92
92
|
}
|
|
93
93
|
return run(
|
|
94
94
|
command[0],
|
|
@@ -104,7 +104,7 @@ function invokeTaskStart(repoRoot, args, json = false) {
|
|
|
104
104
|
if (result.status !== 0)
|
|
105
105
|
throw new Error(`Task start failed or is busy (status ${result.status})`);
|
|
106
106
|
if (json) {
|
|
107
|
-
const { findTask } = require('./
|
|
107
|
+
const { findTask } = require('./tasks');
|
|
108
108
|
const task = findTask(repoRoot, args[args.indexOf('--task-id') + 1]);
|
|
109
109
|
process.stdout.write(JSON.stringify({ version: 1, ...task }) + '\n');
|
|
110
110
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const fs = require('node:fs');
|
|
2
2
|
const path = require('node:path');
|
|
3
3
|
const { randomUUID } = require('node:crypto');
|
|
4
|
-
const { run } = require('
|
|
5
|
-
const { listWorktrees } = require('./
|
|
6
|
-
const { commonGitDirectory, taskLock, validateTaskId } = require('./
|
|
4
|
+
const { run } = require('../core/runtime');
|
|
5
|
+
const { listWorktrees } = require('./navigation');
|
|
6
|
+
const { commonGitDirectory, taskLock, validateTaskId } = require('./start');
|
|
7
7
|
|
|
8
8
|
function taskWorktrees(repoRoot, onlyId) {
|
|
9
9
|
const config = run('git', ['config', '--local', '--null', '--list'], { cwd: repoRoot });
|
|
@@ -69,7 +69,7 @@ function taskWorktrees(repoRoot, onlyId) {
|
|
|
69
69
|
|
|
70
70
|
function worktreeBusy(worktree) {
|
|
71
71
|
const { active, supported } =
|
|
72
|
-
require('
|
|
72
|
+
require('../finish/post-branch-finish-cleanup').probeWorktreeOwnership(worktree);
|
|
73
73
|
return active || !supported;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -99,7 +99,7 @@ function runTask(repoRoot, [id, branch, worktree, separator, ...command]) {
|
|
|
99
99
|
const result = run(
|
|
100
100
|
'python3',
|
|
101
101
|
[
|
|
102
|
-
path.join(__dirname, 'finish/with-claims-lock.py'),
|
|
102
|
+
path.join(__dirname, '../finish/with-claims-lock.py'),
|
|
103
103
|
'--try-lock',
|
|
104
104
|
taskLock(repoRoot, validateTaskId(id), 'task-run'),
|
|
105
105
|
process.execPath,
|
|
@@ -134,7 +134,7 @@ if (require.main === module) {
|
|
|
134
134
|
throw new Error('Selected path is not the expected linked worktree');
|
|
135
135
|
if (worktreeBusy(worktree))
|
|
136
136
|
throw new Error('Task worktree is in use or its occupancy cannot be verified');
|
|
137
|
-
require('
|
|
137
|
+
require('../agents/supervise').supervise(worktree, randomUUID(), '--', ...command);
|
|
138
138
|
} catch (error) {
|
|
139
139
|
console.error(`GitGuardex: ${error.message}`);
|
|
140
140
|
process.exitCode = 1;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|