@magnusekdahl/parallix 1.3.2 → 1.3.4

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 (50) hide show
  1. package/docs/agents.md +1 -1
  2. package/docs/use-cases.md +1 -1
  3. package/lib/agents/agents.js +20 -3
  4. package/lib/agents/agents.ts +14 -3
  5. package/lib/agents/mistral-telemetry.js +122 -23
  6. package/lib/agents/mistral-telemetry.ts +141 -26
  7. package/lib/agents/mistral.js +128 -14
  8. package/lib/agents/mistral.ts +145 -5
  9. package/lib/commands/active.js +69 -39
  10. package/lib/commands/active.ts +97 -60
  11. package/lib/commands/config.ts +3 -3
  12. package/lib/commands/coverage-gate.ts +1 -1
  13. package/lib/commands/draft.js +1 -1
  14. package/lib/commands/draft.ts +1 -1
  15. package/lib/commands/handoff.js +13 -8
  16. package/lib/commands/handoff.ts +24 -18
  17. package/lib/commands/rebase.js +1 -1
  18. package/lib/commands/rebase.ts +2 -2
  19. package/lib/commands/repair-handoff.js +141 -20
  20. package/lib/commands/repair-handoff.ts +185 -45
  21. package/lib/commands/resolve-conflict.js +1 -1
  22. package/lib/commands/resolve-conflict.ts +2 -2
  23. package/lib/commands/stats-backfill.ts +10 -10
  24. package/lib/commands/stats.js +38 -11
  25. package/lib/commands/stats.ts +40 -96
  26. package/lib/core/fmt.ts +2 -2
  27. package/lib/core/git.ts +2 -2
  28. package/lib/core/gitignore.ts +2 -2
  29. package/lib/core/mission-utils.js +2 -2
  30. package/lib/core/mission-utils.ts +2 -2
  31. package/lib/core/persistent-data-migration.ts +2 -2
  32. package/lib/core/spawn-tee.ts +1 -1
  33. package/lib/core/state-map.ts +2 -2
  34. package/lib/core/storage.ts +1 -1
  35. package/lib/core/verification.ts +1 -1
  36. package/lib/review/rebase.ts +12 -12
  37. package/lib/review/review-artifacts.ts +35 -35
  38. package/lib/review/review-commands.ts +40 -40
  39. package/lib/review/review-events.ts +12 -12
  40. package/lib/review/review-loop.js +236 -7
  41. package/lib/review/review-loop.ts +338 -22
  42. package/lib/review/review-polling.ts +6 -6
  43. package/lib/review/review-prompts.js +8 -4
  44. package/lib/review/review-prompts.ts +12 -8
  45. package/lib/review/review-state.js +1 -1
  46. package/lib/review/review-state.ts +2 -2
  47. package/package.json +3 -2
  48. package/prompts/review-verbose.md +1 -1
  49. package/prompts/review.md +1 -1
  50. package/px.js +8 -4
@@ -102,12 +102,12 @@ function postWorkflowComment(
102
102
  slug: string,
103
103
  message: string,
104
104
  options: {
105
- log?: (msg: string) => void;
106
- error?: (msg: string) => void;
107
- readTokenFn?: (user: string, opts: { rootDir?: string }) => string | null;
108
- postCommentFn?: (branch: string, token: string, body: string, opts?: Record<string, unknown>) => unknown;
109
- buildMetadataFooterFn?: (s: string, r?: string) => string;
110
- readReviewStateFn?: (s: string, r?: string) => any;
105
+ log?: (_msg: string) => void;
106
+ error?: (_msg: string) => void;
107
+ readTokenFn?: (_user: string, _opts: { rootDir?: string }) => string | null;
108
+ postCommentFn?: (_branch: string, _token: string, _body: string, _opts?: Record<string, unknown>) => unknown;
109
+ buildMetadataFooterFn?: (_s: string, _r?: string) => string;
110
+ readReviewStateFn?: (_s: string, _r?: string) => any;
111
111
  rootDir?: string;
112
112
  reviewIdentity?: string;
113
113
  forgejoUser?: string;
@@ -172,11 +172,11 @@ function recordLocalReviewVerdict(
172
172
  outcome: string,
173
173
  options: {
174
174
  worktree?: string;
175
- writeReviewStateFn?: (s: string, st: any, w: string) => boolean;
176
- createEventFn?: (s: string, t: string, p: Record<string, unknown>, o: Record<string, unknown>) => CreateResult;
177
- readReviewStateFn?: (s: string, r?: string) => any;
178
- log?: (msg: string) => void;
179
- error?: (msg: string) => void;
175
+ writeReviewStateFn?: (_s: string, _st: any, _w: string) => boolean;
176
+ createEventFn?: (_s: string, _t: string, _p: Record<string, unknown>, _o: Record<string, unknown>) => CreateResult;
177
+ readReviewStateFn?: (_s: string, _r?: string) => any;
178
+ log?: (_msg: string) => void;
179
+ error?: (_msg: string) => void;
180
180
  reviewer?: string;
181
181
  } = {}
182
182
  ): void {
@@ -216,18 +216,18 @@ function postWorkflowReview(
216
216
  outcome: string,
217
217
  message: string,
218
218
  options: {
219
- log?: (msg: string) => void;
220
- error?: (msg: string) => void;
221
- readTokenFn?: (user: string, opts: { rootDir?: string }) => string | null;
222
- postReviewFn?: (branch: string, token: string, outcome: string, body: string, opts?: Record<string, unknown>) => unknown;
223
- buildMetadataFooterFn?: (s: string, r?: string) => string;
224
- readReviewStateFn?: (s: string, r?: string) => any;
219
+ log?: (_msg: string) => void;
220
+ error?: (_msg: string) => void;
221
+ readTokenFn?: (_user: string, _opts: { rootDir?: string }) => string | null;
222
+ postReviewFn?: (_branch: string, _token: string, _outcome: string, _body: string, _opts?: Record<string, unknown>) => unknown;
223
+ buildMetadataFooterFn?: (_s: string, _r?: string) => string;
224
+ readReviewStateFn?: (_s: string, _r?: string) => any;
225
225
  worktree?: string;
226
226
  reviewIdentity?: string;
227
227
  forgejoUser?: string;
228
- getPrAuthorFn?: (branch: string, token: string, opts?: Record<string, unknown>) => unknown;
229
- writeReviewStateFn?: (s: string, st: any, w: string) => boolean;
230
- createEventFn?: (s: string, t: string, p: Record<string, unknown>, o: Record<string, unknown>) => CreateResult;
228
+ getPrAuthorFn?: (_branch: string, _token: string, _opts?: Record<string, unknown>) => unknown;
229
+ writeReviewStateFn?: (_s: string, _st: any, _w: string) => boolean;
230
+ createEventFn?: (_s: string, _t: string, _p: Record<string, unknown>, _o: Record<string, unknown>) => CreateResult;
231
231
  } = {}
232
232
  ): { ok: boolean; error?: string; skipped?: boolean; reason?: string; prAuthor?: unknown } {
233
233
  const log = options.log || fmt.log.plain;
@@ -292,8 +292,8 @@ async function consumeReviewerArtifacts(
292
292
  slug: string,
293
293
  reviewer: string,
294
294
  options: {
295
- log?: (msg: string) => void;
296
- error?: (msg: string) => void;
295
+ log?: (_msg: string) => void;
296
+ error?: (_msg: string) => void;
297
297
  readArtifactFn?: typeof readArtifactFile;
298
298
  deleteArtifactFn?: typeof deleteArtifactFile;
299
299
  tmpDir?: string | null;
@@ -301,12 +301,12 @@ async function consumeReviewerArtifacts(
301
301
  worktree?: string;
302
302
  providerEnabled?: boolean | null;
303
303
  forgejoEnabled?: boolean | null;
304
- readTokenFn?: (user: string, opts?: Record<string, unknown>) => string | null;
305
- getCommentsFn?: (branch: string, token: string) => Promise<unknown[]>;
306
- postCommentFn?: (branch: string, token: string, body: string, opts?: Record<string, unknown>) => unknown;
307
- postReviewFn?: (branch: string, token: string, outcome: string, body: string, opts?: Record<string, unknown>) => unknown;
308
- buildMetadataFooterFn?: (s: string, r?: string) => string;
309
- createEventFn?: (s: string, t: string, p: CreateEventParams, o: CreateEventOptions) => CreateEventResult;
304
+ readTokenFn?: (_user: string, _opts?: Record<string, unknown>) => string | null;
305
+ getCommentsFn?: (_branch: string, _token: string) => Promise<unknown[]>;
306
+ postCommentFn?: (_branch: string, _token: string, _body: string, _opts?: Record<string, unknown>) => unknown;
307
+ postReviewFn?: (_branch: string, _token: string, _outcome: string, _body: string, _opts?: Record<string, unknown>) => unknown;
308
+ buildMetadataFooterFn?: (_s: string, _r?: string) => string;
309
+ createEventFn?: (_s: string, _t: string, _p: CreateEventParams, _o: CreateEventOptions) => CreateEventResult;
310
310
  } = {}
311
311
  ): Promise<{ consumed: boolean; ok?: boolean; reviewState?: string | null }> {
312
312
  const log = options.log || fmt.log.plain;
@@ -452,8 +452,8 @@ async function consumeImplementerArtifacts(
452
452
  slug: string,
453
453
  implementer: string,
454
454
  options: {
455
- log?: (msg: string) => void;
456
- error?: (msg: string) => void;
455
+ log?: (_msg: string) => void;
456
+ error?: (_msg: string) => void;
457
457
  readArtifactFn?: typeof readArtifactFile;
458
458
  deleteArtifactFn?: typeof deleteArtifactFile;
459
459
  tmpDir?: string | null;
@@ -461,11 +461,11 @@ async function consumeImplementerArtifacts(
461
461
  worktree?: string;
462
462
  providerEnabled?: boolean | null;
463
463
  forgejoEnabled?: boolean | null;
464
- readTokenFn?: (user: string, opts?: Record<string, unknown>) => string | null;
465
- getCommentsFn?: (branch: string, token: string) => Promise<unknown[]>;
466
- postCommentFn?: (branch: string, token: string, body: string, opts?: Record<string, unknown>) => unknown;
467
- buildMetadataFooterFn?: (s: string, r?: string) => string;
468
- createEventFn?: (s: string, t: string, p: CreateEventParams, o: CreateEventOptions) => CreateEventResult;
464
+ readTokenFn?: (_user: string, _opts?: Record<string, unknown>) => string | null;
465
+ getCommentsFn?: (_branch: string, _token: string) => Promise<unknown[]>;
466
+ postCommentFn?: (_branch: string, _token: string, _body: string, _opts?: Record<string, unknown>) => unknown;
467
+ buildMetadataFooterFn?: (_s: string, _r?: string) => string;
468
+ createEventFn?: (_s: string, _t: string, _p: CreateEventParams, _o: CreateEventOptions) => CreateEventResult;
469
469
  } = {}
470
470
  ): Promise<{ consumed: boolean; ok?: boolean; disposition?: string | null }> {
471
471
  const log = options.log || fmt.log.plain;
@@ -51,7 +51,7 @@ export function readTextFlag(
51
51
  inlineFlag: string,
52
52
  fileFlag: string,
53
53
  label: string,
54
- options: { readFileSync?: typeof fs.readFileSync; error?: (msg: string) => void; exit?: (code: number) => never } = {}
54
+ options: { readFileSync?: typeof fs.readFileSync; error?: (_msg: string) => void; exit?: (_code: number) => never } = {}
55
55
  ): string | null {
56
56
  const readFileSync = options.readFileSync || fs.readFileSync;
57
57
  const error = options.error || fmt.log.plainError;
@@ -98,8 +98,8 @@ export function formatStaticReviewSuccess(slug: string): string {
98
98
  function repairStaleActiveTaskAfterReview(
99
99
  slug: string,
100
100
  options: {
101
- log?: (msg: string) => void;
102
- error?: (msg: string) => void;
101
+ log?: (_msg: string) => void;
102
+ error?: (_msg: string) => void;
103
103
  getTaskStatusFn?: typeof getTaskStatus;
104
104
  resolveTaskFileFn?: typeof resolveTaskFile;
105
105
  transitionTaskFn?: typeof transitionTask;
@@ -133,7 +133,7 @@ function repairStaleActiveTaskAfterReview(
133
133
 
134
134
  async function commitPersistedReviewOutputs(
135
135
  slug: string,
136
- options: { worktree?: string; taskFile?: string | null; log?: (msg: string) => void; error?: (msg: string) => void } = {}
136
+ options: { worktree?: string; taskFile?: string | null; log?: (_msg: string) => void; error?: (_msg: string) => void } = {}
137
137
  ): Promise<{ ok: boolean; dirty?: boolean; unsafe?: boolean }> {
138
138
  return commitSafeMissionArtifacts(slug, options.worktree || process.cwd(), {
139
139
  taskFile: options.taskFile || null,
@@ -146,8 +146,8 @@ export function postStaticReviewComment(
146
146
  slug: string,
147
147
  message: string,
148
148
  options: {
149
- log?: (msg: string) => void;
150
- error?: (msg: string) => void;
149
+ log?: (_msg: string) => void;
150
+ error?: (_msg: string) => void;
151
151
  resolveTaskFileFn?: typeof resolveTaskFile;
152
152
  getTaskImplementerFn?: typeof getTaskImplementer;
153
153
  resolveWorktreeFn?: typeof resolveWorktree;
@@ -215,7 +215,7 @@ export function postStaticReviewComment(
215
215
  export function performStaticReview(
216
216
  slug: string,
217
217
  options: {
218
- log?: (msg: string) => void;
218
+ log?: (_msg: string) => void;
219
219
  findMissionDir?: typeof findMissionDir;
220
220
  findCheckpoints?: typeof findCheckpoints;
221
221
  readFileSync?: typeof fs.readFileSync;
@@ -338,9 +338,9 @@ export function verifyReview(
338
338
  slug: string,
339
339
  skipGate: boolean | string,
340
340
  options: {
341
- log?: (msg: string) => void;
342
- error?: (msg: string) => void;
343
- exit?: (code: number) => never;
341
+ log?: (_msg: string) => void;
342
+ error?: (_msg: string) => void;
343
+ exit?: (_code: number) => never;
344
344
  resolveWorktreeFn?: typeof resolveWorktree;
345
345
  findMissionDirFn?: typeof findMissionDir;
346
346
  getCurrentBranchFn?: typeof getCurrentBranch;
@@ -522,15 +522,15 @@ export async function submitForReview(
522
522
  slug: string,
523
523
  skipGate: boolean | string,
524
524
  options: {
525
- exit?: (code: number) => never;
525
+ exit?: (_code: number) => never;
526
526
  resolveTaskFileFn?: typeof resolveTaskFile;
527
527
  getTaskImplementerFn?: typeof getTaskImplementer;
528
528
  resolveWorktreeFn?: typeof resolveWorktree;
529
- performHandoffFn?: (slug: string, opts?: Record<string, unknown>) => Promise<Record<string, unknown>>;
529
+ performHandoffFn?: (_slug: string, _opts?: Record<string, unknown>) => Promise<Record<string, unknown>>;
530
530
  readReviewStateFn?: typeof readReviewState;
531
531
  isReviewProviderEnabledFn?: typeof isProviderEnabled;
532
532
  isForgejoReviewEnabledFn?: typeof isProviderEnabled;
533
- log?: (msg: string) => void;
533
+ log?: (_msg: string) => void;
534
534
  } = {}
535
535
  ): Promise<void> {
536
536
  const exit = options.exit || process.exit;
@@ -583,9 +583,9 @@ export async function submitForReview(
583
583
  export async function readComments(
584
584
  slug: string,
585
585
  options: {
586
- log?: (msg: string) => void;
587
- error?: (msg: string) => void;
588
- exit?: (code: number) => never;
586
+ log?: (_msg: string) => void;
587
+ error?: (_msg: string) => void;
588
+ exit?: (_code: number) => never;
589
589
  readTokenFn?: typeof readToken;
590
590
  readReviewStateFn?: typeof readReviewState;
591
591
  resolveReviewUserFn?: typeof resolveReviewUser;
@@ -676,9 +676,9 @@ export async function readComments(
676
676
  export async function pushRound(
677
677
  slug: string,
678
678
  options: {
679
- log?: (msg: string) => void;
680
- error?: (msg: string) => void;
681
- exit?: (code: number) => never;
679
+ log?: (_msg: string) => void;
680
+ error?: (_msg: string) => void;
681
+ exit?: (_code: number) => never;
682
682
  resolveWorktreeFn?: typeof resolveWorktree;
683
683
  resolveTaskFileFn?: typeof resolveTaskFile;
684
684
  getTaskImplementerFn?: typeof getTaskImplementer;
@@ -800,7 +800,7 @@ export async function pushRound(
800
800
  export function showReviewStatus(
801
801
  slug: string,
802
802
  options: {
803
- log?: (msg: string) => void;
803
+ log?: (_msg: string) => void;
804
804
  readReviewStateFn?: typeof readReviewState;
805
805
  resolveWorktreeFn?: typeof resolveWorktree;
806
806
  } = {}
@@ -843,9 +843,9 @@ export function commentRound(
843
843
  slug: string,
844
844
  message: string,
845
845
  options: {
846
- log?: (msg: string) => void;
847
- error?: (msg: string) => void;
848
- exit?: (code: number) => never;
846
+ log?: (_msg: string) => void;
847
+ error?: (_msg: string) => void;
848
+ exit?: (_code: number) => never;
849
849
  readReviewStateFn?: typeof readReviewState;
850
850
  writeReviewStateFn?: typeof writeReviewState;
851
851
  resolveReviewUserFn?: typeof resolveReviewUser;
@@ -902,8 +902,8 @@ export function commentRound(
902
902
  export async function consumeArtifacts(
903
903
  slug: string,
904
904
  options: {
905
- log?: (msg: string) => void;
906
- error?: (msg: string) => void;
905
+ log?: (_msg: string) => void;
906
+ error?: (_msg: string) => void;
907
907
  resolveWorktreeFn?: typeof resolveWorktree;
908
908
  transitionTaskFn?: typeof transitionTask;
909
909
  consumeReviewerArtifactsFn?: typeof consumeReviewerArtifacts;
@@ -1015,9 +1015,9 @@ export function submitReviewRound(
1015
1015
  outcome: string,
1016
1016
  message: string,
1017
1017
  options: {
1018
- log?: (msg: string) => void;
1019
- error?: (msg: string) => void;
1020
- exit?: (code: number) => never;
1018
+ log?: (_msg: string) => void;
1019
+ error?: (_msg: string) => void;
1020
+ exit?: (_code: number) => never;
1021
1021
  transitionTaskFn?: typeof transitionTask;
1022
1022
  readReviewStateFn?: typeof readReviewState;
1023
1023
  writeReviewStateFn?: typeof writeReviewState;
@@ -1178,9 +1178,9 @@ export function submitReviewRound(
1178
1178
  export async function closeMissionPr(
1179
1179
  slug: string,
1180
1180
  options: {
1181
- log?: (msg: string) => void;
1182
- error?: (msg: string) => void;
1183
- exit?: (code: number) => never;
1181
+ log?: (_msg: string) => void;
1182
+ error?: (_msg: string) => void;
1183
+ exit?: (_code: number) => never;
1184
1184
  readTokenFn?: typeof readToken;
1185
1185
  readReviewStateFn?: typeof readReviewState;
1186
1186
  resolveReviewUserFn?: typeof resolveReviewUser;
@@ -1233,9 +1233,9 @@ export function createEventHandler(
1233
1233
  slug: string,
1234
1234
  args: string[],
1235
1235
  options: {
1236
- log?: (msg: string) => void;
1237
- error?: (msg: string) => void;
1238
- exit?: (code: number) => never;
1236
+ log?: (_msg: string) => void;
1237
+ error?: (_msg: string) => void;
1238
+ exit?: (_code: number) => never;
1239
1239
  resolveWorktreeFn?: typeof resolveWorktree;
1240
1240
  readReviewStateFn?: typeof readReviewState;
1241
1241
  } = {}
@@ -1349,9 +1349,9 @@ export function importLegacyHandler(
1349
1349
  slug: string,
1350
1350
  args: string[],
1351
1351
  options: {
1352
- log?: (msg: string) => void;
1353
- error?: (msg: string) => void;
1354
- exit?: (code: number) => never;
1352
+ log?: (_msg: string) => void;
1353
+ error?: (_msg: string) => void;
1354
+ exit?: (_code: number) => never;
1355
1355
  resolveWorktreeFn?: typeof resolveWorktree;
1356
1356
  } = {}
1357
1357
  ): void {
@@ -1383,9 +1383,9 @@ export async function review(
1383
1383
  args: string[],
1384
1384
  options: {
1385
1385
  inferSlugFn?: typeof inferSlug;
1386
- log?: (msg: string) => void;
1387
- error?: (msg: string) => void;
1388
- exit?: (code: number) => never;
1386
+ log?: (_msg: string) => void;
1387
+ error?: (_msg: string) => void;
1388
+ exit?: (_code: number) => never;
1389
1389
  verifyReviewFn?: typeof verifyReview;
1390
1390
  submitForReviewFn?: typeof submitForReview;
1391
1391
  consumeArtifactsFn?: typeof consumeArtifacts;
@@ -207,8 +207,8 @@ export interface CreateEventParams {
207
207
  export interface CreateEventOptions {
208
208
  skipGit?: boolean;
209
209
  gitFn?: typeof git;
210
- log?: (msg: string) => void;
211
- error?: (msg: string) => void;
210
+ log?: (_msg: string) => void;
211
+ error?: (_msg: string) => void;
212
212
  worktree?: string;
213
213
  allowMissingRequiredFields?: boolean;
214
214
  }
@@ -247,7 +247,7 @@ export interface ReadAllEventsOptions {
247
247
  rootDir?: string;
248
248
  readdirSync?: typeof fs.readdirSync;
249
249
  readFileSync?: typeof fs.readFileSync;
250
- error?: (msg: string) => void;
250
+ error?: (_msg: string) => void;
251
251
  }
252
252
 
253
253
  export interface ParseEventResult {
@@ -352,14 +352,14 @@ function classifyComment(comment: { body?: string }): string | null {
352
352
  }
353
353
 
354
354
  export interface ConsumeHumanNotesOptions {
355
- getCommentsFn?: (branch: string, token: string) => Promise<unknown[]>;
356
- createEventFn?: typeof createEvent;
357
- readTokenFn?: (user: string) => string | null;
355
+ getCommentsFn?: (_branch: string, _token: string) => Promise<unknown[]>;
356
+ createEventFn?: typeof createEvent;
357
+ readTokenFn?: (_user: string) => string | null;
358
358
  reviewIdentity?: string | null;
359
359
  forgejoUser?: string | null;
360
360
  worktree?: string;
361
- log?: (msg: string) => void;
362
- error?: (msg: string) => void;
361
+ log?: (_msg: string) => void;
362
+ error?: (_msg: string) => void;
363
363
  }
364
364
 
365
365
  /**
@@ -578,8 +578,8 @@ function createEvent(slug: string, eventType: string, params: CreateEventParams,
578
578
 
579
579
  export interface ImportLegacyArtifactOptions {
580
580
  tmpDir?: string;
581
- log?: (msg: string) => void;
582
- error?: (msg: string) => void;
581
+ log?: (_msg: string) => void;
582
+ error?: (_msg: string) => void;
583
583
  worktree?: string;
584
584
  }
585
585
 
@@ -650,9 +650,9 @@ const LEGACY_ARTIFACT_TO_EVENT_TYPE: Readonly<Record<string, string>> = Object.f
650
650
 
651
651
  export interface ImportAllLegacyOptions {
652
652
  tmpDir?: string;
653
- error?: (msg: string) => void;
653
+ error?: (_msg: string) => void;
654
654
  worktree?: string;
655
- log?: (msg: string) => void;
655
+ log?: (_msg: string) => void;
656
656
  }
657
657
 
658
658
  /**