node-pagefind 0.1.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 +97 -0
- package/dist/cli.d.ts +404 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +126 -0
- package/dist/cli.js.map +1 -0
- package/dist/digest.d.ts +20 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +424 -0
- package/dist/digest.js.map +1 -0
- package/dist/index.d.ts +405 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/pagefind.d.ts +30 -0
- package/dist/pagefind.d.ts.map +1 -0
- package/dist/pagefind.js +215 -0
- package/dist/pagefind.js.map +1 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +19 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +115 -0
- package/dist/utils.js.map +1 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# pr-digest
|
|
2
|
+
|
|
3
|
+
A CLI tool for generating comprehensive digests of GitHub pull requests, optimized for AI agent handoffs with full timeline context.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Fetches all PR information (title, description, branches)
|
|
8
|
+
- Retrieves complete timeline including reviews, comments, and status changes
|
|
9
|
+
- Formats output using markdown-factory for clean, readable output
|
|
10
|
+
- Includes AI agent instructions based on timeline analysis
|
|
11
|
+
- Flexible authentication (args, env vars, or gh CLI)
|
|
12
|
+
- Auto-detects PR from current git repository using Octokit
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g pr-digest
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Auto-detect PR from current git repository
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pr-digest digest
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
When run from a GitHub repository, `pr-digest` will:
|
|
29
|
+
|
|
30
|
+
1. Detect the GitHub repository from `git remote get-url origin`
|
|
31
|
+
2. Get the current branch name from `git branch --show-current`
|
|
32
|
+
3. Search GitHub for an open PR with a matching head branch
|
|
33
|
+
4. Generate a digest for that PR
|
|
34
|
+
|
|
35
|
+
You can still explicitly provide owner/repo/pr if needed:
|
|
36
|
+
|
|
37
|
+
- `--owner` and `--repo` override the detected GitHub repository
|
|
38
|
+
- `--pr` overrides the auto-detected PR number
|
|
39
|
+
|
|
40
|
+
### Using a GitHub PR URL
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pr-digest digest https://github.com/owner/repo/pull/123
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### With output file
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pr-digest digest --url https://github.com/owner/repo/pull/123 --output digest.md
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Authentication
|
|
53
|
+
|
|
54
|
+
The tool tries token sources in this order:
|
|
55
|
+
|
|
56
|
+
1. `--token` CLI argument
|
|
57
|
+
2. `GH_TOKEN` environment variable
|
|
58
|
+
3. `GITHUB_TOKEN` environment variable
|
|
59
|
+
4. `gh auth token` command (requires GitHub CLI)
|
|
60
|
+
|
|
61
|
+
## Digest Format
|
|
62
|
+
|
|
63
|
+
The generated digest includes:
|
|
64
|
+
|
|
65
|
+
- **PR Header**: Title, number, and link
|
|
66
|
+
- **Branch Information**: Base branch (for `git diff` commands) and head branch
|
|
67
|
+
- **Timeline Section**: Full conversation history including:
|
|
68
|
+
- Review summary with approval statistics
|
|
69
|
+
- Individual review comments with review states
|
|
70
|
+
- Nx Cloud CI links (detected and highlighted)
|
|
71
|
+
- General Comments: Issue-level comments with threaded replies
|
|
72
|
+
- File-Specific Comments\*\*: Review comments grouped by file with line numbers and ranges
|
|
73
|
+
- **AI Agent Instructions**: Context-aware guidelines based on timeline data
|
|
74
|
+
|
|
75
|
+
> **Timeline Features:**
|
|
76
|
+
|
|
77
|
+
- Shows review state (approved, changes requested, commented, dismissed, etc.)
|
|
78
|
+
- Groups comments into threads with replies
|
|
79
|
+
- Detects Nx Cloud CI links in review comments and highlights them
|
|
80
|
+
- Provides review summary statistics for quick overview
|
|
81
|
+
- Helps AI agents understand the full review conversation context
|
|
82
|
+
|
|
83
|
+
## Development
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Build
|
|
87
|
+
npm run build
|
|
88
|
+
|
|
89
|
+
# Run tests
|
|
90
|
+
npm run test
|
|
91
|
+
|
|
92
|
+
# Type check
|
|
93
|
+
npm run typecheck
|
|
94
|
+
|
|
95
|
+
# Lint
|
|
96
|
+
npm run lint
|
|
97
|
+
```
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import type { PagefindResultData } from './types.js';
|
|
3
|
+
declare const pagefindCLI: import("cli-forge").CLI<{
|
|
4
|
+
unmatched: string[];
|
|
5
|
+
'--'?: string[];
|
|
6
|
+
} & {
|
|
7
|
+
url?: string;
|
|
8
|
+
} & {} & {
|
|
9
|
+
path?: string;
|
|
10
|
+
} & {} & {
|
|
11
|
+
cachePath?: string;
|
|
12
|
+
} & {}, void, {
|
|
13
|
+
search: import("cli-forge").CLI<{
|
|
14
|
+
unmatched: string[];
|
|
15
|
+
'--'?: string[];
|
|
16
|
+
} & {
|
|
17
|
+
url?: string;
|
|
18
|
+
} & {} & {
|
|
19
|
+
path?: string;
|
|
20
|
+
} & {} & {
|
|
21
|
+
cachePath?: string;
|
|
22
|
+
} & {} & {
|
|
23
|
+
query?: string;
|
|
24
|
+
} & {} & {
|
|
25
|
+
lang?: string;
|
|
26
|
+
} & {} & {
|
|
27
|
+
excerpt?: boolean;
|
|
28
|
+
} & {} & {
|
|
29
|
+
limit?: number;
|
|
30
|
+
} & {}, Promise<{
|
|
31
|
+
query: string;
|
|
32
|
+
results: {
|
|
33
|
+
score: number;
|
|
34
|
+
data: PagefindResultData;
|
|
35
|
+
}[];
|
|
36
|
+
}>, {}, import("cli-forge").CLI<{
|
|
37
|
+
unmatched: string[];
|
|
38
|
+
'--'?: string[];
|
|
39
|
+
} & {
|
|
40
|
+
url?: string;
|
|
41
|
+
} & {} & {
|
|
42
|
+
path?: string;
|
|
43
|
+
} & {} & {
|
|
44
|
+
cachePath?: string;
|
|
45
|
+
} & {}, any, {}, any>>;
|
|
46
|
+
} & {
|
|
47
|
+
filters: import("cli-forge").CLI<{
|
|
48
|
+
unmatched: string[];
|
|
49
|
+
'--'?: string[];
|
|
50
|
+
} & {
|
|
51
|
+
url?: string;
|
|
52
|
+
} & {} & {
|
|
53
|
+
path?: string;
|
|
54
|
+
} & {} & {
|
|
55
|
+
cachePath?: string;
|
|
56
|
+
} & {}, Promise<import("./types.js").PagefindFilterMap>, {
|
|
57
|
+
search: import("cli-forge").CLI<{
|
|
58
|
+
unmatched: string[];
|
|
59
|
+
'--'?: string[];
|
|
60
|
+
} & {
|
|
61
|
+
url?: string;
|
|
62
|
+
} & {} & {
|
|
63
|
+
path?: string;
|
|
64
|
+
} & {} & {
|
|
65
|
+
cachePath?: string;
|
|
66
|
+
} & {} & {
|
|
67
|
+
query?: string;
|
|
68
|
+
} & {} & {
|
|
69
|
+
lang?: string;
|
|
70
|
+
} & {} & {
|
|
71
|
+
excerpt?: boolean;
|
|
72
|
+
} & {} & {
|
|
73
|
+
limit?: number;
|
|
74
|
+
} & {}, Promise<{
|
|
75
|
+
query: string;
|
|
76
|
+
results: {
|
|
77
|
+
score: number;
|
|
78
|
+
data: PagefindResultData;
|
|
79
|
+
}[];
|
|
80
|
+
}>, {}, import("cli-forge").CLI<{
|
|
81
|
+
unmatched: string[];
|
|
82
|
+
'--'?: string[];
|
|
83
|
+
} & {
|
|
84
|
+
url?: string;
|
|
85
|
+
} & {} & {
|
|
86
|
+
path?: string;
|
|
87
|
+
} & {} & {
|
|
88
|
+
cachePath?: string;
|
|
89
|
+
} & {}, any, {}, any>>;
|
|
90
|
+
}, import("cli-forge").CLI<{
|
|
91
|
+
unmatched: string[];
|
|
92
|
+
'--'?: string[];
|
|
93
|
+
} & {
|
|
94
|
+
url?: string;
|
|
95
|
+
} & {} & {
|
|
96
|
+
path?: string;
|
|
97
|
+
} & {} & {
|
|
98
|
+
cachePath?: string;
|
|
99
|
+
} & {}, any, {
|
|
100
|
+
search: import("cli-forge").CLI<{
|
|
101
|
+
unmatched: string[];
|
|
102
|
+
'--'?: string[];
|
|
103
|
+
} & {
|
|
104
|
+
url?: string;
|
|
105
|
+
} & {} & {
|
|
106
|
+
path?: string;
|
|
107
|
+
} & {} & {
|
|
108
|
+
cachePath?: string;
|
|
109
|
+
} & {} & {
|
|
110
|
+
query?: string;
|
|
111
|
+
} & {} & {
|
|
112
|
+
lang?: string;
|
|
113
|
+
} & {} & {
|
|
114
|
+
excerpt?: boolean;
|
|
115
|
+
} & {} & {
|
|
116
|
+
limit?: number;
|
|
117
|
+
} & {}, Promise<{
|
|
118
|
+
query: string;
|
|
119
|
+
results: {
|
|
120
|
+
score: number;
|
|
121
|
+
data: PagefindResultData;
|
|
122
|
+
}[];
|
|
123
|
+
}>, {}, import("cli-forge").CLI<{
|
|
124
|
+
unmatched: string[];
|
|
125
|
+
'--'?: string[];
|
|
126
|
+
} & {
|
|
127
|
+
url?: string;
|
|
128
|
+
} & {} & {
|
|
129
|
+
path?: string;
|
|
130
|
+
} & {} & {
|
|
131
|
+
cachePath?: string;
|
|
132
|
+
} & {}, any, {}, any>>;
|
|
133
|
+
}, any>>;
|
|
134
|
+
} & {
|
|
135
|
+
info: import("cli-forge").CLI<{
|
|
136
|
+
unmatched: string[];
|
|
137
|
+
'--'?: string[];
|
|
138
|
+
} & {
|
|
139
|
+
url?: string;
|
|
140
|
+
} & {} & {
|
|
141
|
+
path?: string;
|
|
142
|
+
} & {} & {
|
|
143
|
+
cachePath?: string;
|
|
144
|
+
} & {}, Promise<{
|
|
145
|
+
baseUrl: string;
|
|
146
|
+
pagefindPath: string;
|
|
147
|
+
initialized: boolean;
|
|
148
|
+
}>, {
|
|
149
|
+
search: import("cli-forge").CLI<{
|
|
150
|
+
unmatched: string[];
|
|
151
|
+
'--'?: string[];
|
|
152
|
+
} & {
|
|
153
|
+
url?: string;
|
|
154
|
+
} & {} & {
|
|
155
|
+
path?: string;
|
|
156
|
+
} & {} & {
|
|
157
|
+
cachePath?: string;
|
|
158
|
+
} & {} & {
|
|
159
|
+
query?: string;
|
|
160
|
+
} & {} & {
|
|
161
|
+
lang?: string;
|
|
162
|
+
} & {} & {
|
|
163
|
+
excerpt?: boolean;
|
|
164
|
+
} & {} & {
|
|
165
|
+
limit?: number;
|
|
166
|
+
} & {}, Promise<{
|
|
167
|
+
query: string;
|
|
168
|
+
results: {
|
|
169
|
+
score: number;
|
|
170
|
+
data: PagefindResultData;
|
|
171
|
+
}[];
|
|
172
|
+
}>, {}, import("cli-forge").CLI<{
|
|
173
|
+
unmatched: string[];
|
|
174
|
+
'--'?: string[];
|
|
175
|
+
} & {
|
|
176
|
+
url?: string;
|
|
177
|
+
} & {} & {
|
|
178
|
+
path?: string;
|
|
179
|
+
} & {} & {
|
|
180
|
+
cachePath?: string;
|
|
181
|
+
} & {}, any, {}, any>>;
|
|
182
|
+
} & {
|
|
183
|
+
filters: import("cli-forge").CLI<{
|
|
184
|
+
unmatched: string[];
|
|
185
|
+
'--'?: string[];
|
|
186
|
+
} & {
|
|
187
|
+
url?: string;
|
|
188
|
+
} & {} & {
|
|
189
|
+
path?: string;
|
|
190
|
+
} & {} & {
|
|
191
|
+
cachePath?: string;
|
|
192
|
+
} & {}, Promise<import("./types.js").PagefindFilterMap>, {
|
|
193
|
+
search: import("cli-forge").CLI<{
|
|
194
|
+
unmatched: string[];
|
|
195
|
+
'--'?: string[];
|
|
196
|
+
} & {
|
|
197
|
+
url?: string;
|
|
198
|
+
} & {} & {
|
|
199
|
+
path?: string;
|
|
200
|
+
} & {} & {
|
|
201
|
+
cachePath?: string;
|
|
202
|
+
} & {} & {
|
|
203
|
+
query?: string;
|
|
204
|
+
} & {} & {
|
|
205
|
+
lang?: string;
|
|
206
|
+
} & {} & {
|
|
207
|
+
excerpt?: boolean;
|
|
208
|
+
} & {} & {
|
|
209
|
+
limit?: number;
|
|
210
|
+
} & {}, Promise<{
|
|
211
|
+
query: string;
|
|
212
|
+
results: {
|
|
213
|
+
score: number;
|
|
214
|
+
data: PagefindResultData;
|
|
215
|
+
}[];
|
|
216
|
+
}>, {}, import("cli-forge").CLI<{
|
|
217
|
+
unmatched: string[];
|
|
218
|
+
'--'?: string[];
|
|
219
|
+
} & {
|
|
220
|
+
url?: string;
|
|
221
|
+
} & {} & {
|
|
222
|
+
path?: string;
|
|
223
|
+
} & {} & {
|
|
224
|
+
cachePath?: string;
|
|
225
|
+
} & {}, any, {}, any>>;
|
|
226
|
+
}, import("cli-forge").CLI<{
|
|
227
|
+
unmatched: string[];
|
|
228
|
+
'--'?: string[];
|
|
229
|
+
} & {
|
|
230
|
+
url?: string;
|
|
231
|
+
} & {} & {
|
|
232
|
+
path?: string;
|
|
233
|
+
} & {} & {
|
|
234
|
+
cachePath?: string;
|
|
235
|
+
} & {}, any, {
|
|
236
|
+
search: import("cli-forge").CLI<{
|
|
237
|
+
unmatched: string[];
|
|
238
|
+
'--'?: string[];
|
|
239
|
+
} & {
|
|
240
|
+
url?: string;
|
|
241
|
+
} & {} & {
|
|
242
|
+
path?: string;
|
|
243
|
+
} & {} & {
|
|
244
|
+
cachePath?: string;
|
|
245
|
+
} & {} & {
|
|
246
|
+
query?: string;
|
|
247
|
+
} & {} & {
|
|
248
|
+
lang?: string;
|
|
249
|
+
} & {} & {
|
|
250
|
+
excerpt?: boolean;
|
|
251
|
+
} & {} & {
|
|
252
|
+
limit?: number;
|
|
253
|
+
} & {}, Promise<{
|
|
254
|
+
query: string;
|
|
255
|
+
results: {
|
|
256
|
+
score: number;
|
|
257
|
+
data: PagefindResultData;
|
|
258
|
+
}[];
|
|
259
|
+
}>, {}, import("cli-forge").CLI<{
|
|
260
|
+
unmatched: string[];
|
|
261
|
+
'--'?: string[];
|
|
262
|
+
} & {
|
|
263
|
+
url?: string;
|
|
264
|
+
} & {} & {
|
|
265
|
+
path?: string;
|
|
266
|
+
} & {} & {
|
|
267
|
+
cachePath?: string;
|
|
268
|
+
} & {}, any, {}, any>>;
|
|
269
|
+
}, any>>;
|
|
270
|
+
}, import("cli-forge").CLI<{
|
|
271
|
+
unmatched: string[];
|
|
272
|
+
'--'?: string[];
|
|
273
|
+
} & {
|
|
274
|
+
url?: string;
|
|
275
|
+
} & {} & {
|
|
276
|
+
path?: string;
|
|
277
|
+
} & {} & {
|
|
278
|
+
cachePath?: string;
|
|
279
|
+
} & {}, any, {
|
|
280
|
+
search: import("cli-forge").CLI<{
|
|
281
|
+
unmatched: string[];
|
|
282
|
+
'--'?: string[];
|
|
283
|
+
} & {
|
|
284
|
+
url?: string;
|
|
285
|
+
} & {} & {
|
|
286
|
+
path?: string;
|
|
287
|
+
} & {} & {
|
|
288
|
+
cachePath?: string;
|
|
289
|
+
} & {} & {
|
|
290
|
+
query?: string;
|
|
291
|
+
} & {} & {
|
|
292
|
+
lang?: string;
|
|
293
|
+
} & {} & {
|
|
294
|
+
excerpt?: boolean;
|
|
295
|
+
} & {} & {
|
|
296
|
+
limit?: number;
|
|
297
|
+
} & {}, Promise<{
|
|
298
|
+
query: string;
|
|
299
|
+
results: {
|
|
300
|
+
score: number;
|
|
301
|
+
data: PagefindResultData;
|
|
302
|
+
}[];
|
|
303
|
+
}>, {}, import("cli-forge").CLI<{
|
|
304
|
+
unmatched: string[];
|
|
305
|
+
'--'?: string[];
|
|
306
|
+
} & {
|
|
307
|
+
url?: string;
|
|
308
|
+
} & {} & {
|
|
309
|
+
path?: string;
|
|
310
|
+
} & {} & {
|
|
311
|
+
cachePath?: string;
|
|
312
|
+
} & {}, any, {}, any>>;
|
|
313
|
+
} & {
|
|
314
|
+
filters: import("cli-forge").CLI<{
|
|
315
|
+
unmatched: string[];
|
|
316
|
+
'--'?: string[];
|
|
317
|
+
} & {
|
|
318
|
+
url?: string;
|
|
319
|
+
} & {} & {
|
|
320
|
+
path?: string;
|
|
321
|
+
} & {} & {
|
|
322
|
+
cachePath?: string;
|
|
323
|
+
} & {}, Promise<import("./types.js").PagefindFilterMap>, {
|
|
324
|
+
search: import("cli-forge").CLI<{
|
|
325
|
+
unmatched: string[];
|
|
326
|
+
'--'?: string[];
|
|
327
|
+
} & {
|
|
328
|
+
url?: string;
|
|
329
|
+
} & {} & {
|
|
330
|
+
path?: string;
|
|
331
|
+
} & {} & {
|
|
332
|
+
cachePath?: string;
|
|
333
|
+
} & {} & {
|
|
334
|
+
query?: string;
|
|
335
|
+
} & {} & {
|
|
336
|
+
lang?: string;
|
|
337
|
+
} & {} & {
|
|
338
|
+
excerpt?: boolean;
|
|
339
|
+
} & {} & {
|
|
340
|
+
limit?: number;
|
|
341
|
+
} & {}, Promise<{
|
|
342
|
+
query: string;
|
|
343
|
+
results: {
|
|
344
|
+
score: number;
|
|
345
|
+
data: PagefindResultData;
|
|
346
|
+
}[];
|
|
347
|
+
}>, {}, import("cli-forge").CLI<{
|
|
348
|
+
unmatched: string[];
|
|
349
|
+
'--'?: string[];
|
|
350
|
+
} & {
|
|
351
|
+
url?: string;
|
|
352
|
+
} & {} & {
|
|
353
|
+
path?: string;
|
|
354
|
+
} & {} & {
|
|
355
|
+
cachePath?: string;
|
|
356
|
+
} & {}, any, {}, any>>;
|
|
357
|
+
}, import("cli-forge").CLI<{
|
|
358
|
+
unmatched: string[];
|
|
359
|
+
'--'?: string[];
|
|
360
|
+
} & {
|
|
361
|
+
url?: string;
|
|
362
|
+
} & {} & {
|
|
363
|
+
path?: string;
|
|
364
|
+
} & {} & {
|
|
365
|
+
cachePath?: string;
|
|
366
|
+
} & {}, any, {
|
|
367
|
+
search: import("cli-forge").CLI<{
|
|
368
|
+
unmatched: string[];
|
|
369
|
+
'--'?: string[];
|
|
370
|
+
} & {
|
|
371
|
+
url?: string;
|
|
372
|
+
} & {} & {
|
|
373
|
+
path?: string;
|
|
374
|
+
} & {} & {
|
|
375
|
+
cachePath?: string;
|
|
376
|
+
} & {} & {
|
|
377
|
+
query?: string;
|
|
378
|
+
} & {} & {
|
|
379
|
+
lang?: string;
|
|
380
|
+
} & {} & {
|
|
381
|
+
excerpt?: boolean;
|
|
382
|
+
} & {} & {
|
|
383
|
+
limit?: number;
|
|
384
|
+
} & {}, Promise<{
|
|
385
|
+
query: string;
|
|
386
|
+
results: {
|
|
387
|
+
score: number;
|
|
388
|
+
data: PagefindResultData;
|
|
389
|
+
}[];
|
|
390
|
+
}>, {}, import("cli-forge").CLI<{
|
|
391
|
+
unmatched: string[];
|
|
392
|
+
'--'?: string[];
|
|
393
|
+
} & {
|
|
394
|
+
url?: string;
|
|
395
|
+
} & {} & {
|
|
396
|
+
path?: string;
|
|
397
|
+
} & {} & {
|
|
398
|
+
cachePath?: string;
|
|
399
|
+
} & {}, any, {}, any>>;
|
|
400
|
+
}, any>>;
|
|
401
|
+
}, any>>;
|
|
402
|
+
}, undefined>;
|
|
403
|
+
export default pagefindCLI;
|
|
404
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAyEE,MAAM;kBACP,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBADjB,MAAM;sBACP,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBADjB,MAAM;sBACP,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBADjB,MAAM;sBACP,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BADjB,MAAM;0BACP,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BADjB,MAAM;0BACP,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBADjB,MAAM;sBACP,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BADjB,MAAM;0BACP,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BADjB,MAAM;0BACP,kBAAkB;;;;;;;;;;;;;;aAmElC,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { __awaiter } from "tslib";
|
|
3
|
+
import { cli } from 'cli-forge';
|
|
4
|
+
import { createPagefindClient } from './pagefind.js';
|
|
5
|
+
const pagefindCLI = cli('pagefind', {
|
|
6
|
+
description: 'Query Pagefind search indices from Node.js',
|
|
7
|
+
builder: (args) => args
|
|
8
|
+
.option('url', {
|
|
9
|
+
type: 'string',
|
|
10
|
+
description: 'Base URL of a remote site that hosts the Pagefind index',
|
|
11
|
+
coerce: (input) => {
|
|
12
|
+
if (input && !input.match(/^.*:\/\//)) {
|
|
13
|
+
// default scheme to https if not provided
|
|
14
|
+
return `https://${input}`;
|
|
15
|
+
}
|
|
16
|
+
return input;
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
.option('path', {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'Path to a locally built site (directory containing pagefind/)',
|
|
22
|
+
})
|
|
23
|
+
.option('cachePath', {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'Custom cache directory for downloaded pagefind.js (bypasses version-based caching)',
|
|
26
|
+
})
|
|
27
|
+
.command('search', {
|
|
28
|
+
description: 'Search the pagefind index',
|
|
29
|
+
builder: (c) => c
|
|
30
|
+
.positional('query', {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Search query',
|
|
33
|
+
required: true,
|
|
34
|
+
})
|
|
35
|
+
.option('lang', {
|
|
36
|
+
type: 'string',
|
|
37
|
+
default: 'en',
|
|
38
|
+
description: 'Language code',
|
|
39
|
+
})
|
|
40
|
+
.option('excerpt', {
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
default: false,
|
|
43
|
+
description: 'Show excerpt from each result',
|
|
44
|
+
})
|
|
45
|
+
.option('limit', {
|
|
46
|
+
type: 'number',
|
|
47
|
+
default: 10,
|
|
48
|
+
description: 'Maximum results to show',
|
|
49
|
+
}),
|
|
50
|
+
handler: (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
+
const client = createPagefindClient({
|
|
52
|
+
path: opts.path,
|
|
53
|
+
url: opts.url,
|
|
54
|
+
cachePath: opts.cachePath,
|
|
55
|
+
});
|
|
56
|
+
yield client.init(opts.lang);
|
|
57
|
+
const query = opts.query;
|
|
58
|
+
const result = yield client.search(query, {
|
|
59
|
+
language: opts.lang,
|
|
60
|
+
excerpt: opts.excerpt,
|
|
61
|
+
limit: opts.limit,
|
|
62
|
+
});
|
|
63
|
+
if (result.results.length === 0) {
|
|
64
|
+
console.log('No results found');
|
|
65
|
+
return { query, results: [] };
|
|
66
|
+
}
|
|
67
|
+
console.log(`\nFound ${result.results.length} result(s):\n`);
|
|
68
|
+
const maxResults = opts.limit;
|
|
69
|
+
const resolvedResults = [];
|
|
70
|
+
for (const r of result.results.slice(0, maxResults)) {
|
|
71
|
+
const data = yield r.data();
|
|
72
|
+
resolvedResults.push({ score: r.score, data });
|
|
73
|
+
console.log(`[${r.score.toFixed(2)}] ${data.meta.title}`);
|
|
74
|
+
console.log(` URL: ${data.url}`);
|
|
75
|
+
if (opts.excerpt && data.excerpt) {
|
|
76
|
+
console.log(` ${data.excerpt
|
|
77
|
+
.replace(/<[^>]*>/g, '')
|
|
78
|
+
.substring(0, 150)}...`);
|
|
79
|
+
}
|
|
80
|
+
console.log();
|
|
81
|
+
}
|
|
82
|
+
if (result.results.length > maxResults) {
|
|
83
|
+
console.log(`... and ${result.results.length - maxResults} more results`);
|
|
84
|
+
}
|
|
85
|
+
return { query, results: resolvedResults };
|
|
86
|
+
}),
|
|
87
|
+
alias: ['$0'],
|
|
88
|
+
})
|
|
89
|
+
.command('filters', {
|
|
90
|
+
description: 'List available search filters',
|
|
91
|
+
builder: (c) => c,
|
|
92
|
+
handler: (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
+
const client = createPagefindClient({
|
|
94
|
+
path: opts.path,
|
|
95
|
+
url: opts.url,
|
|
96
|
+
cachePath: opts.cachePath,
|
|
97
|
+
});
|
|
98
|
+
yield client.init();
|
|
99
|
+
const filters = yield client.filters();
|
|
100
|
+
console.log('Available filters:');
|
|
101
|
+
for (const [key, values] of Object.entries(filters)) {
|
|
102
|
+
console.log(` ${key}: ${Object.keys(values).join(', ')}`);
|
|
103
|
+
}
|
|
104
|
+
return filters;
|
|
105
|
+
}),
|
|
106
|
+
})
|
|
107
|
+
.command('info', {
|
|
108
|
+
description: 'Show index configuration information',
|
|
109
|
+
builder: (c) => c,
|
|
110
|
+
handler: (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
111
|
+
const client = createPagefindClient({
|
|
112
|
+
path: opts.path,
|
|
113
|
+
url: opts.url,
|
|
114
|
+
cachePath: opts.cachePath,
|
|
115
|
+
});
|
|
116
|
+
const info = client.getInfo();
|
|
117
|
+
console.log(`Base URL: ${info.baseUrl}`);
|
|
118
|
+
console.log(`Pagefind path: ${info.pagefindPath}`);
|
|
119
|
+
console.log(`Initialized: ${info.initialized}`);
|
|
120
|
+
return info;
|
|
121
|
+
}),
|
|
122
|
+
}),
|
|
123
|
+
});
|
|
124
|
+
export default pagefindCLI;
|
|
125
|
+
pagefindCLI.forge();
|
|
126
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,MAAM,WAAW,GAAG,GAAG,CAAC,UAAU,EAAE;IAClC,WAAW,EAAE,4CAA4C;IACzD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAChB,IAAI;SACD,MAAM,CAAC,KAAK,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,yDAAyD;QACtE,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;gBACtC,0CAA0C;gBAC1C,OAAO,WAAW,KAAK,EAAE,CAAC;YAC5B,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,+DAA+D;KAClE,CAAC;SACD,MAAM,CAAC,WAAW,EAAE;QACnB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,oFAAoF;KACvF,CAAC;SACD,OAAO,CAAC,QAAQ,EAAE;QACjB,WAAW,EAAE,2BAA2B;QACxC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CACb,CAAC;aACE,UAAU,CAAC,OAAO,EAAE;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;aACD,MAAM,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,eAAe;SA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.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PrInfo, TimelineEvent } from './types';
|
|
2
|
+
interface CheckRun {
|
|
3
|
+
name: string;
|
|
4
|
+
status: 'queued' | 'in_progress' | 'completed' | 'waiting' | 'requested' | 'pending';
|
|
5
|
+
conclusion: 'success' | 'failure' | 'neutral' | 'cancelled' | 'timed_out' | 'action_required' | 'skipped' | null;
|
|
6
|
+
startedAt: string;
|
|
7
|
+
completedAt: string | null;
|
|
8
|
+
htmlUrl: string;
|
|
9
|
+
detailsUrl: string;
|
|
10
|
+
logs: string[];
|
|
11
|
+
aiSummary?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function fetchPrData(owner: string, repo: string, prNumber: number, token?: string, aiProvider?: 'opencode' | 'claude'): Promise<{
|
|
14
|
+
pr: PrInfo;
|
|
15
|
+
timeline: TimelineEvent[];
|
|
16
|
+
checkRuns: CheckRun[];
|
|
17
|
+
}>;
|
|
18
|
+
export declare function formatDigest(pr: PrInfo, timeline: TimelineEvent[], checkRuns?: CheckRun[]): string;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../src/digest.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAErD,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EACF,QAAQ,GACR,aAAa,GACb,WAAW,GACX,SAAS,GACT,WAAW,GACX,SAAS,CAAC;IACd,UAAU,EACN,SAAS,GACT,SAAS,GACT,SAAS,GACT,WAAW,GACX,WAAW,GACX,iBAAiB,GACjB,SAAS,GACT,IAAI,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqOD,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,UAAU,GAAE,UAAU,GAAG,QAAqB,GAC7C,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAAC,SAAS,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAuK3E;AAED,wBAAgB,YAAY,CAC1B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,aAAa,EAAE,EACzB,SAAS,GAAE,QAAQ,EAAO,GACzB,MAAM,CA2DR"}
|