@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.
Files changed (47) hide show
  1. package/CONTRIBUTING.md +2 -33
  2. package/README.md +7 -174
  3. package/SECURITY.md +1 -1
  4. package/package.json +6 -39
  5. package/scripts/prepublish-bump-version.js +11 -1
  6. package/src/agents/start.js +1 -1
  7. package/src/cli/commands/branch.js +7 -7
  8. package/src/cli/commands/claude.js +6 -13
  9. package/src/cli/commands/pr.js +2 -2
  10. package/src/cli/commands/release.js +7 -1
  11. package/src/cli/commands/review.js +2 -2
  12. package/src/cli/commands/worktree-copy-ignored.js +1 -1
  13. package/src/cli/commands/worktree-estimate.js +2 -2
  14. package/src/cli/commands/worktree-hooks.js +1 -1
  15. package/src/cli/commands/worktree-navigation.js +3 -3
  16. package/src/cli/shared-locks.js +1 -1
  17. package/src/context.js +8 -1
  18. package/src/finish/index.js +1 -1
  19. package/src/finish/post-branch-finish-cleanup.js +2 -2
  20. package/src/finish/review-gate.js +3 -3
  21. package/src/finish/review-receipt.js +9 -5
  22. package/src/{github-api.js → github/api.js} +2 -2
  23. package/src/mcp/collect.js +2 -2
  24. package/src/pr-review.js +2 -1178
  25. package/src/pr-value.js +2 -111
  26. package/src/provider-binary.js +2 -122
  27. package/src/{pr.js → pull-request/index.js} +5 -5
  28. package/src/{pr-lens-publish.js → pull-request/lens-publish.js} +2 -2
  29. package/src/{pr-lens.js → pull-request/lens.js} +2 -2
  30. package/src/{pr-respond.js → pull-request/respond.js} +8 -8
  31. package/src/pull-request/value.js +111 -0
  32. package/src/review/bug-hunter.js +75 -0
  33. package/src/{review-fix.js → review/fix.js} +2 -2
  34. package/src/review/provider-binary.js +122 -0
  35. package/src/review/pull-request.js +1217 -0
  36. package/src/{worktree-copy-ignored.js → worktree/copy-ignored.js} +3 -3
  37. package/src/{worktree-hook-worker.js → worktree/hook-worker.js} +1 -1
  38. package/src/{worktree-hooks.js → worktree/hooks.js} +5 -5
  39. package/src/{worktree-navigation.js → worktree/navigation.js} +2 -2
  40. package/src/{worktree-picker.js → worktree/picker.js} +1 -1
  41. package/src/{worktree-quota.js → worktree/quota.js} +1 -1
  42. package/src/{worktree-start.js → worktree/start.js} +4 -4
  43. package/src/{worktree-tasks.js → worktree/tasks.js} +6 -6
  44. /package/src/{shared-git-state.js → git/shared-state.js} +0 -0
  45. /package/src/{pr-checks.js → pull-request/checks.js} +0 -0
  46. /package/src/{review-diff-context.js → review/diff-context.js} +0 -0
  47. /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('./scaffold/provision-config');
9
- const sharedGitState = require('./shared-git-state');
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,
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const fs = require('node:fs');
4
- const { executeHookJob, runLifecycleHook } = require('./worktree-hooks');
4
+ const { executeHookJob, runLifecycleHook } = require('./hooks');
5
5
 
6
6
  async function main(jobFile) {
7
7
  if (jobFile === '--run') {
@@ -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('./context');
11
- const approvals = require('./scaffold/provision-approvals');
12
- const { provisioningMode } = require('./scaffold/provision-config');
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, 'worktree-hook-worker.js'), jobFile],
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, 'worktree-hook-worker.js'),
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('./core/runtime');
6
- const { runTaskStart } = require('./worktree-start');
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('./worktree-navigation');
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,6 +1,6 @@
1
1
  const fs = require('node:fs');
2
2
  const path = require('node:path');
3
- const { run } = require('./core/runtime');
3
+ const { run } = require('../core/runtime');
4
4
 
5
5
  const KEYS = {
6
6
  maxCount: 'multiagent.worktreeMaxCount',
@@ -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('./core/runtime');
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('./worktree-quota').readWorktreeQuota(repoRoot)).length) {
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('./worktree-tasks');
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('./core/runtime');
5
- const { listWorktrees } = require('./worktree-navigation');
6
- const { commonGitDirectory, taskLock, validateTaskId } = require('./worktree-start');
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('./finish/post-branch-finish-cleanup').probeWorktreeOwnership(worktree);
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('./agents/supervise').supervise(worktree, randomUUID(), '--', ...command);
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