@exaudeus/workrail 3.45.0 → 3.47.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/index.d.ts +1 -0
- package/dist/cli/commands/index.js +3 -1
- package/dist/cli/commands/worktrain-pipeline.d.ts +17 -0
- package/dist/cli/commands/worktrain-pipeline.js +121 -0
- package/dist/console-ui/assets/{index-BpanIvmi.js → index-B77l3WBR.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/coordinators/adaptive-pipeline.d.ts +57 -0
- package/dist/coordinators/adaptive-pipeline.js +104 -0
- package/dist/coordinators/modes/full-pipeline.d.ts +4 -0
- package/dist/coordinators/modes/full-pipeline.js +256 -0
- package/dist/coordinators/modes/implement-shared.d.ts +5 -0
- package/dist/coordinators/modes/implement-shared.js +205 -0
- package/dist/coordinators/modes/implement.d.ts +3 -0
- package/dist/coordinators/modes/implement.js +108 -0
- package/dist/coordinators/modes/quick-review.d.ts +3 -0
- package/dist/coordinators/modes/quick-review.js +37 -0
- package/dist/coordinators/modes/review-only.d.ts +2 -0
- package/dist/coordinators/modes/review-only.js +28 -0
- package/dist/coordinators/routing/route-task.d.ts +21 -0
- package/dist/coordinators/routing/route-task.js +55 -0
- package/dist/manifest.json +107 -35
- package/dist/mcp/output-schemas.d.ts +16 -16
- package/dist/trigger/adapters/github-queue-poller.js +10 -7
- package/dist/trigger/github-queue-config.d.ts +1 -0
- package/dist/trigger/github-queue-config.js +9 -0
- package/dist/trigger/polling-scheduler.js +8 -1
- package/dist/trigger/trigger-listener.js +296 -1
- package/dist/trigger/trigger-router.d.ts +6 -1
- package/dist/trigger/trigger-router.js +26 -1
- package/dist/trigger/trigger-store.js +10 -0
- package/dist/trigger/types.d.ts +2 -0
- package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.d.ts +29 -0
- package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.js +26 -0
- package/dist/v2/durable-core/schemas/artifacts/index.d.ts +2 -1
- package/dist/v2/durable-core/schemas/artifacts/index.js +7 -1
- package/dist/v2/durable-core/schemas/artifacts/review-verdict.d.ts +5 -0
- package/dist/v2/durable-core/schemas/artifacts/review-verdict.js +12 -0
- package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +8 -8
- package/docs/design/connect-adaptive-dispatch-candidates.md +153 -0
- package/docs/design/connect-adaptive-dispatch-design-review.md +88 -0
- package/docs/design/connect-adaptive-dispatch-implementation-plan.md +209 -0
- package/docs/design/queue-label-support-candidates.md +83 -0
- package/docs/design/queue-label-support-design-review.md +62 -0
- package/docs/design/queue-label-support-implementation-plan.md +158 -0
- package/docs/ideas/backlog.md +160 -0
- package/package.json +1 -1
- package/workflows/mr-review-workflow.agentic.v2.json +1 -1
|
@@ -13,3 +13,4 @@ export { executeWorktrainSpawnCommand, type WorktrainSpawnCommandDeps, type Work
|
|
|
13
13
|
export { executeWorktrainAwaitCommand, parseDurationMs, type WorktrainAwaitCommandDeps, type WorktrainAwaitCommandOpts, type SessionOutcome, type SessionResult, type AwaitResult, } from './worktrain-await.js';
|
|
14
14
|
export { executeWorktrainDaemonCommand, type WorktrainDaemonCommandDeps, type WorktrainDaemonCommandOpts, } from './worktrain-daemon.js';
|
|
15
15
|
export { executeWorktrainOverviewCommand, buildConsoleServiceFromDataDir, type WorktrainOverviewCommandDeps, type WorktrainOverviewCommandOpts, type StatusDataPacket, type StatusSession, } from './worktrain-overview.js';
|
|
16
|
+
export { executeWorktrainPipelineCommand, type WorktrainPipelineCommandDeps, type WorktrainPipelineCommandOpts, } from './worktrain-pipeline.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildConsoleServiceFromDataDir = exports.executeWorktrainOverviewCommand = exports.executeWorktrainDaemonCommand = exports.parseDurationMs = exports.executeWorktrainAwaitCommand = exports.executeWorktrainSpawnCommand = exports.executeWorktrainInboxCommand = exports.executeWorktrainTellCommand = exports.executeWorktrainInitCommand = exports.detectWorkflowVersion = exports.migrateWorkflowFile = exports.migrateWorkflow = exports.executeMigrateCommand = exports.executeVersionCommand = exports.executeCleanupCommand = exports.executeStartCommand = exports.executeValidateCommand = exports.executeListCommand = exports.getWorkflowSources = exports.executeSourcesCommand = exports.executeInitConfigCommand = exports.executeInitCommand = void 0;
|
|
3
|
+
exports.executeWorktrainPipelineCommand = exports.buildConsoleServiceFromDataDir = exports.executeWorktrainOverviewCommand = exports.executeWorktrainDaemonCommand = exports.parseDurationMs = exports.executeWorktrainAwaitCommand = exports.executeWorktrainSpawnCommand = exports.executeWorktrainInboxCommand = exports.executeWorktrainTellCommand = exports.executeWorktrainInitCommand = exports.detectWorkflowVersion = exports.migrateWorkflowFile = exports.migrateWorkflow = exports.executeMigrateCommand = exports.executeVersionCommand = exports.executeCleanupCommand = exports.executeStartCommand = exports.executeValidateCommand = exports.executeListCommand = exports.getWorkflowSources = exports.executeSourcesCommand = exports.executeInitConfigCommand = exports.executeInitCommand = void 0;
|
|
4
4
|
var init_js_1 = require("./init.js");
|
|
5
5
|
Object.defineProperty(exports, "executeInitCommand", { enumerable: true, get: function () { return init_js_1.executeInitCommand; } });
|
|
6
6
|
Object.defineProperty(exports, "executeInitConfigCommand", { enumerable: true, get: function () { return init_js_1.executeInitConfigCommand; } });
|
|
@@ -38,3 +38,5 @@ Object.defineProperty(exports, "executeWorktrainDaemonCommand", { enumerable: tr
|
|
|
38
38
|
var worktrain_overview_js_1 = require("./worktrain-overview.js");
|
|
39
39
|
Object.defineProperty(exports, "executeWorktrainOverviewCommand", { enumerable: true, get: function () { return worktrain_overview_js_1.executeWorktrainOverviewCommand; } });
|
|
40
40
|
Object.defineProperty(exports, "buildConsoleServiceFromDataDir", { enumerable: true, get: function () { return worktrain_overview_js_1.buildConsoleServiceFromDataDir; } });
|
|
41
|
+
var worktrain_pipeline_js_1 = require("./worktrain-pipeline.js");
|
|
42
|
+
Object.defineProperty(exports, "executeWorktrainPipelineCommand", { enumerable: true, get: function () { return worktrain_pipeline_js_1.executeWorktrainPipelineCommand; } });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CliResult } from '../types/cli-result.js';
|
|
2
|
+
import type { AdaptiveCoordinatorDeps } from '../../coordinators/adaptive-pipeline.js';
|
|
3
|
+
export interface WorktrainPipelineCommandDeps extends AdaptiveCoordinatorDeps {
|
|
4
|
+
readonly stdout: (line: string) => void;
|
|
5
|
+
readonly pathIsAbsolute: (p: string) => boolean;
|
|
6
|
+
readonly statPath: (p: string) => Promise<{
|
|
7
|
+
isDirectory: () => boolean;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export interface WorktrainPipelineCommandOpts {
|
|
11
|
+
readonly workspace: string;
|
|
12
|
+
readonly goal: string;
|
|
13
|
+
readonly mode?: string;
|
|
14
|
+
readonly dryRun?: boolean;
|
|
15
|
+
readonly port?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function executeWorktrainPipelineCommand(deps: WorktrainPipelineCommandDeps, opts: WorktrainPipelineCommandOpts): Promise<CliResult>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.executeWorktrainPipelineCommand = executeWorktrainPipelineCommand;
|
|
37
|
+
const cli_result_js_1 = require("../types/cli-result.js");
|
|
38
|
+
const adaptive_pipeline_js_1 = require("../../coordinators/adaptive-pipeline.js");
|
|
39
|
+
const VALID_MODES = ['QUICK_REVIEW', 'REVIEW_ONLY', 'IMPLEMENT', 'FULL'];
|
|
40
|
+
function isValidMode(mode) {
|
|
41
|
+
return VALID_MODES.includes(mode);
|
|
42
|
+
}
|
|
43
|
+
async function executeWorktrainPipelineCommand(deps, opts) {
|
|
44
|
+
const goal = opts.goal.trim();
|
|
45
|
+
if (!goal) {
|
|
46
|
+
return (0, cli_result_js_1.misuse)('--goal is required and must not be empty.');
|
|
47
|
+
}
|
|
48
|
+
const workspace = opts.workspace.trim();
|
|
49
|
+
if (!workspace) {
|
|
50
|
+
return (0, cli_result_js_1.misuse)('--workspace is required and must not be empty.');
|
|
51
|
+
}
|
|
52
|
+
if (!deps.pathIsAbsolute(workspace)) {
|
|
53
|
+
return (0, cli_result_js_1.misuse)(`--workspace must be an absolute path, got: ${workspace}`);
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const stat = await deps.statPath(workspace);
|
|
57
|
+
if (!stat.isDirectory()) {
|
|
58
|
+
return (0, cli_result_js_1.failure)(`--workspace must be an existing directory: ${workspace}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return (0, cli_result_js_1.failure)(`--workspace does not exist: ${workspace}`);
|
|
63
|
+
}
|
|
64
|
+
let modeOverride;
|
|
65
|
+
if (opts.mode) {
|
|
66
|
+
const modeUpper = opts.mode.toUpperCase();
|
|
67
|
+
if (!isValidMode(modeUpper)) {
|
|
68
|
+
return (0, cli_result_js_1.misuse)(`--mode must be one of: ${VALID_MODES.join(', ')}. Got: ${opts.mode}`, [`Valid modes: ${VALID_MODES.join(', ')}`]);
|
|
69
|
+
}
|
|
70
|
+
modeOverride = modeUpper;
|
|
71
|
+
}
|
|
72
|
+
deps.stderr(`[pipeline] Starting adaptive pipeline: goal="${goal.slice(0, 80)}" workspace="${workspace}"`);
|
|
73
|
+
if (modeOverride) {
|
|
74
|
+
deps.stderr(`[pipeline] Mode override: ${modeOverride}`);
|
|
75
|
+
}
|
|
76
|
+
const { runReviewOnlyPipeline } = await Promise.resolve().then(() => __importStar(require('../../coordinators/modes/review-only.js')));
|
|
77
|
+
const { runQuickReviewPipeline } = await Promise.resolve().then(() => __importStar(require('../../coordinators/modes/quick-review.js')));
|
|
78
|
+
const { runImplementPipeline } = await Promise.resolve().then(() => __importStar(require('../../coordinators/modes/implement.js')));
|
|
79
|
+
const { runFullPipeline } = await Promise.resolve().then(() => __importStar(require('../../coordinators/modes/full-pipeline.js')));
|
|
80
|
+
const executors = {
|
|
81
|
+
runReviewOnly: runReviewOnlyPipeline,
|
|
82
|
+
runQuickReview: runQuickReviewPipeline,
|
|
83
|
+
runImplement: runImplementPipeline,
|
|
84
|
+
runFull: runFullPipeline,
|
|
85
|
+
};
|
|
86
|
+
const pipelineOpts = {
|
|
87
|
+
workspace,
|
|
88
|
+
goal,
|
|
89
|
+
dryRun: opts.dryRun ?? false,
|
|
90
|
+
port: opts.port,
|
|
91
|
+
modeOverride,
|
|
92
|
+
};
|
|
93
|
+
let outcome;
|
|
94
|
+
try {
|
|
95
|
+
outcome = await (0, adaptive_pipeline_js_1.runAdaptivePipeline)(deps, pipelineOpts, executors);
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
99
|
+
deps.stderr(`[pipeline] Unexpected error: ${message}`);
|
|
100
|
+
return (0, cli_result_js_1.failure)(`Pipeline coordinator threw unexpectedly: ${message}`);
|
|
101
|
+
}
|
|
102
|
+
return interpretPipelineOutcome(outcome, deps.stdout);
|
|
103
|
+
}
|
|
104
|
+
function interpretPipelineOutcome(outcome, stdout) {
|
|
105
|
+
switch (outcome.kind) {
|
|
106
|
+
case 'merged':
|
|
107
|
+
stdout(`Pipeline completed: PR merged${outcome.prUrl ? ` (${outcome.prUrl})` : ''}`);
|
|
108
|
+
return (0, cli_result_js_1.successMessage)(`Pipeline completed successfully.${outcome.prUrl ? ` PR: ${outcome.prUrl}` : ''}`);
|
|
109
|
+
case 'escalated': {
|
|
110
|
+
const { phase, reason } = outcome.escalationReason;
|
|
111
|
+
stdout(`Pipeline escalated: phase=${phase} reason=${reason}`);
|
|
112
|
+
return (0, cli_result_js_1.failure)(`Pipeline escalated at phase '${phase}': ${reason}`, {
|
|
113
|
+
details: [`Phase: ${phase}`, `Reason: ${reason}`],
|
|
114
|
+
suggestions: ['Check the Human Outbox for the full escalation notice.'],
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
case 'dry_run':
|
|
118
|
+
stdout(`Dry run: would execute ${outcome.mode} pipeline`);
|
|
119
|
+
return (0, cli_result_js_1.successMessage)(`Dry run completed. Would execute: ${outcome.mode} pipeline`);
|
|
120
|
+
}
|
|
121
|
+
}
|