@effect-agent/testing 0.1.0-beta.8 → 0.1.0-beta.81

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.
Files changed (54) hide show
  1. package/dist/Certification.d.mts +105 -0
  2. package/dist/Certification.mjs +592 -0
  3. package/dist/Certification.mjs.map +1 -0
  4. package/dist/Chaos.d.mts +126 -0
  5. package/dist/Chaos.mjs +755 -0
  6. package/dist/Chaos.mjs.map +1 -0
  7. package/dist/CodeExecutorConformance.d.mts +33 -0
  8. package/dist/CodeExecutorConformance.mjs +231 -0
  9. package/dist/CodeExecutorConformance.mjs.map +1 -0
  10. package/dist/CodeExecutorSubstitute.d.mts +21 -0
  11. package/dist/CodeExecutorSubstitute.mjs +368 -0
  12. package/dist/CodeExecutorSubstitute.mjs.map +1 -0
  13. package/dist/DocsResearcher.d.mts +270 -0
  14. package/dist/DocsResearcher.mjs +490 -0
  15. package/dist/DocsResearcher.mjs.map +1 -0
  16. package/dist/ScriptedModel-DAvxIiud.d.mts +220 -0
  17. package/dist/ScriptedModel.d.mts +2 -0
  18. package/dist/ScriptedModel.mjs +155 -0
  19. package/dist/ScriptedModel.mjs.map +1 -0
  20. package/dist/TravelPlanner.d.mts +1665 -0
  21. package/dist/TravelPlanner.mjs +1963 -0
  22. package/dist/TravelPlanner.mjs.map +1 -0
  23. package/dist/deterministic-layers-Eka0fMZq.mjs +358 -0
  24. package/dist/deterministic-layers-Eka0fMZq.mjs.map +1 -0
  25. package/dist/index.d.mts +2 -3406
  26. package/dist/index.mjs +2 -4771
  27. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  28. package/package.json +1 -48
  29. package/src/{certification.ts → Certification.ts} +251 -117
  30. package/src/{chaos.ts → Chaos.ts} +246 -122
  31. package/src/{code-executor-conformance.ts → CodeExecutorConformance.ts} +29 -6
  32. package/src/{code-executor-substitute.ts → CodeExecutorSubstitute.ts} +112 -45
  33. package/src/{fixtures/docs-researcher/index.ts → DocsResearcher.ts} +68 -5
  34. package/src/{scripted-model.ts → ScriptedModel.ts} +22 -25
  35. package/src/TravelPlanner.ts +232 -0
  36. package/src/fixtures/docs-researcher/definition.ts +19 -10
  37. package/src/fixtures/docs-researcher/harness.ts +41 -30
  38. package/src/fixtures/docs-researcher/mcp.ts +49 -3
  39. package/src/fixtures/travel-planner/definition.ts +15 -2
  40. package/src/fixtures/travel-planner/deterministic-layers.ts +47 -4
  41. package/src/fixtures/travel-planner/phase2.ts +4 -3
  42. package/src/fixtures/travel-planner/phase3.ts +18 -41
  43. package/src/fixtures/travel-planner/phase4.ts +23 -36
  44. package/src/fixtures/travel-planner/phase5.ts +38 -41
  45. package/src/fixtures/travel-planner/phase6.ts +187 -84
  46. package/src/fixtures/travel-planner/phase7.ts +4 -102
  47. package/src/fixtures/travel-planner/scenarios.ts +3 -4
  48. package/src/fixtures/travel-planner/subagents-durable.ts +33 -57
  49. package/src/fixtures/travel-planner/subagents.ts +35 -13
  50. package/src/index.ts +1 -11
  51. package/dist/index.mjs.map +0 -1
  52. package/src/code-executor-conformance.d.ts +0 -30
  53. package/src/fixtures/travel-planner/index.ts +0 -11
  54. package/src/fixtures/warehouse/index.ts +0 -412
package/dist/index.d.mts CHANGED
@@ -1,3406 +1,2 @@
1
- import { McpConnection, McpConnectionRequest, McpConnector, McpDiscovery, McpServerIdentity, McpToolkitMismatch, RedactionError, Redactor, SubagentPolicy } from "@effect-agent/capabilities";
2
- import { ConversationId, IdGenerator } from "@effect-agent/core";
3
- import { DurableStep, DurableStepError, RuntimeBinding } from "@effect-agent/engine";
4
- import { CanonicalBatch, CanonicalRecordEnvelope, CertificationCaseResult, CertificationReport, CertificationScenario, CertificationSweepResult, CertificationTierThreeReport, ConversationCheckpoint, ConversationProjection, ConversationStore, DefinitionDigests, DurableAgentRuntime, DurableRuntimeConfig, DurableRuntimeFailpointLocation, DurableRuntimeFailpointTestControl, DurableSubmitOptions, IdempotencyKey, ProducerId, Receipt, ResolvedBinding, SubmissionLedger, ToolReconciler, WakeScheduler } from "@effect-agent/session";
5
- import { Cause, Context, Crypto, Duration, Effect, Layer, Option, Schema } from "effect";
6
- import { AiError, LanguageModel, Model, Response, Tool, Toolkit } from "effect/unstable/ai";
7
- import { CodeExecutor, SandboxImplementation } from "@effect-agent/sandbox";
8
- //#region src/certification.d.ts
9
- /**
10
- * P7 WP2 — `certifyDurableAdapters` (plan §1): the one certification entry point a durable
11
- * adapter pair runs to earn a Schema-encoded certificate.
12
- *
13
- * - **Tier 1 — port contract**: the two shared conformance case arrays, verbatim, through
14
- * `certifyPorts` (TEST-004/STORE-010).
15
- * - **Tier 2 — coordinator protocol + failpoint convergence**: the durable coordinator is
16
- * assembled over the CANDIDATE Layer pair with a scripted deterministic model; every
17
- * `DurableRuntimeFailpointLocation` is armed one-shot across the six scenario shapes
18
- * (plain / uncertain-tool / durable-steps / approval / join / delegation). After the injected
19
- * fault the runner asserts the state stays CLASSIFIABLE (recovery + the public unblocking
20
- * operations `resolveUnknown`/`resolveApproval` are the only levers used) and that the
21
- * re-drive CONVERGES to `verifyConversationInvariants` with `requireAllSettled` — including a
22
- * fully discharged digest-chain check, because the runner captures per-batch producer
23
- * identity at append time.
24
- * - **Tier 3 — real loss lever**: recorded honestly. A durable adapter either supplies a
25
- * `CertificationCrashLever` executed in this run, cites its committed real-loss evidence
26
- * (process-kill / eviction suites), or the certificate says `not-exercised`. A non-durable
27
- * reference adapter records `not-applicable`.
28
- *
29
- * The runner is adapter-neutral and platform-neutral: it imports nothing Node-only, so the
30
- * same entry point runs under `@effect/vitest` on Node and inside workerd (storage-cloudflare's
31
- * in-workerd runner). It must run under a TestClock (Tier 1 drives lease expiry through
32
- * virtual time), and requires only `Crypto.Crypto` from the environment.
33
- */
34
- /**
35
- * A real-loss lever supplied by an adapter that wants Tier 3 exercised IN this certification
36
- * run (kill/evict/reopen around a designated row subset). Rows report with
37
- * `suite: "real-loss"`. Failures must be captured per-row — the lever's error channel is
38
- * `never` so a certificate is always produced.
39
- */
40
- type CertificationCrashLever = Effect.Effect<ReadonlyArray<CertificationCaseResult>>;
41
- interface CertifyDurableAdaptersOptions<LedgerE = never, StoreE = never> {
42
- /** Adapter pair identity named by the certificate (durability is read from the ledger). */
43
- readonly adapter: {
44
- readonly name: string;
45
- readonly version?: string | undefined;
46
- };
47
- /**
48
- * The candidate Layer pair. When both ports must share one connection root (the ADR-0011
49
- * "same file" rule), pass the SAME combined Layer instance for both fields — Layer
50
- * memoization builds it once. A candidate may require `Crypto.Crypto` (the memory reference
51
- * does); the certification's own environment supplies nothing else.
52
- */
53
- readonly submissionLedger: Layer.Layer<SubmissionLedger, LedgerE, Crypto.Crypto>;
54
- readonly conversationStore: Layer.Layer<ConversationStore, StoreE, Crypto.Crypto>;
55
- /** Defaults to `WakeScheduler.layerNoop`; the runner re-drives lanes explicitly. */
56
- readonly wakeScheduler?: Layer.Layer<WakeScheduler> | undefined;
57
- /** Executes Tier 3 in this run; takes precedence over `tierThreeEvidence`. */
58
- readonly crashLever?: CertificationCrashLever | undefined;
59
- /** Repository-relative citations of committed real-loss suites (Tier 3 `recorded-evidence`). */
60
- readonly tierThreeEvidence?: ReadonlyArray<string> | undefined;
61
- /**
62
- * The candidate ledger's configured ownership lease (defaults to the D5 default, 30s).
63
- * Every Tier-2 re-drive round advances the TestClock past this lease before reclaiming:
64
- * a live lease may block ALL new claims (the SQL adapters do; the memory reference also
65
- * allows same-producer reclaim), so the adapter-NEUTRAL recovery lever after a mid-Attempt
66
- * fault is lease expiry — exactly the documented D5 liveness mechanism, driven through
67
- * virtual time.
68
- */
69
- readonly ownershipLeaseDuration?: Duration.Duration | undefined;
70
- }
71
- /** The six Tier-2 scenario shapes in sweep order. */
72
- declare const CERTIFICATION_SCENARIOS: ReadonlyArray<CertificationScenario>;
73
- /**
74
- * Coordinator failpoint locations that none of the six scenario shapes can reach, recorded
75
- * honestly instead of silently claimed: all three sit on operator/abort paths the shapes do
76
- * not take. They are pinned in-process by the P5/S2 suites
77
- * (`packages/testing/test/durable-tools.test.ts` "resolveUnknown is idempotent across the
78
- * intent failpoint", `durable-runtime.test.ts` abort rows,
79
- * `durable-subagents.test.ts` abort propagation) and by the process-kill/eviction crash
80
- * matrices. Runner tests assert the observed never-fired set equals EXACTLY this list, so a
81
- * protocol change that silently stops exercising a location fails the certification.
82
- */
83
- declare const TIER2_UNREACHED_LOCATIONS: ReadonlyArray<DurableRuntimeFailpointLocation>;
84
- /** Locations of `tier2` rows whose armed fault never fired in ANY scenario, sorted. */
85
- declare const tier2NeverFiredLocations: (tier2: ReadonlyArray<CertificationSweepResult>) => ReadonlyArray<DurableRuntimeFailpointLocation>;
86
- /**
87
- * Resolve the Tier-3 record honestly (plan §1): a non-durable reference adapter has no real
88
- * loss to exercise (`not-applicable`); a supplied lever runs NOW (`exercised`); committed
89
- * real-loss citations are recorded (`recorded-evidence`); otherwise the certificate says
90
- * `not-exercised` — a scoped statement, never a silent claim.
91
- */
92
- declare const resolveTierThree: (durability: "durable-cloudflare" | "durable-node" | "non-durable", options: {
93
- readonly crashLever?: CertificationCrashLever | undefined;
94
- readonly tierThreeEvidence?: ReadonlyArray<string> | undefined;
95
- }) => Effect.Effect<CertificationTierThreeReport, never, never>;
96
- /**
97
- * Certify one durable adapter pair (plan §1, §8 WP2). Runs Tier 2 FIRST over pristine
98
- * storage (each cell converges to all-settled before the next starts, so the recovery scan
99
- * never sees foreign leftovers), then Tier 1's port contract cases (whose lanes deliberately
100
- * end in every nonterminal shape), then records Tier 3. Requires `Crypto.Crypto` and a
101
- * TestClock-backed environment; the candidate Layers are built exactly once.
102
- */
103
- declare const certifyDurableAdapters: <LedgerE = never, StoreE = never>(options: CertifyDurableAdaptersOptions<LedgerE, StoreE>) => Effect.Effect<CertificationReport, LedgerE | StoreE, Crypto.Crypto>;
104
- //#endregion
105
- //#region src/chaos.d.ts
106
- /**
107
- * P7 WP4 chaos machinery (plan §5): a Schema-first `ChaosPlan`, a seeded generator over
108
- * `effect/testing/FastCheck` (already inside the pinned Effect — no new dependency), and a
109
- * deterministic runner that drives the durable coordinator over whatever adapter pair the test
110
- * provides. Every plan ends in the SAME claims the crash matrices make:
111
- *
112
- * 1. `verifyConversationInvariants` in convergence mode over every touched Conversation (the
113
- * shared WP1 checker — one set of claims for admin verify, certification, chaos, and soak);
114
- * 2. `scanObligations` returning ZERO entries (everything settled; nothing invisibly stuck);
115
- * 3. supplier non-fabrication wherever the deterministic desk was in play (durability §10: no
116
- * canonical Tool success exists that the external store did not actually produce).
117
- *
118
- * Replay contract: the memory/SQLite chaos tests derive every plan from one root seed
119
- * (`CHAOS_SEED` env override; see `chaosSeedFromEnv`) and print that seed plus the failing
120
- * plan's own seed in the failure output, so any red run is replayable byte-for-byte.
121
- */
122
- /** The six durable scenario flavors a chaos lane can exercise (plan §5). */
123
- declare const ChaosScenarioKind: Schema.Literals<readonly ["plain", "uncertain-tool", "durable-steps", "approval", "join", "delegation"]>;
124
- type ChaosScenarioKind = typeof ChaosScenarioKind.Type;
125
- declare const ChaosSubmissionSpec_base: Schema.Class<ChaosSubmissionSpec, Schema.Struct<{
126
- readonly lane: Schema.Int;
127
- /** The lane's flavor; the FIRST spec of a lane fixes the lane's agent. */
128
- readonly kind: Schema.Literals<readonly ["plain", "uncertain-tool", "durable-steps", "approval", "join", "delegation"]>;
129
- }>, {}>;
130
- /** One Submission of a plan: which lane it queues into and that lane's scenario flavor. */
131
- declare class ChaosSubmissionSpec extends ChaosSubmissionSpec_base {}
132
- /** How the runner resolves a durable Unknown Outcome it encounters (DUR-017 driver). */
133
- declare const ChaosResolutionKind: Schema.Literals<readonly ["never-happened", "completed-from-supplier", "abort-submission"]>;
134
- type ChaosResolutionKind = typeof ChaosResolutionKind.Type;
135
- declare const ChaosApprovalDecision: Schema.Literals<readonly ["approved", "denied"]>;
136
- type ChaosApprovalDecision = typeof ChaosApprovalDecision.Type;
137
- declare const ChaosPlan_base: Schema.Class<ChaosPlan, Schema.Struct<{
138
- /** Identifies this plan in failure output; derived from the root seed plus the plan index. */
139
- readonly seed: Schema.Int;
140
- /** Lane count; submissions address lanes `0..lanes-1`. */
141
- readonly lanes: Schema.Int;
142
- readonly submissions: Schema.NonEmptyArray<typeof ChaosSubmissionSpec>;
143
- /** Coordinator failpoint arms, consumed one per round (each fails every hit that round). */
144
- readonly failpointArms: Schema.$Array<Schema.Literals<readonly ["submit:after-admit", "submit:after-materialize", "claim:after-claim", "input:after-canonical-append", "turn:after-canonical-append", "turn:after-response-append", "turn:after-results-append", "compaction:after-canonical-append", "tools:after-prepared-append", "step:after-step-append", "approval:after-request-append", "approval:after-suspend", "join:after-claim", "join:after-canonical-append", "resolve:after-intent", "terminalize:after-reserve", "terminalize:after-canonical-append", "abort:after-intent", "subagent:after-reserve", "subagent:after-request-append", "subagent:after-admit", "subagent:after-child-ready", "subagent:after-start-append", "subagent:after-sibling-settle", "subagent:after-suspend", "subagent:after-child-abort-intent", "subagent:after-join-append", "subagent:after-release-pending", "subagent:after-release"]>>;
145
- /** Adapter-owned failpoint arms (e.g. SQLite `ledger:*`/`append:*` locations). */
146
- readonly adapterArms: Schema.$Array<Schema.String>;
147
- /** Flattened submission indices to abort mid-plan (modulo the submission count). */
148
- readonly abortInjections: Schema.$Array<Schema.Int>;
149
- /** Resolution choices for Unknown Outcomes, indexed deterministically per open call. */
150
- readonly resolutionInjections: Schema.$Array<Schema.Literals<readonly ["never-happened", "completed-from-supplier", "abort-submission"]>>;
151
- /** Approval decisions for suspended approval lanes, indexed deterministically per call. */
152
- readonly approvalDecisions: Schema.$Array<Schema.Literals<readonly ["approved", "denied"]>>;
153
- }>, {}>;
154
- /**
155
- * One seeded chaos plan (plan §5): the full fault schedule is data, so a failing run replays
156
- * from the plan alone. `failpointArms` are coordinator locations; `adapterArms` are
157
- * adapter-owned location names the adapter test validates (the memory runner has none).
158
- */
159
- declare class ChaosPlan extends ChaosPlan_base {}
160
- declare const ChaosLaneReport_base: Schema.Class<ChaosLaneReport, Schema.Struct<{
161
- readonly conversationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ConversationId">;
162
- readonly kind: Schema.Literals<readonly ["plain", "uncertain-tool", "durable-steps", "approval", "join", "delegation"]>;
163
- readonly submissionCount: Schema.Int;
164
- /** Verdict of `verifyConversationInvariants` in convergence mode. */
165
- readonly verified: Schema.Boolean;
166
- }>, {}>;
167
- /** Per-lane verification result inside a plan report. */
168
- declare class ChaosLaneReport extends ChaosLaneReport_base {}
169
- declare const ChaosPlanReport_base: Schema.Class<ChaosPlanReport, Schema.Struct<{
170
- readonly seed: Schema.Int;
171
- readonly rounds: Schema.Int;
172
- readonly lanes: Schema.$Array<typeof ChaosLaneReport>;
173
- /** `scanObligations` entries after convergence — MUST be zero. */
174
- readonly openObligations: Schema.Int;
175
- }>, {}>;
176
- /** The Schema-first outcome of one executed chaos plan. */
177
- declare class ChaosPlanReport extends ChaosPlanReport_base {}
178
- declare const ChaosConvergenceFailure_base: Schema.Class<ChaosConvergenceFailure, Schema.TaggedStruct<"ChaosConvergenceFailure", {
179
- readonly seed: Schema.Int;
180
- readonly message: Schema.String;
181
- }>, Cause.YieldableError>;
182
- /** Typed convergence/verification failure of one chaos plan (never a bare defect). */
183
- declare class ChaosConvergenceFailure extends ChaosConvergenceFailure_base {}
184
- /** Default root seed for chaos suites; override with the `CHAOS_SEED` environment variable. */
185
- declare const DEFAULT_CHAOS_SEED = 20260813;
186
- /** The root seed for this run: `CHAOS_SEED` when set to an integer, the default otherwise. */
187
- declare const chaosSeedFromEnv: (env: Record<string, string | undefined>) => number;
188
- interface ChaosGeneratorOptions {
189
- /** Root seed (print this in failure output for replay). */
190
- readonly seed: number;
191
- /** How many plans to derive. */
192
- readonly count: number;
193
- /** Adapter failpoint location names available to arm (empty for memory). */
194
- readonly adapterArms?: ReadonlyArray<string> | undefined;
195
- }
196
- /**
197
- * Derive `count` chaos plans deterministically from one root seed. The same
198
- * `{seed, count, adapterArms}` triple always yields byte-identical plans, so a failure line
199
- * `CHAOS_SEED=<seed>` replays the exact schedule.
200
- */
201
- declare const generateChaosPlans: (options: ChaosGeneratorOptions) => ReadonlyArray<ChaosPlan>;
202
- /** Adapter-owned failpoint control the SQLite runner supplies; memory has none. */
203
- interface ChaosAdapterFailpoints {
204
- readonly arm: (location: string) => Effect.Effect<void>;
205
- readonly clear: Effect.Effect<void>;
206
- }
207
- interface ChaosRunOptions {
208
- readonly adapterFailpoints?: ChaosAdapterFailpoints | undefined;
209
- /**
210
- * Executed at the end of every round. Adapters whose ownership leases block every new claim
211
- * until expiry (the SQLite ledger's D5 semantics — expiry only revokes the liveness
212
- * assumption; producer epochs stay the correctness fence) pass a deterministic
213
- * `TestClock.adjust` here so a dead Attempt's lane becomes reclaimable next round. The memory
214
- * ledger needs nothing: it allows same-producer reclaim under a live lease.
215
- */
216
- readonly betweenRounds?: Effect.Effect<void> | undefined;
217
- }
218
- /**
219
- * Execute one chaos plan against whatever adapters the ambient Layer provides and end in the
220
- * shared invariant claims. Deterministic: same plan + same adapters → same schedule.
221
- */
222
- declare const runChaosPlan: (plan: ChaosPlan, options?: ChaosRunOptions | undefined) => Effect.Effect<ChaosPlanReport, ChaosConvergenceFailure, ConversationStore | import("effect/Crypto").Crypto | DurableAgentRuntime | DurableRuntimeConfig | DurableRuntimeFailpointTestControl | SubmissionLedger>;
223
- //#endregion
224
- //#region src/code-executor-conformance.d.ts
225
- declare const CodeExecutorConformanceViolation_base: Schema.Class<CodeExecutorConformanceViolation, Schema.TaggedStruct<"CodeExecutorConformanceViolation", {
226
- readonly caseName: Schema.String;
227
- readonly message: Schema.String;
228
- }>, import("effect/Cause").YieldableError>;
229
- /**
230
- * Shared `CodeExecutor` conformance (TEST-015). Every adapter — the
231
- * deterministic `unisolated` substitute and each isolated adapter — runs
232
- * `codeExecutorConformanceCases` verbatim. Enforcement cases that only genuine
233
- * isolation can prove (ambient network denial, synchronous CPU runaway
234
- * termination) are NOT here; they belong to isolated adapters only
235
- * (testing spec §8.1).
236
- *
237
- * Cases assume the live `Clock` (the wall-clock case uses a short real
238
- * deadline) and take one fresh executor pass per case, so a suite may share
239
- * one executor Layer across cases.
240
- */
241
- declare class CodeExecutorConformanceViolation extends CodeExecutorConformanceViolation_base {}
242
- interface CodeExecutorConformanceCase {
243
- readonly name: string;
244
- readonly run: Effect.Effect<void, CodeExecutorConformanceViolation, CodeExecutor>;
245
- }
246
- interface CodeExecutorConformanceOptions {
247
- /** The posture the adapter under test must stamp on results and errors. */
248
- readonly implementation: SandboxImplementation;
249
- }
250
- declare const codeExecutorConformanceCases: (options: CodeExecutorConformanceOptions) => ReadonlyArray<CodeExecutorConformanceCase>;
251
- //#endregion
252
- //#region src/code-executor-substitute.d.ts
253
- /**
254
- * The deterministic in-process executor substitute (C1 of ADR-0017). It runs
255
- * the generated program on the host JavaScript engine with best-effort global
256
- * shadowing only, so it self-identifies as `unisolated` and is never a
257
- * security boundary (CAP-010, CAP-015). It exists to prove the public
258
- * `CodeExecutor` contract and to drive deterministic capability tests.
259
- */
260
- declare const inProcessCodeExecutorImplementation: SandboxImplementation;
261
- /**
262
- * Layer providing the unisolated in-process `CodeExecutor` substitute. The
263
- * per-pass `CodeExecutionHost` stays in the caller's requirement channel, the
264
- * same as every real adapter.
265
- */
266
- declare const inProcessCodeExecutorLayer: Layer.Layer<CodeExecutor>;
267
- //#endregion
268
- //#region src/fixtures/docs-researcher/definition.d.ts
269
- declare const ResearchDocumentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/docs-researcher/ResearchDocumentId">;
270
- type ResearchDocumentId = typeof ResearchDocumentId.Type;
271
- /** Bounded summary text: the ONLY child-derived text that may cross to the parent. */
272
- declare const BoundedSummary: Schema.NonEmptyString;
273
- declare const DocumentQuery_base: Schema.Class<DocumentQuery, Schema.Struct<{
274
- readonly documentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/docs-researcher/ResearchDocumentId">;
275
- }>, {}>;
276
- declare class DocumentQuery extends DocumentQuery_base {}
277
- declare const ResearchDocument_base: Schema.Class<ResearchDocument, Schema.Struct<{
278
- readonly documentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/docs-researcher/ResearchDocumentId">;
279
- readonly title: Schema.NonEmptyString;
280
- readonly body: Schema.NonEmptyString;
281
- }>, {}>;
282
- /** One bounded research document as the MCP content server exposes it. */
283
- declare class ResearchDocument extends ResearchDocument_base {}
284
- declare const DocumentUnavailable_base: Schema.Class<DocumentUnavailable, Schema.TaggedStruct<"DocumentUnavailable", {
285
- readonly documentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/docs-researcher/ResearchDocumentId">;
286
- readonly message: Schema.String;
287
- }>, import("effect/Cause").YieldableError>;
288
- declare class DocumentUnavailable extends DocumentUnavailable_base {}
289
- declare const DocumentLibrary_base: Context.ServiceClass<DocumentLibrary, "@effect-agent/testing/docs-researcher/DocumentLibrary", {
290
- readonly fetch: (query: DocumentQuery) => Effect.Effect<ResearchDocument, DocumentUnavailable>;
291
- }>;
292
- /** The content store behind the scripted MCP server. */
293
- declare class DocumentLibrary extends DocumentLibrary_base {}
294
- /**
295
- * The one content tool the doc-summarizer child uses. Its authored JSON
296
- * schema is what MCP discovery must serve byte-for-byte: the scripted MCP
297
- * fixture derives its discovery entry from `Tool.getJsonSchema(FetchDocument)`
298
- * and `validateMcpDiscovery` re-derives and digests both sides (CAP-009).
299
- */
300
- declare const FetchDocument: Tool.Tool<"fetch_document", {
301
- readonly parameters: typeof DocumentQuery;
302
- readonly success: typeof ResearchDocument;
303
- readonly failure: typeof DocumentUnavailable;
304
- readonly failureMode: "error";
305
- }, DocumentLibrary>;
306
- declare const DocContentToolkit: Toolkit.Toolkit<{
307
- readonly fetch_document: Tool.Tool<"fetch_document", {
308
- readonly parameters: typeof DocumentQuery;
309
- readonly success: typeof ResearchDocument;
310
- readonly failure: typeof DocumentUnavailable;
311
- readonly failureMode: "error";
312
- }, DocumentLibrary>;
313
- }>;
314
- declare const docContentToolkitLayer: import("effect/Layer").Layer<Tool.Handler<"fetch_document">, never, never>;
315
- /** Never allowed outside a child Conversation or an unredacted fixture value. */
316
- declare const docsDocumentBodySecret = "docs-vault-secret-771";
317
- /** The corpus document ids in canonical fixture order. */
318
- declare const researchCorpusDocumentIds: ReadonlyArray<ResearchDocumentId>;
319
- /** Deterministic library lookup shared by the scripted MCP content handlers. */
320
- declare const researchDocumentLookup: (query: DocumentQuery) => Effect.Effect<ResearchDocument, DocumentUnavailable>;
321
- /** The full fixture document (body includes the secret marker — child-side only). */
322
- declare const researchDocumentFor: (documentId: string) => ResearchDocument;
323
- /** The distinctive body phrase used by context-isolation assertions. */
324
- declare const documentBodyPhrase: (documentId: string) => string;
325
- declare const SummaryBrief_base: Schema.Class<SummaryBrief, Schema.Struct<{
326
- readonly documentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/docs-researcher/ResearchDocumentId">;
327
- readonly focus: Schema.NonEmptyString;
328
- }>, {}>;
329
- declare class SummaryBrief extends SummaryBrief_base {}
330
- declare const DocumentSummary_base: Schema.Class<DocumentSummary, Schema.Struct<{
331
- readonly documentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/docs-researcher/ResearchDocumentId">;
332
- readonly summary: Schema.NonEmptyString;
333
- }>, {}>;
334
- declare class DocumentSummary extends DocumentSummary_base {}
335
- /** The summary the scripted child writes after fetching the document. */
336
- declare const documentSummaryFor: (documentId: string) => DocumentSummary;
337
- declare const encodedDocumentSummary: (documentId: string) => string;
338
- declare const DocSummarizer: import("@effect-agent/core").Definition<typeof SummaryBrief, typeof DocumentSummary, "Fetch the briefed document with fetch_document exactly once, then return only a JSON document summary. Never copy raw notes or secrets into the summary.", Toolkit.Toolkit<{
339
- readonly fetch_document: Tool.Tool<"fetch_document", {
340
- readonly parameters: typeof DocumentQuery;
341
- readonly success: typeof ResearchDocument;
342
- readonly failure: typeof DocumentUnavailable;
343
- readonly failureMode: "error";
344
- }, DocumentLibrary>;
345
- }>>;
346
- declare const SummaryRequest_base: Schema.Class<SummaryRequest, Schema.Struct<{
347
- readonly documentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/docs-researcher/ResearchDocumentId">;
348
- }>, {}>;
349
- declare class SummaryRequest extends SummaryRequest_base {}
350
- declare const SummaryFinding_base: Schema.Class<SummaryFinding, Schema.Struct<{
351
- readonly documentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/docs-researcher/ResearchDocumentId">;
352
- readonly summary: Schema.NonEmptyString;
353
- }>, {}>;
354
- declare class SummaryFinding extends SummaryFinding_base {}
355
- declare const DocumentSummaryFailed_base: Schema.Class<DocumentSummaryFailed, Schema.TaggedStruct<"DocumentSummaryFailed", {
356
- readonly childErrorTag: Schema.NonEmptyString;
357
- }>, import("effect/Cause").YieldableError>;
358
- declare class DocumentSummaryFailed extends DocumentSummaryFailed_base {}
359
- /** Finite per-invocation bounds (SUB-009): one fetch per child, two children per Run. */
360
- declare const documentSummaryPolicy: SubagentPolicy;
361
- declare const delegateDocumentSummary: import("@effect-agent/capabilities").SubagentDelegation<"delegate_document_summary", typeof SummaryBrief, typeof DocumentSummary, "Fetch the briefed document with fetch_document exactly once, then return only a JSON document summary. Never copy raw notes or secrets into the summary.", {
362
- readonly fetch_document: Tool.Tool<"fetch_document", {
363
- readonly parameters: typeof DocumentQuery;
364
- readonly success: typeof ResearchDocument;
365
- readonly failure: typeof DocumentUnavailable;
366
- readonly failureMode: "error";
367
- }, DocumentLibrary>;
368
- }, typeof SummaryRequest, typeof SummaryFinding, typeof DocumentSummaryFailed, never, never, "error">;
369
- /** Total mapping from every expected child Run failure to the declared Tool failure (SUB-028). */
370
- declare const mapSummaryChildFailure: (failure: {
371
- readonly _tag: string;
372
- }) => DocumentSummaryFailed;
373
- /** The exact digest strings the durable declaration AND host registration must share (SUB-023). */
374
- declare const docsSummarizerDigestStrings: {
375
- readonly agent: string;
376
- readonly model: string;
377
- readonly tools: string;
378
- };
379
- /** Runtime wiring: the immutable delegation plus one explicit child Binding (S2 declaration). */
380
- declare const docsSummaryHandlersLayer: <Provider, ModelProvides, ModelRequires>(childBinding: RuntimeBinding<typeof SummaryBrief, typeof DocumentSummary, string, Toolkit.Tools<typeof DocContentToolkit>, Provider, ModelProvides, ModelRequires>) => import("effect/Layer").Layer<Tool.Handler<"delegate_document_summary">, never, import("@effect-agent/capabilities").SubagentLayerRequirements<typeof SummaryBrief, typeof DocumentSummary, string, {
381
- readonly fetch_document: Tool.Tool<"fetch_document", {
382
- readonly parameters: typeof DocumentQuery;
383
- readonly success: typeof ResearchDocument;
384
- readonly failure: typeof DocumentUnavailable;
385
- readonly failureMode: "error";
386
- }, DocumentLibrary>;
387
- }, Provider, ModelProvides, ModelRequires, never, never, never, {
388
- readonly _tag: string;
389
- }, never>>;
390
- declare const ResearchRequest_base: Schema.Class<ResearchRequest, Schema.Struct<{
391
- readonly question: Schema.NonEmptyString;
392
- readonly documentIds: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/docs-researcher/ResearchDocumentId">>;
393
- }>, {}>;
394
- declare class ResearchRequest extends ResearchRequest_base {}
395
- declare const ResearchDigest_base: Schema.Class<ResearchDigest, Schema.Struct<{
396
- readonly findings: Schema.$Array<typeof SummaryFinding>;
397
- readonly nextAction: Schema.Literal<"review">;
398
- }>, {}>;
399
- declare class ResearchDigest extends ResearchDigest_base {}
400
- /** Parent-only transcript markers proving child context isolation (SUB-006/SUB-015). */
401
- declare const docsCoordinatorConfidentialMarker = "docs-coordinator-vault-19x";
402
- declare const docsMissionConfidentialMarker = "docs-mission-dossier-42f";
403
- declare const DocsResearcherToolkit: Toolkit.Toolkit<{
404
- readonly delegate_document_summary: Tool.Tool<"delegate_document_summary", {
405
- readonly parameters: typeof SummaryRequest;
406
- readonly success: typeof SummaryFinding;
407
- readonly failure: import("@effect-agent/capabilities").SubagentToolFailure<typeof DocumentSummaryFailed>;
408
- readonly failureMode: "error";
409
- }, import("@effect-agent/engine").AgentSpawner | import("@effect-agent/core").IdGenerator | import("@effect-agent/engine").RunEventSink | import("@effect-agent/engine").SubagentDurability>;
410
- }>;
411
- declare const DocsResearcher: import("@effect-agent/core").Definition<typeof ResearchRequest, typeof ResearchDigest, string, Toolkit.Toolkit<{
412
- readonly delegate_document_summary: Tool.Tool<"delegate_document_summary", {
413
- readonly parameters: typeof SummaryRequest;
414
- readonly success: typeof SummaryFinding;
415
- readonly failure: import("@effect-agent/capabilities").SubagentToolFailure<typeof DocumentSummaryFailed>;
416
- readonly failureMode: "error";
417
- }, import("@effect-agent/engine").AgentSpawner | import("@effect-agent/core").IdGenerator | import("@effect-agent/engine").RunEventSink | import("@effect-agent/engine").SubagentDurability>;
418
- }>>;
419
- /** The default two-document research mission. */
420
- declare const researchMissionRequest: ResearchRequest;
421
- /** The coordinator's expected final digest for the given documents. */
422
- declare const expectedResearchDigest: (documentIds?: ReadonlyArray<string>) => ResearchDigest;
423
- //#endregion
424
- //#region src/fixtures/docs-researcher/harness.d.ts
425
- declare const docsResearcherDeploymentId: string & import("effect/Brand").Brand<"@effect-agent/session/DeploymentId">;
426
- declare const docsResearcherProducerId: string & import("effect/Brand").Brand<"@effect-agent/session/ProducerId">;
427
- declare const docsResearcherPrincipal: string & import("effect/Brand").Brand<"@effect-agent/session/Principal">;
428
- /** Redacted, deterministic coordinator definition digests for this fixture version. */
429
- declare const docsCoordinatorDigests: DefinitionDigests;
430
- /** The child registration digests — byte-equal to `docsSummarizerDigestStrings` (SUB-023). */
431
- declare const docsSummarizerDigests: DefinitionDigests;
432
- /** Durable admission options for one docs-researcher Submission on one mission lane. */
433
- declare const docsResearcherSubmitOptions: (conversationId: ConversationId, idempotencyKey: IdempotencyKey) => DurableSubmitOptions;
434
- /** The structural submit slice of the coordinator Binding (`DurableAgentRuntime.submit`). */
435
- declare const docsResearcherSubmitAgent: {
436
- readonly definition: {
437
- readonly id: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
438
- readonly input: typeof ResearchRequest;
439
- };
440
- };
441
- /** The deterministic delegation Tool Call identity for one document. */
442
- declare const summarizeCallId: (documentId: string) => string;
443
- /** The child's own scripted fetch Tool Call identity for one document. */
444
- declare const fetchCallId: (documentId: string) => string;
445
- /** Optional overrides for one docs-researcher harness. */
446
- interface DocsResearcherHarnessOptions {
447
- /** Documents to research; defaults to the full two-document corpus. */
448
- readonly documentIds?: ReadonlyArray<string> | undefined;
449
- }
450
- /** One durable coordinator/summarizer pair with observable counters and MCP evidence. */
451
- interface DocsResearcherHarness {
452
- /** Host registrations for `NodeDurableRuntimeOptions.bindings` (parent + child). */
453
- readonly bindings: ReadonlyArray<ResolvedBinding>;
454
- /** The validated MCP discovery the child toolkit registration was gated on. */
455
- readonly discovery: McpDiscovery;
456
- /** Total coordinator model invocations across every Attempt and runtime handle. */
457
- readonly parentModelCalls: Effect.Effect<number>;
458
- /** JSON-encoded coordinator prompts in request order. */
459
- readonly parentPrompts: Effect.Effect<ReadonlyArray<string>>;
460
- /** Total summarizer model invocations across every Attempt and runtime handle. */
461
- readonly childModelCalls: Effect.Effect<number>;
462
- /** JSON-encoded summarizer prompts in request order (context-isolation evidence). */
463
- readonly childPrompts: Effect.Effect<ReadonlyArray<string>>;
464
- /** MCP content-tool handler executions for one document (external side-effect record). */
465
- readonly fetchInvocations: (documentId: string) => Effect.Effect<number>;
466
- }
467
- /**
468
- * Build the docs-researcher harness. Order matters and is the point: the
469
- * child's content toolkit is only registered as a worker Binding AFTER the
470
- * MCP connector's bounded discovery validated the authored toolkit
471
- * byte-for-byte (`connectMcp` + `assertDiscoveryMatchesAuthoredToolkit`), so
472
- * "the tools the summarizer runs are the tools discovery served" is enforced
473
- * at assembly, not assumed. Content-tool execution then flows through the
474
- * counting `DocumentLibrary` — the scripted MCP server's content store.
475
- */
476
- declare const makeDocsResearcherHarness: (options?: DocsResearcherHarnessOptions) => Effect.Effect<DocsResearcherHarness, import("@effect-agent/capabilities").McpConnectionError | import("@effect-agent/capabilities").McpDiscoveryLimitExceeded | import("@effect-agent/capabilities").McpToolkitMismatch, Crypto.Crypto>;
477
- /**
478
- * The audit-surface preview of one fetched document: the raw document —
479
- * secret marker and all — passes through the configured structural `Redactor`
480
- * before anything may quote it outside the child Conversation (SEC-008,
481
- * CAP-013). Tests assert the preview keeps shape but no scalar content.
482
- */
483
- declare const redactedDocumentPreview: (documentId: string) => Effect.Effect<string & import("effect/Brand").Brand<"@effect-agent/capabilities/RedactedPreview">, RedactionError, Redactor>;
484
- type DocsResearcherHarnessRequirements = Crypto.Crypto;
485
- //#endregion
486
- //#region src/fixtures/docs-researcher/mcp.d.ts
487
- /** Framework-side hard bounds one docs-researcher assembly requests. */
488
- declare const docsMcpRequest: McpConnectionRequest;
489
- declare const docsMcpIdentity: McpServerIdentity;
490
- /** The well-behaved scripted content server. */
491
- declare const docsMcpConnectorLayer: Layer.Layer<McpConnector>;
492
- /** Serves a tool description exceeding `maxToolDescriptionBytes` (SEC-013 bound). */
493
- declare const docsMcpOversizedConnectorLayer: Layer.Layer<McpConnector>;
494
- /** Serves a discovery schema that disagrees with the authored toolkit (drift fails closed). */
495
- declare const docsMcpMismatchedConnectorLayer: Layer.Layer<McpConnector>;
496
- /**
497
- * Bind DISCOVERY to AUTHORING: `validateMcpDiscovery` (inside `connectMcp`)
498
- * already proved the served discovery matches the connection's own Toolkit;
499
- * this check additionally proves that Toolkit is the exact toolkit the
500
- * doc-summarizer was AUTHORED against — same tool names, same derived JSON
501
- * schemas — so a connector cannot substitute a look-alike toolkit. The
502
- * docs-researcher harness runs it before any worker Binding registration and
503
- * fails closed on any drift.
504
- */
505
- declare const assertDiscoveryMatchesAuthoredToolkit: (connection: McpConnection) => Effect.Effect<void, McpToolkitMismatch, never>;
506
- /** Round-trip guard for encoded discovery values persisted as fixture evidence. */
507
- declare const DocsMcpDiscoveryEvidence: Schema.Struct<{
508
- readonly serverId: Schema.NonEmptyString;
509
- readonly toolCount: Schema.Natural;
510
- readonly encodedBytes: Schema.Natural;
511
- readonly toolkitSchemaDigest: Schema.String;
512
- }>;
513
- //#endregion
514
- //#region src/fixtures/travel-planner/definition.d.ts
515
- declare const AirportCode: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
516
- type AirportCode = typeof AirportCode.Type;
517
- declare const QuoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
518
- type QuoteId = typeof QuoteId.Type;
519
- declare const TripRequest_base: Schema.Class<TripRequest, Schema.Struct<{
520
- readonly request: Schema.NonEmptyString;
521
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
522
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
523
- readonly departOn: Schema.String;
524
- readonly nights: Schema.Int;
525
- readonly travelers: Schema.Int;
526
- readonly budgetCents: Schema.Int;
527
- readonly currency: Schema.Literal<"USD">;
528
- }>, {}>;
529
- declare class TripRequest extends TripRequest_base {}
530
- declare const FlightQuery_base: Schema.Class<FlightQuery, Schema.Struct<{
531
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
532
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
533
- readonly departOn: Schema.String;
534
- readonly travelers: Schema.Int;
535
- }>, {}>;
536
- declare class FlightQuery extends FlightQuery_base {}
537
- declare const LodgingQuery_base: Schema.Class<LodgingQuery, Schema.Struct<{
538
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
539
- readonly departOn: Schema.String;
540
- readonly nights: Schema.Int;
541
- readonly travelers: Schema.Int;
542
- }>, {}>;
543
- declare class LodgingQuery extends LodgingQuery_base {}
544
- declare const ActivityQuery_base: Schema.Class<ActivityQuery, Schema.Struct<{
545
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
546
- readonly departOn: Schema.String;
547
- readonly nights: Schema.Int;
548
- readonly travelers: Schema.Int;
549
- }>, {}>;
550
- declare class ActivityQuery extends ActivityQuery_base {}
551
- declare const FlightOption_base: Schema.Class<FlightOption, Schema.Struct<{
552
- readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
553
- readonly flight: Schema.String;
554
- readonly estimatedCents: Schema.Int;
555
- readonly currency: Schema.Literal<"USD">;
556
- }>, {}>;
557
- declare class FlightOption extends FlightOption_base {}
558
- declare const LodgingOption_base: Schema.Class<LodgingOption, Schema.Struct<{
559
- readonly lodging: Schema.String;
560
- readonly estimatedCents: Schema.Int;
561
- readonly currency: Schema.Literal<"USD">;
562
- }>, {}>;
563
- declare class LodgingOption extends LodgingOption_base {}
564
- declare const ActivitySearchResult_base: Schema.Class<ActivitySearchResult, Schema.Struct<{
565
- readonly activities: Schema.$Array<Schema.String>;
566
- }>, {}>;
567
- /** A successful empty activity search is distinct from supplier unavailability. */
568
- declare class ActivitySearchResult extends ActivitySearchResult_base {}
569
- declare const Itinerary_base: Schema.Class<Itinerary, Schema.Struct<{
570
- readonly title: Schema.String;
571
- readonly route: Schema.String;
572
- readonly dates: Schema.String;
573
- readonly flight: Schema.String;
574
- readonly lodging: Schema.String;
575
- readonly activities: Schema.$Array<Schema.String>;
576
- readonly estimatedTotalCents: Schema.Int;
577
- readonly currency: Schema.Literal<"USD">;
578
- readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
579
- readonly assumptions: Schema.$Array<Schema.String>;
580
- readonly unresolvedConstraints: Schema.$Array<Schema.String>;
581
- readonly nextAction: Schema.Literal<"review">;
582
- }>, {}>;
583
- declare class Itinerary extends Itinerary_base {}
584
- declare const TravelPlan_base: Schema.Class<TravelPlan, Schema.Struct<{
585
- readonly itineraries: Schema.$Array<typeof Itinerary>;
586
- }>, {}>;
587
- declare class TravelPlan extends TravelPlan_base {}
588
- declare const FlightUnavailable_base: Schema.Class<FlightUnavailable, Schema.TaggedStruct<"FlightUnavailable", {
589
- query: Schema.String;
590
- message: Schema.String;
591
- }>, import("effect/Cause").YieldableError>;
592
- declare class FlightUnavailable extends FlightUnavailable_base {}
593
- declare const LodgingUnavailable_base: Schema.Class<LodgingUnavailable, Schema.TaggedStruct<"LodgingUnavailable", {
594
- query: Schema.String;
595
- message: Schema.String;
596
- }>, import("effect/Cause").YieldableError>;
597
- declare class LodgingUnavailable extends LodgingUnavailable_base {}
598
- declare const ActivityUnavailable_base: Schema.Class<ActivityUnavailable, Schema.TaggedStruct<"ActivityUnavailable", {
599
- query: Schema.String;
600
- message: Schema.String;
601
- }>, import("effect/Cause").YieldableError>;
602
- declare class ActivityUnavailable extends ActivityUnavailable_base {}
603
- declare const GuidanceFailure_base: Schema.Class<GuidanceFailure, Schema.TaggedStruct<"GuidanceFailure", {
604
- readonly message: Schema.String;
605
- }>, import("effect/Cause").YieldableError>;
606
- declare class GuidanceFailure extends GuidanceFailure_base {}
607
- declare const FlightCatalog_base: Context.ServiceClass<FlightCatalog, "@effect-agent/testing/travel-planner/FlightCatalog", {
608
- readonly search: (query: FlightQuery) => Effect.Effect<FlightOption, FlightUnavailable>;
609
- }>;
610
- declare class FlightCatalog extends FlightCatalog_base {}
611
- declare const LodgingCatalog_base: Context.ServiceClass<LodgingCatalog, "@effect-agent/testing/travel-planner/LodgingCatalog", {
612
- readonly search: (query: LodgingQuery) => Effect.Effect<LodgingOption, LodgingUnavailable>;
613
- }>;
614
- declare class LodgingCatalog extends LodgingCatalog_base {}
615
- declare const ActivityCatalog_base: Context.ServiceClass<ActivityCatalog, "@effect-agent/testing/travel-planner/ActivityCatalog", {
616
- readonly search: (query: ActivityQuery) => Effect.Effect<ActivitySearchResult, ActivityUnavailable>;
617
- }>;
618
- declare class ActivityCatalog extends ActivityCatalog_base {}
619
- declare const TravelGuidance_base: Context.ServiceClass<TravelGuidance, "@effect-agent/testing/travel-planner/TravelGuidance", {
620
- readonly instructions: (input: TripRequest) => Effect.Effect<string, GuidanceFailure>;
621
- }>;
622
- declare class TravelGuidance extends TravelGuidance_base {}
623
- declare const SearchFlights: Tool.Tool<"search_flights", {
624
- readonly parameters: typeof FlightQuery;
625
- readonly success: typeof FlightOption;
626
- readonly failure: typeof FlightUnavailable;
627
- readonly failureMode: "error";
628
- }, FlightCatalog>;
629
- declare const SearchLodging: Tool.Tool<"search_lodging", {
630
- readonly parameters: typeof LodgingQuery;
631
- readonly success: typeof LodgingOption;
632
- readonly failure: typeof LodgingUnavailable;
633
- readonly failureMode: "error";
634
- }, LodgingCatalog>;
635
- declare const SearchActivities: Tool.Tool<"search_activities", {
636
- readonly parameters: typeof ActivityQuery;
637
- readonly success: typeof ActivitySearchResult;
638
- readonly failure: typeof ActivityUnavailable;
639
- readonly failureMode: "error";
640
- }, ActivityCatalog>;
641
- declare const TravelPlannerToolkit: Toolkit.Toolkit<{
642
- readonly search_activities: Tool.Tool<"search_activities", {
643
- readonly parameters: typeof ActivityQuery;
644
- readonly success: typeof ActivitySearchResult;
645
- readonly failure: typeof ActivityUnavailable;
646
- readonly failureMode: "error";
647
- }, ActivityCatalog>;
648
- readonly search_flights: Tool.Tool<"search_flights", {
649
- readonly parameters: typeof FlightQuery;
650
- readonly success: typeof FlightOption;
651
- readonly failure: typeof FlightUnavailable;
652
- readonly failureMode: "error";
653
- }, FlightCatalog>;
654
- readonly search_lodging: Tool.Tool<"search_lodging", {
655
- readonly parameters: typeof LodgingQuery;
656
- readonly success: typeof LodgingOption;
657
- readonly failure: typeof LodgingUnavailable;
658
- readonly failureMode: "error";
659
- }, LodgingCatalog>;
660
- }>;
661
- declare const TravelPlannerToolkitLayer: import("effect/Layer").Layer<Tool.HandlersFor<{
662
- readonly search_activities: Tool.Tool<"search_activities", {
663
- readonly parameters: typeof ActivityQuery;
664
- readonly success: typeof ActivitySearchResult;
665
- readonly failure: typeof ActivityUnavailable;
666
- readonly failureMode: "error";
667
- }, ActivityCatalog>;
668
- readonly search_flights: Tool.Tool<"search_flights", {
669
- readonly parameters: typeof FlightQuery;
670
- readonly success: typeof FlightOption;
671
- readonly failure: typeof FlightUnavailable;
672
- readonly failureMode: "error";
673
- }, FlightCatalog>;
674
- readonly search_lodging: Tool.Tool<"search_lodging", {
675
- readonly parameters: typeof LodgingQuery;
676
- readonly success: typeof LodgingOption;
677
- readonly failure: typeof LodgingUnavailable;
678
- readonly failureMode: "error";
679
- }, LodgingCatalog>;
680
- }>, never, never>;
681
- declare const TravelPlanner: import("@effect-agent/core").Definition<typeof TripRequest, typeof TravelPlan, (input: TripRequest) => Effect.Effect<string, GuidanceFailure, TravelGuidance>, Toolkit.Toolkit<{
682
- readonly search_activities: Tool.Tool<"search_activities", {
683
- readonly parameters: typeof ActivityQuery;
684
- readonly success: typeof ActivitySearchResult;
685
- readonly failure: typeof ActivityUnavailable;
686
- readonly failureMode: "error";
687
- }, ActivityCatalog>;
688
- readonly search_flights: Tool.Tool<"search_flights", {
689
- readonly parameters: typeof FlightQuery;
690
- readonly success: typeof FlightOption;
691
- readonly failure: typeof FlightUnavailable;
692
- readonly failureMode: "error";
693
- }, FlightCatalog>;
694
- readonly search_lodging: Tool.Tool<"search_lodging", {
695
- readonly parameters: typeof LodgingQuery;
696
- readonly success: typeof LodgingOption;
697
- readonly failure: typeof LodgingUnavailable;
698
- readonly failureMode: "error";
699
- }, LodgingCatalog>;
700
- }>>;
701
- //#endregion
702
- //#region src/fixtures/travel-planner/deterministic-layers.d.ts
703
- declare const CatalogLifecycleCounts_base: Schema.Class<CatalogLifecycleCounts, Schema.Struct<{
704
- readonly acquired: Schema.Natural;
705
- readonly finalized: Schema.Natural;
706
- }>, {}>;
707
- declare class CatalogLifecycleCounts extends CatalogLifecycleCounts_base {}
708
- declare const CatalogLifecycle_base: Context.ServiceClass<CatalogLifecycle, "@effect-agent/testing/travel-planner/CatalogLifecycle", {
709
- readonly markAcquired: Effect.Effect<void>;
710
- readonly markFinalized: Effect.Effect<void>;
711
- readonly counts: Effect.Effect<CatalogLifecycleCounts>;
712
- }>;
713
- declare class CatalogLifecycle extends CatalogLifecycle_base {
714
- static readonly layerNoDeps: Layer.Layer<CatalogLifecycle, never, never>;
715
- }
716
- /**
717
- * Deterministic controls for a Tool batch whose completions are released in a
718
- * caller-selected order. This is intentionally a test fixture: it uses no
719
- * clock or sleep and lets engine scheduler tests prove parallel starts and
720
- * declaration-order prompt materialization.
721
- */
722
- interface TravelPlannerCompletionControls {
723
- readonly flightStarted: Effect.Effect<void>;
724
- readonly lodgingStarted: Effect.Effect<void>;
725
- readonly activityStarted: Effect.Effect<void>;
726
- readonly releaseFlight: Effect.Effect<void>;
727
- readonly releaseLodging: Effect.Effect<void>;
728
- readonly releaseActivity: Effect.Effect<void>;
729
- }
730
- declare const ReverseCompletionToolkitLayer: Effect.Effect<{
731
- controls: {
732
- flightStarted: Effect.Effect<void, never, never>;
733
- lodgingStarted: Effect.Effect<void, never, never>;
734
- activityStarted: Effect.Effect<void, never, never>;
735
- releaseFlight: Effect.Effect<void, never, never>;
736
- releaseLodging: Effect.Effect<void, never, never>;
737
- releaseActivity: Effect.Effect<void, never, never>;
738
- };
739
- layer: Layer.Layer<import("effect/unstable/ai/Tool").HandlersFor<{
740
- readonly search_activities: import("effect/unstable/ai/Tool").Tool<"search_activities", {
741
- readonly parameters: typeof ActivityQuery;
742
- readonly success: typeof ActivitySearchResult;
743
- readonly failure: typeof ActivityUnavailable;
744
- readonly failureMode: "error";
745
- }, ActivityCatalog>;
746
- readonly search_flights: import("effect/unstable/ai/Tool").Tool<"search_flights", {
747
- readonly parameters: typeof FlightQuery;
748
- readonly success: typeof FlightOption;
749
- readonly failure: typeof FlightUnavailable;
750
- readonly failureMode: "error";
751
- }, FlightCatalog>;
752
- readonly search_lodging: import("effect/unstable/ai/Tool").Tool<"search_lodging", {
753
- readonly parameters: typeof LodgingQuery;
754
- readonly success: typeof LodgingOption;
755
- readonly failure: typeof LodgingUnavailable;
756
- readonly failureMode: "error";
757
- }, LodgingCatalog>;
758
- }>, never, never>;
759
- }, never, never>;
760
- declare const FlightCatalogLayer: Layer.Layer<FlightCatalog, never, CatalogLifecycle>;
761
- declare const LodgingCatalogLayer: Layer.Layer<LodgingCatalog, never, CatalogLifecycle>;
762
- declare const ActivityCatalogLayer: Layer.Layer<ActivityCatalog, never, CatalogLifecycle>;
763
- /** Stable supplier-side booking identity, minted deterministically from the idempotency key. */
764
- declare const BookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
765
- type BookingRef = typeof BookingRef.Type;
766
- /** The supplier desk operations the P5 booking Tools and Steps invoke. */
767
- declare const SupplierOperation: Schema.Literals<readonly ["book-flight", "cancel-booking", "reserve-flight", "reserve-lodging", "issue-confirmation"]>;
768
- type SupplierOperation = typeof SupplierOperation.Type;
769
- declare const SupplierBookingRecord_base: Schema.Class<SupplierBookingRecord, Schema.Struct<{
770
- readonly bookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
771
- readonly idempotencyKey: Schema.NonEmptyString;
772
- readonly operation: Schema.Literals<readonly ["book-flight", "cancel-booking", "reserve-flight", "reserve-lodging", "issue-confirmation"]>;
773
- readonly detail: Schema.NonEmptyString;
774
- readonly status: Schema.Literals<readonly ["confirmed", "cancelled"]>;
775
- }>, {}>;
776
- /**
777
- * One row of external supplier truth. The desk deduplicates by `idempotencyKey` — replaying a
778
- * call with the same key returns this exact record without creating a second booking — which is
779
- * precisely the honesty model of DUR-010: the framework never makes an external call
780
- * exactly-once; the supplier's idempotency key does.
781
- */
782
- declare class SupplierBookingRecord extends SupplierBookingRecord_base {}
783
- declare const SupplierUnavailable_base: Schema.Class<SupplierUnavailable, Schema.TaggedStruct<"SupplierUnavailable", {
784
- readonly message: Schema.String;
785
- }>, import("effect/Cause").YieldableError>;
786
- declare class SupplierUnavailable extends SupplierUnavailable_base {}
787
- interface SupplierBookRequest {
788
- readonly operation: SupplierOperation;
789
- readonly idempotencyKey: string;
790
- readonly detail: string;
791
- }
792
- /** Controls returned by an armed crash window (`holdAfterWrite`). */
793
- interface SupplierHoldControls {
794
- /** Resolves once the armed call has performed its supplier write and is blocked. */
795
- readonly held: Effect.Effect<void>;
796
- /** Releases the blocked call (tests that interrupt the Attempt never call this). */
797
- readonly release: Effect.Effect<void>;
798
- }
799
- /** The desk-internal idempotency key of one cancellation: cancel is idempotent by bookingRef. */
800
- declare const cancelBookingIdempotencyKey: (bookingRef: string) => string;
801
- /** The deterministic bookingRef the desk mints for one idempotency key. */
802
- declare const supplierBookingRefFor: (idempotencyKey: string) => BookingRef;
803
- declare const SupplierBookingDesk_base: Context.ServiceClass<SupplierBookingDesk, "@effect-agent/testing/travel-planner/SupplierBookingDesk", {
804
- readonly book: (request: SupplierBookRequest) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;
805
- readonly cancel: (bookingRef: BookingRef) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;
806
- readonly lookup: (idempotencyKey: string) => Effect.Effect<Option.Option<SupplierBookingRecord>>;
807
- readonly bookings: Effect.Effect<ReadonlyArray<SupplierBookingRecord>>;
808
- readonly callCount: (idempotencyKey: string) => Effect.Effect<number>;
809
- readonly holdAfterWrite: (idempotencyKey: string) => Effect.Effect<SupplierHoldControls>;
810
- }>;
811
- /**
812
- * The deterministic in-memory supplier: an idempotency-keyed booking store with per-key call
813
- * counters and injectable crash windows.
814
- *
815
- * - `book`/`cancel` always count the call (at-least-once execution stays observable), then
816
- * dedupe the external effect by idempotency key — the supplier-side contract the P5 Tools and
817
- * Steps rely on.
818
- * - `holdAfterWrite` arms a one-shot crash window: the next call with that key performs its
819
- * supplier write, signals `held`, and never returns. Interrupting the Attempt at that point
820
- * models "the external effect happened but no outcome was recorded" without any wall clock.
821
- * - `bookings`/`lookup` expose external truth for the reconciler and for never-fabricate
822
- * assertions.
823
- */
824
- declare class SupplierBookingDesk extends SupplierBookingDesk_base {
825
- static readonly layer: Layer.Layer<SupplierBookingDesk>;
826
- }
827
- declare const TravelGuidanceLayer: Layer.Layer<TravelGuidance, never, never>;
828
- declare const DeterministicIdGeneratorLayer: Layer.Layer<IdGenerator, never, never>;
829
- declare const TravelPlannerRuntimeLayer: Layer.Layer<ActivityCatalog | FlightCatalog | IdGenerator | LodgingCatalog | TravelGuidance | import("effect/unstable/ai/Tool").HandlersFor<{
830
- readonly search_activities: import("effect/unstable/ai/Tool").Tool<"search_activities", {
831
- readonly parameters: typeof ActivityQuery;
832
- readonly success: typeof ActivitySearchResult;
833
- readonly failure: typeof ActivityUnavailable;
834
- readonly failureMode: "error";
835
- }, ActivityCatalog>;
836
- readonly search_flights: import("effect/unstable/ai/Tool").Tool<"search_flights", {
837
- readonly parameters: typeof FlightQuery;
838
- readonly success: typeof FlightOption;
839
- readonly failure: typeof FlightUnavailable;
840
- readonly failureMode: "error";
841
- }, FlightCatalog>;
842
- readonly search_lodging: import("effect/unstable/ai/Tool").Tool<"search_lodging", {
843
- readonly parameters: typeof LodgingQuery;
844
- readonly success: typeof LodgingOption;
845
- readonly failure: typeof LodgingUnavailable;
846
- readonly failureMode: "error";
847
- }, LodgingCatalog>;
848
- }>, never, never>;
849
- //#endregion
850
- //#region src/fixtures/travel-planner/phase2.d.ts
851
- declare const ItineraryHoldRequest_base: Schema.Class<ItineraryHoldRequest, Schema.Struct<{
852
- readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
853
- readonly expiresInMinutes: Schema.Int;
854
- }>, {}>;
855
- declare class ItineraryHoldRequest extends ItineraryHoldRequest_base {}
856
- declare const ItineraryHold_base: Schema.Class<ItineraryHold, Schema.Struct<{
857
- readonly holdId: Schema.NonEmptyString;
858
- readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
859
- readonly status: Schema.Literal<"held">;
860
- }>, {}>;
861
- declare class ItineraryHold extends ItineraryHold_base {}
862
- declare const ItineraryHoldUnavailable_base: Schema.Class<ItineraryHoldUnavailable, Schema.TaggedStruct<"ItineraryHoldUnavailable", {
863
- readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
864
- readonly message: Schema.String;
865
- }>, import("effect/Cause").YieldableError>;
866
- declare class ItineraryHoldUnavailable extends ItineraryHoldUnavailable_base {}
867
- declare const ItineraryHoldGateway_base: Context.ServiceClass<ItineraryHoldGateway, "@effect-agent/testing/travel-planner/ItineraryHoldGateway", {
868
- readonly hold: (request: ItineraryHoldRequest) => Effect.Effect<ItineraryHold, ItineraryHoldUnavailable>;
869
- }>;
870
- declare class ItineraryHoldGateway extends ItineraryHoldGateway_base {}
871
- /**
872
- * The first mutating Travel Planner Tool. Effect AI marks it as approval-gated
873
- * so the engine must settle approval before acquiring a handler permit.
874
- */
875
- declare const HoldItinerary: Tool.Tool<"hold_itinerary", {
876
- readonly parameters: typeof ItineraryHoldRequest;
877
- readonly success: typeof ItineraryHold;
878
- readonly failure: typeof ItineraryHoldUnavailable;
879
- readonly failureMode: "error";
880
- }, ItineraryHoldGateway>;
881
- declare const TravelPlannerPhase2Toolkit: Toolkit.Toolkit<{
882
- readonly hold_itinerary: Tool.Tool<"hold_itinerary", {
883
- readonly parameters: typeof ItineraryHoldRequest;
884
- readonly success: typeof ItineraryHold;
885
- readonly failure: typeof ItineraryHoldUnavailable;
886
- readonly failureMode: "error";
887
- }, ItineraryHoldGateway>;
888
- readonly search_activities: Tool.Tool<"search_activities", {
889
- readonly parameters: typeof ActivityQuery;
890
- readonly success: typeof ActivitySearchResult;
891
- readonly failure: typeof ActivityUnavailable;
892
- readonly failureMode: "error";
893
- }, ActivityCatalog>;
894
- readonly search_flights: Tool.Tool<"search_flights", {
895
- readonly parameters: typeof FlightQuery;
896
- readonly success: typeof FlightOption;
897
- readonly failure: typeof FlightUnavailable;
898
- readonly failureMode: "error";
899
- }, FlightCatalog>;
900
- readonly search_lodging: Tool.Tool<"search_lodging", {
901
- readonly parameters: typeof LodgingQuery;
902
- readonly success: typeof LodgingOption;
903
- readonly failure: typeof LodgingUnavailable;
904
- readonly failureMode: "error";
905
- }, LodgingCatalog>;
906
- }>;
907
- declare const TravelPlannerPhase2ToolkitLayer: import("effect/Layer").Layer<Tool.HandlersFor<{
908
- readonly hold_itinerary: Tool.Tool<"hold_itinerary", {
909
- readonly parameters: typeof ItineraryHoldRequest;
910
- readonly success: typeof ItineraryHold;
911
- readonly failure: typeof ItineraryHoldUnavailable;
912
- readonly failureMode: "error";
913
- }, ItineraryHoldGateway>;
914
- readonly search_activities: Tool.Tool<"search_activities", {
915
- readonly parameters: typeof ActivityQuery;
916
- readonly success: typeof ActivitySearchResult;
917
- readonly failure: typeof ActivityUnavailable;
918
- readonly failureMode: "error";
919
- }, ActivityCatalog>;
920
- readonly search_flights: Tool.Tool<"search_flights", {
921
- readonly parameters: typeof FlightQuery;
922
- readonly success: typeof FlightOption;
923
- readonly failure: typeof FlightUnavailable;
924
- readonly failureMode: "error";
925
- }, FlightCatalog>;
926
- readonly search_lodging: Tool.Tool<"search_lodging", {
927
- readonly parameters: typeof LodgingQuery;
928
- readonly success: typeof LodgingOption;
929
- readonly failure: typeof LodgingUnavailable;
930
- readonly failureMode: "error";
931
- }, LodgingCatalog>;
932
- }>, never, never>;
933
- declare const TravelPlannerPhase2: import("@effect-agent/core").Definition<typeof TripRequest, typeof TravelPlan, (input: TripRequest) => Effect.Effect<string, GuidanceFailure, TravelGuidance>, Toolkit.Toolkit<{
934
- readonly hold_itinerary: Tool.Tool<"hold_itinerary", {
935
- readonly parameters: typeof ItineraryHoldRequest;
936
- readonly success: typeof ItineraryHold;
937
- readonly failure: typeof ItineraryHoldUnavailable;
938
- readonly failureMode: "error";
939
- }, ItineraryHoldGateway>;
940
- readonly search_activities: Tool.Tool<"search_activities", {
941
- readonly parameters: typeof ActivityQuery;
942
- readonly success: typeof ActivitySearchResult;
943
- readonly failure: typeof ActivityUnavailable;
944
- readonly failureMode: "error";
945
- }, ActivityCatalog>;
946
- readonly search_flights: Tool.Tool<"search_flights", {
947
- readonly parameters: typeof FlightQuery;
948
- readonly success: typeof FlightOption;
949
- readonly failure: typeof FlightUnavailable;
950
- readonly failureMode: "error";
951
- }, FlightCatalog>;
952
- readonly search_lodging: Tool.Tool<"search_lodging", {
953
- readonly parameters: typeof LodgingQuery;
954
- readonly success: typeof LodgingOption;
955
- readonly failure: typeof LodgingUnavailable;
956
- readonly failureMode: "error";
957
- }, LodgingCatalog>;
958
- }>>;
959
- //#endregion
960
- //#region src/fixtures/travel-planner/phase3.d.ts
961
- declare const TravelPlannerPersistenceProfile_base: Schema.Class<TravelPlannerPersistenceProfile, Schema.Struct<{
962
- readonly deploymentClass: Schema.Literal<"P">;
963
- readonly durableAcceptedWork: Schema.Literal<false>;
964
- readonly canonicalSchemaVersion: Schema.Literal<1>;
965
- }>, {}>;
966
- /**
967
- * The Phase 3 profile persists Conversation history but deliberately does not
968
- * claim durable admission or recovery of accepted work.
969
- */
970
- declare class TravelPlannerPersistenceProfile extends TravelPlannerPersistenceProfile_base {}
971
- declare const phase3TravelPlannerProfile: TravelPlannerPersistenceProfile;
972
- declare const phase3TravelPlannerConversationId: string & import("effect/Brand").Brand<"@effect-agent/core/ConversationId">;
973
- declare const phase3TravelPlannerProducerId: string & import("effect/Brand").Brand<"@effect-agent/session/ProducerId">;
974
- declare const phase3TravelPlannerRunId: string & import("effect/Brand").Brand<"@effect-agent/core/RunId">;
975
- /** Redacted, deterministic definition identities for the current fixture version. */
976
- declare const phase3TravelPlannerDefinitionDigests: DefinitionDigests;
977
- /**
978
- * The first atomic append establishes the Conversation and records its input.
979
- * Its encoded value is the redacted current-version persistence fixture.
980
- */
981
- declare const phase3TravelPlannerInitialBatch: CanonicalBatch;
982
- /** The second append records the Schema-decoded itinerary and terminal Run result. */
983
- declare const phase3TravelPlannerCompletionBatch: CanonicalBatch;
984
- declare const phase3TravelPlannerBatches: readonly [CanonicalBatch, CanonicalBatch];
985
- /** Portable current-version fixture; it contains no passenger identity or credentials. */
986
- declare const phase3TravelPlannerEncodedFixture: readonly {
987
- readonly batchId: string;
988
- readonly producerId: string;
989
- readonly records: readonly [{
990
- readonly recordId: string;
991
- readonly family: "conversation";
992
- readonly schemaVersion: 1;
993
- readonly createdAt: string;
994
- readonly deploymentId: string;
995
- readonly payload: {
996
- readonly _tag: "AbortRequested";
997
- readonly submissionId: string;
998
- readonly author: string;
999
- readonly reason: string;
1000
- } | {
1001
- readonly _tag: "ToolCallResolved";
1002
- readonly runId: string;
1003
- readonly toolCallId: string;
1004
- readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
1005
- readonly author: string;
1006
- readonly reason: string;
1007
- } | {
1008
- readonly _tag: "ToolCallPrepared";
1009
- readonly runId: string;
1010
- readonly turnId: string;
1011
- readonly turn: number;
1012
- readonly toolCallId: string;
1013
- readonly toolName: string;
1014
- readonly parameters: Schema.Json;
1015
- readonly parametersDigest: string;
1016
- } | {
1017
- readonly _tag: "ToolCallUnknown";
1018
- readonly runId: string;
1019
- readonly turn: number;
1020
- readonly toolCallId: string;
1021
- readonly toolName: string;
1022
- readonly reason: string;
1023
- } | {
1024
- readonly _tag: "ToolApprovalDecided";
1025
- readonly runId: string;
1026
- readonly turn: number;
1027
- readonly toolCallId: string;
1028
- readonly decision: "approved" | "denied";
1029
- readonly resolver: string;
1030
- readonly reason: string;
1031
- } | {
1032
- readonly _tag: "ConversationCreated";
1033
- readonly agentId: string;
1034
- readonly definitions: {
1035
- readonly agent: string;
1036
- readonly model: string;
1037
- readonly tools: string;
1038
- };
1039
- } | {
1040
- readonly _tag: "UserInputRecorded";
1041
- readonly submissionId: string;
1042
- readonly kind: "follow-up" | "steering" | "user";
1043
- readonly runId?: string | undefined;
1044
- readonly input: Schema.Json;
1045
- } | {
1046
- readonly _tag: "ModelCompleted";
1047
- readonly runId: string;
1048
- readonly output: Schema.Json;
1049
- } | {
1050
- readonly _tag: "ModelResponseRecorded";
1051
- readonly runId: string;
1052
- readonly turnId: string;
1053
- readonly turn: number;
1054
- readonly messages: Schema.Json;
1055
- readonly messagesDigest: string;
1056
- readonly inputTokens?: number | undefined;
1057
- readonly outputTokens?: number | undefined;
1058
- } | {
1059
- readonly _tag: "ToolCallSettled";
1060
- readonly runId: string;
1061
- readonly toolCallId: string;
1062
- readonly toolName: string;
1063
- readonly result: Schema.Json;
1064
- readonly isFailure: boolean;
1065
- } | {
1066
- readonly _tag: "ToolStepSettled";
1067
- readonly runId: string;
1068
- readonly toolCallId: string;
1069
- readonly stepName: string;
1070
- readonly output: Schema.Json;
1071
- readonly outputDigest: string;
1072
- } | {
1073
- readonly _tag: "ToolApprovalRequested";
1074
- readonly runId: string;
1075
- readonly turnId: string;
1076
- readonly turn: number;
1077
- readonly toolCallId: string;
1078
- readonly toolName: string;
1079
- readonly parametersDigest: string;
1080
- } | {
1081
- readonly _tag: "ModelResponseInterrupted";
1082
- readonly runId: string;
1083
- readonly supersededEpoch: number;
1084
- readonly attemptId: string;
1085
- readonly reason: string;
1086
- } | {
1087
- readonly _tag: "CompactionCreated";
1088
- readonly runId: string;
1089
- readonly turn: number;
1090
- readonly kind: "clear-tool-results" | "summarize";
1091
- readonly coversThrough: number;
1092
- readonly summary?: string | undefined;
1093
- } | {
1094
- readonly _tag: "RunFailed";
1095
- readonly runId: string;
1096
- readonly failure: Schema.Json;
1097
- } | {
1098
- readonly _tag: "RunCompleted";
1099
- readonly runId: string;
1100
- readonly output: Schema.Json;
1101
- } | {
1102
- readonly _tag: "SubmissionSettled";
1103
- readonly submissionId: string;
1104
- readonly settlementId: string;
1105
- readonly receiptId: string;
1106
- readonly outcome: "aborted" | "completed" | "failed";
1107
- readonly runId?: string | undefined;
1108
- readonly result?: Schema.Json | undefined;
1109
- readonly finishReason?: "budget-exhausted" | undefined;
1110
- } | {
1111
- readonly _tag: "SubagentRequested";
1112
- readonly runId: string;
1113
- readonly turnId: string;
1114
- readonly turn: number;
1115
- readonly toolCallId: string;
1116
- readonly delegationId: string;
1117
- readonly targetAgentId: string;
1118
- readonly targetDigests: {
1119
- readonly agent: string;
1120
- readonly model: string;
1121
- readonly tools: string;
1122
- };
1123
- readonly childInput: Schema.Json;
1124
- readonly childInputDigest: string;
1125
- readonly grantDigest: string;
1126
- readonly reservationId: string;
1127
- readonly reservationDigest: string;
1128
- readonly childConversationId: string;
1129
- readonly childPrincipal: string;
1130
- readonly childIdempotencyKey: string;
1131
- } | {
1132
- readonly _tag: "SubagentStarted";
1133
- readonly runId: string;
1134
- readonly toolCallId: string;
1135
- readonly childConversationId: string;
1136
- readonly childSubmissionId: string;
1137
- readonly childReceiptId: string;
1138
- readonly childRunId: string;
1139
- } | {
1140
- readonly _tag: "SubagentJoined";
1141
- readonly runId: string;
1142
- readonly toolCallId: string;
1143
- readonly childSubmissionId: string;
1144
- readonly childSettlementId: string;
1145
- readonly childOutcome: "aborted" | "completed" | "failed";
1146
- readonly childResultDigest: string;
1147
- readonly projectedResultDigest: string;
1148
- readonly usageSummary: Schema.Json;
1149
- readonly reservationId: string;
1150
- readonly finalAccounting: Schema.Json;
1151
- } | {
1152
- readonly _tag: "SubagentLineageRecorded";
1153
- readonly parentLink: {
1154
- readonly delegationId: string;
1155
- readonly parentAgentId: string;
1156
- readonly parentConversationId: string;
1157
- readonly parentRunId: string;
1158
- readonly parentToolCallId: string;
1159
- readonly depth: number;
1160
- };
1161
- readonly parentSubmissionId: string;
1162
- readonly childDefinitionDigests: {
1163
- readonly agent: string;
1164
- readonly model: string;
1165
- readonly tools: string;
1166
- };
1167
- readonly childInputDigest: string;
1168
- readonly grantDigest: string;
1169
- } | {
1170
- readonly _tag: "RepairAnnotated";
1171
- readonly reason: string;
1172
- readonly details: Schema.Json;
1173
- };
1174
- }, ...{
1175
- readonly recordId: string;
1176
- readonly family: "conversation";
1177
- readonly schemaVersion: 1;
1178
- readonly createdAt: string;
1179
- readonly deploymentId: string;
1180
- readonly payload: {
1181
- readonly _tag: "AbortRequested";
1182
- readonly submissionId: string;
1183
- readonly author: string;
1184
- readonly reason: string;
1185
- } | {
1186
- readonly _tag: "ToolCallResolved";
1187
- readonly runId: string;
1188
- readonly toolCallId: string;
1189
- readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
1190
- readonly author: string;
1191
- readonly reason: string;
1192
- } | {
1193
- readonly _tag: "ToolCallPrepared";
1194
- readonly runId: string;
1195
- readonly turnId: string;
1196
- readonly turn: number;
1197
- readonly toolCallId: string;
1198
- readonly toolName: string;
1199
- readonly parameters: Schema.Json;
1200
- readonly parametersDigest: string;
1201
- } | {
1202
- readonly _tag: "ToolCallUnknown";
1203
- readonly runId: string;
1204
- readonly turn: number;
1205
- readonly toolCallId: string;
1206
- readonly toolName: string;
1207
- readonly reason: string;
1208
- } | {
1209
- readonly _tag: "ToolApprovalDecided";
1210
- readonly runId: string;
1211
- readonly turn: number;
1212
- readonly toolCallId: string;
1213
- readonly decision: "approved" | "denied";
1214
- readonly resolver: string;
1215
- readonly reason: string;
1216
- } | {
1217
- readonly _tag: "ConversationCreated";
1218
- readonly agentId: string;
1219
- readonly definitions: {
1220
- readonly agent: string;
1221
- readonly model: string;
1222
- readonly tools: string;
1223
- };
1224
- } | {
1225
- readonly _tag: "UserInputRecorded";
1226
- readonly submissionId: string;
1227
- readonly kind: "follow-up" | "steering" | "user";
1228
- readonly runId?: string | undefined;
1229
- readonly input: Schema.Json;
1230
- } | {
1231
- readonly _tag: "ModelCompleted";
1232
- readonly runId: string;
1233
- readonly output: Schema.Json;
1234
- } | {
1235
- readonly _tag: "ModelResponseRecorded";
1236
- readonly runId: string;
1237
- readonly turnId: string;
1238
- readonly turn: number;
1239
- readonly messages: Schema.Json;
1240
- readonly messagesDigest: string;
1241
- readonly inputTokens?: number | undefined;
1242
- readonly outputTokens?: number | undefined;
1243
- } | {
1244
- readonly _tag: "ToolCallSettled";
1245
- readonly runId: string;
1246
- readonly toolCallId: string;
1247
- readonly toolName: string;
1248
- readonly result: Schema.Json;
1249
- readonly isFailure: boolean;
1250
- } | {
1251
- readonly _tag: "ToolStepSettled";
1252
- readonly runId: string;
1253
- readonly toolCallId: string;
1254
- readonly stepName: string;
1255
- readonly output: Schema.Json;
1256
- readonly outputDigest: string;
1257
- } | {
1258
- readonly _tag: "ToolApprovalRequested";
1259
- readonly runId: string;
1260
- readonly turnId: string;
1261
- readonly turn: number;
1262
- readonly toolCallId: string;
1263
- readonly toolName: string;
1264
- readonly parametersDigest: string;
1265
- } | {
1266
- readonly _tag: "ModelResponseInterrupted";
1267
- readonly runId: string;
1268
- readonly supersededEpoch: number;
1269
- readonly attemptId: string;
1270
- readonly reason: string;
1271
- } | {
1272
- readonly _tag: "CompactionCreated";
1273
- readonly runId: string;
1274
- readonly turn: number;
1275
- readonly kind: "clear-tool-results" | "summarize";
1276
- readonly coversThrough: number;
1277
- readonly summary?: string | undefined;
1278
- } | {
1279
- readonly _tag: "RunFailed";
1280
- readonly runId: string;
1281
- readonly failure: Schema.Json;
1282
- } | {
1283
- readonly _tag: "RunCompleted";
1284
- readonly runId: string;
1285
- readonly output: Schema.Json;
1286
- } | {
1287
- readonly _tag: "SubmissionSettled";
1288
- readonly submissionId: string;
1289
- readonly settlementId: string;
1290
- readonly receiptId: string;
1291
- readonly outcome: "aborted" | "completed" | "failed";
1292
- readonly runId?: string | undefined;
1293
- readonly result?: Schema.Json | undefined;
1294
- readonly finishReason?: "budget-exhausted" | undefined;
1295
- } | {
1296
- readonly _tag: "SubagentRequested";
1297
- readonly runId: string;
1298
- readonly turnId: string;
1299
- readonly turn: number;
1300
- readonly toolCallId: string;
1301
- readonly delegationId: string;
1302
- readonly targetAgentId: string;
1303
- readonly targetDigests: {
1304
- readonly agent: string;
1305
- readonly model: string;
1306
- readonly tools: string;
1307
- };
1308
- readonly childInput: Schema.Json;
1309
- readonly childInputDigest: string;
1310
- readonly grantDigest: string;
1311
- readonly reservationId: string;
1312
- readonly reservationDigest: string;
1313
- readonly childConversationId: string;
1314
- readonly childPrincipal: string;
1315
- readonly childIdempotencyKey: string;
1316
- } | {
1317
- readonly _tag: "SubagentStarted";
1318
- readonly runId: string;
1319
- readonly toolCallId: string;
1320
- readonly childConversationId: string;
1321
- readonly childSubmissionId: string;
1322
- readonly childReceiptId: string;
1323
- readonly childRunId: string;
1324
- } | {
1325
- readonly _tag: "SubagentJoined";
1326
- readonly runId: string;
1327
- readonly toolCallId: string;
1328
- readonly childSubmissionId: string;
1329
- readonly childSettlementId: string;
1330
- readonly childOutcome: "aborted" | "completed" | "failed";
1331
- readonly childResultDigest: string;
1332
- readonly projectedResultDigest: string;
1333
- readonly usageSummary: Schema.Json;
1334
- readonly reservationId: string;
1335
- readonly finalAccounting: Schema.Json;
1336
- } | {
1337
- readonly _tag: "SubagentLineageRecorded";
1338
- readonly parentLink: {
1339
- readonly delegationId: string;
1340
- readonly parentAgentId: string;
1341
- readonly parentConversationId: string;
1342
- readonly parentRunId: string;
1343
- readonly parentToolCallId: string;
1344
- readonly depth: number;
1345
- };
1346
- readonly parentSubmissionId: string;
1347
- readonly childDefinitionDigests: {
1348
- readonly agent: string;
1349
- readonly model: string;
1350
- readonly tools: string;
1351
- };
1352
- readonly childInputDigest: string;
1353
- readonly grantDigest: string;
1354
- } | {
1355
- readonly _tag: "RepairAnnotated";
1356
- readonly reason: string;
1357
- readonly details: Schema.Json;
1358
- };
1359
- }[]];
1360
- }[];
1361
- declare const TravelPlannerProjectionError_base: Schema.Class<TravelPlannerProjectionError, Schema.TaggedStruct<"TravelPlannerProjectionError", {
1362
- readonly message: Schema.String;
1363
- }>, import("effect/Cause").YieldableError>;
1364
- declare class TravelPlannerProjectionError extends TravelPlannerProjectionError_base {}
1365
- /** Decode the itinerary projection rebuilt from canonical model-completion records. */
1366
- declare const travelPlanFromProjection: (projection: ConversationProjection) => Effect.Effect<TravelPlan, TravelPlannerProjectionError>;
1367
- /** Build a disposable checkpoint bound to a validated canonical prefix. */
1368
- declare const makePhase3TravelPlannerCheckpoint: (projection: ConversationProjection) => ConversationCheckpoint;
1369
- //#endregion
1370
- //#region src/scripted-model.d.ts
1371
- /**
1372
- * Schema for encoded, non-streaming Effect AI response parts.
1373
- *
1374
- * Generic Tool payloads remain explicitly unknown here. `LanguageModel.make`
1375
- * performs the toolkit-specific decode when the scripted response is consumed.
1376
- */
1377
- declare const ScriptedGeneratePart: Schema.Union<readonly [Schema.toEncoded<Schema.Struct<{
1378
- readonly type: Schema.tag<"text">;
1379
- readonly text: Schema.String;
1380
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1381
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1382
- }>>, Schema.toEncoded<Schema.Struct<{
1383
- readonly type: Schema.tag<"reasoning">;
1384
- readonly text: Schema.String;
1385
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1386
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1387
- }>>, Schema.toEncoded<Schema.Struct<{
1388
- readonly type: Schema.tag<"reasoning-delta">;
1389
- readonly id: Schema.String;
1390
- readonly delta: Schema.String;
1391
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1392
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1393
- }>>, Schema.toEncoded<Schema.Struct<{
1394
- readonly type: Schema.tag<"reasoning-end">;
1395
- readonly id: Schema.String;
1396
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1397
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1398
- }>>, Schema.Struct<{
1399
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1400
- readonly type: Schema.Literal<"tool-call">;
1401
- readonly id: Schema.String;
1402
- readonly name: Schema.String;
1403
- readonly params: Schema.Unknown;
1404
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1405
- }>, Schema.Struct<{
1406
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1407
- readonly type: Schema.Literal<"tool-result">;
1408
- readonly id: Schema.String;
1409
- readonly name: Schema.String;
1410
- readonly result: Schema.Unknown;
1411
- readonly isFailure: Schema.Boolean;
1412
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1413
- readonly preliminary: Schema.optionalKey<Schema.Boolean>;
1414
- }>, Schema.toEncoded<Schema.Struct<{
1415
- readonly type: Schema.tag<"tool-approval-request">;
1416
- readonly approvalId: Schema.String;
1417
- readonly toolCallId: Schema.String;
1418
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1419
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1420
- }>>, Schema.toEncoded<Schema.Struct<{
1421
- readonly type: Schema.tag<"file">;
1422
- readonly mediaType: Schema.String;
1423
- readonly data: Schema.Uint8ArrayFromBase64;
1424
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1425
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1426
- }>>, Schema.toEncoded<Schema.Struct<{
1427
- readonly type: Schema.tag<"source">;
1428
- readonly sourceType: Schema.tag<"document">;
1429
- readonly id: Schema.String;
1430
- readonly mediaType: Schema.String;
1431
- readonly title: Schema.String;
1432
- readonly fileName: Schema.optionalKey<Schema.String>;
1433
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1434
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1435
- }>>, Schema.toEncoded<Schema.Struct<{
1436
- readonly type: Schema.tag<"source">;
1437
- readonly sourceType: Schema.tag<"url">;
1438
- readonly id: Schema.String;
1439
- readonly url: Schema.URLFromString;
1440
- readonly title: Schema.String;
1441
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1442
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1443
- }>>, Schema.toEncoded<Schema.Struct<{
1444
- readonly type: Schema.tag<"response-metadata">;
1445
- readonly id: Schema.optional<Schema.String>;
1446
- readonly modelId: Schema.optional<Schema.String>;
1447
- readonly timestamp: Schema.optional<Schema.DateTimeUtcFromString>;
1448
- readonly request: Schema.optional<typeof Response.HttpRequestDetails>;
1449
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1450
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1451
- }>>, Schema.toEncoded<Schema.Struct<{
1452
- readonly type: Schema.tag<"finish">;
1453
- readonly reason: Schema.Literals<["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>;
1454
- readonly usage: typeof Response.Usage;
1455
- readonly response: Schema.optional<typeof Response.HttpResponseDetails>;
1456
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1457
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1458
- }>>]>;
1459
- type ScriptedGeneratePart = typeof ScriptedGeneratePart.Type;
1460
- /**
1461
- * Schema for encoded Effect AI streaming response parts.
1462
- */
1463
- declare const ScriptedStreamPart: Schema.Union<readonly [Schema.toEncoded<Schema.Struct<{
1464
- readonly type: Schema.tag<"text-start">;
1465
- readonly id: Schema.String;
1466
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1467
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1468
- }>>, Schema.toEncoded<Schema.Struct<{
1469
- readonly type: Schema.tag<"text-delta">;
1470
- readonly id: Schema.String;
1471
- readonly delta: Schema.String;
1472
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1473
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1474
- }>>, Schema.toEncoded<Schema.Struct<{
1475
- readonly type: Schema.tag<"text-end">;
1476
- readonly id: Schema.String;
1477
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1478
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1479
- }>>, Schema.toEncoded<Schema.Struct<{
1480
- readonly type: Schema.tag<"reasoning-start">;
1481
- readonly id: Schema.String;
1482
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1483
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1484
- }>>, Schema.toEncoded<Schema.Struct<{
1485
- readonly type: Schema.tag<"reasoning-delta">;
1486
- readonly id: Schema.String;
1487
- readonly delta: Schema.String;
1488
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1489
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1490
- }>>, Schema.toEncoded<Schema.Struct<{
1491
- readonly type: Schema.tag<"reasoning-end">;
1492
- readonly id: Schema.String;
1493
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1494
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1495
- }>>, Schema.toEncoded<Schema.Struct<{
1496
- readonly type: Schema.tag<"tool-params-start">;
1497
- readonly id: Schema.String;
1498
- readonly name: Schema.String;
1499
- readonly providerExecuted: Schema.withDecodingDefaultKey<Schema.Boolean>;
1500
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1501
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1502
- }>>, Schema.toEncoded<Schema.Struct<{
1503
- readonly type: Schema.tag<"tool-params-delta">;
1504
- readonly id: Schema.String;
1505
- readonly delta: Schema.String;
1506
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1507
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1508
- }>>, Schema.toEncoded<Schema.Struct<{
1509
- readonly type: Schema.tag<"tool-params-end">;
1510
- readonly id: Schema.String;
1511
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1512
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1513
- }>>, Schema.Struct<{
1514
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1515
- readonly type: Schema.Literal<"tool-call">;
1516
- readonly id: Schema.String;
1517
- readonly name: Schema.String;
1518
- readonly params: Schema.Unknown;
1519
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1520
- }>, Schema.Struct<{
1521
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1522
- readonly type: Schema.Literal<"tool-result">;
1523
- readonly id: Schema.String;
1524
- readonly name: Schema.String;
1525
- readonly result: Schema.Unknown;
1526
- readonly isFailure: Schema.Boolean;
1527
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1528
- readonly preliminary: Schema.optionalKey<Schema.Boolean>;
1529
- }>, Schema.toEncoded<Schema.Struct<{
1530
- readonly type: Schema.tag<"tool-approval-request">;
1531
- readonly approvalId: Schema.String;
1532
- readonly toolCallId: Schema.String;
1533
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1534
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1535
- }>>, Schema.toEncoded<Schema.Struct<{
1536
- readonly type: Schema.tag<"file">;
1537
- readonly mediaType: Schema.String;
1538
- readonly data: Schema.Uint8ArrayFromBase64;
1539
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1540
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1541
- }>>, Schema.toEncoded<Schema.Struct<{
1542
- readonly type: Schema.tag<"source">;
1543
- readonly sourceType: Schema.tag<"document">;
1544
- readonly id: Schema.String;
1545
- readonly mediaType: Schema.String;
1546
- readonly title: Schema.String;
1547
- readonly fileName: Schema.optionalKey<Schema.String>;
1548
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1549
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1550
- }>>, Schema.toEncoded<Schema.Struct<{
1551
- readonly type: Schema.tag<"source">;
1552
- readonly sourceType: Schema.tag<"url">;
1553
- readonly id: Schema.String;
1554
- readonly url: Schema.URLFromString;
1555
- readonly title: Schema.String;
1556
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1557
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1558
- }>>, Schema.toEncoded<Schema.Struct<{
1559
- readonly type: Schema.tag<"response-metadata">;
1560
- readonly id: Schema.optional<Schema.String>;
1561
- readonly modelId: Schema.optional<Schema.String>;
1562
- readonly timestamp: Schema.optional<Schema.DateTimeUtcFromString>;
1563
- readonly request: Schema.optional<typeof Response.HttpRequestDetails>;
1564
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1565
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1566
- }>>, Schema.toEncoded<Schema.Struct<{
1567
- readonly type: Schema.tag<"finish">;
1568
- readonly reason: Schema.Literals<["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>;
1569
- readonly usage: typeof Response.Usage;
1570
- readonly response: Schema.optional<typeof Response.HttpResponseDetails>;
1571
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1572
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1573
- }>>, Schema.toEncoded<Schema.Struct<{
1574
- readonly type: Schema.tag<"error">;
1575
- readonly error: Schema.Unknown;
1576
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1577
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1578
- }>>]>;
1579
- type ScriptedStreamPart = typeof ScriptedStreamPart.Type;
1580
- /** Controls whether a scripted stream completes, fails, or waits for interruption. */
1581
- declare const ScriptedStreamTermination: Schema.Union<readonly [Schema.TaggedStruct<"Complete", {}>, Schema.TaggedStruct<"Fail", {
1582
- readonly description: Schema.String;
1583
- }>, Schema.TaggedStruct<"Hang", {}>]>;
1584
- type ScriptedStreamTermination = typeof ScriptedStreamTermination.Type;
1585
- /** One non-streaming invocation and the encoded response parts it returns. */
1586
- declare const ScriptedGenerateTurn: Schema.TaggedStruct<"Generate", {
1587
- readonly parts: Schema.$Array<Schema.Union<readonly [Schema.toEncoded<Schema.Struct<{
1588
- readonly type: Schema.tag<"text">;
1589
- readonly text: Schema.String;
1590
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1591
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1592
- }>>, Schema.toEncoded<Schema.Struct<{
1593
- readonly type: Schema.tag<"reasoning">;
1594
- readonly text: Schema.String;
1595
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1596
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1597
- }>>, Schema.toEncoded<Schema.Struct<{
1598
- readonly type: Schema.tag<"reasoning-delta">;
1599
- readonly id: Schema.String;
1600
- readonly delta: Schema.String;
1601
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1602
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1603
- }>>, Schema.toEncoded<Schema.Struct<{
1604
- readonly type: Schema.tag<"reasoning-end">;
1605
- readonly id: Schema.String;
1606
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1607
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1608
- }>>, Schema.Struct<{
1609
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1610
- readonly type: Schema.Literal<"tool-call">;
1611
- readonly id: Schema.String;
1612
- readonly name: Schema.String;
1613
- readonly params: Schema.Unknown;
1614
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1615
- }>, Schema.Struct<{
1616
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1617
- readonly type: Schema.Literal<"tool-result">;
1618
- readonly id: Schema.String;
1619
- readonly name: Schema.String;
1620
- readonly result: Schema.Unknown;
1621
- readonly isFailure: Schema.Boolean;
1622
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1623
- readonly preliminary: Schema.optionalKey<Schema.Boolean>;
1624
- }>, Schema.toEncoded<Schema.Struct<{
1625
- readonly type: Schema.tag<"tool-approval-request">;
1626
- readonly approvalId: Schema.String;
1627
- readonly toolCallId: Schema.String;
1628
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1629
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1630
- }>>, Schema.toEncoded<Schema.Struct<{
1631
- readonly type: Schema.tag<"file">;
1632
- readonly mediaType: Schema.String;
1633
- readonly data: Schema.Uint8ArrayFromBase64;
1634
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1635
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1636
- }>>, Schema.toEncoded<Schema.Struct<{
1637
- readonly type: Schema.tag<"source">;
1638
- readonly sourceType: Schema.tag<"document">;
1639
- readonly id: Schema.String;
1640
- readonly mediaType: Schema.String;
1641
- readonly title: Schema.String;
1642
- readonly fileName: Schema.optionalKey<Schema.String>;
1643
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1644
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1645
- }>>, Schema.toEncoded<Schema.Struct<{
1646
- readonly type: Schema.tag<"source">;
1647
- readonly sourceType: Schema.tag<"url">;
1648
- readonly id: Schema.String;
1649
- readonly url: Schema.URLFromString;
1650
- readonly title: Schema.String;
1651
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1652
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1653
- }>>, Schema.toEncoded<Schema.Struct<{
1654
- readonly type: Schema.tag<"response-metadata">;
1655
- readonly id: Schema.optional<Schema.String>;
1656
- readonly modelId: Schema.optional<Schema.String>;
1657
- readonly timestamp: Schema.optional<Schema.DateTimeUtcFromString>;
1658
- readonly request: Schema.optional<typeof Response.HttpRequestDetails>;
1659
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1660
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1661
- }>>, Schema.toEncoded<Schema.Struct<{
1662
- readonly type: Schema.tag<"finish">;
1663
- readonly reason: Schema.Literals<["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>;
1664
- readonly usage: typeof Response.Usage;
1665
- readonly response: Schema.optional<typeof Response.HttpResponseDetails>;
1666
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1667
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1668
- }>>]>>;
1669
- }>;
1670
- type ScriptedGenerateTurn = typeof ScriptedGenerateTurn.Type;
1671
- /** One streaming invocation with its encoded parts and terminal behavior. */
1672
- declare const ScriptedStreamTurn: Schema.TaggedStruct<"Stream", {
1673
- readonly parts: Schema.$Array<Schema.Union<readonly [Schema.toEncoded<Schema.Struct<{
1674
- readonly type: Schema.tag<"text-start">;
1675
- readonly id: Schema.String;
1676
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1677
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1678
- }>>, Schema.toEncoded<Schema.Struct<{
1679
- readonly type: Schema.tag<"text-delta">;
1680
- readonly id: Schema.String;
1681
- readonly delta: Schema.String;
1682
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1683
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1684
- }>>, Schema.toEncoded<Schema.Struct<{
1685
- readonly type: Schema.tag<"text-end">;
1686
- readonly id: Schema.String;
1687
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1688
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1689
- }>>, Schema.toEncoded<Schema.Struct<{
1690
- readonly type: Schema.tag<"reasoning-start">;
1691
- readonly id: Schema.String;
1692
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1693
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1694
- }>>, Schema.toEncoded<Schema.Struct<{
1695
- readonly type: Schema.tag<"reasoning-delta">;
1696
- readonly id: Schema.String;
1697
- readonly delta: Schema.String;
1698
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1699
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1700
- }>>, Schema.toEncoded<Schema.Struct<{
1701
- readonly type: Schema.tag<"reasoning-end">;
1702
- readonly id: Schema.String;
1703
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1704
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1705
- }>>, Schema.toEncoded<Schema.Struct<{
1706
- readonly type: Schema.tag<"tool-params-start">;
1707
- readonly id: Schema.String;
1708
- readonly name: Schema.String;
1709
- readonly providerExecuted: Schema.withDecodingDefaultKey<Schema.Boolean>;
1710
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1711
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1712
- }>>, Schema.toEncoded<Schema.Struct<{
1713
- readonly type: Schema.tag<"tool-params-delta">;
1714
- readonly id: Schema.String;
1715
- readonly delta: Schema.String;
1716
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1717
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1718
- }>>, Schema.toEncoded<Schema.Struct<{
1719
- readonly type: Schema.tag<"tool-params-end">;
1720
- readonly id: Schema.String;
1721
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1722
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1723
- }>>, Schema.Struct<{
1724
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1725
- readonly type: Schema.Literal<"tool-call">;
1726
- readonly id: Schema.String;
1727
- readonly name: Schema.String;
1728
- readonly params: Schema.Unknown;
1729
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1730
- }>, Schema.Struct<{
1731
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1732
- readonly type: Schema.Literal<"tool-result">;
1733
- readonly id: Schema.String;
1734
- readonly name: Schema.String;
1735
- readonly result: Schema.Unknown;
1736
- readonly isFailure: Schema.Boolean;
1737
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1738
- readonly preliminary: Schema.optionalKey<Schema.Boolean>;
1739
- }>, Schema.toEncoded<Schema.Struct<{
1740
- readonly type: Schema.tag<"tool-approval-request">;
1741
- readonly approvalId: Schema.String;
1742
- readonly toolCallId: Schema.String;
1743
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1744
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1745
- }>>, Schema.toEncoded<Schema.Struct<{
1746
- readonly type: Schema.tag<"file">;
1747
- readonly mediaType: Schema.String;
1748
- readonly data: Schema.Uint8ArrayFromBase64;
1749
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1750
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1751
- }>>, Schema.toEncoded<Schema.Struct<{
1752
- readonly type: Schema.tag<"source">;
1753
- readonly sourceType: Schema.tag<"document">;
1754
- readonly id: Schema.String;
1755
- readonly mediaType: Schema.String;
1756
- readonly title: Schema.String;
1757
- readonly fileName: Schema.optionalKey<Schema.String>;
1758
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1759
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1760
- }>>, Schema.toEncoded<Schema.Struct<{
1761
- readonly type: Schema.tag<"source">;
1762
- readonly sourceType: Schema.tag<"url">;
1763
- readonly id: Schema.String;
1764
- readonly url: Schema.URLFromString;
1765
- readonly title: Schema.String;
1766
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1767
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1768
- }>>, Schema.toEncoded<Schema.Struct<{
1769
- readonly type: Schema.tag<"response-metadata">;
1770
- readonly id: Schema.optional<Schema.String>;
1771
- readonly modelId: Schema.optional<Schema.String>;
1772
- readonly timestamp: Schema.optional<Schema.DateTimeUtcFromString>;
1773
- readonly request: Schema.optional<typeof Response.HttpRequestDetails>;
1774
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1775
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1776
- }>>, Schema.toEncoded<Schema.Struct<{
1777
- readonly type: Schema.tag<"finish">;
1778
- readonly reason: Schema.Literals<["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>;
1779
- readonly usage: typeof Response.Usage;
1780
- readonly response: Schema.optional<typeof Response.HttpResponseDetails>;
1781
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1782
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1783
- }>>, Schema.toEncoded<Schema.Struct<{
1784
- readonly type: Schema.tag<"error">;
1785
- readonly error: Schema.Unknown;
1786
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1787
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1788
- }>>]>>;
1789
- readonly termination: Schema.Union<readonly [Schema.TaggedStruct<"Complete", {}>, Schema.TaggedStruct<"Fail", {
1790
- readonly description: Schema.String;
1791
- }>, Schema.TaggedStruct<"Hang", {}>]>;
1792
- }>;
1793
- type ScriptedStreamTurn = typeof ScriptedStreamTurn.Type;
1794
- /**
1795
- * Serializable grammar for one finite scripted provider invocation.
1796
- */
1797
- declare const ScriptedTurn: Schema.Union<readonly [Schema.TaggedStruct<"Generate", {
1798
- readonly parts: Schema.$Array<Schema.Union<readonly [Schema.toEncoded<Schema.Struct<{
1799
- readonly type: Schema.tag<"text">;
1800
- readonly text: Schema.String;
1801
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1802
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1803
- }>>, Schema.toEncoded<Schema.Struct<{
1804
- readonly type: Schema.tag<"reasoning">;
1805
- readonly text: Schema.String;
1806
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1807
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1808
- }>>, Schema.toEncoded<Schema.Struct<{
1809
- readonly type: Schema.tag<"reasoning-delta">;
1810
- readonly id: Schema.String;
1811
- readonly delta: Schema.String;
1812
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1813
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1814
- }>>, Schema.toEncoded<Schema.Struct<{
1815
- readonly type: Schema.tag<"reasoning-end">;
1816
- readonly id: Schema.String;
1817
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1818
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1819
- }>>, Schema.Struct<{
1820
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1821
- readonly type: Schema.Literal<"tool-call">;
1822
- readonly id: Schema.String;
1823
- readonly name: Schema.String;
1824
- readonly params: Schema.Unknown;
1825
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1826
- }>, Schema.Struct<{
1827
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1828
- readonly type: Schema.Literal<"tool-result">;
1829
- readonly id: Schema.String;
1830
- readonly name: Schema.String;
1831
- readonly result: Schema.Unknown;
1832
- readonly isFailure: Schema.Boolean;
1833
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1834
- readonly preliminary: Schema.optionalKey<Schema.Boolean>;
1835
- }>, Schema.toEncoded<Schema.Struct<{
1836
- readonly type: Schema.tag<"tool-approval-request">;
1837
- readonly approvalId: Schema.String;
1838
- readonly toolCallId: Schema.String;
1839
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1840
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1841
- }>>, Schema.toEncoded<Schema.Struct<{
1842
- readonly type: Schema.tag<"file">;
1843
- readonly mediaType: Schema.String;
1844
- readonly data: Schema.Uint8ArrayFromBase64;
1845
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1846
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1847
- }>>, Schema.toEncoded<Schema.Struct<{
1848
- readonly type: Schema.tag<"source">;
1849
- readonly sourceType: Schema.tag<"document">;
1850
- readonly id: Schema.String;
1851
- readonly mediaType: Schema.String;
1852
- readonly title: Schema.String;
1853
- readonly fileName: Schema.optionalKey<Schema.String>;
1854
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1855
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1856
- }>>, Schema.toEncoded<Schema.Struct<{
1857
- readonly type: Schema.tag<"source">;
1858
- readonly sourceType: Schema.tag<"url">;
1859
- readonly id: Schema.String;
1860
- readonly url: Schema.URLFromString;
1861
- readonly title: Schema.String;
1862
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1863
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1864
- }>>, Schema.toEncoded<Schema.Struct<{
1865
- readonly type: Schema.tag<"response-metadata">;
1866
- readonly id: Schema.optional<Schema.String>;
1867
- readonly modelId: Schema.optional<Schema.String>;
1868
- readonly timestamp: Schema.optional<Schema.DateTimeUtcFromString>;
1869
- readonly request: Schema.optional<typeof Response.HttpRequestDetails>;
1870
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1871
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1872
- }>>, Schema.toEncoded<Schema.Struct<{
1873
- readonly type: Schema.tag<"finish">;
1874
- readonly reason: Schema.Literals<["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>;
1875
- readonly usage: typeof Response.Usage;
1876
- readonly response: Schema.optional<typeof Response.HttpResponseDetails>;
1877
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1878
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1879
- }>>]>>;
1880
- }>, Schema.TaggedStruct<"Stream", {
1881
- readonly parts: Schema.$Array<Schema.Union<readonly [Schema.toEncoded<Schema.Struct<{
1882
- readonly type: Schema.tag<"text-start">;
1883
- readonly id: Schema.String;
1884
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1885
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1886
- }>>, Schema.toEncoded<Schema.Struct<{
1887
- readonly type: Schema.tag<"text-delta">;
1888
- readonly id: Schema.String;
1889
- readonly delta: Schema.String;
1890
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1891
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1892
- }>>, Schema.toEncoded<Schema.Struct<{
1893
- readonly type: Schema.tag<"text-end">;
1894
- readonly id: Schema.String;
1895
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1896
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1897
- }>>, Schema.toEncoded<Schema.Struct<{
1898
- readonly type: Schema.tag<"reasoning-start">;
1899
- readonly id: Schema.String;
1900
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1901
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1902
- }>>, Schema.toEncoded<Schema.Struct<{
1903
- readonly type: Schema.tag<"reasoning-delta">;
1904
- readonly id: Schema.String;
1905
- readonly delta: Schema.String;
1906
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1907
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1908
- }>>, Schema.toEncoded<Schema.Struct<{
1909
- readonly type: Schema.tag<"reasoning-end">;
1910
- readonly id: Schema.String;
1911
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1912
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1913
- }>>, Schema.toEncoded<Schema.Struct<{
1914
- readonly type: Schema.tag<"tool-params-start">;
1915
- readonly id: Schema.String;
1916
- readonly name: Schema.String;
1917
- readonly providerExecuted: Schema.withDecodingDefaultKey<Schema.Boolean>;
1918
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1919
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1920
- }>>, Schema.toEncoded<Schema.Struct<{
1921
- readonly type: Schema.tag<"tool-params-delta">;
1922
- readonly id: Schema.String;
1923
- readonly delta: Schema.String;
1924
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1925
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1926
- }>>, Schema.toEncoded<Schema.Struct<{
1927
- readonly type: Schema.tag<"tool-params-end">;
1928
- readonly id: Schema.String;
1929
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1930
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1931
- }>>, Schema.Struct<{
1932
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1933
- readonly type: Schema.Literal<"tool-call">;
1934
- readonly id: Schema.String;
1935
- readonly name: Schema.String;
1936
- readonly params: Schema.Unknown;
1937
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1938
- }>, Schema.Struct<{
1939
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
1940
- readonly type: Schema.Literal<"tool-result">;
1941
- readonly id: Schema.String;
1942
- readonly name: Schema.String;
1943
- readonly result: Schema.Unknown;
1944
- readonly isFailure: Schema.Boolean;
1945
- readonly providerExecuted: Schema.optionalKey<Schema.Boolean>;
1946
- readonly preliminary: Schema.optionalKey<Schema.Boolean>;
1947
- }>, Schema.toEncoded<Schema.Struct<{
1948
- readonly type: Schema.tag<"tool-approval-request">;
1949
- readonly approvalId: Schema.String;
1950
- readonly toolCallId: Schema.String;
1951
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1952
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1953
- }>>, Schema.toEncoded<Schema.Struct<{
1954
- readonly type: Schema.tag<"file">;
1955
- readonly mediaType: Schema.String;
1956
- readonly data: Schema.Uint8ArrayFromBase64;
1957
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1958
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1959
- }>>, Schema.toEncoded<Schema.Struct<{
1960
- readonly type: Schema.tag<"source">;
1961
- readonly sourceType: Schema.tag<"document">;
1962
- readonly id: Schema.String;
1963
- readonly mediaType: Schema.String;
1964
- readonly title: Schema.String;
1965
- readonly fileName: Schema.optionalKey<Schema.String>;
1966
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1967
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1968
- }>>, Schema.toEncoded<Schema.Struct<{
1969
- readonly type: Schema.tag<"source">;
1970
- readonly sourceType: Schema.tag<"url">;
1971
- readonly id: Schema.String;
1972
- readonly url: Schema.URLFromString;
1973
- readonly title: Schema.String;
1974
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1975
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1976
- }>>, Schema.toEncoded<Schema.Struct<{
1977
- readonly type: Schema.tag<"response-metadata">;
1978
- readonly id: Schema.optional<Schema.String>;
1979
- readonly modelId: Schema.optional<Schema.String>;
1980
- readonly timestamp: Schema.optional<Schema.DateTimeUtcFromString>;
1981
- readonly request: Schema.optional<typeof Response.HttpRequestDetails>;
1982
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1983
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1984
- }>>, Schema.toEncoded<Schema.Struct<{
1985
- readonly type: Schema.tag<"finish">;
1986
- readonly reason: Schema.Literals<["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>;
1987
- readonly usage: typeof Response.Usage;
1988
- readonly response: Schema.optional<typeof Response.HttpResponseDetails>;
1989
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1990
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1991
- }>>, Schema.toEncoded<Schema.Struct<{
1992
- readonly type: Schema.tag<"error">;
1993
- readonly error: Schema.Unknown;
1994
- readonly "~effect/ai/Content/Part": Schema.withDecodingDefaultKey<Schema.tag<"~effect/ai/Content/Part">>;
1995
- readonly metadata: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.Codec<Schema.Json>>>;
1996
- }>>]>>;
1997
- readonly termination: Schema.Union<readonly [Schema.TaggedStruct<"Complete", {}>, Schema.TaggedStruct<"Fail", {
1998
- readonly description: Schema.String;
1999
- }>, Schema.TaggedStruct<"Hang", {}>]>;
2000
- }>]>;
2001
- type ScriptedTurn = typeof ScriptedTurn.Type;
2002
- type ScriptedRequestKind = "generate" | "stream";
2003
- /**
2004
- * A request after Effect AI has normalized its prompt, tools, response format,
2005
- * tool choice, span, and incremental-response fields.
2006
- */
2007
- interface ScriptedRequest {
2008
- readonly kind: ScriptedRequestKind;
2009
- readonly options: LanguageModel.ProviderOptions;
2010
- }
2011
- /** Optional request assertions and stream lifecycle effects for one scripted turn. */
2012
- interface ScriptedTurnHooks {
2013
- /** Runs against the normalized provider request before producing the response. */
2014
- readonly assertRequest?: (request: LanguageModel.ProviderOptions) => Effect.Effect<void, AiError.AiError> | void;
2015
- /** Runs immediately before the scripted stream begins emitting parts. */
2016
- readonly onStreamStart?: Effect.Effect<void> | undefined;
2017
- /** Runs when the scripted stream completes, fails, or is interrupted. */
2018
- readonly onStreamFinalize?: Effect.Effect<void> | undefined;
2019
- }
2020
- /**
2021
- * Runtime hooks are deliberately separate from the serializable turn grammar.
2022
- */
2023
- type ScriptedTurnInput = ScriptedTurn & ScriptedTurnHooks;
2024
- declare const ScriptedModel_base: Context.ServiceClass<ScriptedModel, "@effect-agent/testing/ScriptedModel", {
2025
- /** Normalized provider requests captured in invocation order. */
2026
- readonly requests: Effect.Effect<ReadonlyArray<ScriptedRequest>>;
2027
- /** Number of scripted turns not yet consumed. */
2028
- readonly remaining: Effect.Effect<number>;
2029
- /** Fails with `AiError` when any scripted turns remain. */
2030
- readonly assertExhausted: Effect.Effect<void, AiError.AiError>;
2031
- }>;
2032
- /** Inspection service for a deterministic LanguageModel backed by finite scripted turns. */
2033
- declare class ScriptedModel extends ScriptedModel_base {
2034
- /**
2035
- * Provides the native Effect AI `LanguageModel` and this inspection service.
2036
- * Supplying the extra inspection service does not add it to model-call
2037
- * requirements. Each model invocation consumes one turn before assertion and
2038
- * turn-kind validation.
2039
- */
2040
- static layer(turns: ReadonlyArray<ScriptedTurnInput>): Layer.Layer<LanguageModel.LanguageModel | ScriptedModel, never, never>;
2041
- }
2042
- //#endregion
2043
- //#region src/fixtures/travel-planner/phase4.d.ts
2044
- declare const TravelPlannerDurabilityProfile_base: Schema.Class<TravelPlannerDurabilityProfile, Schema.Struct<{
2045
- readonly deploymentClass: Schema.Literal<"DN">;
2046
- readonly durableAcceptedWork: Schema.Literal<true>;
2047
- readonly canonicalSchemaVersion: Schema.Literal<1>;
2048
- /** Supplier booking replay safety is P5 (Durable Tools) scope; DN does not claim it. */
2049
- readonly supplierBookingReplaySafe: Schema.Literal<false>;
2050
- }>, {}>;
2051
- /**
2052
- * The Phase 4 profile claims durable accepted work on the Node/SQLite runtime (deployment class
2053
- * DN): once `submit` returns a Receipt, the Submission settles exactly once even across process
2054
- * loss. The claim is limited to safe-to-repeat toolkits (D6): supplier booking is explicitly NOT
2055
- * claimed safely replayable — replay-safe external mutation is P5 (Durable Tools) scope.
2056
- */
2057
- declare class TravelPlannerDurabilityProfile extends TravelPlannerDurabilityProfile_base {}
2058
- declare const phase4TravelPlannerProfile: TravelPlannerDurabilityProfile;
2059
- declare const phase4TravelPlannerDeploymentId: string & import("effect/Brand").Brand<"@effect-agent/session/DeploymentId">;
2060
- declare const phase4TravelPlannerProducerId: string & import("effect/Brand").Brand<"@effect-agent/session/ProducerId">;
2061
- declare const phase4TravelPlannerPrincipal: string & import("effect/Brand").Brand<"@effect-agent/session/Principal">;
2062
- /** Redacted, deterministic definition identities for the current fixture version. */
2063
- declare const phase4TravelPlannerDefinitionDigests: DefinitionDigests;
2064
- /** Durable admission options for one Travel Planner Submission on one trip lane. */
2065
- declare const phase4TravelPlannerSubmitOptions: (conversationId: ConversationId, idempotencyKey: IdempotencyKey) => DurableSubmitOptions;
2066
- /**
2067
- * The P4 read-only search Tools, calling the same deterministic catalogs as the P1 toolkit.
2068
- *
2069
- * The plain-Struct parameter shape is a historical remnant of the P4 carry-in workaround: since
2070
- * the P5 engine fix, official history carries Schema-ENCODED Tool-call parameters, so class-typed
2071
- * parameter codecs persist canonically too — the Structs simply need no change here. The
2072
- * `ToolExecutionClass` `readonly` annotation is the deliberate P5 migration (plan §4.3): these
2073
- * Tools perform no external mutation, so a crash between start and settlement is a free re-run
2074
- * and they never enter the prepared/settled uncertainty protocol — keeping the P4 canonical
2075
- * history byte-stable (an unannotated Tool fails closed to `uncertain`).
2076
- */
2077
- declare const DurableSearchFlights: Tool.Tool<"search_flights", {
2078
- readonly parameters: Schema.Struct<{
2079
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2080
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2081
- readonly departOn: Schema.String;
2082
- readonly travelers: Schema.Int;
2083
- }>;
2084
- readonly success: typeof FlightOption;
2085
- readonly failure: typeof FlightUnavailable;
2086
- readonly failureMode: "error";
2087
- }, FlightCatalog>;
2088
- declare const DurableSearchLodging: Tool.Tool<"search_lodging", {
2089
- readonly parameters: Schema.Struct<{
2090
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2091
- readonly departOn: Schema.String;
2092
- readonly nights: Schema.Int;
2093
- readonly travelers: Schema.Int;
2094
- }>;
2095
- readonly success: typeof LodgingOption;
2096
- readonly failure: typeof LodgingUnavailable;
2097
- readonly failureMode: "error";
2098
- }, LodgingCatalog>;
2099
- declare const DurableSearchActivities: Tool.Tool<"search_activities", {
2100
- readonly parameters: Schema.Struct<{
2101
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2102
- readonly departOn: Schema.String;
2103
- readonly nights: Schema.Int;
2104
- readonly travelers: Schema.Int;
2105
- }>;
2106
- readonly success: typeof ActivitySearchResult;
2107
- readonly failure: typeof ActivityUnavailable;
2108
- readonly failureMode: "error";
2109
- }, ActivityCatalog>;
2110
- declare const TravelPlannerPhase4Toolkit: Toolkit.Toolkit<{
2111
- readonly search_activities: Tool.Tool<"search_activities", {
2112
- readonly parameters: Schema.Struct<{
2113
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2114
- readonly departOn: Schema.String;
2115
- readonly nights: Schema.Int;
2116
- readonly travelers: Schema.Int;
2117
- }>;
2118
- readonly success: typeof ActivitySearchResult;
2119
- readonly failure: typeof ActivityUnavailable;
2120
- readonly failureMode: "error";
2121
- }, ActivityCatalog>;
2122
- readonly search_flights: Tool.Tool<"search_flights", {
2123
- readonly parameters: Schema.Struct<{
2124
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2125
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2126
- readonly departOn: Schema.String;
2127
- readonly travelers: Schema.Int;
2128
- }>;
2129
- readonly success: typeof FlightOption;
2130
- readonly failure: typeof FlightUnavailable;
2131
- readonly failureMode: "error";
2132
- }, FlightCatalog>;
2133
- readonly search_lodging: Tool.Tool<"search_lodging", {
2134
- readonly parameters: Schema.Struct<{
2135
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2136
- readonly departOn: Schema.String;
2137
- readonly nights: Schema.Int;
2138
- readonly travelers: Schema.Int;
2139
- }>;
2140
- readonly success: typeof LodgingOption;
2141
- readonly failure: typeof LodgingUnavailable;
2142
- readonly failureMode: "error";
2143
- }, LodgingCatalog>;
2144
- }>;
2145
- declare const TravelPlannerPhase4ToolkitLayer: Layer.Layer<Tool.HandlersFor<{
2146
- readonly search_activities: Tool.Tool<"search_activities", {
2147
- readonly parameters: Schema.Struct<{
2148
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2149
- readonly departOn: Schema.String;
2150
- readonly nights: Schema.Int;
2151
- readonly travelers: Schema.Int;
2152
- }>;
2153
- readonly success: typeof ActivitySearchResult;
2154
- readonly failure: typeof ActivityUnavailable;
2155
- readonly failureMode: "error";
2156
- }, ActivityCatalog>;
2157
- readonly search_flights: Tool.Tool<"search_flights", {
2158
- readonly parameters: Schema.Struct<{
2159
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2160
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2161
- readonly departOn: Schema.String;
2162
- readonly travelers: Schema.Int;
2163
- }>;
2164
- readonly success: typeof FlightOption;
2165
- readonly failure: typeof FlightUnavailable;
2166
- readonly failureMode: "error";
2167
- }, FlightCatalog>;
2168
- readonly search_lodging: Tool.Tool<"search_lodging", {
2169
- readonly parameters: Schema.Struct<{
2170
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2171
- readonly departOn: Schema.String;
2172
- readonly nights: Schema.Int;
2173
- readonly travelers: Schema.Int;
2174
- }>;
2175
- readonly success: typeof LodgingOption;
2176
- readonly failure: typeof LodgingUnavailable;
2177
- readonly failureMode: "error";
2178
- }, LodgingCatalog>;
2179
- }>, never, never>;
2180
- /**
2181
- * The cumulative Travel Planner, Phase 4: the P1 planning behavior on the durable Node/SQLite
2182
- * runtime. The searches are read-only and safe to repeat across Attempts (D6); supplier booking
2183
- * is deliberately absent because DN does NOT claim replay-safe external mutation (P5 scope).
2184
- */
2185
- declare const TravelPlannerPhase4: import("@effect-agent/core").Definition<typeof TripRequest, typeof TravelPlan, (input: TripRequest) => Effect.Effect<string, GuidanceFailure, TravelGuidance>, Toolkit.Toolkit<{
2186
- readonly search_activities: Tool.Tool<"search_activities", {
2187
- readonly parameters: Schema.Struct<{
2188
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2189
- readonly departOn: Schema.String;
2190
- readonly nights: Schema.Int;
2191
- readonly travelers: Schema.Int;
2192
- }>;
2193
- readonly success: typeof ActivitySearchResult;
2194
- readonly failure: typeof ActivityUnavailable;
2195
- readonly failureMode: "error";
2196
- }, ActivityCatalog>;
2197
- readonly search_flights: Tool.Tool<"search_flights", {
2198
- readonly parameters: Schema.Struct<{
2199
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2200
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2201
- readonly departOn: Schema.String;
2202
- readonly travelers: Schema.Int;
2203
- }>;
2204
- readonly success: typeof FlightOption;
2205
- readonly failure: typeof FlightUnavailable;
2206
- readonly failureMode: "error";
2207
- }, FlightCatalog>;
2208
- readonly search_lodging: Tool.Tool<"search_lodging", {
2209
- readonly parameters: Schema.Struct<{
2210
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2211
- readonly departOn: Schema.String;
2212
- readonly nights: Schema.Int;
2213
- readonly travelers: Schema.Int;
2214
- }>;
2215
- readonly success: typeof LodgingOption;
2216
- readonly failure: typeof LodgingUnavailable;
2217
- readonly failureMode: "error";
2218
- }, LodgingCatalog>;
2219
- }>>;
2220
- /**
2221
- * The P4 Agent Binding: the durable Travel Planner definition bound to a finite scripted model.
2222
- * The scripted Layer is rebuilt per Run, so every Run of one Binding replays the same
2223
- * deterministic script.
2224
- */
2225
- declare const makePhase4TravelPlannerAgent: (turns?: ReadonlyArray<ScriptedTurnInput>) => import("@effect-agent/core").Binding<import("@effect-agent/core").Definition<typeof TripRequest, typeof TravelPlan, (input: TripRequest) => Effect.Effect<string, GuidanceFailure, TravelGuidance>, Toolkit.Toolkit<{
2226
- readonly search_activities: Tool.Tool<"search_activities", {
2227
- readonly parameters: Schema.Struct<{
2228
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2229
- readonly departOn: Schema.String;
2230
- readonly nights: Schema.Int;
2231
- readonly travelers: Schema.Int;
2232
- }>;
2233
- readonly success: typeof ActivitySearchResult;
2234
- readonly failure: typeof ActivityUnavailable;
2235
- readonly failureMode: "error";
2236
- }, ActivityCatalog>;
2237
- readonly search_flights: Tool.Tool<"search_flights", {
2238
- readonly parameters: Schema.Struct<{
2239
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2240
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2241
- readonly departOn: Schema.String;
2242
- readonly travelers: Schema.Int;
2243
- }>;
2244
- readonly success: typeof FlightOption;
2245
- readonly failure: typeof FlightUnavailable;
2246
- readonly failureMode: "error";
2247
- }, FlightCatalog>;
2248
- readonly search_lodging: Tool.Tool<"search_lodging", {
2249
- readonly parameters: Schema.Struct<{
2250
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2251
- readonly departOn: Schema.String;
2252
- readonly nights: Schema.Int;
2253
- readonly travelers: Schema.Int;
2254
- }>;
2255
- readonly success: typeof LodgingOption;
2256
- readonly failure: typeof LodgingUnavailable;
2257
- readonly failureMode: "error";
2258
- }, LodgingCatalog>;
2259
- }>>, Model.Model<"scripted", import("effect/unstable/ai/LanguageModel").LanguageModel | ScriptedModel, never>>;
2260
- /**
2261
- * Everything a durable worker needs beyond the runtime stack, reusing the deterministic P1
2262
- * travel-service Layers. The durable coordinator supplies its own deterministic `IdGenerator`,
2263
- * so this Layer deliberately provides none.
2264
- */
2265
- declare const phase4TravelPlannerWorkerLayer: Layer.Layer<ActivityCatalog | FlightCatalog | LodgingCatalog | TravelGuidance | Tool.HandlersFor<{
2266
- readonly search_activities: Tool.Tool<"search_activities", {
2267
- readonly parameters: Schema.Struct<{
2268
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2269
- readonly departOn: Schema.String;
2270
- readonly nights: Schema.Int;
2271
- readonly travelers: Schema.Int;
2272
- }>;
2273
- readonly success: typeof ActivitySearchResult;
2274
- readonly failure: typeof ActivityUnavailable;
2275
- readonly failureMode: "error";
2276
- }, ActivityCatalog>;
2277
- readonly search_flights: Tool.Tool<"search_flights", {
2278
- readonly parameters: Schema.Struct<{
2279
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2280
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2281
- readonly departOn: Schema.String;
2282
- readonly travelers: Schema.Int;
2283
- }>;
2284
- readonly success: typeof FlightOption;
2285
- readonly failure: typeof FlightUnavailable;
2286
- readonly failureMode: "error";
2287
- }, FlightCatalog>;
2288
- readonly search_lodging: Tool.Tool<"search_lodging", {
2289
- readonly parameters: Schema.Struct<{
2290
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2291
- readonly departOn: Schema.String;
2292
- readonly nights: Schema.Int;
2293
- readonly travelers: Schema.Int;
2294
- }>;
2295
- readonly success: typeof LodgingOption;
2296
- readonly failure: typeof LodgingUnavailable;
2297
- readonly failureMode: "error";
2298
- }, LodgingCatalog>;
2299
- }>, never, never>;
2300
- declare const TravelPlannerDurableEvidenceError_base: Schema.Class<TravelPlannerDurableEvidenceError, Schema.TaggedStruct<"TravelPlannerDurableEvidenceError", {
2301
- readonly message: Schema.String;
2302
- }>, import("effect/Cause").YieldableError>;
2303
- declare class TravelPlannerDurableEvidenceError extends TravelPlannerDurableEvidenceError_base {}
2304
- /**
2305
- * Decode the completed itinerary from the canonical `SubmissionSettled` record. Canonical history
2306
- * is the outcome authority (DUR-015): the settled result — not any ledger cache — must decode
2307
- * through the trip output schema.
2308
- */
2309
- declare const travelPlanFromDurableSettlement: (records: readonly CanonicalRecordEnvelope[]) => Effect.Effect<TravelPlan, TravelPlannerDurableEvidenceError, never>;
2310
- /**
2311
- * Project canonical evidence into a Submission-identity-independent comparable form: batch
2312
- * identity, canonical sequence, and the full encoded record, with the ledger-minted
2313
- * `submissionId`/`receiptId` (and every identity derived from them: run, turn, batch, record,
2314
- * and settlement ids) replaced by stable placeholders. Two Conversations whose normalized
2315
- * evidence is equal took byte-equivalent canonical histories, so restart-equivalence can compare
2316
- * a recovered run against an uninterrupted control run on a separate database.
2317
- */
2318
- declare const normalizeDurableTravelPlannerEvidence: (records: readonly CanonicalRecordEnvelope[], receipt: Receipt) => Effect.Effect<Schema.Json, TravelPlannerDurableEvidenceError, never>;
2319
- //#endregion
2320
- //#region src/fixtures/travel-planner/phase5.d.ts
2321
- declare const TravelPlannerBookingProfile_base: Schema.Class<TravelPlannerBookingProfile, Schema.Struct<{
2322
- readonly deploymentClass: Schema.Literal<"DN">;
2323
- readonly durableAcceptedWork: Schema.Literal<true>;
2324
- readonly canonicalSchemaVersion: Schema.Literal<1>;
2325
- /** P5: supplier mutations get prepared/settled records, Unknown Outcomes, and reconciliation. */
2326
- readonly supplierBookingUncertaintyProtocol: Schema.Literal<true>;
2327
- /** P5: Durable Steps are exactly-once-RECORDED; their side effects stay at-least-once. */
2328
- readonly durableStepsRecorded: Schema.Literal<true>;
2329
- /** Never claimed at any phase (DUR-003). */
2330
- readonly exactlyOnceExternalEffects: Schema.Literal<false>;
2331
- }>, {}>;
2332
- /**
2333
- * The Phase 5 profile extends the P4 `DN` claim to consequential supplier mutation: booking
2334
- * Tools enter the prepared/settled uncertainty protocol, unresolved external effects stop at
2335
- * Unknown Outcomes instead of replaying, Durable Steps replay recorded results, and queued
2336
- * traveler input joins the active Run. Exactly-once EXTERNAL execution is still — deliberately —
2337
- * not claimed (DUR-003): the supplier's own idempotency keys are what dedupe repeats.
2338
- */
2339
- declare class TravelPlannerBookingProfile extends TravelPlannerBookingProfile_base {}
2340
- declare const phase5TravelPlannerProfile: TravelPlannerBookingProfile;
2341
- declare const phase5TravelPlannerDeploymentId: string & import("effect/Brand").Brand<"@effect-agent/session/DeploymentId">;
2342
- declare const phase5TravelPlannerProducerId: string & import("effect/Brand").Brand<"@effect-agent/session/ProducerId">;
2343
- declare const phase5TravelPlannerPrincipal: string & import("effect/Brand").Brand<"@effect-agent/session/Principal">;
2344
- /** Redacted, deterministic definition identities for the current fixture version. */
2345
- declare const phase5TravelPlannerDefinitionDigests: DefinitionDigests;
2346
- /** Durable admission options for one Travel Planner Submission on one trip lane. */
2347
- declare const phase5TravelPlannerSubmitOptions: (conversationId: ConversationId, idempotencyKey: IdempotencyKey) => DurableSubmitOptions;
2348
- declare const TravelerRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/TravelerRef">;
2349
- type TravelerRef = typeof TravelerRef.Type;
2350
- declare const FlightBookingRequest_base: Schema.Class<FlightBookingRequest, Schema.Struct<{
2351
- readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
2352
- readonly travelerRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/TravelerRef">;
2353
- readonly departOn: Schema.String;
2354
- }>, {}>;
2355
- /**
2356
- * Class-shaped booking parameters with branded fields: since the P5 engine fix, official history
2357
- * carries Schema-ENCODED Tool-call parameters, so class-typed parameter codecs persist
2358
- * canonically end-to-end (the P4 Struct workaround is gone for new Tools).
2359
- */
2360
- declare class FlightBookingRequest extends FlightBookingRequest_base {}
2361
- declare const SupplierBookingConfirmation_base: Schema.Class<SupplierBookingConfirmation, Schema.Struct<{
2362
- readonly bookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
2363
- readonly status: Schema.Literal<"confirmed">;
2364
- readonly detail: Schema.String;
2365
- }>, {}>;
2366
- declare class SupplierBookingConfirmation extends SupplierBookingConfirmation_base {}
2367
- declare const CancelBookingRequest_base: Schema.Class<CancelBookingRequest, Schema.Struct<{
2368
- readonly bookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
2369
- readonly travelerRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/TravelerRef">;
2370
- }>, {}>;
2371
- declare class CancelBookingRequest extends CancelBookingRequest_base {}
2372
- declare const CancellationConfirmation_base: Schema.Class<CancellationConfirmation, Schema.Struct<{
2373
- readonly bookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
2374
- readonly status: Schema.Literal<"cancelled">;
2375
- }>, {}>;
2376
- declare class CancellationConfirmation extends CancellationConfirmation_base {}
2377
- declare const ItineraryBookingRequest_base: Schema.Class<ItineraryBookingRequest, Schema.Struct<{
2378
- readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
2379
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2380
- readonly nights: Schema.Int;
2381
- readonly travelerRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/TravelerRef">;
2382
- }>, {}>;
2383
- declare class ItineraryBookingRequest extends ItineraryBookingRequest_base {}
2384
- declare const ItineraryConfirmation_base: Schema.Class<ItineraryConfirmation, Schema.Struct<{
2385
- readonly flightBookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
2386
- readonly lodgingBookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
2387
- readonly confirmationCode: Schema.String;
2388
- }>, {}>;
2389
- declare class ItineraryConfirmation extends ItineraryConfirmation_base {}
2390
- declare const TravelBookingReport_base: Schema.Class<TravelBookingReport, Schema.Struct<{
2391
- readonly summary: Schema.String;
2392
- readonly bookingRefs: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">>;
2393
- }>, {}>;
2394
- /** The P5 Run output: a booked (or explicitly not-booked) trip report. */
2395
- declare class TravelBookingReport extends TravelBookingReport_base {}
2396
- /**
2397
- * Supplier idempotency-key derivations. The handler owns key derivation (the `idempotent` and
2398
- * `uncertain` execution classes carry no key), and the reconciler MUST use the same derivations
2399
- * to query external truth — both sides are exported so they cannot drift.
2400
- */
2401
- declare const bookFlightIdempotencyKey: (toolCallId: string) => string;
2402
- declare const itineraryStepIdempotencyKey: (toolCallId: string, stepName: string) => string;
2403
- /**
2404
- * Approval-gated supplier booking, explicitly `uncertain`: a crash after the call may have
2405
- * mutated supplier state without a recorded outcome, so recovery must reconcile or stop at an
2406
- * Unknown Outcome — never replay automatically (DUR-009, ADR-0004).
2407
- */
2408
- declare const BookFlight: Tool.Tool<"book_flight", {
2409
- readonly parameters: typeof FlightBookingRequest;
2410
- readonly success: typeof SupplierBookingConfirmation;
2411
- readonly failure: typeof SupplierUnavailable;
2412
- readonly failureMode: "error";
2413
- }, SupplierBookingDesk>;
2414
- /**
2415
- * Approval-gated cancellation, annotated `idempotent`: the DECLARED external contract is that
2416
- * cancellation is idempotent by `bookingRef` (the supplier desk enforces it), so recovery may
2417
- * re-execute a prepared-but-unsettled cancel without reconciliation proof. Repeats stay
2418
- * observable in the supplier call counters — the annotation never claims exactly-once execution.
2419
- */
2420
- declare const CancelBooking: Tool.Tool<"cancel_booking", {
2421
- readonly parameters: typeof CancelBookingRequest;
2422
- readonly success: typeof CancellationConfirmation;
2423
- readonly failure: typeof SupplierUnavailable;
2424
- readonly failureMode: "error";
2425
- }, SupplierBookingDesk>;
2426
- /**
2427
- * The Durable Tool: declaring `DurableStep` in `dependencies` is what makes it durable
2428
- * (CONTEXT.md). Its handler divides supplier mutation into three named Steps — `reserve-flight`,
2429
- * `reserve-lodging`, `issue-confirmation` — each deriving its supplier idempotency key from
2430
- * `(toolCallId, stepName)`, so re-entry after interruption replays recorded Step results and the
2431
- * supplier dedupes any honestly-repeated call. The Tool itself carries no execution-class
2432
- * annotation: it stays fail-closed `uncertain`, and `TravelSupplierReconcilerLayer` proves
2433
- * re-entry safe from the keyed-Step construction instead.
2434
- */
2435
- declare const BookItinerary: Tool.Tool<"book_itinerary", {
2436
- readonly parameters: typeof ItineraryBookingRequest;
2437
- readonly success: typeof ItineraryConfirmation;
2438
- readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
2439
- readonly failureMode: "error";
2440
- }, DurableStep | SupplierBookingDesk>;
2441
- declare const TravelPlannerPhase5Toolkit: Toolkit.Toolkit<{
2442
- readonly book_flight: Tool.Tool<"book_flight", {
2443
- readonly parameters: typeof FlightBookingRequest;
2444
- readonly success: typeof SupplierBookingConfirmation;
2445
- readonly failure: typeof SupplierUnavailable;
2446
- readonly failureMode: "error";
2447
- }, SupplierBookingDesk>;
2448
- readonly book_itinerary: Tool.Tool<"book_itinerary", {
2449
- readonly parameters: typeof ItineraryBookingRequest;
2450
- readonly success: typeof ItineraryConfirmation;
2451
- readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
2452
- readonly failureMode: "error";
2453
- }, DurableStep | SupplierBookingDesk>;
2454
- readonly cancel_booking: Tool.Tool<"cancel_booking", {
2455
- readonly parameters: typeof CancelBookingRequest;
2456
- readonly success: typeof CancellationConfirmation;
2457
- readonly failure: typeof SupplierUnavailable;
2458
- readonly failureMode: "error";
2459
- }, SupplierBookingDesk>;
2460
- readonly search_activities: Tool.Tool<"search_activities", {
2461
- readonly parameters: Schema.Struct<{
2462
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2463
- readonly departOn: Schema.String;
2464
- readonly nights: Schema.Int;
2465
- readonly travelers: Schema.Int;
2466
- }>;
2467
- readonly success: typeof ActivitySearchResult;
2468
- readonly failure: typeof ActivityUnavailable;
2469
- readonly failureMode: "error";
2470
- }, ActivityCatalog>;
2471
- readonly search_flights: Tool.Tool<"search_flights", {
2472
- readonly parameters: Schema.Struct<{
2473
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2474
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2475
- readonly departOn: Schema.String;
2476
- readonly travelers: Schema.Int;
2477
- }>;
2478
- readonly success: typeof FlightOption;
2479
- readonly failure: typeof FlightUnavailable;
2480
- readonly failureMode: "error";
2481
- }, FlightCatalog>;
2482
- readonly search_lodging: Tool.Tool<"search_lodging", {
2483
- readonly parameters: Schema.Struct<{
2484
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2485
- readonly departOn: Schema.String;
2486
- readonly nights: Schema.Int;
2487
- readonly travelers: Schema.Int;
2488
- }>;
2489
- readonly success: typeof LodgingOption;
2490
- readonly failure: typeof LodgingUnavailable;
2491
- readonly failureMode: "error";
2492
- }, LodgingCatalog>;
2493
- }>;
2494
- declare const TravelPlannerPhase5ToolkitLayer: Layer.Layer<Tool.HandlersFor<{
2495
- readonly book_flight: Tool.Tool<"book_flight", {
2496
- readonly parameters: typeof FlightBookingRequest;
2497
- readonly success: typeof SupplierBookingConfirmation;
2498
- readonly failure: typeof SupplierUnavailable;
2499
- readonly failureMode: "error";
2500
- }, SupplierBookingDesk>;
2501
- readonly book_itinerary: Tool.Tool<"book_itinerary", {
2502
- readonly parameters: typeof ItineraryBookingRequest;
2503
- readonly success: typeof ItineraryConfirmation;
2504
- readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
2505
- readonly failureMode: "error";
2506
- }, DurableStep | SupplierBookingDesk>;
2507
- readonly cancel_booking: Tool.Tool<"cancel_booking", {
2508
- readonly parameters: typeof CancelBookingRequest;
2509
- readonly success: typeof CancellationConfirmation;
2510
- readonly failure: typeof SupplierUnavailable;
2511
- readonly failureMode: "error";
2512
- }, SupplierBookingDesk>;
2513
- readonly search_activities: Tool.Tool<"search_activities", {
2514
- readonly parameters: Schema.Struct<{
2515
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2516
- readonly departOn: Schema.String;
2517
- readonly nights: Schema.Int;
2518
- readonly travelers: Schema.Int;
2519
- }>;
2520
- readonly success: typeof ActivitySearchResult;
2521
- readonly failure: typeof ActivityUnavailable;
2522
- readonly failureMode: "error";
2523
- }, ActivityCatalog>;
2524
- readonly search_flights: Tool.Tool<"search_flights", {
2525
- readonly parameters: Schema.Struct<{
2526
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2527
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2528
- readonly departOn: Schema.String;
2529
- readonly travelers: Schema.Int;
2530
- }>;
2531
- readonly success: typeof FlightOption;
2532
- readonly failure: typeof FlightUnavailable;
2533
- readonly failureMode: "error";
2534
- }, FlightCatalog>;
2535
- readonly search_lodging: Tool.Tool<"search_lodging", {
2536
- readonly parameters: Schema.Struct<{
2537
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2538
- readonly departOn: Schema.String;
2539
- readonly nights: Schema.Int;
2540
- readonly travelers: Schema.Int;
2541
- }>;
2542
- readonly success: typeof LodgingOption;
2543
- readonly failure: typeof LodgingUnavailable;
2544
- readonly failureMode: "error";
2545
- }, LodgingCatalog>;
2546
- }>, never, never>;
2547
- /**
2548
- * The application reconciliation policy (durability §10): a claim about EXTERNAL truth, queried
2549
- * from the supplier desk by the same idempotency-key derivations the handlers use.
2550
- *
2551
- * - `book_flight`: a confirmed booking under `book-flight:{toolCallId}` is recovered supplier
2552
- * truth — `CompletedWithResult` settles it canonically without executing anything. Absence is
2553
- * NOT proof the call never started (a real supplier write could be in flight), so the desk
2554
- * answer stays fail-closed `Uncertain`.
2555
- * - `book_itinerary`: every external mutation inside is a named Step whose supplier idempotency
2556
- * key derives from `(toolCallId, stepName)`, so re-entry is provably safe by construction —
2557
- * `SafeToRetry`. Committed Steps replay from their records; repeated calls dedupe at the desk.
2558
- * - `cancel_booking`: declared `idempotent`, so the coordinator re-executes without consulting
2559
- * this policy; if ever asked, the bookingRef contract makes `SafeToRetry` honest.
2560
- * - anything else: fail-closed `Uncertain` (AGENTS rule 11).
2561
- */
2562
- declare const TravelSupplierReconcilerLayer: Layer.Layer<ToolReconciler, never, SupplierBookingDesk>;
2563
- /**
2564
- * The cumulative Travel Planner, Phase 5: the durable planner now performs consequential
2565
- * supplier mutation under the full uncertainty protocol — approval-gated uncertain booking,
2566
- * idempotent-by-contract cancellation, and one Durable Tool whose Steps carry supplier
2567
- * idempotency keys.
2568
- */
2569
- declare const TravelPlannerPhase5: import("@effect-agent/core").Definition<typeof TripRequest, typeof TravelBookingReport, string, Toolkit.Toolkit<{
2570
- readonly book_flight: Tool.Tool<"book_flight", {
2571
- readonly parameters: typeof FlightBookingRequest;
2572
- readonly success: typeof SupplierBookingConfirmation;
2573
- readonly failure: typeof SupplierUnavailable;
2574
- readonly failureMode: "error";
2575
- }, SupplierBookingDesk>;
2576
- readonly book_itinerary: Tool.Tool<"book_itinerary", {
2577
- readonly parameters: typeof ItineraryBookingRequest;
2578
- readonly success: typeof ItineraryConfirmation;
2579
- readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
2580
- readonly failureMode: "error";
2581
- }, DurableStep | SupplierBookingDesk>;
2582
- readonly cancel_booking: Tool.Tool<"cancel_booking", {
2583
- readonly parameters: typeof CancelBookingRequest;
2584
- readonly success: typeof CancellationConfirmation;
2585
- readonly failure: typeof SupplierUnavailable;
2586
- readonly failureMode: "error";
2587
- }, SupplierBookingDesk>;
2588
- readonly search_activities: Tool.Tool<"search_activities", {
2589
- readonly parameters: Schema.Struct<{
2590
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2591
- readonly departOn: Schema.String;
2592
- readonly nights: Schema.Int;
2593
- readonly travelers: Schema.Int;
2594
- }>;
2595
- readonly success: typeof ActivitySearchResult;
2596
- readonly failure: typeof ActivityUnavailable;
2597
- readonly failureMode: "error";
2598
- }, ActivityCatalog>;
2599
- readonly search_flights: Tool.Tool<"search_flights", {
2600
- readonly parameters: Schema.Struct<{
2601
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2602
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2603
- readonly departOn: Schema.String;
2604
- readonly travelers: Schema.Int;
2605
- }>;
2606
- readonly success: typeof FlightOption;
2607
- readonly failure: typeof FlightUnavailable;
2608
- readonly failureMode: "error";
2609
- }, FlightCatalog>;
2610
- readonly search_lodging: Tool.Tool<"search_lodging", {
2611
- readonly parameters: Schema.Struct<{
2612
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2613
- readonly departOn: Schema.String;
2614
- readonly nights: Schema.Int;
2615
- readonly travelers: Schema.Int;
2616
- }>;
2617
- readonly success: typeof LodgingOption;
2618
- readonly failure: typeof LodgingUnavailable;
2619
- readonly failureMode: "error";
2620
- }, LodgingCatalog>;
2621
- }>>;
2622
- declare const TravelPlannerBookingEvidenceError_base: Schema.Class<TravelPlannerBookingEvidenceError, Schema.TaggedStruct<"TravelPlannerBookingEvidenceError", {
2623
- readonly message: Schema.String;
2624
- }>, import("effect/Cause").YieldableError>;
2625
- declare class TravelPlannerBookingEvidenceError extends TravelPlannerBookingEvidenceError_base {}
2626
- /**
2627
- * Never-fabricate assertion (ROADMAP P5 exit gate): every successfully settled booking result in
2628
- * canonical history must reference a booking that actually exists in the supplier store. A
2629
- * `ToolCallSettled` whose bookingRef the supplier cannot produce would be a fabricated result —
2630
- * the exact lie the uncertainty protocol exists to prevent.
2631
- */
2632
- declare const assertSettledBookingsExistAtSupplier: (records: readonly CanonicalRecordEnvelope[]) => Effect.Effect<void, TravelPlannerBookingEvidenceError, SupplierBookingDesk>;
2633
- /**
2634
- * Everything a durable P5 worker needs beyond the runtime stack and the supplier desk: the
2635
- * booking toolkit plus the deterministic P1 travel-service Layers. `SupplierBookingDesk` is
2636
- * deliberately NOT provided here — tests own the desk's lifetime so its counters, bookings, and
2637
- * crash windows survive Tool-Layer rebuilds across Attempts.
2638
- */
2639
- declare const phase5TravelPlannerWorkerLayer: Layer.Layer<ActivityCatalog | FlightCatalog | LodgingCatalog | Tool.HandlersFor<{
2640
- readonly book_flight: Tool.Tool<"book_flight", {
2641
- readonly parameters: typeof FlightBookingRequest;
2642
- readonly success: typeof SupplierBookingConfirmation;
2643
- readonly failure: typeof SupplierUnavailable;
2644
- readonly failureMode: "error";
2645
- }, SupplierBookingDesk>;
2646
- readonly book_itinerary: Tool.Tool<"book_itinerary", {
2647
- readonly parameters: typeof ItineraryBookingRequest;
2648
- readonly success: typeof ItineraryConfirmation;
2649
- readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
2650
- readonly failureMode: "error";
2651
- }, DurableStep | SupplierBookingDesk>;
2652
- readonly cancel_booking: Tool.Tool<"cancel_booking", {
2653
- readonly parameters: typeof CancelBookingRequest;
2654
- readonly success: typeof CancellationConfirmation;
2655
- readonly failure: typeof SupplierUnavailable;
2656
- readonly failureMode: "error";
2657
- }, SupplierBookingDesk>;
2658
- readonly search_activities: Tool.Tool<"search_activities", {
2659
- readonly parameters: Schema.Struct<{
2660
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2661
- readonly departOn: Schema.String;
2662
- readonly nights: Schema.Int;
2663
- readonly travelers: Schema.Int;
2664
- }>;
2665
- readonly success: typeof ActivitySearchResult;
2666
- readonly failure: typeof ActivityUnavailable;
2667
- readonly failureMode: "error";
2668
- }, ActivityCatalog>;
2669
- readonly search_flights: Tool.Tool<"search_flights", {
2670
- readonly parameters: Schema.Struct<{
2671
- readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2672
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2673
- readonly departOn: Schema.String;
2674
- readonly travelers: Schema.Int;
2675
- }>;
2676
- readonly success: typeof FlightOption;
2677
- readonly failure: typeof FlightUnavailable;
2678
- readonly failureMode: "error";
2679
- }, FlightCatalog>;
2680
- readonly search_lodging: Tool.Tool<"search_lodging", {
2681
- readonly parameters: Schema.Struct<{
2682
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2683
- readonly departOn: Schema.String;
2684
- readonly nights: Schema.Int;
2685
- readonly travelers: Schema.Int;
2686
- }>;
2687
- readonly success: typeof LodgingOption;
2688
- readonly failure: typeof LodgingUnavailable;
2689
- readonly failureMode: "error";
2690
- }, LodgingCatalog>;
2691
- }>, never, never>;
2692
- //#endregion
2693
- //#region src/fixtures/travel-planner/subagents.d.ts
2694
- declare const DestinationQuery_base: Schema.Class<DestinationQuery, Schema.Struct<{
2695
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2696
- }>, {}>;
2697
- declare class DestinationQuery extends DestinationQuery_base {}
2698
- declare const DestinationFacts_base: Schema.Class<DestinationFacts, Schema.Struct<{
2699
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2700
- readonly highlights: Schema.$Array<Schema.String>;
2701
- readonly advisory: Schema.NonEmptyString;
2702
- }>, {}>;
2703
- declare class DestinationFacts extends DestinationFacts_base {}
2704
- declare const DestinationGuideUnavailable_base: Schema.Class<DestinationGuideUnavailable, Schema.TaggedStruct<"DestinationGuideUnavailable", {
2705
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2706
- readonly message: Schema.String;
2707
- }>, import("effect/Cause").YieldableError>;
2708
- declare class DestinationGuideUnavailable extends DestinationGuideUnavailable_base {}
2709
- declare const DestinationGuide_base: Context.ServiceClass<DestinationGuide, "@effect-agent/testing/travel-planner/DestinationGuide", {
2710
- readonly lookup: (query: DestinationQuery) => Effect.Effect<DestinationFacts, DestinationGuideUnavailable>;
2711
- }>;
2712
- declare class DestinationGuide extends DestinationGuide_base {}
2713
- declare const LookupDestination: Tool.Tool<"lookup_destination", {
2714
- readonly parameters: typeof DestinationQuery;
2715
- readonly success: typeof DestinationFacts;
2716
- readonly failure: typeof DestinationGuideUnavailable;
2717
- readonly failureMode: "error";
2718
- }, DestinationGuide>;
2719
- declare const DestinationResearcherToolkit: Toolkit.Toolkit<{
2720
- readonly lookup_destination: Tool.Tool<"lookup_destination", {
2721
- readonly parameters: typeof DestinationQuery;
2722
- readonly success: typeof DestinationFacts;
2723
- readonly failure: typeof DestinationGuideUnavailable;
2724
- readonly failureMode: "error";
2725
- }, DestinationGuide>;
2726
- }>;
2727
- declare const DestinationResearcherToolkitLayer: Layer.Layer<Tool.Handler<"lookup_destination">, never, never>;
2728
- declare const DestinationBrief_base: Schema.Class<DestinationBrief, Schema.Struct<{
2729
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2730
- readonly focus: Schema.NonEmptyString;
2731
- }>, {}>;
2732
- declare class DestinationBrief extends DestinationBrief_base {}
2733
- declare const DestinationReport_base: Schema.Class<DestinationReport, Schema.Struct<{
2734
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2735
- readonly highlights: Schema.$Array<Schema.String>;
2736
- readonly advisory: Schema.NonEmptyString;
2737
- }>, {}>;
2738
- declare class DestinationReport extends DestinationReport_base {}
2739
- declare const DestinationResearcher: import("@effect-agent/core").Definition<typeof DestinationBrief, typeof DestinationReport, "Consult lookup_destination exactly once for the briefed airport, then return only a JSON destination report.", Toolkit.Toolkit<{
2740
- readonly lookup_destination: Tool.Tool<"lookup_destination", {
2741
- readonly parameters: typeof DestinationQuery;
2742
- readonly success: typeof DestinationFacts;
2743
- readonly failure: typeof DestinationGuideUnavailable;
2744
- readonly failureMode: "error";
2745
- }, DestinationGuide>;
2746
- }>>;
2747
- /** Deterministic guide lookup shared by the default and test-local guide Layers. */
2748
- declare const destinationLookup: (query: DestinationQuery) => Effect.Effect<DestinationFacts, DestinationGuideUnavailable>;
2749
- /** The report the scripted researcher writes after consulting the guide. */
2750
- declare const destinationReportFor: (destination: string) => DestinationReport;
2751
- declare const encodedDestinationReport: (destination: string) => string;
2752
- declare const DestinationGuideLayer: Layer.Layer<DestinationGuide, never, CatalogLifecycle>;
2753
- /** Child-side construction requirements of the delegation handler Layer. */
2754
- declare const DestinationResearchSupportLayer: Layer.Layer<DestinationGuide | Tool.Handler<"lookup_destination">, never, CatalogLifecycle>;
2755
- declare const DestinationResearchRequest_base: Schema.Class<DestinationResearchRequest, Schema.Struct<{
2756
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2757
- readonly focus: Schema.NonEmptyString;
2758
- }>, {}>;
2759
- declare class DestinationResearchRequest extends DestinationResearchRequest_base {}
2760
- declare const DestinationResearchFindings_base: Schema.Class<DestinationResearchFindings, Schema.Struct<{
2761
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2762
- readonly summary: Schema.NonEmptyString;
2763
- }>, {}>;
2764
- declare class DestinationResearchFindings extends DestinationResearchFindings_base {}
2765
- declare const DestinationResearchFailed_base: Schema.Class<DestinationResearchFailed, Schema.TaggedStruct<"DestinationResearchFailed", {
2766
- readonly childErrorTag: Schema.NonEmptyString;
2767
- }>, import("effect/Cause").YieldableError>;
2768
- declare class DestinationResearchFailed extends DestinationResearchFailed_base {}
2769
- declare const ResearchDispatchGate_base: Context.ServiceClass<ResearchDispatchGate, "@effect-agent/testing/travel-planner/ResearchDispatchGate", {
2770
- readonly awaitDispatch: (destination: string) => Effect.Effect<void>;
2771
- }>;
2772
- /**
2773
- * Deterministic delegation-admission choreography seam. `prepareInput` awaits
2774
- * this gate before the handler reserves budget or spawns, so tests can order
2775
- * concurrent delegation preflights without sleeps. It also keeps the
2776
- * projection's construction requirements honestly visible in the handler
2777
- * Layer's `R` (spec/subagents.md §4.1). The open Layer never waits.
2778
- */
2779
- declare class ResearchDispatchGate extends ResearchDispatchGate_base {
2780
- static readonly layerOpen: Layer.Layer<ResearchDispatchGate, never, never>;
2781
- }
2782
- /**
2783
- * Finite per-invocation bounds (SUB-009): each child may use two Turns and
2784
- * one Tool Call; the parent Run may establish at most two children with at
2785
- * most two running concurrently.
2786
- */
2787
- declare const destinationResearchPolicy: SubagentPolicy;
2788
- declare const destinationResearchDelegation: import("@effect-agent/capabilities").SubagentDelegation<"delegate_destination_research", typeof DestinationBrief, typeof DestinationReport, "Consult lookup_destination exactly once for the briefed airport, then return only a JSON destination report.", {
2789
- readonly lookup_destination: Tool.Tool<"lookup_destination", {
2790
- readonly parameters: typeof DestinationQuery;
2791
- readonly success: typeof DestinationFacts;
2792
- readonly failure: typeof DestinationGuideUnavailable;
2793
- readonly failureMode: "error";
2794
- }, DestinationGuide>;
2795
- }, typeof DestinationResearchRequest, typeof DestinationResearchFindings, typeof DestinationResearchFailed, ResearchDispatchGate, never, "error">;
2796
- /** Total mapping from every expected child Run failure to the declared Tool failure (SUB-028). */
2797
- declare const mapResearchChildFailure: (failure: {
2798
- readonly _tag: string;
2799
- }) => DestinationResearchFailed;
2800
- /** Runtime wiring: pair the immutable delegation with one explicit child Binding. */
2801
- declare const destinationResearchHandlersLayer: <Provider, ModelProvides, ModelRequires>(childBinding: RuntimeBinding<typeof DestinationBrief, typeof DestinationReport, string, Toolkit.Tools<typeof DestinationResearcherToolkit>, Provider, ModelProvides, ModelRequires>) => Layer.Layer<Tool.Handler<"delegate_destination_research">, never, import("@effect-agent/capabilities").SubagentLayerRequirements<typeof DestinationBrief, typeof DestinationReport, string, {
2802
- readonly lookup_destination: Tool.Tool<"lookup_destination", {
2803
- readonly parameters: typeof DestinationQuery;
2804
- readonly success: typeof DestinationFacts;
2805
- readonly failure: typeof DestinationGuideUnavailable;
2806
- readonly failureMode: "error";
2807
- }, DestinationGuide>;
2808
- }, Provider, ModelProvides, ModelRequires, ResearchDispatchGate, never, never, {
2809
- readonly _tag: string;
2810
- }, never>>;
2811
- declare const ResearchMission_base: Schema.Class<ResearchMission, Schema.Struct<{
2812
- readonly request: Schema.NonEmptyString;
2813
- readonly candidates: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">>;
2814
- }>, {}>;
2815
- declare class ResearchMission extends ResearchMission_base {}
2816
- declare const DestinationRecommendation_base: Schema.Class<DestinationRecommendation, Schema.Struct<{
2817
- readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
2818
- readonly summary: Schema.NonEmptyString;
2819
- }>, {}>;
2820
- declare class DestinationRecommendation extends DestinationRecommendation_base {}
2821
- declare const DestinationShortlist_base: Schema.Class<DestinationShortlist, Schema.Struct<{
2822
- readonly recommendations: Schema.$Array<typeof DestinationRecommendation>;
2823
- readonly nextAction: Schema.Literal<"review">;
2824
- }>, {}>;
2825
- declare class DestinationShortlist extends DestinationShortlist_base {}
2826
- /** Parent-only transcript markers used to prove child context isolation (SUB-006/015). */
2827
- declare const coordinatorConfidentialMarker = "coordinator-vault-7q42";
2828
- declare const missionConfidentialMarker = "traveler-dossier-19f";
2829
- declare const TravelCoordinatorToolkit: Toolkit.Toolkit<{
2830
- readonly delegate_destination_research: Tool.Tool<"delegate_destination_research", {
2831
- readonly parameters: typeof DestinationResearchRequest;
2832
- readonly success: typeof DestinationResearchFindings;
2833
- readonly failure: import("@effect-agent/capabilities").SubagentToolFailure<typeof DestinationResearchFailed>;
2834
- readonly failureMode: "error";
2835
- }, import("@effect-agent/engine").AgentSpawner | import("@effect-agent/core").IdGenerator | import("@effect-agent/engine").RunEventSink | import("@effect-agent/engine").SubagentDurability>;
2836
- }>;
2837
- declare const TravelCoordinator: import("@effect-agent/core").Definition<typeof ResearchMission, typeof DestinationShortlist, string, Toolkit.Toolkit<{
2838
- readonly delegate_destination_research: Tool.Tool<"delegate_destination_research", {
2839
- readonly parameters: typeof DestinationResearchRequest;
2840
- readonly success: typeof DestinationResearchFindings;
2841
- readonly failure: import("@effect-agent/capabilities").SubagentToolFailure<typeof DestinationResearchFailed>;
2842
- readonly failureMode: "error";
2843
- }, import("@effect-agent/engine").AgentSpawner | import("@effect-agent/core").IdGenerator | import("@effect-agent/engine").RunEventSink | import("@effect-agent/engine").SubagentDurability>;
2844
- }>>;
2845
- declare const researchMission: ResearchMission;
2846
- declare const expectedDestinationShortlist: DestinationShortlist;
2847
- interface DestinationResearchCall {
2848
- readonly id: string;
2849
- readonly destination: string;
2850
- readonly focus: string;
2851
- }
2852
- /** One coordinator Turn that declares the given delegation Tool Calls in order. */
2853
- declare const coordinatorResearchTurn: (calls: ReadonlyArray<DestinationResearchCall>) => ScriptedTurnInput;
2854
- /** The coordinator's final structured-output Turn. */
2855
- declare const coordinatorShortlistTurn: (shortlist: DestinationShortlist) => ScriptedTurnInput;
2856
- /** Static researcher script for single-child tests: one guide lookup, then the report. */
2857
- declare const researcherHappyPathTurns: (destination: string) => readonly [ScriptedTurnInput, ScriptedTurnInput];
2858
- /**
2859
- * Deterministic controls for parallel researcher children whose completions
2860
- * are released in a caller-selected order (ReverseCompletionToolkitLayer
2861
- * pattern). This is intentionally a test fixture: it uses no clock or sleep.
2862
- */
2863
- interface DestinationResearcherControls {
2864
- /** Await the first model request of the child researching this destination. */
2865
- readonly awaitStarted: (destination: string) => Effect.Effect<void>;
2866
- /** Allow the child researching this destination to produce its final report. */
2867
- readonly release: (destination: string) => Effect.Effect<void>;
2868
- /** JSON-encoded first-Turn child prompts in arrival order (isolation evidence). */
2869
- readonly prompts: Effect.Effect<ReadonlyArray<string>>;
2870
- }
2871
- /**
2872
- * Build a deterministic researcher Model whose per-child behavior is keyed by
2873
- * the destination named in the child's own prompt: Turn one records the
2874
- * prompt, signals `started`, and calls the guide Tool; Turn two waits for the
2875
- * caller's `release` before writing the report. Each child Run builds the
2876
- * Model Layer inside its own scope, so one `CatalogLifecycle` acquisition and
2877
- * finalization is observed per child — the same acquire/release counting the
2878
- * catalog Layers use to prove interruption reaches every finalizer.
2879
- */
2880
- declare const makeDestinationResearcherModel: (destinations: ReadonlyArray<string>) => Effect.Effect<{
2881
- controls: DestinationResearcherControls;
2882
- model: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
2883
- }, never, CatalogLifecycle>;
2884
- //#endregion
2885
- //#region src/fixtures/travel-planner/phase6.d.ts
2886
- declare const TravelPlannerCloudflareProfile_base: Schema.Class<TravelPlannerCloudflareProfile, Schema.Struct<{
2887
- readonly deploymentClass: Schema.Literal<"DC">;
2888
- readonly durableAcceptedWork: Schema.Literal<true>;
2889
- readonly canonicalSchemaVersion: Schema.Literal<1>;
2890
- /** P5 semantics under DC recovery: prepared/settled records, Unknown Outcomes, approvals. */
2891
- readonly supplierBookingUncertaintyProtocol: Schema.Literal<true>;
2892
- /** S2 semantics under DC recovery: cross-Object establishment/join, completed child never re-runs. */
2893
- readonly durableAttachedSubagents: Schema.Literal<true>;
2894
- /** DN and DC produce byte-equal cross-platform normalized canonical evidence (one golden). */
2895
- readonly cloudflareEquivalence: Schema.Literal<true>;
2896
- /** Never claimed at any phase on any platform (DUR-003). */
2897
- readonly exactlyOnceExternalEffects: Schema.Literal<false>;
2898
- }>, {}>;
2899
- /**
2900
- * The Phase 6 profile: the P4/P5/S2 Travel Planner claims re-earned on the Cloudflare Durable
2901
- * Object runtime (deployment class `DC`), where eviction and alarm redelivery replace process
2902
- * kill and restart as the exercised recovery path. `cloudflareEquivalence` is the claim the S2
2903
- * fixture explicitly deferred to P6 (`TravelPlannerSubagentDurabilityProfile` pins it `false`
2904
- * for `DN`): it flips to `true` here ONLY because the phase-6 suites assert byte-equal
2905
- * cross-platform normalized canonical evidence against one committed golden. Exactly-once
2906
- * EXTERNAL effects remain — deliberately — unclaimed on every platform (DUR-003).
2907
- */
2908
- declare class TravelPlannerCloudflareProfile extends TravelPlannerCloudflareProfile_base {}
2909
- declare const phase6TravelPlannerProfile: TravelPlannerCloudflareProfile;
2910
- declare const phase6TravelPlannerDeploymentId: string & import("effect/Brand").Brand<"@effect-agent/session/DeploymentId">;
2911
- /** Producer prefix of the DC host; each Object mints `{prefix}:{conversationId}`. */
2912
- declare const phase6TravelPlannerProducerPrefix = "travel-planner-p6-producer";
2913
- /** The full producer identity one DC Conversation Object mints for itself. */
2914
- declare const phase6TravelPlannerProducerId: (conversationId: string) => ProducerId;
2915
- /**
2916
- * Registration digests of the GATED planner Binding: the same `TravelPlannerPhase4` definition
2917
- * bound to a model whose first response waits on a test gate, addressable separately so the
2918
- * admission-limits rows can hold a lane busy deterministically without touching the ordinary
2919
- * planner registration.
2920
- */
2921
- declare const phase6GatedPlannerDefinitionDigests: DefinitionDigests;
2922
- /** The run-specific identities the cross-platform normal form scrubs. */
2923
- interface CrossPlatformEvidenceIdentity {
2924
- /** The Conversation lane the evidence came from. */
2925
- readonly conversationId: string;
2926
- /** The host's deployment identity (`DeploymentId` on every record envelope). */
2927
- readonly deploymentId: string;
2928
- /** The full producer identity of the run (DN: configured; DC: `{prefix}:{conversationId}`). */
2929
- readonly producerId: string;
2930
- }
2931
- /**
2932
- * The CROSS-PLATFORM extension of `normalizeDurableTravelPlannerEvidence` (D-P6-6): after the
2933
- * base normalization replaces the two ledger-minted identities (which also normalizes the
2934
- * DC-format routable `{uuidv7}:{conversationId}` Submission identities and everything derived
2935
- * from them), this form additionally scrubs everything that legitimately differs between a DN
2936
- * process and a DC Durable Object over the same scenario:
2937
- *
2938
- * - `RepairAnnotated` audit records are dropped BEFORE normalization and the canonical
2939
- * sequence is renumbered to the surviving order: repairs are DUR-013 evidence of recovery
2940
- * itself, legally present in a recovered run and legally absent from an uninterrupted
2941
- * control (on DC even a CLEAN run carries one, because every pass reconciles before it
2942
- * claims, so the ready lane's input is applied through the recovery path). Canonical ORDER
2943
- * is the durability §5 claim; sequence contiguity is a platform artifact of who appended;
2944
- * - the Conversation identity (DC lanes mint unique names per test run);
2945
- * - the deployment and producer identities (host configuration, not canonical semantics);
2946
- * - `createdAt` commit timestamps (wall clock);
2947
- * - 64-hex digests (they hash RAW content that legally embeds run-specific identity, so they
2948
- * can never be byte-equal across runs; chain integrity is asserted separately by the
2949
- * adapters and the convergence helpers).
2950
- *
2951
- * Two runs whose cross-platform normalized evidence is byte-equal took canonically equivalent
2952
- * histories — the exact sense in which durability §5 permits storage differences while
2953
- * requiring the same observable ordering. Both the DN and DC suites assert equality against
2954
- * the one committed `phase6TravelPlannerGoldenEvidence`, so DN ≡ DC transitively.
2955
- */
2956
- declare const normalizeCrossPlatformTravelPlannerEvidence: (records: readonly CanonicalRecordEnvelope[], receipt: Receipt, identity: CrossPlatformEvidenceIdentity) => Effect.Effect<Schema.Json, TravelPlannerDurableEvidenceError, never>;
2957
- /** The P1/P4 happy-path Tool Call identities (scenarios.ts, byte-stable since P1). */
2958
- declare const phase6FlightCallId = "flight-call-1";
2959
- declare const phase6LodgingCallId = "lodging-call-1";
2960
- declare const phase6ActivityCallId = "activity-call-1";
2961
- /**
2962
- * The P4 planner script (`phase1HappyPathTurns`) as a prompt-aware model: once the search
2963
- * batch is committed history, every later request gets the plan — identical parts, so the DC
2964
- * canonical evidence is byte-equivalent to the DN ScriptedModel run after normalization.
2965
- */
2966
- declare const phase6PlannerModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
2967
- /** Release the gated planner model for one `[gate:...]` marker. */
2968
- declare const releasePhase6PlannerGate: (marker: string) => void;
2969
- /** Re-close one gate marker (fresh suites reuse markers safely). */
2970
- declare const resetPhase6PlannerGate: (marker: string) => void;
2971
- /** A trip whose request text carries the gate marker the gated model waits on. */
2972
- declare const phase6GatedTrip: (marker: string) => TripRequest;
2973
- /**
2974
- * The SAME planner behavior with a hanging first response: the model waits on the released
2975
- * gate before answering, keeping its lane durably busy so queue-depth admission limits can be
2976
- * exercised deterministically.
2977
- */
2978
- declare const phase6GatedPlannerModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
2979
- /** The shared external supplier desk instance (module-level external truth). */
2980
- declare const phase6SupplierDesk: {
2981
- readonly book: (request: SupplierBookRequest) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;
2982
- readonly cancel: (bookingRef: BookingRef) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;
2983
- readonly lookup: (idempotencyKey: string) => Effect.Effect<import("effect/Option").Option<SupplierBookingRecord>>;
2984
- readonly bookings: Effect.Effect<ReadonlyArray<SupplierBookingRecord>>;
2985
- readonly callCount: (idempotencyKey: string) => Effect.Effect<number>;
2986
- readonly holdAfterWrite: (idempotencyKey: string) => Effect.Effect<SupplierHoldControls>;
2987
- };
2988
- /** Layer handing the shared desk to Bindings, reconcilers, and assertions. */
2989
- declare const phase6SupplierDeskLayer: Layer.Layer<SupplierBookingDesk>;
2990
- /**
2991
- * The REAL P5 supplier reconciliation policy over the shared desk, closed to no requirements
2992
- * so a Conversation Object can install it directly: `book_flight` recovers only from supplier
2993
- * truth (absence stays fail-closed `Uncertain` → durable Unknown Outcome), keyed Steps are
2994
- * provably re-enterable.
2995
- */
2996
- declare const phase6SupplierReconcilerLayer: Layer.Layer<ToolReconciler>;
2997
- /** The deterministic booking Tool Call identity for one `[case:...]` marker. */
2998
- declare const phase6BookingToolCallId: (marker: string) => string;
2999
- /** The bookingRef the supplier desk mints for one marker's approved booking. */
3000
- declare const phase6BookingRef: (marker: string) => string;
3001
- /** A trip whose request text carries the per-lane booking case marker. */
3002
- declare const phase6BookingTrip: (marker: string) => TripRequest;
3003
- /**
3004
- * The P5 booking script as a prompt-aware model: request 1 declares the approval-gated
3005
- * `book_flight` call (identity derived from the lane's `[case:...]` marker so supplier
3006
- * idempotency keys never collide across lanes); once that call is committed history, the model
3007
- * writes the booking report.
3008
- */
3009
- declare const phase6BookingModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
3010
- /** Deterministic guide-lookup handler executions across every incarnation. */
3011
- declare const phase6GuideInvocationCount: () => number;
3012
- /** The one-candidate research mission of the DC delegation slice. */
3013
- declare const phase6ResearchMission: ResearchMission;
3014
- declare const phase6ResearchDestination = "LHR";
3015
- /** The child's scripted guide-lookup Tool Call identity. */
3016
- declare const phase6ChildLookupCallId = "lookup-LHR";
3017
- /** Prompt-aware S2 coordinator: delegation call first, shortlist once it is history. */
3018
- declare const phase6CoordinatorModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
3019
- /** Allow the researcher's FIRST model response to proceed (sticky across incarnations). */
3020
- declare const releasePhase6ResearcherGate: () => void;
3021
- /** Re-close the researcher gate (each delegation scenario starts gated). */
3022
- declare const resetPhase6ResearcherGate: () => void;
3023
- /**
3024
- * Prompt-aware S2 researcher: guide lookup first, report once it is history. The FIRST
3025
- * response waits on the researcher gate — a stand-in for real model latency. The child's own
3026
- * Object may legally start its Attempt the moment its routed admission commits, while the
3027
- * parent is still appending the lineage record into the child's log; a child whose first
3028
- * batch commits during that window races the parent's append on one tail. Real models answer
3029
- * in seconds, so establishment always wins that race in production; the gate reproduces that
3030
- * timing deterministically instead of relying on scheduler luck.
3031
- */
3032
- declare const phase6ResearcherModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
3033
- /**
3034
- * Every phase-6 Travel Planner worker Binding, captured with its requirement Contexts
3035
- * (spec/subagents.md §11): the P4 planner and its gated twin, the P5 booking agent over the
3036
- * shared supplier desk, and the S2 coordinator/researcher pair wired through the durable
3037
- * delegation Layer. A Conversation Object registers these via its `bindings` option; the
3038
- * capture runs once per incarnation, and everything stateful the assertions rely on (desk,
3039
- * guide counter, gates) lives at module level so it survives incarnation loss.
3040
- */
3041
- declare const makePhase6TravelPlannerBindings: Effect.Effect<ReadonlyArray<ResolvedBinding>>;
3042
- /**
3043
- * The committed cross-platform normalized canonical evidence of ONE uninterrupted Travel
3044
- * Planner planning Submission (the P1/P4 happy path: canonical input, the search Turn, three
3045
- * Tool settlements, the plan Turn, one Settlement). `travel-planner-phase6.test.ts` asserts
3046
- * the DN run equals this value and `travel-planner-dc.test.ts` asserts the DC run equals this
3047
- * value, so the two platforms' canonical outcomes are byte-equivalent transitively — the P6
3048
- * exit gate "Travel Planner produces equivalent canonical outcomes under DN and DC".
3049
- *
3050
- * Regenerate ONLY when the Travel Planner scenario itself changes, by printing either suite's
3051
- * normalized value; both suites must then agree on the new golden.
3052
- */
3053
- declare const phase6TravelPlannerGoldenEvidence: Schema.Json;
3054
- //#endregion
3055
- //#region src/fixtures/travel-planner/phase7.d.ts
3056
- declare const TravelPlannerPhase7Profile_base: Schema.Class<TravelPlannerPhase7Profile, Schema.Struct<{
3057
- readonly phase: Schema.Literal<"P7">;
3058
- readonly offlineConformanceDeterministic: Schema.Literal<true>;
3059
- readonly offlineRequiresCredentials: Schema.Literal<false>;
3060
- readonly liveProfileOptIn: Schema.Literal<true>;
3061
- readonly liveModelLayers: Schema.Literal<true>;
3062
- readonly liveSupplierLayers: Schema.Literal<false>;
3063
- readonly structurallyRedactedTranscripts: Schema.Literal<true>;
3064
- readonly exactlyOnceExternalEffects: Schema.Literal<false>;
3065
- }>, {}>;
3066
- /**
3067
- * The P7 dual-profile claim, schema-first so the exact scope of "live
3068
- * integration profiles" is a committed, decodable value:
3069
- *
3070
- * - `offlineConformanceDeterministic` / `offlineRequiresCredentials`: the
3071
- * cumulative conformance suites stay deterministic and credential-free.
3072
- * - `liveProfileOptIn`: live suites are excluded from ordinary gates by the
3073
- * environment predicate (`phase7LiveProfileEnabled`), never by test-runner
3074
- * configuration that could silently drift.
3075
- * - `liveModelLayers` / `liveSupplierLayers`: live profiles exercise real
3076
- * model Layers over the SAME deterministic supplier desk — no claim of a
3077
- * live supplier integration is made anywhere (decision 9).
3078
- * - `structurallyRedactedTranscripts`: transcript evidence a live profile
3079
- * emits passes through the structural `Redactor` first (SEC-008,
3080
- * testing.md §12: "live model and supplier profiles are opt-in smoke or
3081
- * release tests, rate-limited and structurally redacted").
3082
- * - `exactlyOnceExternalEffects`: never claimed at any phase (DUR-003).
3083
- */
3084
- declare class TravelPlannerPhase7Profile extends TravelPlannerPhase7Profile_base {}
3085
- declare const phase7TravelPlannerProfile: TravelPlannerPhase7Profile;
3086
- /**
3087
- * The one opt-in switch for EVERY live profile in this repository. `"1"` is
3088
- * the only enabling value: an unset, empty, or differently-truthy value keeps
3089
- * the suite skipped, so CI and ordinary developer runs stay offline.
3090
- */
3091
- declare const PHASE7_LIVE_GATE_ENV = "EFFECT_AGENT_LIVE";
3092
- /** The credential a Travel Planner live-model profile additionally requires. */
3093
- declare const PHASE7_LIVE_CREDENTIAL_ENV = "OPENAI_API_KEY";
3094
- /** Structural shape of `process.env` without importing Node types here. */
3095
- interface Phase7LiveGateEnvironment {
3096
- readonly [name: string]: string | undefined;
3097
- }
3098
- /**
3099
- * The test-side live gate (P7 plan §6: no test-side live-gating pattern
3100
- * existed before this — the demo gates at serve time via
3101
- * `Config.redacted("OPENAI_API_KEY")`). Suites use it as
3102
- * `describe.skipIf(!phase7LiveProfileEnabled(process.env))`, which keeps the
3103
- * live block out of ordinary gates while the SAME file's ungated tests keep
3104
- * pinning the profile schema on every run.
3105
- */
3106
- declare const phase7LiveProfileEnabled: (env: Phase7LiveGateEnvironment) => boolean;
3107
- //#endregion
3108
- //#region src/fixtures/travel-planner/scenarios.d.ts
3109
- declare const phase1Trip: TripRequest;
3110
- /** Backward-compatible fixture alias while consumers transition to the P1 name. */
3111
- declare const phase0Trip: TripRequest;
3112
- declare const expectedTravelPlan: TravelPlan;
3113
- declare const phase1HappyPathTurns: [{
3114
- _tag: "Stream";
3115
- parts: ({
3116
- type: "tool-call";
3117
- id: string;
3118
- name: string;
3119
- params: {
3120
- origin: string;
3121
- destination: string;
3122
- departOn: string;
3123
- travelers: number;
3124
- nights?: undefined;
3125
- };
3126
- reason?: undefined;
3127
- usage?: undefined;
3128
- } | {
3129
- type: "tool-call";
3130
- id: string;
3131
- name: string;
3132
- params: {
3133
- origin?: undefined;
3134
- destination: string;
3135
- departOn: string;
3136
- nights: number;
3137
- travelers: number;
3138
- };
3139
- reason?: undefined;
3140
- usage?: undefined;
3141
- } | {
3142
- id?: undefined;
3143
- name?: undefined;
3144
- params?: undefined;
3145
- type: "finish";
3146
- reason: "tool-calls";
3147
- usage: {
3148
- inputTokens: {
3149
- total: number;
3150
- };
3151
- outputTokens: {
3152
- total: number;
3153
- };
3154
- };
3155
- })[];
3156
- termination: {
3157
- _tag: "Complete";
3158
- };
3159
- }, {
3160
- _tag: "Stream";
3161
- parts: ({
3162
- reason?: undefined;
3163
- usage?: undefined;
3164
- type: "text-start";
3165
- id: string;
3166
- delta?: undefined;
3167
- } | {
3168
- reason?: undefined;
3169
- usage?: undefined;
3170
- type: "text-delta";
3171
- id: string;
3172
- delta: string;
3173
- } | {
3174
- reason?: undefined;
3175
- usage?: undefined;
3176
- delta?: undefined;
3177
- type: "text-end";
3178
- id: string;
3179
- } | {
3180
- id?: undefined;
3181
- delta?: undefined;
3182
- type: "finish";
3183
- reason: "stop";
3184
- usage: {
3185
- inputTokens: {
3186
- total: number;
3187
- };
3188
- outputTokens: {
3189
- total: number;
3190
- };
3191
- };
3192
- })[];
3193
- termination: {
3194
- _tag: "Complete";
3195
- };
3196
- }];
3197
- declare const phase0HappyPathTurns: [{
3198
- _tag: "Stream";
3199
- parts: ({
3200
- type: "tool-call";
3201
- id: string;
3202
- name: string;
3203
- params: {
3204
- origin: string;
3205
- destination: string;
3206
- departOn: string;
3207
- travelers: number;
3208
- nights?: undefined;
3209
- };
3210
- reason?: undefined;
3211
- usage?: undefined;
3212
- } | {
3213
- type: "tool-call";
3214
- id: string;
3215
- name: string;
3216
- params: {
3217
- origin?: undefined;
3218
- destination: string;
3219
- departOn: string;
3220
- nights: number;
3221
- travelers: number;
3222
- };
3223
- reason?: undefined;
3224
- usage?: undefined;
3225
- } | {
3226
- id?: undefined;
3227
- name?: undefined;
3228
- params?: undefined;
3229
- type: "finish";
3230
- reason: "tool-calls";
3231
- usage: {
3232
- inputTokens: {
3233
- total: number;
3234
- };
3235
- outputTokens: {
3236
- total: number;
3237
- };
3238
- };
3239
- })[];
3240
- termination: {
3241
- _tag: "Complete";
3242
- };
3243
- }, {
3244
- _tag: "Stream";
3245
- parts: ({
3246
- reason?: undefined;
3247
- usage?: undefined;
3248
- type: "text-start";
3249
- id: string;
3250
- delta?: undefined;
3251
- } | {
3252
- reason?: undefined;
3253
- usage?: undefined;
3254
- type: "text-delta";
3255
- id: string;
3256
- delta: string;
3257
- } | {
3258
- reason?: undefined;
3259
- usage?: undefined;
3260
- delta?: undefined;
3261
- type: "text-end";
3262
- id: string;
3263
- } | {
3264
- id?: undefined;
3265
- delta?: undefined;
3266
- type: "finish";
3267
- reason: "stop";
3268
- usage: {
3269
- inputTokens: {
3270
- total: number;
3271
- };
3272
- outputTokens: {
3273
- total: number;
3274
- };
3275
- };
3276
- })[];
3277
- termination: {
3278
- _tag: "Complete";
3279
- };
3280
- }];
3281
- //#endregion
3282
- //#region src/fixtures/travel-planner/subagents-durable.d.ts
3283
- declare const TravelPlannerSubagentDurabilityProfile_base: Schema.Class<TravelPlannerSubagentDurabilityProfile, Schema.Struct<{
3284
- readonly deploymentClass: Schema.Literal<"DN">;
3285
- readonly durableAttachedSubagents: Schema.Literal<true>;
3286
- readonly canonicalSchemaVersion: Schema.Literal<1>;
3287
- /** Establishment/join replay converges on one child Receipt, Conversation, and join batch. */
3288
- readonly subagentReplaySafe: Schema.Literal<true>;
3289
- /** Never claimed (rule 8): child ordinary Tools stop at Unknown Outcomes, they do not replay. */
3290
- readonly childExternalEffectsExactlyOnce: Schema.Literal<false>;
3291
- /** The same conformance suite under DO eviction/alarms is P6 scope (spec §17 `DC`). */
3292
- readonly cloudflareEquivalence: Schema.Literal<false>;
3293
- }>, {}>;
3294
- declare class TravelPlannerSubagentDurabilityProfile extends TravelPlannerSubagentDurabilityProfile_base {}
3295
- declare const s2TravelPlannerProfile: TravelPlannerSubagentDurabilityProfile;
3296
- declare const s2TravelPlannerDeploymentId: string & import("effect/Brand").Brand<"@effect-agent/session/DeploymentId">;
3297
- declare const s2TravelPlannerProducerId: string & import("effect/Brand").Brand<"@effect-agent/session/ProducerId">;
3298
- declare const s2TravelPlannerPrincipal: string & import("effect/Brand").Brand<"@effect-agent/session/Principal">;
3299
- /** Redacted, deterministic parent (coordinator) definition digests for this fixture version. */
3300
- declare const s2CoordinatorDigests: DefinitionDigests;
3301
- /**
3302
- * The exact child Binding digest strings the application declares on
3303
- * `SubagentRuntimeOptions.durable.targetDigests` AND the host registers with
3304
- * the `AgentBindingResolver` for the researcher Binding. The coordinator
3305
- * stores and verifies them byte-for-byte (SUB-023); a host registration under
3306
- * different strings is a `ChildCompatibilityFailure`, never a substitution.
3307
- */
3308
- declare const s2ResearcherDigestStrings: {
3309
- readonly agent: string;
3310
- readonly model: string;
3311
- readonly tools: string;
3312
- };
3313
- declare const s2ResearcherDigests: DefinitionDigests;
3314
- /** Durable admission options for one coordinator Submission on one mission lane. */
3315
- declare const s2TravelPlannerSubmitOptions: (conversationId: ConversationId, idempotencyKey: IdempotencyKey) => DurableSubmitOptions;
3316
- /** The structural submit slice of the coordinator Binding (`DurableAgentRuntime.submit`). */
3317
- declare const s2CoordinatorSubmitAgent: {
3318
- readonly definition: {
3319
- readonly id: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
3320
- readonly input: typeof ResearchMission;
3321
- };
3322
- };
3323
- /**
3324
- * The per-invocation reservation the durable handler computes from the S1
3325
- * delegation policy (`delegationAllocationFromPolicy`): the conservation
3326
- * evidence in the S2 tests checks the ledger reservation rows and the
3327
- * canonical `SubagentJoined.finalAccounting` against exactly this value.
3328
- */
3329
- declare const durableResearchAllocation: import("@effect-agent/capabilities").SubagentReservationAmounts;
3330
- /** The one scripted delegation Tool Call id of the durable coordinator Run. */
3331
- declare const durableResearchCallId = "research-lhr-1";
3332
- /** The child's own scripted guide-lookup Tool Call id. */
3333
- declare const durableChildLookupCallId: (destination: string) => string;
3334
- /** The projected finding the parent joins (only the advisory crosses, SUB-015). */
3335
- declare const durableResearchFinding: (destination: string) => {
3336
- destination: string & import("effect/Brand").Brand<"@effect-agent/testing/travel-planner/AirportCode">;
3337
- summary: string;
3338
- };
3339
- /** The coordinator's expected final shortlist for one researched destination. */
3340
- declare const durableResearchShortlist: (destination: string) => DestinationShortlist;
3341
- /**
3342
- * The deterministic guide facts in encoded (wire) form: the "supplier truth"
3343
- * an authorized operator records through `resolveUnknown` when a child guide
3344
- * lookup stopped at an Unknown Outcome (DUR-017 — the framework never guesses
3345
- * or replays it).
3346
- */
3347
- declare const encodedDestinationFacts: (destination: string) => unknown;
3348
- /** One scripted model whose behavior is keyed by the global invocation index. */
3349
- declare const makeInvocationCountingModel: (name: string, script: (call: number) => ReadonlyArray<Response.StreamPartEncoded>) => Effect.Effect<{
3350
- model: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
3351
- calls: Effect.Effect<number, never, never>;
3352
- prompts: Effect.Effect<readonly string[], never, never>;
3353
- }, never, never>;
3354
- /** Runtime wiring for the durable slice: the S1 delegation plus the S2 digest declaration. */
3355
- declare const durableDestinationResearchHandlersLayer: <Provider, ModelProvides, ModelRequires>(childBinding: RuntimeBinding<typeof DestinationBrief, typeof DestinationReport, string, Toolkit.Tools<typeof DestinationResearcherToolkit>, Provider, ModelProvides, ModelRequires>) => Layer.Layer<import("effect/unstable/ai/Tool").Handler<"delegate_destination_research">, never, import("@effect-agent/capabilities").SubagentLayerRequirements<typeof DestinationBrief, typeof DestinationReport, string, {
3356
- readonly lookup_destination: import("effect/unstable/ai/Tool").Tool<"lookup_destination", {
3357
- readonly parameters: typeof DestinationQuery;
3358
- readonly success: typeof DestinationFacts;
3359
- readonly failure: typeof DestinationGuideUnavailable;
3360
- readonly failureMode: "error";
3361
- }, DestinationGuide>;
3362
- }, Provider, ModelProvides, ModelRequires, ResearchDispatchGate, never, never, {
3363
- readonly _tag: string;
3364
- }, never>>;
3365
- /** Optional overrides for one durable research harness. */
3366
- interface DurableResearchHarnessOptions {
3367
- /** Researched destination; defaults to "LHR". */
3368
- readonly destination?: string | undefined;
3369
- /** Delegation focus; defaults to "museums". */
3370
- readonly focus?: string | undefined;
3371
- /**
3372
- * Digests the HOST registers the child Binding under; defaults to the exact
3373
- * declared `s2ResearcherDigests`. Register different digests to force the
3374
- * fail-closed `ChildCompatibilityFailure` path (SUB-023/SUB-032).
3375
- */
3376
- readonly childRegistrationDigests?: DefinitionDigests | undefined;
3377
- }
3378
- /** One durable coordinator/researcher pair with observable invocation counters. */
3379
- interface DurableResearchHarness {
3380
- /** Host registrations for `NodeDurableRuntimeOptions.bindings` (parent + child). */
3381
- readonly bindings: ReadonlyArray<ResolvedBinding>;
3382
- /** Total coordinator model invocations across every Attempt and runtime handle. */
3383
- readonly parentModelCalls: Effect.Effect<number>;
3384
- /** JSON-encoded coordinator prompts in request order. */
3385
- readonly parentPrompts: Effect.Effect<ReadonlyArray<string>>;
3386
- /** Total researcher model invocations across every Attempt and runtime handle. */
3387
- readonly childModelCalls: Effect.Effect<number>;
3388
- /** JSON-encoded researcher prompts in request order (context-isolation evidence). */
3389
- readonly childPrompts: Effect.Effect<ReadonlyArray<string>>;
3390
- /** Deterministic guide-lookup handler executions (ordinary child Tool side effects). */
3391
- readonly guideInvocations: Effect.Effect<number>;
3392
- }
3393
- /**
3394
- * Build the S2 Travel Planner harness: an invocation-counting scripted
3395
- * coordinator (Turn 1 declares the one delegation call, Turn 2 writes the
3396
- * shortlist), an invocation-counting scripted researcher (Turn 1 consults the
3397
- * guide, Turn 2 writes the report), and both worker Bindings captured with
3398
- * their requirement Contexts via `DurableWorkerBinding.make` under the exact
3399
- * fixture digests. The returned `bindings` are plain values: they can be
3400
- * registered with several `NodeDurableRuntime` stacks over the same SQLite
3401
- * file while the counters keep counting across all of them.
3402
- */
3403
- declare const makeDurableResearchHarness: (options?: DurableResearchHarnessOptions) => Effect.Effect<DurableResearchHarness, never, never>;
3404
- //#endregion
3405
- export { ActivityCatalog, ActivityCatalogLayer, ActivityQuery, ActivitySearchResult, ActivityUnavailable, AirportCode, BookFlight, BookItinerary, BookingRef, BoundedSummary, CERTIFICATION_SCENARIOS, CancelBooking, CancelBookingRequest, CancellationConfirmation, CatalogLifecycle, CatalogLifecycleCounts, CertificationCrashLever, CertifyDurableAdaptersOptions, ChaosAdapterFailpoints, ChaosApprovalDecision, ChaosConvergenceFailure, ChaosGeneratorOptions, ChaosLaneReport, ChaosPlan, ChaosPlanReport, ChaosResolutionKind, ChaosRunOptions, ChaosScenarioKind, ChaosSubmissionSpec, CodeExecutorConformanceCase, CodeExecutorConformanceOptions, CodeExecutorConformanceViolation, CrossPlatformEvidenceIdentity, DEFAULT_CHAOS_SEED, DestinationBrief, DestinationFacts, DestinationGuide, DestinationGuideLayer, DestinationGuideUnavailable, DestinationQuery, DestinationRecommendation, DestinationReport, DestinationResearchCall, DestinationResearchFailed, DestinationResearchFindings, DestinationResearchRequest, DestinationResearchSupportLayer, DestinationResearcher, DestinationResearcherControls, DestinationResearcherToolkit, DestinationResearcherToolkitLayer, DestinationShortlist, DeterministicIdGeneratorLayer, DocContentToolkit, DocSummarizer, DocsMcpDiscoveryEvidence, DocsResearcher, DocsResearcherHarness, DocsResearcherHarnessOptions, DocsResearcherHarnessRequirements, DocsResearcherToolkit, DocumentLibrary, DocumentQuery, DocumentSummary, DocumentSummaryFailed, DocumentUnavailable, DurableResearchHarness, DurableResearchHarnessOptions, DurableSearchActivities, DurableSearchFlights, DurableSearchLodging, FetchDocument, FlightBookingRequest, FlightCatalog, FlightCatalogLayer, FlightOption, FlightQuery, FlightUnavailable, GuidanceFailure, HoldItinerary, Itinerary, ItineraryBookingRequest, ItineraryConfirmation, ItineraryHold, ItineraryHoldGateway, ItineraryHoldRequest, ItineraryHoldUnavailable, LodgingCatalog, LodgingCatalogLayer, LodgingOption, LodgingQuery, LodgingUnavailable, LookupDestination, PHASE7_LIVE_CREDENTIAL_ENV, PHASE7_LIVE_GATE_ENV, Phase7LiveGateEnvironment, QuoteId, ResearchDigest, ResearchDispatchGate, ResearchDocument, ResearchDocumentId, ResearchMission, ResearchRequest, ReverseCompletionToolkitLayer, ScriptedGeneratePart, ScriptedGenerateTurn, ScriptedModel, ScriptedRequest, ScriptedRequestKind, ScriptedStreamPart, ScriptedStreamTermination, ScriptedStreamTurn, ScriptedTurn, ScriptedTurnHooks, ScriptedTurnInput, SearchActivities, SearchFlights, SearchLodging, SummaryBrief, SummaryFinding, SummaryRequest, SupplierBookRequest, SupplierBookingConfirmation, SupplierBookingDesk, SupplierBookingRecord, SupplierHoldControls, SupplierOperation, SupplierUnavailable, TIER2_UNREACHED_LOCATIONS, TravelBookingReport, TravelCoordinator, TravelCoordinatorToolkit, TravelGuidance, TravelGuidanceLayer, TravelPlan, TravelPlanner, TravelPlannerBookingEvidenceError, TravelPlannerBookingProfile, TravelPlannerCloudflareProfile, TravelPlannerCompletionControls, TravelPlannerDurabilityProfile, TravelPlannerDurableEvidenceError, TravelPlannerPersistenceProfile, TravelPlannerPhase2, TravelPlannerPhase2Toolkit, TravelPlannerPhase2ToolkitLayer, TravelPlannerPhase4, TravelPlannerPhase4Toolkit, TravelPlannerPhase4ToolkitLayer, TravelPlannerPhase5, TravelPlannerPhase5Toolkit, TravelPlannerPhase5ToolkitLayer, TravelPlannerPhase7Profile, TravelPlannerProjectionError, TravelPlannerRuntimeLayer, TravelPlannerSubagentDurabilityProfile, TravelPlannerToolkit, TravelPlannerToolkitLayer, TravelSupplierReconcilerLayer, TravelerRef, TripRequest, assertDiscoveryMatchesAuthoredToolkit, assertSettledBookingsExistAtSupplier, bookFlightIdempotencyKey, cancelBookingIdempotencyKey, certifyDurableAdapters, chaosSeedFromEnv, codeExecutorConformanceCases, coordinatorConfidentialMarker, coordinatorResearchTurn, coordinatorShortlistTurn, delegateDocumentSummary, destinationLookup, destinationReportFor, destinationResearchDelegation, destinationResearchHandlersLayer, destinationResearchPolicy, docContentToolkitLayer, docsCoordinatorConfidentialMarker, docsCoordinatorDigests, docsDocumentBodySecret, docsMcpConnectorLayer, docsMcpIdentity, docsMcpMismatchedConnectorLayer, docsMcpOversizedConnectorLayer, docsMcpRequest, docsMissionConfidentialMarker, docsResearcherDeploymentId, docsResearcherPrincipal, docsResearcherProducerId, docsResearcherSubmitAgent, docsResearcherSubmitOptions, docsSummarizerDigestStrings, docsSummarizerDigests, docsSummaryHandlersLayer, documentBodyPhrase, documentSummaryFor, documentSummaryPolicy, durableChildLookupCallId, durableDestinationResearchHandlersLayer, durableResearchAllocation, durableResearchCallId, durableResearchFinding, durableResearchShortlist, encodedDestinationFacts, encodedDestinationReport, encodedDocumentSummary, expectedDestinationShortlist, expectedResearchDigest, expectedTravelPlan, fetchCallId, generateChaosPlans, inProcessCodeExecutorImplementation, inProcessCodeExecutorLayer, itineraryStepIdempotencyKey, makeDestinationResearcherModel, makeDocsResearcherHarness, makeDurableResearchHarness, makeInvocationCountingModel, makePhase3TravelPlannerCheckpoint, makePhase4TravelPlannerAgent, makePhase6TravelPlannerBindings, mapResearchChildFailure, mapSummaryChildFailure, missionConfidentialMarker, normalizeCrossPlatformTravelPlannerEvidence, normalizeDurableTravelPlannerEvidence, phase0HappyPathTurns, phase0Trip, phase1HappyPathTurns, phase1Trip, phase3TravelPlannerBatches, phase3TravelPlannerCompletionBatch, phase3TravelPlannerConversationId, phase3TravelPlannerDefinitionDigests, phase3TravelPlannerEncodedFixture, phase3TravelPlannerInitialBatch, phase3TravelPlannerProducerId, phase3TravelPlannerProfile, phase3TravelPlannerRunId, phase4TravelPlannerDefinitionDigests, phase4TravelPlannerDeploymentId, phase4TravelPlannerPrincipal, phase4TravelPlannerProducerId, phase4TravelPlannerProfile, phase4TravelPlannerSubmitOptions, phase4TravelPlannerWorkerLayer, phase5TravelPlannerDefinitionDigests, phase5TravelPlannerDeploymentId, phase5TravelPlannerPrincipal, phase5TravelPlannerProducerId, phase5TravelPlannerProfile, phase5TravelPlannerSubmitOptions, phase5TravelPlannerWorkerLayer, phase6ActivityCallId, phase6BookingModel, phase6BookingRef, phase6BookingToolCallId, phase6BookingTrip, phase6ChildLookupCallId, phase6CoordinatorModel, phase6FlightCallId, phase6GatedPlannerDefinitionDigests, phase6GatedPlannerModel, phase6GatedTrip, phase6GuideInvocationCount, phase6LodgingCallId, phase6PlannerModel, phase6ResearchDestination, phase6ResearchMission, phase6ResearcherModel, phase6SupplierDesk, phase6SupplierDeskLayer, phase6SupplierReconcilerLayer, phase6TravelPlannerDeploymentId, phase6TravelPlannerGoldenEvidence, phase6TravelPlannerProducerId, phase6TravelPlannerProducerPrefix, phase6TravelPlannerProfile, phase7LiveProfileEnabled, phase7TravelPlannerProfile, redactedDocumentPreview, releasePhase6PlannerGate, releasePhase6ResearcherGate, researchCorpusDocumentIds, researchDocumentFor, researchDocumentLookup, researchMission, researchMissionRequest, researcherHappyPathTurns, resetPhase6PlannerGate, resetPhase6ResearcherGate, resolveTierThree, runChaosPlan, s2CoordinatorDigests, s2CoordinatorSubmitAgent, s2ResearcherDigestStrings, s2ResearcherDigests, s2TravelPlannerDeploymentId, s2TravelPlannerPrincipal, s2TravelPlannerProducerId, s2TravelPlannerProfile, s2TravelPlannerSubmitOptions, summarizeCallId, supplierBookingRefFor, tier2NeverFiredLocations, travelPlanFromDurableSettlement, travelPlanFromProjection };
3406
- //# sourceMappingURL=index.d.mts.map
1
+ import { i as ScriptedModel_d_exports } from "./ScriptedModel-DAvxIiud.mjs";
2
+ export { ScriptedModel_d_exports as ScriptedModel };