@generacy-ai/generacy 0.4.0 → 0.6.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/dist/cli/commands/cockpit/clarification-answer-marker.d.ts +8 -0
- package/dist/cli/commands/cockpit/clarification-answer-marker.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/clarification-answer-marker.js +76 -0
- package/dist/cli/commands/cockpit/clarification-answer-marker.js.map +1 -0
- package/dist/cli/commands/cockpit/clarification-comment-finder.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/clarification-comment-finder.js +33 -3
- package/dist/cli/commands/cockpit/clarification-comment-finder.js.map +1 -1
- package/dist/cli/commands/cockpit/clarify-relay.d.ts +38 -0
- package/dist/cli/commands/cockpit/clarify-relay.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/clarify-relay.js +120 -0
- package/dist/cli/commands/cockpit/clarify-relay.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/aggregate-on-demand.d.ts +43 -0
- package/dist/cli/commands/cockpit/doorbell/aggregate-on-demand.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/aggregate-on-demand.js +72 -0
- package/dist/cli/commands/cockpit/doorbell/aggregate-on-demand.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/channel-discovery.d.ts +37 -0
- package/dist/cli/commands/cockpit/doorbell/channel-discovery.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/channel-discovery.js +92 -0
- package/dist/cli/commands/cockpit/doorbell/channel-discovery.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/smee-source.d.ts +73 -0
- package/dist/cli/commands/cockpit/doorbell/smee-source.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/smee-source.js +362 -0
- package/dist/cli/commands/cockpit/doorbell/smee-source.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/source-selector.d.ts +56 -0
- package/dist/cli/commands/cockpit/doorbell/source-selector.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/source-selector.js +182 -0
- package/dist/cli/commands/cockpit/doorbell/source-selector.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/sse-parser.d.ts +15 -0
- package/dist/cli/commands/cockpit/doorbell/sse-parser.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/sse-parser.js +43 -0
- package/dist/cli/commands/cockpit/doorbell/sse-parser.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/startup-retry.d.ts +55 -0
- package/dist/cli/commands/cockpit/doorbell/startup-retry.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/startup-retry.js +159 -0
- package/dist/cli/commands/cockpit/doorbell/startup-retry.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/subscribe.d.ts +19 -0
- package/dist/cli/commands/cockpit/doorbell/subscribe.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/subscribe.js +54 -0
- package/dist/cli/commands/cockpit/doorbell/subscribe.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/webhook-to-event.d.ts +28 -0
- package/dist/cli/commands/cockpit/doorbell/webhook-to-event.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/webhook-to-event.js +159 -0
- package/dist/cli/commands/cockpit/doorbell/webhook-to-event.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell.d.ts +58 -0
- package/dist/cli/commands/cockpit/doorbell.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell.js +477 -0
- package/dist/cli/commands/cockpit/doorbell.js.map +1 -0
- package/dist/cli/commands/cockpit/index.d.ts +1 -0
- package/dist/cli/commands/cockpit/index.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/index.js +5 -0
- package/dist/cli/commands/cockpit/index.js.map +1 -1
- package/dist/cli/commands/cockpit/mcp/errors.d.ts +1 -1
- package/dist/cli/commands/cockpit/mcp/errors.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/mcp/errors.js.map +1 -1
- package/dist/cli/commands/cockpit/mcp/event-bus-registry.d.ts +2 -1
- package/dist/cli/commands/cockpit/mcp/event-bus-registry.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/mcp/event-bus-registry.js +38 -9
- package/dist/cli/commands/cockpit/mcp/event-bus-registry.js.map +1 -1
- package/dist/cli/commands/cockpit/mcp/schemas.d.ts +184 -1
- package/dist/cli/commands/cockpit/mcp/schemas.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/mcp/schemas.js +43 -2
- package/dist/cli/commands/cockpit/mcp/schemas.js.map +1 -1
- package/dist/cli/commands/cockpit/mcp/server.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/mcp/server.js +16 -1
- package/dist/cli/commands/cockpit/mcp/server.js.map +1 -1
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_queue.d.ts +19 -3
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_queue.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_queue.js +40 -2
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_queue.js.map +1 -1
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_relay_clarify_answers.d.ts +45 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_relay_clarify_answers.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_relay_clarify_answers.js +45 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_relay_clarify_answers.js.map +1 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_scope_add.d.ts +31 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_scope_add.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_scope_add.js +81 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_scope_add.js.map +1 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_scope_remove.d.ts +30 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_scope_remove.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_scope_remove.js +80 -0
- package/dist/cli/commands/cockpit/mcp/tools/cockpit_scope_remove.js.map +1 -0
- package/dist/cli/commands/cockpit/queue.d.ts +15 -0
- package/dist/cli/commands/cockpit/queue.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/queue.js +142 -29
- package/dist/cli/commands/cockpit/queue.js.map +1 -1
- package/dist/cli/commands/cockpit/resume.d.ts +12 -6
- package/dist/cli/commands/cockpit/resume.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/resume.js +27 -11
- package/dist/cli/commands/cockpit/resume.js.map +1 -1
- package/dist/cli/commands/cockpit/scope/errors.d.ts +21 -0
- package/dist/cli/commands/cockpit/scope/errors.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/scope/errors.js +17 -0
- package/dist/cli/commands/cockpit/scope/errors.js.map +1 -0
- package/dist/cli/commands/cockpit/scope/retry.d.ts +24 -0
- package/dist/cli/commands/cockpit/scope/retry.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/scope/retry.js +52 -0
- package/dist/cli/commands/cockpit/scope/retry.js.map +1 -0
- package/dist/cli/commands/cockpit/scope/writer.d.ts +21 -0
- package/dist/cli/commands/cockpit/scope/writer.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/scope/writer.js +141 -0
- package/dist/cli/commands/cockpit/scope/writer.js.map +1 -0
- package/dist/cli/commands/cockpit/scope.d.ts +22 -0
- package/dist/cli/commands/cockpit/scope.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/scope.js +110 -0
- package/dist/cli/commands/cockpit/scope.js.map +1 -0
- package/dist/cli/commands/cockpit/status/group.d.ts +4 -2
- package/dist/cli/commands/cockpit/status/group.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/status/group.js +17 -2
- package/dist/cli/commands/cockpit/status/group.js.map +1 -1
- package/dist/cli/commands/cockpit/status.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/status.js +17 -2
- package/dist/cli/commands/cockpit/status.js.map +1 -1
- package/dist/cli/commands/cockpit/watch/diff.d.ts +6 -2
- package/dist/cli/commands/cockpit/watch/diff.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/watch/diff.js +11 -3
- package/dist/cli/commands/cockpit/watch/diff.js.map +1 -1
- package/dist/cli/commands/cockpit/watch/poll-loop.d.ts +2 -0
- package/dist/cli/commands/cockpit/watch/poll-loop.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/watch/poll-loop.js +38 -6
- package/dist/cli/commands/cockpit/watch/poll-loop.js.map +1 -1
- package/dist/cli/commands/cockpit/watch/pr-state.d.ts +15 -1
- package/dist/cli/commands/cockpit/watch/pr-state.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/watch/pr-state.js +38 -0
- package/dist/cli/commands/cockpit/watch/pr-state.js.map +1 -1
- package/dist/cli/commands/cockpit/watch/snapshot.d.ts +6 -1
- package/dist/cli/commands/cockpit/watch/snapshot.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/watch/snapshot.js +3 -1
- package/dist/cli/commands/cockpit/watch/snapshot.js.map +1 -1
- package/dist/cli/commands/cockpit/watch.d.ts +2 -1
- package/dist/cli/commands/cockpit/watch.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/watch.js +25 -13
- package/dist/cli/commands/cockpit/watch.js.map +1 -1
- package/dist/config/schema.d.ts +788 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +12 -1
- package/dist/config/schema.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cockpit_queue.js","sourceRoot":"","sources":["../../../../../../src/cli/commands/cockpit/mcp/tools/cockpit_queue.ts"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"cockpit_queue.js","sourceRoot":"","sources":["../../../../../../src/cli/commands/cockpit/mcp/tools/cockpit_queue.ts"],"names":[],"mappings":"AASA,OAAO,EACL,QAAQ,EACR,mBAAmB,GAGpB,MAAM,gBAAgB,CAAC;AAC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I,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnE,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;YAC7C,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;YAChD,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;SACzB,CAAC;QAEF,MAAM,OAAO,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QAC7E,MAAM,MAAM,GAAG,MAAM,QAAQ,CAC3B,OAAO,EACP,MAAM,CAAC,IAAI,CAAC,KAAK,EACjB,EAAE,GAAG,EAAE,IAAI,EAAE,EACb,SAAS,CACV,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,cAAc,CAClB,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAC1B,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EACzB,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAC3B,MAAM,CAAC,IAAI,CAAC,KAAK,EACjB,MAAM,CACP;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #958 — `cockpit_relay_clarify_answers` MCP tool.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `runClarifyRelay` (which posts a marker-stamped comment via
|
|
5
|
+
* `formatClarificationAnswerComment` and applies `completed:clarification`).
|
|
6
|
+
* The skill invokes this tool with a structured `{ [questionNumber]: string }`
|
|
7
|
+
* payload — the freehand `gh issue comment` step in the pre-#958 skill is
|
|
8
|
+
* retired here. That's the FR-003 load-bearing companion.
|
|
9
|
+
*
|
|
10
|
+
* Envelope mirrors `cockpit_advance` — Zod-validated input, `wrapToolBoundary`
|
|
11
|
+
* for CockpitExit → ToolResult mapping, `normalizeIssueRef` for the MCP-layer
|
|
12
|
+
* qualified-ref requirement.
|
|
13
|
+
*/
|
|
14
|
+
import type { CommandRunner, GhWrapper } from '@generacy-ai/cockpit';
|
|
15
|
+
import { type ClarifyRelayDeps } from '../../clarify-relay.js';
|
|
16
|
+
import { type ToolResult } from '../errors.js';
|
|
17
|
+
import { type IssueRefInput } from '../schemas.js';
|
|
18
|
+
export interface CockpitRelayClarifyAnswersInput {
|
|
19
|
+
issue: IssueRefInput;
|
|
20
|
+
batch: number;
|
|
21
|
+
answers: Record<number, string>;
|
|
22
|
+
actor?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CockpitRelayClarifyAnswersData {
|
|
25
|
+
ref: {
|
|
26
|
+
owner: string;
|
|
27
|
+
repo: string;
|
|
28
|
+
number: number;
|
|
29
|
+
nwo: string;
|
|
30
|
+
};
|
|
31
|
+
batch: number;
|
|
32
|
+
action: 'relayed' | 'already-relayed';
|
|
33
|
+
completedLabel: 'completed:clarification';
|
|
34
|
+
commentUrl?: string;
|
|
35
|
+
noop?: true;
|
|
36
|
+
}
|
|
37
|
+
export interface CockpitRelayClarifyAnswersDeps {
|
|
38
|
+
runner?: CommandRunner;
|
|
39
|
+
gh?: GhWrapper;
|
|
40
|
+
loadConfig?: ClarifyRelayDeps['loadConfig'];
|
|
41
|
+
env?: NodeJS.ProcessEnv;
|
|
42
|
+
now?: () => Date;
|
|
43
|
+
}
|
|
44
|
+
export declare function cockpitRelayClarifyAnswers(input: CockpitRelayClarifyAnswersInput, deps?: CockpitRelayClarifyAnswersDeps): Promise<ToolResult<CockpitRelayClarifyAnswersData>>;
|
|
45
|
+
//# sourceMappingURL=cockpit_relay_clarify_answers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cockpit_relay_clarify_answers.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/cockpit/mcp/tools/cockpit_relay_clarify_answers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,8BAA8B;IAC7C,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,iBAAiB,CAAC;IACtC,cAAc,EAAE,yBAAyB,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,MAAM,WAAW,8BAA8B;IAC7C,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,EACtC,IAAI,GAAE,8BAAmC,GACxC,OAAO,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,CA2CrD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { runClarifyRelay } from '../../clarify-relay.js';
|
|
2
|
+
import { normalizeIssueRef } from '../ref-input.js';
|
|
3
|
+
import { wrapToolBoundary } from '../errors.js';
|
|
4
|
+
import { CockpitRelayClarifyAnswersInputSchema, } from '../schemas.js';
|
|
5
|
+
export function cockpitRelayClarifyAnswers(input, deps = {}) {
|
|
6
|
+
return wrapToolBoundary(async () => {
|
|
7
|
+
const parsed = CockpitRelayClarifyAnswersInputSchema.safeParse(input);
|
|
8
|
+
if (!parsed.success) {
|
|
9
|
+
const detail = parsed.error.issues.map((i) => i.message).join('; ');
|
|
10
|
+
return { status: 'error', class: 'invalid-args', detail };
|
|
11
|
+
}
|
|
12
|
+
const normalized = await normalizeIssueRef(parsed.data.issue, {
|
|
13
|
+
expects: 'issue',
|
|
14
|
+
...(deps.runner != null ? { runner: deps.runner } : {}),
|
|
15
|
+
...(deps.gh != null ? { gh: deps.gh } : {}),
|
|
16
|
+
});
|
|
17
|
+
if (!normalized.ok)
|
|
18
|
+
return normalized.error;
|
|
19
|
+
const relayDeps = {
|
|
20
|
+
gh: deps.gh ?? normalized.value.gh,
|
|
21
|
+
...(deps.runner != null ? { runner: deps.runner } : {}),
|
|
22
|
+
...(deps.loadConfig != null ? { loadConfig: deps.loadConfig } : {}),
|
|
23
|
+
...(deps.env != null ? { env: deps.env } : {}),
|
|
24
|
+
...(deps.now != null ? { now: deps.now } : {}),
|
|
25
|
+
};
|
|
26
|
+
const issueArg = `${normalized.value.ref.nwo}#${normalized.value.ref.number}`;
|
|
27
|
+
const relayInput = {
|
|
28
|
+
issue: issueArg,
|
|
29
|
+
batch: parsed.data.batch,
|
|
30
|
+
answers: parsed.data.answers,
|
|
31
|
+
...(parsed.data.actor != null ? { actor: parsed.data.actor } : {}),
|
|
32
|
+
};
|
|
33
|
+
const result = await runClarifyRelay(relayInput, relayDeps);
|
|
34
|
+
const data = {
|
|
35
|
+
ref: normalized.value.ref,
|
|
36
|
+
batch: result.batch,
|
|
37
|
+
action: result.action,
|
|
38
|
+
completedLabel: result.completedLabel,
|
|
39
|
+
...(result.commentUrl != null ? { commentUrl: result.commentUrl } : {}),
|
|
40
|
+
...(result.noop === true ? { noop: true } : {}),
|
|
41
|
+
};
|
|
42
|
+
return { status: 'ok', data };
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=cockpit_relay_clarify_answers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cockpit_relay_clarify_answers.js","sourceRoot":"","sources":["../../../../../../src/cli/commands/cockpit/mcp/tools/cockpit_relay_clarify_answers.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAyB,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,qCAAqC,GAEtC,MAAM,eAAe,CAAC;AA0BvB,MAAM,UAAU,0BAA0B,CACxC,KAAsC,EACtC,OAAuC,EAAE;IAEzC,OAAO,gBAAgB,CAAiC,KAAK,IAAI,EAAE;QACjE,MAAM,MAAM,GAAG,qCAAqC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpE,OAAO,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rency-safe via bounded retry (see scope/retry.ts).
|
|
6
|
+
*/
|
|
7
|
+
import type { CommandRunner, GhWrapper } from '@generacy-ai/cockpit';
|
|
8
|
+
import { type ToolResult } from '../errors.js';
|
|
9
|
+
import { type CockpitScopeAddInput } from '../schemas.js';
|
|
10
|
+
import type { BodyShape } from '../../scope/writer.js';
|
|
11
|
+
export interface CockpitScopeAddData {
|
|
12
|
+
scope: {
|
|
13
|
+
owner: string;
|
|
14
|
+
repo: string;
|
|
15
|
+
number: number;
|
|
16
|
+
};
|
|
17
|
+
ref: {
|
|
18
|
+
owner: string;
|
|
19
|
+
repo: string;
|
|
20
|
+
number: number;
|
|
21
|
+
};
|
|
22
|
+
shape: BodyShape;
|
|
23
|
+
alreadyPresent: boolean;
|
|
24
|
+
attempts: number;
|
|
25
|
+
}
|
|
26
|
+
export interface CockpitScopeAddDeps {
|
|
27
|
+
runner?: CommandRunner;
|
|
28
|
+
gh?: GhWrapper;
|
|
29
|
+
}
|
|
30
|
+
export declare function cockpitScopeAdd(input: CockpitScopeAddInput, deps?: CockpitScopeAddDeps): Promise<ToolResult<CockpitScopeAddData>>;
|
|
31
|
+
//# sourceMappingURL=cockpit_scope_add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cockpit_scope_add.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/cockpit/mcp/tools/cockpit_scope_add.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,KAAK,EAAE,SAAS,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAOD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,oBAAoB,EAC3B,IAAI,GAAE,mBAAwB,GAC7B,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAuE1C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { normalizeIssueRef } from '../ref-input.js';
|
|
2
|
+
import { wrapToolBoundary } from '../errors.js';
|
|
3
|
+
import { CockpitScopeAddInputSchema, } from '../schemas.js';
|
|
4
|
+
import { writeScopeWithRetry } from '../../scope/retry.js';
|
|
5
|
+
import { ScopeContendedError } from '../../scope/errors.js';
|
|
6
|
+
function isScopeNotFoundError(err) {
|
|
7
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
8
|
+
return /404|not found|no such/i.test(msg);
|
|
9
|
+
}
|
|
10
|
+
export function cockpitScopeAdd(input, deps = {}) {
|
|
11
|
+
return wrapToolBoundary(async () => {
|
|
12
|
+
const parsed = CockpitScopeAddInputSchema.safeParse(input);
|
|
13
|
+
if (!parsed.success) {
|
|
14
|
+
return {
|
|
15
|
+
status: 'error',
|
|
16
|
+
class: 'invalid-args',
|
|
17
|
+
detail: parsed.error.issues.map((i) => i.message).join('; '),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const scopeN = await normalizeIssueRef(parsed.data.scope, {
|
|
21
|
+
expects: 'issue',
|
|
22
|
+
...(deps.runner != null ? { runner: deps.runner } : {}),
|
|
23
|
+
...(deps.gh != null ? { gh: deps.gh } : {}),
|
|
24
|
+
});
|
|
25
|
+
if (!scopeN.ok)
|
|
26
|
+
return scopeN.error;
|
|
27
|
+
const refN = await normalizeIssueRef(parsed.data.issue, {
|
|
28
|
+
expects: 'issue',
|
|
29
|
+
...(deps.runner != null ? { runner: deps.runner } : {}),
|
|
30
|
+
...(deps.gh != null ? { gh: deps.gh } : {}),
|
|
31
|
+
});
|
|
32
|
+
if (!refN.ok)
|
|
33
|
+
return refN.error;
|
|
34
|
+
const gh = deps.gh ?? scopeN.value.gh;
|
|
35
|
+
const scope = { repo: scopeN.value.ref.nwo, number: scopeN.value.ref.number };
|
|
36
|
+
const ref = { repo: refN.value.ref.nwo, number: refN.value.ref.number };
|
|
37
|
+
try {
|
|
38
|
+
const result = await writeScopeWithRetry({
|
|
39
|
+
gh,
|
|
40
|
+
scope,
|
|
41
|
+
mutation: { kind: 'add', ref },
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
status: 'ok',
|
|
45
|
+
data: {
|
|
46
|
+
scope: {
|
|
47
|
+
owner: scopeN.value.ref.owner,
|
|
48
|
+
repo: scopeN.value.ref.repo,
|
|
49
|
+
number: scopeN.value.ref.number,
|
|
50
|
+
},
|
|
51
|
+
ref: {
|
|
52
|
+
owner: refN.value.ref.owner,
|
|
53
|
+
repo: refN.value.ref.repo,
|
|
54
|
+
number: refN.value.ref.number,
|
|
55
|
+
},
|
|
56
|
+
shape: result.shape,
|
|
57
|
+
alreadyPresent: result.noop,
|
|
58
|
+
attempts: result.attempts,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
if (err instanceof ScopeContendedError) {
|
|
64
|
+
return {
|
|
65
|
+
status: 'error',
|
|
66
|
+
class: 'contended',
|
|
67
|
+
detail: `${err.code} after ${err.attempts} attempts`,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (isScopeNotFoundError(err)) {
|
|
71
|
+
return {
|
|
72
|
+
status: 'error',
|
|
73
|
+
class: 'scope-not-found',
|
|
74
|
+
detail: `scope issue ${scope.repo}#${scope.number} not found`,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
throw err;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=cockpit_scope_add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cockpit_scope_add.js","sourceRoot":"","sources":["../../../../../../src/cli/commands/cockpit/mcp/tools/cockpit_scope_add.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,0BAA0B,GAE3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAgB5D,SAAS,oBAAoB,CAAC,GAAY;IACxC,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAA2B,EAC3B,OAA4B,EAAE;IAE9B,OAAO,gBAAgB,CAAC,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,0BAA0B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO;gBACL,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,cAAc;gBACrB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,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AAW;iBACrD,CAAC;YACJ,CAAC;YACD,IAAI,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9B,OAAO;oBACL,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,iBAAiB;oBACxB,MAAM,EAAE,eAAe,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,YAAY;iBAC9D,CAAC;YACJ,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cockpit_scope_remove` MCP tool handler.
|
|
3
|
+
*
|
|
4
|
+
* Removes the first task-list line matching the ref from a scope issue's
|
|
5
|
+
* body. Same envelope and error classes as `cockpit_scope_add`; the shared
|
|
6
|
+
* `SCOPE_ADD_CONTENDED` code covers both mutations per spec Q5.
|
|
7
|
+
*/
|
|
8
|
+
import type { CommandRunner, GhWrapper } from '@generacy-ai/cockpit';
|
|
9
|
+
import { type ToolResult } from '../errors.js';
|
|
10
|
+
import { type CockpitScopeRemoveInput } from '../schemas.js';
|
|
11
|
+
export interface CockpitScopeRemoveData {
|
|
12
|
+
scope: {
|
|
13
|
+
owner: string;
|
|
14
|
+
repo: string;
|
|
15
|
+
number: number;
|
|
16
|
+
};
|
|
17
|
+
ref: {
|
|
18
|
+
owner: string;
|
|
19
|
+
repo: string;
|
|
20
|
+
number: number;
|
|
21
|
+
};
|
|
22
|
+
alreadyAbsent: boolean;
|
|
23
|
+
attempts: number;
|
|
24
|
+
}
|
|
25
|
+
export interface CockpitScopeRemoveDeps {
|
|
26
|
+
runner?: CommandRunner;
|
|
27
|
+
gh?: GhWrapper;
|
|
28
|
+
}
|
|
29
|
+
export declare function cockpitScopeRemove(input: CockpitScopeRemoveInput, deps?: CockpitScopeRemoveDeps): Promise<ToolResult<CockpitScopeRemoveData>>;
|
|
30
|
+
//# sourceMappingURL=cockpit_scope_remove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cockpit_scope_remove.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/cockpit/mcp/tools/cockpit_scope_remove.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB;AAOD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,EAC9B,IAAI,GAAE,sBAA2B,GAChC,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC,CAsE7C"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { normalizeIssueRef } from '../ref-input.js';
|
|
2
|
+
import { wrapToolBoundary } from '../errors.js';
|
|
3
|
+
import { CockpitScopeRemoveInputSchema, } from '../schemas.js';
|
|
4
|
+
import { writeScopeWithRetry } from '../../scope/retry.js';
|
|
5
|
+
import { ScopeContendedError } from '../../scope/errors.js';
|
|
6
|
+
function isScopeNotFoundError(err) {
|
|
7
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
8
|
+
return /404|not found|no such/i.test(msg);
|
|
9
|
+
}
|
|
10
|
+
export function cockpitScopeRemove(input, deps = {}) {
|
|
11
|
+
return wrapToolBoundary(async () => {
|
|
12
|
+
const parsed = CockpitScopeRemoveInputSchema.safeParse(input);
|
|
13
|
+
if (!parsed.success) {
|
|
14
|
+
return {
|
|
15
|
+
status: 'error',
|
|
16
|
+
class: 'invalid-args',
|
|
17
|
+
detail: parsed.error.issues.map((i) => i.message).join('; '),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const scopeN = await normalizeIssueRef(parsed.data.scope, {
|
|
21
|
+
expects: 'issue',
|
|
22
|
+
...(deps.runner != null ? { runner: deps.runner } : {}),
|
|
23
|
+
...(deps.gh != null ? { gh: deps.gh } : {}),
|
|
24
|
+
});
|
|
25
|
+
if (!scopeN.ok)
|
|
26
|
+
return scopeN.error;
|
|
27
|
+
const refN = await normalizeIssueRef(parsed.data.issue, {
|
|
28
|
+
expects: 'issue',
|
|
29
|
+
...(deps.runner != null ? { runner: deps.runner } : {}),
|
|
30
|
+
...(deps.gh != null ? { gh: deps.gh } : {}),
|
|
31
|
+
});
|
|
32
|
+
if (!refN.ok)
|
|
33
|
+
return refN.error;
|
|
34
|
+
const gh = deps.gh ?? scopeN.value.gh;
|
|
35
|
+
const scope = { repo: scopeN.value.ref.nwo, number: scopeN.value.ref.number };
|
|
36
|
+
const ref = { repo: refN.value.ref.nwo, number: refN.value.ref.number };
|
|
37
|
+
try {
|
|
38
|
+
const result = await writeScopeWithRetry({
|
|
39
|
+
gh,
|
|
40
|
+
scope,
|
|
41
|
+
mutation: { kind: 'remove', ref },
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
status: 'ok',
|
|
45
|
+
data: {
|
|
46
|
+
scope: {
|
|
47
|
+
owner: scopeN.value.ref.owner,
|
|
48
|
+
repo: scopeN.value.ref.repo,
|
|
49
|
+
number: scopeN.value.ref.number,
|
|
50
|
+
},
|
|
51
|
+
ref: {
|
|
52
|
+
owner: refN.value.ref.owner,
|
|
53
|
+
repo: refN.value.ref.repo,
|
|
54
|
+
number: refN.value.ref.number,
|
|
55
|
+
},
|
|
56
|
+
alreadyAbsent: result.noop,
|
|
57
|
+
attempts: result.attempts,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
if (err instanceof ScopeContendedError) {
|
|
63
|
+
return {
|
|
64
|
+
status: 'error',
|
|
65
|
+
class: 'contended',
|
|
66
|
+
detail: `${err.code} after ${err.attempts} attempts`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (isScopeNotFoundError(err)) {
|
|
70
|
+
return {
|
|
71
|
+
status: 'error',
|
|
72
|
+
class: 'scope-not-found',
|
|
73
|
+
detail: `scope issue ${scope.repo}#${scope.number} not found`,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
throw err;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=cockpit_scope_remove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cockpit_scope_remove.js","sourceRoot":"","sources":["../../../../../../src/cli/commands/cockpit/mcp/tools/cockpit_scope_remove.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,6BAA6B,GAE9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAc5D,SAAS,oBAAoB,CAAC,GAAY;IACxC,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,wBAAwB,C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AC,GAAG,CAAC,MAAM;qBAC9B;oBACD,aAAa,EAAE,MAAM,CAAC,IAAI;oBAC1B,QAAQ,EAAE,MAAM,CAAC,QAAQ;iBAC1B;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,mBAAmB,EAAE,CAAC;gBACvC,OAAO;oBACL,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,WAAW;oBAClB,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,QAAQ,WAAW;iBACrD,CAAC;YACJ,CAAC;YACD,IAAI,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9B,OAAO;oBACL,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,iBAAiB;oBACxB,MAAM,EAAE,eAAe,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,YAAY;iBAC9D,CAAC;YACJ,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -15,6 +15,16 @@ export interface QueueOptions {
|
|
|
15
15
|
repo?: string;
|
|
16
16
|
assignee?: string;
|
|
17
17
|
yes?: boolean;
|
|
18
|
+
/** #935: single-issue form — mutually exclusive with positional <epic-ref> <phase>. */
|
|
19
|
+
issue?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface QueueIssueResult {
|
|
22
|
+
ref: IssueRef;
|
|
23
|
+
workflowLabel: string;
|
|
24
|
+
assignee: string;
|
|
25
|
+
row: QueueRow;
|
|
26
|
+
confirmed: boolean;
|
|
27
|
+
exitCode: 0 | 1 | 2;
|
|
18
28
|
}
|
|
19
29
|
export type EligibilityStatus = {
|
|
20
30
|
kind: 'eligible';
|
|
@@ -81,5 +91,10 @@ export interface QueueCommandDeps {
|
|
|
81
91
|
export declare function renderPreview(epic: ResolvedEpic, phase: ParsedPhase, targetRepo: string, workflowLabel: string, assignee: string, rows: QueueRow[]): string[];
|
|
82
92
|
export declare function renderSummary(rows: QueueRow[]): string[];
|
|
83
93
|
export declare function runQueue(epicRef: string | undefined, phaseArg: string | undefined, opts: QueueOptions, deps: QueueCommandDeps): Promise<QueueResult>;
|
|
94
|
+
/**
|
|
95
|
+
* Single-issue queue form (#935). Bypasses `resolveEpic` — the caller supplies
|
|
96
|
+
* one specific issue ref; classify and mutate as a single row.
|
|
97
|
+
*/
|
|
98
|
+
export declare function runQueueSingleIssue(issueArg: string, opts: QueueOptions, deps: QueueCommandDeps): Promise<QueueIssueResult>;
|
|
84
99
|
export declare function queueCommand(deps?: QueueCommandDeps): Command;
|
|
85
100
|
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/cockpit/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAE5C,OAAO,EAGL,iBAAiB,EAIjB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,QAAQ,EAEb,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,gCAAgC,CAAC;AAUxC,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/cockpit/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAE5C,OAAO,EAGL,iBAAiB,EAIjB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,QAAQ,EAEb,KAA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,WAAW,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,EAAE,GACf,MAAM,EAAE,CA2BV;AASD,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,CAcxD;AAuDD,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,WAAW,CAAC,CA2MtB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAsG3B;AAED,wBAAgB,YAAY,CAAC,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAyCjE"}
|
|
@@ -197,6 +197,38 @@ async function defaultPrompt(message) {
|
|
|
197
197
|
return false;
|
|
198
198
|
return Boolean(answer);
|
|
199
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Apply the queue mutation (assign + label) for one already-eligible row.
|
|
202
|
+
* Shared between phase-form and single-issue-form runners.
|
|
203
|
+
*/
|
|
204
|
+
async function applyQueueMutation(row, assignee, cockpitGh) {
|
|
205
|
+
if (row.eligibility.kind !== 'eligible')
|
|
206
|
+
return;
|
|
207
|
+
if (row.assignees.includes(assignee)) {
|
|
208
|
+
row.assignResult = { kind: 'already' };
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
try {
|
|
212
|
+
await cockpitGh.addAssignees(row.ref.repo, row.ref.number, [assignee]);
|
|
213
|
+
row.assignResult = { kind: 'ok' };
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
row.assignResult = { kind: 'error', reason: err.message };
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (row.labels.includes(row.eligibility.workflowLabel)) {
|
|
220
|
+
row.labelResult = { kind: 'already' };
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
try {
|
|
224
|
+
await cockpitGh.addLabel(row.ref.repo, row.ref.number, row.eligibility.workflowLabel);
|
|
225
|
+
row.labelResult = { kind: 'ok' };
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
row.labelResult = { kind: 'error', reason: err.message };
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
200
232
|
function pickTargetRepo(refs, repoFlag) {
|
|
201
233
|
const seen = new Set();
|
|
202
234
|
for (const r of refs)
|
|
@@ -367,32 +399,7 @@ export async function runQueue(epicRef, phaseArg, opts, deps) {
|
|
|
367
399
|
}
|
|
368
400
|
const { eligible } = sortRows(rows);
|
|
369
401
|
for (const row of eligible) {
|
|
370
|
-
|
|
371
|
-
continue;
|
|
372
|
-
if (row.assignees.includes(assignee)) {
|
|
373
|
-
row.assignResult = { kind: 'already' };
|
|
374
|
-
}
|
|
375
|
-
else {
|
|
376
|
-
try {
|
|
377
|
-
await cockpitGh.addAssignees(row.ref.repo, row.ref.number, [assignee]);
|
|
378
|
-
row.assignResult = { kind: 'ok' };
|
|
379
|
-
}
|
|
380
|
-
catch (err) {
|
|
381
|
-
row.assignResult = { kind: 'error', reason: err.message };
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
if (row.labels.includes(row.eligibility.workflowLabel)) {
|
|
385
|
-
row.labelResult = { kind: 'already' };
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
try {
|
|
389
|
-
await cockpitGh.addLabel(row.ref.repo, row.ref.number, row.eligibility.workflowLabel);
|
|
390
|
-
row.labelResult = { kind: 'ok' };
|
|
391
|
-
}
|
|
392
|
-
catch (err) {
|
|
393
|
-
row.labelResult = { kind: 'error', reason: err.message };
|
|
394
|
-
}
|
|
395
|
-
}
|
|
402
|
+
await applyQueueMutation(row, assignee, cockpitGh);
|
|
396
403
|
}
|
|
397
404
|
for (const line of renderSummary(rows))
|
|
398
405
|
print(line);
|
|
@@ -409,18 +416,124 @@ export async function runQueue(epicRef, phaseArg, opts, deps) {
|
|
|
409
416
|
exitCode: anyError ? 1 : 0,
|
|
410
417
|
};
|
|
411
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Single-issue queue form (#935). Bypasses `resolveEpic` — the caller supplies
|
|
421
|
+
* one specific issue ref; classify and mutate as a single row.
|
|
422
|
+
*/
|
|
423
|
+
export async function runQueueSingleIssue(issueArg, opts, deps) {
|
|
424
|
+
const print = deps.stdout ?? ((line) => process.stdout.write(`${line}\n`));
|
|
425
|
+
const workflowLabel = opts.label ?? DEFAULT_LABEL;
|
|
426
|
+
if (!LABEL_REGEX.test(workflowLabel)) {
|
|
427
|
+
throw new CockpitExit(2, `Error: cockpit queue: invalid --label "${workflowLabel}"`);
|
|
428
|
+
}
|
|
429
|
+
if (opts.assignee != null && !LOGIN_REGEX.test(opts.assignee)) {
|
|
430
|
+
throw new CockpitExit(2, `Error: cockpit queue: invalid --assignee "${opts.assignee}" (expected GitHub login)`);
|
|
431
|
+
}
|
|
432
|
+
const cockpitGh = deps.cockpitGh ?? new GhCliWrapper(deps.runner ?? nodeChildProcessRunner);
|
|
433
|
+
const gh = deps.gh ?? cockpitGh;
|
|
434
|
+
const loadedConfig = await (deps.loadConfig ?? loadCockpitConfig)({});
|
|
435
|
+
const log = getLogger();
|
|
436
|
+
for (const w of loadedConfig.warnings)
|
|
437
|
+
log.warn(w);
|
|
438
|
+
let cliRef;
|
|
439
|
+
try {
|
|
440
|
+
const resolvedCtx = await resolveIssueContext({ issue: issueArg, runner: deps.runner });
|
|
441
|
+
cliRef = resolvedCtx.ref;
|
|
442
|
+
}
|
|
443
|
+
catch (err) {
|
|
444
|
+
throw new CockpitExit(2, `Error: cockpit queue: ${err instanceof Error ? err.message : String(err)}`);
|
|
445
|
+
}
|
|
446
|
+
const ref = { repo: cliRef.nwo, number: cliRef.number };
|
|
447
|
+
let view;
|
|
448
|
+
try {
|
|
449
|
+
view = await cockpitGh.fetchIssueState(ref.repo, ref.number);
|
|
450
|
+
}
|
|
451
|
+
catch {
|
|
452
|
+
view = null;
|
|
453
|
+
}
|
|
454
|
+
const eligibility = classifyRow(ref, ref.repo, workflowLabel, view);
|
|
455
|
+
const row = {
|
|
456
|
+
ref,
|
|
457
|
+
title: view?.title ?? '',
|
|
458
|
+
labels: view?.labels ?? [],
|
|
459
|
+
assignees: view?.assignees ?? [],
|
|
460
|
+
eligibility,
|
|
461
|
+
};
|
|
462
|
+
let assignee;
|
|
463
|
+
try {
|
|
464
|
+
const resolved = await resolveCockpitIdentity({
|
|
465
|
+
flag: opts.assignee,
|
|
466
|
+
configAssignee: loadedConfig.config.assignee,
|
|
467
|
+
gh,
|
|
468
|
+
logger: log,
|
|
469
|
+
verb: 'queue',
|
|
470
|
+
mode: 'required',
|
|
471
|
+
env: deps.env,
|
|
472
|
+
});
|
|
473
|
+
assignee = resolved.login;
|
|
474
|
+
}
|
|
475
|
+
catch (err) {
|
|
476
|
+
if (err instanceof LoudIdentityError) {
|
|
477
|
+
throw new CockpitExit(1, `Error: ${err.message}`);
|
|
478
|
+
}
|
|
479
|
+
throw err;
|
|
480
|
+
}
|
|
481
|
+
// Preview: single-row line, matching the phased form's preview shape.
|
|
482
|
+
if (row.eligibility.kind === 'eligible') {
|
|
483
|
+
print(`cockpit queue --issue: ${ref.repo}#${ref.number} ${row.title} ` +
|
|
484
|
+
`(${row.eligibility.workflowLabel}, assignee: ${assignee})`);
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
const tag = `[SKIP: ${row.eligibility.reason}]`;
|
|
488
|
+
const title = row.title ? ` ${row.title}` : '';
|
|
489
|
+
print(`cockpit queue --issue: ${tag} ${ref.repo}#${ref.number}${title}`);
|
|
490
|
+
return { ref, workflowLabel, assignee, row, confirmed: false, exitCode: 0 };
|
|
491
|
+
}
|
|
492
|
+
let confirmed = Boolean(opts.yes);
|
|
493
|
+
if (!confirmed) {
|
|
494
|
+
const prompt = deps.prompt ?? defaultPrompt;
|
|
495
|
+
confirmed = (await prompt('Proceed?')) === true;
|
|
496
|
+
if (!confirmed) {
|
|
497
|
+
print('Cancelled. No mutations made.');
|
|
498
|
+
return { ref, workflowLabel, assignee, row, confirmed: false, exitCode: 0 };
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
await applyQueueMutation(row, assignee, cockpitGh);
|
|
502
|
+
for (const line of renderSummary([row]))
|
|
503
|
+
print(line);
|
|
504
|
+
const anyError = row.assignResult?.kind === 'error' || row.labelResult?.kind === 'error';
|
|
505
|
+
return {
|
|
506
|
+
ref,
|
|
507
|
+
workflowLabel,
|
|
508
|
+
assignee,
|
|
509
|
+
row,
|
|
510
|
+
confirmed: true,
|
|
511
|
+
exitCode: anyError ? 1 : 0,
|
|
512
|
+
};
|
|
513
|
+
}
|
|
412
514
|
export function queueCommand(deps = {}) {
|
|
413
515
|
const cmd = new Command('queue');
|
|
414
516
|
cmd
|
|
415
|
-
.description('Queue
|
|
416
|
-
.argument('
|
|
417
|
-
.argument('
|
|
517
|
+
.description('Queue eligible refs under a phase heading — or a single issue via --issue.')
|
|
518
|
+
.argument('[epic-ref]', 'Epic ref (owner/repo#N). Omit when using --issue.')
|
|
519
|
+
.argument('[phase]', 'Phase token — matched against the first token of a ### heading.')
|
|
418
520
|
.addOption(new Option('--label <name>', `Workflow label (default: ${DEFAULT_LABEL}).`))
|
|
419
521
|
.addOption(new Option('--repo <owner/repo>', 'Restrict the invocation to a single repo.'))
|
|
420
522
|
.addOption(new Option('--assignee <login>', 'Override the default cluster-account assignee.'))
|
|
421
523
|
.addOption(new Option('--yes', 'Skip the interactive confirmation prompt.'))
|
|
524
|
+
.addOption(new Option('--issue <ref>', 'Single-issue mode. Mutually exclusive with <epic-ref> <phase>.'))
|
|
422
525
|
.action(async (epicRef, phaseArg, opts) => {
|
|
423
526
|
try {
|
|
527
|
+
if (opts.issue != null) {
|
|
528
|
+
if (epicRef != null || phaseArg != null) {
|
|
529
|
+
throw new CockpitExit(2, 'Error: cockpit queue: --issue is mutually exclusive with <epic-ref> <phase>');
|
|
530
|
+
}
|
|
531
|
+
const result = await runQueueSingleIssue(opts.issue, opts, deps);
|
|
532
|
+
process.exit(result.exitCode);
|
|
533
|
+
}
|
|
534
|
+
if (epicRef == null || phaseArg == null) {
|
|
535
|
+
throw new CockpitExit(2, 'Error: cockpit queue: either <epic-ref> <phase> or --issue <ref> is required');
|
|
536
|
+
}
|
|
424
537
|
const result = await runQueue(epicRef, phaseArg, opts, deps);
|
|
425
538
|
process.exit(result.exitCode);
|
|
426
539
|
}
|