vouchington-tooling 0.57.0 → 0.59.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 +26 -0
- package/dist/agent-issue-labels/ensure-labels.d.mts +17 -0
- package/dist/agent-issue-labels/ensure-labels.mjs +55 -0
- package/dist/agent-issue-labels/index.d.mts +5 -0
- package/dist/agent-issue-labels/index.mjs +3 -0
- package/dist/agent-issue-labels/label-policy.d.mts +21 -0
- package/dist/agent-issue-labels/label-policy.mjs +67 -0
- package/dist/agent-issue-labels/labels-from-paths.d.mts +9 -0
- package/dist/agent-issue-labels/labels-from-paths.mjs +54 -0
- package/dist/browser-session-runner/tail-queue.d.mts +1 -1
- package/dist/browser-session-runner/tail-queue.mjs +1 -1
- package/dist/cli/commands/agent-issue-labels.d.mts +2 -0
- package/dist/cli/commands/agent-issue-labels.mjs +17 -0
- package/dist/cli/commands/gitleaks-directory-scan.d.mts +4 -0
- package/dist/cli/commands/gitleaks-directory-scan.mjs +9 -0
- package/dist/cli/commands/transient-retry.d.mts +13 -0
- package/dist/cli/commands/transient-retry.mjs +68 -0
- package/dist/cli/index.mjs +14 -53
- package/dist/cli/parse-agent-issue-labels.d.mts +19 -0
- package/dist/cli/parse-agent-issue-labels.mjs +70 -0
- package/dist/cli/parse-forwarded-commands.d.mts +9 -0
- package/dist/cli/parse-forwarded-commands.mjs +6 -0
- package/dist/cli/parse.d.mts +11 -1
- package/dist/cli/parse.mjs +3 -0
- package/dist/cli/script-paths.d.mts +5 -0
- package/dist/cli/script-paths.mjs +48 -0
- package/dist/cli/usage.d.mts +1 -1
- package/dist/cli/usage.mjs +12 -0
- package/dist/dead-code/baseline.d.mts +19 -0
- package/dist/dead-code/baseline.mjs +124 -0
- package/dist/dead-code/child-command.d.mts +6 -0
- package/dist/dead-code/child-command.mjs +107 -0
- package/dist/dead-code/cli.d.mts +5 -0
- package/dist/dead-code/cli.mjs +71 -0
- package/dist/dead-code/entry-roots.d.mts +7 -0
- package/dist/dead-code/entry-roots.mjs +43 -0
- package/dist/dead-code/fixture-deadline.test-helpers.d.mts +1 -0
- package/dist/dead-code/fixture-deadline.test-helpers.mjs +9 -0
- package/dist/dead-code/gate.d.mts +29 -0
- package/dist/dead-code/gate.mjs +33 -0
- package/dist/dead-code/gate.test-helpers.d.mts +14 -0
- package/dist/dead-code/gate.test-helpers.mjs +35 -0
- package/dist/dead-code/index.d.mts +9 -0
- package/dist/dead-code/index.mjs +7 -0
- package/dist/dead-code/scan.d.mts +11 -0
- package/dist/dead-code/scan.mjs +37 -0
- package/dist/dead-code/tracked-snapshot.d.mts +2 -0
- package/dist/dead-code/tracked-snapshot.mjs +72 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -0
- package/dist/markdown/details-scope.d.mts +1 -1
- package/dist/markdown/details-scope.mjs +1 -1
- package/dist/transient-retry/attempts.d.mts +1 -1
- package/dist/transient-retry/attempts.mjs +1 -1
- package/dist/transient-retry/decision-evaluator.d.mts +3 -3
- package/dist/transient-retry/gh-api.d.mts +30 -0
- package/dist/transient-retry/gh-api.mjs +68 -0
- package/dist/transient-retry/github-actions-log.d.mts +7 -0
- package/dist/transient-retry/github-actions-log.mjs +33 -0
- package/dist/transient-retry/index.d.mts +15 -0
- package/dist/transient-retry/index.mjs +8 -0
- package/dist/transient-retry/log-stream.d.mts +12 -0
- package/dist/transient-retry/log-stream.mjs +39 -0
- package/dist/transient-retry/log-window.d.mts +18 -0
- package/dist/transient-retry/log-window.mjs +94 -0
- package/dist/transient-retry/rerun.d.mts +23 -0
- package/dist/transient-retry/rerun.mjs +68 -0
- package/dist/transient-retry/run-context-annotations.d.mts +7 -0
- package/dist/transient-retry/run-context-annotations.mjs +44 -0
- package/dist/transient-retry/run-context-jobs.d.mts +20 -0
- package/dist/transient-retry/run-context-jobs.mjs +54 -0
- package/dist/transient-retry/run-context-logs.d.mts +12 -0
- package/dist/transient-retry/run-context-logs.mjs +86 -0
- package/dist/transient-retry/run-context-rule-attempts.d.mts +14 -0
- package/dist/transient-retry/run-context-rule-attempts.mjs +65 -0
- package/dist/transient-retry/run-context-types.d.mts +49 -0
- package/dist/transient-retry/run-context-types.mjs +3 -0
- package/dist/transient-retry/run-context.d.mts +9 -0
- package/dist/transient-retry/run-context.mjs +25 -0
- package/dist/transient-retry/run-context.test-helpers.d.mts +16 -0
- package/dist/transient-retry/run-context.test-helpers.mjs +56 -0
- package/dist/transient-retry/types.d.mts +8 -7
- package/dist/vitest-diagnostics/vitest-worker-exit-diagnostics-reporter.mjs +1 -1
- package/dist/workflow-secrets-drift/cli.d.mts +10 -0
- package/dist/workflow-secrets-drift/cli.mjs +73 -0
- package/dist/workflow-secrets-drift/collect.d.mts +10 -0
- package/dist/workflow-secrets-drift/collect.mjs +70 -0
- package/dist/workflow-secrets-drift/drift.d.mts +22 -0
- package/dist/workflow-secrets-drift/drift.mjs +49 -0
- package/dist/workflow-secrets-drift/gh-parse.d.mts +5 -0
- package/dist/workflow-secrets-drift/gh-parse.mjs +41 -0
- package/dist/workflow-secrets-drift/gh.d.mts +4 -0
- package/dist/workflow-secrets-drift/gh.mjs +51 -0
- package/dist/workflow-secrets-drift/index.d.mts +11 -0
- package/dist/workflow-secrets-drift/index.mjs +6 -0
- package/dist/workflow-secrets-drift/inventory.d.mts +10 -0
- package/dist/workflow-secrets-drift/inventory.mjs +78 -0
- package/dist/workflow-secrets-drift/scopes.d.mts +12 -0
- package/dist/workflow-secrets-drift/scopes.mjs +56 -0
- package/dist/workflow-secrets-drift/settle.d.mts +3 -0
- package/dist/workflow-secrets-drift/settle.mjs +19 -0
- package/dist/workflow-secrets-drift/types.d.mts +33 -0
- package/dist/workflow-secrets-drift/types.mjs +1 -0
- package/package.json +16 -1
- package/scripts/__pycache__/run_bounded_process.cpython-312.pyc +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function createFixtureDeadline() {
|
|
2
|
+
const deadline = process.hrtime.bigint() + 4000000000n;
|
|
3
|
+
return () => {
|
|
4
|
+
const milliseconds = Number((deadline - process.hrtime.bigint()) / 1000000n);
|
|
5
|
+
if (milliseconds <= 0)
|
|
6
|
+
throw new Error('Analyzer fixture case deadline exhausted');
|
|
7
|
+
return milliseconds;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type DeadCodeOperation = 'check' | 'seed' | 'update';
|
|
2
|
+
export type DeadCodeGateOptions = {
|
|
3
|
+
/** Git repository whose tracked working tree is scanned. */
|
|
4
|
+
repoRoot: string;
|
|
5
|
+
/** Baseline JSON file, absolute or relative to `repoRoot`. */
|
|
6
|
+
baselinePath: string;
|
|
7
|
+
operation?: DeadCodeOperation;
|
|
8
|
+
/** jscpd config, relative to `repoRoot` and tracked. Defaults to `.jscpd.json`. */
|
|
9
|
+
configPath?: string | undefined;
|
|
10
|
+
/** jscpd executable. Defaults to `<repoRoot>/node_modules/.bin/jscpd`. */
|
|
11
|
+
binary?: string | undefined;
|
|
12
|
+
/** Live entry roots (files or globs). Defaults to the config's `deadCode.entry`. */
|
|
13
|
+
entryRoots?: readonly string[] | undefined;
|
|
14
|
+
/** Tracked-file globs left out of the snapshot. */
|
|
15
|
+
snapshotIgnore?: readonly string[] | undefined;
|
|
16
|
+
/** Finding path globs that are not counted. */
|
|
17
|
+
excludeFindings?: readonly string[] | undefined;
|
|
18
|
+
/** Optional deadline source forwarded to child processes. */
|
|
19
|
+
remaining?: (() => number) | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type DeadCodeGateResult = {
|
|
22
|
+
operation: DeadCodeOperation;
|
|
23
|
+
identities: number;
|
|
24
|
+
trackedFiles: number;
|
|
25
|
+
/** Stale identities removed by `update`; 0 for `seed` and `check`. */
|
|
26
|
+
removed: number;
|
|
27
|
+
};
|
|
28
|
+
/** Scans a tracked snapshot and checks, seeds, or shrinks the committed baseline. */
|
|
29
|
+
export declare function runDeadCodeGate(options: DeadCodeGateOptions): Promise<DeadCodeGateResult>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { mkdtemp, rm } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join, resolve } from 'node:path';
|
|
5
|
+
import { reconcileBaseline } from "./baseline.mjs";
|
|
6
|
+
import { resolveEntryRoots } from "./entry-roots.mjs";
|
|
7
|
+
import { scanDeadCode } from "./scan.mjs";
|
|
8
|
+
import { copyTrackedWorkingTree } from "./tracked-snapshot.mjs";
|
|
9
|
+
/** Scans a tracked snapshot and checks, seeds, or shrinks the committed baseline. */
|
|
10
|
+
export async function runDeadCodeGate(options) {
|
|
11
|
+
const operation = options.operation ?? 'check';
|
|
12
|
+
const repoRoot = resolve(options.repoRoot);
|
|
13
|
+
const baselinePath = resolve(repoRoot, options.baselinePath);
|
|
14
|
+
const configPath = options.configPath ?? '.jscpd.json';
|
|
15
|
+
if (operation === 'seed' && existsSync(baselinePath)) {
|
|
16
|
+
throw new Error('Initial baseline already exists; --seed cannot replace it');
|
|
17
|
+
}
|
|
18
|
+
if (operation !== 'seed' && !existsSync(baselinePath)) {
|
|
19
|
+
throw new Error('Dead-code baseline is missing; --seed is required for first adoption');
|
|
20
|
+
}
|
|
21
|
+
const temporaryRoot = await mkdtemp(join(tmpdir(), 'dead-code-gate-'));
|
|
22
|
+
try {
|
|
23
|
+
const snapshotRoot = join(temporaryRoot, 'snapshot');
|
|
24
|
+
const trackedFiles = await copyTrackedWorkingTree(repoRoot, snapshotRoot, options.remaining, options.snapshotIgnore);
|
|
25
|
+
await resolveEntryRoots(snapshotRoot, configPath, options.entryRoots);
|
|
26
|
+
const current = await scanDeadCode(snapshotRoot, join(temporaryRoot, 'report'), options.binary ?? join(repoRoot, 'node_modules/.bin/jscpd'), options.remaining, { configPath, excludeGlobs: options.excludeFindings });
|
|
27
|
+
const removed = await reconcileBaseline(baselinePath, current, operation);
|
|
28
|
+
return { operation, identities: current.length, trackedFiles, removed };
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
await rm(temporaryRoot, { recursive: true, force: true });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Fixture = {
|
|
2
|
+
repo: string;
|
|
3
|
+
binary: string;
|
|
4
|
+
baseline: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const orphan: {
|
|
7
|
+
category: string;
|
|
8
|
+
path: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
/** Writes a stand-in analyzer that records its config and emits `findings`. */
|
|
12
|
+
export declare function analyzer(directory: string, findings: unknown[]): Promise<string>;
|
|
13
|
+
/** A git repository with a tracked config, an entry file, and a tracked orphan. */
|
|
14
|
+
export declare function fixture(findings?: unknown[]): Promise<Fixture>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { chmod, mkdtemp, mkdir, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
export const orphan = { category: 'unused-file', path: 'orphan.mts', name: '' };
|
|
6
|
+
/** Writes a stand-in analyzer that records its config and emits `findings`. */
|
|
7
|
+
export async function analyzer(directory, findings) {
|
|
8
|
+
const binary = join(directory, 'analyzer.mjs');
|
|
9
|
+
const report = { statistics: { files: 3, unparsed: 0 }, findings };
|
|
10
|
+
await writeFile(binary, `#!/usr/bin/env node
|
|
11
|
+
import { copyFileSync, mkdirSync, writeFileSync } from 'node:fs'
|
|
12
|
+
const out = process.argv[process.argv.indexOf('--output') + 1]
|
|
13
|
+
mkdirSync(out, { recursive: true })
|
|
14
|
+
copyFileSync(process.argv[process.argv.indexOf('--config') + 1], out + '/seen-config.json')
|
|
15
|
+
writeFileSync(out + '/basta-report.json', ${JSON.stringify(JSON.stringify(report))})
|
|
16
|
+
`);
|
|
17
|
+
await chmod(binary, 0o755);
|
|
18
|
+
return binary;
|
|
19
|
+
}
|
|
20
|
+
/** A git repository with a tracked config, an entry file, and a tracked orphan. */
|
|
21
|
+
export async function fixture(findings = [orphan]) {
|
|
22
|
+
const directory = await mkdtemp(join(tmpdir(), 'dead-code-gate-test-'));
|
|
23
|
+
const repo = join(directory, 'repo');
|
|
24
|
+
await mkdir(repo);
|
|
25
|
+
execFileSync('git', ['init', '-q'], { cwd: repo });
|
|
26
|
+
await writeFile(join(repo, 'main.mts'), 'export const live = 1\n');
|
|
27
|
+
await writeFile(join(repo, 'orphan.mts'), 'export const orphan = 2\n');
|
|
28
|
+
await writeFile(join(repo, '.jscpd.json'), JSON.stringify({ deadCode: { entry: ['main.mts'] } }));
|
|
29
|
+
execFileSync('git', ['add', '.'], { cwd: repo });
|
|
30
|
+
return {
|
|
31
|
+
repo,
|
|
32
|
+
binary: await analyzer(directory, findings),
|
|
33
|
+
baseline: join(repo, 'baseline.json'),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { runDeadCodeCli, USAGE } from './cli.mts';
|
|
2
|
+
export { runDeadCodeGate } from './gate.mts';
|
|
3
|
+
export type { DeadCodeGateOptions, DeadCodeGateResult, DeadCodeOperation } from './gate.mts';
|
|
4
|
+
export { compareRows, parseBaseline, readBaseline, reconcileBaseline, rowsFromReport, writeBaseline, } from './baseline.mts';
|
|
5
|
+
export type { BaselineRow, FindingIdentity } from './baseline.mts';
|
|
6
|
+
export { resolveEntryRoots } from './entry-roots.mts';
|
|
7
|
+
export { createFindingFilter, scanDeadCode } from './scan.mts';
|
|
8
|
+
export { copyTrackedWorkingTree, trackedPaths } from './tracked-snapshot.mts';
|
|
9
|
+
export { ChildCommandCleanupError, runChildCommand } from './child-command.mts';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { runDeadCodeCli, USAGE } from "./cli.mjs";
|
|
2
|
+
export { runDeadCodeGate } from "./gate.mjs";
|
|
3
|
+
export { compareRows, parseBaseline, readBaseline, reconcileBaseline, rowsFromReport, writeBaseline, } from "./baseline.mjs";
|
|
4
|
+
export { resolveEntryRoots } from "./entry-roots.mjs";
|
|
5
|
+
export { createFindingFilter, scanDeadCode } from "./scan.mjs";
|
|
6
|
+
export { copyTrackedWorkingTree, trackedPaths } from "./tracked-snapshot.mjs";
|
|
7
|
+
export { ChildCommandCleanupError, runChildCommand } from "./child-command.mjs";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type BaselineRow, type FindingIdentity } from './baseline.mts';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the finding filter. Findings in test and spec files, unused files that are only
|
|
4
|
+
* used by tests, and any path matching one of `excludeGlobs` are not counted.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createFindingFilter(excludeGlobs?: readonly string[]): (finding: FindingIdentity, raw: Record<string, unknown>) => boolean;
|
|
7
|
+
/** Runs `binary --dead-code` over a snapshot and returns its baseline rows. */
|
|
8
|
+
export declare function scanDeadCode(snapshotRoot: string, reportRoot: string, binary: string, remaining?: () => number, options?: {
|
|
9
|
+
configPath?: string | undefined;
|
|
10
|
+
excludeGlobs?: readonly string[] | undefined;
|
|
11
|
+
}): Promise<BaselineRow[]>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { join, matchesGlob } from 'node:path';
|
|
3
|
+
import { rowsFromReport } from "./baseline.mjs";
|
|
4
|
+
import { runChildCommand } from "./child-command.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Builds the finding filter. Findings in test and spec files, unused files that are only
|
|
7
|
+
* used by tests, and any path matching one of `excludeGlobs` are not counted.
|
|
8
|
+
*/
|
|
9
|
+
export function createFindingFilter(excludeGlobs = []) {
|
|
10
|
+
return (finding, raw) => {
|
|
11
|
+
if (finding.category === 'unused-file' &&
|
|
12
|
+
Array.isArray(raw['reasons']) &&
|
|
13
|
+
raw['reasons'].includes('used-only-by-tests'))
|
|
14
|
+
return false;
|
|
15
|
+
if (excludeGlobs.some((glob) => matchesGlob(finding.path, glob)))
|
|
16
|
+
return false;
|
|
17
|
+
return !/\.(test|spec)\.[^/]+$/.test(finding.path);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** Runs `binary --dead-code` over a snapshot and returns its baseline rows. */
|
|
21
|
+
export async function scanDeadCode(snapshotRoot, reportRoot, binary, remaining, options = {}) {
|
|
22
|
+
await runChildCommand(binary, [
|
|
23
|
+
'--dead-code',
|
|
24
|
+
'--no-gitignore',
|
|
25
|
+
'--config',
|
|
26
|
+
options.configPath ?? '.jscpd.json',
|
|
27
|
+
'--reporters',
|
|
28
|
+
'json',
|
|
29
|
+
'--output',
|
|
30
|
+
reportRoot,
|
|
31
|
+
'--exit-code',
|
|
32
|
+
'0',
|
|
33
|
+
'.',
|
|
34
|
+
], snapshotRoot, remaining);
|
|
35
|
+
const report = JSON.parse(await readFile(join(reportRoot, 'basta-report.json'), 'utf8'));
|
|
36
|
+
return rowsFromReport(report, createFindingFilter(options.excludeGlobs));
|
|
37
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { copyFile, lstat, mkdir, readlink, realpath, symlink } from 'node:fs/promises';
|
|
3
|
+
import { dirname, isAbsolute, join, matchesGlob, relative, sep } from 'node:path';
|
|
4
|
+
function within(root, path) {
|
|
5
|
+
const difference = relative(root, path);
|
|
6
|
+
return difference !== '..' && !difference.startsWith(`..${sep}`) && !isAbsolute(difference);
|
|
7
|
+
}
|
|
8
|
+
export function trackedPaths(repoRoot, remaining) {
|
|
9
|
+
const output = execFileSync('git', ['ls-files', '--cached', '-z'], {
|
|
10
|
+
cwd: repoRoot,
|
|
11
|
+
maxBuffer: 20 * 1024 * 1024,
|
|
12
|
+
timeout: remaining?.(),
|
|
13
|
+
killSignal: 'SIGKILL',
|
|
14
|
+
});
|
|
15
|
+
return [...new Set(output.toString('utf8').split('\0').filter(Boolean))];
|
|
16
|
+
}
|
|
17
|
+
export async function copyTrackedWorkingTree(repoRoot, snapshotRoot, remaining, ignore = []) {
|
|
18
|
+
const root = await realpath(repoRoot);
|
|
19
|
+
const paths = trackedPaths(root, remaining).filter((path) => !ignore.some((glob) => matchesGlob(path, glob)));
|
|
20
|
+
let copied = 0;
|
|
21
|
+
for (let index = 0; index < paths.length; index += 64) {
|
|
22
|
+
const batch = await Promise.all(paths.slice(index, index + 64).map(async (path) => {
|
|
23
|
+
const source = join(root, path);
|
|
24
|
+
const target = join(snapshotRoot, path);
|
|
25
|
+
if (!within(root, source) || !within(snapshotRoot, target)) {
|
|
26
|
+
throw new Error(`Tracked path escapes the repository: ${path}`);
|
|
27
|
+
}
|
|
28
|
+
let sourceParent;
|
|
29
|
+
try {
|
|
30
|
+
sourceParent = await realpath(dirname(source));
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
if (err.code === 'ENOENT')
|
|
34
|
+
return false; // tracked deletion
|
|
35
|
+
throw err;
|
|
36
|
+
}
|
|
37
|
+
if (!within(root, sourceParent))
|
|
38
|
+
throw new Error(`Tracked path escapes the repository: ${path}`);
|
|
39
|
+
let info;
|
|
40
|
+
try {
|
|
41
|
+
info = await lstat(source);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
if (err.code === 'ENOENT')
|
|
45
|
+
return false; // tracked deletion
|
|
46
|
+
throw err;
|
|
47
|
+
}
|
|
48
|
+
await mkdir(dirname(target), { recursive: true });
|
|
49
|
+
const resolved = await realpath(source);
|
|
50
|
+
if (!within(root, resolved))
|
|
51
|
+
throw new Error(`Tracked path escapes the repository: ${path}`);
|
|
52
|
+
if (info.isSymbolicLink()) {
|
|
53
|
+
const link = await readlink(source);
|
|
54
|
+
const targetLink = isAbsolute(link)
|
|
55
|
+
? relative(dirname(target), join(snapshotRoot, relative(root, resolved)))
|
|
56
|
+
: link;
|
|
57
|
+
await symlink(targetLink, target);
|
|
58
|
+
}
|
|
59
|
+
else if (info.isFile()) {
|
|
60
|
+
await copyFile(source, target);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
throw new Error(`Tracked path is neither a file nor an internal symlink: ${path}`);
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
}));
|
|
67
|
+
copied += batch.filter(Boolean).length;
|
|
68
|
+
}
|
|
69
|
+
if (copied === 0)
|
|
70
|
+
throw new Error('Tracked snapshot contains no files');
|
|
71
|
+
return copied;
|
|
72
|
+
}
|
package/dist/index.d.mts
CHANGED
|
@@ -43,6 +43,8 @@ export type { FakeGitOptions, NamedCheck, SharedContext } from './shared-context
|
|
|
43
43
|
export { decodeSelectedFiles, encodeSelectedFiles, formatMultilineOutput, SELECTED_FILES_ENV_MAX_BYTES, selectedFilesExceedEnvBudget, writeSelectedFilesOutput, } from './gha-selected-files/index.mts';
|
|
44
44
|
export { createArtifactClassifier, parseArtifactPatternsJson, planRunDeletions, runCleanup, sweepCleanup, } from './gha-artifacts-cleanup/index.mts';
|
|
45
45
|
export type { ArtifactClassification, ArtifactClassifier, ArtifactPatterns, CleanupRequest, DeletionSummary, } from './gha-artifacts-cleanup/index.mts';
|
|
46
|
+
export { DEFAULT_LABEL_POLICY, DEFAULT_LABELER_PATH, ensureLabels, labelMetadata, labelsFromPaths, parseLabelPolicy, readLabelPolicyFile, } from './agent-issue-labels/index.mts';
|
|
47
|
+
export type { EnsureLabelsOptions, LabelMetadata, LabelPolicy, } from './agent-issue-labels/index.mts';
|
|
46
48
|
export { validateOptionalHttpOrigin } from './http-origin/index.mts';
|
|
47
49
|
export { boundPendingLine, DEFAULT_MAX_PENDING_LINE_LENGTH, DEFAULT_TRUNCATED_LINE_MARKER, splitCompleteLines, } from './process-line-buffer/index.mts';
|
|
48
50
|
export { isProcessGroupAlive, ProcessGroupDrainTimeoutError, runBrowserSession, waitForProcessGroupExit, } from './browser-session-runner/index.mts';
|
package/dist/index.mjs
CHANGED
|
@@ -22,6 +22,7 @@ export { flattenReleaseAgeSelectors, packageNameFromPnpmLockKey, pnpmLockPackage
|
|
|
22
22
|
export { buildContextFromTrackedFiles, buildSharedContext, clearFakeGitEnv, gitEnv, installFakeGit, runNamedChecks, setFakeGitTrackedFiles, } from "./shared-context/index.mjs";
|
|
23
23
|
export { decodeSelectedFiles, encodeSelectedFiles, formatMultilineOutput, SELECTED_FILES_ENV_MAX_BYTES, selectedFilesExceedEnvBudget, writeSelectedFilesOutput, } from "./gha-selected-files/index.mjs";
|
|
24
24
|
export { createArtifactClassifier, parseArtifactPatternsJson, planRunDeletions, runCleanup, sweepCleanup, } from "./gha-artifacts-cleanup/index.mjs";
|
|
25
|
+
export { DEFAULT_LABEL_POLICY, DEFAULT_LABELER_PATH, ensureLabels, labelMetadata, labelsFromPaths, parseLabelPolicy, readLabelPolicyFile, } from "./agent-issue-labels/index.mjs";
|
|
25
26
|
export { validateOptionalHttpOrigin } from "./http-origin/index.mjs";
|
|
26
27
|
export { boundPendingLine, DEFAULT_MAX_PENDING_LINE_LENGTH, DEFAULT_TRUNCATED_LINE_MARKER, splitCompleteLines, } from "./process-line-buffer/index.mjs";
|
|
27
28
|
export { isProcessGroupAlive, ProcessGroupDrainTimeoutError, runBrowserSession, waitForProcessGroupExit, } from "./browser-session-runner/index.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { MarkdownSectionsDiagnostic } from './document-types.mts';
|
|
2
2
|
/** Tracks disclosure tags from HTML nodes, never from fenced code or Markdown comments. */
|
|
3
3
|
export declare class DetailsScope {
|
|
4
|
-
private readonly markdown;
|
|
5
4
|
readonly diagnostics: MarkdownSectionsDiagnostic[];
|
|
6
5
|
private readonly frames;
|
|
6
|
+
private readonly markdown;
|
|
7
7
|
constructor(markdown: string);
|
|
8
8
|
get visible(): boolean;
|
|
9
9
|
acceptHtml(html: string, startOffset: number): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Normalizes a provider's attempt count when earlier attempts produced no targets.
|
|
3
|
-
*
|
|
3
|
+
* Fetching a provider's run state lives in `run-context*.mts`.
|
|
4
4
|
*/
|
|
5
5
|
export declare function deriveRetryAttempt(runAttempt: number, priorTargetCounts: readonly number[]): number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Normalizes a provider's attempt count when earlier attempts produced no targets.
|
|
3
|
-
*
|
|
3
|
+
* Fetching a provider's run state lives in `run-context*.mts`.
|
|
4
4
|
*/
|
|
5
5
|
export function deriveRetryAttempt(runAttempt, priorTargetCounts) {
|
|
6
6
|
const emptyPriorAttempts = priorTargetCounts.filter((count) => count === 0).length;
|
|
@@ -12,9 +12,9 @@ export type DecisionResult = {
|
|
|
12
12
|
matchedRule: string;
|
|
13
13
|
reason: NoMatchReason;
|
|
14
14
|
};
|
|
15
|
-
export interface EvaluateRulesOptions {
|
|
16
|
-
afterRuleEvaluated?: (context:
|
|
15
|
+
export interface EvaluateRulesOptions<C extends RetryContext = RetryContext> {
|
|
16
|
+
afterRuleEvaluated?: (context: C, rule: RetryRule<C>) => Promise<void> | void;
|
|
17
17
|
/** Defaults to `no-match`. Use `dispatch` when unmatched work should leave the retry engine. */
|
|
18
18
|
unmatchedDecision?: 'no-match' | 'dispatch';
|
|
19
19
|
}
|
|
20
|
-
export declare function decide(context:
|
|
20
|
+
export declare function decide<C extends RetryContext = RetryContext>(context: C, rules: readonly RetryRule<C>[], options?: EvaluateRulesOptions<C>): Promise<DecisionResult>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type RunTextCommand } from '../gh-cli/exec.mts';
|
|
2
|
+
/** Substrings of a failed `gh` call that mark a transport hiccup worth retrying. */
|
|
3
|
+
export declare const DEFAULT_RETRYABLE_MARKERS: readonly string[];
|
|
4
|
+
/** The largest stdout one buffered `gh api` call may return; job logs are streamed, not buffered. */
|
|
5
|
+
export declare const API_MAX_BUFFER_BYTES: number;
|
|
6
|
+
export interface GhApiOptions {
|
|
7
|
+
/** Runs `gh` with the given argv and returns stdout. Defaults to {@link createGhRunner}. */
|
|
8
|
+
run?: RunTextCommand;
|
|
9
|
+
attempts?: number;
|
|
10
|
+
retryableMarkers?: readonly string[];
|
|
11
|
+
sleep?: (ms: number) => Promise<void>;
|
|
12
|
+
warn?: (message: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface GhApi {
|
|
15
|
+
/** `gh api <args>` with bounded retries on transport errors. Resolves to stdout. */
|
|
16
|
+
call: (args: string[]) => Promise<string>;
|
|
17
|
+
isRetryable: (error: unknown) => boolean;
|
|
18
|
+
sleep: (ms: number) => Promise<void>;
|
|
19
|
+
/** Runs an arbitrary `gh` argv once, without retries. */
|
|
20
|
+
run: RunTextCommand;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Builds the default `gh` runner. `tokenEnv` names the environment variable that holds the
|
|
24
|
+
* token; when set and present it is passed to `gh` as `GH_TOKEN`. Otherwise `gh` uses its own
|
|
25
|
+
* credentials.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createGhRunner(tokenEnv?: string): RunTextCommand;
|
|
28
|
+
/** The `gh` child environment: forced color removed, and `tokenEnv`'s value exposed as `GH_TOKEN`. */
|
|
29
|
+
export declare function ghEnvWithToken(tokenEnv?: string): (env: NodeJS.ProcessEnv) => NodeJS.ProcessEnv;
|
|
30
|
+
export declare function createGhApi({ run, attempts, retryableMarkers, sleep, warn, }?: GhApiOptions): GhApi;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { setTimeout as sleepFor } from 'node:timers/promises';
|
|
3
|
+
import { promisify } from 'node:util';
|
|
4
|
+
import { ghSpawnEnv } from "../gh-cli/env.mjs";
|
|
5
|
+
import { createCommandRunner } from "../gh-cli/exec.mjs";
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
7
|
+
/** Substrings of a failed `gh` call that mark a transport hiccup worth retrying. */
|
|
8
|
+
export const DEFAULT_RETRYABLE_MARKERS = [
|
|
9
|
+
'ECONNRESET',
|
|
10
|
+
'ETIMEDOUT',
|
|
11
|
+
'EAI_AGAIN',
|
|
12
|
+
'connection reset',
|
|
13
|
+
'TLS handshake timeout',
|
|
14
|
+
'unexpected EOF',
|
|
15
|
+
'HTTP 502',
|
|
16
|
+
'HTTP 503',
|
|
17
|
+
'HTTP 504',
|
|
18
|
+
];
|
|
19
|
+
/** The largest stdout one buffered `gh api` call may return; job logs are streamed, not buffered. */
|
|
20
|
+
export const API_MAX_BUFFER_BYTES = 16 * 1024 * 1024;
|
|
21
|
+
/**
|
|
22
|
+
* Builds the default `gh` runner. `tokenEnv` names the environment variable that holds the
|
|
23
|
+
* token; when set and present it is passed to `gh` as `GH_TOKEN`. Otherwise `gh` uses its own
|
|
24
|
+
* credentials.
|
|
25
|
+
*/
|
|
26
|
+
export function createGhRunner(tokenEnv) {
|
|
27
|
+
return createCommandRunner('gh', (command, args, options) => execFileAsync(command, args, {
|
|
28
|
+
...options,
|
|
29
|
+
encoding: 'utf8',
|
|
30
|
+
maxBuffer: API_MAX_BUFFER_BYTES,
|
|
31
|
+
}), ghEnvWithToken(tokenEnv));
|
|
32
|
+
}
|
|
33
|
+
/** The `gh` child environment: forced color removed, and `tokenEnv`'s value exposed as `GH_TOKEN`. */
|
|
34
|
+
export function ghEnvWithToken(tokenEnv) {
|
|
35
|
+
return (env) => {
|
|
36
|
+
const base = ghSpawnEnv(env);
|
|
37
|
+
const token = tokenEnv === undefined ? undefined : env[tokenEnv];
|
|
38
|
+
return token ? { ...base, GH_TOKEN: token } : base;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function errorText(error) {
|
|
42
|
+
const stderr = error?.stderr;
|
|
43
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
44
|
+
return typeof stderr === 'string' ? `${message}\n${stderr}` : message;
|
|
45
|
+
}
|
|
46
|
+
export function createGhApi({ run = createGhRunner(), attempts = 3, retryableMarkers = DEFAULT_RETRYABLE_MARKERS, sleep = (ms) => sleepFor(ms), warn = (message) => console.error(message), } = {}) {
|
|
47
|
+
if (!Number.isInteger(attempts) || attempts < 1) {
|
|
48
|
+
throw new Error(`Invalid gh api retry attempts: ${attempts}`);
|
|
49
|
+
}
|
|
50
|
+
const isRetryable = (error) => {
|
|
51
|
+
const text = errorText(error);
|
|
52
|
+
return retryableMarkers.some((marker) => text.includes(marker));
|
|
53
|
+
};
|
|
54
|
+
const call = async (args) => {
|
|
55
|
+
for (let attempt = 1;; attempt += 1) {
|
|
56
|
+
try {
|
|
57
|
+
return await run(['api', ...args]);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
if (attempt >= attempts || !isRetryable(error))
|
|
61
|
+
throw error;
|
|
62
|
+
warn(`::warning::gh api attempt ${attempt}/${attempts} failed; retrying`);
|
|
63
|
+
await sleep(attempt * 1000);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return { call, isRetryable, sleep, run };
|
|
68
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface GithubActionsStepGroupSlice {
|
|
2
|
+
header: string;
|
|
3
|
+
log: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function getGithubActionsStepGroupSlices(log: string): GithubActionsStepGroupSlice[];
|
|
6
|
+
export declare function sliceGithubActionsStepGroup(log: string, runGroup: string): string;
|
|
7
|
+
export declare function terminalFailedGithubActionsStepLog(log: string): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function findGithubActionsStepGroupStarts(log) {
|
|
2
|
+
return [...log.matchAll(/##\[group\]Run [^\n]*/g)].map((match) => match.index);
|
|
3
|
+
}
|
|
4
|
+
export function getGithubActionsStepGroupSlices(log) {
|
|
5
|
+
const starts = findGithubActionsStepGroupStarts(log);
|
|
6
|
+
return starts.map((start, index) => {
|
|
7
|
+
const end = starts[index + 1] ?? log.length;
|
|
8
|
+
const headerEnd = log.indexOf('\n', start);
|
|
9
|
+
return {
|
|
10
|
+
header: headerEnd === -1 ? log.slice(start, end) : log.slice(start, headerEnd),
|
|
11
|
+
log: log.slice(start, end),
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export function sliceGithubActionsStepGroup(log, runGroup) {
|
|
16
|
+
const start = log.indexOf(runGroup);
|
|
17
|
+
if (start === -1)
|
|
18
|
+
return '';
|
|
19
|
+
const searchStart = start + runGroup.length;
|
|
20
|
+
const nextGroupIndex = log.slice(searchStart).search(/##\[group\]Run [^\n]*/);
|
|
21
|
+
const end = nextGroupIndex === -1 ? log.length : searchStart + nextGroupIndex;
|
|
22
|
+
return log.slice(start, end);
|
|
23
|
+
}
|
|
24
|
+
const stepFailurePattern = /(?:Process completed with exit code [1-9]\d*\.|The action(?: '[^']+')? has timed out)/;
|
|
25
|
+
export function terminalFailedGithubActionsStepLog(log) {
|
|
26
|
+
const slices = getGithubActionsStepGroupSlices(log);
|
|
27
|
+
for (let index = slices.length - 1; index >= 0; index -= 1) {
|
|
28
|
+
const stepLog = slices[index].log;
|
|
29
|
+
if (stepFailurePattern.test(stepLog))
|
|
30
|
+
return stepLog;
|
|
31
|
+
}
|
|
32
|
+
return '';
|
|
33
|
+
}
|
|
@@ -2,3 +2,18 @@ export { deriveRetryAttempt } from './attempts.mts';
|
|
|
2
2
|
export { decide } from './decision-evaluator.mts';
|
|
3
3
|
export type { DecisionResult, EvaluateRulesOptions, NoMatchReason } from './decision-evaluator.mts';
|
|
4
4
|
export type { RetryContext, RetryDecision, RetryRule, RetryTarget } from './types.mts';
|
|
5
|
+
export { API_MAX_BUFFER_BYTES, createGhApi, createGhRunner, ghEnvWithToken, DEFAULT_RETRYABLE_MARKERS, } from './gh-api.mts';
|
|
6
|
+
export type { GhApi, GhApiOptions } from './gh-api.mts';
|
|
7
|
+
export { getGithubActionsStepGroupSlices, sliceGithubActionsStepGroup, terminalFailedGithubActionsStepLog, } from './github-actions-log.mts';
|
|
8
|
+
export type { GithubActionsStepGroupSlice } from './github-actions-log.mts';
|
|
9
|
+
export { createGhLogStreamer, streamGhApiLog } from './log-stream.mts';
|
|
10
|
+
export { DEFAULT_LOG_LIMITS, LOG_OMISSION_MARKER } from './log-window.mts';
|
|
11
|
+
export type { LogLimits } from './log-window.mts';
|
|
12
|
+
export { NO_RERUN, RERUN_REQUESTED, rerunKnownTransient } from './rerun.mts';
|
|
13
|
+
export type { RerunKnownTransientOptions } from './rerun.mts';
|
|
14
|
+
export { buildWorkflowRunContext } from './run-context.mts';
|
|
15
|
+
export type { BuildWorkflowRunContextOptions } from './run-context.mts';
|
|
16
|
+
export { fetchWorkflowRunSummary } from './run-context-jobs.mts';
|
|
17
|
+
export type { WorkflowRunSummary } from './run-context-jobs.mts';
|
|
18
|
+
export { isFailedWorkflowConclusion } from './run-context-types.mts';
|
|
19
|
+
export type { JobEntry, RunFetchEnv, WorkflowConclusion, WorkflowJobStep, WorkflowRetryRule, WorkflowRunContext, } from './run-context-types.mts';
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export { deriveRetryAttempt } from "./attempts.mjs";
|
|
2
2
|
export { decide } from "./decision-evaluator.mjs";
|
|
3
|
+
export { API_MAX_BUFFER_BYTES, createGhApi, createGhRunner, ghEnvWithToken, DEFAULT_RETRYABLE_MARKERS, } from "./gh-api.mjs";
|
|
4
|
+
export { getGithubActionsStepGroupSlices, sliceGithubActionsStepGroup, terminalFailedGithubActionsStepLog, } from "./github-actions-log.mjs";
|
|
5
|
+
export { createGhLogStreamer, streamGhApiLog } from "./log-stream.mjs";
|
|
6
|
+
export { DEFAULT_LOG_LIMITS, LOG_OMISSION_MARKER } from "./log-window.mjs";
|
|
7
|
+
export { NO_RERUN, RERUN_REQUESTED, rerunKnownTransient } from "./rerun.mjs";
|
|
8
|
+
export { buildWorkflowRunContext } from "./run-context.mjs";
|
|
9
|
+
export { fetchWorkflowRunSummary } from "./run-context-jobs.mjs";
|
|
10
|
+
export { isFailedWorkflowConclusion } from "./run-context-types.mjs";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ChildProcessByStdio } from 'node:child_process';
|
|
2
|
+
import type { Readable } from 'node:stream';
|
|
3
|
+
type GhChild = ChildProcessByStdio<null, Readable, Readable>;
|
|
4
|
+
export type SpawnGh = (args: string[]) => GhChild;
|
|
5
|
+
/** A log streamer whose `gh` child sees `tokenEnv`'s value as `GH_TOKEN`, like `createGhRunner`. */
|
|
6
|
+
export declare const createGhLogStreamer: (tokenEnv?: string) => (path: string) => AsyncGenerator<Buffer<ArrayBufferLike>, any, any>;
|
|
7
|
+
/**
|
|
8
|
+
* Streams one `gh api` response body in chunks so the caller never buffers a whole job log. If the
|
|
9
|
+
* consumer stops early the child is killed. A non-zero exit throws with at most 4 KiB of stderr.
|
|
10
|
+
*/
|
|
11
|
+
export declare function streamGhApiLog(path: string, spawnChild?: SpawnGh): AsyncGenerator<Buffer>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { ghEnvWithToken } from "./gh-api.mjs";
|
|
3
|
+
const STDERR_MAX_BYTES = 4 * 1024;
|
|
4
|
+
const spawnGhWith = (buildEnv) => (args) => spawn('gh', args, { env: buildEnv(process.env), stdio: ['ignore', 'pipe', 'pipe'] });
|
|
5
|
+
/** A log streamer whose `gh` child sees `tokenEnv`'s value as `GH_TOKEN`, like `createGhRunner`. */
|
|
6
|
+
export const createGhLogStreamer = (tokenEnv) => (path) => streamGhApiLog(path, spawnGhWith(ghEnvWithToken(tokenEnv)));
|
|
7
|
+
/**
|
|
8
|
+
* Streams one `gh api` response body in chunks so the caller never buffers a whole job log. If the
|
|
9
|
+
* consumer stops early the child is killed. A non-zero exit throws with at most 4 KiB of stderr.
|
|
10
|
+
*/
|
|
11
|
+
export async function* streamGhApiLog(path, spawnChild = spawnGhWith(ghEnvWithToken())) {
|
|
12
|
+
const child = spawnChild(['api', '--allow-escape-sequences', path]);
|
|
13
|
+
const stderr = [];
|
|
14
|
+
let stderrBytes = 0;
|
|
15
|
+
child.stderr.on('data', (chunk) => {
|
|
16
|
+
const part = Buffer.from(chunk).subarray(0, STDERR_MAX_BYTES - stderrBytes);
|
|
17
|
+
stderr.push(part);
|
|
18
|
+
stderrBytes += part.byteLength;
|
|
19
|
+
});
|
|
20
|
+
const closed = new Promise((resolve, reject) => {
|
|
21
|
+
child.once('error', reject);
|
|
22
|
+
child.once('close', resolve);
|
|
23
|
+
});
|
|
24
|
+
closed.catch(() => undefined);
|
|
25
|
+
let finished = false;
|
|
26
|
+
try {
|
|
27
|
+
for await (const chunk of child.stdout)
|
|
28
|
+
yield Buffer.from(chunk);
|
|
29
|
+
finished = true;
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
if (!finished)
|
|
33
|
+
child.kill();
|
|
34
|
+
}
|
|
35
|
+
const code = await closed;
|
|
36
|
+
if (code !== 0) {
|
|
37
|
+
throw new Error(`gh api ${path} exited with status ${String(code)}: ${Buffer.concat(stderr).toString('utf8')}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const LOG_OMISSION_MARKER = "\n[...job log middle omitted...]\n";
|
|
2
|
+
export interface LogLimits {
|
|
3
|
+
/** Bytes kept from the start of each job log. */
|
|
4
|
+
headBytes: number;
|
|
5
|
+
/** Bytes kept from the end of each job log. */
|
|
6
|
+
tailBytes: number;
|
|
7
|
+
/** Most bytes read from one job log stream before the rest is abandoned. */
|
|
8
|
+
maxReadBytes: number;
|
|
9
|
+
/** Most bytes retained across every job log of one run context. */
|
|
10
|
+
totalBytes: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_LOG_LIMITS: LogLimits;
|
|
13
|
+
/**
|
|
14
|
+
* Reads a log stream keeping only a head and a tail window, so memory stays bounded by the limits
|
|
15
|
+
* rather than by the log size. Bytes between the windows are replaced by an omission marker.
|
|
16
|
+
*/
|
|
17
|
+
export declare function collectDiagnosticWindow(stream: AsyncIterable<Buffer>, { headBytes, tailBytes, maxReadBytes }: LogLimits): Promise<string>;
|
|
18
|
+
export declare function fitDiagnosticWindow(log: string, maxBytes: number): string;
|