@proletariat/cli 0.3.102 → 0.3.103
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/lib/orchestrate/engine.d.ts +19 -39
- package/dist/lib/orchestrate/engine.js +51 -215
- package/dist/lib/orchestrate/engine.js.map +1 -1
- package/dist/lib/orchestrate/types.d.ts +3 -11
- package/dist/lib/orchestrate/types.js +1 -2
- package/dist/lib/orchestrate/types.js.map +1 -1
- package/dist/lib/work-lifecycle/hooks/executor.js +2 -0
- package/dist/lib/work-lifecycle/hooks/executor.js.map +1 -1
- package/dist/lib/work-lifecycle/hooks/index.d.ts +5 -3
- package/dist/lib/work-lifecycle/hooks/index.js +3 -2
- package/dist/lib/work-lifecycle/hooks/index.js.map +1 -1
- package/dist/lib/work-lifecycle/hooks/manager.d.ts +93 -8
- package/dist/lib/work-lifecycle/hooks/manager.js +248 -20
- package/dist/lib/work-lifecycle/hooks/manager.js.map +1 -1
- package/dist/lib/work-lifecycle/hooks/storage.d.ts +1 -0
- package/dist/lib/work-lifecycle/hooks/storage.js +28 -6
- package/dist/lib/work-lifecycle/hooks/storage.js.map +1 -1
- package/dist/lib/work-lifecycle/hooks/types.d.ts +37 -0
- package/dist/lib/work-lifecycle/hooks/types.js +2 -0
- package/dist/lib/work-lifecycle/hooks/types.js.map +1 -1
- package/dist/lib/work-lifecycle/index.d.ts +2 -1
- package/dist/lib/work-lifecycle/index.js +1 -1
- package/dist/lib/work-lifecycle/index.js.map +1 -1
- package/oclif.manifest.json +1018 -1018
- package/package.json +1 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Orchestrate Engine
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 2. Subscribes to EventBus events
|
|
7
|
-
* 3. Executes matching hooks with mode-aware behavior
|
|
8
|
-
* 4. Optionally polls external sources for events
|
|
4
|
+
* Thin orchestration layer that configures a HookManager with mode-aware
|
|
5
|
+
* execution, built-in action handlers, and confirmation routing.
|
|
9
6
|
*
|
|
10
|
-
* The engine
|
|
11
|
-
* and
|
|
7
|
+
* The engine itself handles:
|
|
8
|
+
* - Configuring HookManager with the correct callbacks and action handlers
|
|
9
|
+
* - Exposing the OrchestrateActionResult API expected by callers
|
|
10
|
+
* - Start/stop lifecycle management
|
|
11
|
+
*
|
|
12
|
+
* All hook matching, mode checking, and execution is delegated to HookManager.
|
|
12
13
|
*/
|
|
13
14
|
import type Database from 'better-sqlite3';
|
|
14
|
-
import type {
|
|
15
|
+
import type { OrchestrateActionResult } from './types.js';
|
|
15
16
|
export interface OrchestrateEngineOptions {
|
|
16
17
|
/** Database connection */
|
|
17
18
|
db: Database.Database;
|
|
@@ -23,17 +24,11 @@ export interface OrchestrateEngineOptions {
|
|
|
23
24
|
onNotify?: (hookName: string, event: string, action: string, result: OrchestrateActionResult) => void;
|
|
24
25
|
}
|
|
25
26
|
export declare class OrchestrateEngine {
|
|
26
|
-
private
|
|
27
|
-
private hookStorage;
|
|
28
|
-
private unsubscribers;
|
|
29
|
-
private log;
|
|
30
|
-
private onConfirm?;
|
|
31
|
-
private onNotify?;
|
|
27
|
+
private manager;
|
|
32
28
|
private running;
|
|
33
|
-
private pendingConfirmations;
|
|
34
29
|
constructor(options: OrchestrateEngineOptions);
|
|
35
30
|
/**
|
|
36
|
-
* Start the orchestrate engine —
|
|
31
|
+
* Start the orchestrate engine — delegates to HookManager.
|
|
37
32
|
*/
|
|
38
33
|
start(): void;
|
|
39
34
|
/**
|
|
@@ -44,11 +39,17 @@ export declare class OrchestrateEngine {
|
|
|
44
39
|
* Fire an event manually (used by `prlt hook fire`).
|
|
45
40
|
* This is the entry point for external event sources (GitHub Actions, polling, etc.).
|
|
46
41
|
*/
|
|
47
|
-
fireEvent(event: string, ctx:
|
|
42
|
+
fireEvent(event: string, ctx: Record<string, unknown>): Promise<OrchestrateActionResult[]>;
|
|
48
43
|
/**
|
|
49
44
|
* Get pending confirmations for hooks in confirm mode.
|
|
50
45
|
*/
|
|
51
|
-
getPendingConfirmations():
|
|
46
|
+
getPendingConfirmations(): Array<{
|
|
47
|
+
hookName: string;
|
|
48
|
+
event: string;
|
|
49
|
+
action: string;
|
|
50
|
+
ctx: Record<string, unknown>;
|
|
51
|
+
config?: Record<string, unknown>;
|
|
52
|
+
}>;
|
|
52
53
|
/**
|
|
53
54
|
* Approve a pending confirmation and execute it.
|
|
54
55
|
*/
|
|
@@ -57,27 +58,6 @@ export declare class OrchestrateEngine {
|
|
|
57
58
|
* Deny a pending confirmation.
|
|
58
59
|
*/
|
|
59
60
|
denyConfirmation(index: number): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Handle an event by finding and executing matching hooks.
|
|
62
|
-
*/
|
|
63
|
-
private handleEvent;
|
|
64
|
-
/**
|
|
65
|
-
* Get hooks for a given event from the database, ordered by priority.
|
|
66
|
-
*/
|
|
67
|
-
private getHooksForEvent;
|
|
68
|
-
/**
|
|
69
|
-
* Build an OrchestrateEventContext from raw event data.
|
|
70
|
-
*/
|
|
71
|
-
private buildContext;
|
|
72
|
-
/**
|
|
73
|
-
* Resolve the action name from a hook row.
|
|
74
|
-
* Built-in actions are referenced by name; shell hooks use the raw command.
|
|
75
|
-
*/
|
|
76
|
-
private resolveActionName;
|
|
77
|
-
/**
|
|
78
|
-
* Execute an action — either built-in or shell fallback.
|
|
79
|
-
*/
|
|
80
|
-
private executeAction;
|
|
81
61
|
}
|
|
82
62
|
/**
|
|
83
63
|
* Initialize and start the orchestrate engine.
|
|
@@ -1,263 +1,99 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Orchestrate Engine
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 2. Subscribes to EventBus events
|
|
7
|
-
* 3. Executes matching hooks with mode-aware behavior
|
|
8
|
-
* 4. Optionally polls external sources for events
|
|
4
|
+
* Thin orchestration layer that configures a HookManager with mode-aware
|
|
5
|
+
* execution, built-in action handlers, and confirmation routing.
|
|
9
6
|
*
|
|
10
|
-
* The engine
|
|
11
|
-
* and
|
|
7
|
+
* The engine itself handles:
|
|
8
|
+
* - Configuring HookManager with the correct callbacks and action handlers
|
|
9
|
+
* - Exposing the OrchestrateActionResult API expected by callers
|
|
10
|
+
* - Start/stop lifecycle management
|
|
11
|
+
*
|
|
12
|
+
* All hook matching, mode checking, and execution is delegated to HookManager.
|
|
12
13
|
*/
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { WorkHookStorage } from '../work-lifecycle/hooks/storage.js';
|
|
16
|
-
import { executeBuiltinAction, ACTION_HANDLERS } from './actions.js';
|
|
14
|
+
import { HookManager } from '../work-lifecycle/hooks/manager.js';
|
|
15
|
+
import { ACTION_HANDLERS } from './actions.js';
|
|
17
16
|
export class OrchestrateEngine {
|
|
18
|
-
|
|
19
|
-
hookStorage;
|
|
20
|
-
unsubscribers = [];
|
|
21
|
-
log;
|
|
22
|
-
onConfirm;
|
|
23
|
-
onNotify;
|
|
17
|
+
manager;
|
|
24
18
|
running = false;
|
|
25
|
-
pendingConfirmations = [];
|
|
26
19
|
constructor(options) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
// Map OrchestrateActionResult-based onNotify to HookExecutionResult-based onNotify
|
|
21
|
+
const onNotify = options.onNotify
|
|
22
|
+
? (hookName, event, action, result) => {
|
|
23
|
+
options.onNotify(hookName, event, action, toActionResult(result));
|
|
24
|
+
}
|
|
25
|
+
: undefined;
|
|
26
|
+
this.manager = new HookManager({
|
|
27
|
+
db: options.db,
|
|
28
|
+
log: options.log,
|
|
29
|
+
onConfirm: options.onConfirm,
|
|
30
|
+
onNotify,
|
|
31
|
+
actionHandlers: ACTION_HANDLERS,
|
|
32
|
+
});
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
|
-
* Start the orchestrate engine —
|
|
35
|
+
* Start the orchestrate engine — delegates to HookManager.
|
|
35
36
|
*/
|
|
36
37
|
start() {
|
|
37
38
|
if (this.running)
|
|
38
39
|
return;
|
|
39
40
|
this.running = true;
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
'work:started',
|
|
44
|
-
'work:status_changed',
|
|
45
|
-
'work:pr_created',
|
|
46
|
-
'work:pr_merged',
|
|
47
|
-
'work:pr_closed',
|
|
48
|
-
'work:completed',
|
|
49
|
-
'agent:spawned',
|
|
50
|
-
'agent:stopped',
|
|
51
|
-
];
|
|
52
|
-
for (const eventName of standardEvents) {
|
|
53
|
-
this.unsubscribers.push(bus.on(eventName, (payload) => {
|
|
54
|
-
void this.handleEvent(eventName, payload);
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
this.log('[orchestrate] Engine started, listening for events');
|
|
41
|
+
this.manager.start();
|
|
42
|
+
// Log is internal to the manager, but we can't access it here easily.
|
|
43
|
+
// The manager's log callback will handle logging.
|
|
58
44
|
}
|
|
59
45
|
/**
|
|
60
46
|
* Stop the engine and clean up subscriptions.
|
|
61
47
|
*/
|
|
62
48
|
stop() {
|
|
63
49
|
this.running = false;
|
|
64
|
-
|
|
65
|
-
unsub();
|
|
66
|
-
}
|
|
67
|
-
this.unsubscribers = [];
|
|
68
|
-
this.pendingConfirmations = [];
|
|
69
|
-
this.log('[orchestrate] Engine stopped');
|
|
50
|
+
this.manager.stop();
|
|
70
51
|
}
|
|
71
52
|
/**
|
|
72
53
|
* Fire an event manually (used by `prlt hook fire`).
|
|
73
54
|
* This is the entry point for external event sources (GitHub Actions, polling, etc.).
|
|
74
55
|
*/
|
|
75
56
|
async fireEvent(event, ctx) {
|
|
76
|
-
|
|
57
|
+
const results = await this.manager.fireEvent(event, ctx);
|
|
58
|
+
return results.map(toActionResult);
|
|
77
59
|
}
|
|
78
60
|
/**
|
|
79
61
|
* Get pending confirmations for hooks in confirm mode.
|
|
80
62
|
*/
|
|
81
63
|
getPendingConfirmations() {
|
|
82
|
-
return
|
|
64
|
+
return this.manager.getPendingConfirmations();
|
|
83
65
|
}
|
|
84
66
|
/**
|
|
85
67
|
* Approve a pending confirmation and execute it.
|
|
86
68
|
*/
|
|
87
69
|
async approveConfirmation(index) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const pending = this.pendingConfirmations.splice(index, 1)[0];
|
|
91
|
-
const result = executeBuiltinAction(pending.action, pending.ctx, pending.config);
|
|
92
|
-
this.log(`[orchestrate] Approved: ${pending.hookName} → ${pending.action} (${result.success ? 'success' : 'failed'})`);
|
|
93
|
-
return result;
|
|
70
|
+
const result = await this.manager.approveConfirmation(index);
|
|
71
|
+
return result ? toActionResult(result) : null;
|
|
94
72
|
}
|
|
95
73
|
/**
|
|
96
74
|
* Deny a pending confirmation.
|
|
97
75
|
*/
|
|
98
76
|
denyConfirmation(index) {
|
|
99
|
-
|
|
100
|
-
return false;
|
|
101
|
-
const pending = this.pendingConfirmations.splice(index, 1)[0];
|
|
102
|
-
this.log(`[orchestrate] Denied: ${pending.hookName} → ${pending.action}`);
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
// ===========================================================================
|
|
106
|
-
// Private
|
|
107
|
-
// ===========================================================================
|
|
108
|
-
/**
|
|
109
|
-
* Handle an event by finding and executing matching hooks.
|
|
110
|
-
*/
|
|
111
|
-
async handleEvent(eventName, eventData) {
|
|
112
|
-
const results = [];
|
|
113
|
-
try {
|
|
114
|
-
// Query hooks matching this event, ordered by priority
|
|
115
|
-
const hooks = this.getHooksForEvent(eventName);
|
|
116
|
-
if (hooks.length === 0)
|
|
117
|
-
return results;
|
|
118
|
-
// Build event context from the payload
|
|
119
|
-
const ctx = this.buildContext(eventName, eventData);
|
|
120
|
-
for (const hook of hooks) {
|
|
121
|
-
const mode = (hook.mode || 'auto');
|
|
122
|
-
const config = hook.config ? JSON.parse(hook.config) : undefined;
|
|
123
|
-
// Determine action — either a built-in action name or the raw action_value
|
|
124
|
-
const actionName = this.resolveActionName(hook);
|
|
125
|
-
if (mode === 'off') {
|
|
126
|
-
results.push({ action: actionName, success: true, durationMs: 0, skipped: true });
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
if (mode === 'confirm') {
|
|
130
|
-
// Queue for confirmation
|
|
131
|
-
if (this.onConfirm) {
|
|
132
|
-
const approved = await this.onConfirm(hook.name, eventName, actionName);
|
|
133
|
-
if (!approved) {
|
|
134
|
-
this.log(`[orchestrate] Skipped (not confirmed): ${hook.name} → ${actionName}`);
|
|
135
|
-
results.push({ action: actionName, success: true, durationMs: 0, skipped: true });
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
// No confirm handler — queue for later approval
|
|
141
|
-
this.pendingConfirmations.push({
|
|
142
|
-
hookName: hook.name,
|
|
143
|
-
event: eventName,
|
|
144
|
-
action: actionName,
|
|
145
|
-
ctx,
|
|
146
|
-
config,
|
|
147
|
-
});
|
|
148
|
-
this.log(`[orchestrate] Queued for confirmation: ${hook.name} → ${actionName}`);
|
|
149
|
-
results.push({ action: actionName, success: true, durationMs: 0, awaitingConfirmation: true });
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
// Execute the action
|
|
154
|
-
const result = this.executeAction(actionName, ctx, config);
|
|
155
|
-
results.push(result);
|
|
156
|
-
this.log(`[orchestrate] ${hook.name} → ${actionName}: ${result.success ? 'success' : `failed: ${result.error}`} (${result.durationMs}ms)`);
|
|
157
|
-
// For notify mode, also fire the notification callback
|
|
158
|
-
if (mode === 'notify' && this.onNotify) {
|
|
159
|
-
this.onNotify(hook.name, eventName, actionName, result);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
catch (err) {
|
|
164
|
-
this.log(`[orchestrate] Error handling event ${eventName}: ${err instanceof Error ? err.message : String(err)}`);
|
|
165
|
-
}
|
|
166
|
-
return results;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Get hooks for a given event from the database, ordered by priority.
|
|
170
|
-
*/
|
|
171
|
-
getHooksForEvent(eventName) {
|
|
172
|
-
try {
|
|
173
|
-
return this.db.prepare(`
|
|
174
|
-
SELECT id, name, event, action_type, action_value, enabled, description, mode, priority, config
|
|
175
|
-
FROM pmo_work_hooks
|
|
176
|
-
WHERE event = ? AND enabled = 1
|
|
177
|
-
ORDER BY priority ASC, created_at ASC
|
|
178
|
-
`).all(eventName);
|
|
179
|
-
}
|
|
180
|
-
catch {
|
|
181
|
-
// Fallback without mode/priority columns (pre-migration)
|
|
182
|
-
try {
|
|
183
|
-
const basic = this.db.prepare(`
|
|
184
|
-
SELECT id, name, event, action_type, action_value, enabled, description
|
|
185
|
-
FROM pmo_work_hooks
|
|
186
|
-
WHERE event = ? AND enabled = 1
|
|
187
|
-
ORDER BY created_at ASC
|
|
188
|
-
`).all(eventName);
|
|
189
|
-
return basic;
|
|
190
|
-
}
|
|
191
|
-
catch {
|
|
192
|
-
return [];
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Build an OrchestrateEventContext from raw event data.
|
|
198
|
-
*/
|
|
199
|
-
buildContext(eventName, data) {
|
|
200
|
-
return {
|
|
201
|
-
event: eventName,
|
|
202
|
-
ticket: (data.ticketId ?? data.workItemId ?? data.ticket),
|
|
203
|
-
pr: (data.prNumber ?? data.pr),
|
|
204
|
-
branch: data.branch,
|
|
205
|
-
agent: (data.agentName ?? data.agent ?? data.sessionId),
|
|
206
|
-
container: data.containerId,
|
|
207
|
-
executionId: data.executionId,
|
|
208
|
-
prUrl: data.prUrl,
|
|
209
|
-
projectId: data.projectId,
|
|
210
|
-
...data,
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Resolve the action name from a hook row.
|
|
215
|
-
* Built-in actions are referenced by name; shell hooks use the raw command.
|
|
216
|
-
*/
|
|
217
|
-
resolveActionName(hook) {
|
|
218
|
-
// If the action_value starts with "prlt hook fire", extract the --action value
|
|
219
|
-
const actionMatch = hook.action_value.match(/--action\s+(\S+)/);
|
|
220
|
-
if (actionMatch)
|
|
221
|
-
return actionMatch[1];
|
|
222
|
-
// If it's a known built-in action name directly
|
|
223
|
-
if (ACTION_HANDLERS[hook.action_value])
|
|
224
|
-
return hook.action_value;
|
|
225
|
-
// Otherwise it's a raw shell command — use the action_value as-is
|
|
226
|
-
return hook.action_value;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Execute an action — either built-in or shell fallback.
|
|
230
|
-
*/
|
|
231
|
-
executeAction(actionName, ctx, config) {
|
|
232
|
-
// Try built-in action first
|
|
233
|
-
if (ACTION_HANDLERS[actionName]) {
|
|
234
|
-
return executeBuiltinAction(actionName, ctx, config);
|
|
235
|
-
}
|
|
236
|
-
// Fallback to shell execution
|
|
237
|
-
const start = Date.now();
|
|
238
|
-
try {
|
|
239
|
-
const env = {
|
|
240
|
-
...process.env,
|
|
241
|
-
PRLT_HOOK_EVENT: ctx.event,
|
|
242
|
-
PRLT_HOOK_TICKET: ctx.ticket ?? '',
|
|
243
|
-
PRLT_HOOK_PR: ctx.pr ? String(ctx.pr) : '',
|
|
244
|
-
PRLT_HOOK_BRANCH: ctx.branch ?? '',
|
|
245
|
-
PRLT_HOOK_AGENT: ctx.agent ?? '',
|
|
246
|
-
};
|
|
247
|
-
execSync(actionName, { env, timeout: 30_000, stdio: 'pipe' });
|
|
248
|
-
return { action: actionName, success: true, durationMs: Date.now() - start };
|
|
249
|
-
}
|
|
250
|
-
catch (err) {
|
|
251
|
-
return {
|
|
252
|
-
action: actionName,
|
|
253
|
-
success: false,
|
|
254
|
-
error: err instanceof Error ? err.message : String(err),
|
|
255
|
-
durationMs: Date.now() - start,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
77
|
+
return this.manager.denyConfirmation(index);
|
|
258
78
|
}
|
|
259
79
|
}
|
|
260
80
|
// =============================================================================
|
|
81
|
+
// Result Mapping
|
|
82
|
+
// =============================================================================
|
|
83
|
+
/**
|
|
84
|
+
* Convert a HookExecutionResult to an OrchestrateActionResult.
|
|
85
|
+
*/
|
|
86
|
+
function toActionResult(result) {
|
|
87
|
+
return {
|
|
88
|
+
action: result.action,
|
|
89
|
+
success: result.success,
|
|
90
|
+
error: result.error,
|
|
91
|
+
durationMs: result.durationMs,
|
|
92
|
+
skipped: result.skipped,
|
|
93
|
+
awaitingConfirmation: result.awaitingConfirmation,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
// =============================================================================
|
|
261
97
|
// Singleton
|
|
262
98
|
// =============================================================================
|
|
263
99
|
let _engine;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../../src/lib/orchestrate/engine.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../../src/lib/orchestrate/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAoB9C,MAAM,OAAO,iBAAiB;IACpB,OAAO,CAAa;IACpB,OAAO,GAAG,KAAK,CAAA;IAEvB,YAAY,OAAiC;QAC3C,mFAAmF;QACnF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ;YAC/B,CAAC,CAAC,CAAC,QAAgB,EAAE,KAAa,EAAE,MAAc,EAAE,MAA2B,EAAE,EAAE;gBAC/E,OAAO,CAAC,QAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;YACpE,CAAC;YACH,CAAC,CAAC,SAAS,CAAA;QAEb,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC;YAC7B,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC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,OAAO;QACvB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;KAClD,CAAA;AACH,CAAC;AAED,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,IAAI,OAAsC,CAAA;AAE1C;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAiC;IACrE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAA;QACxC,OAAO,CAAC,KAAK,EAAE,CAAA;IACjB,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,EAAE,CAAA;QACd,OAAO,GAAG,SAAS,CAAA;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -12,17 +12,9 @@
|
|
|
12
12
|
export type OrchestrateEvent = 'work:started' | 'work:status_changed' | 'work:pr_created' | 'work:pr_merged' | 'work:pr_closed' | 'work:completed' | 'agent:spawned' | 'agent:stopped' | 'on_ci_green' | 'on_ci_failed' | 'on_pr_opened' | 'on_pr_merged' | 'on_pr_conflicting' | 'on_ticket_ready' | 'on_agent_spawned' | 'on_agent_died' | 'on_agent_completed' | 'on_agent_idle' | 'on_version_published';
|
|
13
13
|
/** All valid orchestrate event names. */
|
|
14
14
|
export declare const ORCHESTRATE_EVENTS: OrchestrateEvent[];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* - auto: fires immediately, no human needed
|
|
19
|
-
* - confirm: pauses, notifies, waits for approval
|
|
20
|
-
* - notify: fires but also pings (log, Slack, dashboard)
|
|
21
|
-
* - off: disabled
|
|
22
|
-
*/
|
|
23
|
-
export type HookMode = 'auto' | 'confirm' | 'notify' | 'off';
|
|
24
|
-
/** All valid hook modes. */
|
|
25
|
-
export declare const HOOK_MODES: HookMode[];
|
|
15
|
+
import type { HookMode as _HookMode } from '../work-lifecycle/hooks/types.js';
|
|
16
|
+
export type HookMode = _HookMode;
|
|
17
|
+
export { HOOK_MODES } from '../work-lifecycle/hooks/types.js';
|
|
26
18
|
/**
|
|
27
19
|
* Built-in orchestrate actions.
|
|
28
20
|
* These are first-class actions the daemon knows how to execute natively.
|
|
@@ -27,8 +27,7 @@ export const ORCHESTRATE_EVENTS = [
|
|
|
27
27
|
'on_agent_idle',
|
|
28
28
|
'on_version_published',
|
|
29
29
|
];
|
|
30
|
-
|
|
31
|
-
export const HOOK_MODES = ['auto', 'confirm', 'notify', 'off'];
|
|
30
|
+
export { HOOK_MODES } from '../work-lifecycle/hooks/types.js';
|
|
32
31
|
/** All valid built-in action names. */
|
|
33
32
|
export const BUILTIN_ACTIONS = [
|
|
34
33
|
'merge-pr',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/orchestrate/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiCH,yCAAyC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAuB;IACpD,cAAc;IACd,qBAAqB;IACrB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,eAAe;IACf,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,mBAAmB;IACnB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,oBAAoB;IACpB,eAAe;IACf,sBAAsB;CACvB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/orchestrate/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiCH,yCAAyC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAuB;IACpD,cAAc;IACd,qBAAqB;IACrB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,eAAe;IACf,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,mBAAmB;IACnB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,oBAAoB;IACpB,eAAe;IACf,sBAAsB;CACvB,CAAA;AASD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAsB7D,uCAAuC;AACvC,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,UAAU;IACV,aAAa;IACb,wBAAwB;IACxB,aAAa;IACb,SAAS;IACT,QAAQ;IACR,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,kBAAkB;CACnB,CAAA;AAmDD,8BAA8B;AAC9B,MAAM,CAAC,MAAM,YAAY,GAAiB,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC,CAAA"}
|
|
@@ -85,6 +85,7 @@ export function executeHook(hook, eventName, eventData) {
|
|
|
85
85
|
return {
|
|
86
86
|
hookId: hook.id,
|
|
87
87
|
hookName: hook.name,
|
|
88
|
+
action: hook.actionValue,
|
|
88
89
|
success: true,
|
|
89
90
|
durationMs: Date.now() - start,
|
|
90
91
|
};
|
|
@@ -93,6 +94,7 @@ export function executeHook(hook, eventName, eventData) {
|
|
|
93
94
|
return {
|
|
94
95
|
hookId: hook.id,
|
|
95
96
|
hookName: hook.name,
|
|
97
|
+
action: hook.actionValue,
|
|
96
98
|
success: false,
|
|
97
99
|
error: err instanceof Error ? err.message : String(err),
|
|
98
100
|
durationMs: Date.now() - start,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/lib/work-lifecycle/hooks/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG7C;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AAE,IAAI,CAAC,EAAE;YACf,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,MAAM,EAAE,IAAI,CAAC,WAAW;YACxB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;YACvD,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;SAC/B,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Configurable event-driven actions for work lifecycle events.
|
|
5
5
|
* Hooks subscribe to the EventBus and execute user-configured
|
|
6
|
-
* actions (shell commands, webhooks, log messages
|
|
6
|
+
* actions (shell commands, webhooks, log messages, built-in actions)
|
|
7
|
+
* when events fire, with mode-aware behavior (auto/confirm/notify/off).
|
|
7
8
|
*/
|
|
8
|
-
export type { HookableEvent, HookActionType, WorkHookConfig, WorkHookRow, HookExecutionResult, } from './types.js';
|
|
9
|
-
export { HOOKABLE_EVENTS } from './types.js';
|
|
9
|
+
export type { HookableEvent, HookActionType, HookMode, WorkHookConfig, WorkHookRow, HookExecutionResult, HookActionHandler, } from './types.js';
|
|
10
|
+
export { HOOKABLE_EVENTS, HOOK_MODES } from './types.js';
|
|
10
11
|
export { WorkHookStorage, HOOKS_TABLE, HOOKS_TABLE_SCHEMA, HOOKS_TABLE_INDEX, ensureHooksTable, } from './storage.js';
|
|
11
12
|
export { executeHook } from './executor.js';
|
|
12
13
|
export { HookManager, initHookManager, stopHookManager, } from './manager.js';
|
|
14
|
+
export type { HookManagerOptions } from './manager.js';
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Configurable event-driven actions for work lifecycle events.
|
|
5
5
|
* Hooks subscribe to the EventBus and execute user-configured
|
|
6
|
-
* actions (shell commands, webhooks, log messages
|
|
6
|
+
* actions (shell commands, webhooks, log messages, built-in actions)
|
|
7
|
+
* when events fire, with mode-aware behavior (auto/confirm/notify/off).
|
|
7
8
|
*/
|
|
8
|
-
export { HOOKABLE_EVENTS } from './types.js';
|
|
9
|
+
export { HOOKABLE_EVENTS, HOOK_MODES } from './types.js';
|
|
9
10
|
export { WorkHookStorage, HOOKS_TABLE, HOOKS_TABLE_SCHEMA, HOOKS_TABLE_INDEX, ensureHooksTable, } from './storage.js';
|
|
10
11
|
export { executeHook } from './executor.js';
|
|
11
12
|
export { HookManager, initHookManager, stopHookManager, } from './manager.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/work-lifecycle/hooks/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/work-lifecycle/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAExD,OAAO,EACL,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,cAAc,CAAA"}
|