@blogic-cz/agent-tools 1.4.0 → 1.4.1

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.
@@ -24,7 +24,7 @@ export declare const fetchPRView: (prNumber: number | null) => Effect.Effect<{
24
24
  reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
25
25
  reviewRequests: import("#gh/types").ReviewRequest[];
26
26
  headRefOid?: string;
27
- }, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
27
+ }, import("#gh/service").GhError, GitHubService>;
28
28
  export declare const viewPR: (prNumber: number | null) => Effect.Effect<{
29
29
  baseSha: string | null;
30
30
  headSha: string | null;
@@ -44,7 +44,7 @@ export declare const viewPR: (prNumber: number | null) => Effect.Effect<{
44
44
  reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
45
45
  reviewRequests: import("#gh/types").ReviewRequest[];
46
46
  headRefOid?: string;
47
- }, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
47
+ }, import("#gh/service").GhError, GitHubService>;
48
48
  export declare const detectPRStatus: () => Effect.Effect<{
49
49
  mode: "none";
50
50
  branches: BranchPRDetail[];
@@ -68,7 +68,7 @@ export declare const listPRs: (opts: {
68
68
  base: string | null;
69
69
  head: string | null;
70
70
  search: string | null;
71
- }) => Effect.Effect<PRInfo[], GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
71
+ }) => Effect.Effect<PRInfo[], import("#gh/service").GhError, GitHubService>;
72
72
  export declare const waitForMergeable: (pr: number | null, timeoutSeconds: number) => Effect.Effect<{
73
73
  baseSha: string | null;
74
74
  headSha: string | null;
@@ -88,20 +88,20 @@ export declare const waitForMergeable: (pr: number | null, timeoutSeconds: numbe
88
88
  reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
89
89
  reviewRequests: import("#gh/types").ReviewRequest[];
90
90
  headRefOid?: string;
91
- }, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
91
+ }, import("#gh/service").GhError, GitHubService>;
92
92
  export declare const createPR: (opts: {
93
93
  base: string | null;
94
94
  title: string;
95
95
  body: string;
96
96
  draft: boolean;
97
97
  head: string | null;
98
- }) => Effect.Effect<PRInfo, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
98
+ }) => Effect.Effect<PRInfo, import("#gh/service").GhError, GitHubService>;
99
99
  export declare const mergePR: (opts: {
100
100
  pr: number;
101
101
  strategy: MergeStrategy;
102
102
  deleteBranch: boolean;
103
103
  confirm: boolean;
104
- }) => Effect.Effect<MergeResult, GitHubMergeError | (GitHubCommandError | GitHubNotFoundError | GitHubAuthError), GitHubService>;
104
+ }) => Effect.Effect<MergeResult, GitHubMergeError | import("#gh/service").GhError, GitHubService>;
105
105
  export declare const closePR: (opts: {
106
106
  pr: number;
107
107
  comment: string | null;
@@ -125,7 +125,7 @@ export declare const closePR: (opts: {
125
125
  reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
126
126
  reviewRequests: import("#gh/types").ReviewRequest[];
127
127
  headRefOid?: string;
128
- }, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
128
+ }, import("#gh/service").GhError, GitHubService>;
129
129
  export declare const readyPR: (opts: {
130
130
  pr: number | null;
131
131
  }) => Effect.Effect<{
@@ -148,7 +148,7 @@ export declare const readyPR: (opts: {
148
148
  reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
149
149
  reviewRequests: import("#gh/types").ReviewRequest[];
150
150
  headRefOid?: string;
151
- }, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
151
+ }, import("#gh/service").GhError, GitHubService>;
152
152
  export declare const editPR: (opts: {
153
153
  pr: number;
154
154
  title: string | null;
@@ -173,7 +173,7 @@ export declare const editPR: (opts: {
173
173
  reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
174
174
  reviewRequests: import("#gh/types").ReviewRequest[];
175
175
  headRefOid?: string;
176
- }, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
176
+ }, import("#gh/service").GhError, GitHubService>;
177
177
  export declare const fetchChecks: (pr: number | null, watch: boolean, failFast: boolean, timeoutSeconds: number, quiet?: any) => Effect.Effect<CheckResult[], GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
178
178
  export declare const triggerChecks: (pr: number | null, workflow: string, fields: readonly string[]) => Effect.Effect<{
179
179
  triggered: false;
@@ -199,7 +199,7 @@ export declare const triggerChecks: (pr: number | null, workflow: string, fields
199
199
  url: string | null;
200
200
  message: string;
201
201
  nextCommand: string;
202
- }, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
202
+ }, import("#gh/service").GhError, GitHubService>;
203
203
  export declare const collectWithStableState: <S, A, E1, R1, E2, R2>(initial: S, collect: (state: S) => Effect.Effect<A, E1, R1>, refresh: (state: S) => Effect.Effect<S, E2, R2>, unchanged: (before: S, after: S) => boolean) => Effect.Effect<{
204
204
  state: S;
205
205
  value: A;
@@ -221,7 +221,7 @@ export declare const fetchFailedChecks: (pr: number | null, withLogs?: any) => E
221
221
  pendingChecks: CheckResult[];
222
222
  hint: string;
223
223
  nextCommands: string[];
224
- }, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
224
+ }, import("#gh/service").GhError, GitHubService>;
225
225
  export declare const fetchChecksForCommand: (pr: number | null, watch: boolean, failFast: boolean, timeoutSeconds: number, quiet?: any) => Effect.Effect<CheckResult[] | {
226
226
  evidence: {
227
227
  headSha: string | null;
@@ -244,9 +244,9 @@ export declare const watchPRs: (prs: readonly number[], options: {
244
244
  intervalSeconds: number;
245
245
  timeoutSeconds: number;
246
246
  until?: "terminal";
247
- }, emit: (event: Record<string, unknown>) => Effect.Effect<void>) => Effect.Effect<undefined, "timeout" | (GitHubCommandError | GitHubNotFoundError | GitHubAuthError), GitHubService>;
247
+ }, emit: (event: Record<string, unknown>) => Effect.Effect<void>) => Effect.Effect<undefined, "timeout" | import("#gh/service").GhError, GitHubService>;
248
248
  export declare const rerunChecks: (pr: number | null, failedOnly: boolean, options?: {
249
249
  watch?: boolean;
250
250
  timeoutSeconds?: number;
251
- } | undefined) => Effect.Effect<RerunChecksReport, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
251
+ } | undefined) => Effect.Effect<RerunChecksReport, import("#gh/service").GhError, GitHubService>;
252
252
  //# sourceMappingURL=core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAE1E,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,iBAAiB,EAEjB,WAAW,EACX,aAAa,EACb,MAAM,EAGN,iBAAiB,EAIlB,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAsL5C,eAAO,MAAM,qBAAqB,QAAwB,CAAC;AAE3D,eAAO,MAAM,iBAAiB,gIAiB5B,CAAC;AA8IH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;iBAYuC,MAAM;6EAMnE,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;iBAR4C,MAAM;6EAuBnE,CAAC;AAEH,eAAO,MAAM,cAAc;;cAkBL,cAAc,EAAE;;;;;QAqIb,MAAM;;;;;;;;kGAQ7B,CAAC;AAEH,eAAO,MAAM,OAAO;WACX,MAAM;WACN,MAAM;YACL,MAAM,GAAG,IAAI;UACf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,EACV,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAC/C,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAC/C,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,OAAO,KAC1C,MAAM,CAAC,MAAM,CAAC;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAU5D,CAAC;AAEL,eAAO,MAAM,iBAAiB;;iBAppCJ,MAAM,GAAG,IAAI;iBAAW,MAAM,GAAG,IAAI;;;;;;;;;;;;;;gDAirC7D,CAAC;AAEH,eAAO,MAAM,qBAAqB;;iBAnrCR,MAAM,GAAG,IAAI;iBAAW,MAAM,GAAG,IAAI;;;;;;;;;;;;;;6EAmtC7D,CAAC;AAqBH,eAAO,MAAM,QAAQ;qBAES,MAAM;oBAAkB,MAAM;YAAU,UAAU;iBAChE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,uFAwM7D,CAAC;AAmEH,eAAO,MAAM,WAAW;YAGH,OAAO;qBAAmB,MAAM;gGAwLnD,CAAC"}
@@ -1,29 +1,28 @@
1
1
  import { Effect } from "effect";
2
2
  import type { IssueComment, PullRequestReview, ReviewComment, ReviewThread } from "#gh/types";
3
3
  import type { REVIEW_EVENTS } from "#gh/config";
4
- import { GitHubCommandError } from "#gh/errors";
5
4
  import { GitHubService } from "#gh/service";
6
5
  /**
7
6
  * Fetch review threads for a PR via GraphQL.
8
7
  * Filters to unresolved threads when unresolvedOnly is true.
9
8
  */
10
- export declare const fetchThreads: (pr: number | null, unresolvedOnly: boolean, visibleOpenOnly?: any, currentHeadSha?: string | null | undefined) => Effect.Effect<ReviewThread[], GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
9
+ export declare const fetchThreads: (pr: number | null, unresolvedOnly: boolean, visibleOpenOnly?: any, currentHeadSha?: string | null | undefined) => Effect.Effect<ReviewThread[], import("#gh/service").GhError, GitHubService>;
11
10
  /**
12
11
  * Fetch review comments for a PR via REST API.
13
12
  * Optionally filters to comments created at or after `since` timestamp.
14
13
  */
15
- export declare const fetchComments: (pr: number | null, since: string | null, currentHeadSha?: string | null | undefined) => Effect.Effect<ReviewComment[], GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
14
+ export declare const fetchComments: (pr: number | null, since: string | null, currentHeadSha?: string | null | undefined) => Effect.Effect<ReviewComment[], import("#gh/service").GhError, GitHubService>;
16
15
  /**
17
16
  * Fetch general PR discussion comments (issue comments) via REST API.
18
17
  * Supports optional filtering by timestamp, author, and body substring.
19
18
  */
20
- export declare const fetchIssueComments: (pr: number | null, since: string | null, author: string | null, bodyContains: string | null) => Effect.Effect<IssueComment[], GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
19
+ export declare const fetchIssueComments: (pr: number | null, since: string | null, author: string | null, bodyContains: string | null) => Effect.Effect<IssueComment[], import("#gh/service").GhError, GitHubService>;
21
20
  /**
22
21
  * Fetch submitted review summaries (state + top-level body) for a PR via REST API.
23
22
  * Complements `comments` (inline review comments) and `issue-comments` (discussion),
24
23
  * which never expose the submitted review body. Optional author/state/body filters.
25
24
  */
26
- export declare const fetchReviews: (pr: number | null, author: string | null, bodyContains: string | null, state: string | null, currentHeadSha?: string | null | undefined) => Effect.Effect<PullRequestReview[], GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
25
+ export declare const fetchReviews: (pr: number | null, author: string | null, bodyContains: string | null, state: string | null, currentHeadSha?: string | null | undefined) => Effect.Effect<PullRequestReview[], import("#gh/service").GhError, GitHubService>;
27
26
  /**
28
27
  * Full review-response inventory for a PR in one call: submitted review summaries,
29
28
  * all review threads with resolution state, inline review comments, and issue
@@ -34,9 +33,9 @@ export declare const fetchFeedback: (pr: number | null, currentHeadSha?: string
34
33
  threads: ReviewThread[];
35
34
  inlineComments: ReviewComment[];
36
35
  issueComments: IssueComment[];
37
- }, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
38
- export declare const fetchLatestIssueComment: (pr: number | null, author: string | null, bodyContains: string | null) => Effect.Effect<IssueComment | null, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
39
- export declare const postIssueComment: (pr: number | null, body: string) => Effect.Effect<IssueComment, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
36
+ }, import("#gh/service").GhError, GitHubService>;
37
+ export declare const fetchLatestIssueComment: (pr: number | null, author: string | null, bodyContains: string | null) => Effect.Effect<IssueComment | null, import("#gh/service").GhError, GitHubService>;
38
+ export declare const postIssueComment: (pr: number | null, body: string) => Effect.Effect<IssueComment, import("#gh/service").GhError, GitHubService>;
40
39
  export declare const fetchDiscussionSummary: (pr: number | null) => Effect.Effect<{
41
40
  issueCommentsCount: number;
42
41
  latestIssueComment: IssueComment | null;
@@ -48,14 +47,14 @@ export declare const fetchDiscussionSummary: (pr: number | null) => Effect.Effec
48
47
  resolvedUnrepliedReviewThreadsCount: number;
49
48
  unresolvedReviewThreadsCount: number;
50
49
  unresolvedUnrepliedReviewThreadsCount: number;
51
- }, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
50
+ }, import("#gh/service").GhError, GitHubService>;
52
51
  /**
53
52
  * Reply to an inline review comment via REST API.
54
53
  */
55
54
  export declare const replyToComment: (pr: number | null, commentId: number, body: string) => Effect.Effect<{
56
55
  success: true;
57
56
  commentId: number;
58
- }, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
57
+ }, import("#gh/service").GhError, GitHubService>;
59
58
  /**
60
59
  * Reply to a review comment, infer and validate its PR and thread, then resolve that thread.
61
60
  */
@@ -70,14 +69,14 @@ export declare const replyAndResolveComment: (pr: number | null, commentId: numb
70
69
  };
71
70
  pr: number;
72
71
  threadId: string;
73
- }, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
72
+ }, import("#gh/service").GhError, GitHubService>;
74
73
  /**
75
74
  * Resolve a review thread via GraphQL mutation.
76
75
  */
77
76
  export declare const resolveThread: (threadId: string) => Effect.Effect<{
78
77
  resolved: boolean;
79
78
  threadId: string;
80
- }, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
79
+ }, import("#gh/service").GhError, GitHubService>;
81
80
  export type ReviewEvent = (typeof REVIEW_EVENTS)[number];
82
81
  /**
83
82
  * Create and submit a review in one call — the path for a verdict an agent reached from a diff
@@ -94,15 +93,15 @@ export declare const createReview: (opts: {
94
93
  reviewId: number;
95
94
  state: string;
96
95
  url: string;
97
- }, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
96
+ }, import("#gh/service").GhError, GitHubService>;
98
97
  export declare const submitPendingReview: (pr: number | null, reviewId: string | null, body: string | null, event?: "approve" | "comment" | "request-changes" | undefined, confirm?: any) => Effect.Effect<{
99
98
  submitted: true;
100
99
  reviewId: string;
101
100
  state: string;
102
- }, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
101
+ }, import("#gh/service").GhError, GitHubService>;
103
102
  export declare const fetchLastHumanReviewer: (pr: number | null) => Effect.Effect<{
104
103
  currentRequestedReviewers: string[];
105
104
  lastHumanReviewer: string | null;
106
105
  lastHumanReviewAt: string | null;
107
- }, GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError, GitHubService>;
106
+ }, import("#gh/service").GhError, GitHubService>;
108
107
  //# sourceMappingURL=review.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAEV,YAAY,EAGZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EAEb,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAic5C;;;GAGG;AACH,eAAO,MAAM,YAAY,uQAcvB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa,8OAoCxB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,qPAmC7B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,sSA+CvB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;uHAaxB,CAAC;AAEH,eAAO,MAAM,uBAAuB,oOAgBlC,CAAC;AAEH,eAAO,MAAM,gBAAgB,uLA0C3B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;uHA4CjC,CAAC;AAeH;;GAEG;AACH,eAAO,MAAM,cAAc;;;uHA4FzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;uHA0FjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;uHAWxB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAgCzD;;;GAGG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,MAAM,GAAG,IAAI;WACV,WAAW;UACZ,MAAM;aACH,OAAO;;;;;;;gDAmDhB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;gDAsD9B,CAAC;AAeH,eAAO,MAAM,sBAAsB;;;;gDA8CjC,CAAC"}
@@ -3,5 +3,5 @@ import { GitHubService } from "#gh/service";
3
3
  import type { StackView } from "#gh/types";
4
4
  export declare const readStack: (opts: {
5
5
  pr: number;
6
- }) => Effect.Effect<StackView, import("../errors").GitHubCommandError | import("../errors").GitHubNotFoundError | import("../errors").GitHubAuthError, GitHubService>;
6
+ }) => Effect.Effect<StackView, import("#gh/service").GhError, GitHubService>;
7
7
  //# sourceMappingURL=stack-read.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stack-read.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/stack-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,WAAW,CAAC;AAoBxD,eAAO,MAAM,SAAS;QAAoD,MAAM;qKAgD9E,CAAC"}
1
+ {"version":3,"file":"stack-read.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/stack-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,WAAW,CAAC;AAoBxD,eAAO,MAAM,SAAS;QAAoD,MAAM;4EAgD9E,CAAC"}
@@ -38,7 +38,7 @@ export declare const mergeStack: (opts: {
38
38
  headRefName: string;
39
39
  }[];
40
40
  blockers: StackMergeBlocker[];
41
- }, GitHubMergeError | (import("#gh/errors").GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError), GitHubService>;
41
+ }, GitHubMergeError | import("#gh/service").GhError, GitHubService>;
42
42
  export declare const unstackStack: (opts: {
43
43
  pr: number;
44
44
  confirm: boolean;
@@ -49,5 +49,5 @@ export declare const unstackStack: (opts: {
49
49
  stackNumber: number;
50
50
  pr: number;
51
51
  removes: number[];
52
- }, GitHubMergeError | (import("#gh/errors").GitHubCommandError | import("#gh/errors").GitHubNotFoundError | import("#gh/errors").GitHubAuthError), GitHubService>;
52
+ }, GitHubMergeError | import("#gh/service").GhError, GitHubService>;
53
53
  //# sourceMappingURL=stack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAe,iBAAiB,EAAoB,MAAM,WAAW,CAAC;AAGjG,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAqFrB,eAAO,MAAM,UAAU;QACjB,MAAM;cACA,aAAa;aACd,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iKA2IhB,CAAC;AAEH,eAAO,MAAM,YAAY;QACnB,MAAM;aACD,OAAO;;;;;;;;iKAyChB,CAAC"}
1
+ {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAe,iBAAiB,EAAoB,MAAM,WAAW,CAAC;AAGjG,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAqFrB,eAAO,MAAM,UAAU;QACjB,MAAM;cACA,aAAa;aACd,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEA2IhB,CAAC;AAEH,eAAO,MAAM,YAAY;QACnB,MAAM;aACD,OAAO;;;;;;;;mEAyChB,CAAC"}
@@ -16,17 +16,17 @@ export declare const releaseCreateCommand: Command.Command<"create", {
16
16
  readonly target: Option.Option<string>;
17
17
  readonly title: Option.Option<string>;
18
18
  readonly verifyTag: boolean;
19
- }, {}, import("./errors").GitHubCommandError | import("./errors").GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
19
+ }, {}, import("./service").GhError, GitHubService>;
20
20
  export declare const releaseListCommand: Command.Command<"list", {
21
21
  readonly format: "json" | "toon";
22
22
  readonly limit: number;
23
23
  readonly repo: Option.Option<string>;
24
- }, {}, import("./errors").GitHubCommandError | import("./errors").GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
24
+ }, {}, import("./service").GhError, GitHubService>;
25
25
  export declare const releaseViewCommand: Command.Command<"view", {
26
26
  readonly format: "json" | "toon";
27
27
  readonly repo: Option.Option<string>;
28
28
  readonly tag: string;
29
- }, {}, import("./errors").GitHubCommandError | import("./errors").GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
29
+ }, {}, import("./service").GhError, GitHubService>;
30
30
  export declare const releaseEditCommand: Command.Command<"edit", {
31
31
  readonly body: Option.Option<string>;
32
32
  readonly bodyFile: Option.Option<string>;
@@ -37,16 +37,16 @@ export declare const releaseEditCommand: Command.Command<"edit", {
37
37
  readonly repo: Option.Option<string>;
38
38
  readonly tag: string;
39
39
  readonly title: Option.Option<string>;
40
- }, {}, import("./errors").GitHubCommandError | import("./errors").GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
40
+ }, {}, import("./service").GhError, GitHubService>;
41
41
  export declare const releaseDeleteCommand: Command.Command<"delete", {
42
42
  readonly cleanupTag: boolean;
43
43
  readonly confirm: boolean;
44
44
  readonly format: "json" | "toon";
45
45
  readonly repo: Option.Option<string>;
46
46
  readonly tag: string;
47
- }, {}, import("./errors").GitHubCommandError | import("./errors").GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
47
+ }, {}, import("./service").GhError, GitHubService>;
48
48
  export declare const releaseStatusCommand: Command.Command<"status", {
49
49
  readonly format: "json" | "toon";
50
50
  readonly repo: Option.Option<string>;
51
- }, {}, import("./errors").GitHubCommandError | import("./errors").GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
51
+ }, {}, import("./service").GhError, GitHubService>;
52
52
  //# sourceMappingURL=release.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../src/gh-tool/release.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAsV1C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;0IAqGhC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;0IAsBiB,CAAC;AAEjD,eAAO,MAAM,kBAAkB;;;;0IAmB+B,CAAC;AAE/D,eAAO,MAAM,kBAAkB;;;;;;;;;;0IAsD4B,CAAC;AAE5D,eAAO,MAAM,oBAAoB;;;;;;0IA6BiE,CAAC;AAEnG,eAAO,MAAM,oBAAoB;;;0IAckE,CAAC"}
1
+ {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../src/gh-tool/release.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAsV1C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;kDAqGhC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;kDAsBiB,CAAC;AAEjD,eAAO,MAAM,kBAAkB;;;;kDAmB+B,CAAC;AAE/D,eAAO,MAAM,kBAAkB;;;;;;;;;;kDAsD4B,CAAC;AAE5D,eAAO,MAAM,oBAAoB;;;;;;kDA6BiE,CAAC;AAEnG,eAAO,MAAM,oBAAoB;;;kDAckE,CAAC"}
@@ -1,21 +1,20 @@
1
1
  import { Command } from "effect/unstable/cli";
2
2
  import { Option } from "effect";
3
- import { GitHubCommandError } from "./errors";
4
3
  import { GitHubService } from "./service";
5
4
  export declare const repoInfoCommand: Command.Command<"info", {
6
5
  readonly format: "json" | "toon";
7
6
  readonly repo: Option.Option<string>;
8
- }, {}, GitHubCommandError | import("./errors").GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
7
+ }, {}, import("./service").GhError, GitHubService>;
9
8
  export declare const repoListCommand: Command.Command<"list", {
10
9
  readonly format: "json" | "toon";
11
10
  readonly limit: number;
12
11
  readonly org: string;
13
12
  readonly visibility: Option.Option<"public" | "all" | "private">;
14
- }, {}, GitHubCommandError | import("./errors").GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
13
+ }, {}, import("./service").GhError, GitHubService>;
15
14
  export declare const repoSearchCodeCommand: Command.Command<"search-code", {
16
15
  readonly format: "json" | "toon";
17
16
  readonly limit: number;
18
17
  readonly org: string;
19
18
  readonly query: string;
20
- }, {}, GitHubCommandError | import("./errors").GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
19
+ }, {}, import("./service").GhError, GitHubService>;
21
20
  //# sourceMappingURL=repo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/gh-tool/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA2F1C,eAAO,MAAM,eAAe;;;uHAcqE,CAAC;AAElG,eAAO,MAAM,eAAe;;;;;uHAyB3B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;uHAoB6C,CAAC"}
1
+ {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/gh-tool/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA2F1C,eAAO,MAAM,eAAe;;;kDAcqE,CAAC;AAElG,eAAO,MAAM,eAAe;;;;;kDAyB3B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;kDAoB6C,CAAC"}
@@ -5,12 +5,12 @@ import type { RepoInfo } from "./types";
5
5
  import { GitHubAuthError, GitHubCommandError, GitHubNotFoundError } from "./errors";
6
6
  import type { GitHubApiRequest, GitHubApiResponse } from "./api";
7
7
  import { ConfigService } from "#config";
8
- type GhResult = {
8
+ export type GhResult = {
9
9
  stdout: string;
10
10
  stderr: string;
11
11
  exitCode: number;
12
12
  };
13
- type GhError = GitHubCommandError | GitHubAuthError | GitHubNotFoundError;
13
+ export type GhError = GitHubCommandError | GitHubAuthError | GitHubNotFoundError;
14
14
  declare const GitHubService_base: Context.ServiceClass<GitHubService, "@agent-tools/GitHubService", {
15
15
  readonly runGh: (args: string[]) => Effect.Effect<GhResult, GhError>;
16
16
  readonly runGhJson: <T>(args: string[]) => Effect.Effect<T, GhError>;
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/gh-tool/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EA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,OAAO,CAAC;yBAC/C,CACnB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,KAC9C,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;yBACf,CAAC,CAAC,EACrB,IAAI,EAAE,gBAAgB,KACnB,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;4BACzB,MAAM,MAAM,CAAC,MAAM,CAAC,gBAAgB,GAAG,SAAS,EAAE,KAAK,CAAC;0BAC1D,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC;6BACnC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,kBAAkB,EAAE,CAAC,CAAC;;AAjBpD,qBAAa,aAAc,SAAQ,kBAmBF;IAC/B,MAAM,CAAC,QAAQ,CAAC,KAAK,6FAsRnB;CACH"}
@@ -1,6 +1,6 @@
1
1
  import { Command } from "effect/unstable/cli";
2
2
  import { Effect, Option } from "effect";
3
- import { GitHubCommandError, GitHubNotFoundError } from "./errors";
3
+ import { GitHubNotFoundError } from "./errors";
4
4
  import { GitHubService } from "./service";
5
5
  import type { LogDiagnosis } from "./types";
6
6
  export type LogEntry = {
@@ -18,7 +18,7 @@ export declare const dispatchWorkflow: (opts: {
18
18
  ref: string;
19
19
  repo: string | null;
20
20
  fields: readonly string[];
21
- }, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
21
+ }, import("./service").GhError, GitHubService>;
22
22
  export type DispatchedRun = {
23
23
  databaseId: number;
24
24
  headSha: string;
@@ -90,7 +90,7 @@ export declare const fetchJobLogs: (opts: {
90
90
  formatted: string;
91
91
  diagnosis?: undefined;
92
92
  entries?: undefined;
93
- }, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
93
+ }, import("./service").GhError, GitHubService>;
94
94
  export declare const workflowListCommand: Command.Command<"list", {
95
95
  readonly branch: Option.Option<string>;
96
96
  readonly format: "json" | "toon";
@@ -98,48 +98,48 @@ export declare const workflowListCommand: Command.Command<"list", {
98
98
  readonly repo: Option.Option<string>;
99
99
  readonly status: Option.Option<"success" | "completed" | "skipped" | "failure" | "queued" | "in_progress" | "action_required" | "cancelled" | "neutral" | "stale" | "timed_out" | "waiting">;
100
100
  readonly workflow: Option.Option<string>;
101
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
101
+ }, {}, import("./service").GhError, GitHubService>;
102
102
  export declare const workflowViewCommand: Command.Command<"view", {
103
103
  readonly format: "json" | "toon";
104
104
  readonly repo: Option.Option<string>;
105
105
  readonly run: number;
106
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
106
+ }, {}, import("./service").GhError, GitHubService>;
107
107
  export declare const workflowJobsCommand: Command.Command<"jobs", {
108
108
  readonly format: "json" | "toon";
109
109
  readonly repo: Option.Option<string>;
110
110
  readonly run: number;
111
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
111
+ }, {}, import("./service").GhError, GitHubService>;
112
112
  export declare const workflowLogsCommand: Command.Command<"logs", {
113
113
  readonly failedOnly: boolean;
114
114
  readonly format: "json" | "toon";
115
115
  readonly repo: Option.Option<string>;
116
116
  readonly run: number;
117
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
117
+ }, {}, import("./service").GhError, GitHubService>;
118
118
  export declare const workflowRerunCommand: Command.Command<"rerun", {
119
119
  readonly failedOnly: boolean;
120
120
  readonly format: "json" | "toon";
121
121
  readonly repo: Option.Option<string>;
122
122
  readonly run: number;
123
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
123
+ }, {}, import("./service").GhError, GitHubService>;
124
124
  export declare const workflowCancelCommand: Command.Command<"cancel", {
125
125
  readonly format: "json" | "toon";
126
126
  readonly repo: Option.Option<string>;
127
127
  readonly run: number;
128
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
128
+ }, {}, import("./service").GhError, GitHubService>;
129
129
  export declare const workflowRunCommand: Command.Command<"run", {
130
130
  readonly field: readonly string[];
131
131
  readonly format: "json" | "toon";
132
132
  readonly ref: string;
133
133
  readonly repo: Option.Option<string>;
134
134
  readonly workflow: string;
135
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
135
+ }, {}, import("./service").GhError, GitHubService>;
136
136
  export declare const workflowWatchCommand: Command.Command<"watch", {
137
137
  readonly format: "json" | "toon";
138
138
  readonly frames: boolean;
139
139
  readonly repo: Option.Option<string>;
140
140
  readonly run: number;
141
141
  readonly timeout: number;
142
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
142
+ }, {}, import("./service").GhError, GitHubService>;
143
143
  export declare const workflowJobLogsCommand: Command.Command<"job-logs", {
144
144
  readonly diagnose: boolean;
145
145
  readonly failedStepsOnly: boolean;
@@ -147,11 +147,11 @@ export declare const workflowJobLogsCommand: Command.Command<"job-logs", {
147
147
  readonly job: string;
148
148
  readonly repo: Option.Option<string>;
149
149
  readonly run: number;
150
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
150
+ }, {}, import("./service").GhError, GitHubService>;
151
151
  export declare const workflowAnnotationsCommand: Command.Command<"annotations", {
152
152
  readonly format: "json" | "toon";
153
153
  readonly job: Option.Option<string>;
154
154
  readonly repo: Option.Option<string>;
155
155
  readonly run: number;
156
- }, {}, GitHubCommandError | GitHubNotFoundError | import("./errors").GitHubAuthError, GitHubService>;
156
+ }, {}, import("./service").GhError, GitHubService>;
157
157
  //# sourceMappingURL=workflow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/gh-tool/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAY,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIlD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAsC,YAAY,EAAE,MAAM,SAAS,CAAC;AAwChF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAqKF,eAAO,MAAM,gBAAgB;cACjB,MAAM;SACX,MAAM;YACH,aAAa,CAAC,MAAM,CAAC;UACvB,MAAM,GAAG,IAAI;;;;;;;gGAsBnB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAKF,eAAO,MAAM,kBAAkB;cACnB,MAAM;SACX,MAAM;UACL,MAAM,GAAG,IAAI;6GAyBnB,CAAC;AAKH,eAAO,MAAM,qBAAqB;cACtB,MAAM;SACX,MAAM;UACL,MAAM,GAAG,IAAI;iBACN,WAAW,CAAC,MAAM,CAAC;kHAShC,CAAC;AAMH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,MAAM,EACb,YAAY;IACV,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;I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AC7C,OAAO,EAAY,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AAK9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAWlD,OAAO,KAAK,EAEV,sBAAsB,EAItB,YAAY,EAEZ,mBAAmB,EAEnB,cAAc,EAEf,MAAM,SAAS,CAAC;AAuVjB,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,cAAc,EAAE,CAsBnF;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,sBAAsB,EAC9B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,GACZ,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,CA4C5D;AAgPD,eAAO,MAAM,YAAY,iFAGxB,CAAC"}
1
+ {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/observability-tool/trace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAY,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AAK9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAWlD,OAAO,KAAK,EAEV,sBAAsB,EAItB,YAAY,EAEZ,mBAAmB,EAEnB,cAAc,EAEf,MAAM,SAAS,CAAC;AAuVjB,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,cAAc,EAAE,CAsBnF;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,sBAAsB,EAC9B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,GACZ,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,CA4C5D;AAoPD,eAAO,MAAM,YAAY,iFAGxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blogic-cz/agent-tools",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "CLI tools for AI coding agent workflows — GitHub, database, Kubernetes, Azure platform, Azure DevOps, logs, sessions, and audit",
5
5
  "keywords": [
6
6
  "agent",
@@ -19,6 +19,7 @@ import type {
19
19
  import type { GitHubAuthError, GitHubNotFoundError } from "#gh/errors";
20
20
  import { GitHubCommandError, GitHubMergeError } from "#gh/errors";
21
21
  import { GitHubService } from "#gh/service";
22
+ import type { GhResult } from "#gh/service";
22
23
  import { logText } from "#shared";
23
24
 
24
25
  import type { ButStatusJson, PRViewJsonResult } from "./helpers";
@@ -201,6 +202,13 @@ const fetchWorkflowRunFailureContext = Effect.fn("pr.fetchWorkflowRunFailureCont
201
202
  // `gh pr checks` exits 1 on an *empty* result ("no checks reported on the 'x' branch"). Zero checks
202
203
  // is an ordinary state, so map it to [] and keep the zero-check paths downstream reachable.
203
204
  export const NO_CHECKS_REPORTED_RE = /no checks reported/i;
205
+ // `gh` reports "no checks reported" both for the seconds after a push, before its checks
206
+ // register, and forever for a PR that has none — the message cannot tell them apart. So the
207
+ // wait for registration gets its own short budget: long enough to cover the race (measured
208
+ // at roughly 40s on blogic-cz/agent-tools#134), short enough that a check-less PR is not held
209
+ // for the caller's whole --timeout.
210
+ const CHECK_REGISTRATION_POLL_SECONDS = 5;
211
+ const CHECK_REGISTRATION_GRACE_SECONDS = 60;
204
212
 
205
213
  export const fetchCheckResults = Effect.fn("pr.fetchCheckResults")(function* (pr: number | null) {
206
214
  const gh = yield* GitHubService;
@@ -1244,7 +1252,45 @@ export const fetchChecks = Effect.fn("pr.fetchChecks")(function* (
1244
1252
  // Block for the caller's requested --timeout (no artificial cap — blocking isn't the problem;
1245
1253
  // --timeout is validated >= 1s at the CLI boundary). On timeout return a snapshot, never
1246
1254
  // nothing — that was the actual token-wasting bug.
1247
- const watchOutcome = yield* gh.runGh(watchArgs).pipe(
1255
+ // A push registers its checks a moment after the ref lands, and `gh pr checks --watch`
1256
+ // exits non-zero in that window. A watch was asked to wait, so keep waiting: the outer
1257
+ // timeout still bounds it, and a PR that genuinely has no checks returns an empty
1258
+ // snapshot at that deadline rather than an error.
1259
+ let watchResult: GhResult | null = null;
1260
+ let registered = false;
1261
+ let graceExpired = false;
1262
+ const watchThroughRegistration = Effect.gen(function* () {
1263
+ const graceStart = yield* Clock.currentTimeMillis;
1264
+ const graceDeadlineMs =
1265
+ Number(graceStart) + Math.min(CHECK_REGISTRATION_GRACE_SECONDS, timeoutSeconds) * 1000;
1266
+ yield* Effect.whileLoop({
1267
+ while: () => !registered && !graceExpired,
1268
+ body: () =>
1269
+ gh.runGh(watchArgs).pipe(
1270
+ Effect.flatMap((result) => {
1271
+ watchResult = result;
1272
+ registered = true;
1273
+ return Effect.void;
1274
+ }),
1275
+ Effect.catchTag("GitHubCommandError", (error) =>
1276
+ NO_CHECKS_REPORTED_RE.test(error.stderr) || NO_CHECKS_REPORTED_RE.test(error.message)
1277
+ ? Effect.gen(function* () {
1278
+ const now = yield* Clock.currentTimeMillis;
1279
+ if (Number(now) >= graceDeadlineMs) {
1280
+ graceExpired = true;
1281
+ return;
1282
+ }
1283
+ yield* Effect.sleep(Duration.seconds(CHECK_REGISTRATION_POLL_SECONDS));
1284
+ })
1285
+ : Effect.fail(error),
1286
+ ),
1287
+ ),
1288
+ step: () => undefined,
1289
+ });
1290
+ return watchResult;
1291
+ });
1292
+
1293
+ const watchOutcome = yield* watchThroughRegistration.pipe(
1248
1294
  Effect.timeoutOrElse({
1249
1295
  duration: timeoutSeconds * 1000,
1250
1296
  orElse: () => Effect.succeed(null),
@@ -1252,7 +1298,15 @@ export const fetchChecks = Effect.fn("pr.fetchChecks")(function* (
1252
1298
  );
1253
1299
 
1254
1300
  const results = yield* fetchCheckResults(pr);
1255
- if (!quiet && watchOutcome === null && results.some((c) => c.bucket === "pending")) {
1301
+ if (!quiet && graceExpired) {
1302
+ const prRef = pr === null ? "<number>" : String(pr);
1303
+ yield* Console.warn(
1304
+ `ℹ️ No checks registered within ${CHECK_REGISTRATION_GRACE_SECONDS}s of watching; ` +
1305
+ `returning the current snapshot. If this PR should have checks, the push event was ` +
1306
+ `likely dropped, and re-watching will find nothing again — dispatch them on the PR ` +
1307
+ `head instead:\n agent-tools-gh pr trigger-checks --pr ${prRef} --workflow <file.yml>`,
1308
+ );
1309
+ } else if (!quiet && watchOutcome === null && results.some((c) => c.bucket === "pending")) {
1256
1310
  const pending = results.filter((c) => c.bucket === "pending").length;
1257
1311
  yield* Console.warn(
1258
1312
  `ℹ️ Watch timed out after ${timeoutSeconds}s; ${pending} check(s) still pending (snapshot returned). ` +
@@ -68,13 +68,13 @@ const isSafeRetryRead = (args: readonly string[]): boolean => {
68
68
  return args.some((a) => READ_VERBS.has(a));
69
69
  };
70
70
 
71
- type GhResult = {
71
+ export type GhResult = {
72
72
  stdout: string;
73
73
  stderr: string;
74
74
  exitCode: number;
75
75
  };
76
76
 
77
- type GhError = GitHubCommandError | GitHubAuthError | GitHubNotFoundError;
77
+ export type GhError = GitHubCommandError | GitHubAuthError | GitHubNotFoundError;
78
78
 
79
79
  export class GitHubService extends Context.Service<
80
80
  GitHubService,
@@ -614,7 +614,11 @@ const findCommand = Command.make(
614
614
  profile: profileOption,
615
615
  },
616
616
  ({ id, format, env, profile }) => handleTraceGet(id, format, env, profile),
617
- ).pipe(Command.withDescription("Alias for 'trace get' — resolve a trace by trace ID or span ID"));
617
+ ).pipe(
618
+ Command.withDescription(
619
+ "Alias for 'trace get' — resolves an id, and is not the TraceQL search; that is 'trace search'",
620
+ ),
621
+ );
618
622
 
619
623
  const searchCommand = Command.make(
620
624
  "search",