@cuylabs/agent-runtime 0.9.0 → 0.11.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/README.md +31 -3
- package/dist/{chunk-MAVHVV2U.js → chunk-U7M333GT.js} +35 -9
- package/dist/{driver-BaLji34_.d.ts → driver-CQg5G_ey.d.ts} +1 -1
- package/dist/drivers/in-memory.d.ts +2 -2
- package/dist/{index-DkdkAAoL.d.ts → index-acbJQol3.d.ts} +2 -2
- package/dist/index.d.ts +171 -6
- package/dist/index.js +1 -1
- package/dist/orchestration/index.d.ts +3 -3
- package/dist/orchestration/index.js +1 -1
- package/dist/{types-DllX9NP8.d.ts → types-AoJlEcyK.d.ts} +1 -1
- package/dist/workload/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,12 @@ The package now makes one architectural seam explicit:
|
|
|
11
11
|
- `agent-runtime` consumes a generic workload contract
|
|
12
12
|
- infrastructure packages such as `agent-runtime-dapr` implement that contract
|
|
13
13
|
|
|
14
|
+
Another way to say it:
|
|
15
|
+
|
|
16
|
+
- `agent-runtime` is the API your application targets for orchestration
|
|
17
|
+
- backend packages are allowed to provide stronger guarantees and extra helpers
|
|
18
|
+
- those backend-specific helpers should not leak back into the base runtime contract
|
|
19
|
+
|
|
14
20
|
## Package Boundary
|
|
15
21
|
|
|
16
22
|
Use `@cuylabs/agent-runtime` when you need outer orchestration:
|
|
@@ -28,14 +34,31 @@ This package does not own in-process model or tool interception.
|
|
|
28
34
|
|
|
29
35
|
So most users start with `agent-core`, then add `agent-runtime` when they need workers, jobs, or orchestrated execution.
|
|
30
36
|
|
|
37
|
+
## What Stays In The Shared Contract
|
|
38
|
+
|
|
39
|
+
`agent-runtime` should only own concepts that remain meaningful without naming a
|
|
40
|
+
specific backend:
|
|
41
|
+
|
|
42
|
+
- jobs and schedules
|
|
43
|
+
- dispatch and retry semantics
|
|
44
|
+
- queueing and concurrency limits
|
|
45
|
+
- invocation lifecycle and control-plane grammar
|
|
46
|
+
- runtime drivers and run stores as abstract contracts
|
|
47
|
+
|
|
48
|
+
If a feature only makes sense when you say "Dapr", "workflow instance",
|
|
49
|
+
"sidecar callback", or "HTTP runner", it should live outside this package.
|
|
50
|
+
|
|
31
51
|
## What This Package Owns
|
|
32
52
|
|
|
33
|
-
- Job definitions and lifecycle (`schedule`, `update`, `pause`, `resume`, `runNow`, `dispatch`)
|
|
53
|
+
- Job definitions and lifecycle (`schedule`, `update`, `pause`, `resume`, `remove`, `runNow`, `dispatch`, `dispatchDue`)
|
|
54
|
+
- Runtime introspection (`status`, `listJobs`, `getJob`)
|
|
34
55
|
- Schedule evaluation (`at`, `every`, `cron`)
|
|
35
56
|
- Execution loop with concurrency limits
|
|
36
57
|
- Pluggable runtime drivers (in-memory now, Dapr/others later)
|
|
37
58
|
- Neutral workload adapter for plugging application work into the runtime
|
|
38
|
-
- Optional app-level orchestration API (`invoke`, `listInvocations`, `waitForInvocation`, `close`, `guide`)
|
|
59
|
+
- Optional app-level orchestration API (`invoke`, `get`, `status`, `listInvocations`, `waitForInvocation`, `close`, `guide`)
|
|
60
|
+
- Execution-store contracts (`ExecutionStore`, `ExecutionRunRecord`, `ExecutionStatus`) for provider-agnostic persistence
|
|
61
|
+
- Prometheus-compatible metrics (`createPrometheusRuntimeMetrics`)
|
|
39
62
|
|
|
40
63
|
## Layered Architecture
|
|
41
64
|
|
|
@@ -94,13 +117,18 @@ src/
|
|
|
94
117
|
index.ts # Generic workload contract + adapter helper
|
|
95
118
|
observer.ts # Runtime lifecycle/queue/run observer contracts
|
|
96
119
|
logger.ts # Logger interface + defaults
|
|
120
|
+
metrics.ts # Prometheus counters/gauges/histograms
|
|
97
121
|
schedule.ts # Schedule normalization + next-run calculation
|
|
98
122
|
driver.ts # Driver interface
|
|
99
123
|
runtime.ts # WorkloadRuntime orchestration class
|
|
100
124
|
drivers/
|
|
101
125
|
in-memory.ts # Default local runtime driver
|
|
126
|
+
execution/
|
|
127
|
+
types.ts # ExecutionStatus, ExecutionRunRecord
|
|
128
|
+
store.ts # ExecutionStore contract
|
|
129
|
+
index.ts # barrel
|
|
102
130
|
orchestration/
|
|
103
|
-
service.ts # invoke/listInvocations/waitForInvocation/close/guide
|
|
131
|
+
service.ts # invoke/get/status/listInvocations/waitForInvocation/close/guide
|
|
104
132
|
store.ts # run-record persistence contract
|
|
105
133
|
stores/
|
|
106
134
|
in-memory.ts # default orchestration run store
|
|
@@ -305,6 +305,21 @@ var WorkloadRuntime = class {
|
|
|
305
305
|
pending.reject(error);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
+
if (this.inFlight.size > 0) {
|
|
309
|
+
this.logger.info("Waiting for in-flight jobs to drain before stopping", {
|
|
310
|
+
count: this.inFlight.size
|
|
311
|
+
});
|
|
312
|
+
const drainStart = Date.now();
|
|
313
|
+
const drainTimeoutMs = 1e4;
|
|
314
|
+
while (this.inFlight.size > 0 && Date.now() - drainStart < drainTimeoutMs) {
|
|
315
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
316
|
+
}
|
|
317
|
+
if (this.inFlight.size > 0) {
|
|
318
|
+
this.logger.warn("Drain timeout reached, stopping with in-flight jobs", {
|
|
319
|
+
remaining: this.inFlight.size
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
308
323
|
await this.driver.stop();
|
|
309
324
|
await this.forEachObserver("runtime stop", { driver: this.driver.name }, async (observer) => {
|
|
310
325
|
await observer.notifyRuntimeStop?.({
|
|
@@ -456,9 +471,6 @@ var WorkloadRuntime = class {
|
|
|
456
471
|
async enqueuePendingDispatch(jobId, trigger) {
|
|
457
472
|
const existing = this.pendingDispatchByJobId.get(jobId);
|
|
458
473
|
if (existing) {
|
|
459
|
-
if (existing.trigger === "due" && trigger === "manual") {
|
|
460
|
-
existing.trigger = "manual";
|
|
461
|
-
}
|
|
462
474
|
return await existing.promise;
|
|
463
475
|
}
|
|
464
476
|
if (this.maxQueuedDispatches !== void 0 && this.pendingDispatches.length >= this.maxQueuedDispatches) {
|
|
@@ -730,7 +742,14 @@ var WorkloadRuntime = class {
|
|
|
730
742
|
nextRunAtMs
|
|
731
743
|
}
|
|
732
744
|
};
|
|
733
|
-
await this.driver.upsertJob(persisted)
|
|
745
|
+
await this.driver.upsertJob(persisted).catch((error) => {
|
|
746
|
+
this.logger.error("Failed to persist final job state after execution", {
|
|
747
|
+
jobId,
|
|
748
|
+
trigger,
|
|
749
|
+
status,
|
|
750
|
+
error: String(error)
|
|
751
|
+
});
|
|
752
|
+
});
|
|
734
753
|
await this.forEachObserver(
|
|
735
754
|
"run complete",
|
|
736
755
|
{ jobId, trigger, status },
|
|
@@ -934,6 +953,13 @@ var AgentOrchestrator = class {
|
|
|
934
953
|
}
|
|
935
954
|
}
|
|
936
955
|
async stop() {
|
|
956
|
+
const stopError = new Error("Orchestrator stopped");
|
|
957
|
+
for (const [, waiterSet] of this.waiters) {
|
|
958
|
+
for (const waiter of waiterSet) {
|
|
959
|
+
waiter.reject(stopError);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
this.waiters.clear();
|
|
937
963
|
let runtimeError;
|
|
938
964
|
try {
|
|
939
965
|
await this.runtime.stop();
|
|
@@ -1042,11 +1068,11 @@ var AgentOrchestrator = class {
|
|
|
1042
1068
|
return current;
|
|
1043
1069
|
}
|
|
1044
1070
|
return await new Promise((resolve, reject) => {
|
|
1045
|
-
|
|
1071
|
+
const timeoutRef = {};
|
|
1046
1072
|
let abortHandler;
|
|
1047
1073
|
const cleanup = () => {
|
|
1048
|
-
if (
|
|
1049
|
-
clearTimeout(
|
|
1074
|
+
if (timeoutRef.current) {
|
|
1075
|
+
clearTimeout(timeoutRef.current);
|
|
1050
1076
|
}
|
|
1051
1077
|
if (abortHandler && options.signal) {
|
|
1052
1078
|
options.signal.removeEventListener("abort", abortHandler);
|
|
@@ -1090,10 +1116,10 @@ var AgentOrchestrator = class {
|
|
|
1090
1116
|
return;
|
|
1091
1117
|
}
|
|
1092
1118
|
const timeoutMs = Math.floor(options.timeoutMs);
|
|
1093
|
-
|
|
1119
|
+
timeoutRef.current = setTimeout(() => {
|
|
1094
1120
|
waiter.reject(new Error(`Timed out waiting for run "${normalizedRunId}" after ${timeoutMs}ms`));
|
|
1095
1121
|
}, timeoutMs);
|
|
1096
|
-
|
|
1122
|
+
timeoutRef.current.unref?.();
|
|
1097
1123
|
});
|
|
1098
1124
|
}
|
|
1099
1125
|
async close(runId, options = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RuntimeDriver, a as RuntimeDriverContext } from '../driver-
|
|
2
|
-
import { R as RuntimeJobRecord } from '../types-
|
|
1
|
+
import { R as RuntimeDriver, a as RuntimeDriverContext } from '../driver-CQg5G_ey.js';
|
|
2
|
+
import { R as RuntimeJobRecord } from '../types-AoJlEcyK.js';
|
|
3
3
|
|
|
4
4
|
interface InMemoryRuntimeDriverOptions {
|
|
5
5
|
maxTimerDelayMs?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as RuntimeTrigger, R as RuntimeJobRecord, p as RuntimeRunStatus,
|
|
2
|
-
import { R as RuntimeDriver, c as RuntimeLogger } from './driver-
|
|
1
|
+
import { s as RuntimeTrigger, R as RuntimeJobRecord, p as RuntimeRunStatus, i as RuntimeDeadLetterEvent, b as RuntimeExecutor, q as RuntimeScheduleInput, r as RuntimeSchedulePatch, c as RuntimeRunResult, j as RuntimeDispatchInput } from './types-AoJlEcyK.js';
|
|
2
|
+
import { R as RuntimeDriver, c as RuntimeLogger } from './driver-CQg5G_ey.js';
|
|
3
3
|
|
|
4
4
|
interface RuntimeLifecycleEvent {
|
|
5
5
|
driver: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { d as RuntimeJobSchedule, e as RuntimeJobScheduleInput } from './types-AoJlEcyK.js';
|
|
2
|
+
export { f as RuntimeAtSchedule, g as RuntimeAtScheduleInput, h as RuntimeCronSchedule, i as RuntimeDeadLetterEvent, j as RuntimeDispatchInput, k as RuntimeEverySchedule, a as RuntimeExecutionContext, l as RuntimeExecutionResult, b as RuntimeExecutor, R as RuntimeJobRecord, m as RuntimeJobState, n as RuntimeRetryPolicy, o as RuntimeRetryStrategy, c as RuntimeRunResult, p as RuntimeRunStatus, q as RuntimeScheduleInput, r as RuntimeSchedulePatch, s as RuntimeTrigger } from './types-AoJlEcyK.js';
|
|
3
3
|
export { RuntimeWorkloadContext, RuntimeWorkloadErrorContext, RuntimeWorkloadExecutorOptions, RuntimeWorkloadResultContext, RuntimeWorkloadRunner, createRuntimeWorkloadContext, createRuntimeWorkloadExecutor } from './workload/index.js';
|
|
4
|
-
export { R as RuntimeDriver, a as RuntimeDriverContext, b as RuntimeLogMeta, c as RuntimeLogger, d as createConsoleRuntimeLogger, s as silentRuntimeLogger } from './driver-
|
|
5
|
-
import { R as RuntimeObserver } from './index-
|
|
6
|
-
export { A as AgentOrchestrator, a as AgentOrchestratorOptions, I as InMemoryOrchestratorRunStore, O as OrchestratorCloseOptions, b as OrchestratorExecutionContext, c as OrchestratorExecutor, d as OrchestratorGuideInput, e as OrchestratorGuidedInputResolver, f as OrchestratorInvokeInput, g as OrchestratorInvokeResult, h as OrchestratorJobPayload, i as OrchestratorListOptions, j as OrchestratorRunMode, k as OrchestratorRunRecord, l as OrchestratorRunState, m as OrchestratorRunStatus, n as OrchestratorRunStore, o as OrchestratorWaitOptions, p as RuntimeDispatchDroppedEvent, q as RuntimeDispatchQueuedEvent, r as RuntimeLifecycleEvent, s as RuntimeRunCompleteEvent, t as RuntimeRunRetryEvent, u as RuntimeRunStartEvent, W as WorkloadRuntime, v as WorkloadRuntimeOptions, w as createAgentOrchestrator, x as createWorkloadRuntime, y as isTerminalRunStatus } from './index-
|
|
4
|
+
export { R as RuntimeDriver, a as RuntimeDriverContext, b as RuntimeLogMeta, c as RuntimeLogger, d as createConsoleRuntimeLogger, s as silentRuntimeLogger } from './driver-CQg5G_ey.js';
|
|
5
|
+
import { R as RuntimeObserver } from './index-acbJQol3.js';
|
|
6
|
+
export { A as AgentOrchestrator, a as AgentOrchestratorOptions, I as InMemoryOrchestratorRunStore, O as OrchestratorCloseOptions, b as OrchestratorExecutionContext, c as OrchestratorExecutor, d as OrchestratorGuideInput, e as OrchestratorGuidedInputResolver, f as OrchestratorInvokeInput, g as OrchestratorInvokeResult, h as OrchestratorJobPayload, i as OrchestratorListOptions, j as OrchestratorRunMode, k as OrchestratorRunRecord, l as OrchestratorRunState, m as OrchestratorRunStatus, n as OrchestratorRunStore, o as OrchestratorWaitOptions, p as RuntimeDispatchDroppedEvent, q as RuntimeDispatchQueuedEvent, r as RuntimeLifecycleEvent, s as RuntimeRunCompleteEvent, t as RuntimeRunRetryEvent, u as RuntimeRunStartEvent, W as WorkloadRuntime, v as WorkloadRuntimeOptions, w as createAgentOrchestrator, x as createWorkloadRuntime, y as isTerminalRunStatus } from './index-acbJQol3.js';
|
|
7
7
|
export { InMemoryRuntimeDriver } from './drivers/in-memory.js';
|
|
8
8
|
|
|
9
9
|
declare const PROMETHEUS_TEXT_CONTENT_TYPE = "text/plain; version=0.0.4; charset=utf-8";
|
|
@@ -40,7 +40,172 @@ interface PrometheusRuntimeMetrics<TPayload = unknown> {
|
|
|
40
40
|
}
|
|
41
41
|
declare function createPrometheusRuntimeMetrics<TPayload = unknown>(options?: PrometheusRuntimeMetricsOptions): PrometheusRuntimeMetrics<TPayload>;
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Generic execution record and checkpoint types.
|
|
45
|
+
*
|
|
46
|
+
* These types define the provider-agnostic contract for persisting and
|
|
47
|
+
* querying agent task execution state. Runtime providers (Dapr, Temporal,
|
|
48
|
+
* etc.) implement `ExecutionStore` against their own durable backend.
|
|
49
|
+
*
|
|
50
|
+
* There is no built-in/in-memory implementation — durability requires a
|
|
51
|
+
* real runtime provider.
|
|
52
|
+
*/
|
|
53
|
+
type ExecutionStatus = "running" | "completed" | "failed";
|
|
54
|
+
/**
|
|
55
|
+
* Lightweight execution run metadata. Provider-specific stores may persist
|
|
56
|
+
* richer records (e.g. Dapr envelopes), but this is the portable shape
|
|
57
|
+
* that runtime-agnostic code can rely on.
|
|
58
|
+
*/
|
|
59
|
+
interface ExecutionRunRecord {
|
|
60
|
+
/** Session ID that scopes this execution. */
|
|
61
|
+
sessionId: string;
|
|
62
|
+
/** Current lifecycle status. */
|
|
63
|
+
status: ExecutionStatus;
|
|
64
|
+
/** ISO timestamp when the execution started. */
|
|
65
|
+
startedAt: string;
|
|
66
|
+
/** ISO timestamp of the last update. */
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
/** ISO timestamp when the execution completed (if terminal). */
|
|
69
|
+
completedAt?: string;
|
|
70
|
+
/** Number of checkpoints persisted so far. */
|
|
71
|
+
checkpointCount: number;
|
|
72
|
+
/** Reason tag of the most recent checkpoint. */
|
|
73
|
+
lastCheckpointReason?: string;
|
|
74
|
+
/** The latest execution snapshot (serializable turn state). */
|
|
75
|
+
snapshot: ExecutionSnapshot;
|
|
76
|
+
/** Final result when `status === "completed"`. */
|
|
77
|
+
result?: ExecutionResult;
|
|
78
|
+
/** Error details when `status === "failed"`. */
|
|
79
|
+
error?: ExecutionErrorRecord;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Serializable snapshot of an in-flight or completed execution.
|
|
83
|
+
* This is the portable subset of the agent-core `AgentTaskExecutionSnapshot`
|
|
84
|
+
* — enough to resume or inspect, without leaking runtime-specific fields.
|
|
85
|
+
*/
|
|
86
|
+
interface ExecutionSnapshot {
|
|
87
|
+
sessionId: string;
|
|
88
|
+
response: string;
|
|
89
|
+
usage: {
|
|
90
|
+
inputTokens?: number;
|
|
91
|
+
outputTokens?: number;
|
|
92
|
+
totalTokens?: number;
|
|
93
|
+
};
|
|
94
|
+
toolCalls: Array<{
|
|
95
|
+
name: string;
|
|
96
|
+
result: unknown;
|
|
97
|
+
}>;
|
|
98
|
+
eventCount: number;
|
|
99
|
+
activeStep?: number;
|
|
100
|
+
error?: string;
|
|
101
|
+
startedAt: string;
|
|
102
|
+
updatedAt: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Final result of a completed execution.
|
|
106
|
+
*/
|
|
107
|
+
interface ExecutionResult {
|
|
108
|
+
response: string;
|
|
109
|
+
sessionId: string;
|
|
110
|
+
usage: {
|
|
111
|
+
inputTokens?: number;
|
|
112
|
+
outputTokens?: number;
|
|
113
|
+
totalTokens?: number;
|
|
114
|
+
};
|
|
115
|
+
toolCalls: Array<{
|
|
116
|
+
name: string;
|
|
117
|
+
result: unknown;
|
|
118
|
+
}>;
|
|
119
|
+
}
|
|
120
|
+
interface ExecutionErrorRecord {
|
|
121
|
+
name: string;
|
|
122
|
+
message: string;
|
|
123
|
+
stack?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A persisted checkpoint captured at a specific phase boundary during
|
|
127
|
+
* execution. Checkpoints enable resume-from-last-safe-point on crash.
|
|
128
|
+
*/
|
|
129
|
+
interface ExecutionCheckpointRecord {
|
|
130
|
+
/** Unique checkpoint identifier (provider-generated). */
|
|
131
|
+
id: string;
|
|
132
|
+
/** Session that owns this checkpoint. */
|
|
133
|
+
sessionId: string;
|
|
134
|
+
/** Phase boundary that triggered this checkpoint. */
|
|
135
|
+
reason: string;
|
|
136
|
+
/** Snapshot of execution state at checkpoint time. */
|
|
137
|
+
snapshot: ExecutionSnapshot;
|
|
138
|
+
/** ISO timestamp when this checkpoint was recorded. */
|
|
139
|
+
createdAt: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Provider-agnostic execution store contract.
|
|
144
|
+
*
|
|
145
|
+
* Runtime providers (Dapr, Temporal, etc.) implement this interface to
|
|
146
|
+
* persist and query agent task execution state. This enables:
|
|
147
|
+
*
|
|
148
|
+
* - Execution lookup and inspection after completion
|
|
149
|
+
* - Crash detection (find `status === "running"` after restart)
|
|
150
|
+
* - Resume from the last checkpoint on the direct (non-workflow) path
|
|
151
|
+
*
|
|
152
|
+
* There is no built-in/in-memory implementation. Durability requires a
|
|
153
|
+
* real runtime provider — if no provider is configured, execution
|
|
154
|
+
* persistence is simply not available.
|
|
155
|
+
*/
|
|
156
|
+
interface ExecutionStore {
|
|
157
|
+
/** Optional lifecycle hook called on runtime start. */
|
|
158
|
+
start?(): Promise<void>;
|
|
159
|
+
/** Optional lifecycle hook called on runtime stop. */
|
|
160
|
+
stop?(): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Get the execution record for a session.
|
|
163
|
+
* Returns `undefined` if no execution exists for the given session.
|
|
164
|
+
*/
|
|
165
|
+
get(sessionId: string): Promise<ExecutionRunRecord | undefined>;
|
|
166
|
+
/**
|
|
167
|
+
* List all known execution records.
|
|
168
|
+
* Providers may support optional filtering (e.g. by status) through
|
|
169
|
+
* their own extended options.
|
|
170
|
+
*/
|
|
171
|
+
list(options?: ExecutionListOptions): Promise<ExecutionRunRecord[]>;
|
|
172
|
+
/**
|
|
173
|
+
* List checkpoints for a specific execution, ordered by creation time.
|
|
174
|
+
* Returns an empty array if the session has no checkpoints.
|
|
175
|
+
*/
|
|
176
|
+
listGenericCheckpoints(sessionId: string): Promise<ExecutionCheckpointRecord[]>;
|
|
177
|
+
/**
|
|
178
|
+
* Remove an execution record and all its checkpoints.
|
|
179
|
+
* Returns `true` if the record existed and was removed.
|
|
180
|
+
*/
|
|
181
|
+
remove?(sessionId: string): Promise<boolean>;
|
|
182
|
+
/**
|
|
183
|
+
* Clean up old execution records according to provider-specific
|
|
184
|
+
* retention policies. This is an optional maintenance operation.
|
|
185
|
+
*/
|
|
186
|
+
cleanup?(options?: Record<string, unknown>): Promise<ExecutionCleanupResult>;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Options for listing executions. Providers may extend this with their
|
|
190
|
+
* own filter capabilities.
|
|
191
|
+
*/
|
|
192
|
+
interface ExecutionListOptions {
|
|
193
|
+
/** Filter by execution status. */
|
|
194
|
+
status?: ExecutionStatus | ExecutionStatus[];
|
|
195
|
+
/** Maximum number of records to return. */
|
|
196
|
+
limit?: number;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Result of an execution store cleanup operation.
|
|
200
|
+
*/
|
|
201
|
+
interface ExecutionCleanupResult {
|
|
202
|
+
/** Number of execution records deleted. */
|
|
203
|
+
deletedExecutions: number;
|
|
204
|
+
/** Number of checkpoint records deleted. */
|
|
205
|
+
deletedCheckpoints: number;
|
|
206
|
+
}
|
|
207
|
+
|
|
43
208
|
declare function normalizeSchedule(input: RuntimeJobScheduleInput): RuntimeJobSchedule;
|
|
44
209
|
declare function computeNextRunAtMs(schedule: RuntimeJobSchedule, nowMs: number): number | undefined;
|
|
45
210
|
|
|
46
|
-
export { PROMETHEUS_TEXT_CONTENT_TYPE, type PrometheusHistogramBucketSample, type PrometheusHistogramSample, type PrometheusMetricSample, type PrometheusRuntimeMetrics, type PrometheusRuntimeMetricsOptions, type PrometheusRuntimeMetricsSnapshot, RuntimeJobSchedule, RuntimeJobScheduleInput, RuntimeObserver, computeNextRunAtMs, createPrometheusRuntimeMetrics, normalizeSchedule };
|
|
211
|
+
export { type ExecutionCheckpointRecord, type ExecutionCleanupResult, type ExecutionErrorRecord, type ExecutionListOptions, type ExecutionResult, type ExecutionRunRecord, type ExecutionSnapshot, type ExecutionStatus, type ExecutionStore, PROMETHEUS_TEXT_CONTENT_TYPE, type PrometheusHistogramBucketSample, type PrometheusHistogramSample, type PrometheusMetricSample, type PrometheusRuntimeMetrics, type PrometheusRuntimeMetricsOptions, type PrometheusRuntimeMetricsSnapshot, RuntimeJobSchedule, RuntimeJobScheduleInput, RuntimeObserver, computeNextRunAtMs, createPrometheusRuntimeMetrics, normalizeSchedule };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AgentOrchestrator, a as AgentOrchestratorOptions, I as InMemoryOrchestratorRunStore, O as OrchestratorCloseOptions, b as OrchestratorExecutionContext, c as OrchestratorExecutor, d as OrchestratorGuideInput, e as OrchestratorGuidedInputResolver, f as OrchestratorInvokeInput, g as OrchestratorInvokeResult, h as OrchestratorJobPayload, i as OrchestratorListOptions, j as OrchestratorRunMode, k as OrchestratorRunRecord, l as OrchestratorRunState, m as OrchestratorRunStatus, n as OrchestratorRunStore, o as OrchestratorWaitOptions, w as createAgentOrchestrator, y as isTerminalRunStatus } from '../index-
|
|
2
|
-
import '../types-
|
|
3
|
-
import '../driver-
|
|
1
|
+
export { A as AgentOrchestrator, a as AgentOrchestratorOptions, I as InMemoryOrchestratorRunStore, O as OrchestratorCloseOptions, b as OrchestratorExecutionContext, c as OrchestratorExecutor, d as OrchestratorGuideInput, e as OrchestratorGuidedInputResolver, f as OrchestratorInvokeInput, g as OrchestratorInvokeResult, h as OrchestratorJobPayload, i as OrchestratorListOptions, j as OrchestratorRunMode, k as OrchestratorRunRecord, l as OrchestratorRunState, m as OrchestratorRunStatus, n as OrchestratorRunStore, o as OrchestratorWaitOptions, w as createAgentOrchestrator, y as isTerminalRunStatus } from '../index-acbJQol3.js';
|
|
2
|
+
import '../types-AoJlEcyK.js';
|
|
3
|
+
import '../driver-CQg5G_ey.js';
|
|
@@ -99,4 +99,4 @@ interface RuntimeDeadLetterEvent<TPayload = unknown> {
|
|
|
99
99
|
error: string;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
export type { RuntimeJobRecord as R, RuntimeExecutionContext as a, RuntimeExecutor as b,
|
|
102
|
+
export type { RuntimeJobRecord as R, RuntimeExecutionContext as a, RuntimeExecutor as b, RuntimeRunResult as c, RuntimeJobSchedule as d, RuntimeJobScheduleInput as e, RuntimeAtSchedule as f, RuntimeAtScheduleInput as g, RuntimeCronSchedule as h, RuntimeDeadLetterEvent as i, RuntimeDispatchInput as j, RuntimeEverySchedule as k, RuntimeExecutionResult as l, RuntimeJobState as m, RuntimeRetryPolicy as n, RuntimeRetryStrategy as o, RuntimeRunStatus as p, RuntimeScheduleInput as q, RuntimeSchedulePatch as r, RuntimeTrigger as s };
|
package/dist/workload/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as RuntimeExecutionContext, R as RuntimeJobRecord, b as RuntimeExecutor } from '../types-
|
|
1
|
+
import { a as RuntimeExecutionContext, R as RuntimeJobRecord, b as RuntimeExecutor } from '../types-AoJlEcyK.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Context exposed to domain workloads that run inside `WorkloadRuntime`.
|
package/package.json
CHANGED