@usepipr/runtime 0.3.7 → 0.4.0

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  # @usepipr/runtime
2
2
 
3
- `@usepipr/runtime` owns Pipr's config loading, Action and local command
3
+ `@usepipr/runtime` owns Pipr's config loading, hosted and local command
4
4
  execution, Diff Manifest creation, Pi execution, review validation, and
5
5
  publication planning.
6
6
 
7
- Most users should interact with this package through the `pipr` CLI or the
8
- GitHub Action. Repository configs should import from `@usepipr/sdk`.
7
+ Most users should interact with this package through the `pipr` CLI or a code
8
+ host integration. Repository configs should import from `@usepipr/sdk`.
9
9
 
10
10
  ## Technical Notes
11
11
 
12
- - The package root exports command APIs for init, Action runs, dry runs,
12
+ - The package root exports command APIs for init, hosted runs, dry runs,
13
13
  config checks, plan inspection, and local review.
14
14
  - `./runtime-tools-extension` is the static Pi runtime tools extension loaded
15
15
  during condensed Diff Manifest runs.
@@ -23,12 +23,12 @@ GitHub Action. Repository configs should import from `@usepipr/sdk`.
23
23
 
24
24
  | Path | Responsibility |
25
25
  | --- | --- |
26
- | `src/action` | CLI and GitHub Action command orchestration |
26
+ | `src/host-run` | Provider-neutral hosted event orchestration |
27
27
  | `src/config` | `.pipr/config.ts` loading, init files, recipes, and SDK stubs |
28
28
  | `src/diff` | Diff Manifest parsing, projection, ranges, and path filters |
29
29
  | `src/pi` | Pi subprocess contract, runtime tools, and provider wiring |
30
30
  | `src/review` | Task execution, agent prompts, validation, comments, and publication plans |
31
- | `src/hosts` | Code host adapters for GitHub and local runs |
31
+ | `src/hosts` | Code host adapters and local-run integration |
32
32
 
33
33
  ## Local Checks
34
34
 
@@ -7,7 +7,7 @@ type InitOfficialMinimalProjectResult = {
7
7
  created: string[];
8
8
  overwritten: string[];
9
9
  };
10
- declare const supportedOfficialInitAdapters: readonly ["github"];
10
+ declare const supportedOfficialInitAdapters: readonly ["github", "gitlab", "azure-devops", "bitbucket"];
11
11
  type OfficialInitAdapter = (typeof supportedOfficialInitAdapters)[number];
12
12
  //#endregion
13
13
  //#region src/types.d.ts
@@ -58,6 +58,9 @@ declare const piprConfigSchema: z.ZodObject<{
58
58
  }>;
59
59
  }, z.core.$strict>;
60
60
  }, z.core.$strict>;
61
+ showHeader: z.ZodDefault<z.ZodBoolean>;
62
+ showFooter: z.ZodDefault<z.ZodBoolean>;
63
+ showStats: z.ZodDefault<z.ZodBoolean>;
61
64
  }, z.core.$strict>;
62
65
  limits: z.ZodOptional<z.ZodObject<{
63
66
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
@@ -105,6 +108,9 @@ declare const runtimeSettingsSchema: z.ZodObject<{
105
108
  }>;
106
109
  }, z.core.$strict>;
107
110
  }, z.core.$strict>;
111
+ showHeader: z.ZodDefault<z.ZodBoolean>;
112
+ showFooter: z.ZodDefault<z.ZodBoolean>;
113
+ showStats: z.ZodDefault<z.ZodBoolean>;
108
114
  }, z.core.$strict>;
109
115
  limits: z.ZodOptional<z.ZodObject<{
110
116
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
@@ -127,6 +133,26 @@ declare const repositoryRefSchema: z.ZodObject<{
127
133
  slug: z.ZodString;
128
134
  url: z.ZodOptional<z.ZodString>;
129
135
  }, z.core.$strict>;
136
+ declare const codeHostCoordinatesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
137
+ provider: z.ZodLiteral<"github">;
138
+ owner: z.ZodString;
139
+ repository: z.ZodString;
140
+ }, z.core.$strict>, z.ZodObject<{
141
+ provider: z.ZodLiteral<"gitlab">;
142
+ projectId: z.ZodString;
143
+ projectPath: z.ZodString;
144
+ }, z.core.$strict>, z.ZodObject<{
145
+ provider: z.ZodLiteral<"bitbucket">;
146
+ workspace: z.ZodString;
147
+ repository: z.ZodString;
148
+ repositoryUuid: z.ZodOptional<z.ZodString>;
149
+ }, z.core.$strict>, z.ZodObject<{
150
+ provider: z.ZodLiteral<"azure-devops">;
151
+ organization: z.ZodString;
152
+ project: z.ZodString;
153
+ projectId: z.ZodOptional<z.ZodString>;
154
+ repositoryId: z.ZodString;
155
+ }, z.core.$strict>], "provider">;
130
156
  declare const changeRequestRefSchema: z.ZodObject<{
131
157
  number: z.ZodNumber;
132
158
  title: z.ZodDefault<z.ZodString>;
@@ -154,6 +180,7 @@ declare const changeRequestRefSchema: z.ZodObject<{
154
180
  fork: z.ZodOptional<z.ZodBoolean>;
155
181
  }, z.core.$strict>;
156
182
  isFork: z.ZodOptional<z.ZodBoolean>;
183
+ isDraft: z.ZodOptional<z.ZodBoolean>;
157
184
  }, z.core.$strict>;
158
185
  declare const changeRequestEventContextSchema: z.ZodObject<{
159
186
  eventName: z.ZodString;
@@ -167,6 +194,26 @@ declare const changeRequestEventContextSchema: z.ZodObject<{
167
194
  slug: z.ZodString;
168
195
  url: z.ZodOptional<z.ZodString>;
169
196
  }, z.core.$strict>;
197
+ coordinates: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
198
+ provider: z.ZodLiteral<"github">;
199
+ owner: z.ZodString;
200
+ repository: z.ZodString;
201
+ }, z.core.$strict>, z.ZodObject<{
202
+ provider: z.ZodLiteral<"gitlab">;
203
+ projectId: z.ZodString;
204
+ projectPath: z.ZodString;
205
+ }, z.core.$strict>, z.ZodObject<{
206
+ provider: z.ZodLiteral<"bitbucket">;
207
+ workspace: z.ZodString;
208
+ repository: z.ZodString;
209
+ repositoryUuid: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strict>, z.ZodObject<{
211
+ provider: z.ZodLiteral<"azure-devops">;
212
+ organization: z.ZodString;
213
+ project: z.ZodString;
214
+ projectId: z.ZodOptional<z.ZodString>;
215
+ repositoryId: z.ZodString;
216
+ }, z.core.$strict>], "provider">>;
170
217
  change: z.ZodObject<{
171
218
  number: z.ZodNumber;
172
219
  title: z.ZodDefault<z.ZodString>;
@@ -194,6 +241,7 @@ declare const changeRequestEventContextSchema: z.ZodObject<{
194
241
  fork: z.ZodOptional<z.ZodBoolean>;
195
242
  }, z.core.$strict>;
196
243
  isFork: z.ZodOptional<z.ZodBoolean>;
244
+ isDraft: z.ZodOptional<z.ZodBoolean>;
197
245
  }, z.core.$strict>;
198
246
  workspace: z.ZodString;
199
247
  }, z.core.$strict>;
@@ -217,6 +265,7 @@ type PiprConfig = z.infer<typeof piprConfigSchema>;
217
265
  type RuntimeSettings = z.infer<typeof runtimeSettingsSchema>;
218
266
  type PlatformInfo = z.infer<typeof platformInfoSchema>;
219
267
  type RepositoryRef = z.infer<typeof repositoryRefSchema>;
268
+ type CodeHostCoordinates = z.infer<typeof codeHostCoordinatesSchema>;
220
269
  type ChangeRequestRef = z.infer<typeof changeRequestRefSchema>;
221
270
  type ChangeRequestEventContext = z.infer<typeof changeRequestEventContextSchema>;
222
271
  type ValidatedReview = z.infer<typeof validatedReviewSchema>;
@@ -261,6 +310,19 @@ declare const priorReviewStateSchema: z.ZodObject<{
261
310
  lastSeenHeadSha: z.ZodString;
262
311
  lastCommentedHeadSha: z.ZodOptional<z.ZodString>;
263
312
  }, z.core.$strict>>;
313
+ stats: z.ZodOptional<z.ZodObject<{
314
+ models: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
315
+ agentRuns: z.ZodNumber;
316
+ durationMs: z.ZodNumber;
317
+ inputTokens: z.ZodNumber;
318
+ outputTokens: z.ZodNumber;
319
+ costUsd: z.ZodNumber;
320
+ usageStatus: z.ZodEnum<{
321
+ complete: "complete";
322
+ partial: "partial";
323
+ unavailable: "unavailable";
324
+ }>;
325
+ }, z.core.$strict>>;
264
326
  }, z.core.$strict>;
265
327
  type PriorReviewState = z.infer<typeof priorReviewStateSchema>;
266
328
  //#endregion
@@ -269,6 +331,7 @@ declare const inlinePublicationItemSchema: z.ZodObject<{
269
331
  finding: import("@usepipr/sdk").ZodSchema<ReviewFinding>;
270
332
  range: z.ZodType<CommentableRange, unknown, z.core.$ZodTypeInternals<CommentableRange, unknown>>;
271
333
  path: z.ZodString;
334
+ previousPath: z.ZodOptional<z.ZodString>;
272
335
  side: z.ZodType<ReviewSide, unknown, z.core.$ZodTypeInternals<ReviewSide, unknown>>;
273
336
  startLine: z.ZodNumber;
274
337
  endLine: z.ZodNumber;
@@ -286,7 +349,7 @@ declare const threadActionSchema: z.ZodObject<{
286
349
  }>;
287
350
  findingId: z.ZodString;
288
351
  findingHeadSha: z.ZodString;
289
- commentId: z.ZodNumber;
352
+ commentId: z.ZodString;
290
353
  threadId: z.ZodOptional<z.ZodString>;
291
354
  body: z.ZodString;
292
355
  responseKey: z.ZodString;
@@ -327,6 +390,7 @@ declare const publicationPlanSchema: z.ZodObject<{
327
390
  finding: import("@usepipr/sdk").ZodSchema<ReviewFinding>;
328
391
  range: z.ZodType<CommentableRange, unknown, z.core.$ZodTypeInternals<CommentableRange, unknown>>;
329
392
  path: z.ZodString;
393
+ previousPath: z.ZodOptional<z.ZodString>;
330
394
  side: z.ZodType<ReviewSide, unknown, z.core.$ZodTypeInternals<ReviewSide, unknown>>;
331
395
  startLine: z.ZodNumber;
332
396
  endLine: z.ZodNumber;
@@ -380,6 +444,19 @@ declare const publicationPlanSchema: z.ZodObject<{
380
444
  lastSeenHeadSha: z.ZodString;
381
445
  lastCommentedHeadSha: z.ZodOptional<z.ZodString>;
382
446
  }, z.core.$strict>>;
447
+ stats: z.ZodOptional<z.ZodObject<{
448
+ models: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
449
+ agentRuns: z.ZodNumber;
450
+ durationMs: z.ZodNumber;
451
+ inputTokens: z.ZodNumber;
452
+ outputTokens: z.ZodNumber;
453
+ costUsd: z.ZodNumber;
454
+ usageStatus: z.ZodEnum<{
455
+ complete: "complete";
456
+ partial: "partial";
457
+ unavailable: "unavailable";
458
+ }>;
459
+ }, z.core.$strict>>;
383
460
  }, z.core.$strict>;
384
461
  threadActions: z.ZodArray<z.ZodObject<{
385
462
  kind: z.ZodEnum<{
@@ -388,7 +465,7 @@ declare const publicationPlanSchema: z.ZodObject<{
388
465
  }>;
389
466
  findingId: z.ZodString;
390
467
  findingHeadSha: z.ZodString;
391
- commentId: z.ZodNumber;
468
+ commentId: z.ZodString;
392
469
  threadId: z.ZodOptional<z.ZodString>;
393
470
  body: z.ZodString;
394
471
  responseKey: z.ZodString;
@@ -400,7 +477,7 @@ type PublicationPlan = z.infer<typeof publicationPlanSchema>;
400
477
  type PublicationResult = {
401
478
  mainComment: {
402
479
  action: "created" | "updated";
403
- id: number;
480
+ id: string;
404
481
  };
405
482
  inlineComments: {
406
483
  posted: number;
@@ -420,17 +497,18 @@ declare class PublicationError extends Error {
420
497
  //#endregion
421
498
  //#region src/hosts/types.d.ts
422
499
  type HostEventParseOptions = {
423
- eventPath: string;
500
+ eventPath?: string;
424
501
  env: NodeJS.ProcessEnv;
425
502
  workspace: string;
426
503
  };
504
+ type NativeId = string;
427
505
  type CommandCommentEvent = {
428
506
  eventName: string;
429
507
  action?: string;
430
508
  rawAction?: string;
431
509
  repository: RepositoryRef;
432
510
  changeNumber: number;
433
- commentId: number;
511
+ commentId: NativeId;
434
512
  isChangeRequest: boolean;
435
513
  body: string;
436
514
  actor: string;
@@ -438,17 +516,17 @@ type CommandCommentEvent = {
438
516
  };
439
517
  type CommandResponsePublicationResult = {
440
518
  action: "created" | "updated";
441
- id: number;
519
+ id: NativeId;
442
520
  };
443
521
  type InlineThreadContext = {
444
522
  findingId: string;
445
523
  findingHeadSha: string;
446
- parentCommentId: number;
524
+ parentCommentId: NativeId;
447
525
  parentBody: string;
448
526
  threadId?: string;
449
527
  threadResolved: boolean;
450
528
  comments: Array<{
451
- id: number;
529
+ id: NativeId;
452
530
  body: string;
453
531
  authorLogin?: string;
454
532
  }>;
@@ -459,14 +537,28 @@ type ReviewCommentReplyEvent = {
459
537
  rawAction?: string;
460
538
  repository: RepositoryRef;
461
539
  changeNumber: number;
462
- commentId: number;
463
- parentCommentId?: number;
540
+ commentId: NativeId;
541
+ parentCommentId?: NativeId;
464
542
  body: string;
465
543
  actor: string;
466
544
  workspace: string;
467
545
  };
546
+ type CodeHostEvent = {
547
+ kind: "ignored";
548
+ reason: string;
549
+ } | {
550
+ kind: "change-request";
551
+ change: ChangeRequestEventContext;
552
+ } | {
553
+ kind: "command-comment";
554
+ comment: CommandCommentEvent;
555
+ } | {
556
+ kind: "review-comment-reply";
557
+ reply: ReviewCommentReplyEvent;
558
+ };
468
559
  type LoadedChangeRequest = {
469
560
  repository: RepositoryRef;
561
+ coordinates: CodeHostCoordinates;
470
562
  change: ChangeRequestRef;
471
563
  eventName?: string;
472
564
  action?: string;
@@ -474,13 +566,13 @@ type LoadedChangeRequest = {
474
566
  workspace?: string;
475
567
  };
476
568
  type RepositoryPermission = CommandPermissionLevel | "none";
477
- type CodeHostCheckConclusion = "success" | "failure" | "neutral";
478
- type CodeHostCheckRun = {
479
- id: number | string;
569
+ type CodeHostStatusState = "pending" | "success" | "failure" | "neutral";
570
+ type CodeHostStatus = {
571
+ id: NativeId;
480
572
  name: string;
481
573
  };
482
574
  type CodeHostEvents = {
483
- parseEvent(options: HostEventParseOptions): Promise<ChangeRequestEventContext>;
575
+ parseEvent(options: HostEventParseOptions): Promise<CodeHostEvent>;
484
576
  loadChangeRequest(ref: {
485
577
  repository: RepositoryRef;
486
578
  changeNumber: number;
@@ -489,12 +581,10 @@ type CodeHostEvents = {
489
581
  action?: string;
490
582
  rawAction?: string;
491
583
  }): Promise<LoadedChangeRequest>;
492
- resolveCommandComment(options: HostEventParseOptions): Promise<CommandCommentEvent>;
493
- resolveReviewCommentReply?(options: HostEventParseOptions): Promise<ReviewCommentReplyEvent>;
494
584
  };
495
585
  type CodeHostPermissions = {
496
586
  getRepositoryPermission(options: {
497
- repository: RepositoryRef;
587
+ change: ChangeRequestEventContext;
498
588
  actor: string;
499
589
  }): Promise<RepositoryPermission>;
500
590
  };
@@ -502,7 +592,7 @@ type CodeHostWorkspace = {
502
592
  ensureHeadCheckout(options: {
503
593
  rootDir: string;
504
594
  change: ChangeRequestEventContext;
505
- }): void;
595
+ }): Promise<void>;
506
596
  ensureWorkspaceSafeDirectory?(options: {
507
597
  rootDir: string;
508
598
  env?: NodeJS.ProcessEnv;
@@ -515,7 +605,7 @@ type CodeHostPublication = {
515
605
  }): Promise<PublicationResult>;
516
606
  publishCommandResponse?(options: {
517
607
  change: ChangeRequestEventContext;
518
- sourceCommentId: number;
608
+ sourceCommentId: NativeId;
519
609
  commandName: string;
520
610
  body: string;
521
611
  }): Promise<CommandResponsePublicationResult>;
@@ -538,204 +628,47 @@ type CodeHostComments = {
538
628
  change: ChangeRequestEventContext;
539
629
  }): Promise<InlineThreadContext[]>;
540
630
  };
541
- type CodeHostChecks = {
542
- createCheckRun?(options: {
631
+ type CodeHostStatuses = {
632
+ isAvailable(change: ChangeRequestEventContext): boolean;
633
+ upsert(options: {
543
634
  change: ChangeRequestEventContext;
544
635
  name: string;
636
+ state: CodeHostStatusState;
545
637
  summary?: string;
546
- }): Promise<CodeHostCheckRun>;
547
- updateCheckRun?(options: {
548
- change: ChangeRequestEventContext;
549
- checkRun: CodeHostCheckRun;
550
- conclusion: CodeHostCheckConclusion;
551
- summary?: string;
552
- }): Promise<void>;
638
+ status?: CodeHostStatus;
639
+ }): Promise<CodeHostStatus>;
640
+ };
641
+ type CodeHostCapabilities = {
642
+ commandComments: boolean;
643
+ reviewCommentReplies: boolean;
644
+ threadResolution: boolean;
645
+ multilineInlineComments: boolean;
646
+ suggestedChanges: boolean;
647
+ statuses: boolean;
553
648
  };
554
649
  type CodeHostAdapter = {
555
650
  id: string;
651
+ capabilities: CodeHostCapabilities;
556
652
  events: CodeHostEvents;
557
653
  workspace: CodeHostWorkspace;
558
654
  permissions: CodeHostPermissions;
559
655
  publication?: CodeHostPublication;
560
656
  comments?: CodeHostComments;
561
- checks?: CodeHostChecks;
562
- };
563
- //#endregion
564
- //#region src/hosts/github/command.d.ts
565
- type GitHubPullRequestDetails = {
566
- repository: RepositoryRef;
567
- change: ChangeRequestRef;
568
- };
569
- type GitHubCommandClient = {
570
- getPullRequest(options: {
571
- repository: RepositoryRef;
572
- changeNumber: number;
573
- }): Promise<GitHubPullRequestDetails>;
574
- getRepositoryPermission(options: {
575
- repository: RepositoryRef;
576
- actor: string;
577
- }): Promise<RepositoryPermission>;
578
- };
579
- //#endregion
580
- //#region src/hosts/github/publication-client.d.ts
581
- declare const githubIssueCommentSchema: z.ZodPipe<z.ZodObject<{
582
- id: z.ZodNumber;
583
- body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
584
- user: z.ZodOptional<z.ZodObject<{
585
- login: z.ZodString;
586
- }, z.core.$loose>>;
587
- }, z.core.$loose>, z.ZodTransform<{
588
- id: number;
589
- body: string | null | undefined;
590
- authorLogin: string | undefined;
591
- }, {
592
- [x: string]: unknown;
593
- id: number;
594
- body?: string | null | undefined;
595
- user?: {
596
- [x: string]: unknown;
597
- login: string;
598
- } | undefined;
599
- }>>;
600
- declare const githubReviewCommentSchema: z.ZodPipe<z.ZodObject<{
601
- path: z.ZodOptional<z.ZodString>;
602
- commit_id: z.ZodOptional<z.ZodString>;
603
- line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
604
- start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
605
- side: z.ZodOptional<z.ZodEnum<{
606
- RIGHT: "RIGHT";
607
- LEFT: "LEFT";
608
- }>>;
609
- start_side: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
610
- RIGHT: "RIGHT";
611
- LEFT: "LEFT";
612
- }>>>;
613
- user: z.ZodOptional<z.ZodObject<{
614
- login: z.ZodString;
615
- }, z.core.$loose>>;
616
- id: z.ZodNumber;
617
- body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
618
- }, z.core.$loose>, z.ZodTransform<{
619
- id: number;
620
- body: string | null | undefined;
621
- authorLogin: string | undefined;
622
- path: string | undefined;
623
- commitId: string | undefined;
624
- line: number | undefined;
625
- startLine: number | undefined;
626
- side: "RIGHT" | "LEFT" | undefined;
627
- startSide: "RIGHT" | "LEFT" | undefined;
628
- }, {
629
- [x: string]: unknown;
630
- id: number;
631
- path?: string | undefined;
632
- commit_id?: string | undefined;
633
- line?: number | null | undefined;
634
- start_line?: number | null | undefined;
635
- side?: "RIGHT" | "LEFT" | undefined;
636
- start_side?: "RIGHT" | "LEFT" | null | undefined;
637
- user?: {
638
- [x: string]: unknown;
639
- login: string;
640
- } | undefined;
641
- body?: string | null | undefined;
642
- }>>;
643
- declare const githubReviewThreadSchema: z.ZodObject<{
644
- id: z.ZodString;
645
- isResolved: z.ZodBoolean;
646
- commentIds: z.ZodArray<z.ZodNumber>;
647
- }, z.core.$strict>;
648
- declare const githubCheckRunSchema: z.ZodObject<{
649
- id: z.ZodNumber;
650
- name: z.ZodString;
651
- }, z.core.$loose>;
652
- type GitHubIssueComment = z.infer<typeof githubIssueCommentSchema>;
653
- type GitHubReviewComment = z.infer<typeof githubReviewCommentSchema>;
654
- type GitHubReviewThread = z.infer<typeof githubReviewThreadSchema>;
655
- type GitHubCheckRun = z.infer<typeof githubCheckRunSchema>;
656
- type GitHubPublicationClient = {
657
- getAuthenticatedUserLogin(): Promise<string>;
658
- getPullRequestHeadSha(options: {
659
- repo: string;
660
- pullRequestNumber: number;
661
- }): Promise<string>;
662
- listIssueComments(options: {
663
- repo: string;
664
- issueNumber: number;
665
- }): Promise<GitHubIssueComment[]>;
666
- createIssueComment(options: {
667
- repo: string;
668
- issueNumber: number;
669
- body: string;
670
- }): Promise<{
671
- id: number;
672
- }>;
673
- updateIssueComment(options: {
674
- repo: string;
675
- commentId: number;
676
- body: string;
677
- }): Promise<{
678
- id: number;
679
- }>;
680
- listReviewComments(options: {
681
- repo: string;
682
- pullRequestNumber: number;
683
- }): Promise<GitHubReviewComment[]>;
684
- listReviewThreads(options: {
685
- repo: string;
686
- pullRequestNumber: number;
687
- }): Promise<GitHubReviewThread[]>;
688
- createReviewComment(options: {
689
- repo: string;
690
- pullRequestNumber: number;
691
- body: string;
692
- path: string;
693
- commit_id: string;
694
- line: number;
695
- side: "RIGHT" | "LEFT";
696
- start_line?: number;
697
- start_side?: "RIGHT" | "LEFT";
698
- }): Promise<{
699
- id: number;
700
- }>;
701
- createReviewCommentReply(options: {
702
- repo: string;
703
- pullRequestNumber: number;
704
- commentId: number;
705
- body: string;
706
- }): Promise<{
707
- id: number;
708
- }>;
709
- resolveReviewThread(options: {
710
- threadId: string;
711
- }): Promise<void>;
712
- createCheckRun(options: {
713
- repo: string;
714
- name: string;
715
- headSha: string;
716
- summary?: string;
717
- }): Promise<GitHubCheckRun>;
718
- updateCheckRun(options: {
719
- repo: string;
720
- checkRunId: number;
721
- name: string;
722
- conclusion: "success" | "failure" | "neutral";
723
- summary?: string;
724
- }): Promise<void>;
657
+ statuses?: CodeHostStatuses;
725
658
  };
726
659
  //#endregion
727
660
  //#region src/shared/logging.d.ts
728
- type ActionLogSink = {
729
- log(record: ActionLogRecord): void;
661
+ type RuntimeLogSink = {
662
+ log(record: RuntimeLogRecord): void;
730
663
  group<T>(name: string, run: () => Promise<T>): Promise<T>;
731
664
  };
732
- type ActionLogRecord = {
665
+ type RuntimeLogRecord = {
733
666
  level: LogLevel;
734
667
  event: string;
735
- fields: ActionLogRecordFields;
668
+ fields: RuntimeLogRecordFields;
736
669
  text?: string;
737
670
  };
738
- type ActionLogRecordFields = Record<string, string | number | boolean | readonly string[]>;
671
+ type RuntimeLogRecordFields = Record<string, string | number | boolean | readonly string[]>;
739
672
  type LogLevel = "info" | "notice" | "warning" | "error" | "debug";
740
673
  //#endregion
741
674
  //#region src/pi/contract.d.ts
@@ -791,7 +724,7 @@ type ReviewRuntimeResult = (ReviewRuntimeBaseResult & {
791
724
  inlineCommentDrafts?: never;
792
725
  });
793
726
  //#endregion
794
- //#region src/action/types.d.ts
727
+ //#region src/host-run/types.d.ts
795
728
  type RuntimeCommandOptions = {
796
729
  rootDir: string;
797
730
  configDir: string;
@@ -805,18 +738,18 @@ type InitCommandOptions = RuntimeCommandOptions & {
805
738
  minimal?: boolean;
806
739
  };
807
740
  type DryRunCommandOptions = RuntimeCommandOptions & {
741
+ host?: string;
808
742
  eventPath: string;
809
743
  };
810
- type ActionCommandOptions = RuntimeCommandOptions & {
811
- eventPath: string;
744
+ type HostRunCommandOptions = RuntimeCommandOptions & {
745
+ host?: string;
746
+ eventPath?: string;
812
747
  dryRun: boolean;
813
- logSink?: ActionLogSink;
748
+ logSink?: RuntimeLogSink;
814
749
  };
815
- type ActionCommandDependencyOptions = ActionCommandOptions & {
750
+ type HostRunCommandDependencyOptions = HostRunCommandOptions & {
816
751
  piExecutable?: string;
817
752
  hostAdapter?: CodeHostAdapter;
818
- githubClient?: GitHubCommandClient;
819
- githubPublicationClient?: GitHubPublicationClient;
820
753
  };
821
754
  type LocalReviewTaskLog = {
822
755
  info(message: string): void;
@@ -827,7 +760,7 @@ type LocalReviewCommandOptions = RuntimeCommandOptions & {
827
760
  baseSha: string;
828
761
  headSha?: string;
829
762
  piExecutable?: string;
830
- logSink?: ActionLogSink;
763
+ logSink?: RuntimeLogSink;
831
764
  taskLog?: LocalReviewTaskLog;
832
765
  };
833
766
  type DryRunCommandResult = {
@@ -845,7 +778,7 @@ type LocalReviewCommandResult = ReviewRuntimeResult & {
845
778
  type PublishedReviewRuntimeResult = Extract<ReviewRuntimeResult, {
846
779
  kind: "review";
847
780
  }>;
848
- type ActionCommandResult = {
781
+ type HostRunCommandResult = {
849
782
  kind: "ignored";
850
783
  reason: string;
851
784
  } | {
@@ -882,20 +815,20 @@ type ActionCommandResult = {
882
815
  };
883
816
  type ValidateCommandResult = RuntimeSettings;
884
817
  //#endregion
885
- //#region src/action/commands.d.ts
818
+ //#region src/host-run/commands.d.ts
886
819
  /** Initializes the official minimal `.pipr` project files. */
887
820
  declare function runInitCommand(options: InitCommandOptions): Promise<InitOfficialMinimalProjectResult>;
888
821
  /** Loads and validates the runtime project configuration. */
889
822
  declare function runValidateCommand(options: RuntimeCommandOptions): Promise<ValidateCommandResult>;
890
823
  /** Returns an inspectable summary of the configured runtime plan. */
891
824
  declare function runInspectCommand(options: RuntimeCommandOptions): Promise<InspectCommandResult>;
892
- /** Loads the runtime config and pull request event without running review publication. */
825
+ /** Loads the runtime config and change request event without running review publication. */
893
826
  declare function runDryRunCommand(options: DryRunCommandOptions): Promise<DryRunCommandResult>;
894
827
  /** Runs configured change-request tasks against local Git base and head revisions. */
895
828
  declare function runLocalReviewCommand(options: LocalReviewCommandOptions): Promise<LocalReviewCommandResult>;
896
- /** Runs the GitHub Action workflow for pull request and issue-comment events. */
897
- declare function runActionCommand(options: ActionCommandOptions): Promise<ActionCommandResult>;
898
- declare function runActionCommandWithDependencies(options: ActionCommandDependencyOptions): Promise<ActionCommandResult>;
829
+ /** Runs a normalized code host event through the selected adapter. */
830
+ declare function runHostRunCommand(options: HostRunCommandOptions): Promise<HostRunCommandResult>;
831
+ declare function runHostRunCommandWithDependencies(options: HostRunCommandDependencyOptions): Promise<HostRunCommandResult>;
899
832
  //#endregion
900
- export { PlatformInfo as A, GitHubPublicationClient as C, ChangeRequestRef as D, ChangeRequestEventContext as E, supportedOfficialInitAdapters as F, RepositoryRef as M, RuntimeSettings as N, DiffManifest as O, OfficialInitAdapter as P, ActionLogSink as S, PublicationResult as T, piBuiltinToolNames as _, runInspectCommand as a, piThinkingLevels as b, ActionCommandOptions as c, DryRunCommandResult as d, InitCommandOptions as f, RuntimeCommandOptions as g, LocalReviewCommandResult as h, runInitCommand as i, ProviderConfig as j, PiprConfig as k, ActionCommandResult as l, LocalReviewCommandOptions as m, runActionCommandWithDependencies as n, runLocalReviewCommand as o, InspectCommandResult as p, runDryRunCommand as r, runValidateCommand as s, runActionCommand as t, DryRunCommandOptions as u, piReadOnlyToolNames as v, PublicationError as w, ActionLogRecord as x, piRequiredCliFlags as y };
901
- //# sourceMappingURL=commands-Bcta0T4L.d.mts.map
833
+ export { PiprConfig as A, CodeHostAdapter as C, ChangeRequestEventContext as D, PublicationResult as E, OfficialInitAdapter as F, supportedOfficialInitAdapters as I, ProviderConfig as M, RepositoryRef as N, ChangeRequestRef as O, RuntimeSettings as P, RuntimeLogSink as S, PublicationError as T, piBuiltinToolNames as _, runInspectCommand as a, piThinkingLevels as b, DryRunCommandOptions as c, HostRunCommandResult as d, InitCommandOptions as f, RuntimeCommandOptions as g, LocalReviewCommandResult as h, runInitCommand as i, PlatformInfo as j, DiffManifest as k, DryRunCommandResult as l, LocalReviewCommandOptions as m, runHostRunCommand as n, runLocalReviewCommand as o, InspectCommandResult as p, runHostRunCommandWithDependencies as r, runValidateCommand as s, runDryRunCommand as t, HostRunCommandOptions as u, piReadOnlyToolNames as v, RepositoryPermission as w, RuntimeLogRecord as x, piRequiredCliFlags as y };
834
+ //# sourceMappingURL=commands-YFjB3wx8.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands-YFjB3wx8.d.mts","names":[],"sources":["../src/config/init.ts","../src/types.ts","../src/config/project.ts","../src/review/prior-state.ts","../src/review/comment.ts","../src/review/publication-result.ts","../src/hosts/types.ts","../src/shared/logging.ts","../src/pi/contract.ts","../src/review/task/task-output.ts","../src/review/task/task-runtime.ts","../src/host-run/types.ts","../src/host-run/commands.ts"],"mappings":";;;;KAsBY;EACV;EACA;EACA;;cAGW;KAOD,8BAA8B;;;cCJpC,sBAAoB,EAAA;;;;;;;;;;;;;;cAyBpB,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBhB,uBAAqB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAMrB,oBAAkB,EAAA;;;;cAKlB,qBAAmB,EAAA;;;;cAKnB,2BAAyB,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;;;cAkCzB,wBAAsB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAYtB,iCAA+B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;c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