@generacy-ai/generacy 0.5.0 → 0.7.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 +0 -10
- package/dist/cli/commands/cockpit/clarification-comment-finder.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/clarification-comment-finder.js +57 -4
- 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 +103 -0
- package/dist/cli/commands/cockpit/doorbell/channel-discovery.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/channel-discovery.js +168 -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 +405 -0
- package/dist/cli/commands/cockpit/doorbell/smee-source.js.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/source-selector.d.ts +61 -0
- package/dist/cli/commands/cockpit/doorbell/source-selector.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/source-selector.js +208 -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-target-resolver.d.ts +20 -0
- package/dist/cli/commands/cockpit/doorbell/webhook-target-resolver.d.ts.map +1 -0
- package/dist/cli/commands/cockpit/doorbell/webhook-target-resolver.js +51 -0
- package/dist/cli/commands/cockpit/doorbell/webhook-target-resolver.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 +162 -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 +519 -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 +3 -0
- package/dist/cli/commands/cockpit/index.js.map +1 -1
- package/dist/cli/commands/cockpit/mcp/event-bus-registry.d.ts +3 -2
- package/dist/cli/commands/cockpit/mcp/event-bus-registry.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/mcp/event-bus-registry.js +41 -12
- package/dist/cli/commands/cockpit/mcp/event-bus-registry.js.map +1 -1
- package/dist/cli/commands/cockpit/mcp/event-bus.d.ts +6 -0
- package/dist/cli/commands/cockpit/mcp/event-bus.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/mcp/event-bus.js +7 -1
- package/dist/cli/commands/cockpit/mcp/event-bus.js.map +1 -1
- package/dist/cli/commands/cockpit/mcp/schemas.d.ts +48 -0
- package/dist/cli/commands/cockpit/mcp/schemas.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/mcp/schemas.js +28 -0
- 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 +6 -1
- package/dist/cli/commands/cockpit/mcp/server.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/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/watch/diff.d.ts +1 -0
- package/dist/cli/commands/cockpit/watch/diff.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/watch/diff.js.map +1 -1
- package/dist/cli/commands/cockpit/watch/emit.d.ts +3 -0
- package/dist/cli/commands/cockpit/watch/emit.d.ts.map +1 -1
- package/dist/cli/commands/cockpit/watch/emit.js +1 -0
- package/dist/cli/commands/cockpit/watch/emit.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/stream-event.d.ts +3 -0
- package/dist/cli/commands/cockpit/watch/stream-event.d.ts.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/package.json +6 -5
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `generacy cockpit doorbell` — wake sensor for `/cockpit:auto`.
|
|
3
|
+
*
|
|
4
|
+
* Owns its own in-process `acquireEpicBus()` call (Q1=C rationale: the
|
|
5
|
+
* cockpit MCP server is stdio-only and cannot accept a second client). On
|
|
6
|
+
* smee-live clusters, the doorbell subscribes to the smee.io SSE stream
|
|
7
|
+
* (real-time-first — revised FR-011, #978) with the poll bus as fallback.
|
|
8
|
+
* One process → one wake source at a time → one stdout line per event.
|
|
9
|
+
*
|
|
10
|
+
* Contract: `contracts/cli-surface.md`, `data-model.md`.
|
|
11
|
+
*/
|
|
12
|
+
import { promises as fsPromises } from 'node:fs';
|
|
13
|
+
import { Command } from 'commander';
|
|
14
|
+
import { GhCliWrapper, createGhResponseCache, createRateLimitScheduler, nodeChildProcessRunner, } from '@generacy-ai/cockpit';
|
|
15
|
+
import { acquireEpicBus, } from './mcp/event-bus-registry.js';
|
|
16
|
+
import { subscribeAndEmit, lineForEvent } from './doorbell/subscribe.js';
|
|
17
|
+
import { discoverChannelUrl, DEFAULT_CHANNEL_FILE_PATH, } from './doorbell/channel-discovery.js';
|
|
18
|
+
import { resolveWebhookTargets } from './doorbell/webhook-target-resolver.js';
|
|
19
|
+
import { SourceSelector } from './doorbell/source-selector.js';
|
|
20
|
+
import { SmeeDoorbellSource } from './doorbell/smee-source.js';
|
|
21
|
+
import { runStartupRetry } from './doorbell/startup-retry.js';
|
|
22
|
+
export function classifyForm(positional, options) {
|
|
23
|
+
const hasPositional = positional != null && positional.trim() !== '';
|
|
24
|
+
const hasTracking = options.tracking === true;
|
|
25
|
+
const hasNew = options.new != null && options.new.trim() !== '';
|
|
26
|
+
if (hasTracking && hasNew) {
|
|
27
|
+
return { kind: 'conflicting-flags', reason: 'tracking-with-new' };
|
|
28
|
+
}
|
|
29
|
+
if (hasNew) {
|
|
30
|
+
if (hasPositional) {
|
|
31
|
+
return { kind: 'conflicting-flags', reason: 'positional-with-new' };
|
|
32
|
+
}
|
|
33
|
+
return { kind: 'form-3', title: options.new };
|
|
34
|
+
}
|
|
35
|
+
if (!hasPositional) {
|
|
36
|
+
return { kind: 'missing-positional' };
|
|
37
|
+
}
|
|
38
|
+
if (hasTracking) {
|
|
39
|
+
return { kind: 'form-2', ref: positional };
|
|
40
|
+
}
|
|
41
|
+
return { kind: 'form-1', ref: positional };
|
|
42
|
+
}
|
|
43
|
+
function drainStdout(stdout) {
|
|
44
|
+
return new Promise((resolve) => {
|
|
45
|
+
stdout.write('', () => resolve());
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function writeLine(stdout, line) {
|
|
49
|
+
return new Promise((resolve) => {
|
|
50
|
+
stdout.write(line, () => resolve());
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Fallback scheduler for tests / callers that do not wire a real
|
|
55
|
+
* rate-limit-aware scheduler. Retry envelope treats absence as "sleep for
|
|
56
|
+
* 1s between attempts and do nothing else".
|
|
57
|
+
*/
|
|
58
|
+
function noopScheduler() {
|
|
59
|
+
return {
|
|
60
|
+
getCurrentIntervalMs: () => 1_000,
|
|
61
|
+
probeNow: async () => null,
|
|
62
|
+
noteRetryAfter: () => undefined,
|
|
63
|
+
noteResponseHeaders: () => undefined,
|
|
64
|
+
start: () => undefined,
|
|
65
|
+
stop: () => undefined,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
async function runPollMode(input) {
|
|
69
|
+
const acquire = input.deps.acquireBus ?? acquireEpicBus;
|
|
70
|
+
const acquireOptions = {
|
|
71
|
+
epicRef: input.ref,
|
|
72
|
+
logger: input.logger,
|
|
73
|
+
};
|
|
74
|
+
if (input.deps.runner != null)
|
|
75
|
+
acquireOptions.runner = input.deps.runner;
|
|
76
|
+
if (input.deps.gh != null)
|
|
77
|
+
acquireOptions.gh = input.deps.gh;
|
|
78
|
+
if (input.deps.rateLimitScheduler != null) {
|
|
79
|
+
acquireOptions.rateLimitScheduler = input.deps.rateLimitScheduler;
|
|
80
|
+
}
|
|
81
|
+
const outcome = await runStartupRetry({
|
|
82
|
+
task: () => acquire(acquireOptions),
|
|
83
|
+
label: 'acquireEpicBus',
|
|
84
|
+
rateLimitScheduler: input.deps.rateLimitScheduler ?? noopScheduler(),
|
|
85
|
+
abortSignal: input.retryAbortSignal,
|
|
86
|
+
stderr: input.stderr,
|
|
87
|
+
logger: input.logger,
|
|
88
|
+
});
|
|
89
|
+
if (outcome.kind === 'permanent') {
|
|
90
|
+
return { kind: 'permanent-exit' };
|
|
91
|
+
}
|
|
92
|
+
if (outcome.kind === 'aborted') {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
const acquired = outcome.value;
|
|
96
|
+
const onEmit = (event) => {
|
|
97
|
+
if (input.options.exitOnEpicComplete === true &&
|
|
98
|
+
input.form.kind === 'form-1' &&
|
|
99
|
+
event.type === 'epic-complete') {
|
|
100
|
+
input.stop();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const unsubscribe = subscribeAndEmit(acquired.bus, { stdout: input.stdout, onEmit });
|
|
104
|
+
let released = false;
|
|
105
|
+
const release = () => {
|
|
106
|
+
if (released)
|
|
107
|
+
return;
|
|
108
|
+
released = true;
|
|
109
|
+
unsubscribe();
|
|
110
|
+
acquired.release();
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
release,
|
|
114
|
+
waitForStop: () => input.stopPromise,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
async function runSmeeMode(input) {
|
|
118
|
+
if (input.deps.gh == null) {
|
|
119
|
+
input.logger.warn('cockpit doorbell: smee-mode requires a gh wrapper; falling through');
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
const gh = input.deps.gh;
|
|
123
|
+
const onEvent = async (event) => {
|
|
124
|
+
await new Promise((resolve) => {
|
|
125
|
+
input.stdout.write(lineForEvent(event), () => resolve());
|
|
126
|
+
});
|
|
127
|
+
if (input.options.exitOnEpicComplete === true &&
|
|
128
|
+
input.form.kind === 'form-1' &&
|
|
129
|
+
event.type === 'epic-complete') {
|
|
130
|
+
input.stop();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const sourceOptions = {
|
|
134
|
+
channelUrl: input.channelUrl,
|
|
135
|
+
epicRef: input.ref,
|
|
136
|
+
gh,
|
|
137
|
+
logger: input.logger,
|
|
138
|
+
onEvent,
|
|
139
|
+
onReconnectAttempt: (n) => input.selector.onReconnectAttempt(n),
|
|
140
|
+
onReconnectSuccess: () => input.selector.onReconnectSuccess(),
|
|
141
|
+
onSseBytes: () => input.selector.onSseBytes(),
|
|
142
|
+
};
|
|
143
|
+
if (input.deps.runner != null)
|
|
144
|
+
sourceOptions.runner = input.deps.runner;
|
|
145
|
+
const source = input.deps.smeeSourceFactory != null
|
|
146
|
+
? input.deps.smeeSourceFactory(sourceOptions)
|
|
147
|
+
: new SmeeDoorbellSource(sourceOptions);
|
|
148
|
+
const outcome = await runStartupRetry({
|
|
149
|
+
task: async () => {
|
|
150
|
+
await source.start();
|
|
151
|
+
return null;
|
|
152
|
+
},
|
|
153
|
+
label: 'resolveEpic',
|
|
154
|
+
rateLimitScheduler: input.deps.rateLimitScheduler ?? noopScheduler(),
|
|
155
|
+
abortSignal: input.retryAbortSignal,
|
|
156
|
+
stderr: process.stderr,
|
|
157
|
+
logger: input.logger,
|
|
158
|
+
});
|
|
159
|
+
if (outcome.kind === 'permanent') {
|
|
160
|
+
return { kind: 'permanent-exit' };
|
|
161
|
+
}
|
|
162
|
+
if (outcome.kind === 'aborted') {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
return { source };
|
|
166
|
+
}
|
|
167
|
+
export async function runDoorbell(positional, options, deps = {}) {
|
|
168
|
+
const stderr = process.stderr;
|
|
169
|
+
const stdout = deps.stdout ?? process.stdout;
|
|
170
|
+
const exit = deps.exit ??
|
|
171
|
+
((code) => {
|
|
172
|
+
process.exit(code);
|
|
173
|
+
});
|
|
174
|
+
const form = classifyForm(positional, options);
|
|
175
|
+
if (form.kind === 'missing-positional') {
|
|
176
|
+
stderr.write('cockpit doorbell: parse issue: issue argument is required\n');
|
|
177
|
+
try {
|
|
178
|
+
exit(2);
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
/* test seam may throw; propagate return */
|
|
182
|
+
}
|
|
183
|
+
return 2;
|
|
184
|
+
}
|
|
185
|
+
if (form.kind === 'conflicting-flags') {
|
|
186
|
+
if (form.reason === 'positional-with-new') {
|
|
187
|
+
stderr.write('cockpit doorbell: --new does not accept a positional argument\n');
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
stderr.write('cockpit doorbell: --tracking and --new are mutually exclusive\n');
|
|
191
|
+
}
|
|
192
|
+
try {
|
|
193
|
+
exit(2);
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
/* test seam may throw; propagate return */
|
|
197
|
+
}
|
|
198
|
+
return 2;
|
|
199
|
+
}
|
|
200
|
+
const logger = deps.logger ?? { warn: (msg) => process.stderr.write(`${msg}\n`) };
|
|
201
|
+
let stopResolve = () => undefined;
|
|
202
|
+
const stopPromise = new Promise((resolve) => {
|
|
203
|
+
stopResolve = resolve;
|
|
204
|
+
});
|
|
205
|
+
let stopped = false;
|
|
206
|
+
// Signal used to abort startup-retry sleeps promptly on shutdown.
|
|
207
|
+
const retryAbortController = new AbortController();
|
|
208
|
+
const stop = () => {
|
|
209
|
+
if (stopped)
|
|
210
|
+
return;
|
|
211
|
+
stopped = true;
|
|
212
|
+
retryAbortController.abort();
|
|
213
|
+
stopResolve();
|
|
214
|
+
};
|
|
215
|
+
const onSignal = () => {
|
|
216
|
+
stop();
|
|
217
|
+
};
|
|
218
|
+
process.once('SIGINT', onSignal);
|
|
219
|
+
process.once('SIGTERM', onSignal);
|
|
220
|
+
const cleanupSignals = () => {
|
|
221
|
+
process.off('SIGINT', onSignal);
|
|
222
|
+
process.off('SIGTERM', onSignal);
|
|
223
|
+
};
|
|
224
|
+
if (deps.abortSignal != null) {
|
|
225
|
+
if (deps.abortSignal.aborted) {
|
|
226
|
+
stop();
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
deps.abortSignal.addEventListener('abort', onSignal, { once: true });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// `armed\n` written before source selection (Q5=A / spec-explicit
|
|
233
|
+
// "unconditional, before source selection"). Preserves the shipped
|
|
234
|
+
// contract with agency#431 — the FR-006 `source=…` line on stderr is the
|
|
235
|
+
// "which source settled" signal.
|
|
236
|
+
await writeLine(stdout, 'armed\n');
|
|
237
|
+
if (form.kind === 'form-3') {
|
|
238
|
+
await stopPromise;
|
|
239
|
+
await drainStdout(stdout);
|
|
240
|
+
cleanupSignals();
|
|
241
|
+
try {
|
|
242
|
+
exit(0);
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
/* test seam may throw */
|
|
246
|
+
}
|
|
247
|
+
return 0;
|
|
248
|
+
}
|
|
249
|
+
const discover = deps.discoverChannel ?? discoverChannelUrl;
|
|
250
|
+
const env = deps.env ?? process.env;
|
|
251
|
+
const fs = deps.fs ?? fsPromises;
|
|
252
|
+
const channelFilePath = deps.channelFilePath ?? DEFAULT_CHANNEL_FILE_PATH;
|
|
253
|
+
// Smee-mode needs a gh wrapper for ref-set resolution and aggregate refreshes.
|
|
254
|
+
// Without one, discovery is wasted work and the code must poll-fallback anyway.
|
|
255
|
+
let discovery = null;
|
|
256
|
+
if (deps.gh != null || deps.discoverChannel != null) {
|
|
257
|
+
let targets = [];
|
|
258
|
+
if (deps.gh != null) {
|
|
259
|
+
try {
|
|
260
|
+
targets = await resolveWebhookTargets({
|
|
261
|
+
epicRef: form.ref,
|
|
262
|
+
gh: deps.gh,
|
|
263
|
+
logger,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
catch {
|
|
267
|
+
targets = [];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const discoveryInput = {
|
|
271
|
+
env,
|
|
272
|
+
channelFilePath,
|
|
273
|
+
fs,
|
|
274
|
+
logger,
|
|
275
|
+
targets,
|
|
276
|
+
runner: deps.runner ?? nodeChildProcessRunner,
|
|
277
|
+
};
|
|
278
|
+
try {
|
|
279
|
+
discovery = await discover(discoveryInput);
|
|
280
|
+
}
|
|
281
|
+
catch {
|
|
282
|
+
discovery = null;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
const selectorOptions = {
|
|
286
|
+
initial: discovery == null ? 'poll-fallback' : 'smee-attempt',
|
|
287
|
+
stderr,
|
|
288
|
+
logger,
|
|
289
|
+
};
|
|
290
|
+
const selector = deps.sourceSelectorFactory != null
|
|
291
|
+
? deps.sourceSelectorFactory(selectorOptions)
|
|
292
|
+
: new SourceSelector(selectorOptions);
|
|
293
|
+
let pollHandle = null;
|
|
294
|
+
let smeeHandle = null;
|
|
295
|
+
const tearDownActiveSource = async () => {
|
|
296
|
+
if (smeeHandle != null) {
|
|
297
|
+
const s = smeeHandle;
|
|
298
|
+
smeeHandle = null;
|
|
299
|
+
await s.source.stop();
|
|
300
|
+
}
|
|
301
|
+
if (pollHandle != null) {
|
|
302
|
+
const p = pollHandle;
|
|
303
|
+
pollHandle = null;
|
|
304
|
+
p.release();
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
// In-flight guard: the startup fall-through calls markStartupSmeeFailed()
|
|
308
|
+
// (which synchronously fires the poll-fallback callback → fire-and-forget
|
|
309
|
+
// startPollMode) and then also awaits startPollMode() directly. Without
|
|
310
|
+
// this guard both would pass the `pollHandle != null` check and create
|
|
311
|
+
// two subscribers on the same bus.
|
|
312
|
+
let pollStartInFlight = null;
|
|
313
|
+
const startPollMode = async () => {
|
|
314
|
+
if (pollHandle != null)
|
|
315
|
+
return 'ok';
|
|
316
|
+
if (pollStartInFlight != null)
|
|
317
|
+
return pollStartInFlight;
|
|
318
|
+
pollStartInFlight = (async () => {
|
|
319
|
+
try {
|
|
320
|
+
const handle = await runPollMode({
|
|
321
|
+
ref: form.ref,
|
|
322
|
+
form,
|
|
323
|
+
options,
|
|
324
|
+
deps,
|
|
325
|
+
logger,
|
|
326
|
+
stdout,
|
|
327
|
+
stderr,
|
|
328
|
+
stopPromise,
|
|
329
|
+
stop,
|
|
330
|
+
retryAbortSignal: retryAbortController.signal,
|
|
331
|
+
});
|
|
332
|
+
if (handle == null)
|
|
333
|
+
return 'transient-fail';
|
|
334
|
+
if ('kind' in handle && handle.kind === 'permanent-exit')
|
|
335
|
+
return 'permanent-exit';
|
|
336
|
+
pollHandle = handle;
|
|
337
|
+
return 'ok';
|
|
338
|
+
}
|
|
339
|
+
finally {
|
|
340
|
+
pollStartInFlight = null;
|
|
341
|
+
}
|
|
342
|
+
})();
|
|
343
|
+
return pollStartInFlight;
|
|
344
|
+
};
|
|
345
|
+
const startSmeeMode = async (url) => {
|
|
346
|
+
if (smeeHandle != null)
|
|
347
|
+
return 'ok';
|
|
348
|
+
const handle = await runSmeeMode({
|
|
349
|
+
ref: form.ref,
|
|
350
|
+
form,
|
|
351
|
+
channelUrl: url,
|
|
352
|
+
options,
|
|
353
|
+
deps,
|
|
354
|
+
logger,
|
|
355
|
+
stdout,
|
|
356
|
+
selector,
|
|
357
|
+
stop,
|
|
358
|
+
retryAbortSignal: retryAbortController.signal,
|
|
359
|
+
});
|
|
360
|
+
if (handle == null)
|
|
361
|
+
return 'transient-fail';
|
|
362
|
+
if ('kind' in handle && handle.kind === 'permanent-exit')
|
|
363
|
+
return 'permanent-exit';
|
|
364
|
+
smeeHandle = handle;
|
|
365
|
+
return 'ok';
|
|
366
|
+
};
|
|
367
|
+
// Signals a permanent-error exit from a mode-change branch that runs
|
|
368
|
+
// fire-and-forget. Consumed once at the outer boundary.
|
|
369
|
+
let permanentExit = false;
|
|
370
|
+
selector.onModeChange((next) => {
|
|
371
|
+
if (next === 'poll-fallback') {
|
|
372
|
+
// Live bridge: keep smeeHandle alive so its runLoop keeps reconnecting
|
|
373
|
+
// in the background; open a poll subscriber alongside so stdout stays
|
|
374
|
+
// hot. Never stop the smee source here.
|
|
375
|
+
void (async () => {
|
|
376
|
+
const outcome = await startPollMode();
|
|
377
|
+
if (outcome === 'permanent-exit') {
|
|
378
|
+
permanentExit = true;
|
|
379
|
+
stop();
|
|
380
|
+
}
|
|
381
|
+
else if (outcome === 'transient-fail')
|
|
382
|
+
stop();
|
|
383
|
+
})();
|
|
384
|
+
}
|
|
385
|
+
else if (next === 'smee-active') {
|
|
386
|
+
// Runtime bridge exit: background smee reconnected. Release the poll
|
|
387
|
+
// subscriber; smee source is already streaming.
|
|
388
|
+
if (pollHandle != null) {
|
|
389
|
+
const p = pollHandle;
|
|
390
|
+
pollHandle = null;
|
|
391
|
+
p.release();
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
else if (next === 'smee-attempt' && discovery != null) {
|
|
395
|
+
void (async () => {
|
|
396
|
+
if (pollHandle != null) {
|
|
397
|
+
const p = pollHandle;
|
|
398
|
+
pollHandle = null;
|
|
399
|
+
p.release();
|
|
400
|
+
}
|
|
401
|
+
const outcome = await startSmeeMode(discovery.url);
|
|
402
|
+
if (outcome === 'permanent-exit') {
|
|
403
|
+
permanentExit = true;
|
|
404
|
+
stop();
|
|
405
|
+
}
|
|
406
|
+
else if (outcome === 'transient-fail') {
|
|
407
|
+
// smee-attempt failed → fall back to poll-mode immediately, without
|
|
408
|
+
// waiting for the demotion counter.
|
|
409
|
+
const pollOutcome = await startPollMode();
|
|
410
|
+
if (pollOutcome === 'permanent-exit') {
|
|
411
|
+
permanentExit = true;
|
|
412
|
+
stop();
|
|
413
|
+
}
|
|
414
|
+
else if (pollOutcome === 'transient-fail')
|
|
415
|
+
stop();
|
|
416
|
+
}
|
|
417
|
+
})();
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
if (discovery != null) {
|
|
421
|
+
const outcome = await startSmeeMode(discovery.url);
|
|
422
|
+
if (outcome === 'permanent-exit') {
|
|
423
|
+
selector.stop();
|
|
424
|
+
cleanupSignals();
|
|
425
|
+
try {
|
|
426
|
+
exit(3);
|
|
427
|
+
}
|
|
428
|
+
catch {
|
|
429
|
+
/* test seam may throw */
|
|
430
|
+
}
|
|
431
|
+
return 3;
|
|
432
|
+
}
|
|
433
|
+
if (outcome === 'transient-fail') {
|
|
434
|
+
selector.markStartupSmeeFailed();
|
|
435
|
+
const pollOutcome = await startPollMode();
|
|
436
|
+
if (pollOutcome === 'permanent-exit') {
|
|
437
|
+
selector.stop();
|
|
438
|
+
cleanupSignals();
|
|
439
|
+
try {
|
|
440
|
+
exit(3);
|
|
441
|
+
}
|
|
442
|
+
catch {
|
|
443
|
+
/* test seam may throw */
|
|
444
|
+
}
|
|
445
|
+
return 3;
|
|
446
|
+
}
|
|
447
|
+
if (pollOutcome === 'transient-fail' && !stopped) {
|
|
448
|
+
selector.stop();
|
|
449
|
+
cleanupSignals();
|
|
450
|
+
try {
|
|
451
|
+
exit(2);
|
|
452
|
+
}
|
|
453
|
+
catch {
|
|
454
|
+
/* test seam may throw */
|
|
455
|
+
}
|
|
456
|
+
return 2;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
const outcome = await startPollMode();
|
|
462
|
+
if (outcome === 'permanent-exit') {
|
|
463
|
+
selector.stop();
|
|
464
|
+
cleanupSignals();
|
|
465
|
+
try {
|
|
466
|
+
exit(3);
|
|
467
|
+
}
|
|
468
|
+
catch {
|
|
469
|
+
/* test seam may throw */
|
|
470
|
+
}
|
|
471
|
+
return 3;
|
|
472
|
+
}
|
|
473
|
+
if (outcome === 'transient-fail' && !stopped) {
|
|
474
|
+
selector.stop();
|
|
475
|
+
cleanupSignals();
|
|
476
|
+
try {
|
|
477
|
+
exit(2);
|
|
478
|
+
}
|
|
479
|
+
catch {
|
|
480
|
+
/* test seam may throw */
|
|
481
|
+
}
|
|
482
|
+
return 2;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
await stopPromise;
|
|
486
|
+
await tearDownActiveSource();
|
|
487
|
+
selector.stop();
|
|
488
|
+
await drainStdout(stdout);
|
|
489
|
+
cleanupSignals();
|
|
490
|
+
const finalCode = permanentExit ? 3 : 0;
|
|
491
|
+
try {
|
|
492
|
+
exit(finalCode);
|
|
493
|
+
}
|
|
494
|
+
catch {
|
|
495
|
+
/* test seam may throw */
|
|
496
|
+
}
|
|
497
|
+
return finalCode;
|
|
498
|
+
}
|
|
499
|
+
export function doorbellCommand() {
|
|
500
|
+
return new Command('doorbell')
|
|
501
|
+
.description('Wake sensor for /cockpit:auto. Emits one stdout line per epic bus event.')
|
|
502
|
+
.argument('[epic-ref]', 'Epic ref (Form 1) or tracking-issue ref (Form 2). Omitted under --new.')
|
|
503
|
+
.option('--tracking', 'Positional is a tracking-issue ref; subscribe the tracking-ref bus.', false)
|
|
504
|
+
.option('--new <title>', 'No subscription; arm as a placeholder before the tracking issue exists.')
|
|
505
|
+
.option('--exit-on-epic-complete', 'Exit 0 after flushing the epic-complete line. Off by default.', false)
|
|
506
|
+
.action(async (epicRef, options) => {
|
|
507
|
+
const runner = nodeChildProcessRunner;
|
|
508
|
+
const cache = createGhResponseCache();
|
|
509
|
+
const rateLimitScheduler = createRateLimitScheduler({ runner });
|
|
510
|
+
const gh = new GhCliWrapper(runner, undefined, { cache, rateLimitScheduler });
|
|
511
|
+
const code = await runDoorbell(epicRef, options, {
|
|
512
|
+
runner,
|
|
513
|
+
gh,
|
|
514
|
+
rateLimitScheduler,
|
|
515
|
+
});
|
|
516
|
+
process.exit(code);
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
//# sourceMappingURL=doorbell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doorbell.js","sourceRoot":"","sources":["../../../../src/cli/commands/cockpit/doorbell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,GAIvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,GAGf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAE1B,MAAM,iCAAiC,CAAC;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wB,EAAE,EAAE;QACtE,MAAM,MAAM,GAAkB,sBAAsB,CAAC;QACrD,MAAM,KAAK,GAAG,qBAAqB,EAAE,CAAC;QACtC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAChE,MAAM,EAAE,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAC9E,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE;YAC/C,MAAM;YACN,EAAE;YACF,kBAAkB;SACnB,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Observability verbs (read-only) for Generacy epics and repos:
|
|
5
5
|
* - watch — poll an epic's issues/PRs and emit cockpit events on state changes
|
|
6
|
+
* - doorbell — wake sensor for /cockpit:auto; one stdout line per epic bus event
|
|
6
7
|
* - status — render a grouped, colorized table of the epic's current state
|
|
7
8
|
*
|
|
8
9
|
* Single-issue verbs that inspect and drive workflow state for one issue:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/cockpit/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/cockpit/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,cAAc,IAAI,OAAO,CAgBxC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Observability verbs (read-only) for Generacy epics and repos:
|
|
5
5
|
* - watch — poll an epic's issues/PRs and emit cockpit events on state changes
|
|
6
|
+
* - doorbell — wake sensor for /cockpit:auto; one stdout line per epic bus event
|
|
6
7
|
* - status — render a grouped, colorized table of the epic's current state
|
|
7
8
|
*
|
|
8
9
|
* Single-issue verbs that inspect and drive workflow state for one issue:
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
*/
|
|
18
19
|
import { Command } from 'commander';
|
|
19
20
|
import { watchCommand } from './watch.js';
|
|
21
|
+
import { doorbellCommand } from './doorbell.js';
|
|
20
22
|
import { statusCommand } from './status.js';
|
|
21
23
|
import { advanceCommand } from './advance.js';
|
|
22
24
|
import { contextCommand } from './context.js';
|
|
@@ -29,6 +31,7 @@ export function cockpitCommand() {
|
|
|
29
31
|
const command = new Command('cockpit');
|
|
30
32
|
command.description('Cockpit — inspect and drive workflow state for Generacy epics and issues.');
|
|
31
33
|
command.addCommand(watchCommand());
|
|
34
|
+
command.addCommand(doorbellCommand());
|
|
32
35
|
command.addCommand(statusCommand());
|
|
33
36
|
command.addCommand(advanceCommand());
|
|
34
37
|
command.addCommand(contextCommand());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/commands/cockpit/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/commands/cockpit/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,UAAU,cAAc;IAC5B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,OAAO,CAAC,WAAW,CAAC,2EAA2E,CAAC,CAAC;IAEjG,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;IACnC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;IACtC,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IACpC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC;IACrC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC;IACrC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC1C,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;IACnC,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IACpC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;IACnC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAExC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -14,16 +14,17 @@
|
|
|
14
14
|
* A soft cap on live buses evicts the least-recently-active on overflow.
|
|
15
15
|
*
|
|
16
16
|
* Env knobs:
|
|
17
|
-
* `COCKPIT_MCP_BUS_IDLE_TTL_MS` — idle-TTL for refcount-0 buses (default
|
|
17
|
+
* `COCKPIT_MCP_BUS_IDLE_TTL_MS` — idle-TTL for refcount-0 buses (default 7_200_000, sourced from the shared `DEFAULT_QUIET_HORIZON_MS` constant in `event-bus.ts`).
|
|
18
18
|
* `COCKPIT_MCP_BUS_MAX` — soft cap on live buses (default 100).
|
|
19
19
|
*/
|
|
20
|
-
import { type CommandRunner, type GhWrapper } from '@generacy-ai/cockpit';
|
|
20
|
+
import { type CommandRunner, type GhWrapper, type RateLimitScheduler } from '@generacy-ai/cockpit';
|
|
21
21
|
import { EpicEventBus } from './event-bus.js';
|
|
22
22
|
export interface AcquireOptions {
|
|
23
23
|
epicRef: string;
|
|
24
24
|
runner?: CommandRunner;
|
|
25
25
|
gh?: GhWrapper;
|
|
26
26
|
intervalMs?: number;
|
|
27
|
+
rateLimitScheduler?: RateLimitScheduler;
|
|
27
28
|
logger?: {
|
|
28
29
|
warn: (msg: string) => void;
|
|
29
30
|
info?: (msg: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus-registry.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/cockpit/mcp/event-bus-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"event-bus-registry.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/cockpit/mcp/event-bus-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,kBAAkB,EAExB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,EAA4B,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAoDxE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;IACvE;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,YAAY,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,CA6J/E;AA8KD;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAM7C"}
|