@magnusekdahl/parallix 1.3.0 → 1.3.2
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/README.md +4 -2
- package/config/integration-pipelines.json +5 -0
- package/docs/adr/0048-fail-closed-harness-defense-against-agent-hallucinations.md +161 -0
- package/docs/adr/index.md +2 -0
- package/docs/authority-reference.md +8 -5
- package/lib/agents/agents.js +37 -5
- package/lib/agents/agents.ts +43 -6
- package/lib/agents/claude.js +3 -1
- package/lib/agents/claude.ts +3 -1
- package/lib/agents/codex.js +3 -1
- package/lib/agents/codex.ts +3 -1
- package/lib/agents/opencode.js +5 -3
- package/lib/agents/opencode.ts +5 -3
- package/lib/commands/active.js +21 -3
- package/lib/commands/active.ts +7 -2
- package/lib/commands/config.js +6 -1
- package/lib/commands/config.ts +6 -1
- package/lib/commands/coverage-gate.js +19 -1
- package/lib/commands/coverage-gate.ts +6 -1
- package/lib/commands/diff.js +6 -1
- package/lib/commands/diff.ts +6 -1
- package/lib/commands/draft.js +31 -1
- package/lib/commands/draft.ts +6 -1
- package/lib/commands/handoff.js +12 -1
- package/lib/commands/handoff.ts +6 -1
- package/lib/commands/integrate.js +103 -27
- package/lib/commands/integrate.ts +67 -31
- package/lib/commands/mission-start.js +12 -3
- package/lib/commands/mission-start.ts +7 -2
- package/lib/commands/rebase.js +10 -2
- package/lib/commands/rebase.ts +6 -2
- package/lib/commands/repair-handoff.js +13 -3
- package/lib/commands/repair-handoff.ts +7 -2
- package/lib/commands/resolve-conflict.js +8 -2
- package/lib/commands/resolve-conflict.ts +7 -2
- package/lib/commands/review.js +6 -1
- package/lib/commands/review.ts +6 -1
- package/lib/commands/setup-review.js +8 -3
- package/lib/commands/setup-review.ts +8 -3
- package/lib/commands/setup.js +8 -2
- package/lib/commands/setup.ts +7 -2
- package/lib/commands/stats-backfill.js +14 -3
- package/lib/commands/stats-backfill.ts +7 -2
- package/lib/commands/stats.js +33 -1
- package/lib/commands/stats.ts +7 -2
- package/lib/commands/status.js +8 -1
- package/lib/commands/status.ts +6 -1
- package/lib/commands/verify.js +11 -2
- package/lib/commands/verify.ts +7 -2
- package/lib/core/gitignore.js +9 -1
- package/lib/core/gitignore.ts +6 -1
- package/lib/core/persistent-data-migration.js +4 -2
- package/lib/core/persistent-data-migration.ts +4 -2
- package/lib/index.js +36 -36
- package/lib/index.ts +18 -18
- package/lib/review/review-loop.js +12 -7
- package/lib/review/review-loop.ts +10 -7
- package/lib/review/review.js +51 -1
- package/lib/review/review.ts +6 -1
- package/lib/tools/setup-review.js +7 -4
- package/lib/tools/setup-review.ts +2 -2
- package/package.json +1 -1
- package/px.js +26 -14
package/lib/index.ts
CHANGED
|
@@ -26,28 +26,28 @@ import * as mistralMod from './agents/mistral.js';
|
|
|
26
26
|
import * as opencodeMod from './agents/opencode.js';
|
|
27
27
|
|
|
28
28
|
// commands/ — mixed export styles
|
|
29
|
-
import active
|
|
29
|
+
import active from './commands/active.js';
|
|
30
30
|
import checkpoint from './commands/checkpoint.js';
|
|
31
|
-
import config
|
|
32
|
-
import coverageGate
|
|
33
|
-
import diff
|
|
34
|
-
import draft
|
|
35
|
-
import handoff
|
|
36
|
-
import integrate
|
|
37
|
-
import missionStart
|
|
38
|
-
import rebase
|
|
39
|
-
import repairHandoff
|
|
40
|
-
import resolveConflict
|
|
41
|
-
import setup
|
|
42
|
-
import stats
|
|
43
|
-
import statsBackfill
|
|
44
|
-
import status
|
|
45
|
-
import verify
|
|
31
|
+
import config from './commands/config.js';
|
|
32
|
+
import coverageGate from './commands/coverage-gate.js';
|
|
33
|
+
import diff from './commands/diff.js';
|
|
34
|
+
import draft from './commands/draft.js';
|
|
35
|
+
import handoff from './commands/handoff.js';
|
|
36
|
+
import integrate from './commands/integrate.js';
|
|
37
|
+
import missionStart from './commands/mission-start.js';
|
|
38
|
+
import rebase from './commands/rebase.js';
|
|
39
|
+
import repairHandoff from './commands/repair-handoff.js';
|
|
40
|
+
import resolveConflict from './commands/resolve-conflict.js';
|
|
41
|
+
import setup from './commands/setup.js';
|
|
42
|
+
import stats from './commands/stats.js';
|
|
43
|
+
import statsBackfill from './commands/stats-backfill.js';
|
|
44
|
+
import status from './commands/status.js';
|
|
45
|
+
import verify from './commands/verify.js';
|
|
46
46
|
|
|
47
47
|
// core/ — mixed export styles
|
|
48
48
|
import * as fmtMod from './core/fmt.js';
|
|
49
49
|
import * as gitMod from './core/git.js';
|
|
50
|
-
import gitignore
|
|
50
|
+
import gitignore from './core/gitignore.js';
|
|
51
51
|
import * as missionUtilsMod from './core/mission-utils.js';
|
|
52
52
|
import * as persistentDataMigrationMod from './core/persistent-data-migration.js';
|
|
53
53
|
import * as productConfigMod from './core/product-config.js';
|
|
@@ -58,7 +58,7 @@ import * as storageMod from './core/storage.js';
|
|
|
58
58
|
import * as verificationMod from './core/verification.js';
|
|
59
59
|
|
|
60
60
|
// review/ — mixed export styles
|
|
61
|
-
import review
|
|
61
|
+
import review from './review/review.js';
|
|
62
62
|
import * as reviewArtifactsMod from './review/review-artifacts.js';
|
|
63
63
|
import * as reviewCommandsMod from './review/review-commands.js';
|
|
64
64
|
import * as reviewEventsMod from './review/review-events.js';
|
|
@@ -66,17 +66,17 @@ const review_artifacts_js_1 = require("./review-artifacts.js");
|
|
|
66
66
|
const stage_telemetry_js_1 = require("../agents/stage-telemetry.js");
|
|
67
67
|
/** Lazily loaded stats module — loaded on first use to avoid circular dependency. */
|
|
68
68
|
let _stats = null;
|
|
69
|
-
|
|
69
|
+
function getStats() {
|
|
70
70
|
if (!_stats) {
|
|
71
|
-
_stats =
|
|
71
|
+
_stats = _require('../commands/stats.js');
|
|
72
72
|
}
|
|
73
73
|
return _stats;
|
|
74
74
|
}
|
|
75
75
|
/** Lazily loaded handoff module. */
|
|
76
76
|
let _handoff = null;
|
|
77
|
-
|
|
77
|
+
function getHandoff() {
|
|
78
78
|
if (!_handoff) {
|
|
79
|
-
_handoff =
|
|
79
|
+
_handoff = _require('../commands/handoff.js');
|
|
80
80
|
}
|
|
81
81
|
return _handoff;
|
|
82
82
|
}
|
|
@@ -143,7 +143,10 @@ function recordStageStatsSafe(kind, opts) {
|
|
|
143
143
|
})) {
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
try {
|
|
147
|
+
getStats().accumulateStageStats({ stage, slug, rootDir, implementer, reviewer, telemetry, durationMinutes, model });
|
|
148
|
+
}
|
|
149
|
+
catch { /* best-effort */ }
|
|
147
150
|
}
|
|
148
151
|
catch (err) {
|
|
149
152
|
log?.(fmt.status('WARN', `Could not record ${kind} stats for ${slug}: ${err.message}`));
|
|
@@ -161,9 +164,11 @@ function strictlyLaterIso(earlierIso, nowMs = Date.now()) {
|
|
|
161
164
|
// ============================================================================
|
|
162
165
|
// Pre-review Setup Functions
|
|
163
166
|
// ============================================================================
|
|
167
|
+
const node_module_1 = require("node:module");
|
|
168
|
+
const _require = (0, node_module_1.createRequire)(__filename);
|
|
164
169
|
function maybeUpdateGraphifyBeforeReview(rootDir, { commandRunner = git_js_1.run, log = fmt.log.plain } = {}) {
|
|
165
170
|
// Lazy require to break circular dependency with core/mission-utils
|
|
166
|
-
const { updateGraphifyKnowledgeGraph } =
|
|
171
|
+
const { updateGraphifyKnowledgeGraph } = _require('../core/mission-utils.js');
|
|
167
172
|
return updateGraphifyKnowledgeGraph({
|
|
168
173
|
rootDir,
|
|
169
174
|
commandRunner,
|
|
@@ -262,7 +267,7 @@ async function startReviewLoop(slug, opts = {}) {
|
|
|
262
267
|
}
|
|
263
268
|
const taskResolution = resolveTaskFileFn(slug, worktree);
|
|
264
269
|
if (!dryRun) {
|
|
265
|
-
maybeUpdateGraphifyBeforeReviewFn(worktree, { commandRunner: runFn, log });
|
|
270
|
+
await maybeUpdateGraphifyBeforeReviewFn(worktree, { commandRunner: runFn, log });
|
|
266
271
|
}
|
|
267
272
|
// --reset: clear persisted state before starting
|
|
268
273
|
if (reset) {
|
|
@@ -24,18 +24,18 @@ import { resolveStageTelemetry } from '../agents/stage-telemetry.js';
|
|
|
24
24
|
|
|
25
25
|
/** Lazily loaded stats module — loaded on first use to avoid circular dependency. */
|
|
26
26
|
let _stats: any = null;
|
|
27
|
-
|
|
27
|
+
function getStats(): any {
|
|
28
28
|
if (!_stats) {
|
|
29
|
-
_stats =
|
|
29
|
+
_stats = _require('../commands/stats.js');
|
|
30
30
|
}
|
|
31
31
|
return _stats as any;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/** Lazily loaded handoff module. */
|
|
35
35
|
let _handoff: any = null;
|
|
36
|
-
|
|
36
|
+
function getHandoff(): any {
|
|
37
37
|
if (!_handoff) {
|
|
38
|
-
_handoff =
|
|
38
|
+
_handoff = _require('../commands/handoff.js');
|
|
39
39
|
}
|
|
40
40
|
return _handoff as any;
|
|
41
41
|
}
|
|
@@ -123,7 +123,7 @@ export function recordStageStatsSafe(
|
|
|
123
123
|
})) {
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
|
-
getStats().
|
|
126
|
+
try { getStats().accumulateStageStats({ stage, slug, rootDir, implementer, reviewer, telemetry, durationMinutes, model }); } catch { /* best-effort */ }
|
|
127
127
|
} catch (err: unknown) {
|
|
128
128
|
log?.(fmt.status('WARN', `Could not record ${kind} stats for ${slug}: ${(err as Error).message}`));
|
|
129
129
|
}
|
|
@@ -144,12 +144,15 @@ function strictlyLaterIso(earlierIso: string, nowMs = Date.now()): string {
|
|
|
144
144
|
// Pre-review Setup Functions
|
|
145
145
|
// ============================================================================
|
|
146
146
|
|
|
147
|
+
import { createRequire } from 'node:module';
|
|
148
|
+
const _require = createRequire(__filename);
|
|
149
|
+
|
|
147
150
|
export function maybeUpdateGraphifyBeforeReview(
|
|
148
151
|
rootDir: string,
|
|
149
152
|
{ commandRunner = run, log = fmt.log.plain }: { commandRunner?: typeof run; log?: (msg: string) => void } = {}
|
|
150
153
|
): unknown {
|
|
151
154
|
// Lazy require to break circular dependency with core/mission-utils
|
|
152
|
-
const { updateGraphifyKnowledgeGraph } =
|
|
155
|
+
const { updateGraphifyKnowledgeGraph } = _require('../core/mission-utils.js');
|
|
153
156
|
return updateGraphifyKnowledgeGraph({
|
|
154
157
|
rootDir,
|
|
155
158
|
commandRunner,
|
|
@@ -400,7 +403,7 @@ export async function startReviewLoop(slug: string, opts: {
|
|
|
400
403
|
const taskResolution = resolveTaskFileFn(slug, worktree);
|
|
401
404
|
|
|
402
405
|
if (!dryRun) {
|
|
403
|
-
maybeUpdateGraphifyBeforeReviewFn(worktree, { commandRunner: runFn, log });
|
|
406
|
+
await maybeUpdateGraphifyBeforeReviewFn(worktree, { commandRunner: runFn, log });
|
|
404
407
|
}
|
|
405
408
|
|
|
406
409
|
// --reset: clear persisted state before starting
|
package/lib/review/review.js
CHANGED
|
@@ -9,22 +9,68 @@
|
|
|
9
9
|
* - review-artifacts.ts (artifact handling and posting)
|
|
10
10
|
* - review-polling.ts (polling utilities)
|
|
11
11
|
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ReviewState = exports.reviewStateFile = exports.importLegacyHandler = exports.createEventHandler = exports.closeMissionPr = exports.submitReviewRound = exports.commentRound = exports.showReviewStatus = exports.pushRound = exports.readComments = exports.submitForReview = exports.verifyReview = exports.performStaticReview = exports.postStaticReviewComment = exports.formatStaticReviewSuccess = exports.formatStaticReviewFindings = exports.readTextFlag = exports.flagValue = exports.startReviewLoop = exports.persistNormalizedPhaseRepair = exports.applyAgentFallback = exports.rebaseBeforeReviewRound = exports.commitSafeMissionArtifacts = exports.maybeUpdateGraphifyBeforeReview = exports.recordStageStatsSafe = exports.consumeImplementerArtifacts = exports.consumeReviewerArtifacts = exports.postWorkflowReview = exports.postWorkflowComment = exports.normalizeDisposition = exports.normalizeReviewVerdict = exports.deleteArtifactFile = exports.readArtifactFile = exports.reviewArtifactPath = exports.buildMetadataFooter = exports.pollForDisposition = exports.pollForReview = exports.isPollTimeout = exports.formatElapsed = exports.resolvePollTimeoutMs = exports.resolvePollIntervalMs = exports.delay = exports.POLL_TIMEOUT = exports.review = void 0;
|
|
12
14
|
// Import from review-polling module
|
|
13
15
|
const review_polling_js_1 = require("./review-polling.js");
|
|
16
|
+
Object.defineProperty(exports, "POLL_TIMEOUT", { enumerable: true, get: function () { return review_polling_js_1.POLL_TIMEOUT; } });
|
|
17
|
+
Object.defineProperty(exports, "delay", { enumerable: true, get: function () { return review_polling_js_1.delay; } });
|
|
18
|
+
Object.defineProperty(exports, "resolvePollIntervalMs", { enumerable: true, get: function () { return review_polling_js_1.resolvePollIntervalMs; } });
|
|
19
|
+
Object.defineProperty(exports, "resolvePollTimeoutMs", { enumerable: true, get: function () { return review_polling_js_1.resolvePollTimeoutMs; } });
|
|
20
|
+
Object.defineProperty(exports, "formatElapsed", { enumerable: true, get: function () { return review_polling_js_1.formatElapsed; } });
|
|
21
|
+
Object.defineProperty(exports, "isPollTimeout", { enumerable: true, get: function () { return review_polling_js_1.isPollTimeout; } });
|
|
22
|
+
Object.defineProperty(exports, "pollForReview", { enumerable: true, get: function () { return review_polling_js_1.pollForReview; } });
|
|
23
|
+
Object.defineProperty(exports, "pollForDisposition", { enumerable: true, get: function () { return review_polling_js_1.pollForDisposition; } });
|
|
14
24
|
// Import from review-artifacts module
|
|
15
25
|
const review_artifacts_js_1 = require("./review-artifacts.js");
|
|
26
|
+
Object.defineProperty(exports, "buildMetadataFooter", { enumerable: true, get: function () { return review_artifacts_js_1.buildMetadataFooter; } });
|
|
27
|
+
Object.defineProperty(exports, "reviewArtifactPath", { enumerable: true, get: function () { return review_artifacts_js_1.reviewArtifactPath; } });
|
|
28
|
+
Object.defineProperty(exports, "readArtifactFile", { enumerable: true, get: function () { return review_artifacts_js_1.readArtifactFile; } });
|
|
29
|
+
Object.defineProperty(exports, "deleteArtifactFile", { enumerable: true, get: function () { return review_artifacts_js_1.deleteArtifactFile; } });
|
|
30
|
+
Object.defineProperty(exports, "normalizeReviewVerdict", { enumerable: true, get: function () { return review_artifacts_js_1.normalizeReviewVerdict; } });
|
|
31
|
+
Object.defineProperty(exports, "normalizeDisposition", { enumerable: true, get: function () { return review_artifacts_js_1.normalizeDisposition; } });
|
|
32
|
+
Object.defineProperty(exports, "postWorkflowComment", { enumerable: true, get: function () { return review_artifacts_js_1.postWorkflowComment; } });
|
|
33
|
+
Object.defineProperty(exports, "postWorkflowReview", { enumerable: true, get: function () { return review_artifacts_js_1.postWorkflowReview; } });
|
|
34
|
+
Object.defineProperty(exports, "consumeReviewerArtifacts", { enumerable: true, get: function () { return review_artifacts_js_1.consumeReviewerArtifacts; } });
|
|
35
|
+
Object.defineProperty(exports, "consumeImplementerArtifacts", { enumerable: true, get: function () { return review_artifacts_js_1.consumeImplementerArtifacts; } });
|
|
16
36
|
// Import from review-loop module
|
|
17
37
|
const review_loop_js_1 = require("./review-loop.js");
|
|
38
|
+
Object.defineProperty(exports, "maybeUpdateGraphifyBeforeReview", { enumerable: true, get: function () { return review_loop_js_1.maybeUpdateGraphifyBeforeReview; } });
|
|
39
|
+
Object.defineProperty(exports, "commitSafeMissionArtifacts", { enumerable: true, get: function () { return review_loop_js_1.commitSafeMissionArtifacts; } });
|
|
40
|
+
Object.defineProperty(exports, "rebaseBeforeReviewRound", { enumerable: true, get: function () { return review_loop_js_1.rebaseBeforeReviewRound; } });
|
|
41
|
+
Object.defineProperty(exports, "applyAgentFallback", { enumerable: true, get: function () { return review_loop_js_1.applyAgentFallback; } });
|
|
42
|
+
Object.defineProperty(exports, "persistNormalizedPhaseRepair", { enumerable: true, get: function () { return review_loop_js_1.persistNormalizedPhaseRepair; } });
|
|
43
|
+
Object.defineProperty(exports, "startReviewLoop", { enumerable: true, get: function () { return review_loop_js_1.startReviewLoop; } });
|
|
44
|
+
Object.defineProperty(exports, "recordStageStatsSafe", { enumerable: true, get: function () { return review_loop_js_1.recordStageStatsSafe; } });
|
|
18
45
|
// Import from review-commands module
|
|
19
46
|
const review_commands_js_1 = require("./review-commands.js");
|
|
47
|
+
Object.defineProperty(exports, "flagValue", { enumerable: true, get: function () { return review_commands_js_1.flagValue; } });
|
|
48
|
+
Object.defineProperty(exports, "readTextFlag", { enumerable: true, get: function () { return review_commands_js_1.readTextFlag; } });
|
|
49
|
+
Object.defineProperty(exports, "formatStaticReviewFindings", { enumerable: true, get: function () { return review_commands_js_1.formatStaticReviewFindings; } });
|
|
50
|
+
Object.defineProperty(exports, "formatStaticReviewSuccess", { enumerable: true, get: function () { return review_commands_js_1.formatStaticReviewSuccess; } });
|
|
51
|
+
Object.defineProperty(exports, "postStaticReviewComment", { enumerable: true, get: function () { return review_commands_js_1.postStaticReviewComment; } });
|
|
52
|
+
Object.defineProperty(exports, "performStaticReview", { enumerable: true, get: function () { return review_commands_js_1.performStaticReview; } });
|
|
53
|
+
Object.defineProperty(exports, "verifyReview", { enumerable: true, get: function () { return review_commands_js_1.verifyReview; } });
|
|
54
|
+
Object.defineProperty(exports, "submitForReview", { enumerable: true, get: function () { return review_commands_js_1.submitForReview; } });
|
|
55
|
+
Object.defineProperty(exports, "readComments", { enumerable: true, get: function () { return review_commands_js_1.readComments; } });
|
|
56
|
+
Object.defineProperty(exports, "pushRound", { enumerable: true, get: function () { return review_commands_js_1.pushRound; } });
|
|
57
|
+
Object.defineProperty(exports, "showReviewStatus", { enumerable: true, get: function () { return review_commands_js_1.showReviewStatus; } });
|
|
58
|
+
Object.defineProperty(exports, "commentRound", { enumerable: true, get: function () { return review_commands_js_1.commentRound; } });
|
|
59
|
+
Object.defineProperty(exports, "submitReviewRound", { enumerable: true, get: function () { return review_commands_js_1.submitReviewRound; } });
|
|
60
|
+
Object.defineProperty(exports, "closeMissionPr", { enumerable: true, get: function () { return review_commands_js_1.closeMissionPr; } });
|
|
61
|
+
Object.defineProperty(exports, "createEventHandler", { enumerable: true, get: function () { return review_commands_js_1.createEventHandler; } });
|
|
62
|
+
Object.defineProperty(exports, "importLegacyHandler", { enumerable: true, get: function () { return review_commands_js_1.importLegacyHandler; } });
|
|
20
63
|
// Import from review-state module
|
|
21
64
|
const review_state_js_1 = require("./review-state.js");
|
|
65
|
+
Object.defineProperty(exports, "reviewStateFile", { enumerable: true, get: function () { return review_state_js_1.reviewStateFile; } });
|
|
66
|
+
Object.defineProperty(exports, "ReviewState", { enumerable: true, get: function () { return review_state_js_1.ReviewState; } });
|
|
22
67
|
// ============================================================================
|
|
23
68
|
// Module Exports
|
|
24
69
|
// ============================================================================
|
|
25
70
|
// Set the module exports to the main review function (for backward compatibility)
|
|
26
71
|
// then add all other exports as properties
|
|
27
72
|
const _review = review_commands_js_1.review;
|
|
73
|
+
exports.review = _review;
|
|
28
74
|
// From review-polling
|
|
29
75
|
_review.POLL_TIMEOUT = review_polling_js_1.POLL_TIMEOUT;
|
|
30
76
|
_review.delay = review_polling_js_1.delay;
|
|
@@ -73,4 +119,8 @@ _review.importLegacyHandler = review_commands_js_1.importLegacyHandler;
|
|
|
73
119
|
// From review-state
|
|
74
120
|
_review.reviewStateFile = review_state_js_1.reviewStateFile;
|
|
75
121
|
_review.ReviewState = review_state_js_1.ReviewState;
|
|
76
|
-
module
|
|
122
|
+
// Export the review function as the module exports (CJS-compatible)
|
|
123
|
+
exports.default = _review;
|
|
124
|
+
if (typeof module !== 'undefined') {
|
|
125
|
+
module.exports = _review;
|
|
126
|
+
}
|
package/lib/review/review.ts
CHANGED
|
@@ -135,4 +135,9 @@ _review.reviewStateFile = reviewStateFile;
|
|
|
135
135
|
_review.ReviewState = ReviewState;
|
|
136
136
|
|
|
137
137
|
// Export the review function as the module exports (CJS-compatible)
|
|
138
|
-
export
|
|
138
|
+
export default _review;
|
|
139
|
+
export { _review as review, POLL_TIMEOUT, delay, resolvePollIntervalMs, resolvePollTimeoutMs, formatElapsed, isPollTimeout, pollForReview, pollForDisposition, buildMetadataFooter, reviewArtifactPath, readArtifactFile, deleteArtifactFile, normalizeReviewVerdict, normalizeDisposition, postWorkflowComment, postWorkflowReview, consumeReviewerArtifacts, consumeImplementerArtifacts, recordStageStatsSafe, maybeUpdateGraphifyBeforeReview, commitSafeMissionArtifacts, rebaseBeforeReviewRound, applyAgentFallback, persistNormalizedPhaseRepair, startReviewLoop, flagValue, readTextFlag, formatStaticReviewFindings, formatStaticReviewSuccess, postStaticReviewComment, performStaticReview, verifyReview, submitForReview, readComments, pushRound, showReviewStatus, commentRound, submitReviewRound, closeMissionPr, createEventHandler, importLegacyHandler, reviewStateFile, ReviewState };
|
|
140
|
+
|
|
141
|
+
// CJS compat: ensure require() returns the function directly
|
|
142
|
+
declare const module: { exports: any } | undefined;
|
|
143
|
+
if (typeof module !== 'undefined') { module.exports = _review; }
|
|
@@ -32,6 +32,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
35
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
39
|
exports.standardLayoutDescription = standardLayoutDescription;
|
|
37
40
|
exports.suggestedForgejoUsers = suggestedForgejoUsers;
|
|
@@ -61,14 +64,14 @@ exports.buildNonInteractiveAnswers = buildNonInteractiveAnswers;
|
|
|
61
64
|
const fs = __importStar(require("fs"));
|
|
62
65
|
const path = __importStar(require("path"));
|
|
63
66
|
const readline = __importStar(require("readline"));
|
|
64
|
-
const
|
|
65
|
-
const { spawnSync } =
|
|
67
|
+
const child_process_1 = __importDefault(require("child_process"));
|
|
68
|
+
const { spawnSync } = child_process_1.default;
|
|
66
69
|
const fmt = __importStar(require("../core/fmt"));
|
|
67
70
|
const agents_1 = require("../agents/agents");
|
|
68
71
|
const product_config_1 = require("../core/product-config");
|
|
69
72
|
const forgejo_1 = require("./forgejo");
|
|
70
73
|
const product_config_2 = require("../core/product-config");
|
|
71
|
-
const
|
|
74
|
+
const gitignore_js_1 = __importDefault(require("../core/gitignore.js"));
|
|
72
75
|
let tokenNameCounter = 0;
|
|
73
76
|
const REVIEW_TOKEN_SCOPES = ['write:user', 'write:repository', 'write:issue', 'write:organization'];
|
|
74
77
|
const PASSWORD_PROMPT_OPTIONS = { hidden: false };
|
|
@@ -1036,7 +1039,7 @@ async function setupWizard(_args, options = {}) {
|
|
|
1036
1039
|
: await collectWizardAnswers(rootDir, { ...options, promptFn, log });
|
|
1037
1040
|
const configPath = writeWorkflowConfig(rootDir, buildWorkflowConfig(answers));
|
|
1038
1041
|
log(fmt.status('PASS', `Wrote ${configPath}`));
|
|
1039
|
-
const gitignoreResult =
|
|
1042
|
+
const gitignoreResult = (0, gitignore_js_1.default)(rootDir, { logFn: log });
|
|
1040
1043
|
if (gitignoreResult.created) {
|
|
1041
1044
|
log(fmt.status('PASS', `Created .gitignore with ${gitignoreResult.appended} workflow entries in ${fmt.path(rootDir)}`));
|
|
1042
1045
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import * as readline from 'readline';
|
|
4
|
-
import _cp
|
|
4
|
+
import _cp from 'child_process';
|
|
5
5
|
const { spawnSync } = _cp;
|
|
6
6
|
import * as fmt from '../core/fmt';
|
|
7
7
|
import { eligibleAgentsForStep } from '../agents/agents';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
reviewRemoteUrl,
|
|
13
13
|
} from './forgejo';
|
|
14
14
|
import { loadWorkflowConfig } from '../core/product-config';
|
|
15
|
-
import ensureWorkflowGitignore
|
|
15
|
+
import ensureWorkflowGitignore from '../core/gitignore.js';
|
|
16
16
|
|
|
17
17
|
let tokenNameCounter = 0;
|
|
18
18
|
const REVIEW_TOKEN_SCOPES = ['write:user', 'write:repository', 'write:issue', 'write:organization'];
|
package/package.json
CHANGED
package/px.js
CHANGED
|
@@ -46,10 +46,20 @@ exports.run = run;
|
|
|
46
46
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
47
47
|
const node_path_1 = __importDefault(require("node:path"));
|
|
48
48
|
const fmt = __importStar(require("./lib/core/fmt.js"));
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
const node_module_1 = require("node:module");
|
|
50
|
+
function resolveRuntimePath() {
|
|
51
|
+
if (typeof __filename === 'string' && __filename) {
|
|
52
|
+
return __filename;
|
|
53
|
+
}
|
|
54
|
+
if (typeof process.argv[1] === 'string' && node_path_1.default.isAbsolute(process.argv[1])) {
|
|
55
|
+
return process.argv[1];
|
|
56
|
+
}
|
|
57
|
+
return node_path_1.default.resolve(process.cwd(), 'px.js');
|
|
58
|
+
}
|
|
59
|
+
const runtimePath = resolveRuntimePath();
|
|
60
|
+
const _require = (0, node_module_1.createRequire)(runtimePath);
|
|
61
|
+
const packageJson = _require('./package.json');
|
|
62
|
+
const runtimeDir = node_path_1.default.dirname(runtimePath);
|
|
53
63
|
function parseArgs(argv, baseCwd = process.cwd()) {
|
|
54
64
|
const args = [...argv];
|
|
55
65
|
if (args[0] === '--version' || args[0] === '-v') {
|
|
@@ -108,10 +118,10 @@ function shellInit(shell = 'bash') {
|
|
|
108
118
|
}
|
|
109
119
|
function versionInfo() {
|
|
110
120
|
return {
|
|
111
|
-
name:
|
|
112
|
-
version:
|
|
113
|
-
pxPath:
|
|
114
|
-
packageRoot:
|
|
121
|
+
name: packageJson.name,
|
|
122
|
+
version: packageJson.version,
|
|
123
|
+
pxPath: runtimePath,
|
|
124
|
+
packageRoot: runtimeDir,
|
|
115
125
|
node: process.version,
|
|
116
126
|
};
|
|
117
127
|
}
|
|
@@ -205,11 +215,15 @@ async function run(argv = process.argv.slice(2), options = {}) {
|
|
|
205
215
|
return 0;
|
|
206
216
|
}
|
|
207
217
|
const previousCwd = process.cwd();
|
|
208
|
-
process.chdir(parsed.target);
|
|
209
218
|
try {
|
|
219
|
+
const missionStartModule = _require('./lib/commands/mission-start.js');
|
|
220
|
+
const missionStart = missionStartModule.default || missionStartModule;
|
|
221
|
+
const { createEvent } = _require('./lib/review/review-events.js');
|
|
222
|
+
const workflow = _require('./index.js');
|
|
223
|
+
process.chdir(parsed.target);
|
|
210
224
|
if (parsed.command === 'review-event') {
|
|
211
225
|
const eventArgs = parseReviewEventArgs(parsed.args);
|
|
212
|
-
const result =
|
|
226
|
+
const result = createEvent(eventArgs.slug, eventArgs.type || '', {
|
|
213
227
|
actor: eventArgs.actor || '',
|
|
214
228
|
content: eventArgs.content,
|
|
215
229
|
timestamp: eventArgs.timestamp || undefined,
|
|
@@ -245,8 +259,6 @@ async function run(argv = process.argv.slice(2), options = {}) {
|
|
|
245
259
|
process.chdir(previousCwd);
|
|
246
260
|
}
|
|
247
261
|
}
|
|
248
|
-
if (typeof require
|
|
249
|
-
run().then(code => {
|
|
250
|
-
process.exitCode = code;
|
|
251
|
-
});
|
|
262
|
+
if (typeof require === 'undefined' || require.main === module) {
|
|
263
|
+
run().then(code => { process.exitCode = code; });
|
|
252
264
|
}
|