@exaudeus/workrail 3.72.3 → 3.73.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-BUyvn3iN.js → index-HnM-KywY.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/daemon/agent-loop.d.ts +3 -0
- package/dist/daemon/agent-loop.js +20 -1
- package/dist/daemon/daemon-events.d.ts +1 -1
- package/dist/daemon/tools/file-tools.d.ts +2 -2
- package/dist/daemon/tools/file-tools.js +14 -12
- package/dist/daemon/tools/spawn-agent.js +1 -1
- package/dist/daemon/workflow-runner.d.ts +6 -3
- package/dist/daemon/workflow-runner.js +25 -7
- package/dist/manifest.json +47 -47
- package/dist/mcp/handlers/v2-execution/index.js +1 -1
- package/dist/mcp/handlers/v2-execution/start.js +3 -0
- package/dist/trigger/coordinator-deps.js +1 -1
- package/dist/trigger/polling-scheduler.d.ts +1 -0
- package/dist/trigger/polling-scheduler.js +25 -6
- package/dist/trigger/trigger-store.js +16 -1
- package/dist/trigger/types.d.ts +1 -0
- package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +16 -0
- package/dist/v2/durable-core/schemas/session/events.d.ts +5 -0
- package/dist/v2/durable-core/schemas/session/events.js +1 -0
- package/dist/v2/usecases/console-routes.js +1 -1
- package/dist/v2/usecases/console-service.js +26 -2
- package/dist/v2/usecases/console-types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -269,16 +269,19 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
|
|
|
269
269
|
workflowHash: z.ZodEffects<z.ZodString, never, string>;
|
|
270
270
|
workflowSourceKind: z.ZodEnum<["bundled", "user", "project", "remote", "plugin"]>;
|
|
271
271
|
workflowSourceRef: z.ZodString;
|
|
272
|
+
triggerSource: z.ZodOptional<z.ZodEnum<["daemon", "mcp"]>>;
|
|
272
273
|
}, "strip", z.ZodTypeAny, {
|
|
273
274
|
workflowHash: never;
|
|
274
275
|
workflowId: string;
|
|
275
276
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
276
277
|
workflowSourceRef: string;
|
|
278
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
277
279
|
}, {
|
|
278
280
|
workflowHash: string;
|
|
279
281
|
workflowId: string;
|
|
280
282
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
281
283
|
workflowSourceRef: string;
|
|
284
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
282
285
|
}>;
|
|
283
286
|
}, "strip", z.ZodTypeAny, {
|
|
284
287
|
kind: "run_started";
|
|
@@ -295,6 +298,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
|
|
|
295
298
|
workflowId: string;
|
|
296
299
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
297
300
|
workflowSourceRef: string;
|
|
301
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
298
302
|
};
|
|
299
303
|
timestampMs: number;
|
|
300
304
|
}, {
|
|
@@ -312,6 +316,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
|
|
|
312
316
|
workflowId: string;
|
|
313
317
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
314
318
|
workflowSourceRef: string;
|
|
319
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
315
320
|
};
|
|
316
321
|
timestampMs: number;
|
|
317
322
|
}>, z.ZodObject<{
|
|
@@ -4927,6 +4932,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
|
|
|
4927
4932
|
workflowId: string;
|
|
4928
4933
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
4929
4934
|
workflowSourceRef: string;
|
|
4935
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
4930
4936
|
};
|
|
4931
4937
|
timestampMs: number;
|
|
4932
4938
|
} | {
|
|
@@ -5540,6 +5546,7 @@ export declare const SessionContentsV1Schema: z.ZodObject<{
|
|
|
5540
5546
|
workflowId: string;
|
|
5541
5547
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
5542
5548
|
workflowSourceRef: string;
|
|
5549
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
5543
5550
|
};
|
|
5544
5551
|
timestampMs: number;
|
|
5545
5552
|
} | {
|
|
@@ -6199,16 +6206,19 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
6199
6206
|
workflowHash: z.ZodEffects<z.ZodString, never, string>;
|
|
6200
6207
|
workflowSourceKind: z.ZodEnum<["bundled", "user", "project", "remote", "plugin"]>;
|
|
6201
6208
|
workflowSourceRef: z.ZodString;
|
|
6209
|
+
triggerSource: z.ZodOptional<z.ZodEnum<["daemon", "mcp"]>>;
|
|
6202
6210
|
}, "strip", z.ZodTypeAny, {
|
|
6203
6211
|
workflowHash: never;
|
|
6204
6212
|
workflowId: string;
|
|
6205
6213
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
6206
6214
|
workflowSourceRef: string;
|
|
6215
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
6207
6216
|
}, {
|
|
6208
6217
|
workflowHash: string;
|
|
6209
6218
|
workflowId: string;
|
|
6210
6219
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
6211
6220
|
workflowSourceRef: string;
|
|
6221
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
6212
6222
|
}>;
|
|
6213
6223
|
}, "strip", z.ZodTypeAny, {
|
|
6214
6224
|
kind: "run_started";
|
|
@@ -6225,6 +6235,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
6225
6235
|
workflowId: string;
|
|
6226
6236
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
6227
6237
|
workflowSourceRef: string;
|
|
6238
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
6228
6239
|
};
|
|
6229
6240
|
timestampMs: number;
|
|
6230
6241
|
}, {
|
|
@@ -6242,6 +6253,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
6242
6253
|
workflowId: string;
|
|
6243
6254
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
6244
6255
|
workflowSourceRef: string;
|
|
6256
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
6245
6257
|
};
|
|
6246
6258
|
timestampMs: number;
|
|
6247
6259
|
}>, z.ZodObject<{
|
|
@@ -10857,6 +10869,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
10857
10869
|
workflowId: string;
|
|
10858
10870
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
10859
10871
|
workflowSourceRef: string;
|
|
10872
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
10860
10873
|
};
|
|
10861
10874
|
timestampMs: number;
|
|
10862
10875
|
} | {
|
|
@@ -11470,6 +11483,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
11470
11483
|
workflowId: string;
|
|
11471
11484
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
11472
11485
|
workflowSourceRef: string;
|
|
11486
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
11473
11487
|
};
|
|
11474
11488
|
timestampMs: number;
|
|
11475
11489
|
} | {
|
|
@@ -12097,6 +12111,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
12097
12111
|
workflowId: string;
|
|
12098
12112
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
12099
12113
|
workflowSourceRef: string;
|
|
12114
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
12100
12115
|
};
|
|
12101
12116
|
timestampMs: number;
|
|
12102
12117
|
} | {
|
|
@@ -12727,6 +12742,7 @@ export declare const ExportBundleV1Schema: z.ZodObject<{
|
|
|
12727
12742
|
workflowId: string;
|
|
12728
12743
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
12729
12744
|
workflowSourceRef: string;
|
|
12745
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
12730
12746
|
};
|
|
12731
12747
|
timestampMs: number;
|
|
12732
12748
|
} | {
|
|
@@ -257,16 +257,19 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
257
257
|
workflowHash: z.ZodEffects<z.ZodString, never, string>;
|
|
258
258
|
workflowSourceKind: z.ZodEnum<["bundled", "user", "project", "remote", "plugin"]>;
|
|
259
259
|
workflowSourceRef: z.ZodString;
|
|
260
|
+
triggerSource: z.ZodOptional<z.ZodEnum<["daemon", "mcp"]>>;
|
|
260
261
|
}, "strip", z.ZodTypeAny, {
|
|
261
262
|
workflowHash: never;
|
|
262
263
|
workflowId: string;
|
|
263
264
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
264
265
|
workflowSourceRef: string;
|
|
266
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
265
267
|
}, {
|
|
266
268
|
workflowHash: string;
|
|
267
269
|
workflowId: string;
|
|
268
270
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
269
271
|
workflowSourceRef: string;
|
|
272
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
270
273
|
}>;
|
|
271
274
|
}, "strip", z.ZodTypeAny, {
|
|
272
275
|
kind: "run_started";
|
|
@@ -283,6 +286,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
283
286
|
workflowId: string;
|
|
284
287
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
285
288
|
workflowSourceRef: string;
|
|
289
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
286
290
|
};
|
|
287
291
|
timestampMs: number;
|
|
288
292
|
}, {
|
|
@@ -300,6 +304,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
300
304
|
workflowId: string;
|
|
301
305
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
302
306
|
workflowSourceRef: string;
|
|
307
|
+
triggerSource?: "daemon" | "mcp" | undefined;
|
|
303
308
|
};
|
|
304
309
|
timestampMs: number;
|
|
305
310
|
}>, z.ZodObject<{
|
|
@@ -44,6 +44,7 @@ const RunStartedDataV1Schema = zod_1.z.object({
|
|
|
44
44
|
workflowHash: workflowHashSchema,
|
|
45
45
|
workflowSourceKind: WorkflowSourceKindSchema,
|
|
46
46
|
workflowSourceRef: zod_1.z.string().min(1),
|
|
47
|
+
triggerSource: zod_1.z.enum(['daemon', 'mcp']).optional(),
|
|
47
48
|
});
|
|
48
49
|
const AdvanceRecordedOutcomeV1Schema = zod_1.z.discriminatedUnion('kind', [
|
|
49
50
|
zod_1.z.object({ kind: zod_1.z.literal('blocked'), blockers: blockers_js_1.BlockerReportV1Schema }),
|
|
@@ -625,7 +625,7 @@ function mountConsoleRoutes(app, consoleService, workflowService, timingRingBuff
|
|
|
625
625
|
res.status(503).json({ success: false, error: 'No LLM credentials available. Set ANTHROPIC_API_KEY or AWS_PROFILE.' });
|
|
626
626
|
return;
|
|
627
627
|
}
|
|
628
|
-
const startResult = await (0, start_js_1.executeStartWorkflow)({ workflowId, workspacePath, goal }, v2ToolContext, { is_autonomous: 'true', workspacePath });
|
|
628
|
+
const startResult = await (0, start_js_1.executeStartWorkflow)({ workflowId, workspacePath, goal }, v2ToolContext, { is_autonomous: 'true', workspacePath, triggerSource: 'daemon' });
|
|
629
629
|
if (startResult.isErr()) {
|
|
630
630
|
const errDetail = `${startResult.error.kind}${'message' in startResult.error ? `: ${startResult.error.message}` : ''}`;
|
|
631
631
|
res.status(400).json({ success: false, error: `Session creation failed: ${errDetail}` });
|
|
@@ -643,6 +643,16 @@ function projectSessionSummary(sessionId, truth, completionByRunId, workflowName
|
|
|
643
643
|
return false;
|
|
644
644
|
return Object.values(contextRes.value.byRunId).some((runCtx) => runCtx.context['is_autonomous'] === 'true');
|
|
645
645
|
})();
|
|
646
|
+
const triggerSource = (() => {
|
|
647
|
+
if (sortedEventsRes.isOk()) {
|
|
648
|
+
for (const e of sortedEventsRes.value) {
|
|
649
|
+
if (e.kind === 'run_started' && e.data.triggerSource !== undefined) {
|
|
650
|
+
return e.data.triggerSource;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return isAutonomous ? 'daemon' : 'mcp';
|
|
655
|
+
})();
|
|
646
656
|
const metrics = (0, session_metrics_js_1.projectSessionMetricsV2)(events);
|
|
647
657
|
const runs = Object.values(dag.runsById);
|
|
648
658
|
const run = runs[0];
|
|
@@ -666,6 +676,7 @@ function projectSessionSummary(sessionId, truth, completionByRunId, workflowName
|
|
|
666
676
|
repoRoot,
|
|
667
677
|
lastModifiedMs,
|
|
668
678
|
isAutonomous,
|
|
679
|
+
triggerSource,
|
|
669
680
|
isLive,
|
|
670
681
|
parentSessionId,
|
|
671
682
|
metrics,
|
|
@@ -713,6 +724,7 @@ function projectSessionSummary(sessionId, truth, completionByRunId, workflowName
|
|
|
713
724
|
repoRoot,
|
|
714
725
|
lastModifiedMs,
|
|
715
726
|
isAutonomous,
|
|
727
|
+
triggerSource,
|
|
716
728
|
isLive,
|
|
717
729
|
parentSessionId,
|
|
718
730
|
metrics,
|
|
@@ -724,9 +736,21 @@ function projectSessionDetail(sessionId, truth, completionByRunId, stepLabels, w
|
|
|
724
736
|
const sessionHealth = health.isOk() && health.value.kind === 'healthy' ? 'healthy' : 'corrupt';
|
|
725
737
|
const sortedEventsRes = (0, sorted_event_log_js_1.asSortedEventLog)(events);
|
|
726
738
|
const sessionTitle = sortedEventsRes.isOk() ? deriveSessionTitle(sortedEventsRes.value) : null;
|
|
739
|
+
const detailTriggerSource = (() => {
|
|
740
|
+
if (sortedEventsRes.isOk()) {
|
|
741
|
+
for (const e of sortedEventsRes.value) {
|
|
742
|
+
if (e.kind === 'run_started' && e.data.triggerSource !== undefined) {
|
|
743
|
+
return e.data.triggerSource;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
const contextRes = sortedEventsRes.isOk() ? (0, run_context_js_1.projectRunContextV2)(sortedEventsRes.value) : (0, neverthrow_2.err)(sortedEventsRes.error);
|
|
748
|
+
const isAutonomous = contextRes.isOk() && Object.values(contextRes.value.byRunId).some((runCtx) => runCtx.context['is_autonomous'] === 'true');
|
|
749
|
+
return isAutonomous ? 'daemon' : 'mcp';
|
|
750
|
+
})();
|
|
727
751
|
const dagRes = (0, run_dag_js_1.projectRunDagV2)(events);
|
|
728
752
|
if (dagRes.isErr()) {
|
|
729
|
-
return { sessionId, sessionTitle, health: sessionHealth, runs: [], metrics: null, repoRoot: null };
|
|
753
|
+
return { sessionId, sessionTitle, health: sessionHealth, runs: [], metrics: null, repoRoot: null, triggerSource: detailTriggerSource };
|
|
730
754
|
}
|
|
731
755
|
const statusRes = sortedEventsRes.isOk() ? (0, run_status_signals_js_1.projectRunStatusSignalsV2)(sortedEventsRes.value) : (0, neverthrow_2.err)(sortedEventsRes.error);
|
|
732
756
|
const gapsRes = sortedEventsRes.isOk() ? (0, gaps_js_1.projectGapsV2)(sortedEventsRes.value) : (0, neverthrow_2.err)(sortedEventsRes.error);
|
|
@@ -795,7 +819,7 @@ function projectSessionDetail(sessionId, truth, completionByRunId, stepLabels, w
|
|
|
795
819
|
skippedSteps: skippedStepsMap[run.runId] ?? [],
|
|
796
820
|
};
|
|
797
821
|
});
|
|
798
|
-
return { sessionId, sessionTitle, health: sessionHealth, runs, metrics: null, repoRoot: null };
|
|
822
|
+
return { sessionId, sessionTitle, health: sessionHealth, runs, metrics: null, repoRoot: null, triggerSource: detailTriggerSource };
|
|
799
823
|
}
|
|
800
824
|
function deriveRunStatus(isBlocked, hasUnresolvedCriticalGaps, isComplete) {
|
|
801
825
|
if (isBlocked)
|
|
@@ -21,6 +21,7 @@ export interface ConsoleSessionSummary {
|
|
|
21
21
|
readonly repoRoot: string | null;
|
|
22
22
|
readonly lastModifiedMs: number;
|
|
23
23
|
readonly isAutonomous: boolean;
|
|
24
|
+
readonly triggerSource: 'daemon' | 'mcp';
|
|
24
25
|
readonly isLive: boolean;
|
|
25
26
|
readonly parentSessionId: string | null;
|
|
26
27
|
readonly metrics: SessionMetricsV2 | null;
|
|
@@ -95,6 +96,7 @@ export interface ConsoleSessionDetail {
|
|
|
95
96
|
readonly liveActivity?: readonly ConsoleToolActivity[] | null;
|
|
96
97
|
readonly metrics: SessionMetricsV2 | null;
|
|
97
98
|
readonly repoRoot: string | null;
|
|
99
|
+
readonly triggerSource: 'daemon' | 'mcp';
|
|
98
100
|
}
|
|
99
101
|
export type ConsoleValidationOutcome = 'pass' | 'fail';
|
|
100
102
|
export interface ConsoleValidationResult {
|