@on-par/factory-cli 0.9.7-next.24 → 0.9.7-next.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/doctor-queue-reconcile.d.ts +7 -0
- package/dist/cli/doctor-queue-reconcile.d.ts.map +1 -0
- package/dist/cli/doctor-queue-reconcile.js +55 -0
- package/dist/cli/doctor-queue-reconcile.js.map +1 -0
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +4 -21
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +3 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +10 -13
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/unpark.d.ts +5 -27
- package/dist/cli/unpark.d.ts.map +1 -1
- package/dist/cli/unpark.js +5 -66
- package/dist/cli/unpark.js.map +1 -1
- package/package.json +3 -3
package/dist/cli/unpark.d.ts
CHANGED
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
/** `factory unpark --json` payload (#2277). Additive changes only; bump schemaVersion on a breaking change. */
|
|
8
|
-
export interface UnparkJson {
|
|
9
|
-
schemaVersion: 1;
|
|
10
|
-
ok: true;
|
|
11
|
-
action: 'unpark';
|
|
12
|
-
issue: number;
|
|
13
|
-
/** Slug actually routed to (the factory:lane:<slug> suffix). */
|
|
14
|
-
lane: string;
|
|
15
|
-
/** The one order position assigned. */
|
|
16
|
-
order: number;
|
|
17
|
-
labelsBefore: string[];
|
|
18
|
-
labelsAfter: string[];
|
|
19
|
-
}
|
|
20
|
-
export interface UnparkInput {
|
|
21
|
-
client: QueueGitHubClient;
|
|
22
|
-
owner: string;
|
|
23
|
-
repo: string;
|
|
24
|
-
issue: number;
|
|
25
|
-
lane?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare function runUnpark(input: UnparkInput): Promise<UnparkJson>;
|
|
1
|
+
import type { UnparkJson } from '@on-par/factory-core/internal';
|
|
2
|
+
export type { UnparkJson } from '@on-par/factory-core/internal';
|
|
3
|
+
export { runUnpark, UnparkError } from '@on-par/factory-core/internal';
|
|
4
|
+
/** Append one `issue_unparked` event; the silent sink keeps stdout untouched. Throws on a log failure. */
|
|
5
|
+
export declare function appendUnparkEvent(result: UnparkJson, eventsFile: string): void;
|
|
28
6
|
//# sourceMappingURL=unpark.d.ts.map
|
package/dist/cli/unpark.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpark.d.ts","sourceRoot":"","sources":["../../src/cli/unpark.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unpark.d.ts","sourceRoot":"","sources":["../../src/cli/unpark.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,YAAY,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEvE,0GAA0G;AAC1G,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAK9E"}
|
package/dist/cli/unpark.js
CHANGED
|
@@ -1,68 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this.code = code;
|
|
7
|
-
this.name = 'UnparkError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
function message(err) {
|
|
11
|
-
return err instanceof Error ? err.message : String(err);
|
|
12
|
-
}
|
|
13
|
-
export async function runUnpark(input) {
|
|
14
|
-
const { client, owner, repo, issue } = input;
|
|
15
|
-
const ref = { owner, repo, issue_number: issue };
|
|
16
|
-
try {
|
|
17
|
-
const labelsBefore = await client.getIssueLabels(ref);
|
|
18
|
-
if (!labelsBefore.includes(PARKED_LABEL)) {
|
|
19
|
-
throw new UnparkError('not-parked', `#${issue} is not labelled ${PARKED_LABEL}`);
|
|
20
|
-
}
|
|
21
|
-
const existing = labelsBefore
|
|
22
|
-
.filter((l) => l.startsWith(LANE_LABEL_PREFIX))
|
|
23
|
-
.map((l) => l.slice(LANE_LABEL_PREFIX.length))
|
|
24
|
-
.filter((s) => s !== '');
|
|
25
|
-
let lane;
|
|
26
|
-
if (input.lane !== undefined && input.lane.trim() !== '') {
|
|
27
|
-
lane = laneLabel(input.lane.trim()).slice(LANE_LABEL_PREFIX.length);
|
|
28
|
-
}
|
|
29
|
-
else if (existing.length === 1) {
|
|
30
|
-
lane = existing[0];
|
|
31
|
-
}
|
|
32
|
-
else if (existing.length === 0) {
|
|
33
|
-
throw new UnparkError('lane-required', `#${issue} has no ${LANE_LABEL_PREFIX}* label; pass --lane <lane>`);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
throw new UnparkError('lane-required', `#${issue} has several lane labels (${existing.join(', ')}); pass --lane <lane>`);
|
|
37
|
-
}
|
|
38
|
-
const keepLane = laneLabel(lane);
|
|
39
|
-
for (const name of labelsBefore) {
|
|
40
|
-
if (name.startsWith(QUEUE_ORDER_LABEL_PREFIX) || (name.startsWith(LANE_LABEL_PREFIX) && name !== keepLane)) {
|
|
41
|
-
await client.removeLabel({ ...ref, name });
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const [r] = await createGithubQueue({ client, owner, repo }).enqueue(lane, [issue]);
|
|
45
|
-
if (r === undefined || r.outcome !== 'queued' || r.position === undefined) {
|
|
46
|
-
throw new UnparkError('unpark-failed', r?.detail ?? `enqueue returned ${r?.outcome}`);
|
|
47
|
-
}
|
|
48
|
-
// Remove the parked label last so a failed run can simply be repeated.
|
|
49
|
-
await client.removeLabel({ ...ref, name: PARKED_LABEL });
|
|
50
|
-
const labelsAfter = await client.getIssueLabels(ref);
|
|
51
|
-
return {
|
|
52
|
-
schemaVersion: 1,
|
|
53
|
-
ok: true,
|
|
54
|
-
action: 'unpark',
|
|
55
|
-
issue,
|
|
56
|
-
lane,
|
|
57
|
-
order: r.position,
|
|
58
|
-
labelsBefore: [...labelsBefore],
|
|
59
|
-
labelsAfter,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
catch (err) {
|
|
63
|
-
if (err instanceof UnparkError)
|
|
64
|
-
throw err;
|
|
65
|
-
throw new UnparkError('unpark-failed', message(err));
|
|
66
|
-
}
|
|
1
|
+
import { createLogger } from '@on-par/factory-core';
|
|
2
|
+
export { runUnpark, UnparkError } from '@on-par/factory-core/internal';
|
|
3
|
+
/** Append one `issue_unparked` event; the silent sink keeps stdout untouched. Throws on a log failure. */
|
|
4
|
+
export function appendUnparkEvent(result, eventsFile) {
|
|
5
|
+
createLogger(eventsFile, { lane: result.lane, issue: result.issue }, { out: { write: () => true } }).info('issue_unparked', `#${result.issue} unparked → ${result.lane} (order ${result.order})`);
|
|
67
6
|
}
|
|
68
7
|
//# sourceMappingURL=unpark.js.map
|
package/dist/cli/unpark.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpark.js","sourceRoot":"","sources":["../../src/cli/unpark.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unpark.js","sourceRoot":"","sources":["../../src/cli/unpark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIpD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEvE,0GAA0G;AAC1G,MAAM,UAAU,iBAAiB,CAAC,MAAkB,EAAE,UAAkB;IACtE,YAAY,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CACvG,gBAAgB,EAChB,IAAI,MAAM,CAAC,KAAK,eAAe,MAAM,CAAC,IAAI,WAAW,MAAM,CAAC,KAAK,GAAG,CACrE,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@on-par/factory-cli",
|
|
3
|
-
"version": "0.9.7-next.
|
|
3
|
+
"version": "0.9.7-next.25",
|
|
4
4
|
"description": "On PAR Dev's Software Factory CLI: takes a GitHub issue through plan, build and check with AI agents, then opens a ready-for-review PR.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@octokit/plugin-retry": "^8.1.1",
|
|
48
48
|
"@octokit/plugin-throttling": "^11.0.5",
|
|
49
49
|
"@octokit/rest": "^22.0.0",
|
|
50
|
-
"@on-par/factory-core": "0.9.7-next.
|
|
51
|
-
"@on-par/factory-tui": "0.9.7-next.
|
|
50
|
+
"@on-par/factory-core": "0.9.7-next.25",
|
|
51
|
+
"@on-par/factory-tui": "0.9.7-next.25",
|
|
52
52
|
"commander": "^15.0.0"
|
|
53
53
|
},
|
|
54
54
|
"license": "MIT",
|