@exaudeus/workrail 3.73.0 → 3.73.2
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/worktrain-daemon.d.ts +7 -0
- package/dist/cli/commands/worktrain-daemon.js +29 -7
- package/dist/cli-worktrain.js +11 -0
- package/dist/console-ui/assets/{index-HnM-KywY.js → index-CfI4I3OX.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/manifest.json +73 -57
- package/dist/mcp/handlers/v2-advance-core/index.d.ts +1 -0
- package/dist/mcp/handlers/v2-advance-core/index.js +3 -3
- package/dist/mcp/handlers/v2-advance-core/outcome-success.js +3 -28
- package/dist/mcp/handlers/v2-advance-events.d.ts +1 -1
- package/dist/mcp/handlers/v2-advance-events.js +1 -1
- package/dist/mcp/handlers/v2-execution/advance.d.ts +1 -0
- package/dist/mcp/handlers/v2-execution/advance.js +3 -3
- package/dist/mcp/handlers/v2-execution/continue-advance.d.ts +1 -0
- package/dist/mcp/handlers/v2-execution/continue-advance.js +2 -1
- package/dist/mcp/handlers/v2-execution/index.js +3 -1
- package/dist/mcp/server.js +6 -4
- package/dist/mcp/types.d.ts +2 -0
- package/dist/trigger/delivery-action.d.ts +1 -0
- package/dist/trigger/delivery-action.js +1 -1
- package/dist/trigger/delivery-pipeline.d.ts +13 -2
- package/dist/trigger/delivery-pipeline.js +58 -3
- package/dist/trigger/trigger-router.js +6 -3
- package/dist/v2/durable-core/constants.d.ts +1 -0
- package/dist/v2/durable-core/constants.js +1 -0
- package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +202 -0
- package/dist/v2/durable-core/schemas/session/events.d.ts +56 -0
- package/dist/v2/durable-core/schemas/session/events.js +8 -0
- package/dist/v2/infra/local/git-snapshot/index.d.ts +6 -0
- package/dist/v2/infra/local/git-snapshot/index.js +39 -0
- package/dist/v2/ports/git-snapshot.port.d.ts +10 -0
- package/dist/v2/ports/git-snapshot.port.js +9 -0
- package/dist/v2/projections/session-metrics.js +17 -2
- package/docs/design/engine-boundary-discovery.md +123 -0
- package/docs/design/engine-boundary-review-findings.md +72 -0
- package/docs/ideas/backlog.md +3178 -542
- package/docs/roadmap/open-work-inventory.md +12 -0
- package/package.json +2 -1
|
@@ -21,6 +21,7 @@ export interface WorktrainDaemonCommandDeps {
|
|
|
21
21
|
}>;
|
|
22
22
|
readonly print: (line: string) => void;
|
|
23
23
|
readonly sleep: (ms: number) => Promise<void>;
|
|
24
|
+
readonly httpGet: (url: string) => Promise<number | null>;
|
|
24
25
|
readonly startDaemon?: () => Promise<void>;
|
|
25
26
|
}
|
|
26
27
|
export interface WorktrainDaemonCommandOpts {
|
|
@@ -30,5 +31,11 @@ export interface WorktrainDaemonCommandOpts {
|
|
|
30
31
|
readonly start?: boolean;
|
|
31
32
|
readonly stop?: boolean;
|
|
32
33
|
}
|
|
34
|
+
export declare function pollHealthEndpoint(url: string, deps: Pick<WorktrainDaemonCommandDeps, 'httpGet' | 'sleep'>, maxAttempts: number, intervalMs: number): Promise<{
|
|
35
|
+
readonly ok: true;
|
|
36
|
+
} | {
|
|
37
|
+
readonly ok: false;
|
|
38
|
+
readonly reason: string;
|
|
39
|
+
}>;
|
|
33
40
|
export declare function parseDotEnv(content: string): Record<string, string>;
|
|
34
41
|
export declare function executeWorktrainDaemonCommand(deps: WorktrainDaemonCommandDeps, opts: WorktrainDaemonCommandOpts): Promise<CliResult>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pollHealthEndpoint = pollHealthEndpoint;
|
|
3
4
|
exports.parseDotEnv = parseDotEnv;
|
|
4
5
|
exports.executeWorktrainDaemonCommand = executeWorktrainDaemonCommand;
|
|
5
6
|
const cli_result_js_1 = require("../types/cli-result.js");
|
|
@@ -12,6 +13,7 @@ const CAPTURED_ENV_VARS = [
|
|
|
12
13
|
'HOME',
|
|
13
14
|
'USER',
|
|
14
15
|
'PATH',
|
|
16
|
+
'WORKRAIL_TRIGGER_PORT',
|
|
15
17
|
'WORKRAIL_DEV',
|
|
16
18
|
'WORKRAIL_LOG_LEVEL',
|
|
17
19
|
'WORKRAIL_VERBOSE_LOGGING',
|
|
@@ -106,6 +108,19 @@ function parseLaunchctlList(stdout, exitCode) {
|
|
|
106
108
|
return { running: false, pid: null, loaded: false };
|
|
107
109
|
}
|
|
108
110
|
}
|
|
111
|
+
async function pollHealthEndpoint(url, deps, maxAttempts, intervalMs) {
|
|
112
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
113
|
+
await deps.sleep(intervalMs);
|
|
114
|
+
const status = await deps.httpGet(url);
|
|
115
|
+
if (status === 200) {
|
|
116
|
+
return { ok: true };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
ok: false,
|
|
121
|
+
reason: `Health endpoint did not respond after ${maxAttempts} attempts (${(maxAttempts * intervalMs) / 1000}s).`,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
109
124
|
async function runInstall(deps) {
|
|
110
125
|
const home = deps.homedir();
|
|
111
126
|
const plistDir = deps.joinPath(home, 'Library', 'LaunchAgents');
|
|
@@ -285,15 +300,22 @@ async function runStart(deps) {
|
|
|
285
300
|
if (result.exitCode !== 0) {
|
|
286
301
|
return (0, cli_result_js_1.failure)(`launchctl start failed (exit ${result.exitCode}): ${result.stderr.trim() || result.stdout.trim()}`, { suggestions: [`View logs: tail -f ${logDir}/daemon.stderr.log`] });
|
|
287
302
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
303
|
+
const port = deps.env['WORKRAIL_TRIGGER_PORT']
|
|
304
|
+
? parseInt(deps.env['WORKRAIL_TRIGGER_PORT'], 10)
|
|
305
|
+
: 3200;
|
|
306
|
+
const healthUrl = `http://127.0.0.1:${port}/health`;
|
|
307
|
+
const poll = await pollHealthEndpoint(healthUrl, deps, 10, 500);
|
|
308
|
+
if (poll.ok) {
|
|
309
|
+
deps.print('Daemon started successfully.');
|
|
293
310
|
deps.print(`Logs: ${logDir}/daemon.stdout.log`);
|
|
294
|
-
return (0, cli_result_js_1.success)({ message:
|
|
311
|
+
return (0, cli_result_js_1.success)({ message: 'Daemon started successfully' });
|
|
295
312
|
}
|
|
296
|
-
return (0, cli_result_js_1.failure)(
|
|
313
|
+
return (0, cli_result_js_1.failure)(`Daemon did not respond to health check at ${healthUrl} within 5 seconds.`, {
|
|
314
|
+
suggestions: [
|
|
315
|
+
`View logs: tail -f ${logDir}/daemon.stderr.log`,
|
|
316
|
+
`Check daemon status: worktrain daemon --status`,
|
|
317
|
+
],
|
|
318
|
+
});
|
|
297
319
|
}
|
|
298
320
|
async function runStop(deps) {
|
|
299
321
|
const result = await deps.exec('launchctl', ['stop', LAUNCHD_LABEL]);
|
package/dist/cli-worktrain.js
CHANGED
|
@@ -287,6 +287,17 @@ program
|
|
|
287
287
|
},
|
|
288
288
|
print: (line) => console.log(line),
|
|
289
289
|
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
290
|
+
httpGet: async (url) => {
|
|
291
|
+
const { get } = await Promise.resolve().then(() => __importStar(require('http')));
|
|
292
|
+
return new Promise((resolve) => {
|
|
293
|
+
const req = get(url, { timeout: 1000 }, (res) => {
|
|
294
|
+
res.resume();
|
|
295
|
+
resolve(res.statusCode ?? null);
|
|
296
|
+
});
|
|
297
|
+
req.on('error', () => resolve(null));
|
|
298
|
+
req.on('timeout', () => { req.destroy(); resolve(null); });
|
|
299
|
+
});
|
|
300
|
+
},
|
|
290
301
|
startDaemon: async () => {
|
|
291
302
|
await (0, daemon_env_js_1.loadDaemonEnv)();
|
|
292
303
|
const { startTriggerListener } = await Promise.resolve().then(() => __importStar(require('./trigger/trigger-listener.js')));
|