@on-par/factory-cli 0.0.0-stage → 0.9.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/LICENSE +21 -0
- package/README.md +40 -2
- package/dist/cli/admission.d.ts +17 -0
- package/dist/cli/admission.d.ts.map +1 -0
- package/dist/cli/admission.js +37 -0
- package/dist/cli/admission.js.map +1 -0
- package/dist/cli/base-hold.d.ts +63 -0
- package/dist/cli/base-hold.d.ts.map +1 -0
- package/dist/cli/base-hold.js +122 -0
- package/dist/cli/base-hold.js.map +1 -0
- package/dist/cli/branch-prefix.d.ts +8 -0
- package/dist/cli/branch-prefix.d.ts.map +1 -0
- package/dist/cli/branch-prefix.js +16 -0
- package/dist/cli/branch-prefix.js.map +1 -0
- package/dist/cli/classifier-backtest.d.ts +50 -0
- package/dist/cli/classifier-backtest.d.ts.map +1 -0
- package/dist/cli/classifier-backtest.js +112 -0
- package/dist/cli/classifier-backtest.js.map +1 -0
- package/dist/cli/cost-json.d.ts +37 -0
- package/dist/cli/cost-json.d.ts.map +1 -0
- package/dist/cli/cost-json.js +48 -0
- package/dist/cli/cost-json.js.map +1 -0
- package/dist/cli/daemon.d.ts +162 -0
- package/dist/cli/daemon.d.ts.map +1 -0
- package/dist/cli/daemon.js +393 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/doctor.d.ts +127 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +400 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/feedback.d.ts +74 -0
- package/dist/cli/feedback.d.ts.map +1 -0
- package/dist/cli/feedback.js +180 -0
- package/dist/cli/feedback.js.map +1 -0
- package/dist/cli/filing.d.ts +22 -0
- package/dist/cli/filing.d.ts.map +1 -0
- package/dist/cli/filing.js +53 -0
- package/dist/cli/filing.js.map +1 -0
- package/dist/cli/first-run.d.ts +9 -0
- package/dist/cli/first-run.d.ts.map +1 -0
- package/dist/cli/first-run.js +34 -0
- package/dist/cli/first-run.js.map +1 -0
- package/dist/cli/help-groups.d.ts +17 -0
- package/dist/cli/help-groups.d.ts.map +1 -0
- package/dist/cli/help-groups.js +59 -0
- package/dist/cli/help-groups.js.map +1 -0
- package/dist/cli/hosted-queue.d.ts +45 -0
- package/dist/cli/hosted-queue.d.ts.map +1 -0
- package/dist/cli/hosted-queue.js +74 -0
- package/dist/cli/hosted-queue.js.map +1 -0
- package/dist/cli/hosted-runner.d.ts +44 -0
- package/dist/cli/hosted-runner.d.ts.map +1 -0
- package/dist/cli/hosted-runner.js +68 -0
- package/dist/cli/hosted-runner.js.map +1 -0
- package/dist/cli/hosted.d.ts +38 -0
- package/dist/cli/hosted.d.ts.map +1 -0
- package/dist/cli/hosted.js +82 -0
- package/dist/cli/hosted.js.map +1 -0
- package/dist/cli/index.d.ts +674 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +4916 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init-files.d.ts +8 -0
- package/dist/cli/init-files.d.ts.map +1 -0
- package/dist/cli/init-files.js +45 -0
- package/dist/cli/init-files.js.map +1 -0
- package/dist/cli/logs.d.ts +27 -0
- package/dist/cli/logs.d.ts.map +1 -0
- package/dist/cli/logs.js +52 -0
- package/dist/cli/logs.js.map +1 -0
- package/dist/cli/merge-scope.d.ts +7 -0
- package/dist/cli/merge-scope.d.ts.map +1 -0
- package/dist/cli/merge-scope.js +14 -0
- package/dist/cli/merge-scope.js.map +1 -0
- package/dist/cli/octokit.d.ts +43 -0
- package/dist/cli/octokit.d.ts.map +1 -0
- package/dist/cli/octokit.js +87 -0
- package/dist/cli/octokit.js.map +1 -0
- package/dist/cli/queue-add-json.d.ts +25 -0
- package/dist/cli/queue-add-json.d.ts.map +1 -0
- package/dist/cli/queue-add-json.js +24 -0
- package/dist/cli/queue-add-json.js.map +1 -0
- package/dist/cli/queue-clear.d.ts +15 -0
- package/dist/cli/queue-clear.d.ts.map +1 -0
- package/dist/cli/queue-clear.js +58 -0
- package/dist/cli/queue-clear.js.map +1 -0
- package/dist/cli/queue-list.d.ts +24 -0
- package/dist/cli/queue-list.d.ts.map +1 -0
- package/dist/cli/queue-list.js +25 -0
- package/dist/cli/queue-list.js.map +1 -0
- package/dist/cli/ready-check.d.ts +98 -0
- package/dist/cli/ready-check.d.ts.map +1 -0
- package/dist/cli/ready-check.js +169 -0
- package/dist/cli/ready-check.js.map +1 -0
- package/dist/cli/reset.d.ts +40 -0
- package/dist/cli/reset.d.ts.map +1 -0
- package/dist/cli/reset.js +215 -0
- package/dist/cli/reset.js.map +1 -0
- package/dist/cli/run-children.d.ts +24 -0
- package/dist/cli/run-children.d.ts.map +1 -0
- package/dist/cli/run-children.js +73 -0
- package/dist/cli/run-children.js.map +1 -0
- package/dist/cli/run-flags.d.ts +14 -0
- package/dist/cli/run-flags.d.ts.map +1 -0
- package/dist/cli/run-flags.js +43 -0
- package/dist/cli/run-flags.js.map +1 -0
- package/dist/cli/runs-diffstat.d.ts +43 -0
- package/dist/cli/runs-diffstat.d.ts.map +1 -0
- package/dist/cli/runs-diffstat.js +91 -0
- package/dist/cli/runs-diffstat.js.map +1 -0
- package/dist/cli/runs.d.ts +36 -0
- package/dist/cli/runs.d.ts.map +1 -0
- package/dist/cli/runs.js +102 -0
- package/dist/cli/runs.js.map +1 -0
- package/dist/cli/self-update.d.ts +68 -0
- package/dist/cli/self-update.d.ts.map +1 -0
- package/dist/cli/self-update.js +167 -0
- package/dist/cli/self-update.js.map +1 -0
- package/dist/cli/staleness.d.ts +30 -0
- package/dist/cli/staleness.d.ts.map +1 -0
- package/dist/cli/staleness.js +132 -0
- package/dist/cli/staleness.js.map +1 -0
- package/dist/cli/state-root.d.ts +5 -0
- package/dist/cli/state-root.d.ts.map +1 -0
- package/dist/cli/state-root.js +12 -0
- package/dist/cli/state-root.js.map +1 -0
- package/dist/cli/status-json.d.ts +49 -0
- package/dist/cli/status-json.d.ts.map +1 -0
- package/dist/cli/status-json.js +23 -0
- package/dist/cli/status-json.js.map +1 -0
- package/dist/cli/stop-resume-json.d.ts +18 -0
- package/dist/cli/stop-resume-json.d.ts.map +1 -0
- package/dist/cli/stop-resume-json.js +10 -0
- package/dist/cli/stop-resume-json.js.map +1 -0
- package/dist/cli/stop-sentinel.d.ts +23 -0
- package/dist/cli/stop-sentinel.d.ts.map +1 -0
- package/dist/cli/stop-sentinel.js +61 -0
- package/dist/cli/stop-sentinel.js.map +1 -0
- package/dist/cli/sweep-heartbeat.d.ts +33 -0
- package/dist/cli/sweep-heartbeat.d.ts.map +1 -0
- package/dist/cli/sweep-heartbeat.js +65 -0
- package/dist/cli/sweep-heartbeat.js.map +1 -0
- package/dist/cli/unpark.d.ts +28 -0
- package/dist/cli/unpark.d.ts.map +1 -0
- package/dist/cli/unpark.js +68 -0
- package/dist/cli/unpark.js.map +1 -0
- package/dist/cli/update-state.d.ts +44 -0
- package/dist/cli/update-state.d.ts.map +1 -0
- package/dist/cli/update-state.js +154 -0
- package/dist/cli/update-state.js.map +1 -0
- package/dist/cli/usage-json.d.ts +20 -0
- package/dist/cli/usage-json.d.ts.map +1 -0
- package/dist/cli/usage-json.js +36 -0
- package/dist/cli/usage-json.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +6 -0
- package/dist/cli.js.map +1 -0
- package/dist/entry.d.ts +6 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +13 -0
- package/dist/entry.js.map +1 -0
- package/package.json +56 -4
package/dist/cli/logs.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// packages/cli/src/cli/logs.ts — `factory logs` [--follow] [--json] [--issue <n>]
|
|
2
|
+
import { followEvents, readEvents } from '@on-par/factory-core';
|
|
3
|
+
import { colorEnabled, formatEventLine } from '@on-par/factory-core/internal';
|
|
4
|
+
export function eventMatchesIssue(e, issue) {
|
|
5
|
+
return !issue || e.issue === issue;
|
|
6
|
+
}
|
|
7
|
+
export function renderEvent(e, opts) {
|
|
8
|
+
if (opts.json)
|
|
9
|
+
return JSON.stringify(e);
|
|
10
|
+
return formatEventLine(e.type, e.issue, e.msg, { color: opts.color, lane: e.lane, ts: e.ts });
|
|
11
|
+
}
|
|
12
|
+
/** Print current events; with follow, keep tailing. Returns a stop() function (no-op stop for non-follow). */
|
|
13
|
+
export function runLogs(eventsFile, opts, deps = {}) {
|
|
14
|
+
const out = deps.out ?? process.stdout;
|
|
15
|
+
const env = deps.env ?? process.env;
|
|
16
|
+
const color = colorEnabled(out, env) && !opts.json;
|
|
17
|
+
let delivered = 0;
|
|
18
|
+
const emit = (e) => {
|
|
19
|
+
delivered++;
|
|
20
|
+
if (!eventMatchesIssue(e, opts.issue))
|
|
21
|
+
return;
|
|
22
|
+
out.write(renderEvent(e, { json: opts.json, color }) + '\n');
|
|
23
|
+
};
|
|
24
|
+
if (!opts.follow) {
|
|
25
|
+
for (const e of readEvents(eventsFile))
|
|
26
|
+
emit(e);
|
|
27
|
+
return () => { };
|
|
28
|
+
}
|
|
29
|
+
const stopTailing = followEvents(eventsFile, emit, { fromStart: true, pollMs: deps.pollMs ?? 250 });
|
|
30
|
+
return () => {
|
|
31
|
+
stopTailing();
|
|
32
|
+
// Catch up on anything written in the poll window right before stop() (e.g. a
|
|
33
|
+
// Ctrl-C racing the final "build complete" event) so it isn't silently dropped.
|
|
34
|
+
for (const e of readEvents(eventsFile).slice(delivered))
|
|
35
|
+
emit(e);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** Command entry point wired up to commander. Keeps the process alive until Ctrl-C in --follow mode. */
|
|
39
|
+
export async function cmdLogs(opts, deps) {
|
|
40
|
+
const stop = runLogs(deps.eventsFile, opts, deps);
|
|
41
|
+
if (!opts.follow)
|
|
42
|
+
return;
|
|
43
|
+
const keepAlive = setInterval(() => { }, 60_000);
|
|
44
|
+
await new Promise((res) => {
|
|
45
|
+
const done = () => res();
|
|
46
|
+
process.once('SIGINT', done);
|
|
47
|
+
process.once('SIGTERM', done);
|
|
48
|
+
});
|
|
49
|
+
stop();
|
|
50
|
+
clearInterval(keepAlive);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/cli/logs.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAGlF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAe9E,MAAM,UAAU,iBAAiB,CAAC,CAAe,EAAE,KAAc;IAC/D,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,CAAe,EAAE,IAAwC;IACnF,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACxC,OAAO,eAAe,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAChG,CAAC;AAED,8GAA8G;AAC9G,MAAM,UAAU,OAAO,CAAC,UAAkB,EAAE,IAAiB,EAAE,IAAI,GAAa,EAAE;IAChF,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IACvC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACpC,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAEnD,IAAI,SAAS,GAAG,CAAC,CAAC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AE;QAC9B,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IACH,IAAI,EAAE,CAAC;IACP,aAAa,CAAC,SAAS,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The env vars that enable autonomous merge — honored by `factory run`/`factory land`,
|
|
2
|
+
* never by `factory ship`, which always stops at a ready-for-review PR (#978). */
|
|
3
|
+
export declare const MERGE_SCOPE_ENV_VARS: readonly ['FACTORY_MERGE', 'FACTORY_MERGE_ADMIN'];
|
|
4
|
+
/** One advisory line when a merge env var is set for a command that cannot honor it,
|
|
5
|
+
* or undefined when none is set. Pure: reads only the passed env bag. */
|
|
6
|
+
export declare function mergeScopeNotice(env: NodeJS.ProcessEnv, issueNum: number): string | undefined;
|
|
7
|
+
//# sourceMappingURL=merge-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-scope.d.ts","sourceRoot":"","sources":["../../src/cli/merge-scope.ts"],"names":[],"mappings":"AAEA;mFACmF;AACnF,eAAO,MAAM,oBAAoB,YAAI,eAAe,EAAE,qBAAqB,CAAU,CAAC;AAEtF;0EAC0E;AAC1E,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO7F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// packages/cli/src/cli/merge-scope.ts — warn when merge env vars are set for a command that ignores them
|
|
2
|
+
/** The env vars that enable autonomous merge — honored by `factory run`/`factory land`,
|
|
3
|
+
* never by `factory ship`, which always stops at a ready-for-review PR (#978). */
|
|
4
|
+
export const MERGE_SCOPE_ENV_VARS = ['FACTORY_MERGE', 'FACTORY_MERGE_ADMIN'];
|
|
5
|
+
/** One advisory line when a merge env var is set for a command that cannot honor it,
|
|
6
|
+
* or undefined when none is set. Pure: reads only the passed env bag. */
|
|
7
|
+
export function mergeScopeNotice(env, issueNum) {
|
|
8
|
+
const set = MERGE_SCOPE_ENV_VARS.filter((name) => env[name] === '1');
|
|
9
|
+
if (set.length === 0)
|
|
10
|
+
return undefined;
|
|
11
|
+
return (`factory: ${set.map((n) => `${n}=1`).join(', ')} ignored — factory ship always stops at ` +
|
|
12
|
+
`ready-for-review; use "factory land ${issueNum}" after review, or "factory run" to merge automatically`);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=merge-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-scope.js","sourceRoot":"","sources":["../../src/cli/merge-scope.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAEzG;mFACmF;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,eAAe,EAAE,qBAAqB,CAAU,CAAC;AAEtF;0EAC0E;AAC1E,MAAM,UAAU,gBAAgB,CAAC,GAAsB,EAAE,QAAgB;IACvE,MAAM,GAAG,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACrE,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACvC,OAAO,CACL,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,0CAA0C;QACzF,uCAAuC,QAAQ,yDAAyD,CACzG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Octokit } from '@octokit/rest';
|
|
2
|
+
/** Rate-limit retries per request. Bounded so a genuinely exhausted quota surfaces to the
|
|
3
|
+
* caller instead of stalling a lane behind an unbounded backoff loop. */
|
|
4
|
+
export declare const MAX_THROTTLE_RETRIES = 2;
|
|
5
|
+
export declare function onRateLimit(_retryAfter: number, _options: {
|
|
6
|
+
method?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
}, _octokit: unknown, retryCount: number): boolean;
|
|
9
|
+
export declare function onSecondaryRateLimit(_retryAfter: number, _options: {
|
|
10
|
+
method?: string;
|
|
11
|
+
url?: string;
|
|
12
|
+
}, _octokit: unknown, retryCount: number): boolean;
|
|
13
|
+
/** One deprecated REST route, as reported by GitHub's Deprecation/Sunset/Link headers (#2218). */
|
|
14
|
+
export interface GitHubApiDeprecation {
|
|
15
|
+
/** Upper-case, e.g. 'POST'. */
|
|
16
|
+
method: string;
|
|
17
|
+
/** Route template, e.g. '/repos/{owner}/{repo}/issues'. */
|
|
18
|
+
route: string;
|
|
19
|
+
/** Raw Sunset header, e.g. 'Fri, 10 Mar 2028 00:00:00 GMT'. */
|
|
20
|
+
sunset?: string;
|
|
21
|
+
/** 'YYYY-MM-DD' (UTC) when Sunset parses, e.g. '2028-03-10'. */
|
|
22
|
+
sunsetDate?: string;
|
|
23
|
+
/** The rel="deprecation" URL from the Link header. */
|
|
24
|
+
link?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface FactoryOctokitOptions {
|
|
27
|
+
/** Receives each deprecated METHOD route once per client — shipIssue turns it into a github_api_deprecated event. */
|
|
28
|
+
log?: (deprecation: GitHubApiDeprecation) => void;
|
|
29
|
+
/** Where the short per-route line goes. Defaults to console.error. Injectable for tests. */
|
|
30
|
+
stderr?: (line: string) => void;
|
|
31
|
+
}
|
|
32
|
+
type ResponseHeaders = Record<string, string | number | undefined>;
|
|
33
|
+
/** True for Octokit's raw `[@octokit/request] "…" is deprecated.` warn line. */
|
|
34
|
+
export declare function isOctokitDeprecationWarning(message: string): boolean;
|
|
35
|
+
/** Reads GitHub's deprecation headers (Octokit lower-cases header keys); undefined when not deprecated. */
|
|
36
|
+
export declare function readDeprecation(method: string, route: string, headers: ResponseHeaders): GitHubApiDeprecation | undefined;
|
|
37
|
+
export declare function formatDeprecation(d: GitHubApiDeprecation): string;
|
|
38
|
+
/** The client every CLI GitHub call goes through. `@octokit/plugin-retry` handles transient
|
|
39
|
+
* 5xx/network failures with its default bounded backoff; the throttle handlers above cover
|
|
40
|
+
* primary and secondary rate limits (#641). Deprecated routes are reported once per client (#2218). */
|
|
41
|
+
export declare function createFactoryOctokit(token?: string, options?: FactoryOctokitOptions): Octokit;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=octokit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"octokit.d.ts","sourceRoot":"","sources":["../../src/cli/octokit.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;0EAC0E;AAC1E,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAItC,wBAAgB,WAAW,CACzB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3C,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAET;AAED,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3C,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAET;AAED,kGAAkG;AAClG,MAAM,WAAW,oBAAoB;IACnC,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,qHAAqH;IACrH,GAAG,CAAC,EAAE,CAAC,WAAW,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClD,4FAA4F;IAC5F,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAEnE,gFAAgF;AAChF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED,2GAA2G;AAC3G,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,eAAe,GACvB,oBAAoB,GAAG,SAAS,CAWlC;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAEjE;AAED;;wGAEwG;AACxG,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,OAAO,CA2CjG"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// src/cli/octokit.ts — the shared GitHub client: retry + throttling on every call (#641),
|
|
2
|
+
// deprecated-route detection once per route (#2218)
|
|
3
|
+
import { styleText } from 'node:util';
|
|
4
|
+
import { retry } from '@octokit/plugin-retry';
|
|
5
|
+
import { throttling } from '@octokit/plugin-throttling';
|
|
6
|
+
import { Octokit } from '@octokit/rest';
|
|
7
|
+
/** Rate-limit retries per request. Bounded so a genuinely exhausted quota surfaces to the
|
|
8
|
+
* caller instead of stalling a lane behind an unbounded backoff loop. */
|
|
9
|
+
export const MAX_THROTTLE_RETRIES = 2;
|
|
10
|
+
const FactoryOctokit = Octokit.plugin(retry, throttling);
|
|
11
|
+
export function onRateLimit(_retryAfter, _options, _octokit, retryCount) {
|
|
12
|
+
return retryCount < MAX_THROTTLE_RETRIES;
|
|
13
|
+
}
|
|
14
|
+
export function onSecondaryRateLimit(_retryAfter, _options, _octokit, retryCount) {
|
|
15
|
+
return retryCount < MAX_THROTTLE_RETRIES;
|
|
16
|
+
}
|
|
17
|
+
/** True for Octokit's raw `[@octokit/request] "…" is deprecated.` warn line. */
|
|
18
|
+
export function isOctokitDeprecationWarning(message) {
|
|
19
|
+
return /^\[@octokit\/request\] ".*" is deprecated\./.test(message);
|
|
20
|
+
}
|
|
21
|
+
/** Reads GitHub's deprecation headers (Octokit lower-cases header keys); undefined when not deprecated. */
|
|
22
|
+
export function readDeprecation(method, route, headers) {
|
|
23
|
+
if (!('deprecation' in headers))
|
|
24
|
+
return undefined;
|
|
25
|
+
const deprecation = { method: method.toUpperCase(), route };
|
|
26
|
+
if (headers.sunset !== undefined) {
|
|
27
|
+
deprecation.sunset = String(headers.sunset);
|
|
28
|
+
const time = new Date(deprecation.sunset);
|
|
29
|
+
if (!Number.isNaN(time.getTime()))
|
|
30
|
+
deprecation.sunsetDate = time.toISOString().slice(0, 10);
|
|
31
|
+
}
|
|
32
|
+
const link = String(headers.link ?? '').match(/<([^<>]+)>; rel="deprecation"/)?.[1];
|
|
33
|
+
if (link !== undefined)
|
|
34
|
+
deprecation.link = link;
|
|
35
|
+
return deprecation;
|
|
36
|
+
}
|
|
37
|
+
export function formatDeprecation(d) {
|
|
38
|
+
return `GitHub API deprecated: ${d.method} ${d.route} — sunset ${d.sunsetDate ?? d.sunset ?? 'unknown'}${d.link ? ` (see ${d.link})` : ''}`;
|
|
39
|
+
}
|
|
40
|
+
/** The client every CLI GitHub call goes through. `@octokit/plugin-retry` handles transient
|
|
41
|
+
* 5xx/network failures with its default bounded backoff; the throttle handlers above cover
|
|
42
|
+
* primary and secondary rate limits (#641). Deprecated routes are reported once per client (#2218). */
|
|
43
|
+
export function createFactoryOctokit(token, options = {}) {
|
|
44
|
+
const seen = new Set();
|
|
45
|
+
const stderr = options.stderr ?? ((line) => console.error(line));
|
|
46
|
+
const log = {
|
|
47
|
+
debug: () => { },
|
|
48
|
+
info: () => { },
|
|
49
|
+
warn: (message) => {
|
|
50
|
+
if (!isOctokitDeprecationWarning(message))
|
|
51
|
+
console.warn(message);
|
|
52
|
+
},
|
|
53
|
+
error: (message) => console.error(message),
|
|
54
|
+
};
|
|
55
|
+
const octokit = new FactoryOctokit({
|
|
56
|
+
auth: token,
|
|
57
|
+
throttle: { onRateLimit, onSecondaryRateLimit },
|
|
58
|
+
log,
|
|
59
|
+
// @octokit/request reads its own `request.log` (default console), not the client's `log`.
|
|
60
|
+
request: { log },
|
|
61
|
+
});
|
|
62
|
+
const record = (opts, headers) => {
|
|
63
|
+
try {
|
|
64
|
+
if (!headers || !opts.method || !opts.url)
|
|
65
|
+
return;
|
|
66
|
+
const d = readDeprecation(opts.method, opts.url, headers);
|
|
67
|
+
if (!d)
|
|
68
|
+
return;
|
|
69
|
+
const key = `${d.method} ${d.route}`;
|
|
70
|
+
if (seen.has(key))
|
|
71
|
+
return;
|
|
72
|
+
seen.add(key);
|
|
73
|
+
stderr(styleText('yellow', formatDeprecation(d)));
|
|
74
|
+
options.log?.(d);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// observability only — never break the call
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
octokit.hook.after('request', (response, opts) => record(opts, response.headers));
|
|
81
|
+
octokit.hook.error('request', (error, opts) => {
|
|
82
|
+
record(opts, error.response?.headers);
|
|
83
|
+
throw error;
|
|
84
|
+
});
|
|
85
|
+
return octokit;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=octokit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"octokit.js","sourceRoot":"","sources":["../../src/cli/octokit.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,oDAAoD;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;A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MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { EnqueueOutcome, EnqueueResult } from '@on-par/factory-core/internal';
|
|
2
|
+
/** One issue in `factory queue add --json` (#2275). */
|
|
3
|
+
export interface QueueAddIssueJson {
|
|
4
|
+
number: number;
|
|
5
|
+
outcome: EnqueueOutcome;
|
|
6
|
+
/** 1-based order position; null when failed or the existing order label is unparsable. */
|
|
7
|
+
order: number | null;
|
|
8
|
+
labelsAdded: string[];
|
|
9
|
+
/** Set only when outcome === 'failed'. */
|
|
10
|
+
detail?: string;
|
|
11
|
+
}
|
|
12
|
+
/** `factory queue add --json` payload (#2275). Additive changes only; bump schemaVersion on a breaking change. */
|
|
13
|
+
export interface QueueAddJson {
|
|
14
|
+
schemaVersion: 1;
|
|
15
|
+
/** False when any issue failed. */
|
|
16
|
+
ok: boolean;
|
|
17
|
+
action: 'queue-add';
|
|
18
|
+
lane: string;
|
|
19
|
+
/** Input order (deduped). */
|
|
20
|
+
issues: QueueAddIssueJson[];
|
|
21
|
+
/** Union of per-result labelsCreated, first-seen order, deduped. */
|
|
22
|
+
labelsCreated: string[];
|
|
23
|
+
}
|
|
24
|
+
export declare function buildQueueAddJson(lane: string, results: readonly EnqueueResult[]): QueueAddJson;
|
|
25
|
+
//# sourceMappingURL=queue-add-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-add-json.d.ts","sourceRoot":"","sources":["../../src/cli/queue-add-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnF,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;IACxB,0FAA0F;IAC1F,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,kHAAkH;AAClH,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,CAAC,CAAC;IACjB,mCAAmC;IACnC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,oEAAoE;IACpE,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,YAAY,CAqB/F"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function buildQueueAddJson(lane, results) {
|
|
2
|
+
const created = new Set();
|
|
3
|
+
const issues = results.map((r) => {
|
|
4
|
+
for (const name of r.labelsCreated ?? [])
|
|
5
|
+
created.add(name);
|
|
6
|
+
const failed = r.outcome === 'failed';
|
|
7
|
+
return {
|
|
8
|
+
number: r.issue,
|
|
9
|
+
outcome: r.outcome,
|
|
10
|
+
order: failed ? null : (r.position ?? null),
|
|
11
|
+
labelsAdded: failed ? [] : [...(r.labelsAdded ?? [])],
|
|
12
|
+
...(failed ? { detail: r.detail ?? '' } : {}),
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
schemaVersion: 1,
|
|
17
|
+
ok: !results.some((r) => r.outcome === 'failed'),
|
|
18
|
+
action: 'queue-add',
|
|
19
|
+
lane,
|
|
20
|
+
issues,
|
|
21
|
+
labelsCreated: [...created],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=queue-add-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-add-json.js","sourceRoot":"","sources":["../../src/cli/queue-add-json.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,OAAiC;IAC/E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAqB,EAAE;QAClD,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,aAAa,IAAI,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC;QACtC,OAAO;YACL,MAAM,EAAE,CAAC,CAAC,KAAK;YACf,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC;YAC3C,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;YACrD,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9C,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO;QACL,aAAa,EAAE,CAAC;QAChB,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC;QAChD,MAAM,EAAE,WAAW;QACnB,IAAI;QACJ,MAAM;QACN,aAAa,EAAE,CAAC,GAAG,OAAO,CAAC;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { QueueClearPreview, QueueClearResult } from '@on-par/factory-core/internal';
|
|
2
|
+
export declare function formatQueueClearPreview(preview: QueueClearPreview): string;
|
|
3
|
+
export declare function formatQueueClearResult(result: QueueClearResult): string;
|
|
4
|
+
export declare function runQueueClear(deps: {
|
|
5
|
+
previewClear: () => Promise<QueueClearPreview>;
|
|
6
|
+
clear: () => Promise<QueueClearResult>;
|
|
7
|
+
dryRun?: boolean;
|
|
8
|
+
yes?: boolean;
|
|
9
|
+
lane?: string;
|
|
10
|
+
}): Promise<{
|
|
11
|
+
report: string;
|
|
12
|
+
exitCode: 0 | 1 | 2;
|
|
13
|
+
message?: string;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=queue-clear.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-clear.d.ts","sourceRoot":"","sources":["../../src/cli/queue-clear.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEzF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAW1E;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAUvE;AAQD,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,YAAY,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC/C,KAAK,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA4BrE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// packages/cli/src/cli/queue-clear.ts — `factory queue clear`: preview (#1693), `--yes` clear (#1694), `--lane` (#1695).
|
|
2
|
+
export function formatQueueClearPreview(preview) {
|
|
3
|
+
const lines = preview.entries.map((entry) => {
|
|
4
|
+
const lane = entry.lanes.length > 0 ? entry.lanes.join(',') : '(none)';
|
|
5
|
+
const reason = entry.action === 'would-skip' && entry.reason !== undefined ? ` — ${entry.reason}` : '';
|
|
6
|
+
const title = entry.title ? ` — ${entry.title}` : '';
|
|
7
|
+
return ` #${entry.issue} [lane ${lane}] ${entry.action}${reason}${title}`;
|
|
8
|
+
});
|
|
9
|
+
lines.push(`${preview.entries.length} queued issue(s): ${preview.wouldClear} would-clear, ${preview.wouldSkip} would-skip`);
|
|
10
|
+
return lines.join('\n');
|
|
11
|
+
}
|
|
12
|
+
export function formatQueueClearResult(result) {
|
|
13
|
+
const lines = result.entries.map((entry) => {
|
|
14
|
+
const lane = entry.lanes.length > 0 ? entry.lanes.join(',') : '(none)';
|
|
15
|
+
const reason = entry.reason !== undefined ? ` — ${entry.reason}` : '';
|
|
16
|
+
const title = entry.title ? ` — ${entry.title}` : '';
|
|
17
|
+
return ` #${entry.issue} [lane ${lane}] ${entry.outcome}${reason}${title}`;
|
|
18
|
+
});
|
|
19
|
+
const failed = result.failed > 0 ? `, ${result.failed} failed` : '';
|
|
20
|
+
lines.push(`${result.entries.length} queued issue(s): ${result.cleared} cleared, ${result.skipped} skipped${failed}`);
|
|
21
|
+
return lines.join('\n');
|
|
22
|
+
}
|
|
23
|
+
function emptyQueueReport(lane) {
|
|
24
|
+
return lane === undefined
|
|
25
|
+
? 'queue is already empty — no open factory:queued issues'
|
|
26
|
+
: `queue is already empty for lane ${lane} — no open factory:queued issues in factory:lane:${lane}`;
|
|
27
|
+
}
|
|
28
|
+
export async function runQueueClear(deps) {
|
|
29
|
+
const laneSuffix = deps.lane === undefined ? '' : ` (lane ${deps.lane})`;
|
|
30
|
+
if (deps.yes && !deps.dryRun) {
|
|
31
|
+
const result = await deps.clear();
|
|
32
|
+
if (result.entries.length === 0)
|
|
33
|
+
return { report: emptyQueueReport(deps.lane), exitCode: 0 };
|
|
34
|
+
const report = `queue clear${laneSuffix}\n${formatQueueClearResult(result)}`;
|
|
35
|
+
if (result.failed > 0) {
|
|
36
|
+
return {
|
|
37
|
+
report,
|
|
38
|
+
exitCode: 1,
|
|
39
|
+
message: `factory: queue clear failed for ${result.failed} issue(s); see the lines above`,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return { report, exitCode: 0 };
|
|
43
|
+
}
|
|
44
|
+
const preview = await deps.previewClear();
|
|
45
|
+
if (preview.entries.length === 0) {
|
|
46
|
+
return { report: emptyQueueReport(deps.lane), exitCode: 0 };
|
|
47
|
+
}
|
|
48
|
+
const body = formatQueueClearPreview(preview);
|
|
49
|
+
if (deps.dryRun) {
|
|
50
|
+
return { report: `dry run — queue clear preview${laneSuffix}\n${body}\nno GitHub labels changed`, exitCode: 0 };
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
report: `queue clear preview${laneSuffix}\n${body}`,
|
|
54
|
+
exitCode: 2,
|
|
55
|
+
message: 'factory: queue clear needs --yes to proceed (or --dry-run to preview); no GitHub labels changed',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=queue-clear.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-clear.js","sourceRoot":"","sources":["../../src/cli/queue-clear.ts"],"names":[],"mappings":"AAAA,yHAAyH;AAIzH,MAAM,UAAU,uBAAuB,CAAC,OAA0B;IAChE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACvE,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,KAAK,YAAY,IAAI,KAAK,CAAC,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AAC;QACD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACjC,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IAC1C,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAC9D,CAAC;IACD,MAAM,IAAI,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,gCAAgC,UAAU,KAAK,IAAI,4BAA4B,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAClH,CAAC;IACD,OAAO;QACL,MAAM,EAAE,sBAAsB,UAAU,KAAK,IAAI,EAAE;QACnD,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,iGAAiG;KAC3G,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { QueueSnapshot } from '@on-par/factory-core/internal';
|
|
2
|
+
/** One item in `factory queue list --json` (#2268). */
|
|
3
|
+
export interface QueueListItemJson {
|
|
4
|
+
issue: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
status: 'queued' | 'in-progress' | 'parked';
|
|
7
|
+
/** 1-based position within the lane, in order-label order. */
|
|
8
|
+
order: number;
|
|
9
|
+
claimedBy: string | null;
|
|
10
|
+
}
|
|
11
|
+
/** `factory queue list --json` payload (#2268). Additive changes only; bump schemaVersion on a breaking change. */
|
|
12
|
+
export interface QueueListJson {
|
|
13
|
+
schemaVersion: 1;
|
|
14
|
+
lanes: Array<{
|
|
15
|
+
lane: string;
|
|
16
|
+
items: QueueListItemJson[];
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Group the reader's already-sorted entries by lane (lane order preserved) and
|
|
21
|
+
* rank each item 1-based within its lane. `lane` keeps only that lane.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildQueueListJson(snapshot: QueueSnapshot, lane?: string): QueueListJson;
|
|
24
|
+
//# sourceMappingURL=queue-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-list.d.ts","sourceRoot":"","sources":["../../src/cli/queue-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,QAAQ,GAAG,aAAa,GAAG,QAAQ,CAAC;IAC5C,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,mHAAmH;AACnH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,CAAC,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,iBAAiB,EAAE,CAAA;KAAE,CAAC,CAAC;CAC5D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,CAkBxF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Group the reader's already-sorted entries by lane (lane order preserved) and
|
|
3
|
+
* rank each item 1-based within its lane. `lane` keeps only that lane.
|
|
4
|
+
*/
|
|
5
|
+
export function buildQueueListJson(snapshot, lane) {
|
|
6
|
+
const byLane = new Map();
|
|
7
|
+
for (const entry of snapshot.entries) {
|
|
8
|
+
if (lane !== undefined && entry.lane !== lane)
|
|
9
|
+
continue;
|
|
10
|
+
let items = byLane.get(entry.lane);
|
|
11
|
+
if (items === undefined) {
|
|
12
|
+
items = [];
|
|
13
|
+
byLane.set(entry.lane, items);
|
|
14
|
+
}
|
|
15
|
+
items.push({
|
|
16
|
+
issue: entry.issue,
|
|
17
|
+
...(entry.title === undefined ? {} : { title: entry.title }),
|
|
18
|
+
status: entry.status ?? 'queued',
|
|
19
|
+
order: items.length + 1,
|
|
20
|
+
claimedBy: entry.claimant ?? null,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return { schemaVersion: 1, lanes: [...byLane].map(([name, items]) => ({ lane: name, items })) };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=queue-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue-list.js","sourceRoot":"","sources":["../../src/cli/queue-list.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAuB,EAAE,IAAa;IACvE,MAAM,MAAM,GAAG,IAAI,GAAG,EAA+B,CAAC;IACtD,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;YAAE,SAAS;QACxD,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,KAAK,GAAG,EAAE,CAAC;YACX,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,KAAK,CAAC,IAAI,CAAC;YACT,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YAC5D,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,QAAQ;YAChC,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;YACvB,SAAS,EAAE,KAAK,CAAC,QAAQ,IAAI,IAAI;SAClC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;AAClG,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { type CriteriaReport, type IssueInvestReport, type ReadinessInfo, type ReadinessTemplate } from '@on-par/factory-core';
|
|
2
|
+
import { type ReadinessGapReport } from '@on-par/factory-core/internal';
|
|
3
|
+
export type IssueSizeVerdict = 'runs-as-is' | 'would-split';
|
|
4
|
+
export type DeepCheckTask = 'decompose' | 'triage';
|
|
5
|
+
export type DeepCheckModelRunner = (task: DeepCheckTask, prompt: string) => Promise<{
|
|
6
|
+
model: string;
|
|
7
|
+
output: string;
|
|
8
|
+
cost: number | null;
|
|
9
|
+
}>;
|
|
10
|
+
/** Proposed child story; acceptance criteria are already formatted via formatGapCriterion. */
|
|
11
|
+
export interface DeepSplitChild {
|
|
12
|
+
title: string;
|
|
13
|
+
acceptanceCriteria: string[];
|
|
14
|
+
}
|
|
15
|
+
export type IssueDeepCheck = {
|
|
16
|
+
kind: 'split';
|
|
17
|
+
model: string;
|
|
18
|
+
cost: number | null;
|
|
19
|
+
unpriced: boolean;
|
|
20
|
+
children: DeepSplitChild[];
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'gaps';
|
|
23
|
+
model: string;
|
|
24
|
+
cost: number | null;
|
|
25
|
+
unpriced: boolean;
|
|
26
|
+
gaps: ReadinessGapReport;
|
|
27
|
+
};
|
|
28
|
+
/** Minimal router surface the deep check needs (a ModelRouter satisfies it). */
|
|
29
|
+
export interface DeepCheckRouter {
|
|
30
|
+
setCostSink(sink: (entry: {
|
|
31
|
+
cost: number | null;
|
|
32
|
+
}) => void): void;
|
|
33
|
+
run(task: string, prompt: string, opts: {
|
|
34
|
+
worktree: string;
|
|
35
|
+
timeoutSeconds: number;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
model: string;
|
|
38
|
+
output: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
/** Backs `--deep` with a router; captures the call's cost without writing costs.jsonl. */
|
|
42
|
+
export declare function createDeepModelRunner(router: DeepCheckRouter, worktree: string): DeepCheckModelRunner;
|
|
43
|
+
export declare class DeepCheckError extends Error {
|
|
44
|
+
constructor(message: string);
|
|
45
|
+
}
|
|
46
|
+
export interface IssueCheckReport {
|
|
47
|
+
issue: number;
|
|
48
|
+
template: ReadinessTemplate;
|
|
49
|
+
/** 0..100, rounded. */
|
|
50
|
+
score: number;
|
|
51
|
+
fields: {
|
|
52
|
+
pass: boolean;
|
|
53
|
+
missing: string[];
|
|
54
|
+
};
|
|
55
|
+
/** Per-criterion findings for factory-task issues; null for epic/factory-bug. */
|
|
56
|
+
criteria: CriteriaReport | null;
|
|
57
|
+
size: {
|
|
58
|
+
verdict: IssueSizeVerdict;
|
|
59
|
+
reason?: string;
|
|
60
|
+
};
|
|
61
|
+
/** Advisory INVEST findings for factory-task issues; null for epic/factory-bug. Never affects exitCode. */
|
|
62
|
+
invest: IssueInvestReport | null;
|
|
63
|
+
/** Human-readable reasons the issue is not ready / would split; empty when exitCode is 0. */
|
|
64
|
+
reasons: string[];
|
|
65
|
+
exitCode: 0 | 1 | 3;
|
|
66
|
+
/** Present only when `--deep` was requested. */
|
|
67
|
+
deep?: IssueDeepCheck;
|
|
68
|
+
}
|
|
69
|
+
export interface IssueCheckDeps {
|
|
70
|
+
/** Read-only issue fetch — the only GitHub access this command has. */
|
|
71
|
+
getIssue(issue: number): Promise<{
|
|
72
|
+
title: string;
|
|
73
|
+
body: string | null;
|
|
74
|
+
}>;
|
|
75
|
+
/** Read-only state lookup for dependencies cited in the issue body. */
|
|
76
|
+
getIssueState?(issue: number): Promise<'open' | 'closed'>;
|
|
77
|
+
/** Single model call for `--deep`; absent otherwise. */
|
|
78
|
+
runModel?: DeepCheckModelRunner;
|
|
79
|
+
log(line: string): void;
|
|
80
|
+
}
|
|
81
|
+
export declare function buildIssueCheckReport(issue: number, readiness: ReadinessInfo, criteria?: CriteriaReport | null, invest?: IssueInvestReport | null): IssueCheckReport;
|
|
82
|
+
export declare function formatIssueCheckLines(report: IssueCheckReport): string[];
|
|
83
|
+
export declare function formatGapCriterion(c: {
|
|
84
|
+
name: string;
|
|
85
|
+
when: readonly string[];
|
|
86
|
+
then: readonly string[];
|
|
87
|
+
}): string;
|
|
88
|
+
export declare function runDeepCheck(input: {
|
|
89
|
+
title: string;
|
|
90
|
+
body: string;
|
|
91
|
+
wouldSplit: boolean;
|
|
92
|
+
}, runModel: DeepCheckModelRunner): Promise<IssueDeepCheck>;
|
|
93
|
+
export declare function formatDeepCheckLines(deep: IssueDeepCheck): string[];
|
|
94
|
+
export declare function runIssueCheck(issue: number, opts: {
|
|
95
|
+
json?: boolean;
|
|
96
|
+
deep?: boolean;
|
|
97
|
+
}, deps: IssueCheckDeps): Promise<IssueCheckReport>;
|
|
98
|
+
//# sourceMappingURL=ready-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ready-check.d.ts","sourceRoot":"","sources":["../../src/cli/ready-check.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,cAAc,EAEnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,aAAa,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG,WAAW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