@blogic-cz/agent-tools 1.1.0 → 1.2.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.
- package/dist/gh-tool/pr/commands.d.ts +1 -2
- package/dist/gh-tool/pr/commands.d.ts.map +1 -1
- package/dist/gh-tool/pr/core.d.ts +25 -10
- package/dist/gh-tool/pr/core.d.ts.map +1 -1
- package/dist/session-tool/index.d.ts.map +1 -1
- package/dist/session-tool/service.d.ts +0 -1
- package/dist/session-tool/service.d.ts.map +1 -1
- package/dist/session-tool/summaries.d.ts +12 -0
- package/dist/session-tool/summaries.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/gh-tool/pr/commands.ts +5 -1
- package/src/gh-tool/pr/core.ts +28 -6
- package/src/session-tool/index.ts +11 -6
- package/src/session-tool/service.ts +0 -8
- package/src/session-tool/summaries.ts +19 -0
|
@@ -106,8 +106,8 @@ export declare const fetchReviewTriage: (prNumber: number | null, format?: "json
|
|
|
106
106
|
};
|
|
107
107
|
classification: ReviewTriageClassification;
|
|
108
108
|
info: {
|
|
109
|
-
headSha: string | null;
|
|
110
109
|
baseSha: string | null;
|
|
110
|
+
headSha: string | null;
|
|
111
111
|
number: number;
|
|
112
112
|
url: string;
|
|
113
113
|
title: string;
|
|
@@ -124,7 +124,6 @@ export declare const fetchReviewTriage: (prNumber: number | null, format?: "json
|
|
|
124
124
|
reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
|
|
125
125
|
reviewRequests: import("#gh/types").ReviewRequest[];
|
|
126
126
|
headRefOid?: string;
|
|
127
|
-
baseRefOid?: string;
|
|
128
127
|
};
|
|
129
128
|
unresolvedThreads: import("#gh/types").ReviewThread[];
|
|
130
129
|
visibleOpenThreads: import("#gh/types").ReviewThread[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/commands.ts"],"names":[],"mappings":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BAA0B;;;;2HAuBtC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;2HAkDpC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { GitHubAuthError, GitHubNotFoundError } from "#gh/errors";
|
|
|
4
4
|
import { GitHubCommandError, GitHubMergeError } from "#gh/errors";
|
|
5
5
|
import { GitHubService } from "#gh/service";
|
|
6
6
|
export declare const NO_CHECKS_REPORTED_RE: RegExp;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const fetchPRView: (prNumber: number | null) => Effect.Effect<{
|
|
8
8
|
headSha: string | null;
|
|
9
9
|
baseSha: string | null;
|
|
10
10
|
number: number;
|
|
@@ -23,7 +23,26 @@ export declare const viewPR: (prNumber: number | null) => Effect.Effect<{
|
|
|
23
23
|
reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
|
|
24
24
|
reviewRequests: import("#gh/types").ReviewRequest[];
|
|
25
25
|
headRefOid?: string;
|
|
26
|
-
|
|
26
|
+
}, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
|
|
27
|
+
export declare const viewPR: (prNumber: number | null) => Effect.Effect<{
|
|
28
|
+
baseSha: string | null;
|
|
29
|
+
headSha: string | null;
|
|
30
|
+
number: number;
|
|
31
|
+
url: string;
|
|
32
|
+
title: string;
|
|
33
|
+
headRefName: string;
|
|
34
|
+
baseRefName: string;
|
|
35
|
+
state: string;
|
|
36
|
+
isDraft: boolean;
|
|
37
|
+
mergeable: "MERGEABLE" | "CONFLICTING" | "UNKNOWN";
|
|
38
|
+
body: string;
|
|
39
|
+
author: {
|
|
40
|
+
login: string;
|
|
41
|
+
is_bot: boolean;
|
|
42
|
+
};
|
|
43
|
+
reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
|
|
44
|
+
reviewRequests: import("#gh/types").ReviewRequest[];
|
|
45
|
+
headRefOid?: string;
|
|
27
46
|
}, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
|
|
28
47
|
export declare const detectPRStatus: () => Effect.Effect<{
|
|
29
48
|
mode: "none";
|
|
@@ -50,8 +69,8 @@ export declare const listPRs: (opts: {
|
|
|
50
69
|
search: string | null;
|
|
51
70
|
}) => Effect.Effect<PRInfo[], GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
|
|
52
71
|
export declare const waitForMergeable: (pr: number | null, timeoutSeconds: number) => Effect.Effect<{
|
|
53
|
-
headSha: string | null;
|
|
54
72
|
baseSha: string | null;
|
|
73
|
+
headSha: string | null;
|
|
55
74
|
number: number;
|
|
56
75
|
url: string;
|
|
57
76
|
title: string;
|
|
@@ -68,7 +87,6 @@ export declare const waitForMergeable: (pr: number | null, timeoutSeconds: numbe
|
|
|
68
87
|
reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
|
|
69
88
|
reviewRequests: import("#gh/types").ReviewRequest[];
|
|
70
89
|
headRefOid?: string;
|
|
71
|
-
baseRefOid?: string;
|
|
72
90
|
}, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
|
|
73
91
|
export declare const createPR: (opts: {
|
|
74
92
|
base: string | null;
|
|
@@ -88,8 +106,8 @@ export declare const closePR: (opts: {
|
|
|
88
106
|
comment: string | null;
|
|
89
107
|
deleteBranch: boolean;
|
|
90
108
|
}) => Effect.Effect<{
|
|
91
|
-
headSha: string | null;
|
|
92
109
|
baseSha: string | null;
|
|
110
|
+
headSha: string | null;
|
|
93
111
|
number: number;
|
|
94
112
|
url: string;
|
|
95
113
|
title: string;
|
|
@@ -106,14 +124,13 @@ export declare const closePR: (opts: {
|
|
|
106
124
|
reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
|
|
107
125
|
reviewRequests: import("#gh/types").ReviewRequest[];
|
|
108
126
|
headRefOid?: string;
|
|
109
|
-
baseRefOid?: string;
|
|
110
127
|
}, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
|
|
111
128
|
export declare const readyPR: (opts: {
|
|
112
129
|
pr: number | null;
|
|
113
130
|
}) => Effect.Effect<{
|
|
114
131
|
wasAlreadyReady: boolean;
|
|
115
|
-
headSha: string | null;
|
|
116
132
|
baseSha: string | null;
|
|
133
|
+
headSha: string | null;
|
|
117
134
|
number: number;
|
|
118
135
|
url: string;
|
|
119
136
|
title: string;
|
|
@@ -130,7 +147,6 @@ export declare const readyPR: (opts: {
|
|
|
130
147
|
reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
|
|
131
148
|
reviewRequests: import("#gh/types").ReviewRequest[];
|
|
132
149
|
headRefOid?: string;
|
|
133
|
-
baseRefOid?: string;
|
|
134
150
|
}, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
|
|
135
151
|
export declare const editPR: (opts: {
|
|
136
152
|
pr: number;
|
|
@@ -138,8 +154,8 @@ export declare const editPR: (opts: {
|
|
|
138
154
|
body: string | null;
|
|
139
155
|
base: string | null;
|
|
140
156
|
}) => Effect.Effect<{
|
|
141
|
-
headSha: string | null;
|
|
142
157
|
baseSha: string | null;
|
|
158
|
+
headSha: string | null;
|
|
143
159
|
number: number;
|
|
144
160
|
url: string;
|
|
145
161
|
title: string;
|
|
@@ -156,7 +172,6 @@ export declare const editPR: (opts: {
|
|
|
156
172
|
reviewDecision: "APPROVED" | "CHANGES_REQUESTED" | "REVIEW_REQUIRED" | "";
|
|
157
173
|
reviewRequests: import("#gh/types").ReviewRequest[];
|
|
158
174
|
headRefOid?: string;
|
|
159
|
-
baseRefOid?: string;
|
|
160
175
|
}, GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
|
|
161
176
|
export declare const fetchChecks: (pr: number | null, watch: boolean, failFast: boolean, timeoutSeconds: number, quiet?: any) => Effect.Effect<CheckResult[], GitHubCommandError | GitHubNotFoundError | GitHubAuthError, GitHubService>;
|
|
162
177
|
export declare const triggerChecks: (pr: number | null, workflow: string, fields: readonly string[]) => Effect.Effect<{
|
|
@@ -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;AAoL5C,eAAO,MAAM,qBAAqB,QAAwB,CAAC;AAiK3D,eAAO,MAAM,
|
|
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;AAoL5C,eAAO,MAAM,qBAAqB,QAAwB,CAAC;AAiK3D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;iBAYuC,MAAM;6EAMnE,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;iBAR4C,MAAM;6EAuBnE,CAAC;AAEH,eAAO,MAAM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,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;;iBA9iCJ,MAAM,GAAG,IAAI;iBAAW,MAAM,GAAG,IAAI;;;;;;;;;;;;;;6EA2kC7D,CAAC;AAEH,eAAO,MAAM,qBAAqB;;iBA7kCR,MAAM,GAAG,IAAI;iBAAW,MAAM,GAAG,IAAI;;;;;;;;;;;;;;6EA6mC7D,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,sHAwM7D,CAAC;AAmEH,eAAO,MAAM,WAAW;YAGH,OAAO;qBAAmB,MAAM;6HAwLnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session-tool/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAY,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAiB,MAAM,QAAQ,CAAC;AAQ/C,OAAO,EAAE,aAAa,EAAsB,MAAM,UAAU,CAAC;AAE7D,OAAO,EAAc,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session-tool/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAY,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAiB,MAAM,QAAQ,CAAC;AAQ/C,OAAO,EAAE,aAAa,EAAsB,MAAM,UAAU,CAAC;AAE7D,OAAO,EAAc,cAAc,EAAuB,MAAM,WAAW,CAAC;AAsT5E,eAAO,MAAM,GAAG,8JAEd,CAAC"}
|
|
@@ -3,7 +3,6 @@ import type { MessageSummary, SessionSource, SessionSummary } from "./types";
|
|
|
3
3
|
import { ResolvedPaths } from "./config";
|
|
4
4
|
import { type SessionError } from "./errors";
|
|
5
5
|
export declare const formatDate: (timestamp: number) => string;
|
|
6
|
-
export declare const truncate: (value: string, maxLen: number) => string;
|
|
7
6
|
declare const SessionService_base: Context.ServiceClass<SessionService, "@agent-tools/SessionService", {
|
|
8
7
|
readonly getSessionsForProject: (projectDir: string | null, sources?: ReadonlySet<SessionSource>) => Effect.Effect<Set<string>, SessionError>;
|
|
9
8
|
readonly getPiSessionSummaries: (filterSessions: Set<string> | null) => Effect.Effect<SessionSummary[], SessionError>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/session-tool/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAIhD,OAAO,KAAK,EAAE,cAAc,EAAe,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAO1F,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAiD,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAU5F,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,KAAG,MAW9C,CAAC
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/session-tool/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAIhD,OAAO,KAAK,EAAE,cAAc,EAAe,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAO1F,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAiD,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAU5F,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,KAAG,MAW9C,CAAC;;oCA6HkC,CAC9B,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,OAAO,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,KACjC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;oCACb,CAC9B,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,KAC/B,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,YAAY,CAAC;kCACpB,CAC5B,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,EAClC,OAAO,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,KACjC,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,YAAY,CAAC;8BACxB,CAAC,SAAS,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,KAAK,cAAc,EAAE;;AAd9F,qBAAa,cAAe,SAAQ,mBAgBF;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,oDAsPnB;CACH;AAED,eAAO,MAAM,mBAAmB,mDAAuB,CAAC"}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import type { MessageSummary, SessionSummary } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Shapes a message body for output. A body silently cut to 500 chars was
|
|
4
|
+
* indistinguishable from a short one, so callers read "no match in this snippet" as
|
|
5
|
+
* "not in this session". When the body is cut, say so and report its real length.
|
|
6
|
+
*
|
|
7
|
+
* maxBodyChars <= 0 returns the full body.
|
|
8
|
+
*/
|
|
9
|
+
export declare const shapeBody: (body: string, maxBodyChars: number) => {
|
|
10
|
+
body: string;
|
|
11
|
+
bodyLength?: number;
|
|
12
|
+
truncated?: true;
|
|
13
|
+
};
|
|
2
14
|
export declare const sessionSummariesFromMessages: (summaries: MessageSummary[]) => SessionSummary[];
|
|
3
15
|
export declare const projectSessionFilter: (sessionsBySource: ReadonlyMap<SessionSummary["source"], Set<string>>, source: SessionSummary["source"], allProjects: boolean) => Set<string> | null;
|
|
4
16
|
export declare const sortSessionSummaries: (summaries: SessionSummary[]) => SessionSummary[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaries.d.ts","sourceRoot":"","sources":["../../src/session-tool/summaries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9D,eAAO,MAAM,4BAA4B,GAAI,WAAW,cAAc,EAAE,KAAG,cAAc,EAwBxF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,kBAAkB,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACpE,QAAQ,cAAc,CAAC,QAAQ,CAAC,EAChC,aAAa,OAAO,KACnB,GAAG,CAAC,MAAM,CAAC,GAAG,IAA0E,CAAC;AAE5F,eAAO,MAAM,oBAAoB,GAAI,WAAW,cAAc,EAAE,KAAG,cAAc,EAO9E,CAAC"}
|
|
1
|
+
{"version":3,"file":"summaries.d.ts","sourceRoot":"","sources":["../../src/session-tool/summaries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,IAAI,CAAA;CAOvD,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,WAAW,cAAc,EAAE,KAAG,cAAc,EAwBxF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,kBAAkB,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACpE,QAAQ,cAAc,CAAC,QAAQ,CAAC,EAChC,aAAa,OAAO,KACnB,GAAG,CAAC,MAAM,CAAC,GAAG,IAA0E,CAAC;AAE5F,eAAO,MAAM,oBAAoB,GAAI,WAAW,cAAc,EAAE,KAAG,cAAc,EAO9E,CAAC"}
|
package/package.json
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
createPR,
|
|
34
34
|
detectPRStatus,
|
|
35
35
|
editPR,
|
|
36
|
+
fetchPRView,
|
|
36
37
|
fetchChecks,
|
|
37
38
|
fetchChecksForCommand,
|
|
38
39
|
fetchFailedChecks,
|
|
@@ -223,7 +224,10 @@ const withStableHead = Effect.fn("pr.withStableHead")(function* <A, E, R>(
|
|
|
223
224
|
const snapshot = yield* collectWithStableState(
|
|
224
225
|
initial,
|
|
225
226
|
(info) => collect(info.number, info.headSha),
|
|
226
|
-
(info) =>
|
|
227
|
+
(info) =>
|
|
228
|
+
fetchPRView(info.number).pipe(
|
|
229
|
+
Effect.map((refreshed) => ({ ...refreshed, baseSha: initial.baseSha })),
|
|
230
|
+
),
|
|
227
231
|
(before, after) => after.headSha === before.headSha,
|
|
228
232
|
);
|
|
229
233
|
if (snapshot !== null) return { info: snapshot.state, value: snapshot.value };
|
package/src/gh-tool/pr/core.ts
CHANGED
|
@@ -359,7 +359,7 @@ const buildFailedChecksReport = Effect.fn("pr.buildFailedChecksReport")(function
|
|
|
359
359
|
};
|
|
360
360
|
});
|
|
361
361
|
|
|
362
|
-
export const
|
|
362
|
+
export const fetchPRView = Effect.fn("pr.fetchPRView")(function* (prNumber: number | null) {
|
|
363
363
|
const gh = yield* GitHubService;
|
|
364
364
|
|
|
365
365
|
const args = ["pr", "view"];
|
|
@@ -368,14 +368,31 @@ export const viewPR = Effect.fn("pr.viewPR")(function* (prNumber: number | null)
|
|
|
368
368
|
}
|
|
369
369
|
args.push(
|
|
370
370
|
"--json",
|
|
371
|
-
"number,url,title,headRefName,baseRefName,headRefOid,
|
|
371
|
+
"number,url,title,headRefName,baseRefName,headRefOid,state,isDraft,mergeable,body,author,reviewDecision,reviewRequests",
|
|
372
372
|
);
|
|
373
373
|
|
|
374
|
-
const info = yield* gh.runGhJson<PRViewInfo & { headRefOid?: string
|
|
374
|
+
const info = yield* gh.runGhJson<PRViewInfo & { headRefOid?: string }>(args);
|
|
375
375
|
return {
|
|
376
376
|
...info,
|
|
377
377
|
headSha: info.headRefOid ?? info.headSha ?? null,
|
|
378
|
-
baseSha: info.
|
|
378
|
+
baseSha: info.baseSha ?? null,
|
|
379
|
+
};
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
export const viewPR = Effect.fn("pr.viewPR")(function* (prNumber: number | null) {
|
|
383
|
+
const gh = yield* GitHubService;
|
|
384
|
+
|
|
385
|
+
const info = yield* fetchPRView(prNumber);
|
|
386
|
+
const repo = yield* gh.getRepoInfo();
|
|
387
|
+
const baseSha = yield* gh.runGh([
|
|
388
|
+
"api",
|
|
389
|
+
`repos/${repo.owner}/${repo.name}/pulls/${info.number}`,
|
|
390
|
+
"--jq",
|
|
391
|
+
".base.sha",
|
|
392
|
+
]);
|
|
393
|
+
return {
|
|
394
|
+
...info,
|
|
395
|
+
baseSha: baseSha.stdout.trim() || null,
|
|
379
396
|
};
|
|
380
397
|
});
|
|
381
398
|
|
|
@@ -593,7 +610,9 @@ export const waitForMergeable = Effect.fn("pr.waitForMergeable")(function* (
|
|
|
593
610
|
// Cap the sleep to the remaining budget so the total wait doesn't overshoot the deadline.
|
|
594
611
|
const remaining = deadlineMs - Number(now);
|
|
595
612
|
yield* Effect.sleep(Duration.millis(Math.min(MERGEABLE_POLL_INTERVAL_MS, remaining)));
|
|
596
|
-
latest = yield*
|
|
613
|
+
latest = yield* fetchPRView(pr).pipe(
|
|
614
|
+
Effect.map((info) => ({ ...info, baseSha: latest.baseSha })),
|
|
615
|
+
);
|
|
597
616
|
}),
|
|
598
617
|
step: () => undefined,
|
|
599
618
|
});
|
|
@@ -1283,7 +1302,10 @@ export const fetchFailedChecks = Effect.fn("pr.fetchFailedChecks")(function* (
|
|
|
1283
1302
|
const snapshot = yield* collectWithStableState(
|
|
1284
1303
|
initial,
|
|
1285
1304
|
(info) => fetchCheckResults(info.number),
|
|
1286
|
-
(info) =>
|
|
1305
|
+
(info) =>
|
|
1306
|
+
fetchPRView(info.number).pipe(
|
|
1307
|
+
Effect.map((refreshed) => ({ ...refreshed, baseSha: initial.baseSha })),
|
|
1308
|
+
),
|
|
1287
1309
|
(before, after) => after.headSha === before.headSha,
|
|
1288
1310
|
);
|
|
1289
1311
|
if (snapshot !== null) {
|
|
@@ -19,9 +19,10 @@ import { makeSchemaCommand, formatOption, formatOutput, logText, VERSION } from
|
|
|
19
19
|
import { AuditServiceLayer, withAudit } from "#shared/audit";
|
|
20
20
|
import { ResolvedPaths, ResolvedPathsLayer } from "./config";
|
|
21
21
|
import { SessionStorageNotFoundError } from "./errors";
|
|
22
|
-
import { formatDate, SessionService, SessionServiceLayer
|
|
22
|
+
import { formatDate, SessionService, SessionServiceLayer } from "./service";
|
|
23
23
|
import {
|
|
24
24
|
projectSessionFilter,
|
|
25
|
+
shapeBody,
|
|
25
26
|
sessionSummariesFromMessages,
|
|
26
27
|
sortSessionSummaries,
|
|
27
28
|
} from "./summaries";
|
|
@@ -50,14 +51,14 @@ const buildScopeLabel = (searchAll: boolean, currentDir: string) => {
|
|
|
50
51
|
return `current project (${projectName})`;
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
const mapSummary = (summary: MessageSummary) => {
|
|
54
|
+
const mapSummary = (maxBodyChars: number) => (summary: MessageSummary) => {
|
|
54
55
|
return Effect.gen(function* () {
|
|
55
56
|
const paths = yield* ResolvedPaths;
|
|
56
57
|
return {
|
|
57
58
|
sessionID: summary.sessionID,
|
|
58
59
|
messageID: summary.id,
|
|
59
60
|
title: summary.title,
|
|
60
|
-
|
|
61
|
+
...shapeBody(summary.body, maxBodyChars),
|
|
61
62
|
created: formatDate(summary.created),
|
|
62
63
|
...(summary.source === "opencode"
|
|
63
64
|
? {
|
|
@@ -184,13 +185,17 @@ const searchCommand = Command.make(
|
|
|
184
185
|
Flag.withDefault(false),
|
|
185
186
|
),
|
|
186
187
|
format: formatOption,
|
|
188
|
+
bodyChars: Flag.integer("body-chars").pipe(
|
|
189
|
+
Flag.withDescription("Max message body characters per result (0 = full bodies)"),
|
|
190
|
+
Flag.withDefault(500),
|
|
191
|
+
),
|
|
187
192
|
limit: Flag.integer("limit").pipe(
|
|
188
193
|
Flag.withDescription("Limit result count"),
|
|
189
194
|
Flag.withDefault(10),
|
|
190
195
|
),
|
|
191
196
|
source: sourceOption,
|
|
192
197
|
},
|
|
193
|
-
({ all, format, limit, query, source }) =>
|
|
198
|
+
({ all, bodyChars, format, limit, query, source }) =>
|
|
194
199
|
Effect.gen(function* () {
|
|
195
200
|
const sessionService = yield* SessionService;
|
|
196
201
|
const startTime = Date.now();
|
|
@@ -218,7 +223,7 @@ const searchCommand = Command.make(
|
|
|
218
223
|
const allSummaries = yield* sessionService.getMessageSummaries(sessionFilter);
|
|
219
224
|
const summaries = filterBySource(allSummaries, source);
|
|
220
225
|
const matched = sessionService.searchSummaries(summaries, query);
|
|
221
|
-
const mappedResults = yield* Effect.all(matched.slice(0, limit).map(mapSummary));
|
|
226
|
+
const mappedResults = yield* Effect.all(matched.slice(0, limit).map(mapSummary(bodyChars)));
|
|
222
227
|
|
|
223
228
|
return {
|
|
224
229
|
success: true,
|
|
@@ -287,7 +292,7 @@ const readCommand = Command.make(
|
|
|
287
292
|
onSuccess: (summaries) => {
|
|
288
293
|
const filtered = filterBySource(summaries, source);
|
|
289
294
|
const sessionResults = filtered.filter((summary) => summary.sessionID === session);
|
|
290
|
-
return Effect.all(sessionResults.map(mapSummary)).pipe(
|
|
295
|
+
return Effect.all(sessionResults.map(mapSummary(0))).pipe(
|
|
291
296
|
Effect.map(
|
|
292
297
|
(mapped) =>
|
|
293
298
|
({
|
|
@@ -33,14 +33,6 @@ export const formatDate = (timestamp: number): string => {
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export const truncate = (value: string, maxLen: number): string => {
|
|
37
|
-
if (value.length <= maxLen) {
|
|
38
|
-
return value;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return `${value.slice(0, maxLen - 3)}...`;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
36
|
type FileEntry = { filePath: string; content: string };
|
|
45
37
|
|
|
46
38
|
type SourceFilter = ReadonlySet<SessionSource>;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import type { MessageSummary, SessionSummary } from "./types";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Shapes a message body for output. A body silently cut to 500 chars was
|
|
5
|
+
* indistinguishable from a short one, so callers read "no match in this snippet" as
|
|
6
|
+
* "not in this session". When the body is cut, say so and report its real length.
|
|
7
|
+
*
|
|
8
|
+
* maxBodyChars <= 0 returns the full body.
|
|
9
|
+
*/
|
|
10
|
+
export const shapeBody = (
|
|
11
|
+
body: string,
|
|
12
|
+
maxBodyChars: number,
|
|
13
|
+
): { body: string; bodyLength?: number; truncated?: true } => {
|
|
14
|
+
if (maxBodyChars <= 0 || body.length <= maxBodyChars) {
|
|
15
|
+
return { body };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const kept = body.slice(0, Math.max(0, maxBodyChars - 3));
|
|
19
|
+
return { body: `${kept}...`, bodyLength: body.length, truncated: true };
|
|
20
|
+
};
|
|
21
|
+
|
|
3
22
|
export const sessionSummariesFromMessages = (summaries: MessageSummary[]): SessionSummary[] => {
|
|
4
23
|
const bySession = new Map<string, SessionSummary>();
|
|
5
24
|
|