@exaudeus/workrail 3.71.0 → 3.72.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/console-ui/assets/{index-DyREuUoq.js → index-CTza1zb5.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/daemon/session-scope.d.ts +27 -0
- package/dist/daemon/session-scope.js +21 -0
- package/dist/daemon/turn-end/conversation-flusher.d.ts +4 -0
- package/dist/daemon/turn-end/conversation-flusher.js +8 -0
- package/dist/daemon/turn-end/detect-stuck.d.ts +2 -0
- package/dist/daemon/turn-end/detect-stuck.js +5 -0
- package/dist/daemon/turn-end/step-injector.d.ts +8 -0
- package/dist/daemon/turn-end/step-injector.js +10 -0
- package/dist/daemon/workflow-runner.d.ts +53 -2
- package/dist/daemon/workflow-runner.js +400 -306
- package/dist/manifest.json +52 -20
- package/dist/mcp/handlers/v2-advance-core/outcome-success.js +1 -5
- package/dist/mcp/handlers/v2-context-budget.d.ts +0 -5
- package/dist/mcp/handlers/v2-context-budget.js +0 -17
- package/dist/trigger/trigger-listener.js +4 -3
- package/dist/trigger/trigger-router.js +7 -7
- package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +16 -16
- package/docs/history/worktrain-journal.md +1945 -0
- package/docs/ideas/backlog.md +165 -12
- package/docs/reference/worktrain-daemon-invariants.md +29 -9
- package/package.json +1 -1
- package/workflows/coding-task-workflow-agentic.json +23 -8
- package/workflows/wr.research.json +158 -0
package/dist/manifest.json
CHANGED
|
@@ -473,16 +473,16 @@
|
|
|
473
473
|
"sha256": "5fe866e54f796975dec5d8ba9983aefd86074db212d3fccd64eed04bc9f0b3da",
|
|
474
474
|
"bytes": 8011
|
|
475
475
|
},
|
|
476
|
+
"console-ui/assets/index-CTza1zb5.js": {
|
|
477
|
+
"sha256": "9fbd911fd803739af06560ff0a69860ff9ef684edac4d6390434e02467b0f766",
|
|
478
|
+
"bytes": 768234
|
|
479
|
+
},
|
|
476
480
|
"console-ui/assets/index-DHrKiMCf.css": {
|
|
477
481
|
"sha256": "40290b50e21ee7e82433efe13b1aa31c1ea608bd057a5c4e324982f284bc928b",
|
|
478
482
|
"bytes": 60673
|
|
479
483
|
},
|
|
480
|
-
"console-ui/assets/index-DyREuUoq.js": {
|
|
481
|
-
"sha256": "707d1b21939b7a0b64ce067f287c5e65d9d87e32b21a7834c1988fe0b1f4820a",
|
|
482
|
-
"bytes": 768234
|
|
483
|
-
},
|
|
484
484
|
"console-ui/index.html": {
|
|
485
|
-
"sha256": "
|
|
485
|
+
"sha256": "9bb88b082c668e32c1a972d77a97b5a3ff6aaa972be3a6f99b1805d530ccd813",
|
|
486
486
|
"bytes": 417
|
|
487
487
|
},
|
|
488
488
|
"console/standalone-console.d.ts": {
|
|
@@ -637,6 +637,14 @@
|
|
|
637
637
|
"sha256": "497efb2389e49ec28c73624a580b4bddb4ae2c800c4f50c343bc931aacbe565a",
|
|
638
638
|
"bytes": 247
|
|
639
639
|
},
|
|
640
|
+
"daemon/session-scope.d.ts": {
|
|
641
|
+
"sha256": "569954160a5102f95a81acf88942fc4ff951b7ee7bc0ac7206be7209c78beebb",
|
|
642
|
+
"bytes": 1341
|
|
643
|
+
},
|
|
644
|
+
"daemon/session-scope.js": {
|
|
645
|
+
"sha256": "2f5295aa36b8d46b162a2b1f4d6f13af00517796aa468956563a8de46e2ecd56",
|
|
646
|
+
"bytes": 630
|
|
647
|
+
},
|
|
640
648
|
"daemon/soul-template.d.ts": {
|
|
641
649
|
"sha256": "abe720ac2d0bdc23b6e0a2b4aed78ae241b6553fd8f6784d0961a915f54d13c2",
|
|
642
650
|
"bytes": 2245
|
|
@@ -653,13 +661,37 @@
|
|
|
653
661
|
"sha256": "485b7407433f7246af41b6895dd8973efeb05228a9791f327e1dbc581a5c7ef8",
|
|
654
662
|
"bytes": 5921
|
|
655
663
|
},
|
|
664
|
+
"daemon/turn-end/conversation-flusher.d.ts": {
|
|
665
|
+
"sha256": "5a8c1666ad18c31f49cb34ad2f4b5f134437bfb902dc5f89ea3db568ca44976d",
|
|
666
|
+
"bytes": 314
|
|
667
|
+
},
|
|
668
|
+
"daemon/turn-end/conversation-flusher.js": {
|
|
669
|
+
"sha256": "7a8f294be43e30c0c3a486418bcf42a31e507e2a1b7e793291e97d5b0ffe3c8e",
|
|
670
|
+
"bytes": 382
|
|
671
|
+
},
|
|
672
|
+
"daemon/turn-end/detect-stuck.d.ts": {
|
|
673
|
+
"sha256": "d2d88889b9397d0cb4893f73498c673ba57d264c052485449ef5c3fc50c1d806",
|
|
674
|
+
"bytes": 148
|
|
675
|
+
},
|
|
676
|
+
"daemon/turn-end/detect-stuck.js": {
|
|
677
|
+
"sha256": "a6ec84d4bca121179927ecb21ee7fb798999097bec52491be88e1f6d559357cf",
|
|
678
|
+
"bytes": 309
|
|
679
|
+
},
|
|
680
|
+
"daemon/turn-end/step-injector.d.ts": {
|
|
681
|
+
"sha256": "0f0e8dc1a1db140c2fc9a5b531f4990a284482a63795d13d4874f0f82e4ea6d3",
|
|
682
|
+
"bytes": 247
|
|
683
|
+
},
|
|
684
|
+
"daemon/turn-end/step-injector.js": {
|
|
685
|
+
"sha256": "073b6735f7bfa59c7e7ee398a9290fb15484465640d86f8bf28f06be83d6040f",
|
|
686
|
+
"bytes": 429
|
|
687
|
+
},
|
|
656
688
|
"daemon/workflow-runner.d.ts": {
|
|
657
|
-
"sha256": "
|
|
658
|
-
"bytes":
|
|
689
|
+
"sha256": "2d686ca9de2bcb88565782eb7070b3fddbe47ed423f2c0437e13fc9b900961d0",
|
|
690
|
+
"bytes": 14002
|
|
659
691
|
},
|
|
660
692
|
"daemon/workflow-runner.js": {
|
|
661
|
-
"sha256": "
|
|
662
|
-
"bytes":
|
|
693
|
+
"sha256": "cc4f2255c2af8152f2e9a7e40839aa2eed84c8afc57d7e388024793f28d5fc00",
|
|
694
|
+
"bytes": 119115
|
|
663
695
|
},
|
|
664
696
|
"di/container.d.ts": {
|
|
665
697
|
"sha256": "003bb7fb7478d627524b9b1e76bd0a963a243794a687ff233b96dc0e33a06d9f",
|
|
@@ -1082,8 +1114,8 @@
|
|
|
1082
1114
|
"bytes": 1055
|
|
1083
1115
|
},
|
|
1084
1116
|
"mcp/handlers/v2-advance-core/outcome-success.js": {
|
|
1085
|
-
"sha256": "
|
|
1086
|
-
"bytes":
|
|
1117
|
+
"sha256": "9b7169001269c1c94a158cd9b82ed60bcef1831202527446b75c23232f4fb031",
|
|
1118
|
+
"bytes": 10509
|
|
1087
1119
|
},
|
|
1088
1120
|
"mcp/handlers/v2-advance-events.d.ts": {
|
|
1089
1121
|
"sha256": "318894df12e0dfc74cad9e81fcea44bc04ea972d6e887cd5b196de1f144e256b",
|
|
@@ -1102,12 +1134,12 @@
|
|
|
1102
1134
|
"bytes": 10800
|
|
1103
1135
|
},
|
|
1104
1136
|
"mcp/handlers/v2-context-budget.d.ts": {
|
|
1105
|
-
"sha256": "
|
|
1106
|
-
"bytes":
|
|
1137
|
+
"sha256": "cc5c05d9b7843bd1eb8c7ea513cdac3a68b499ad915213db819e4e3c9945fcec",
|
|
1138
|
+
"bytes": 402
|
|
1107
1139
|
},
|
|
1108
1140
|
"mcp/handlers/v2-context-budget.js": {
|
|
1109
|
-
"sha256": "
|
|
1110
|
-
"bytes":
|
|
1141
|
+
"sha256": "a99bf293bc941e87ad0125db109e971fadf195d8424232d7871323141c9d9daf",
|
|
1142
|
+
"bytes": 7493
|
|
1111
1143
|
},
|
|
1112
1144
|
"mcp/handlers/v2-error-mapping.d.ts": {
|
|
1113
1145
|
"sha256": "4522217a754afc6a2ee3834368decb7fb22ebf9d4c72fc0de9890903d652d76c",
|
|
@@ -1730,16 +1762,16 @@
|
|
|
1730
1762
|
"bytes": 1798
|
|
1731
1763
|
},
|
|
1732
1764
|
"trigger/trigger-listener.js": {
|
|
1733
|
-
"sha256": "
|
|
1734
|
-
"bytes":
|
|
1765
|
+
"sha256": "540e3942790b8b00f22b43575d83db4aa96cfdaf4ad6ea1fcaa8470e793b3bee",
|
|
1766
|
+
"bytes": 25847
|
|
1735
1767
|
},
|
|
1736
1768
|
"trigger/trigger-router.d.ts": {
|
|
1737
1769
|
"sha256": "618f1b346eb18d83ea76f71c0008be6f7ae76cc7734a93abd8afd30d26d24806",
|
|
1738
1770
|
"bytes": 3064
|
|
1739
1771
|
},
|
|
1740
1772
|
"trigger/trigger-router.js": {
|
|
1741
|
-
"sha256": "
|
|
1742
|
-
"bytes":
|
|
1773
|
+
"sha256": "68a9dacf69468aef7cfb0f0da72122d33f34236e5296b176def5f40dbb0f0839",
|
|
1774
|
+
"bytes": 24842
|
|
1743
1775
|
},
|
|
1744
1776
|
"trigger/trigger-store.d.ts": {
|
|
1745
1777
|
"sha256": "f846ca66494a2a1b834914652c845373d777bdeaaaefdc101ad1e78083d9ad5b",
|
|
@@ -2342,7 +2374,7 @@
|
|
|
2342
2374
|
"bytes": 3397
|
|
2343
2375
|
},
|
|
2344
2376
|
"v2/durable-core/schemas/export-bundle/index.d.ts": {
|
|
2345
|
-
"sha256": "
|
|
2377
|
+
"sha256": "823a96b41bc27defef5ba7fc2eb34ab0cf09db2f2d71dd9820d02564b1cce788",
|
|
2346
2378
|
"bytes": 551200
|
|
2347
2379
|
},
|
|
2348
2380
|
"v2/durable-core/schemas/export-bundle/index.js": {
|
|
@@ -8,7 +8,6 @@ const workflow_compiler_js_1 = require("../../../application/services/workflow-c
|
|
|
8
8
|
const workflow_interpreter_js_1 = require("../../../application/services/workflow-interpreter.js");
|
|
9
9
|
const recommendation_warnings_js_1 = require("../../../v2/durable-core/domain/recommendation-warnings.js");
|
|
10
10
|
const v2_state_conversion_js_1 = require("../v2-state-conversion.js");
|
|
11
|
-
const v2_context_budget_js_1 = require("../v2-context-budget.js");
|
|
12
11
|
const v2_advance_events_js_1 = require("../v2-advance-events.js");
|
|
13
12
|
const event_builders_js_1 = require("./event-builders.js");
|
|
14
13
|
const assessment_recorded_event_builder_js_1 = require("../../../v2/durable-core/domain/assessment-recorded-event-builder.js");
|
|
@@ -63,10 +62,7 @@ function buildSuccessOutcome(args) {
|
|
|
63
62
|
if (advanced.isErr()) {
|
|
64
63
|
return errAsync({ kind: 'advance_apply_failed', message: advanced.error.message });
|
|
65
64
|
}
|
|
66
|
-
const artifactsForEval =
|
|
67
|
-
truthEvents: truth.events,
|
|
68
|
-
inputArtifacts: inputOutput?.artifacts ?? [],
|
|
69
|
-
});
|
|
65
|
+
const artifactsForEval = inputOutput?.artifacts ?? [];
|
|
70
66
|
const nextRes = interpreter.next(compiledWf.value, advanced.value, v.mergedContext, artifactsForEval);
|
|
71
67
|
if (nextRes.isErr()) {
|
|
72
68
|
if (nextRes.error._tag === 'MissingContext') {
|
|
@@ -10,8 +10,3 @@ export declare function checkContextBudget(args: {
|
|
|
10
10
|
readonly tool: ContextToolNameV2;
|
|
11
11
|
readonly context: unknown;
|
|
12
12
|
}): ContextBudgetCheck;
|
|
13
|
-
import type { DomainEventV1 } from '../../v2/durable-core/schemas/session/index.js';
|
|
14
|
-
export declare function collectArtifactsForEvaluation(args: {
|
|
15
|
-
readonly truthEvents: readonly DomainEventV1[];
|
|
16
|
-
readonly inputArtifacts: readonly unknown[];
|
|
17
|
-
}): readonly unknown[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkContextBudget = checkContextBudget;
|
|
4
|
-
exports.collectArtifactsForEvaluation = collectArtifactsForEvaluation;
|
|
5
4
|
const types_js_1 = require("../types.js");
|
|
6
5
|
const jcs_js_1 = require("../../v2/durable-core/canonical/jcs.js");
|
|
7
6
|
const constants_js_1 = require("../../v2/durable-core/constants.js");
|
|
@@ -169,19 +168,3 @@ function checkContextBudget(args) {
|
|
|
169
168
|
}
|
|
170
169
|
return { ok: true };
|
|
171
170
|
}
|
|
172
|
-
function collectArtifactsForEvaluation(args) {
|
|
173
|
-
const collected = [];
|
|
174
|
-
for (const e of args.truthEvents) {
|
|
175
|
-
if (e.kind !== constants_js_1.EVENT_KIND.NODE_OUTPUT_APPENDED)
|
|
176
|
-
continue;
|
|
177
|
-
if (e.data.outputChannel !== constants_js_1.OUTPUT_CHANNEL.ARTIFACT)
|
|
178
|
-
continue;
|
|
179
|
-
if (e.data.payload.payloadKind !== constants_js_1.PAYLOAD_KIND.ARTIFACT_REF)
|
|
180
|
-
continue;
|
|
181
|
-
const payload = e.data.payload;
|
|
182
|
-
if (payload.content === undefined)
|
|
183
|
-
continue;
|
|
184
|
-
collected.push(payload.content);
|
|
185
|
-
}
|
|
186
|
-
return [...collected, ...args.inputArtifacts];
|
|
187
|
-
}
|
|
@@ -134,8 +134,9 @@ async function startTriggerListener(ctx, options) {
|
|
|
134
134
|
if (env['WORKRAIL_TRIGGERS_ENABLED'] !== 'true') {
|
|
135
135
|
return null;
|
|
136
136
|
}
|
|
137
|
-
const apiKey = options.apiKey ?? env['ANTHROPIC_API_KEY'];
|
|
138
|
-
|
|
137
|
+
const apiKey = options.apiKey ?? env['ANTHROPIC_API_KEY'] ?? '';
|
|
138
|
+
const hasBedrock = !!(env['AWS_PROFILE'] || env['AWS_ACCESS_KEY_ID']);
|
|
139
|
+
if (!apiKey && !hasBedrock) {
|
|
139
140
|
return { _kind: 'err', error: { kind: 'missing_api_key' } };
|
|
140
141
|
}
|
|
141
142
|
const workspaceResult = (0, config_file_js_1.loadWorkspacesFromConfigFile)();
|
|
@@ -499,7 +500,7 @@ async function startTriggerListener(ctx, options) {
|
|
|
499
500
|
const polledEventStore = new polled_event_store_js_1.PolledEventStore(env);
|
|
500
501
|
const pollingScheduler = new polling_scheduler_js_1.PollingScheduler(allTriggers, router, polledEventStore, options.fetchFn);
|
|
501
502
|
pollingScheduler.start();
|
|
502
|
-
await (0, workflow_runner_js_1.runStartupRecovery)(undefined, undefined, ctx).catch((err) => {
|
|
503
|
+
await (0, workflow_runner_js_1.runStartupRecovery)(undefined, undefined, ctx, undefined, undefined, undefined, apiKey).catch((err) => {
|
|
503
504
|
console.warn('[TriggerListener] Startup recovery encountered an unexpected error:', err instanceof Error ? err.message : String(err));
|
|
504
505
|
});
|
|
505
506
|
const portEnv = env['WORKRAIL_TRIGGER_PORT'];
|
|
@@ -123,16 +123,16 @@ function validateHmac(rawBody, secret, headerValue) {
|
|
|
123
123
|
async function maybeRunDelivery(triggerId, trigger, result, execFn) {
|
|
124
124
|
if (result._tag !== 'success')
|
|
125
125
|
return;
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
console.warn(`[TriggerRouter] Delivery skipped: triggerId=${triggerId} -- ` +
|
|
129
|
-
`lastStepNotes is absent (agent did not provide notes on the final step). ` +
|
|
130
|
-
`Ensure the workflow produces a JSON handoff block in its final step notes.`);
|
|
131
|
-
}
|
|
126
|
+
if (trigger.autoCommit !== true) {
|
|
127
|
+
console.log(`[TriggerRouter] Delivery skipped: triggerId=${triggerId} -- autoCommit not set for this trigger.`);
|
|
132
128
|
return;
|
|
133
129
|
}
|
|
134
|
-
if (
|
|
130
|
+
if (result.lastStepNotes === undefined) {
|
|
131
|
+
console.warn(`[TriggerRouter] Delivery skipped: triggerId=${triggerId} -- ` +
|
|
132
|
+
`lastStepNotes is absent (agent did not provide notes on the final step). ` +
|
|
133
|
+
`Ensure the workflow produces a JSON handoff block in its final step notes.`);
|
|
135
134
|
return;
|
|
135
|
+
}
|
|
136
136
|
const parseResult = (0, delivery_action_js_1.parseHandoffArtifact)(result.lastStepNotes);
|
|
137
137
|
if (parseResult.kind === 'err') {
|
|
138
138
|
console.warn(`[TriggerRouter] Delivery skipped: triggerId=${triggerId} -- ` +
|
|
@@ -11871,21 +11871,6 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
11871
11871
|
pinnedWorkflows: Record<string, unknown>;
|
|
11872
11872
|
}>;
|
|
11873
11873
|
}, "strip", z.ZodTypeAny, {
|
|
11874
|
-
bundleSchemaVersion: 1;
|
|
11875
|
-
bundleId: string;
|
|
11876
|
-
exportedAt: string;
|
|
11877
|
-
producer: {
|
|
11878
|
-
appVersion: string;
|
|
11879
|
-
appliedConfigHash?: string | undefined;
|
|
11880
|
-
};
|
|
11881
|
-
integrity: {
|
|
11882
|
-
kind: "sha256_manifest_v1";
|
|
11883
|
-
entries: {
|
|
11884
|
-
path: string;
|
|
11885
|
-
sha256: string;
|
|
11886
|
-
bytes: number;
|
|
11887
|
-
}[];
|
|
11888
|
-
};
|
|
11889
11874
|
session: {
|
|
11890
11875
|
sessionId: string;
|
|
11891
11876
|
snapshots: Record<string, {
|
|
@@ -12512,7 +12497,6 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
12512
12497
|
})[];
|
|
12513
12498
|
pinnedWorkflows: Record<string, unknown>;
|
|
12514
12499
|
};
|
|
12515
|
-
}, {
|
|
12516
12500
|
bundleSchemaVersion: 1;
|
|
12517
12501
|
bundleId: string;
|
|
12518
12502
|
exportedAt: string;
|
|
@@ -12528,6 +12512,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
12528
12512
|
bytes: number;
|
|
12529
12513
|
}[];
|
|
12530
12514
|
};
|
|
12515
|
+
}, {
|
|
12531
12516
|
session: {
|
|
12532
12517
|
sessionId: string;
|
|
12533
12518
|
snapshots: Record<string, {
|
|
@@ -13142,6 +13127,21 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
13142
13127
|
})[];
|
|
13143
13128
|
pinnedWorkflows: Record<string, unknown>;
|
|
13144
13129
|
};
|
|
13130
|
+
bundleSchemaVersion: 1;
|
|
13131
|
+
bundleId: string;
|
|
13132
|
+
exportedAt: string;
|
|
13133
|
+
producer: {
|
|
13134
|
+
appVersion: string;
|
|
13135
|
+
appliedConfigHash?: string | undefined;
|
|
13136
|
+
};
|
|
13137
|
+
integrity: {
|
|
13138
|
+
kind: "sha256_manifest_v1";
|
|
13139
|
+
entries: {
|
|
13140
|
+
path: string;
|
|
13141
|
+
sha256: string;
|
|
13142
|
+
bytes: number;
|
|
13143
|
+
}[];
|
|
13144
|
+
};
|
|
13145
13145
|
}>;
|
|
13146
13146
|
export type ExportBundleV1 = z.infer<typeof ExportBundleV1Schema>;
|
|
13147
13147
|
export declare const BundleImportErrorCodeSchema: z.ZodEnum<["BUNDLE_INVALID_FORMAT", "BUNDLE_UNSUPPORTED_VERSION", "BUNDLE_INTEGRITY_FAILED", "BUNDLE_MISSING_SNAPSHOT", "BUNDLE_MISSING_PINNED_WORKFLOW", "BUNDLE_EVENT_ORDER_INVALID", "BUNDLE_MANIFEST_ORDER_INVALID"]>;
|