@effect-agent/platform-node 0.1.0-beta.45 → 0.1.0-beta.47
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/NodeDurableAgentRuntime-Ceye0Exk.d.mts +170 -0
- package/dist/NodeDurableAgentRuntime.d.mts +2 -0
- package/dist/NodeDurableAgentRuntime.mjs +217 -0
- package/dist/NodeDurableAgentRuntime.mjs.map +1 -0
- package/dist/NodeDurableHost.d.mts +120 -0
- package/dist/NodeDurableHost.mjs +90 -0
- package/dist/NodeDurableHost.mjs.map +1 -0
- package/dist/NodeScheduling.d.mts +22 -0
- package/dist/NodeScheduling.mjs +59 -0
- package/dist/NodeScheduling.mjs.map +1 -0
- package/dist/NodeSubscriptions.d.mts +27 -0
- package/dist/NodeSubscriptions.mjs +103 -0
- package/dist/NodeSubscriptions.mjs.map +1 -0
- package/dist/NodeWakeScheduler-DWdHIhWA.d.mts +27 -0
- package/dist/NodeWakeScheduler.d.mts +2 -0
- package/dist/NodeWakeScheduler.mjs +61 -0
- package/dist/NodeWakeScheduler.mjs.map +1 -0
- package/dist/{workflow.d.mts → NodeWorkflow.d.mts} +3 -3
- package/dist/{workflow.mjs → NodeWorkflow.mjs} +32 -6
- package/dist/NodeWorkflow.mjs.map +1 -0
- package/dist/index.d.mts +6 -313
- package/dist/index.mjs +6 -444
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +1 -1
- package/src/{layers.ts → NodeDurableAgentRuntime.ts} +24 -17
- package/src/{host.ts → NodeDurableHost.ts} +24 -16
- package/src/{scheduling.ts → NodeScheduling.ts} +7 -5
- package/src/{subscriptions.ts → NodeSubscriptions.ts} +17 -13
- package/src/{wake-scheduler.ts → NodeWakeScheduler.ts} +3 -2
- package/src/{workflow.ts → NodeWorkflow.ts} +52 -3
- package/src/index.ts +5 -5
- package/dist/index.mjs.map +0 -1
- package/dist/workflow.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,313 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
//#region src/wake-scheduler.d.ts
|
|
8
|
-
declare const NodeWakeSchedulerConfig_base: Context.ServiceClass<NodeWakeSchedulerConfig, "@effect-agent/platform-node/NodeWakeSchedulerConfig", {
|
|
9
|
-
/** Interval between ledger scans that re-emit every nonterminal Thread lane. */
|
|
10
|
-
readonly scanInterval: Duration.Duration;
|
|
11
|
-
}>;
|
|
12
|
-
/** Cadence authority for the Node wake scheduler's ledger-scan fallback loop. */
|
|
13
|
-
declare class NodeWakeSchedulerConfig extends NodeWakeSchedulerConfig_base {
|
|
14
|
-
static layer(options: {
|
|
15
|
-
readonly scanInterval: Duration.Duration;
|
|
16
|
-
}): Layer.Layer<NodeWakeSchedulerConfig>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* In-process Node `WakeScheduler`: `notify` publishes to a bounded sliding PubSub for prompt
|
|
20
|
-
* same-process wakeups, and every `wakes` subscription additionally runs a periodic
|
|
21
|
-
* `SubmissionLedger.scanNonterminal` fallback so a dropped, coalesced, or never-sent notification
|
|
22
|
-
* can never strand accepted work (persistence §14). Delivery may duplicate; consumers already
|
|
23
|
-
* treat wakes as pure liveness hints.
|
|
24
|
-
*/
|
|
25
|
-
declare const nodeWakeSchedulerLayer: Layer.Layer<WakeScheduler, never, SubmissionLedger | NodeWakeSchedulerConfig>;
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/layers.d.ts
|
|
28
|
-
declare const NodePlatformConfigError_base: Schema.Class<NodePlatformConfigError, Schema.TaggedStruct<"NodePlatformConfigError", {
|
|
29
|
-
readonly message: Schema.String;
|
|
30
|
-
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
31
|
-
}>, import("effect/Cause").YieldableError>;
|
|
32
|
-
/** The supplied Node durable runtime configuration failed schema validation (DEPLOY-003). */
|
|
33
|
-
declare class NodePlatformConfigError extends NodePlatformConfigError_base {}
|
|
34
|
-
declare const NodeDurableAgentRuntimeConfigValue_base: Schema.Class<NodeDurableAgentRuntimeConfigValue, Schema.Struct<{
|
|
35
|
-
/** SQLite database file backing BOTH the Thread Log and the Submission Ledger. */
|
|
36
|
-
readonly filename: Schema.NonEmptyString;
|
|
37
|
-
readonly deploymentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/DeploymentId">;
|
|
38
|
-
readonly producerId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ProducerId">;
|
|
39
|
-
/** Submission ownership lease duration (D5); liveness hint only, epochs stay authoritative. */
|
|
40
|
-
readonly ownershipLeaseDuration: Schema.Int;
|
|
41
|
-
/** Finite bound on concurrent worker loops per host (rule 10). */
|
|
42
|
-
readonly workerConcurrency: Schema.Int;
|
|
43
|
-
/** Ledger-scan fallback cadence of the Node wake scheduler (deployment §3). */
|
|
44
|
-
readonly wakeScanInterval: Schema.Int;
|
|
45
|
-
/** `awaitSettlement` ledger re-check cadence when no wake arrives. */
|
|
46
|
-
readonly settlementPollInterval: Schema.Int;
|
|
47
|
-
/** Worker ownership-lease renewal cadence. */
|
|
48
|
-
readonly leaseRenewalInterval: Schema.Int;
|
|
49
|
-
/** Active-Run abort-intent poll cadence. */
|
|
50
|
-
readonly abortPollInterval: Schema.Int;
|
|
51
|
-
/** Bounded SQLITE_BUSY retry window for write-lock acquisition. */
|
|
52
|
-
readonly busyTimeout: Schema.Int;
|
|
53
|
-
/** Canonical observation poll cadence of the SQLite store. */
|
|
54
|
-
readonly observationPollInterval: Schema.Int;
|
|
55
|
-
/** Opt-in full payload/digest-chain audit while opening the store. */
|
|
56
|
-
readonly verifyOnOpen: Schema.Boolean;
|
|
57
|
-
}>, {}>;
|
|
58
|
-
/**
|
|
59
|
-
* Validated Node durable runtime configuration (deployment §4: decoded once during Layer
|
|
60
|
-
* construction, exposed as a typed service). Every cadence is in milliseconds and every bound is
|
|
61
|
-
* finite; `workerConcurrency` caps how many worker loops `NodeDurableHost.runWorkers` drives.
|
|
62
|
-
*/
|
|
63
|
-
declare class NodeDurableAgentRuntimeConfigValue extends NodeDurableAgentRuntimeConfigValue_base {}
|
|
64
|
-
declare const NodeDurableAgentRuntimeConfig_base: Context.ServiceClass<NodeDurableAgentRuntimeConfig, "@effect-agent/platform-node/NodeDurableAgentRuntimeConfig", NodeDurableAgentRuntimeConfigValue>;
|
|
65
|
-
/** Explicit configuration authority for the assembled Node durable runtime. */
|
|
66
|
-
declare class NodeDurableAgentRuntimeConfig extends NodeDurableAgentRuntimeConfig_base {}
|
|
67
|
-
/**
|
|
68
|
-
* Raw (unvalidated) construction options for `NodeDurableAgentRuntime.layer`. Optional fields default
|
|
69
|
-
* to the documented production values; everything is schema-decoded into
|
|
70
|
-
* `NodeDurableAgentRuntimeConfigValue` before any resource opens (deployment §5 gate 1).
|
|
71
|
-
*/
|
|
72
|
-
interface NodeDurableAgentRuntimeOptions<ContextError = never, ContextRequirements = never, AuthorizationError = never, AuthorizationRequirements = never> {
|
|
73
|
-
readonly filename: string;
|
|
74
|
-
readonly deploymentId: string;
|
|
75
|
-
readonly producerId: string;
|
|
76
|
-
/** Milliseconds; default `DEFAULT_OWNERSHIP_LEASE_DURATION` (30s, D5). */
|
|
77
|
-
readonly ownershipLeaseDuration?: number | undefined;
|
|
78
|
-
/** Default 1; bounded to 1..64. */
|
|
79
|
-
readonly workerConcurrency?: number | undefined;
|
|
80
|
-
/** Milliseconds; default 1000. */
|
|
81
|
-
readonly wakeScanInterval?: number | undefined;
|
|
82
|
-
/** Milliseconds; default 500. */
|
|
83
|
-
readonly settlementPollInterval?: number | undefined;
|
|
84
|
-
/** Milliseconds; default 10000. */
|
|
85
|
-
readonly leaseRenewalInterval?: number | undefined;
|
|
86
|
-
/** Milliseconds; default 500. */
|
|
87
|
-
readonly abortPollInterval?: number | undefined;
|
|
88
|
-
/** Deployment-owned pricing authority used by durable cost budgets and settlements. */
|
|
89
|
-
readonly estimateCostMicrousd?: RunCostEstimator | undefined;
|
|
90
|
-
/** Closed trusted Tool failure reporting. Omission masks ambient observers at construction. */
|
|
91
|
-
readonly toolFailureObserver?: RunToolFailureObserver | undefined;
|
|
92
|
-
/** Milliseconds; default 5000. */
|
|
93
|
-
readonly busyTimeout?: number | undefined;
|
|
94
|
-
/** Milliseconds; default 25. */
|
|
95
|
-
readonly observationPollInterval?: number | undefined;
|
|
96
|
-
/** Default false. */
|
|
97
|
-
readonly verifyOnOpen?: boolean | undefined;
|
|
98
|
-
/** SQLite adapter fault injection (`ledger:*` / `append:*` locations); default none. */
|
|
99
|
-
readonly storageFailpoint?: SqliteStorageFailpointHandler | undefined;
|
|
100
|
-
/** Coordinator fault injection (`submit:*` / `terminalize:*` locations); default none. */
|
|
101
|
-
readonly runtimeFailpoint?: DurableRuntimeFailpointHandler | undefined;
|
|
102
|
-
/**
|
|
103
|
-
* Reconciliation policy consulted for open ordinary Tool Calls before an Unknown Outcome is
|
|
104
|
-
* recorded (durability §10, DUR-009). Defaults to the fail-closed `ToolReconciler.uncertain`:
|
|
105
|
-
* with no registered policy, every open call stays Unknown and routes to the authorized
|
|
106
|
-
* DUR-017 resolution path.
|
|
107
|
-
*/
|
|
108
|
-
readonly toolReconciler?: Layer.Layer<ToolReconciler> | undefined;
|
|
109
|
-
/** Host prompt preparation/compaction, acquired once with the runtime; default pass-through. */
|
|
110
|
-
readonly runContext?: Layer.Layer<RunContextPreparation, ContextError, ContextRequirements | Crypto.Crypto> | undefined;
|
|
111
|
-
/**
|
|
112
|
-
* Independent action-time Tool authority, acquired once with the runtime; default allow-all.
|
|
113
|
-
* Construction errors and application dependencies remain in the assembled Layer's E and R.
|
|
114
|
-
* The platform supplies Crypto to both extension Layers.
|
|
115
|
-
*/
|
|
116
|
-
readonly toolAuthorization?: Layer.Layer<RunToolAuthorization, AuthorizationError, AuthorizationRequirements | Crypto.Crypto> | undefined;
|
|
117
|
-
}
|
|
118
|
-
/** Built-in construction failures. `layer` also preserves supplied service Layers' errors. */
|
|
119
|
-
type NodeDurableAgentRuntimeInitializationError = NodePlatformConfigError | SqliteStorageInitializationError;
|
|
120
|
-
/** The services `NodeDurableAgentRuntime.layer` provides. */
|
|
121
|
-
type NodeDurableAgentRuntimeServices = DurableAgentRuntime | SubmissionLedger | ThreadStore | ScheduleStore | WakeScheduler | DurableRuntimeConfig | NodeDurableAgentRuntimeConfig;
|
|
122
|
-
/**
|
|
123
|
-
* Shutdown-drain decorator for a `SubmissionLedger` (deployment §6 step 6): every ownership
|
|
124
|
-
* period granted through this Layer is tracked — claims start tracking, renewals follow token
|
|
125
|
-
* rotation, releases and settlement finalizations stop it — and every ownership still held when
|
|
126
|
-
* the Layer's Scope closes is released so another host can claim the lane immediately instead of
|
|
127
|
-
* waiting for lease expiry. The drain is a liveness courtesy only; producer-epoch fencing remains
|
|
128
|
-
* the correctness authority (DUR-006), and a forced kill simply falls back to lease expiry.
|
|
129
|
-
*/
|
|
130
|
-
declare const ownershipDrainLayer: Layer.Layer<SubmissionLedger, never, SubmissionLedger>;
|
|
131
|
-
/**
|
|
132
|
-
* The DN Layer assembly (deployment §12: a Layer-assembly library, not an app entrypoint).
|
|
133
|
-
* `layer(options)` decodes the configuration, opens ONE SQLite database serving both the
|
|
134
|
-
* Thread Log and the Submission Ledger (so claims fence the same producer epochs), wires
|
|
135
|
-
* the Node wake scheduler with its ledger-scan fallback, wraps the ledger with the shutdown
|
|
136
|
-
* ownership drain, defaults the Tool reconciliation policy to the fail-closed
|
|
137
|
-
* `ToolReconciler.uncertain` (override via `options.toolReconciler`), and provides a ready
|
|
138
|
-
* `DurableAgentRuntime` on top. Storage compatibility is
|
|
139
|
-
* verified during construction: an incompatible database file fails the Layer with
|
|
140
|
-
* `SqliteStorageCompatibilityError` before anything is mutated (DEPLOY-008).
|
|
141
|
-
*/
|
|
142
|
-
declare class NodeDurableAgentRuntime {
|
|
143
|
-
/** Validated configuration Layer; fails typed when the supplied options are out of bounds. */
|
|
144
|
-
static configLayer<ContextError = never, ContextRequirements = never, AuthorizationError = never, AuthorizationRequirements = never>(options: NodeDurableAgentRuntimeOptions<ContextError, ContextRequirements, AuthorizationError, AuthorizationRequirements>): Layer.Layer<NodeDurableAgentRuntimeConfig, NodePlatformConfigError>;
|
|
145
|
-
/** The full DN runtime stack over one SQLite file. */
|
|
146
|
-
static layer<ContextError = never, ContextRequirements = never, AuthorizationError = never, AuthorizationRequirements = never>(options: NodeDurableAgentRuntimeOptions<ContextError, ContextRequirements, AuthorizationError, AuthorizationRequirements>): Layer.Layer<NodeDurableAgentRuntimeServices, NodeDurableAgentRuntimeInitializationError | ContextError | AuthorizationError, Exclude<ContextRequirements | AuthorizationRequirements, Crypto.Crypto>>;
|
|
147
|
-
/** Own typed executable registrations for every worker using this Node runtime. */
|
|
148
|
-
static layerRegistered<const Entries extends ReadonlyArray<AgentRegistration>, ContextError = never, ContextRequirements = never, AuthorizationError = never, AuthorizationRequirements = never>(registrations: Entries, options: NodeDurableAgentRuntimeOptions<ContextError, ContextRequirements, AuthorizationError, AuthorizationRequirements>): Layer.Layer<NodeDurableAgentRuntimeServices, AuthorizationError | ContextError | import("@effect-agent/thread").DigestError | NodePlatformConfigError | SqliteStorageInitializationError, Exclude<AuthorizationRequirements, Crypto.Crypto> | Exclude<ContextRequirements, Crypto.Crypto> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<[Entries[number]] extends [never] ? never : Entries[number] extends (infer T_2) ? T_2 extends Entries[number] ? T_2 extends {
|
|
149
|
-
readonly attemptLayer: (context: import("@effect-agent/thread").AgentAttemptContext) => Layer.Layer<infer Provides, never, infer Requires>;
|
|
150
|
-
} ? Requires | Exclude<T_2 extends (infer T_3) ? T_3 extends T_2 ? T_3 extends {
|
|
151
|
-
readonly agent: infer A extends import("@effect-agent/thread").ExecutableAgentBinding;
|
|
152
|
-
} ? import("@effect-agent/thread").DurableWorkerRequirements<A> : T_3 extends {
|
|
153
|
-
readonly agent: infer D extends import("@effect-agent/core").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("@effect-agent/core").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown> & {
|
|
154
|
-
readonly instructions: import("@effect-agent/core").InstructionSource<never, unknown, unknown>;
|
|
155
|
-
readonly inputPrompt?: import("@effect-agent/core").InputPromptSource<never, unknown, unknown> | undefined;
|
|
156
|
-
};
|
|
157
|
-
readonly model: infer M extends import("@effect-agent/thread").ExecutableAgentBinding["model"];
|
|
158
|
-
} ? import("@effect-agent/thread").DurableWorkerRequirements<{
|
|
159
|
-
readonly definition: D;
|
|
160
|
-
readonly model: M;
|
|
161
|
-
}> : never : never : never, Provides> : T_2 extends {
|
|
162
|
-
readonly agent: infer A extends import("@effect-agent/thread").ExecutableAgentBinding;
|
|
163
|
-
} ? import("@effect-agent/thread").DurableWorkerRequirements<A> : T_2 extends {
|
|
164
|
-
readonly agent: infer D extends import("@effect-agent/core").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("@effect-agent/core").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown> & {
|
|
165
|
-
readonly instructions: import("@effect-agent/core").InstructionSource<never, unknown, unknown>;
|
|
166
|
-
readonly inputPrompt?: import("@effect-agent/core").InputPromptSource<never, unknown, unknown> | undefined;
|
|
167
|
-
};
|
|
168
|
-
readonly model: infer M extends import("@effect-agent/thread").ExecutableAgentBinding["model"];
|
|
169
|
-
} ? import("@effect-agent/thread").DurableWorkerRequirements<{
|
|
170
|
-
readonly definition: D;
|
|
171
|
-
readonly model: M;
|
|
172
|
-
}> : never : never : never, import("effect/Scope").Scope>, DurableRuntimeConfig | ScheduleStore | SubmissionLedger | ThreadStore | WakeScheduler>, DurableRuntimeFailpoint | NodeWakeSchedulerConfig | ToolReconciler>, Crypto.Crypto | import("effect/unstable/sql/SqlClient").SqlClient | SqliteClient.SqliteClient | SqliteStorageConfig | import("@effect-agent/storage-sqlite").SqliteStorageFailpoint>, NodeDurableAgentRuntimeConfig>, RunContextPreparation | RunToolAuthorization>>;
|
|
173
|
-
/** Construct from registrations already resolved within the enclosing application Scope. */
|
|
174
|
-
static layerWithBindings<ContextError = never, ContextRequirements = never, AuthorizationError = never, AuthorizationRequirements = never>(bindings: ReadonlyArray<ResolvedBinding>, options: NodeDurableAgentRuntimeOptions<ContextError, ContextRequirements, AuthorizationError, AuthorizationRequirements>): Layer.Layer<NodeDurableAgentRuntimeServices, AuthorizationError | ContextError | NodePlatformConfigError | SqliteStorageInitializationError, Exclude<AuthorizationRequirements, Crypto.Crypto> | Exclude<ContextRequirements, Crypto.Crypto>>;
|
|
175
|
-
private static assemble;
|
|
176
|
-
}
|
|
177
|
-
//#endregion
|
|
178
|
-
//#region src/host.d.ts
|
|
179
|
-
declare const AdmissionClosed_base: Schema.Class<AdmissionClosed, Schema.TaggedStruct<"AdmissionClosed", {
|
|
180
|
-
readonly message: Schema.String;
|
|
181
|
-
}>, import("effect/Cause").YieldableError>;
|
|
182
|
-
/**
|
|
183
|
-
* Admission is not open on this host: it is shutting down (deployment §6 step 1, DEPLOY-005).
|
|
184
|
-
* Accepted work is unaffected — only NEW admissions are refused.
|
|
185
|
-
*/
|
|
186
|
-
declare class AdmissionClosed extends AdmissionClosed_base {}
|
|
187
|
-
declare const NodeDurableHost_base: Context.ServiceClass<NodeDurableHost, "@effect-agent/platform-node/NodeDurableHost", {
|
|
188
|
-
/**
|
|
189
|
-
* The recovery decisions executed (or deferred) by this host's startup reconciliation.
|
|
190
|
-
* Reports with the `unknown` disposition identify lanes blocked on Unknown Outcomes that
|
|
191
|
-
* only the authorized DUR-017 resolution path can release.
|
|
192
|
-
*/
|
|
193
|
-
readonly startupRecovery: ReadonlyArray<RecoveryReport>;
|
|
194
|
-
/** Admission-role readiness (deployment §7): true until shutdown begins. */
|
|
195
|
-
readonly admissionOpen: Effect.Effect<boolean>;
|
|
196
|
-
/** `DurableAgentRuntime.submit` behind the host admission gate. */
|
|
197
|
-
readonly submit: <InputSchema extends Schema.Top>(agent: DurableSubmitAgent<InputSchema>, input: InputSchema["Type"], options: DurableSubmitOptions) => Effect.Effect<Receipt, AdmissionClosed | DurableSubmitFailure, InputSchema["EncodingServices"]>;
|
|
198
|
-
readonly awaitSettlement: (receipt: Receipt) => Effect.Effect<Settlement, DurableAwaitFailure>;
|
|
199
|
-
readonly observe: (receipt: Receipt, options?: DurableObserveOptions) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError | ThreadNotMaterialized | OperationDenied>;
|
|
200
|
-
readonly abort: (command: AbortCommand) => Effect.Effect<AbortIntent, DurableAbortFailure>;
|
|
201
|
-
/** `DurableAgentRuntime.explain` — read-only recovery explanation of one Submission (P7). */
|
|
202
|
-
readonly explain: (submissionId: SubmissionId) => Effect.Effect<RecoveryExplanation, DurableExplainFailure>;
|
|
203
|
-
/** `DurableAgentRuntime.explainThread` — explain every nonterminal lane member. */
|
|
204
|
-
readonly explainThread: (threadId: ThreadId) => Effect.Effect<ReadonlyArray<RecoveryExplanation>, DurableExplainFailure>;
|
|
205
|
-
/** `DurableAgentRuntime.verify` — read-only integrity checks, never a repair (P7). */
|
|
206
|
-
readonly verify: (threadId: ThreadId) => Effect.Effect<IntegrityReport, DurableVerifyFailure>;
|
|
207
|
-
/** `DurableAgentRuntime.retry` — audited single-Submission re-drive with typed refusals. */
|
|
208
|
-
readonly retry: (command: RetryCommand) => Effect.Effect<RecoveryReport, DurableRetryFailure>;
|
|
209
|
-
/** `DurableAgentRuntime.wake` — the documented operator liveness nudge for one lane. */
|
|
210
|
-
readonly wake: (threadId: ThreadId) => Effect.Effect<void, OperationDenied>;
|
|
211
|
-
/** `DurableAgentRuntime.scanObligations` — the scan-based DUR-017/OPS-001 report. */
|
|
212
|
-
readonly scanObligations: (thresholds: ObligationThresholds) => Effect.Effect<ObligationReport, DurableObligationFailure>;
|
|
213
|
-
/**
|
|
214
|
-
* Run `workerConcurrency` copies of the given worker effect (typically
|
|
215
|
-
* `DurableAgentRuntime.runWorker(agent)`) until the caller's Scope interrupts them. The
|
|
216
|
-
* bound is the validated finite configuration value; the host never forks daemon fibers.
|
|
217
|
-
*/
|
|
218
|
-
readonly runWorkers: <A, E, R>(worker: Effect.Effect<A, E, R>) => Effect.Effect<void, E, R>;
|
|
219
|
-
/**
|
|
220
|
-
* Run `workerConcurrency` copies of `DurableAgentRuntime.runResolvedWorker` over the host's
|
|
221
|
-
* registered Bindings (S2): every claimed head resolves its exact stored Binding before any
|
|
222
|
-
* code runs (SUB-023), so one bounded pool serves parent and attached-child lanes.
|
|
223
|
-
*/
|
|
224
|
-
readonly runResolvedWorkers: Effect.Effect<void, DurableWorkerFailure | DurableBindingFailure>;
|
|
225
|
-
}>;
|
|
226
|
-
/**
|
|
227
|
-
* Operational host lifecycle for the DN runtime (deployment §2/§5/§6).
|
|
228
|
-
*
|
|
229
|
-
* Startup gates run during Layer construction, so the service existing implies readiness:
|
|
230
|
-
* configuration was schema-decoded, the SQLite file passed the exact-version compatibility check,
|
|
231
|
-
* and every nonterminal Submission went through one full recovery pass BEFORE admission opened.
|
|
232
|
-
* `startupRecovery` is the auditable evidence of that reconciliation pass.
|
|
233
|
-
*
|
|
234
|
-
* Shutdown runs in reverse Layer order when the owning Scope closes: `submit` starts refusing
|
|
235
|
-
* with `AdmissionClosed` first, then the runtime Layer's ownership drain releases every claim
|
|
236
|
-
* still held so another host can take over the lanes immediately, then the SQLite resources
|
|
237
|
-
* close. Forced termination at any point stays safe — the durability protocol, not graceful
|
|
238
|
-
* shutdown, provides correctness (DEPLOY-006).
|
|
239
|
-
*/
|
|
240
|
-
declare class NodeDurableHost extends NodeDurableHost_base {
|
|
241
|
-
/**
|
|
242
|
-
* Compile typed registrations and acquire the complete host in one Layer Scope.
|
|
243
|
-
* Node supplies Crypto; model, tool, instruction, and schema services remain required.
|
|
244
|
-
* Startup recovery and shutdown gates are unchanged. Workers start only when the caller
|
|
245
|
-
* runs runResolvedWorkers; this constructor never starts a background worker.
|
|
246
|
-
*/
|
|
247
|
-
static layerRegistered<const Entries extends ReadonlyArray<AgentRegistration>, ContextError = never, ContextRequirements = never, AuthorizationError = never, AuthorizationRequirements = never>(registrations: Entries, options: NodeDurableAgentRuntimeOptions<ContextError, ContextRequirements, AuthorizationError, AuthorizationRequirements>): Layer.Layer<NodeDurableHost | NodeDurableAgentRuntimeServices, AuthorizationError | ContextError | NodePlatformConfigError | DurableWorkerFailure | import("@effect-agent/storage-sqlite").SqliteStorageInitializationError, Exclude<AuthorizationRequirements, Crypto.Crypto> | Exclude<ContextRequirements, Crypto.Crypto> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<[Entries[number]] extends [never] ? never : Entries[number] extends (infer T_2) ? T_2 extends Entries[number] ? T_2 extends {
|
|
248
|
-
readonly attemptLayer: (context: import("@effect-agent/thread").AgentAttemptContext) => Layer.Layer<infer Provides, never, infer Requires>;
|
|
249
|
-
} ? Requires | Exclude<T_2 extends (infer T_3) ? T_3 extends T_2 ? T_3 extends {
|
|
250
|
-
readonly agent: infer A extends import("@effect-agent/thread").ExecutableAgentBinding;
|
|
251
|
-
} ? import("@effect-agent/thread").DurableWorkerRequirements<A> : T_3 extends {
|
|
252
|
-
readonly agent: infer D extends import("@effect-agent/core").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("@effect-agent/core").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown> & {
|
|
253
|
-
readonly instructions: import("@effect-agent/core").InstructionSource<never, unknown, unknown>;
|
|
254
|
-
readonly inputPrompt?: import("@effect-agent/core").InputPromptSource<never, unknown, unknown> | undefined;
|
|
255
|
-
};
|
|
256
|
-
readonly model: infer M extends import("@effect-agent/thread").ExecutableAgentBinding["model"];
|
|
257
|
-
} ? import("@effect-agent/thread").DurableWorkerRequirements<{
|
|
258
|
-
readonly definition: D;
|
|
259
|
-
readonly model: M;
|
|
260
|
-
}> : never : never : never, Provides> : T_2 extends {
|
|
261
|
-
readonly agent: infer A extends import("@effect-agent/thread").ExecutableAgentBinding;
|
|
262
|
-
} ? import("@effect-agent/thread").DurableWorkerRequirements<A> : T_2 extends {
|
|
263
|
-
readonly agent: infer D extends import("@effect-agent/core").Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, import("@effect-agent/core").RunDispositionDeclaration<never, Schema.Top> | undefined, unknown> & {
|
|
264
|
-
readonly instructions: import("@effect-agent/core").InstructionSource<never, unknown, unknown>;
|
|
265
|
-
readonly inputPrompt?: import("@effect-agent/core").InputPromptSource<never, unknown, unknown> | undefined;
|
|
266
|
-
};
|
|
267
|
-
readonly model: infer M extends import("@effect-agent/thread").ExecutableAgentBinding["model"];
|
|
268
|
-
} ? import("@effect-agent/thread").DurableWorkerRequirements<{
|
|
269
|
-
readonly definition: D;
|
|
270
|
-
readonly model: M;
|
|
271
|
-
}> : never : never : never, import("effect/Scope").Scope>, import("@effect-agent/thread").DurableRuntimeConfig | import("@effect-agent/thread").ScheduleStore | import("@effect-agent/thread").SubmissionLedger | import("@effect-agent/thread").ThreadStore | import("@effect-agent/thread").WakeScheduler>, import("@effect-agent/thread").DurableRuntimeFailpoint | NodeWakeSchedulerConfig | import("@effect-agent/thread").ToolReconciler>, Crypto.Crypto | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect-agent/storage-sqlite").SqliteStorageConfig | import("@effect-agent/storage-sqlite").SqliteStorageFailpoint>, NodeDurableAgentRuntimeConfig>, import("@effect-agent/engine").RunContextPreparation | import("@effect-agent/engine").RunToolAuthorization>>;
|
|
272
|
-
/**
|
|
273
|
-
* Host gates over an assembled `NodeDurableAgentRuntime` stack. The runtime Layer owns
|
|
274
|
-
* executable registrations; omission registers no Agents, so resolved work fails closed.
|
|
275
|
-
*/
|
|
276
|
-
static readonly layer: Layer.Layer<NodeDurableHost, DurableWorkerFailure, DurableAgentRuntime | NodeDurableAgentRuntimeConfig>;
|
|
277
|
-
/** The complete DN host: `NodeDurableAgentRuntime.layer(options)` plus the host lifecycle gates. */
|
|
278
|
-
static layerStack<ContextError = never, ContextRequirements = never, AuthorizationError = never, AuthorizationRequirements = never>(options: NodeDurableAgentRuntimeOptions<ContextError, ContextRequirements, AuthorizationError, AuthorizationRequirements> & {
|
|
279
|
-
readonly bindings?: ReadonlyArray<ResolvedBinding>;
|
|
280
|
-
}): Layer.Layer<NodeDurableHost | NodeDurableAgentRuntimeServices, DurableWorkerFailure | NodeDurableAgentRuntimeInitializationError | ContextError | AuthorizationError, Exclude<ContextRequirements | AuthorizationRequirements, Crypto.Crypto>>;
|
|
281
|
-
}
|
|
282
|
-
//#endregion
|
|
283
|
-
//#region src/scheduling.d.ts
|
|
284
|
-
/** One bounded hint slot for the single supported Node scheduler. Indexed polling repairs loss. */
|
|
285
|
-
declare const nodeScheduleWakeLayer: Layer.Layer<ScheduleWake>;
|
|
286
|
-
interface NodeSchedulingOptions {
|
|
287
|
-
readonly limits?: SchedulingLimits | undefined;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Optional Scope-owned Node scheduling service and driver. The caller must provide the existing
|
|
291
|
-
* host, its SQLite ScheduleStore, and an explicit ScheduleAuthorizer.
|
|
292
|
-
*/
|
|
293
|
-
declare class NodeScheduling {
|
|
294
|
-
static layer(options?: NodeSchedulingOptions): Layer.Layer<Scheduling, ScheduleValidationError, NodeDurableHost | ScheduleStore | ScheduleAuthorizer>;
|
|
295
|
-
}
|
|
296
|
-
//#endregion
|
|
297
|
-
//#region src/subscriptions.d.ts
|
|
298
|
-
/** Ordinary prepared admission through the Scope-owned Node host gate. */
|
|
299
|
-
declare const nodePreparedInputAdmissionLayer: Layer.Layer<PreparedInputAdmission, never, NodeDurableHost>;
|
|
300
|
-
declare const nodeScheduledInputAdmissionLayer: Layer.Layer<ScheduledInputAdmission, never, NodeDurableHost>;
|
|
301
|
-
interface NodeSubscriptionsOptions {
|
|
302
|
-
readonly limits?: SubscriptionLimits | undefined;
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* One Scope-owned subscription partition in the sole process owning its SQLite database.
|
|
306
|
-
* Indexed polling repairs restart and lost wake state; closing the Scope interrupts the driver.
|
|
307
|
-
*/
|
|
308
|
-
declare class NodeSubscriptions {
|
|
309
|
-
static layer(options?: NodeSubscriptionsOptions): Layer.Layer<Subscriptions | SubscriptionIntake, SubscriptionError, NodeDurableHost | SubscriptionStore | SubscriptionAuthorizer | EventSources | SubscriptionInputBindings>;
|
|
310
|
-
}
|
|
311
|
-
//#endregion
|
|
312
|
-
export { AdmissionClosed, NodeDurableAgentRuntime, NodeDurableAgentRuntimeConfig, NodeDurableAgentRuntimeConfigValue, NodeDurableAgentRuntimeInitializationError, NodeDurableAgentRuntimeOptions, NodeDurableAgentRuntimeServices, NodeDurableHost, NodePlatformConfigError, NodeScheduling, NodeSchedulingOptions, NodeSubscriptions, NodeSubscriptionsOptions, NodeWakeSchedulerConfig, nodePreparedInputAdmissionLayer, nodeScheduleWakeLayer, nodeScheduledInputAdmissionLayer, nodeWakeSchedulerLayer, ownershipDrainLayer };
|
|
313
|
-
//# sourceMappingURL=index.d.mts.map
|
|
1
|
+
import { n as NodeWakeScheduler_d_exports } from "./NodeWakeScheduler-DWdHIhWA.mjs";
|
|
2
|
+
import { s as NodeDurableAgentRuntime_d_exports } from "./NodeDurableAgentRuntime-Ceye0Exk.mjs";
|
|
3
|
+
import { t as NodeDurableHost_d_exports } from "./NodeDurableHost.mjs";
|
|
4
|
+
import { t as NodeScheduling_d_exports } from "./NodeScheduling.mjs";
|
|
5
|
+
import { t as NodeSubscriptions_d_exports } from "./NodeSubscriptions.mjs";
|
|
6
|
+
export { NodeDurableAgentRuntime_d_exports as NodeDurableAgentRuntime, NodeDurableHost_d_exports as NodeDurableHost, NodeScheduling_d_exports as NodeScheduling, NodeSubscriptions_d_exports as NodeSubscriptions, NodeWakeScheduler_d_exports as NodeWakeScheduler };
|