@usepipr/runtime 0.3.8 → 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
@@ -133,6 +133,26 @@ declare const repositoryRefSchema: z.ZodObject<{
133
133
  slug: z.ZodString;
134
134
  url: z.ZodOptional<z.ZodString>;
135
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">;
136
156
  declare const changeRequestRefSchema: z.ZodObject<{
137
157
  number: z.ZodNumber;
138
158
  title: z.ZodDefault<z.ZodString>;
@@ -160,6 +180,7 @@ declare const changeRequestRefSchema: z.ZodObject<{
160
180
  fork: z.ZodOptional<z.ZodBoolean>;
161
181
  }, z.core.$strict>;
162
182
  isFork: z.ZodOptional<z.ZodBoolean>;
183
+ isDraft: z.ZodOptional<z.ZodBoolean>;
163
184
  }, z.core.$strict>;
164
185
  declare const changeRequestEventContextSchema: z.ZodObject<{
165
186
  eventName: z.ZodString;
@@ -173,6 +194,26 @@ declare const changeRequestEventContextSchema: z.ZodObject<{
173
194
  slug: z.ZodString;
174
195
  url: z.ZodOptional<z.ZodString>;
175
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">>;
176
217
  change: z.ZodObject<{
177
218
  number: z.ZodNumber;
178
219
  title: z.ZodDefault<z.ZodString>;
@@ -200,6 +241,7 @@ declare const changeRequestEventContextSchema: z.ZodObject<{
200
241
  fork: z.ZodOptional<z.ZodBoolean>;
201
242
  }, z.core.$strict>;
202
243
  isFork: z.ZodOptional<z.ZodBoolean>;
244
+ isDraft: z.ZodOptional<z.ZodBoolean>;
203
245
  }, z.core.$strict>;
204
246
  workspace: z.ZodString;
205
247
  }, z.core.$strict>;
@@ -223,6 +265,7 @@ type PiprConfig = z.infer<typeof piprConfigSchema>;
223
265
  type RuntimeSettings = z.infer<typeof runtimeSettingsSchema>;
224
266
  type PlatformInfo = z.infer<typeof platformInfoSchema>;
225
267
  type RepositoryRef = z.infer<typeof repositoryRefSchema>;
268
+ type CodeHostCoordinates = z.infer<typeof codeHostCoordinatesSchema>;
226
269
  type ChangeRequestRef = z.infer<typeof changeRequestRefSchema>;
227
270
  type ChangeRequestEventContext = z.infer<typeof changeRequestEventContextSchema>;
228
271
  type ValidatedReview = z.infer<typeof validatedReviewSchema>;
@@ -288,6 +331,7 @@ declare const inlinePublicationItemSchema: z.ZodObject<{
288
331
  finding: import("@usepipr/sdk").ZodSchema<ReviewFinding>;
289
332
  range: z.ZodType<CommentableRange, unknown, z.core.$ZodTypeInternals<CommentableRange, unknown>>;
290
333
  path: z.ZodString;
334
+ previousPath: z.ZodOptional<z.ZodString>;
291
335
  side: z.ZodType<ReviewSide, unknown, z.core.$ZodTypeInternals<ReviewSide, unknown>>;
292
336
  startLine: z.ZodNumber;
293
337
  endLine: z.ZodNumber;
@@ -305,7 +349,7 @@ declare const threadActionSchema: z.ZodObject<{
305
349
  }>;
306
350
  findingId: z.ZodString;
307
351
  findingHeadSha: z.ZodString;
308
- commentId: z.ZodNumber;
352
+ commentId: z.ZodString;
309
353
  threadId: z.ZodOptional<z.ZodString>;
310
354
  body: z.ZodString;
311
355
  responseKey: z.ZodString;
@@ -346,6 +390,7 @@ declare const publicationPlanSchema: z.ZodObject<{
346
390
  finding: import("@usepipr/sdk").ZodSchema<ReviewFinding>;
347
391
  range: z.ZodType<CommentableRange, unknown, z.core.$ZodTypeInternals<CommentableRange, unknown>>;
348
392
  path: z.ZodString;
393
+ previousPath: z.ZodOptional<z.ZodString>;
349
394
  side: z.ZodType<ReviewSide, unknown, z.core.$ZodTypeInternals<ReviewSide, unknown>>;
350
395
  startLine: z.ZodNumber;
351
396
  endLine: z.ZodNumber;
@@ -420,7 +465,7 @@ declare const publicationPlanSchema: z.ZodObject<{
420
465
  }>;
421
466
  findingId: z.ZodString;
422
467
  findingHeadSha: z.ZodString;
423
- commentId: z.ZodNumber;
468
+ commentId: z.ZodString;
424
469
  threadId: z.ZodOptional<z.ZodString>;
425
470
  body: z.ZodString;
426
471
  responseKey: z.ZodString;
@@ -432,7 +477,7 @@ type PublicationPlan = z.infer<typeof publicationPlanSchema>;
432
477
  type PublicationResult = {
433
478
  mainComment: {
434
479
  action: "created" | "updated";
435
- id: number;
480
+ id: string;
436
481
  };
437
482
  inlineComments: {
438
483
  posted: number;
@@ -452,17 +497,18 @@ declare class PublicationError extends Error {
452
497
  //#endregion
453
498
  //#region src/hosts/types.d.ts
454
499
  type HostEventParseOptions = {
455
- eventPath: string;
500
+ eventPath?: string;
456
501
  env: NodeJS.ProcessEnv;
457
502
  workspace: string;
458
503
  };
504
+ type NativeId = string;
459
505
  type CommandCommentEvent = {
460
506
  eventName: string;
461
507
  action?: string;
462
508
  rawAction?: string;
463
509
  repository: RepositoryRef;
464
510
  changeNumber: number;
465
- commentId: number;
511
+ commentId: NativeId;
466
512
  isChangeRequest: boolean;
467
513
  body: string;
468
514
  actor: string;
@@ -470,17 +516,17 @@ type CommandCommentEvent = {
470
516
  };
471
517
  type CommandResponsePublicationResult = {
472
518
  action: "created" | "updated";
473
- id: number;
519
+ id: NativeId;
474
520
  };
475
521
  type InlineThreadContext = {
476
522
  findingId: string;
477
523
  findingHeadSha: string;
478
- parentCommentId: number;
524
+ parentCommentId: NativeId;
479
525
  parentBody: string;
480
526
  threadId?: string;
481
527
  threadResolved: boolean;
482
528
  comments: Array<{
483
- id: number;
529
+ id: NativeId;
484
530
  body: string;
485
531
  authorLogin?: string;
486
532
  }>;
@@ -491,14 +537,28 @@ type ReviewCommentReplyEvent = {
491
537
  rawAction?: string;
492
538
  repository: RepositoryRef;
493
539
  changeNumber: number;
494
- commentId: number;
495
- parentCommentId?: number;
540
+ commentId: NativeId;
541
+ parentCommentId?: NativeId;
496
542
  body: string;
497
543
  actor: string;
498
544
  workspace: string;
499
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
+ };
500
559
  type LoadedChangeRequest = {
501
560
  repository: RepositoryRef;
561
+ coordinates: CodeHostCoordinates;
502
562
  change: ChangeRequestRef;
503
563
  eventName?: string;
504
564
  action?: string;
@@ -506,13 +566,13 @@ type LoadedChangeRequest = {
506
566
  workspace?: string;
507
567
  };
508
568
  type RepositoryPermission = CommandPermissionLevel | "none";
509
- type CodeHostCheckConclusion = "success" | "failure" | "neutral";
510
- type CodeHostCheckRun = {
511
- id: number | string;
569
+ type CodeHostStatusState = "pending" | "success" | "failure" | "neutral";
570
+ type CodeHostStatus = {
571
+ id: NativeId;
512
572
  name: string;
513
573
  };
514
574
  type CodeHostEvents = {
515
- parseEvent(options: HostEventParseOptions): Promise<ChangeRequestEventContext>;
575
+ parseEvent(options: HostEventParseOptions): Promise<CodeHostEvent>;
516
576
  loadChangeRequest(ref: {
517
577
  repository: RepositoryRef;
518
578
  changeNumber: number;
@@ -521,12 +581,10 @@ type CodeHostEvents = {
521
581
  action?: string;
522
582
  rawAction?: string;
523
583
  }): Promise<LoadedChangeRequest>;
524
- resolveCommandComment(options: HostEventParseOptions): Promise<CommandCommentEvent>;
525
- resolveReviewCommentReply?(options: HostEventParseOptions): Promise<ReviewCommentReplyEvent>;
526
584
  };
527
585
  type CodeHostPermissions = {
528
586
  getRepositoryPermission(options: {
529
- repository: RepositoryRef;
587
+ change: ChangeRequestEventContext;
530
588
  actor: string;
531
589
  }): Promise<RepositoryPermission>;
532
590
  };
@@ -534,7 +592,7 @@ type CodeHostWorkspace = {
534
592
  ensureHeadCheckout(options: {
535
593
  rootDir: string;
536
594
  change: ChangeRequestEventContext;
537
- }): void;
595
+ }): Promise<void>;
538
596
  ensureWorkspaceSafeDirectory?(options: {
539
597
  rootDir: string;
540
598
  env?: NodeJS.ProcessEnv;
@@ -547,7 +605,7 @@ type CodeHostPublication = {
547
605
  }): Promise<PublicationResult>;
548
606
  publishCommandResponse?(options: {
549
607
  change: ChangeRequestEventContext;
550
- sourceCommentId: number;
608
+ sourceCommentId: NativeId;
551
609
  commandName: string;
552
610
  body: string;
553
611
  }): Promise<CommandResponsePublicationResult>;
@@ -570,204 +628,47 @@ type CodeHostComments = {
570
628
  change: ChangeRequestEventContext;
571
629
  }): Promise<InlineThreadContext[]>;
572
630
  };
573
- type CodeHostChecks = {
574
- createCheckRun?(options: {
631
+ type CodeHostStatuses = {
632
+ isAvailable(change: ChangeRequestEventContext): boolean;
633
+ upsert(options: {
575
634
  change: ChangeRequestEventContext;
576
635
  name: string;
636
+ state: CodeHostStatusState;
577
637
  summary?: string;
578
- }): Promise<CodeHostCheckRun>;
579
- updateCheckRun?(options: {
580
- change: ChangeRequestEventContext;
581
- checkRun: CodeHostCheckRun;
582
- conclusion: CodeHostCheckConclusion;
583
- summary?: string;
584
- }): 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;
585
648
  };
586
649
  type CodeHostAdapter = {
587
650
  id: string;
651
+ capabilities: CodeHostCapabilities;
588
652
  events: CodeHostEvents;
589
653
  workspace: CodeHostWorkspace;
590
654
  permissions: CodeHostPermissions;
591
655
  publication?: CodeHostPublication;
592
656
  comments?: CodeHostComments;
593
- checks?: CodeHostChecks;
594
- };
595
- //#endregion
596
- //#region src/hosts/github/command.d.ts
597
- type GitHubPullRequestDetails = {
598
- repository: RepositoryRef;
599
- change: ChangeRequestRef;
600
- };
601
- type GitHubCommandClient = {
602
- getPullRequest(options: {
603
- repository: RepositoryRef;
604
- changeNumber: number;
605
- }): Promise<GitHubPullRequestDetails>;
606
- getRepositoryPermission(options: {
607
- repository: RepositoryRef;
608
- actor: string;
609
- }): Promise<RepositoryPermission>;
610
- };
611
- //#endregion
612
- //#region src/hosts/github/publication-client.d.ts
613
- declare const githubIssueCommentSchema: z.ZodPipe<z.ZodObject<{
614
- id: z.ZodNumber;
615
- body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
616
- user: z.ZodOptional<z.ZodObject<{
617
- login: z.ZodString;
618
- }, z.core.$loose>>;
619
- }, z.core.$loose>, z.ZodTransform<{
620
- id: number;
621
- body: string | null | undefined;
622
- authorLogin: string | undefined;
623
- }, {
624
- [x: string]: unknown;
625
- id: number;
626
- body?: string | null | undefined;
627
- user?: {
628
- [x: string]: unknown;
629
- login: string;
630
- } | undefined;
631
- }>>;
632
- declare const githubReviewCommentSchema: z.ZodPipe<z.ZodObject<{
633
- path: z.ZodOptional<z.ZodString>;
634
- commit_id: z.ZodOptional<z.ZodString>;
635
- line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
636
- start_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
637
- side: z.ZodOptional<z.ZodEnum<{
638
- RIGHT: "RIGHT";
639
- LEFT: "LEFT";
640
- }>>;
641
- start_side: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
642
- RIGHT: "RIGHT";
643
- LEFT: "LEFT";
644
- }>>>;
645
- user: z.ZodOptional<z.ZodObject<{
646
- login: z.ZodString;
647
- }, z.core.$loose>>;
648
- id: z.ZodNumber;
649
- body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
650
- }, z.core.$loose>, z.ZodTransform<{
651
- id: number;
652
- body: string | null | undefined;
653
- authorLogin: string | undefined;
654
- path: string | undefined;
655
- commitId: string | undefined;
656
- line: number | undefined;
657
- startLine: number | undefined;
658
- side: "RIGHT" | "LEFT" | undefined;
659
- startSide: "RIGHT" | "LEFT" | undefined;
660
- }, {
661
- [x: string]: unknown;
662
- id: number;
663
- path?: string | undefined;
664
- commit_id?: string | undefined;
665
- line?: number | null | undefined;
666
- start_line?: number | null | undefined;
667
- side?: "RIGHT" | "LEFT" | undefined;
668
- start_side?: "RIGHT" | "LEFT" | null | undefined;
669
- user?: {
670
- [x: string]: unknown;
671
- login: string;
672
- } | undefined;
673
- body?: string | null | undefined;
674
- }>>;
675
- declare const githubReviewThreadSchema: z.ZodObject<{
676
- id: z.ZodString;
677
- isResolved: z.ZodBoolean;
678
- commentIds: z.ZodArray<z.ZodNumber>;
679
- }, z.core.$strict>;
680
- declare const githubCheckRunSchema: z.ZodObject<{
681
- id: z.ZodNumber;
682
- name: z.ZodString;
683
- }, z.core.$loose>;
684
- type GitHubIssueComment = z.infer<typeof githubIssueCommentSchema>;
685
- type GitHubReviewComment = z.infer<typeof githubReviewCommentSchema>;
686
- type GitHubReviewThread = z.infer<typeof githubReviewThreadSchema>;
687
- type GitHubCheckRun = z.infer<typeof githubCheckRunSchema>;
688
- type GitHubPublicationClient = {
689
- getAuthenticatedUserLogin(): Promise<string>;
690
- getPullRequestHeadSha(options: {
691
- repo: string;
692
- pullRequestNumber: number;
693
- }): Promise<string>;
694
- listIssueComments(options: {
695
- repo: string;
696
- issueNumber: number;
697
- }): Promise<GitHubIssueComment[]>;
698
- createIssueComment(options: {
699
- repo: string;
700
- issueNumber: number;
701
- body: string;
702
- }): Promise<{
703
- id: number;
704
- }>;
705
- updateIssueComment(options: {
706
- repo: string;
707
- commentId: number;
708
- body: string;
709
- }): Promise<{
710
- id: number;
711
- }>;
712
- listReviewComments(options: {
713
- repo: string;
714
- pullRequestNumber: number;
715
- }): Promise<GitHubReviewComment[]>;
716
- listReviewThreads(options: {
717
- repo: string;
718
- pullRequestNumber: number;
719
- }): Promise<GitHubReviewThread[]>;
720
- createReviewComment(options: {
721
- repo: string;
722
- pullRequestNumber: number;
723
- body: string;
724
- path: string;
725
- commit_id: string;
726
- line: number;
727
- side: "RIGHT" | "LEFT";
728
- start_line?: number;
729
- start_side?: "RIGHT" | "LEFT";
730
- }): Promise<{
731
- id: number;
732
- }>;
733
- createReviewCommentReply(options: {
734
- repo: string;
735
- pullRequestNumber: number;
736
- commentId: number;
737
- body: string;
738
- }): Promise<{
739
- id: number;
740
- }>;
741
- resolveReviewThread(options: {
742
- threadId: string;
743
- }): Promise<void>;
744
- createCheckRun(options: {
745
- repo: string;
746
- name: string;
747
- headSha: string;
748
- summary?: string;
749
- }): Promise<GitHubCheckRun>;
750
- updateCheckRun(options: {
751
- repo: string;
752
- checkRunId: number;
753
- name: string;
754
- conclusion: "success" | "failure" | "neutral";
755
- summary?: string;
756
- }): Promise<void>;
657
+ statuses?: CodeHostStatuses;
757
658
  };
758
659
  //#endregion
759
660
  //#region src/shared/logging.d.ts
760
- type ActionLogSink = {
761
- log(record: ActionLogRecord): void;
661
+ type RuntimeLogSink = {
662
+ log(record: RuntimeLogRecord): void;
762
663
  group<T>(name: string, run: () => Promise<T>): Promise<T>;
763
664
  };
764
- type ActionLogRecord = {
665
+ type RuntimeLogRecord = {
765
666
  level: LogLevel;
766
667
  event: string;
767
- fields: ActionLogRecordFields;
668
+ fields: RuntimeLogRecordFields;
768
669
  text?: string;
769
670
  };
770
- type ActionLogRecordFields = Record<string, string | number | boolean | readonly string[]>;
671
+ type RuntimeLogRecordFields = Record<string, string | number | boolean | readonly string[]>;
771
672
  type LogLevel = "info" | "notice" | "warning" | "error" | "debug";
772
673
  //#endregion
773
674
  //#region src/pi/contract.d.ts
@@ -823,7 +724,7 @@ type ReviewRuntimeResult = (ReviewRuntimeBaseResult & {
823
724
  inlineCommentDrafts?: never;
824
725
  });
825
726
  //#endregion
826
- //#region src/action/types.d.ts
727
+ //#region src/host-run/types.d.ts
827
728
  type RuntimeCommandOptions = {
828
729
  rootDir: string;
829
730
  configDir: string;
@@ -837,18 +738,18 @@ type InitCommandOptions = RuntimeCommandOptions & {
837
738
  minimal?: boolean;
838
739
  };
839
740
  type DryRunCommandOptions = RuntimeCommandOptions & {
741
+ host?: string;
840
742
  eventPath: string;
841
743
  };
842
- type ActionCommandOptions = RuntimeCommandOptions & {
843
- eventPath: string;
744
+ type HostRunCommandOptions = RuntimeCommandOptions & {
745
+ host?: string;
746
+ eventPath?: string;
844
747
  dryRun: boolean;
845
- logSink?: ActionLogSink;
748
+ logSink?: RuntimeLogSink;
846
749
  };
847
- type ActionCommandDependencyOptions = ActionCommandOptions & {
750
+ type HostRunCommandDependencyOptions = HostRunCommandOptions & {
848
751
  piExecutable?: string;
849
752
  hostAdapter?: CodeHostAdapter;
850
- githubClient?: GitHubCommandClient;
851
- githubPublicationClient?: GitHubPublicationClient;
852
753
  };
853
754
  type LocalReviewTaskLog = {
854
755
  info(message: string): void;
@@ -859,7 +760,7 @@ type LocalReviewCommandOptions = RuntimeCommandOptions & {
859
760
  baseSha: string;
860
761
  headSha?: string;
861
762
  piExecutable?: string;
862
- logSink?: ActionLogSink;
763
+ logSink?: RuntimeLogSink;
863
764
  taskLog?: LocalReviewTaskLog;
864
765
  };
865
766
  type DryRunCommandResult = {
@@ -877,7 +778,7 @@ type LocalReviewCommandResult = ReviewRuntimeResult & {
877
778
  type PublishedReviewRuntimeResult = Extract<ReviewRuntimeResult, {
878
779
  kind: "review";
879
780
  }>;
880
- type ActionCommandResult = {
781
+ type HostRunCommandResult = {
881
782
  kind: "ignored";
882
783
  reason: string;
883
784
  } | {
@@ -914,20 +815,20 @@ type ActionCommandResult = {
914
815
  };
915
816
  type ValidateCommandResult = RuntimeSettings;
916
817
  //#endregion
917
- //#region src/action/commands.d.ts
818
+ //#region src/host-run/commands.d.ts
918
819
  /** Initializes the official minimal `.pipr` project files. */
919
820
  declare function runInitCommand(options: InitCommandOptions): Promise<InitOfficialMinimalProjectResult>;
920
821
  /** Loads and validates the runtime project configuration. */
921
822
  declare function runValidateCommand(options: RuntimeCommandOptions): Promise<ValidateCommandResult>;
922
823
  /** Returns an inspectable summary of the configured runtime plan. */
923
824
  declare function runInspectCommand(options: RuntimeCommandOptions): Promise<InspectCommandResult>;
924
- /** 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. */
925
826
  declare function runDryRunCommand(options: DryRunCommandOptions): Promise<DryRunCommandResult>;
926
827
  /** Runs configured change-request tasks against local Git base and head revisions. */
927
828
  declare function runLocalReviewCommand(options: LocalReviewCommandOptions): Promise<LocalReviewCommandResult>;
928
- /** Runs the GitHub Action workflow for pull request and issue-comment events. */
929
- declare function runActionCommand(options: ActionCommandOptions): Promise<ActionCommandResult>;
930
- 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>;
931
832
  //#endregion
932
- 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 };
933
- //# sourceMappingURL=commands-C5_GHGxN.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsE/B,uBAAqB,EAAA;;;;;;;;cAMrB,8BAA4B,EAAA;;;;;;;KAEtB,iBAAiB,EAAE,aAAa;KAGhC,aAAa,EAAE,aAAa;KAC5B,kBAAkB,EAAE,aAAa;KACjC,eAAe,EAAE,aAAa;KAC9B,gBAAgB,EAAE,aAAa;KAC/B,sBAAsB,EAAE,aAAa;KACrC,mBAAmB,EAAE,aAAa;KAClC,4BAA4B,EAAE,aAAa;KAE3C,kBAAkB,EAAE,aAAa;KACjC,yBAAyB,EAAE,aAAa;;;KC1MxC;EACV;EACA;EACA;EACA;EACA,QAAQ;IAAQ;IAAc;;EAC9B,UAAU;IAAQ;IAAiB;IAAc;;EAC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