@juangadm/pre-post 0.3.0 → 1.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.
Files changed (153) hide show
  1. package/README.md +174 -233
  2. package/dist/baseline.d.ts +119 -0
  3. package/dist/baseline.d.ts.map +1 -0
  4. package/dist/baseline.js +316 -0
  5. package/dist/baseline.js.map +1 -0
  6. package/dist/bin/cli.js +243 -458
  7. package/dist/bin/cli.js.map +1 -1
  8. package/dist/browser.d.ts +68 -25
  9. package/dist/browser.d.ts.map +1 -1
  10. package/dist/browser.js +500 -105
  11. package/dist/browser.js.map +1 -1
  12. package/dist/capture.d.ts +1 -6
  13. package/dist/capture.d.ts.map +1 -1
  14. package/dist/capture.js +12 -36
  15. package/dist/capture.js.map +1 -1
  16. package/dist/commands/compare.d.ts +18 -0
  17. package/dist/commands/compare.d.ts.map +1 -0
  18. package/dist/commands/compare.js +82 -0
  19. package/dist/commands/compare.js.map +1 -0
  20. package/dist/commands/detect.d.ts +25 -0
  21. package/dist/commands/detect.d.ts.map +1 -0
  22. package/dist/commands/detect.js +22 -0
  23. package/dist/commands/detect.js.map +1 -0
  24. package/dist/commands/doctor.d.ts +42 -0
  25. package/dist/commands/doctor.d.ts.map +1 -0
  26. package/dist/commands/doctor.js +119 -0
  27. package/dist/commands/doctor.js.map +1 -0
  28. package/dist/commands/login.d.ts +6 -0
  29. package/dist/commands/login.d.ts.map +1 -0
  30. package/dist/commands/login.js +34 -0
  31. package/dist/commands/login.js.map +1 -0
  32. package/dist/commands/pr.d.ts +32 -0
  33. package/dist/commands/pr.d.ts.map +1 -0
  34. package/dist/commands/pr.js +259 -0
  35. package/dist/commands/pr.js.map +1 -0
  36. package/dist/commands/prune.d.ts +10 -0
  37. package/dist/commands/prune.d.ts.map +1 -0
  38. package/dist/commands/prune.js +13 -0
  39. package/dist/commands/prune.js.map +1 -0
  40. package/dist/comparison.d.ts +104 -0
  41. package/dist/comparison.d.ts.map +1 -0
  42. package/dist/comparison.js +236 -0
  43. package/dist/comparison.js.map +1 -0
  44. package/dist/config.d.ts +46 -0
  45. package/dist/config.d.ts.map +1 -0
  46. package/dist/config.js +82 -0
  47. package/dist/config.js.map +1 -0
  48. package/dist/deployments.d.ts +71 -0
  49. package/dist/deployments.d.ts.map +1 -0
  50. package/dist/deployments.js +204 -0
  51. package/dist/deployments.js.map +1 -0
  52. package/dist/diff-pool.d.ts +17 -0
  53. package/dist/diff-pool.d.ts.map +1 -0
  54. package/dist/diff-pool.js +92 -0
  55. package/dist/diff-pool.js.map +1 -0
  56. package/dist/diff-worker.d.ts +32 -0
  57. package/dist/diff-worker.d.ts.map +1 -0
  58. package/dist/diff-worker.js +39 -0
  59. package/dist/diff-worker.js.map +1 -0
  60. package/dist/diff.d.ts +47 -0
  61. package/dist/diff.d.ts.map +1 -0
  62. package/dist/diff.js +281 -0
  63. package/dist/diff.js.map +1 -0
  64. package/dist/doctor.d.ts +79 -0
  65. package/dist/doctor.d.ts.map +1 -0
  66. package/dist/doctor.js +138 -0
  67. package/dist/doctor.js.map +1 -0
  68. package/dist/errors.d.ts +38 -0
  69. package/dist/errors.d.ts.map +1 -0
  70. package/dist/errors.js +59 -0
  71. package/dist/errors.js.map +1 -0
  72. package/dist/git.d.ts +61 -0
  73. package/dist/git.d.ts.map +1 -0
  74. package/dist/git.js +182 -0
  75. package/dist/git.js.map +1 -0
  76. package/dist/github.d.ts +163 -0
  77. package/dist/github.d.ts.map +1 -0
  78. package/dist/github.js +411 -0
  79. package/dist/github.js.map +1 -0
  80. package/dist/index.d.ts +22 -23
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +17 -67
  83. package/dist/index.js.map +1 -1
  84. package/dist/landing.d.ts +48 -0
  85. package/dist/landing.d.ts.map +1 -0
  86. package/dist/landing.js +93 -0
  87. package/dist/landing.js.map +1 -0
  88. package/dist/pkg.d.ts +17 -0
  89. package/dist/pkg.d.ts.map +1 -0
  90. package/dist/pkg.js +49 -0
  91. package/dist/pkg.js.map +1 -0
  92. package/dist/report.d.ts +20 -0
  93. package/dist/report.d.ts.map +1 -0
  94. package/dist/report.js +130 -0
  95. package/dist/report.js.map +1 -0
  96. package/dist/routes/imports.d.ts +46 -0
  97. package/dist/routes/imports.d.ts.map +1 -0
  98. package/dist/routes/imports.js +208 -0
  99. package/dist/routes/imports.js.map +1 -0
  100. package/dist/routes/vite.d.ts +15 -0
  101. package/dist/routes/vite.d.ts.map +1 -0
  102. package/dist/routes/vite.js +130 -0
  103. package/dist/routes/vite.js.map +1 -0
  104. package/dist/routes.d.ts +65 -11
  105. package/dist/routes.d.ts.map +1 -1
  106. package/dist/routes.js +346 -141
  107. package/dist/routes.js.map +1 -1
  108. package/dist/run.d.ts +116 -0
  109. package/dist/run.d.ts.map +1 -0
  110. package/dist/run.js +316 -0
  111. package/dist/run.js.map +1 -0
  112. package/dist/sameness.d.ts +91 -0
  113. package/dist/sameness.d.ts.map +1 -0
  114. package/dist/sameness.js +157 -0
  115. package/dist/sameness.js.map +1 -0
  116. package/dist/sessions.d.ts +50 -0
  117. package/dist/sessions.d.ts.map +1 -0
  118. package/dist/sessions.js +80 -0
  119. package/dist/sessions.js.map +1 -0
  120. package/dist/shift.d.ts +67 -0
  121. package/dist/shift.d.ts.map +1 -0
  122. package/dist/shift.js +184 -0
  123. package/dist/shift.js.map +1 -0
  124. package/dist/types.d.ts +179 -68
  125. package/dist/types.d.ts.map +1 -1
  126. package/dist/types.js +1 -0
  127. package/dist/types.js.map +1 -1
  128. package/dist/url.d.ts +12 -0
  129. package/dist/url.d.ts.map +1 -0
  130. package/dist/url.js +30 -0
  131. package/dist/url.js.map +1 -0
  132. package/dist/viewport.d.ts +6 -1
  133. package/dist/viewport.d.ts.map +1 -1
  134. package/dist/viewport.js +13 -7
  135. package/dist/viewport.js.map +1 -1
  136. package/package.json +21 -14
  137. package/skill/SKILL.md +56 -221
  138. package/dist/clipboard.d.ts +0 -9
  139. package/dist/clipboard.d.ts.map +0 -1
  140. package/dist/clipboard.js +0 -26
  141. package/dist/clipboard.js.map +0 -1
  142. package/dist/upload.d.ts +0 -39
  143. package/dist/upload.d.ts.map +0 -1
  144. package/dist/upload.js +0 -159
  145. package/dist/upload.js.map +0 -1
  146. package/dist/video.d.ts +0 -19
  147. package/dist/video.d.ts.map +0 -1
  148. package/dist/video.js +0 -263
  149. package/dist/video.js.map +0 -1
  150. package/skill/scripts/adapters/0x0st.sh +0 -36
  151. package/skill/scripts/adapters/blob.sh +0 -55
  152. package/skill/scripts/adapters/git-native.sh +0 -51
  153. package/skill/scripts/upload-and-copy.sh +0 -230
package/dist/git.d.ts ADDED
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Thin git helpers. Every call is a single short-lived subprocess.
3
+ */
4
+ export declare function git(args: string[], cwd?: string): string;
5
+ export declare function repoRoot(cwd?: string): string;
6
+ export declare function currentBranch(cwd?: string): string | null;
7
+ export declare function headSha(cwd?: string): string | null;
8
+ /**
9
+ * Parse "owner/repo" from a remote URL. Supports HTTPS, SSH, and proxy URLs
10
+ * whose last two path segments are owner/repo.
11
+ */
12
+ export declare function parseOwnerRepo(remoteUrl: string): string | null;
13
+ export declare function resolveOwnerRepo(cwd?: string): string;
14
+ /** Default branch of origin (main/master/...), best effort. */
15
+ export declare function defaultBranch(cwd?: string): string;
16
+ /** Merge base between HEAD and the default branch, or null when unknown. */
17
+ export declare function mergeBase(cwd?: string): string | null;
18
+ /** True when this clone was made with --depth, so its history may be missing. */
19
+ export declare function isShallow(cwd?: string): boolean;
20
+ /** The branch this work forked from: the CI hint first, then origin's default. */
21
+ export declare function baseBranchName(cwd?: string): string;
22
+ /**
23
+ * git's empty tree. Diffing against it lists every tracked file, which is the
24
+ * honest answer in a repository whose first commit has not happened yet.
25
+ */
26
+ export declare const EMPTY_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
27
+ /** What a run diffs against, and how it was found. */
28
+ export interface BaseResolution {
29
+ /** The commit the working tree is compared with. */
30
+ sha: string;
31
+ source: 'explicit' | 'merge-base' | 'fetched' | 'head';
32
+ /** The base branch it came from, when one is known. */
33
+ branch?: string;
34
+ }
35
+ export interface ResolveBaseOptions {
36
+ /** A ref the caller named; it wins outright. */
37
+ explicit?: string;
38
+ /** Allow one network fetch to repair a shallow clone. Default true. */
39
+ fetch?: boolean;
40
+ log?: (msg: string) => void;
41
+ }
42
+ /**
43
+ * The commit this branch forked from, or null when that cannot be established.
44
+ *
45
+ * Null is a real answer and callers must treat it as one: diffing against HEAD
46
+ * instead reports only uncommitted work, so a branch whose changes are
47
+ * committed comes back as "nothing changed" — the wrong answer, stated
48
+ * confidently.
49
+ */
50
+ export declare function resolveBase(cwd?: string, opts?: ResolveBaseOptions): BaseResolution | null;
51
+ /** `resolveBase`, with the one sentence a human needs when it comes back null. */
52
+ export declare function requireBase(cwd: string, opts?: ResolveBaseOptions): BaseResolution;
53
+ /**
54
+ * Files changed relative to `diffTarget`, plus anything staged, unstaged, or
55
+ * untracked. Paths are relative to the repo root.
56
+ *
57
+ * The target is required: working it out is `resolveBase`'s job, because
58
+ * guessing it wrong here is silent and reports an empty diff.
59
+ */
60
+ export declare function changedFiles(cwd: string, diffTarget: string): string[];
61
+ //# sourceMappingURL=git.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,SAAgB,GAAG,MAAM,CAE/D;AAUD,wBAAgB,QAAQ,CAAC,GAAG,SAAgB,GAAG,MAAM,CAIpD;AAED,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzD;AAED,wBAAgB,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEnD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG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package/dist/git.js ADDED
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Thin git helpers. Every call is a single short-lived subprocess.
3
+ */
4
+ import { execFileSync } from 'child_process';
5
+ import { NeedsHumanError } from './errors.js';
6
+ export function git(args, cwd = process.cwd()) {
7
+ return execFileSync('git', args, { cwd, encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'] }).trim();
8
+ }
9
+ function tryGit(args, cwd) {
10
+ try {
11
+ return git(args, cwd);
12
+ }
13
+ catch {
14
+ return null;
15
+ }
16
+ }
17
+ export function repoRoot(cwd = process.cwd()) {
18
+ const root = tryGit(['rev-parse', '--show-toplevel'], cwd);
19
+ if (!root)
20
+ throw new Error('Not inside a git repository.');
21
+ return root;
22
+ }
23
+ export function currentBranch(cwd) {
24
+ const b = tryGit(['rev-parse', '--abbrev-ref', 'HEAD'], cwd);
25
+ return b && b !== 'HEAD' ? b : null;
26
+ }
27
+ export function headSha(cwd) {
28
+ return tryGit(['rev-parse', 'HEAD'], cwd);
29
+ }
30
+ /**
31
+ * Parse "owner/repo" from a remote URL. Supports HTTPS, SSH, and proxy URLs
32
+ * whose last two path segments are owner/repo.
33
+ */
34
+ export function parseOwnerRepo(remoteUrl) {
35
+ const std = remoteUrl.match(/github\.com[/:]([^/]+\/[^/]+?)(?:\.git)?\/?$/);
36
+ if (std)
37
+ return std[1];
38
+ const fallback = remoteUrl.match(/\/([^/]+\/[^/]+?)(?:\.git)?\/?$/);
39
+ return fallback ? fallback[1] : null;
40
+ }
41
+ export function resolveOwnerRepo(cwd) {
42
+ const env = process.env.GH_REPO || process.env.GITHUB_REPOSITORY;
43
+ if (env)
44
+ return env;
45
+ const url = tryGit(['remote', 'get-url', 'origin'], cwd);
46
+ const parsed = url ? parseOwnerRepo(url) : null;
47
+ if (!parsed) {
48
+ throw new Error('Cannot determine GitHub repository. Set GH_REPO=owner/repo.');
49
+ }
50
+ return parsed;
51
+ }
52
+ /** Default branch of origin (main/master/...), best effort. */
53
+ export function defaultBranch(cwd) {
54
+ const ref = tryGit(['symbolic-ref', '--short', 'refs/remotes/origin/HEAD'], cwd);
55
+ if (ref)
56
+ return ref.replace(/^origin\//, '');
57
+ const found = lines(tryGit([
58
+ 'for-each-ref', '--format=%(refname:short)',
59
+ 'refs/remotes/origin/main', 'refs/remotes/origin/master', 'refs/heads/main', 'refs/heads/master',
60
+ ], cwd));
61
+ const first = found[0]?.replace(/^origin\//, '');
62
+ return first || 'main';
63
+ }
64
+ /** Merge base between HEAD and the default branch, or null when unknown. */
65
+ export function mergeBase(cwd) {
66
+ return mergeBaseWith(defaultBranch(cwd), cwd);
67
+ }
68
+ function mergeBaseWith(branch, cwd) {
69
+ return tryGit(['merge-base', `origin/${branch}`, 'HEAD'], cwd)
70
+ || tryGit(['merge-base', branch, 'HEAD'], cwd);
71
+ }
72
+ /** True when this clone was made with --depth, so its history may be missing. */
73
+ export function isShallow(cwd) {
74
+ return tryGit(['rev-parse', '--is-shallow-repository'], cwd) === 'true';
75
+ }
76
+ /** The branch this work forked from: the CI hint first, then origin's default. */
77
+ export function baseBranchName(cwd) {
78
+ // GitHub Actions sets this on pull_request events, and it is more reliable
79
+ // than origin/HEAD in a checkout that has neither.
80
+ const env = process.env.GITHUB_BASE_REF?.trim();
81
+ return env || defaultBranch(cwd);
82
+ }
83
+ /**
84
+ * Make the base branch reachable in a clone that does not have it.
85
+ *
86
+ * Sandbox and web environments check a branch out with `--depth 1
87
+ * --single-branch`, which leaves no origin/<base> ref and no shared history to
88
+ * fork from. Widen in three steps, stopping as soon as a merge base appears, so
89
+ * the common case costs one shallow fetch rather than the whole history.
90
+ */
91
+ function fetchBase(branch, cwd) {
92
+ const refspec = `+refs/heads/${branch}:refs/remotes/origin/${branch}`;
93
+ const attempts = [
94
+ ['fetch', '--no-tags', '--depth=50', 'origin', refspec],
95
+ ['fetch', '--no-tags', '--deepen=200', 'origin', refspec],
96
+ ['fetch', '--no-tags', '--unshallow', 'origin', refspec],
97
+ ];
98
+ for (const args of attempts) {
99
+ // A deepen or unshallow against a complete clone is an error, not a result.
100
+ if (tryGit(args, cwd) === null)
101
+ continue;
102
+ if (mergeBaseWith(branch, cwd))
103
+ return true;
104
+ }
105
+ return false;
106
+ }
107
+ /**
108
+ * git's empty tree. Diffing against it lists every tracked file, which is the
109
+ * honest answer in a repository whose first commit has not happened yet.
110
+ */
111
+ export const EMPTY_TREE = '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
112
+ /**
113
+ * The commit this branch forked from, or null when that cannot be established.
114
+ *
115
+ * Null is a real answer and callers must treat it as one: diffing against HEAD
116
+ * instead reports only uncommitted work, so a branch whose changes are
117
+ * committed comes back as "nothing changed" — the wrong answer, stated
118
+ * confidently.
119
+ */
120
+ export function resolveBase(cwd = process.cwd(), opts = {}) {
121
+ if (opts.explicit) {
122
+ const sha = tryGit(['rev-parse', '--verify', '--quiet', `${opts.explicit}^{commit}`], cwd);
123
+ if (!sha)
124
+ throw new NeedsHumanError(`--base ${opts.explicit} is not a commit in this repository.`);
125
+ return { sha, source: 'explicit' };
126
+ }
127
+ // No commits yet: everything in the tree is new, and there is nothing to
128
+ // fork from. Not a failure — a repository at its very beginning.
129
+ if (!headSha(cwd))
130
+ return { sha: EMPTY_TREE, source: 'head' };
131
+ const branch = baseBranchName(cwd);
132
+ const local = mergeBaseWith(branch, cwd);
133
+ if (local)
134
+ return { sha: local, source: 'merge-base', branch };
135
+ if (opts.fetch !== false) {
136
+ opts.log?.(`No local history for ${branch}; fetching it to see what this branch changed.`);
137
+ if (fetchBase(branch, cwd)) {
138
+ const sha = mergeBaseWith(branch, cwd);
139
+ if (sha)
140
+ return { sha, source: 'fetched', branch };
141
+ }
142
+ }
143
+ // Standing on the base branch with nothing to fork from: the change under
144
+ // review is whatever is uncommitted, which is what diffing HEAD reports.
145
+ if (currentBranch(cwd) === branch) {
146
+ const head = headSha(cwd);
147
+ if (head)
148
+ return { sha: head, source: 'head', branch };
149
+ }
150
+ return null;
151
+ }
152
+ /** `resolveBase`, with the one sentence a human needs when it comes back null. */
153
+ export function requireBase(cwd, opts = {}) {
154
+ const base = resolveBase(cwd, opts);
155
+ if (base)
156
+ return base;
157
+ const branch = baseBranchName(cwd);
158
+ throw new NeedsHumanError(`Cannot tell what this branch changed: this clone shares no history with ${branch}` +
159
+ `${isShallow(cwd) ? ' (it is a shallow checkout)' : ''}. ` +
160
+ `Run \`git fetch origin ${branch}\`, or pass --base <ref>.`);
161
+ }
162
+ function lines(out) {
163
+ return out ? out.split('\n').map(l => l.trim()).filter(Boolean) : [];
164
+ }
165
+ /**
166
+ * Files changed relative to `diffTarget`, plus anything staged, unstaged, or
167
+ * untracked. Paths are relative to the repo root.
168
+ *
169
+ * The target is required: working it out is `resolveBase`'s job, because
170
+ * guessing it wrong here is silent and reports an empty diff.
171
+ */
172
+ export function changedFiles(cwd, diffTarget) {
173
+ const files = new Set();
174
+ const root = repoRoot(cwd);
175
+ const target = diffTarget;
176
+ lines(tryGit(['diff', '--name-only', target], root)).forEach(f => files.add(f));
177
+ lines(tryGit(['diff', '--name-only', '--cached'], root)).forEach(f => files.add(f));
178
+ lines(tryGit(['diff', '--name-only'], root)).forEach(f => files.add(f));
179
+ lines(tryGit(['ls-files', '--others', '--exclude-standard'], root)).forEach(f => files.add(f));
180
+ return Array.from(files);
181
+ }
182
+ //# sourceMappingURL=git.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,UAAU,GAAG,CAAC,IAAc,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IACrD,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAA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M,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpF,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,oBAAoB,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * GitHub REST client used for:
3
+ * - finding the open PR for a branch
4
+ * - publishing screenshots to an orphan assets branch (Git Data API, one commit per run)
5
+ * - upserting a sticky PR comment
6
+ * - pruning old assets
7
+ *
8
+ * Authentication: GH_TOKEN / GITHUB_TOKEN, else the gh CLI's stored token.
9
+ */
10
+ export { GitHubError } from './errors.js';
11
+ export declare const API_BASE: string;
12
+ /** Where a token came from. Which one it is decides how a rejection is fixed. */
13
+ export type TokenSource = 'GH_TOKEN' | 'GITHUB_TOKEN' | 'gh';
14
+ export interface FoundToken {
15
+ token: string;
16
+ source: TokenSource;
17
+ }
18
+ /**
19
+ * The token this run will use, and where it came from.
20
+ *
21
+ * The source is not bookkeeping: the env vars take precedence over the `gh`
22
+ * CLI, so advice aimed at the wrong one is advice that cannot work. Someone
23
+ * whose `GH_TOKEN` is refused gains nothing from `gh auth login`, because the
24
+ * variable still wins on the next run.
25
+ */
26
+ export declare function findToken(): FoundToken | null;
27
+ export declare function getToken(): string | null;
28
+ /** A token and its source, or the one sentence telling the human how to get one. */
29
+ export declare function requireToken(purpose?: string): FoundToken;
30
+ export declare class GitHub {
31
+ private readonly token;
32
+ private readonly base;
33
+ constructor(token: string, base?: string);
34
+ request<T = any>(method: string, path: string, body?: unknown): Promise<T>;
35
+ }
36
+ /** What one write attempt established about this token's access to a repository. */
37
+ export type WriteAccess =
38
+ /** The token wrote an object. It may still be refused a ref by a ruleset. */
39
+ {
40
+ writable: true;
41
+ }
42
+ /** GitHub refused the write. Nothing this run publishes will land. */
43
+ | {
44
+ writable: false;
45
+ reason: 'rejected';
46
+ }
47
+ /** Nobody answered, or answered something that is not about access. */
48
+ | {
49
+ writable: false;
50
+ reason: 'unknown';
51
+ detail: string;
52
+ };
53
+ /**
54
+ * Can this token write to `ownerRepo`?
55
+ *
56
+ * `getToken()` checks that a token exists, which is a different question. A
57
+ * GitHub Actions job that maps `secrets.GITHUB_TOKEN` gets one that reads
58
+ * everything this tool reads and writes nothing: measured on this repository,
59
+ * `GET /repos/juangadm/pre-post` answers 200 with `permissions.push: false`
60
+ * and `POST .../git/blobs` answers 403. Those reads are the ones `pr` makes
61
+ * before it captures, so without this the run spends its screenshots first and
62
+ * discovers the refusal after.
63
+ *
64
+ * The probe is the first write `publishAssets` makes, on the one piece of
65
+ * content that cannot add anything: the empty blob already exists in every
66
+ * repository, so a successful call stores nothing new. A read cannot stand in
67
+ * for it — `permissions.push` describes the account's access to the repository,
68
+ * not the scopes the token carries, so it can report `true` for a credential
69
+ * the write still refuses. That is the confident all-clear this check exists to
70
+ * avoid, which is why it writes.
71
+ *
72
+ * What it proves is bounded: the token may write objects. Creating the assets
73
+ * *ref* is a separate permission a ruleset can refuse, so `writable: true` is
74
+ * "not this failure", never "the publish will work".
75
+ */
76
+ export declare function checkWriteAccess(gh: GitHub, ownerRepo: string): Promise<WriteAccess>;
77
+ /**
78
+ * The one thing to do about a token that cannot publish.
79
+ *
80
+ * It follows the credential that was actually chosen, not just the
81
+ * environment. Being inside a runner does not make `permissions:` the fix: a
82
+ * workflow that sets `GH_TOKEN` to a PAT is refused by that PAT, and rewriting
83
+ * the job's permissions changes only the `GITHUB_TOKEN` the run never reaches.
84
+ * The same holds the other way round on a laptop, where `gh auth login` cannot
85
+ * help while an env var is shadowing it.
86
+ *
87
+ * The runner sentence names both permissions, though only `contents` is what
88
+ * this check tested. Naming `contents` alone would be advice that fails on its
89
+ * own terms: a `permissions:` block sets every scope it omits to none, so
90
+ * following it leaves a token that uploads the screenshots and is then refused
91
+ * the PR description — measured on this repository, `PATCH /pulls/23` answers
92
+ * 403 with only `contents: write` and 200 with `pull-requests: write` beside it.
93
+ * A second trip through a full capture is not worth the tighter sentence.
94
+ */
95
+ export declare function cannotPublishHint(ownerRepo: string, source: TokenSource): string;
96
+ export interface PullRequestRef {
97
+ number: number;
98
+ html_url: string;
99
+ head: {
100
+ sha: string;
101
+ ref: string;
102
+ };
103
+ base: {
104
+ ref: string;
105
+ sha: string;
106
+ };
107
+ title: string;
108
+ }
109
+ export declare function findOpenPr(gh: GitHub, ownerRepo: string, branch: string): Promise<PullRequestRef | null>;
110
+ export declare function getPr(gh: GitHub, ownerRepo: string, number: number): Promise<PullRequestRef & {
111
+ state: string;
112
+ closed_at: string | null;
113
+ merged_at: string | null;
114
+ }>;
115
+ export interface AssetFile {
116
+ /** Path inside the assets branch, e.g. "pr-42/20260115-1200/home-desktop-post.png" */
117
+ path: string;
118
+ content: Buffer;
119
+ }
120
+ export interface PublishResult {
121
+ sha: string;
122
+ /** path → raw-rendering blob URL */
123
+ urls: Map<string, string>;
124
+ }
125
+ export declare function blobUrl(ownerRepo: string, sha: string, filePath: string): string;
126
+ /**
127
+ * Publish files to `branch` as a single commit. Creates the branch as an
128
+ * orphan (no parents) when it does not exist. Retries once on a ref race.
129
+ */
130
+ export declare function publishAssets(gh: GitHub, ownerRepo: string, branch: string, files: AssetFile[], message: string): Promise<PublishResult>;
131
+ export interface CommentResult {
132
+ html_url: string;
133
+ created: boolean;
134
+ }
135
+ /**
136
+ * Create or update the single pre-post comment on a PR, identified by `marker`.
137
+ */
138
+ export declare function upsertStickyComment(gh: GitHub, ownerRepo: string, prNumber: number, body: string, marker: string): Promise<CommentResult>;
139
+ export interface DescriptionResult {
140
+ html_url: string;
141
+ /** False when the PR body could not be edited and nothing was written. */
142
+ updated: boolean;
143
+ }
144
+ /**
145
+ * Write `body` into a marked block in the PR description, replacing the block
146
+ * from a previous run. The description is where reviewers look first, so this
147
+ * is preferred over a comment.
148
+ *
149
+ * Returns updated: false when the token cannot edit the PR (a fork, or no write
150
+ * access), so the caller can fall back to a comment instead of failing.
151
+ */
152
+ export declare function upsertPrDescription(gh: GitHub, ownerRepo: string, prNumber: number, body: string, marker: string): Promise<DescriptionResult>;
153
+ export interface PruneResult {
154
+ removed: string[];
155
+ kept: string[];
156
+ sha?: string;
157
+ }
158
+ /**
159
+ * Remove `pr-<n>/` folders on the assets branch whose PR closed more than
160
+ * `olderThanDays` ago. One commit; no history rewrite.
161
+ */
162
+ export declare function pruneAssets(gh: GitHub, ownerRepo: string, branch: string, olderThanDays: number, dryRun?: boolean): Promise<PruneResult>;
163
+ //# sourceMappingURL=github.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,eAAO,MAAM,QAAQ,QAAyD,CAAC;AAE/E,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,IAAI,CAAC;AAE7D,MAAM,WAAW,UAAU;IACzB,KAAK,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