@effect-agent/testing 0.1.0-beta.9 → 0.1.0-beta.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Certification.d.mts +106 -0
- package/dist/Certification.mjs +633 -0
- package/dist/Certification.mjs.map +1 -0
- package/dist/Chaos.d.mts +126 -0
- package/dist/Chaos.mjs +755 -0
- package/dist/Chaos.mjs.map +1 -0
- package/dist/CodeExecutorConformance.d.mts +33 -0
- package/dist/CodeExecutorConformance.mjs +231 -0
- package/dist/CodeExecutorConformance.mjs.map +1 -0
- package/dist/CodeExecutorSubstitute.d.mts +21 -0
- package/dist/CodeExecutorSubstitute.mjs +368 -0
- package/dist/CodeExecutorSubstitute.mjs.map +1 -0
- package/dist/DocsResearcher.d.mts +276 -0
- package/dist/DocsResearcher.mjs +490 -0
- package/dist/DocsResearcher.mjs.map +1 -0
- package/dist/ScriptedModel-DAvxIiud.d.mts +220 -0
- package/dist/ScriptedModel.d.mts +2 -0
- package/dist/ScriptedModel.mjs +155 -0
- package/dist/ScriptedModel.mjs.map +1 -0
- package/dist/TravelPlanner.d.mts +1680 -0
- package/dist/TravelPlanner.mjs +1963 -0
- package/dist/TravelPlanner.mjs.map +1 -0
- package/dist/deterministic-layers-D5owIoke.mjs +358 -0
- package/dist/deterministic-layers-D5owIoke.mjs.map +1 -0
- package/dist/index.d.mts +2 -3408
- package/dist/index.mjs +2 -4771
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +1 -48
- package/src/{certification.ts → Certification.ts} +366 -171
- package/src/{chaos.ts → Chaos.ts} +241 -127
- package/src/{code-executor-conformance.ts → CodeExecutorConformance.ts} +30 -7
- package/src/{code-executor-substitute.ts → CodeExecutorSubstitute.ts} +113 -46
- package/src/{fixtures/docs-researcher/index.ts → DocsResearcher.ts} +68 -5
- package/src/{scripted-model.ts → ScriptedModel.ts} +25 -29
- package/src/TravelPlanner.ts +232 -0
- package/src/fixtures/docs-researcher/definition.ts +20 -11
- package/src/fixtures/docs-researcher/harness.ts +41 -34
- package/src/fixtures/docs-researcher/mcp.ts +49 -3
- package/src/fixtures/travel-planner/definition.ts +15 -2
- package/src/fixtures/travel-planner/deterministic-layers.ts +47 -4
- package/src/fixtures/travel-planner/phase2.ts +4 -3
- package/src/fixtures/travel-planner/phase3.ts +19 -42
- package/src/fixtures/travel-planner/phase4.ts +24 -37
- package/src/fixtures/travel-planner/phase5.ts +35 -42
- package/src/fixtures/travel-planner/phase6.ts +191 -88
- package/src/fixtures/travel-planner/phase7.ts +4 -102
- package/src/fixtures/travel-planner/scenarios.ts +3 -4
- package/src/fixtures/travel-planner/subagents-durable.ts +35 -61
- package/src/fixtures/travel-planner/subagents.ts +36 -14
- package/src/index.ts +1 -11
- package/src/internal/certification-report.ts +25 -0
- package/dist/index.mjs.map +0 -1
- package/src/code-executor-conformance.d.ts +0 -30
- package/src/fixtures/travel-planner/index.ts +0 -11
- package/src/fixtures/warehouse/index.ts +0 -412
|
@@ -0,0 +1,1680 @@
|
|
|
1
|
+
import { f as ScriptedTurnInput, r as ScriptedModel } from "./ScriptedModel-DAvxIiud.mjs";
|
|
2
|
+
import { Context, Effect, Layer, Option, Schema } from "effect";
|
|
3
|
+
import { LanguageModel, Model, Response, Tool, Toolkit } from "effect/unstable/ai";
|
|
4
|
+
import * as Agent from "effect-agent/agent";
|
|
5
|
+
import { ResolvedBinding } from "effect-agent/agent-registration";
|
|
6
|
+
import { DurableSubmitOptions, Receipt } from "effect-agent/durable-agent-runtime";
|
|
7
|
+
import { DurableStep, DurableStepError } from "effect-agent/durable-step";
|
|
8
|
+
import { ThreadId } from "effect-agent/identifiers";
|
|
9
|
+
import { CanonicalBatch, CanonicalRecordEnvelope, DefinitionDigests, ProducerId } from "effect-agent/records";
|
|
10
|
+
import * as Subagent from "effect-agent/subagent";
|
|
11
|
+
import { SubagentPolicy } from "effect-agent/subagent";
|
|
12
|
+
import { IdempotencyKey } from "effect-agent/submission-ledger";
|
|
13
|
+
import { ThreadCheckpoint } from "effect-agent/thread-store";
|
|
14
|
+
import { ToolReconciler } from "effect-agent/tool-reconciler";
|
|
15
|
+
import { RuntimeBinding } from "effect-agent/agent-runtime";
|
|
16
|
+
import { ThreadHistory } from "effect-agent/thread-history";
|
|
17
|
+
import { ThreadProjection } from "effect-agent/thread-projection";
|
|
18
|
+
//#region src/fixtures/travel-planner/definition.d.ts
|
|
19
|
+
declare const AirportCode: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
20
|
+
type AirportCode = typeof AirportCode.Type;
|
|
21
|
+
declare const QuoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
|
|
22
|
+
type QuoteId = typeof QuoteId.Type;
|
|
23
|
+
declare const TripRequest_base: Schema.Class<TripRequest, Schema.Struct<{
|
|
24
|
+
readonly request: Schema.NonEmptyString;
|
|
25
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
26
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
27
|
+
readonly departOn: Schema.String;
|
|
28
|
+
readonly nights: Schema.Int;
|
|
29
|
+
readonly travelers: Schema.Int;
|
|
30
|
+
readonly budgetCents: Schema.Int;
|
|
31
|
+
readonly currency: Schema.Literal<"USD">;
|
|
32
|
+
}>, {}>;
|
|
33
|
+
declare class TripRequest extends TripRequest_base {}
|
|
34
|
+
declare const FlightQuery_base: Schema.Class<FlightQuery, Schema.Struct<{
|
|
35
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
36
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
37
|
+
readonly departOn: Schema.String;
|
|
38
|
+
readonly travelers: Schema.Int;
|
|
39
|
+
}>, {}>;
|
|
40
|
+
declare class FlightQuery extends FlightQuery_base {}
|
|
41
|
+
declare const LodgingQuery_base: Schema.Class<LodgingQuery, Schema.Struct<{
|
|
42
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
43
|
+
readonly departOn: Schema.String;
|
|
44
|
+
readonly nights: Schema.Int;
|
|
45
|
+
readonly travelers: Schema.Int;
|
|
46
|
+
}>, {}>;
|
|
47
|
+
declare class LodgingQuery extends LodgingQuery_base {}
|
|
48
|
+
declare const ActivityQuery_base: Schema.Class<ActivityQuery, Schema.Struct<{
|
|
49
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
50
|
+
readonly departOn: Schema.String;
|
|
51
|
+
readonly nights: Schema.Int;
|
|
52
|
+
readonly travelers: Schema.Int;
|
|
53
|
+
}>, {}>;
|
|
54
|
+
declare class ActivityQuery extends ActivityQuery_base {}
|
|
55
|
+
declare const FlightOption_base: Schema.Class<FlightOption, Schema.Struct<{
|
|
56
|
+
readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
|
|
57
|
+
readonly flight: Schema.String;
|
|
58
|
+
readonly estimatedCents: Schema.Int;
|
|
59
|
+
readonly currency: Schema.Literal<"USD">;
|
|
60
|
+
}>, {}>;
|
|
61
|
+
declare class FlightOption extends FlightOption_base {}
|
|
62
|
+
declare const LodgingOption_base: Schema.Class<LodgingOption, Schema.Struct<{
|
|
63
|
+
readonly lodging: Schema.String;
|
|
64
|
+
readonly estimatedCents: Schema.Int;
|
|
65
|
+
readonly currency: Schema.Literal<"USD">;
|
|
66
|
+
}>, {}>;
|
|
67
|
+
declare class LodgingOption extends LodgingOption_base {}
|
|
68
|
+
declare const ActivitySearchResult_base: Schema.Class<ActivitySearchResult, Schema.Struct<{
|
|
69
|
+
readonly activities: Schema.$Array<Schema.String>;
|
|
70
|
+
}>, {}>;
|
|
71
|
+
/** A successful empty activity search is distinct from supplier unavailability. */
|
|
72
|
+
declare class ActivitySearchResult extends ActivitySearchResult_base {}
|
|
73
|
+
declare const Itinerary_base: Schema.Class<Itinerary, Schema.Struct<{
|
|
74
|
+
readonly title: Schema.String;
|
|
75
|
+
readonly route: Schema.String;
|
|
76
|
+
readonly dates: Schema.String;
|
|
77
|
+
readonly flight: Schema.String;
|
|
78
|
+
readonly lodging: Schema.String;
|
|
79
|
+
readonly activities: Schema.$Array<Schema.String>;
|
|
80
|
+
readonly estimatedTotalCents: Schema.Int;
|
|
81
|
+
readonly currency: Schema.Literal<"USD">;
|
|
82
|
+
readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
|
|
83
|
+
readonly assumptions: Schema.$Array<Schema.String>;
|
|
84
|
+
readonly unresolvedConstraints: Schema.$Array<Schema.String>;
|
|
85
|
+
readonly nextAction: Schema.Literal<"review">;
|
|
86
|
+
}>, {}>;
|
|
87
|
+
declare class Itinerary extends Itinerary_base {}
|
|
88
|
+
declare const TravelPlan_base: Schema.Class<TravelPlan, Schema.Struct<{
|
|
89
|
+
readonly itineraries: Schema.$Array<typeof Itinerary>;
|
|
90
|
+
}>, {}>;
|
|
91
|
+
declare class TravelPlan extends TravelPlan_base {}
|
|
92
|
+
declare const FlightUnavailable_base: Schema.Class<FlightUnavailable, Schema.TaggedStruct<"FlightUnavailable", {
|
|
93
|
+
query: Schema.String;
|
|
94
|
+
message: Schema.String;
|
|
95
|
+
}>, import("effect/Cause").YieldableError>;
|
|
96
|
+
declare class FlightUnavailable extends FlightUnavailable_base {}
|
|
97
|
+
declare const LodgingUnavailable_base: Schema.Class<LodgingUnavailable, Schema.TaggedStruct<"LodgingUnavailable", {
|
|
98
|
+
query: Schema.String;
|
|
99
|
+
message: Schema.String;
|
|
100
|
+
}>, import("effect/Cause").YieldableError>;
|
|
101
|
+
declare class LodgingUnavailable extends LodgingUnavailable_base {}
|
|
102
|
+
declare const ActivityUnavailable_base: Schema.Class<ActivityUnavailable, Schema.TaggedStruct<"ActivityUnavailable", {
|
|
103
|
+
query: Schema.String;
|
|
104
|
+
message: Schema.String;
|
|
105
|
+
}>, import("effect/Cause").YieldableError>;
|
|
106
|
+
declare class ActivityUnavailable extends ActivityUnavailable_base {}
|
|
107
|
+
declare const GuidanceFailure_base: Schema.Class<GuidanceFailure, Schema.TaggedStruct<"GuidanceFailure", {
|
|
108
|
+
readonly message: Schema.String;
|
|
109
|
+
}>, import("effect/Cause").YieldableError>;
|
|
110
|
+
declare class GuidanceFailure extends GuidanceFailure_base {}
|
|
111
|
+
declare const FlightCatalog_base: Context.ServiceClass<FlightCatalog, "@effect-agent/testing/travel-planner/FlightCatalog", {
|
|
112
|
+
readonly search: (query: FlightQuery) => Effect.Effect<FlightOption, FlightUnavailable>;
|
|
113
|
+
}>;
|
|
114
|
+
declare class FlightCatalog extends FlightCatalog_base {}
|
|
115
|
+
declare const LodgingCatalog_base: Context.ServiceClass<LodgingCatalog, "@effect-agent/testing/travel-planner/LodgingCatalog", {
|
|
116
|
+
readonly search: (query: LodgingQuery) => Effect.Effect<LodgingOption, LodgingUnavailable>;
|
|
117
|
+
}>;
|
|
118
|
+
declare class LodgingCatalog extends LodgingCatalog_base {}
|
|
119
|
+
declare const ActivityCatalog_base: Context.ServiceClass<ActivityCatalog, "@effect-agent/testing/travel-planner/ActivityCatalog", {
|
|
120
|
+
readonly search: (query: ActivityQuery) => Effect.Effect<ActivitySearchResult, ActivityUnavailable>;
|
|
121
|
+
}>;
|
|
122
|
+
declare class ActivityCatalog extends ActivityCatalog_base {}
|
|
123
|
+
declare const TravelGuidance_base: Context.ServiceClass<TravelGuidance, "@effect-agent/testing/travel-planner/TravelGuidance", {
|
|
124
|
+
readonly instructions: (input: TripRequest) => Effect.Effect<string, GuidanceFailure>;
|
|
125
|
+
}>;
|
|
126
|
+
declare class TravelGuidance extends TravelGuidance_base {}
|
|
127
|
+
declare const SearchFlights: Tool.Tool<"search_flights", {
|
|
128
|
+
readonly parameters: typeof FlightQuery;
|
|
129
|
+
readonly success: typeof FlightOption;
|
|
130
|
+
readonly failure: typeof FlightUnavailable;
|
|
131
|
+
readonly failureMode: "error";
|
|
132
|
+
}, FlightCatalog>;
|
|
133
|
+
declare const SearchLodging: Tool.Tool<"search_lodging", {
|
|
134
|
+
readonly parameters: typeof LodgingQuery;
|
|
135
|
+
readonly success: typeof LodgingOption;
|
|
136
|
+
readonly failure: typeof LodgingUnavailable;
|
|
137
|
+
readonly failureMode: "error";
|
|
138
|
+
}, LodgingCatalog>;
|
|
139
|
+
declare const SearchActivities: Tool.Tool<"search_activities", {
|
|
140
|
+
readonly parameters: typeof ActivityQuery;
|
|
141
|
+
readonly success: typeof ActivitySearchResult;
|
|
142
|
+
readonly failure: typeof ActivityUnavailable;
|
|
143
|
+
readonly failureMode: "error";
|
|
144
|
+
}, ActivityCatalog>;
|
|
145
|
+
declare const TravelPlannerToolkit: Toolkit.Toolkit<{
|
|
146
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
147
|
+
readonly parameters: typeof ActivityQuery;
|
|
148
|
+
readonly success: typeof ActivitySearchResult;
|
|
149
|
+
readonly failure: typeof ActivityUnavailable;
|
|
150
|
+
readonly failureMode: "error";
|
|
151
|
+
}, ActivityCatalog>;
|
|
152
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
153
|
+
readonly parameters: typeof FlightQuery;
|
|
154
|
+
readonly success: typeof FlightOption;
|
|
155
|
+
readonly failure: typeof FlightUnavailable;
|
|
156
|
+
readonly failureMode: "error";
|
|
157
|
+
}, FlightCatalog>;
|
|
158
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
159
|
+
readonly parameters: typeof LodgingQuery;
|
|
160
|
+
readonly success: typeof LodgingOption;
|
|
161
|
+
readonly failure: typeof LodgingUnavailable;
|
|
162
|
+
readonly failureMode: "error";
|
|
163
|
+
}, LodgingCatalog>;
|
|
164
|
+
}>;
|
|
165
|
+
declare const TravelPlannerToolkitLayer: import("effect/Layer").Layer<Tool.HandlersFor<{
|
|
166
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
167
|
+
readonly parameters: typeof ActivityQuery;
|
|
168
|
+
readonly success: typeof ActivitySearchResult;
|
|
169
|
+
readonly failure: typeof ActivityUnavailable;
|
|
170
|
+
readonly failureMode: "error";
|
|
171
|
+
}, ActivityCatalog>;
|
|
172
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
173
|
+
readonly parameters: typeof FlightQuery;
|
|
174
|
+
readonly success: typeof FlightOption;
|
|
175
|
+
readonly failure: typeof FlightUnavailable;
|
|
176
|
+
readonly failureMode: "error";
|
|
177
|
+
}, FlightCatalog>;
|
|
178
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
179
|
+
readonly parameters: typeof LodgingQuery;
|
|
180
|
+
readonly success: typeof LodgingOption;
|
|
181
|
+
readonly failure: typeof LodgingUnavailable;
|
|
182
|
+
readonly failureMode: "error";
|
|
183
|
+
}, LodgingCatalog>;
|
|
184
|
+
}>, never, never>;
|
|
185
|
+
declare const TravelPlanner: Agent.Definition<typeof TripRequest, typeof TravelPlan, (input: TripRequest) => Effect.Effect<string, GuidanceFailure, TravelGuidance>, Toolkit.Toolkit<{
|
|
186
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
187
|
+
readonly parameters: typeof ActivityQuery;
|
|
188
|
+
readonly success: typeof ActivitySearchResult;
|
|
189
|
+
readonly failure: typeof ActivityUnavailable;
|
|
190
|
+
readonly failureMode: "error";
|
|
191
|
+
}, ActivityCatalog>;
|
|
192
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
193
|
+
readonly parameters: typeof FlightQuery;
|
|
194
|
+
readonly success: typeof FlightOption;
|
|
195
|
+
readonly failure: typeof FlightUnavailable;
|
|
196
|
+
readonly failureMode: "error";
|
|
197
|
+
}, FlightCatalog>;
|
|
198
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
199
|
+
readonly parameters: typeof LodgingQuery;
|
|
200
|
+
readonly success: typeof LodgingOption;
|
|
201
|
+
readonly failure: typeof LodgingUnavailable;
|
|
202
|
+
readonly failureMode: "error";
|
|
203
|
+
}, LodgingCatalog>;
|
|
204
|
+
}>, undefined, undefined, undefined> & {
|
|
205
|
+
readonly id: import("effect/Brand").Brand<"@effect-agent/core/AgentId"> & "travel-planner";
|
|
206
|
+
};
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/fixtures/travel-planner/deterministic-layers.d.ts
|
|
209
|
+
declare const CatalogLifecycleCounts_base: Schema.Class<CatalogLifecycleCounts, Schema.Struct<{
|
|
210
|
+
readonly acquired: Schema.Natural;
|
|
211
|
+
readonly finalized: Schema.Natural;
|
|
212
|
+
}>, {}>;
|
|
213
|
+
declare class CatalogLifecycleCounts extends CatalogLifecycleCounts_base {}
|
|
214
|
+
declare const CatalogLifecycle_base: Context.ServiceClass<CatalogLifecycle, "@effect-agent/testing/travel-planner/CatalogLifecycle", {
|
|
215
|
+
readonly markAcquired: Effect.Effect<void>;
|
|
216
|
+
readonly markFinalized: Effect.Effect<void>;
|
|
217
|
+
readonly counts: Effect.Effect<CatalogLifecycleCounts>;
|
|
218
|
+
}>;
|
|
219
|
+
declare class CatalogLifecycle extends CatalogLifecycle_base {
|
|
220
|
+
static readonly layerNoDeps: Layer.Layer<CatalogLifecycle, never, never>;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Deterministic controls for a Tool batch whose completions are released in a
|
|
224
|
+
* caller-selected order. This is intentionally a test fixture: it uses no
|
|
225
|
+
* clock or sleep and lets engine scheduler tests prove parallel starts and
|
|
226
|
+
* declaration-order prompt materialization.
|
|
227
|
+
*/
|
|
228
|
+
interface TravelPlannerCompletionControls {
|
|
229
|
+
readonly flightStarted: Effect.Effect<void>;
|
|
230
|
+
readonly lodgingStarted: Effect.Effect<void>;
|
|
231
|
+
readonly activityStarted: Effect.Effect<void>;
|
|
232
|
+
readonly releaseFlight: Effect.Effect<void>;
|
|
233
|
+
readonly releaseLodging: Effect.Effect<void>;
|
|
234
|
+
readonly releaseActivity: Effect.Effect<void>;
|
|
235
|
+
}
|
|
236
|
+
declare const ReverseCompletionToolkitLayer: Effect.Effect<{
|
|
237
|
+
controls: {
|
|
238
|
+
flightStarted: Effect.Effect<void, never, never>;
|
|
239
|
+
lodgingStarted: Effect.Effect<void, never, never>;
|
|
240
|
+
activityStarted: Effect.Effect<void, never, never>;
|
|
241
|
+
releaseFlight: Effect.Effect<void, never, never>;
|
|
242
|
+
releaseLodging: Effect.Effect<void, never, never>;
|
|
243
|
+
releaseActivity: Effect.Effect<void, never, never>;
|
|
244
|
+
};
|
|
245
|
+
layer: Layer.Layer<import("effect/unstable/ai/Tool").HandlersFor<{
|
|
246
|
+
readonly search_activities: import("effect/unstable/ai/Tool").Tool<"search_activities", {
|
|
247
|
+
readonly parameters: typeof ActivityQuery;
|
|
248
|
+
readonly success: typeof ActivitySearchResult;
|
|
249
|
+
readonly failure: typeof ActivityUnavailable;
|
|
250
|
+
readonly failureMode: "error";
|
|
251
|
+
}, ActivityCatalog>;
|
|
252
|
+
readonly search_flights: import("effect/unstable/ai/Tool").Tool<"search_flights", {
|
|
253
|
+
readonly parameters: typeof FlightQuery;
|
|
254
|
+
readonly success: typeof FlightOption;
|
|
255
|
+
readonly failure: typeof FlightUnavailable;
|
|
256
|
+
readonly failureMode: "error";
|
|
257
|
+
}, FlightCatalog>;
|
|
258
|
+
readonly search_lodging: import("effect/unstable/ai/Tool").Tool<"search_lodging", {
|
|
259
|
+
readonly parameters: typeof LodgingQuery;
|
|
260
|
+
readonly success: typeof LodgingOption;
|
|
261
|
+
readonly failure: typeof LodgingUnavailable;
|
|
262
|
+
readonly failureMode: "error";
|
|
263
|
+
}, LodgingCatalog>;
|
|
264
|
+
}>, never, never>;
|
|
265
|
+
}, never, never>;
|
|
266
|
+
declare const FlightCatalogLayer: Layer.Layer<FlightCatalog, never, CatalogLifecycle>;
|
|
267
|
+
declare const LodgingCatalogLayer: Layer.Layer<LodgingCatalog, never, CatalogLifecycle>;
|
|
268
|
+
declare const ActivityCatalogLayer: Layer.Layer<ActivityCatalog, never, CatalogLifecycle>;
|
|
269
|
+
/** Stable supplier-side booking identity, minted deterministically from the idempotency key. */
|
|
270
|
+
declare const BookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
|
|
271
|
+
type BookingRef = typeof BookingRef.Type;
|
|
272
|
+
/** The supplier desk operations the P5 booking Tools and Steps invoke. */
|
|
273
|
+
declare const SupplierOperation: Schema.Literals<readonly ["book-flight", "cancel-booking", "reserve-flight", "reserve-lodging", "issue-confirmation"]>;
|
|
274
|
+
type SupplierOperation = typeof SupplierOperation.Type;
|
|
275
|
+
declare const SupplierBookingRecord_base: Schema.Class<SupplierBookingRecord, Schema.Struct<{
|
|
276
|
+
readonly bookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
|
|
277
|
+
readonly idempotencyKey: Schema.NonEmptyString;
|
|
278
|
+
readonly operation: Schema.Literals<readonly ["book-flight", "cancel-booking", "reserve-flight", "reserve-lodging", "issue-confirmation"]>;
|
|
279
|
+
readonly detail: Schema.NonEmptyString;
|
|
280
|
+
readonly status: Schema.Literals<readonly ["confirmed", "cancelled"]>;
|
|
281
|
+
}>, {}>;
|
|
282
|
+
/**
|
|
283
|
+
* One row of external supplier truth. The desk deduplicates by `idempotencyKey` — replaying a
|
|
284
|
+
* call with the same key returns this exact record without creating a second booking — which is
|
|
285
|
+
* precisely the honesty model of DUR-010: the framework never makes an external call
|
|
286
|
+
* exactly-once; the supplier's idempotency key does.
|
|
287
|
+
*/
|
|
288
|
+
declare class SupplierBookingRecord extends SupplierBookingRecord_base {}
|
|
289
|
+
declare const SupplierUnavailable_base: Schema.Class<SupplierUnavailable, Schema.TaggedStruct<"SupplierUnavailable", {
|
|
290
|
+
readonly message: Schema.String;
|
|
291
|
+
}>, import("effect/Cause").YieldableError>;
|
|
292
|
+
declare class SupplierUnavailable extends SupplierUnavailable_base {}
|
|
293
|
+
interface SupplierBookRequest {
|
|
294
|
+
readonly operation: SupplierOperation;
|
|
295
|
+
readonly idempotencyKey: string;
|
|
296
|
+
readonly detail: string;
|
|
297
|
+
}
|
|
298
|
+
/** Controls returned by an armed crash window (`holdAfterWrite`). */
|
|
299
|
+
interface SupplierHoldControls {
|
|
300
|
+
/** Resolves once the armed call has performed its supplier write and is blocked. */
|
|
301
|
+
readonly held: Effect.Effect<void>;
|
|
302
|
+
/** Releases the blocked call (tests that interrupt the Attempt never call this). */
|
|
303
|
+
readonly release: Effect.Effect<void>;
|
|
304
|
+
}
|
|
305
|
+
/** The desk-internal idempotency key of one cancellation: cancel is idempotent by bookingRef. */
|
|
306
|
+
declare const cancelBookingIdempotencyKey: (bookingRef: string) => string;
|
|
307
|
+
/** The deterministic bookingRef the desk mints for one idempotency key. */
|
|
308
|
+
declare const supplierBookingRefFor: (idempotencyKey: string) => BookingRef;
|
|
309
|
+
declare const SupplierBookingDesk_base: Context.ServiceClass<SupplierBookingDesk, "@effect-agent/testing/travel-planner/SupplierBookingDesk", {
|
|
310
|
+
readonly book: (request: SupplierBookRequest) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;
|
|
311
|
+
readonly cancel: (bookingRef: BookingRef) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;
|
|
312
|
+
readonly lookup: (idempotencyKey: string) => Effect.Effect<Option.Option<SupplierBookingRecord>>;
|
|
313
|
+
readonly bookings: Effect.Effect<ReadonlyArray<SupplierBookingRecord>>;
|
|
314
|
+
readonly callCount: (idempotencyKey: string) => Effect.Effect<number>;
|
|
315
|
+
readonly holdAfterWrite: (idempotencyKey: string) => Effect.Effect<SupplierHoldControls>;
|
|
316
|
+
}>;
|
|
317
|
+
/**
|
|
318
|
+
* The deterministic in-memory supplier: an idempotency-keyed booking store with per-key call
|
|
319
|
+
* counters and injectable crash windows.
|
|
320
|
+
*
|
|
321
|
+
* - `book`/`cancel` always count the call (at-least-once execution stays observable), then
|
|
322
|
+
* dedupe the external effect by idempotency key — the supplier-side contract the P5 Tools and
|
|
323
|
+
* Steps rely on.
|
|
324
|
+
* - `holdAfterWrite` arms a one-shot crash window: the next call with that key performs its
|
|
325
|
+
* supplier write, signals `held`, and never returns. Interrupting the Attempt at that point
|
|
326
|
+
* models "the external effect happened but no outcome was recorded" without any wall clock.
|
|
327
|
+
* - `bookings`/`lookup` expose external truth for the reconciler and for never-fabricate
|
|
328
|
+
* assertions.
|
|
329
|
+
*/
|
|
330
|
+
declare class SupplierBookingDesk extends SupplierBookingDesk_base {
|
|
331
|
+
static readonly layer: Layer.Layer<SupplierBookingDesk>;
|
|
332
|
+
}
|
|
333
|
+
declare const TravelGuidanceLayer: Layer.Layer<TravelGuidance, never, never>;
|
|
334
|
+
declare const DeterministicIdGeneratorLayer: Layer.Layer<never, never, never>;
|
|
335
|
+
declare const TravelPlannerRuntimeLayer: Layer.Layer<ActivityCatalog | FlightCatalog | LodgingCatalog | import("effect-agent/run-options").RunContextPreparation | import("effect-agent/thread").Store | ThreadHistory | TravelGuidance | import("effect/unstable/ai/Tool").HandlersFor<{
|
|
336
|
+
readonly search_activities: import("effect/unstable/ai/Tool").Tool<"search_activities", {
|
|
337
|
+
readonly parameters: typeof ActivityQuery;
|
|
338
|
+
readonly success: typeof ActivitySearchResult;
|
|
339
|
+
readonly failure: typeof ActivityUnavailable;
|
|
340
|
+
readonly failureMode: "error";
|
|
341
|
+
}, ActivityCatalog>;
|
|
342
|
+
readonly search_flights: import("effect/unstable/ai/Tool").Tool<"search_flights", {
|
|
343
|
+
readonly parameters: typeof FlightQuery;
|
|
344
|
+
readonly success: typeof FlightOption;
|
|
345
|
+
readonly failure: typeof FlightUnavailable;
|
|
346
|
+
readonly failureMode: "error";
|
|
347
|
+
}, FlightCatalog>;
|
|
348
|
+
readonly search_lodging: import("effect/unstable/ai/Tool").Tool<"search_lodging", {
|
|
349
|
+
readonly parameters: typeof LodgingQuery;
|
|
350
|
+
readonly success: typeof LodgingOption;
|
|
351
|
+
readonly failure: typeof LodgingUnavailable;
|
|
352
|
+
readonly failureMode: "error";
|
|
353
|
+
}, LodgingCatalog>;
|
|
354
|
+
}>, never, never>;
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/fixtures/travel-planner/phase2.d.ts
|
|
357
|
+
declare const ItineraryHoldRequest_base: Schema.Class<ItineraryHoldRequest, Schema.Struct<{
|
|
358
|
+
readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
|
|
359
|
+
readonly expiresInMinutes: Schema.Int;
|
|
360
|
+
}>, {}>;
|
|
361
|
+
declare class ItineraryHoldRequest extends ItineraryHoldRequest_base {}
|
|
362
|
+
declare const ItineraryHold_base: Schema.Class<ItineraryHold, Schema.Struct<{
|
|
363
|
+
readonly holdId: Schema.NonEmptyString;
|
|
364
|
+
readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
|
|
365
|
+
readonly status: Schema.Literal<"held">;
|
|
366
|
+
}>, {}>;
|
|
367
|
+
declare class ItineraryHold extends ItineraryHold_base {}
|
|
368
|
+
declare const ItineraryHoldUnavailable_base: Schema.Class<ItineraryHoldUnavailable, Schema.TaggedStruct<"ItineraryHoldUnavailable", {
|
|
369
|
+
readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
|
|
370
|
+
readonly message: Schema.String;
|
|
371
|
+
}>, import("effect/Cause").YieldableError>;
|
|
372
|
+
declare class ItineraryHoldUnavailable extends ItineraryHoldUnavailable_base {}
|
|
373
|
+
declare const ItineraryHoldGateway_base: Context.ServiceClass<ItineraryHoldGateway, "@effect-agent/testing/travel-planner/ItineraryHoldGateway", {
|
|
374
|
+
readonly hold: (request: ItineraryHoldRequest) => Effect.Effect<ItineraryHold, ItineraryHoldUnavailable>;
|
|
375
|
+
}>;
|
|
376
|
+
declare class ItineraryHoldGateway extends ItineraryHoldGateway_base {}
|
|
377
|
+
/**
|
|
378
|
+
* The first mutating Travel Planner Tool. Effect AI marks it as approval-gated
|
|
379
|
+
* so the engine must settle approval before acquiring a handler permit.
|
|
380
|
+
*/
|
|
381
|
+
declare const HoldItinerary: Tool.Tool<"hold_itinerary", {
|
|
382
|
+
readonly parameters: typeof ItineraryHoldRequest;
|
|
383
|
+
readonly success: typeof ItineraryHold;
|
|
384
|
+
readonly failure: typeof ItineraryHoldUnavailable;
|
|
385
|
+
readonly failureMode: "error";
|
|
386
|
+
}, ItineraryHoldGateway>;
|
|
387
|
+
declare const TravelPlannerPhase2Toolkit: Toolkit.Toolkit<{
|
|
388
|
+
readonly hold_itinerary: Tool.Tool<"hold_itinerary", {
|
|
389
|
+
readonly parameters: typeof ItineraryHoldRequest;
|
|
390
|
+
readonly success: typeof ItineraryHold;
|
|
391
|
+
readonly failure: typeof ItineraryHoldUnavailable;
|
|
392
|
+
readonly failureMode: "error";
|
|
393
|
+
}, ItineraryHoldGateway>;
|
|
394
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
395
|
+
readonly parameters: typeof ActivityQuery;
|
|
396
|
+
readonly success: typeof ActivitySearchResult;
|
|
397
|
+
readonly failure: typeof ActivityUnavailable;
|
|
398
|
+
readonly failureMode: "error";
|
|
399
|
+
}, ActivityCatalog>;
|
|
400
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
401
|
+
readonly parameters: typeof FlightQuery;
|
|
402
|
+
readonly success: typeof FlightOption;
|
|
403
|
+
readonly failure: typeof FlightUnavailable;
|
|
404
|
+
readonly failureMode: "error";
|
|
405
|
+
}, FlightCatalog>;
|
|
406
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
407
|
+
readonly parameters: typeof LodgingQuery;
|
|
408
|
+
readonly success: typeof LodgingOption;
|
|
409
|
+
readonly failure: typeof LodgingUnavailable;
|
|
410
|
+
readonly failureMode: "error";
|
|
411
|
+
}, LodgingCatalog>;
|
|
412
|
+
}>;
|
|
413
|
+
declare const TravelPlannerPhase2ToolkitLayer: import("effect/Layer").Layer<Tool.HandlersFor<{
|
|
414
|
+
readonly hold_itinerary: Tool.Tool<"hold_itinerary", {
|
|
415
|
+
readonly parameters: typeof ItineraryHoldRequest;
|
|
416
|
+
readonly success: typeof ItineraryHold;
|
|
417
|
+
readonly failure: typeof ItineraryHoldUnavailable;
|
|
418
|
+
readonly failureMode: "error";
|
|
419
|
+
}, ItineraryHoldGateway>;
|
|
420
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
421
|
+
readonly parameters: typeof ActivityQuery;
|
|
422
|
+
readonly success: typeof ActivitySearchResult;
|
|
423
|
+
readonly failure: typeof ActivityUnavailable;
|
|
424
|
+
readonly failureMode: "error";
|
|
425
|
+
}, ActivityCatalog>;
|
|
426
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
427
|
+
readonly parameters: typeof FlightQuery;
|
|
428
|
+
readonly success: typeof FlightOption;
|
|
429
|
+
readonly failure: typeof FlightUnavailable;
|
|
430
|
+
readonly failureMode: "error";
|
|
431
|
+
}, FlightCatalog>;
|
|
432
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
433
|
+
readonly parameters: typeof LodgingQuery;
|
|
434
|
+
readonly success: typeof LodgingOption;
|
|
435
|
+
readonly failure: typeof LodgingUnavailable;
|
|
436
|
+
readonly failureMode: "error";
|
|
437
|
+
}, LodgingCatalog>;
|
|
438
|
+
}>, never, never>;
|
|
439
|
+
declare const TravelPlannerPhase2: Agent.Definition<typeof TripRequest, typeof TravelPlan, (input: TripRequest) => Effect.Effect<string, GuidanceFailure, TravelGuidance>, Toolkit.Toolkit<{
|
|
440
|
+
readonly hold_itinerary: Tool.Tool<"hold_itinerary", {
|
|
441
|
+
readonly parameters: typeof ItineraryHoldRequest;
|
|
442
|
+
readonly success: typeof ItineraryHold;
|
|
443
|
+
readonly failure: typeof ItineraryHoldUnavailable;
|
|
444
|
+
readonly failureMode: "error";
|
|
445
|
+
}, ItineraryHoldGateway>;
|
|
446
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
447
|
+
readonly parameters: typeof ActivityQuery;
|
|
448
|
+
readonly success: typeof ActivitySearchResult;
|
|
449
|
+
readonly failure: typeof ActivityUnavailable;
|
|
450
|
+
readonly failureMode: "error";
|
|
451
|
+
}, ActivityCatalog>;
|
|
452
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
453
|
+
readonly parameters: typeof FlightQuery;
|
|
454
|
+
readonly success: typeof FlightOption;
|
|
455
|
+
readonly failure: typeof FlightUnavailable;
|
|
456
|
+
readonly failureMode: "error";
|
|
457
|
+
}, FlightCatalog>;
|
|
458
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
459
|
+
readonly parameters: typeof LodgingQuery;
|
|
460
|
+
readonly success: typeof LodgingOption;
|
|
461
|
+
readonly failure: typeof LodgingUnavailable;
|
|
462
|
+
readonly failureMode: "error";
|
|
463
|
+
}, LodgingCatalog>;
|
|
464
|
+
}>, undefined, undefined, undefined> & {
|
|
465
|
+
readonly id: import("effect/Brand").Brand<"@effect-agent/core/AgentId"> & "travel-planner-phase-2";
|
|
466
|
+
};
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/fixtures/travel-planner/phase3.d.ts
|
|
469
|
+
declare const phase3TravelPlannerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
470
|
+
declare const phase3TravelPlannerProducerId: string & import("effect/Brand").Brand<"@effect-agent/thread/ProducerId">;
|
|
471
|
+
declare const phase3TravelPlannerRunId: string & import("effect/Brand").Brand<"@effect-agent/core/RunId">;
|
|
472
|
+
/** Redacted, deterministic definition identities for the current fixture version. */
|
|
473
|
+
declare const phase3TravelPlannerDefinitionDigests: DefinitionDigests;
|
|
474
|
+
/**
|
|
475
|
+
* The first atomic append establishes the Thread and records its input.
|
|
476
|
+
* Its encoded value is the redacted current-version persistence fixture.
|
|
477
|
+
*/
|
|
478
|
+
declare const phase3TravelPlannerInitialBatch: CanonicalBatch;
|
|
479
|
+
/** The second append records the Schema-decoded itinerary and terminal Run result. */
|
|
480
|
+
declare const phase3TravelPlannerCompletionBatch: CanonicalBatch;
|
|
481
|
+
declare const phase3TravelPlannerBatches: readonly [CanonicalBatch, CanonicalBatch];
|
|
482
|
+
/** Portable current-version fixture; it contains no passenger identity or credentials. */
|
|
483
|
+
declare const phase3TravelPlannerEncodedFixture: ReadonlyArray<typeof CanonicalBatch.Encoded>;
|
|
484
|
+
declare const TravelPlannerProjectionError_base: Schema.Class<TravelPlannerProjectionError, Schema.TaggedStruct<"TravelPlannerProjectionError", {
|
|
485
|
+
readonly message: Schema.String;
|
|
486
|
+
}>, import("effect/Cause").YieldableError>;
|
|
487
|
+
declare class TravelPlannerProjectionError extends TravelPlannerProjectionError_base {}
|
|
488
|
+
/** Decode the itinerary projection rebuilt from canonical model-completion records. */
|
|
489
|
+
declare const travelPlanFromProjection: (projection: ThreadProjection) => Effect.Effect<TravelPlan, TravelPlannerProjectionError>;
|
|
490
|
+
/** Build a disposable checkpoint bound to a validated canonical prefix. */
|
|
491
|
+
declare const makePhase3TravelPlannerCheckpoint: (projection: ThreadProjection) => ThreadCheckpoint;
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region src/fixtures/travel-planner/phase4.d.ts
|
|
494
|
+
declare const phase4TravelPlannerDeploymentId: string & import("effect/Brand").Brand<"@effect-agent/thread/DeploymentId">;
|
|
495
|
+
declare const phase4TravelPlannerProducerId: string & import("effect/Brand").Brand<"@effect-agent/thread/ProducerId">;
|
|
496
|
+
declare const phase4TravelPlannerPrincipal: string & import("effect/Brand").Brand<"@effect-agent/thread/Principal">;
|
|
497
|
+
/** Redacted, deterministic definition identities for the current fixture version. */
|
|
498
|
+
declare const phase4TravelPlannerDefinitionDigests: DefinitionDigests;
|
|
499
|
+
/** Durable admission options for one Travel Planner Submission on one trip lane. */
|
|
500
|
+
declare const phase4TravelPlannerSubmitOptions: (threadId: ThreadId, idempotencyKey: IdempotencyKey) => DurableSubmitOptions;
|
|
501
|
+
/**
|
|
502
|
+
* The P4 read-only search Tools, calling the same deterministic catalogs as the P1 toolkit.
|
|
503
|
+
*
|
|
504
|
+
* The plain-Struct parameter shape is a historical remnant of the P4 carry-in workaround: since
|
|
505
|
+
* the P5 engine fix, official history carries Schema-ENCODED Tool-call parameters, so class-typed
|
|
506
|
+
* parameter codecs persist canonically too — the Structs simply need no change here. The
|
|
507
|
+
* `ToolExecutionClass` `readonly` annotation is the deliberate P5 migration (plan §4.3): these
|
|
508
|
+
* Tools perform no external mutation, so a crash between start and settlement is a free re-run
|
|
509
|
+
* and they never enter the prepared/settled uncertainty protocol — keeping the P4 canonical
|
|
510
|
+
* history byte-stable (an unannotated Tool fails closed to `uncertain`).
|
|
511
|
+
*/
|
|
512
|
+
declare const DurableSearchFlights: Tool.Tool<"search_flights", {
|
|
513
|
+
readonly parameters: Schema.Struct<{
|
|
514
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
515
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
516
|
+
readonly departOn: Schema.String;
|
|
517
|
+
readonly travelers: Schema.Int;
|
|
518
|
+
}>;
|
|
519
|
+
readonly success: typeof FlightOption;
|
|
520
|
+
readonly failure: typeof FlightUnavailable;
|
|
521
|
+
readonly failureMode: "error";
|
|
522
|
+
}, FlightCatalog>;
|
|
523
|
+
declare const DurableSearchLodging: Tool.Tool<"search_lodging", {
|
|
524
|
+
readonly parameters: Schema.Struct<{
|
|
525
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
526
|
+
readonly departOn: Schema.String;
|
|
527
|
+
readonly nights: Schema.Int;
|
|
528
|
+
readonly travelers: Schema.Int;
|
|
529
|
+
}>;
|
|
530
|
+
readonly success: typeof LodgingOption;
|
|
531
|
+
readonly failure: typeof LodgingUnavailable;
|
|
532
|
+
readonly failureMode: "error";
|
|
533
|
+
}, LodgingCatalog>;
|
|
534
|
+
declare const DurableSearchActivities: Tool.Tool<"search_activities", {
|
|
535
|
+
readonly parameters: Schema.Struct<{
|
|
536
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
537
|
+
readonly departOn: Schema.String;
|
|
538
|
+
readonly nights: Schema.Int;
|
|
539
|
+
readonly travelers: Schema.Int;
|
|
540
|
+
}>;
|
|
541
|
+
readonly success: typeof ActivitySearchResult;
|
|
542
|
+
readonly failure: typeof ActivityUnavailable;
|
|
543
|
+
readonly failureMode: "error";
|
|
544
|
+
}, ActivityCatalog>;
|
|
545
|
+
declare const TravelPlannerPhase4Toolkit: Toolkit.Toolkit<{
|
|
546
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
547
|
+
readonly parameters: Schema.Struct<{
|
|
548
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
549
|
+
readonly departOn: Schema.String;
|
|
550
|
+
readonly nights: Schema.Int;
|
|
551
|
+
readonly travelers: Schema.Int;
|
|
552
|
+
}>;
|
|
553
|
+
readonly success: typeof ActivitySearchResult;
|
|
554
|
+
readonly failure: typeof ActivityUnavailable;
|
|
555
|
+
readonly failureMode: "error";
|
|
556
|
+
}, ActivityCatalog>;
|
|
557
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
558
|
+
readonly parameters: Schema.Struct<{
|
|
559
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
560
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
561
|
+
readonly departOn: Schema.String;
|
|
562
|
+
readonly travelers: Schema.Int;
|
|
563
|
+
}>;
|
|
564
|
+
readonly success: typeof FlightOption;
|
|
565
|
+
readonly failure: typeof FlightUnavailable;
|
|
566
|
+
readonly failureMode: "error";
|
|
567
|
+
}, FlightCatalog>;
|
|
568
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
569
|
+
readonly parameters: Schema.Struct<{
|
|
570
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
571
|
+
readonly departOn: Schema.String;
|
|
572
|
+
readonly nights: Schema.Int;
|
|
573
|
+
readonly travelers: Schema.Int;
|
|
574
|
+
}>;
|
|
575
|
+
readonly success: typeof LodgingOption;
|
|
576
|
+
readonly failure: typeof LodgingUnavailable;
|
|
577
|
+
readonly failureMode: "error";
|
|
578
|
+
}, LodgingCatalog>;
|
|
579
|
+
}>;
|
|
580
|
+
declare const TravelPlannerPhase4ToolkitLayer: Layer.Layer<Tool.HandlersFor<{
|
|
581
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
582
|
+
readonly parameters: Schema.Struct<{
|
|
583
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
584
|
+
readonly departOn: Schema.String;
|
|
585
|
+
readonly nights: Schema.Int;
|
|
586
|
+
readonly travelers: Schema.Int;
|
|
587
|
+
}>;
|
|
588
|
+
readonly success: typeof ActivitySearchResult;
|
|
589
|
+
readonly failure: typeof ActivityUnavailable;
|
|
590
|
+
readonly failureMode: "error";
|
|
591
|
+
}, ActivityCatalog>;
|
|
592
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
593
|
+
readonly parameters: Schema.Struct<{
|
|
594
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
595
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
596
|
+
readonly departOn: Schema.String;
|
|
597
|
+
readonly travelers: Schema.Int;
|
|
598
|
+
}>;
|
|
599
|
+
readonly success: typeof FlightOption;
|
|
600
|
+
readonly failure: typeof FlightUnavailable;
|
|
601
|
+
readonly failureMode: "error";
|
|
602
|
+
}, FlightCatalog>;
|
|
603
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
604
|
+
readonly parameters: Schema.Struct<{
|
|
605
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
606
|
+
readonly departOn: Schema.String;
|
|
607
|
+
readonly nights: Schema.Int;
|
|
608
|
+
readonly travelers: Schema.Int;
|
|
609
|
+
}>;
|
|
610
|
+
readonly success: typeof LodgingOption;
|
|
611
|
+
readonly failure: typeof LodgingUnavailable;
|
|
612
|
+
readonly failureMode: "error";
|
|
613
|
+
}, LodgingCatalog>;
|
|
614
|
+
}>, never, never>;
|
|
615
|
+
/**
|
|
616
|
+
* The cumulative Travel Planner, Phase 4: the P1 planning behavior on the durable Node/SQLite
|
|
617
|
+
* runtime. The searches are read-only and safe to repeat across Attempts (D6); supplier booking
|
|
618
|
+
* is deliberately absent because DN does NOT claim replay-safe external mutation (P5 scope).
|
|
619
|
+
*/
|
|
620
|
+
declare const TravelPlannerPhase4: Agent.Definition<typeof TripRequest, typeof TravelPlan, (input: TripRequest) => Effect.Effect<string, GuidanceFailure, TravelGuidance>, Toolkit.Toolkit<{
|
|
621
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
622
|
+
readonly parameters: Schema.Struct<{
|
|
623
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
624
|
+
readonly departOn: Schema.String;
|
|
625
|
+
readonly nights: Schema.Int;
|
|
626
|
+
readonly travelers: Schema.Int;
|
|
627
|
+
}>;
|
|
628
|
+
readonly success: typeof ActivitySearchResult;
|
|
629
|
+
readonly failure: typeof ActivityUnavailable;
|
|
630
|
+
readonly failureMode: "error";
|
|
631
|
+
}, ActivityCatalog>;
|
|
632
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
633
|
+
readonly parameters: Schema.Struct<{
|
|
634
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
635
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
636
|
+
readonly departOn: Schema.String;
|
|
637
|
+
readonly travelers: Schema.Int;
|
|
638
|
+
}>;
|
|
639
|
+
readonly success: typeof FlightOption;
|
|
640
|
+
readonly failure: typeof FlightUnavailable;
|
|
641
|
+
readonly failureMode: "error";
|
|
642
|
+
}, FlightCatalog>;
|
|
643
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
644
|
+
readonly parameters: Schema.Struct<{
|
|
645
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
646
|
+
readonly departOn: Schema.String;
|
|
647
|
+
readonly nights: Schema.Int;
|
|
648
|
+
readonly travelers: Schema.Int;
|
|
649
|
+
}>;
|
|
650
|
+
readonly success: typeof LodgingOption;
|
|
651
|
+
readonly failure: typeof LodgingUnavailable;
|
|
652
|
+
readonly failureMode: "error";
|
|
653
|
+
}, LodgingCatalog>;
|
|
654
|
+
}>, undefined, undefined, undefined> & {
|
|
655
|
+
readonly id: import("effect/Brand").Brand<"@effect-agent/core/AgentId"> & "travel-planner-phase-4";
|
|
656
|
+
};
|
|
657
|
+
/**
|
|
658
|
+
* The P4 Agent Binding: the durable Travel Planner definition bound to a finite scripted model.
|
|
659
|
+
* The scripted Layer is rebuilt per Run, so every Run of one Binding replays the same
|
|
660
|
+
* deterministic script.
|
|
661
|
+
*/
|
|
662
|
+
declare const makePhase4TravelPlannerAgent: (turns?: ReadonlyArray<ScriptedTurnInput>) => Agent.Binding<Agent.Definition<typeof TripRequest, typeof TravelPlan, (input: TripRequest) => Effect.Effect<string, GuidanceFailure, TravelGuidance>, Toolkit.Toolkit<{
|
|
663
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
664
|
+
readonly parameters: Schema.Struct<{
|
|
665
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
666
|
+
readonly departOn: Schema.String;
|
|
667
|
+
readonly nights: Schema.Int;
|
|
668
|
+
readonly travelers: Schema.Int;
|
|
669
|
+
}>;
|
|
670
|
+
readonly success: typeof ActivitySearchResult;
|
|
671
|
+
readonly failure: typeof ActivityUnavailable;
|
|
672
|
+
readonly failureMode: "error";
|
|
673
|
+
}, ActivityCatalog>;
|
|
674
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
675
|
+
readonly parameters: Schema.Struct<{
|
|
676
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
677
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
678
|
+
readonly departOn: Schema.String;
|
|
679
|
+
readonly travelers: Schema.Int;
|
|
680
|
+
}>;
|
|
681
|
+
readonly success: typeof FlightOption;
|
|
682
|
+
readonly failure: typeof FlightUnavailable;
|
|
683
|
+
readonly failureMode: "error";
|
|
684
|
+
}, FlightCatalog>;
|
|
685
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
686
|
+
readonly parameters: Schema.Struct<{
|
|
687
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
688
|
+
readonly departOn: Schema.String;
|
|
689
|
+
readonly nights: Schema.Int;
|
|
690
|
+
readonly travelers: Schema.Int;
|
|
691
|
+
}>;
|
|
692
|
+
readonly success: typeof LodgingOption;
|
|
693
|
+
readonly failure: typeof LodgingUnavailable;
|
|
694
|
+
readonly failureMode: "error";
|
|
695
|
+
}, LodgingCatalog>;
|
|
696
|
+
}>, undefined, undefined, undefined> & {
|
|
697
|
+
readonly id: import("effect/Brand").Brand<"@effect-agent/core/AgentId"> & "travel-planner-phase-4";
|
|
698
|
+
}, Model.Model<"scripted", import("effect/unstable/ai/LanguageModel").LanguageModel | ScriptedModel, never>>;
|
|
699
|
+
/**
|
|
700
|
+
* Everything a durable worker needs beyond the runtime stack, reusing the deterministic P1
|
|
701
|
+
* travel-service Layers. The durable coordinator supplies its own deterministic `IdGenerator`,
|
|
702
|
+
* so this Layer deliberately provides none.
|
|
703
|
+
*/
|
|
704
|
+
declare const phase4TravelPlannerWorkerLayer: Layer.Layer<ActivityCatalog | FlightCatalog | LodgingCatalog | TravelGuidance | Tool.HandlersFor<{
|
|
705
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
706
|
+
readonly parameters: Schema.Struct<{
|
|
707
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
708
|
+
readonly departOn: Schema.String;
|
|
709
|
+
readonly nights: Schema.Int;
|
|
710
|
+
readonly travelers: Schema.Int;
|
|
711
|
+
}>;
|
|
712
|
+
readonly success: typeof ActivitySearchResult;
|
|
713
|
+
readonly failure: typeof ActivityUnavailable;
|
|
714
|
+
readonly failureMode: "error";
|
|
715
|
+
}, ActivityCatalog>;
|
|
716
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
717
|
+
readonly parameters: Schema.Struct<{
|
|
718
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
719
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
720
|
+
readonly departOn: Schema.String;
|
|
721
|
+
readonly travelers: Schema.Int;
|
|
722
|
+
}>;
|
|
723
|
+
readonly success: typeof FlightOption;
|
|
724
|
+
readonly failure: typeof FlightUnavailable;
|
|
725
|
+
readonly failureMode: "error";
|
|
726
|
+
}, FlightCatalog>;
|
|
727
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
728
|
+
readonly parameters: Schema.Struct<{
|
|
729
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
730
|
+
readonly departOn: Schema.String;
|
|
731
|
+
readonly nights: Schema.Int;
|
|
732
|
+
readonly travelers: Schema.Int;
|
|
733
|
+
}>;
|
|
734
|
+
readonly success: typeof LodgingOption;
|
|
735
|
+
readonly failure: typeof LodgingUnavailable;
|
|
736
|
+
readonly failureMode: "error";
|
|
737
|
+
}, LodgingCatalog>;
|
|
738
|
+
}>, never, never>;
|
|
739
|
+
declare const TravelPlannerDurableEvidenceError_base: Schema.Class<TravelPlannerDurableEvidenceError, Schema.TaggedStruct<"TravelPlannerDurableEvidenceError", {
|
|
740
|
+
readonly message: Schema.String;
|
|
741
|
+
}>, import("effect/Cause").YieldableError>;
|
|
742
|
+
declare class TravelPlannerDurableEvidenceError extends TravelPlannerDurableEvidenceError_base {}
|
|
743
|
+
/**
|
|
744
|
+
* Decode the completed itinerary from the canonical `SubmissionSettled` record. Canonical history
|
|
745
|
+
* is the outcome authority (DUR-015): the settled result — not any ledger cache — must decode
|
|
746
|
+
* through the trip output schema.
|
|
747
|
+
*/
|
|
748
|
+
declare const travelPlanFromDurableSettlement: (records: readonly CanonicalRecordEnvelope[]) => Effect.Effect<TravelPlan, TravelPlannerDurableEvidenceError, never>;
|
|
749
|
+
/**
|
|
750
|
+
* Project canonical evidence into a Submission-identity-independent comparable form: batch
|
|
751
|
+
* identity, canonical sequence, and the full encoded record, with the ledger-minted
|
|
752
|
+
* `submissionId`/`receiptId` (and every identity derived from them: run, turn, batch, record,
|
|
753
|
+
* and settlement ids) replaced by stable placeholders. Two Threads whose normalized
|
|
754
|
+
* evidence is equal took byte-equivalent canonical histories, so restart-equivalence can compare
|
|
755
|
+
* a recovered run against an uninterrupted control run on a separate database.
|
|
756
|
+
*/
|
|
757
|
+
declare const normalizeDurableTravelPlannerEvidence: (records: readonly CanonicalRecordEnvelope[], receipt: Receipt) => Effect.Effect<Schema.Json, TravelPlannerDurableEvidenceError, never>;
|
|
758
|
+
//#endregion
|
|
759
|
+
//#region src/fixtures/travel-planner/phase5.d.ts
|
|
760
|
+
declare const phase5TravelPlannerDeploymentId: string & import("effect/Brand").Brand<"@effect-agent/thread/DeploymentId">;
|
|
761
|
+
declare const phase5TravelPlannerProducerId: string & import("effect/Brand").Brand<"@effect-agent/thread/ProducerId">;
|
|
762
|
+
declare const phase5TravelPlannerPrincipal: string & import("effect/Brand").Brand<"@effect-agent/thread/Principal">;
|
|
763
|
+
/** Redacted, deterministic definition identities for the current fixture version. */
|
|
764
|
+
declare const phase5TravelPlannerDefinitionDigests: DefinitionDigests;
|
|
765
|
+
/** Durable admission options for one Travel Planner Submission on one trip lane. */
|
|
766
|
+
declare const phase5TravelPlannerSubmitOptions: (threadId: ThreadId, idempotencyKey: IdempotencyKey) => DurableSubmitOptions;
|
|
767
|
+
declare const TravelerRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/TravelerRef">;
|
|
768
|
+
type TravelerRef = typeof TravelerRef.Type;
|
|
769
|
+
declare const FlightBookingRequest_base: Schema.Class<FlightBookingRequest, Schema.Struct<{
|
|
770
|
+
readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
|
|
771
|
+
readonly travelerRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/TravelerRef">;
|
|
772
|
+
readonly departOn: Schema.String;
|
|
773
|
+
}>, {}>;
|
|
774
|
+
/**
|
|
775
|
+
* Class-shaped booking parameters with branded fields: since the P5 engine fix, official history
|
|
776
|
+
* carries Schema-ENCODED Tool-call parameters, so class-typed parameter codecs persist
|
|
777
|
+
* canonically end-to-end (the P4 Struct workaround is gone for new Tools).
|
|
778
|
+
*/
|
|
779
|
+
declare class FlightBookingRequest extends FlightBookingRequest_base {}
|
|
780
|
+
declare const SupplierBookingConfirmation_base: Schema.Class<SupplierBookingConfirmation, Schema.Struct<{
|
|
781
|
+
readonly bookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
|
|
782
|
+
readonly status: Schema.Literal<"confirmed">;
|
|
783
|
+
readonly detail: Schema.String;
|
|
784
|
+
}>, {}>;
|
|
785
|
+
declare class SupplierBookingConfirmation extends SupplierBookingConfirmation_base {}
|
|
786
|
+
declare const CancelBookingRequest_base: Schema.Class<CancelBookingRequest, Schema.Struct<{
|
|
787
|
+
readonly bookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
|
|
788
|
+
readonly travelerRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/TravelerRef">;
|
|
789
|
+
}>, {}>;
|
|
790
|
+
declare class CancelBookingRequest extends CancelBookingRequest_base {}
|
|
791
|
+
declare const CancellationConfirmation_base: Schema.Class<CancellationConfirmation, Schema.Struct<{
|
|
792
|
+
readonly bookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
|
|
793
|
+
readonly status: Schema.Literal<"cancelled">;
|
|
794
|
+
}>, {}>;
|
|
795
|
+
declare class CancellationConfirmation extends CancellationConfirmation_base {}
|
|
796
|
+
declare const ItineraryBookingRequest_base: Schema.Class<ItineraryBookingRequest, Schema.Struct<{
|
|
797
|
+
readonly quoteId: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/QuoteId">;
|
|
798
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
799
|
+
readonly nights: Schema.Int;
|
|
800
|
+
readonly travelerRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/TravelerRef">;
|
|
801
|
+
}>, {}>;
|
|
802
|
+
declare class ItineraryBookingRequest extends ItineraryBookingRequest_base {}
|
|
803
|
+
declare const ItineraryConfirmation_base: Schema.Class<ItineraryConfirmation, Schema.Struct<{
|
|
804
|
+
readonly flightBookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
|
|
805
|
+
readonly lodgingBookingRef: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">;
|
|
806
|
+
readonly confirmationCode: Schema.String;
|
|
807
|
+
}>, {}>;
|
|
808
|
+
declare class ItineraryConfirmation extends ItineraryConfirmation_base {}
|
|
809
|
+
declare const TravelBookingReport_base: Schema.Class<TravelBookingReport, Schema.Struct<{
|
|
810
|
+
readonly summary: Schema.String;
|
|
811
|
+
readonly bookingRefs: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/BookingRef">>;
|
|
812
|
+
}>, {}>;
|
|
813
|
+
/** The P5 Run output: a booked (or explicitly not-booked) trip report. */
|
|
814
|
+
declare class TravelBookingReport extends TravelBookingReport_base {}
|
|
815
|
+
/**
|
|
816
|
+
* Supplier idempotency-key derivations. The handler owns key derivation (the `idempotent` and
|
|
817
|
+
* `uncertain` execution classes carry no key), and the reconciler MUST use the same derivations
|
|
818
|
+
* to query external truth — both sides are exported so they cannot drift.
|
|
819
|
+
*/
|
|
820
|
+
declare const bookFlightIdempotencyKey: (toolCallId: string) => string;
|
|
821
|
+
declare const itineraryStepIdempotencyKey: (toolCallId: string, stepName: string) => string;
|
|
822
|
+
/**
|
|
823
|
+
* Approval-gated supplier booking, explicitly `uncertain`: a crash after the call may have
|
|
824
|
+
* mutated supplier state without a recorded outcome, so recovery must reconcile or stop at an
|
|
825
|
+
* Unknown Outcome — never replay automatically (DUR-009, ADR-0004).
|
|
826
|
+
*/
|
|
827
|
+
declare const BookFlight: Tool.Tool<"book_flight", {
|
|
828
|
+
readonly parameters: typeof FlightBookingRequest;
|
|
829
|
+
readonly success: typeof SupplierBookingConfirmation;
|
|
830
|
+
readonly failure: typeof SupplierUnavailable;
|
|
831
|
+
readonly failureMode: "error";
|
|
832
|
+
}, SupplierBookingDesk>;
|
|
833
|
+
/**
|
|
834
|
+
* Approval-gated cancellation, annotated `idempotent`: the DECLARED external contract is that
|
|
835
|
+
* cancellation is idempotent by `bookingRef` (the supplier desk enforces it), so recovery may
|
|
836
|
+
* re-execute a prepared-but-unsettled cancel without reconciliation proof. Repeats stay
|
|
837
|
+
* observable in the supplier call counters — the annotation never claims exactly-once execution.
|
|
838
|
+
*/
|
|
839
|
+
declare const CancelBooking: Tool.Tool<"cancel_booking", {
|
|
840
|
+
readonly parameters: typeof CancelBookingRequest;
|
|
841
|
+
readonly success: typeof CancellationConfirmation;
|
|
842
|
+
readonly failure: typeof SupplierUnavailable;
|
|
843
|
+
readonly failureMode: "error";
|
|
844
|
+
}, SupplierBookingDesk>;
|
|
845
|
+
/**
|
|
846
|
+
* The Durable Tool: declaring `DurableStep` in `dependencies` is what makes it durable
|
|
847
|
+
* (GLOSSARY.md). Its handler divides supplier mutation into three named Steps — `reserve-flight`,
|
|
848
|
+
* `reserve-lodging`, `issue-confirmation` — each deriving its supplier idempotency key from
|
|
849
|
+
* `(toolCallId, stepName)`, so re-entry after interruption replays recorded Step results and the
|
|
850
|
+
* supplier dedupes any honestly-repeated call. The Tool itself carries no execution-class
|
|
851
|
+
* annotation: it stays fail-closed `uncertain`, and `TravelSupplierReconcilerLayer` proves
|
|
852
|
+
* re-entry safe from the keyed-Step construction instead.
|
|
853
|
+
*/
|
|
854
|
+
declare const BookItinerary: Tool.Tool<"book_itinerary", {
|
|
855
|
+
readonly parameters: typeof ItineraryBookingRequest;
|
|
856
|
+
readonly success: typeof ItineraryConfirmation;
|
|
857
|
+
readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
|
|
858
|
+
readonly failureMode: "error";
|
|
859
|
+
}, DurableStep | SupplierBookingDesk>;
|
|
860
|
+
declare const TravelPlannerPhase5Toolkit: Toolkit.Toolkit<{
|
|
861
|
+
readonly book_flight: Tool.Tool<"book_flight", {
|
|
862
|
+
readonly parameters: typeof FlightBookingRequest;
|
|
863
|
+
readonly success: typeof SupplierBookingConfirmation;
|
|
864
|
+
readonly failure: typeof SupplierUnavailable;
|
|
865
|
+
readonly failureMode: "error";
|
|
866
|
+
}, SupplierBookingDesk>;
|
|
867
|
+
readonly book_itinerary: Tool.Tool<"book_itinerary", {
|
|
868
|
+
readonly parameters: typeof ItineraryBookingRequest;
|
|
869
|
+
readonly success: typeof ItineraryConfirmation;
|
|
870
|
+
readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
|
|
871
|
+
readonly failureMode: "error";
|
|
872
|
+
}, DurableStep | SupplierBookingDesk>;
|
|
873
|
+
readonly cancel_booking: Tool.Tool<"cancel_booking", {
|
|
874
|
+
readonly parameters: typeof CancelBookingRequest;
|
|
875
|
+
readonly success: typeof CancellationConfirmation;
|
|
876
|
+
readonly failure: typeof SupplierUnavailable;
|
|
877
|
+
readonly failureMode: "error";
|
|
878
|
+
}, SupplierBookingDesk>;
|
|
879
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
880
|
+
readonly parameters: Schema.Struct<{
|
|
881
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
882
|
+
readonly departOn: Schema.String;
|
|
883
|
+
readonly nights: Schema.Int;
|
|
884
|
+
readonly travelers: Schema.Int;
|
|
885
|
+
}>;
|
|
886
|
+
readonly success: typeof ActivitySearchResult;
|
|
887
|
+
readonly failure: typeof ActivityUnavailable;
|
|
888
|
+
readonly failureMode: "error";
|
|
889
|
+
}, ActivityCatalog>;
|
|
890
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
891
|
+
readonly parameters: Schema.Struct<{
|
|
892
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
893
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
894
|
+
readonly departOn: Schema.String;
|
|
895
|
+
readonly travelers: Schema.Int;
|
|
896
|
+
}>;
|
|
897
|
+
readonly success: typeof FlightOption;
|
|
898
|
+
readonly failure: typeof FlightUnavailable;
|
|
899
|
+
readonly failureMode: "error";
|
|
900
|
+
}, FlightCatalog>;
|
|
901
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
902
|
+
readonly parameters: Schema.Struct<{
|
|
903
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
904
|
+
readonly departOn: Schema.String;
|
|
905
|
+
readonly nights: Schema.Int;
|
|
906
|
+
readonly travelers: Schema.Int;
|
|
907
|
+
}>;
|
|
908
|
+
readonly success: typeof LodgingOption;
|
|
909
|
+
readonly failure: typeof LodgingUnavailable;
|
|
910
|
+
readonly failureMode: "error";
|
|
911
|
+
}, LodgingCatalog>;
|
|
912
|
+
}>;
|
|
913
|
+
declare const TravelPlannerPhase5ToolkitLayer: Layer.Layer<Tool.HandlersFor<{
|
|
914
|
+
readonly book_flight: Tool.Tool<"book_flight", {
|
|
915
|
+
readonly parameters: typeof FlightBookingRequest;
|
|
916
|
+
readonly success: typeof SupplierBookingConfirmation;
|
|
917
|
+
readonly failure: typeof SupplierUnavailable;
|
|
918
|
+
readonly failureMode: "error";
|
|
919
|
+
}, SupplierBookingDesk>;
|
|
920
|
+
readonly book_itinerary: Tool.Tool<"book_itinerary", {
|
|
921
|
+
readonly parameters: typeof ItineraryBookingRequest;
|
|
922
|
+
readonly success: typeof ItineraryConfirmation;
|
|
923
|
+
readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
|
|
924
|
+
readonly failureMode: "error";
|
|
925
|
+
}, DurableStep | SupplierBookingDesk>;
|
|
926
|
+
readonly cancel_booking: Tool.Tool<"cancel_booking", {
|
|
927
|
+
readonly parameters: typeof CancelBookingRequest;
|
|
928
|
+
readonly success: typeof CancellationConfirmation;
|
|
929
|
+
readonly failure: typeof SupplierUnavailable;
|
|
930
|
+
readonly failureMode: "error";
|
|
931
|
+
}, SupplierBookingDesk>;
|
|
932
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
933
|
+
readonly parameters: Schema.Struct<{
|
|
934
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
935
|
+
readonly departOn: Schema.String;
|
|
936
|
+
readonly nights: Schema.Int;
|
|
937
|
+
readonly travelers: Schema.Int;
|
|
938
|
+
}>;
|
|
939
|
+
readonly success: typeof ActivitySearchResult;
|
|
940
|
+
readonly failure: typeof ActivityUnavailable;
|
|
941
|
+
readonly failureMode: "error";
|
|
942
|
+
}, ActivityCatalog>;
|
|
943
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
944
|
+
readonly parameters: Schema.Struct<{
|
|
945
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
946
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
947
|
+
readonly departOn: Schema.String;
|
|
948
|
+
readonly travelers: Schema.Int;
|
|
949
|
+
}>;
|
|
950
|
+
readonly success: typeof FlightOption;
|
|
951
|
+
readonly failure: typeof FlightUnavailable;
|
|
952
|
+
readonly failureMode: "error";
|
|
953
|
+
}, FlightCatalog>;
|
|
954
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
955
|
+
readonly parameters: Schema.Struct<{
|
|
956
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
957
|
+
readonly departOn: Schema.String;
|
|
958
|
+
readonly nights: Schema.Int;
|
|
959
|
+
readonly travelers: Schema.Int;
|
|
960
|
+
}>;
|
|
961
|
+
readonly success: typeof LodgingOption;
|
|
962
|
+
readonly failure: typeof LodgingUnavailable;
|
|
963
|
+
readonly failureMode: "error";
|
|
964
|
+
}, LodgingCatalog>;
|
|
965
|
+
}>, never, never>;
|
|
966
|
+
/**
|
|
967
|
+
* The application reconciliation policy (durability §10): a claim about EXTERNAL truth, queried
|
|
968
|
+
* from the supplier desk by the same idempotency-key derivations the handlers use.
|
|
969
|
+
*
|
|
970
|
+
* - `book_flight`: a confirmed booking under `book-flight:{toolCallId}` is recovered supplier
|
|
971
|
+
* truth — `CompletedWithResult` settles it canonically without executing anything. Absence is
|
|
972
|
+
* NOT proof the call never started (a real supplier write could be in flight), so the desk
|
|
973
|
+
* answer stays fail-closed `Uncertain`.
|
|
974
|
+
* - `book_itinerary`: every external mutation inside is a named Step whose supplier idempotency
|
|
975
|
+
* key derives from `(toolCallId, stepName)`, so re-entry is provably safe by construction —
|
|
976
|
+
* `SafeToRetry`. Committed Steps replay from their records; repeated calls dedupe at the desk.
|
|
977
|
+
* - `cancel_booking`: declared `idempotent`, so the coordinator re-executes without consulting
|
|
978
|
+
* this policy; if ever asked, the bookingRef contract makes `SafeToRetry` honest.
|
|
979
|
+
* - anything else: fail-closed `Uncertain` (AGENTS rule 11).
|
|
980
|
+
*/
|
|
981
|
+
declare const TravelSupplierReconcilerLayer: Layer.Layer<ToolReconciler, never, SupplierBookingDesk>;
|
|
982
|
+
/**
|
|
983
|
+
* The cumulative Travel Planner, Phase 5: the durable planner now performs consequential
|
|
984
|
+
* supplier mutation under the full uncertainty protocol — approval-gated uncertain booking,
|
|
985
|
+
* idempotent-by-contract cancellation, and one Durable Tool whose Steps carry supplier
|
|
986
|
+
* idempotency keys.
|
|
987
|
+
*/
|
|
988
|
+
declare const TravelPlannerPhase5: Agent.Definition<typeof TripRequest, typeof TravelBookingReport, string, Toolkit.Toolkit<{
|
|
989
|
+
readonly book_flight: Tool.Tool<"book_flight", {
|
|
990
|
+
readonly parameters: typeof FlightBookingRequest;
|
|
991
|
+
readonly success: typeof SupplierBookingConfirmation;
|
|
992
|
+
readonly failure: typeof SupplierUnavailable;
|
|
993
|
+
readonly failureMode: "error";
|
|
994
|
+
}, SupplierBookingDesk>;
|
|
995
|
+
readonly book_itinerary: Tool.Tool<"book_itinerary", {
|
|
996
|
+
readonly parameters: typeof ItineraryBookingRequest;
|
|
997
|
+
readonly success: typeof ItineraryConfirmation;
|
|
998
|
+
readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
|
|
999
|
+
readonly failureMode: "error";
|
|
1000
|
+
}, DurableStep | SupplierBookingDesk>;
|
|
1001
|
+
readonly cancel_booking: Tool.Tool<"cancel_booking", {
|
|
1002
|
+
readonly parameters: typeof CancelBookingRequest;
|
|
1003
|
+
readonly success: typeof CancellationConfirmation;
|
|
1004
|
+
readonly failure: typeof SupplierUnavailable;
|
|
1005
|
+
readonly failureMode: "error";
|
|
1006
|
+
}, SupplierBookingDesk>;
|
|
1007
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
1008
|
+
readonly parameters: Schema.Struct<{
|
|
1009
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1010
|
+
readonly departOn: Schema.String;
|
|
1011
|
+
readonly nights: Schema.Int;
|
|
1012
|
+
readonly travelers: Schema.Int;
|
|
1013
|
+
}>;
|
|
1014
|
+
readonly success: typeof ActivitySearchResult;
|
|
1015
|
+
readonly failure: typeof ActivityUnavailable;
|
|
1016
|
+
readonly failureMode: "error";
|
|
1017
|
+
}, ActivityCatalog>;
|
|
1018
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
1019
|
+
readonly parameters: Schema.Struct<{
|
|
1020
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1021
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1022
|
+
readonly departOn: Schema.String;
|
|
1023
|
+
readonly travelers: Schema.Int;
|
|
1024
|
+
}>;
|
|
1025
|
+
readonly success: typeof FlightOption;
|
|
1026
|
+
readonly failure: typeof FlightUnavailable;
|
|
1027
|
+
readonly failureMode: "error";
|
|
1028
|
+
}, FlightCatalog>;
|
|
1029
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
1030
|
+
readonly parameters: Schema.Struct<{
|
|
1031
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1032
|
+
readonly departOn: Schema.String;
|
|
1033
|
+
readonly nights: Schema.Int;
|
|
1034
|
+
readonly travelers: Schema.Int;
|
|
1035
|
+
}>;
|
|
1036
|
+
readonly success: typeof LodgingOption;
|
|
1037
|
+
readonly failure: typeof LodgingUnavailable;
|
|
1038
|
+
readonly failureMode: "error";
|
|
1039
|
+
}, LodgingCatalog>;
|
|
1040
|
+
}>, undefined, undefined, undefined> & {
|
|
1041
|
+
readonly id: import("effect/Brand").Brand<"@effect-agent/core/AgentId"> & "travel-planner-phase-5";
|
|
1042
|
+
};
|
|
1043
|
+
declare const TravelPlannerBookingEvidenceError_base: Schema.Class<TravelPlannerBookingEvidenceError, Schema.TaggedStruct<"TravelPlannerBookingEvidenceError", {
|
|
1044
|
+
readonly message: Schema.String;
|
|
1045
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1046
|
+
declare class TravelPlannerBookingEvidenceError extends TravelPlannerBookingEvidenceError_base {}
|
|
1047
|
+
/**
|
|
1048
|
+
* Never-fabricate assertion (ROADMAP P5 exit gate): every successfully settled booking result in
|
|
1049
|
+
* canonical history must reference a booking that actually exists in the supplier store. A
|
|
1050
|
+
* `ToolCallSettled` whose bookingRef the supplier cannot produce would be a fabricated result —
|
|
1051
|
+
* the exact lie the uncertainty protocol exists to prevent.
|
|
1052
|
+
*/
|
|
1053
|
+
declare const assertSettledBookingsExistAtSupplier: (records: readonly CanonicalRecordEnvelope[]) => Effect.Effect<void, TravelPlannerBookingEvidenceError, SupplierBookingDesk>;
|
|
1054
|
+
/**
|
|
1055
|
+
* Everything a durable P5 worker needs beyond the runtime stack and the supplier desk: the
|
|
1056
|
+
* booking toolkit plus the deterministic P1 travel-service Layers. `SupplierBookingDesk` is
|
|
1057
|
+
* deliberately NOT provided here — tests own the desk's lifetime so its counters, bookings, and
|
|
1058
|
+
* crash windows survive Tool-Layer rebuilds across Attempts.
|
|
1059
|
+
*/
|
|
1060
|
+
declare const phase5TravelPlannerWorkerLayer: Layer.Layer<ActivityCatalog | FlightCatalog | LodgingCatalog | Tool.HandlersFor<{
|
|
1061
|
+
readonly book_flight: Tool.Tool<"book_flight", {
|
|
1062
|
+
readonly parameters: typeof FlightBookingRequest;
|
|
1063
|
+
readonly success: typeof SupplierBookingConfirmation;
|
|
1064
|
+
readonly failure: typeof SupplierUnavailable;
|
|
1065
|
+
readonly failureMode: "error";
|
|
1066
|
+
}, SupplierBookingDesk>;
|
|
1067
|
+
readonly book_itinerary: Tool.Tool<"book_itinerary", {
|
|
1068
|
+
readonly parameters: typeof ItineraryBookingRequest;
|
|
1069
|
+
readonly success: typeof ItineraryConfirmation;
|
|
1070
|
+
readonly failure: Schema.Union<readonly [typeof SupplierUnavailable, typeof DurableStepError]>;
|
|
1071
|
+
readonly failureMode: "error";
|
|
1072
|
+
}, DurableStep | SupplierBookingDesk>;
|
|
1073
|
+
readonly cancel_booking: Tool.Tool<"cancel_booking", {
|
|
1074
|
+
readonly parameters: typeof CancelBookingRequest;
|
|
1075
|
+
readonly success: typeof CancellationConfirmation;
|
|
1076
|
+
readonly failure: typeof SupplierUnavailable;
|
|
1077
|
+
readonly failureMode: "error";
|
|
1078
|
+
}, SupplierBookingDesk>;
|
|
1079
|
+
readonly search_activities: Tool.Tool<"search_activities", {
|
|
1080
|
+
readonly parameters: Schema.Struct<{
|
|
1081
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1082
|
+
readonly departOn: Schema.String;
|
|
1083
|
+
readonly nights: Schema.Int;
|
|
1084
|
+
readonly travelers: Schema.Int;
|
|
1085
|
+
}>;
|
|
1086
|
+
readonly success: typeof ActivitySearchResult;
|
|
1087
|
+
readonly failure: typeof ActivityUnavailable;
|
|
1088
|
+
readonly failureMode: "error";
|
|
1089
|
+
}, ActivityCatalog>;
|
|
1090
|
+
readonly search_flights: Tool.Tool<"search_flights", {
|
|
1091
|
+
readonly parameters: Schema.Struct<{
|
|
1092
|
+
readonly origin: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1093
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1094
|
+
readonly departOn: Schema.String;
|
|
1095
|
+
readonly travelers: Schema.Int;
|
|
1096
|
+
}>;
|
|
1097
|
+
readonly success: typeof FlightOption;
|
|
1098
|
+
readonly failure: typeof FlightUnavailable;
|
|
1099
|
+
readonly failureMode: "error";
|
|
1100
|
+
}, FlightCatalog>;
|
|
1101
|
+
readonly search_lodging: Tool.Tool<"search_lodging", {
|
|
1102
|
+
readonly parameters: Schema.Struct<{
|
|
1103
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1104
|
+
readonly departOn: Schema.String;
|
|
1105
|
+
readonly nights: Schema.Int;
|
|
1106
|
+
readonly travelers: Schema.Int;
|
|
1107
|
+
}>;
|
|
1108
|
+
readonly success: typeof LodgingOption;
|
|
1109
|
+
readonly failure: typeof LodgingUnavailable;
|
|
1110
|
+
readonly failureMode: "error";
|
|
1111
|
+
}, LodgingCatalog>;
|
|
1112
|
+
}>, never, never>;
|
|
1113
|
+
//#endregion
|
|
1114
|
+
//#region src/fixtures/travel-planner/subagents.d.ts
|
|
1115
|
+
declare const DestinationQuery_base: Schema.Class<DestinationQuery, Schema.Struct<{
|
|
1116
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1117
|
+
}>, {}>;
|
|
1118
|
+
declare class DestinationQuery extends DestinationQuery_base {}
|
|
1119
|
+
declare const DestinationFacts_base: Schema.Class<DestinationFacts, Schema.Struct<{
|
|
1120
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1121
|
+
readonly highlights: Schema.$Array<Schema.String>;
|
|
1122
|
+
readonly advisory: Schema.NonEmptyString;
|
|
1123
|
+
}>, {}>;
|
|
1124
|
+
declare class DestinationFacts extends DestinationFacts_base {}
|
|
1125
|
+
declare const DestinationGuideUnavailable_base: Schema.Class<DestinationGuideUnavailable, Schema.TaggedStruct<"DestinationGuideUnavailable", {
|
|
1126
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1127
|
+
readonly message: Schema.String;
|
|
1128
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1129
|
+
declare class DestinationGuideUnavailable extends DestinationGuideUnavailable_base {}
|
|
1130
|
+
declare const DestinationGuide_base: Context.ServiceClass<DestinationGuide, "@effect-agent/testing/travel-planner/DestinationGuide", {
|
|
1131
|
+
readonly lookup: (query: DestinationQuery) => Effect.Effect<DestinationFacts, DestinationGuideUnavailable>;
|
|
1132
|
+
}>;
|
|
1133
|
+
declare class DestinationGuide extends DestinationGuide_base {}
|
|
1134
|
+
declare const LookupDestination: Tool.Tool<"lookup_destination", {
|
|
1135
|
+
readonly parameters: typeof DestinationQuery;
|
|
1136
|
+
readonly success: typeof DestinationFacts;
|
|
1137
|
+
readonly failure: typeof DestinationGuideUnavailable;
|
|
1138
|
+
readonly failureMode: "error";
|
|
1139
|
+
}, DestinationGuide>;
|
|
1140
|
+
declare const DestinationResearcherToolkit: Toolkit.Toolkit<{
|
|
1141
|
+
readonly lookup_destination: Tool.Tool<"lookup_destination", {
|
|
1142
|
+
readonly parameters: typeof DestinationQuery;
|
|
1143
|
+
readonly success: typeof DestinationFacts;
|
|
1144
|
+
readonly failure: typeof DestinationGuideUnavailable;
|
|
1145
|
+
readonly failureMode: "error";
|
|
1146
|
+
}, DestinationGuide>;
|
|
1147
|
+
}>;
|
|
1148
|
+
declare const DestinationResearcherToolkitLayer: Layer.Layer<Tool.Handler<"lookup_destination">, never, never>;
|
|
1149
|
+
declare const DestinationBrief_base: Schema.Class<DestinationBrief, Schema.Struct<{
|
|
1150
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1151
|
+
readonly focus: Schema.NonEmptyString;
|
|
1152
|
+
}>, {}>;
|
|
1153
|
+
declare class DestinationBrief extends DestinationBrief_base {}
|
|
1154
|
+
declare const DestinationReport_base: Schema.Class<DestinationReport, Schema.Struct<{
|
|
1155
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1156
|
+
readonly highlights: Schema.$Array<Schema.String>;
|
|
1157
|
+
readonly advisory: Schema.NonEmptyString;
|
|
1158
|
+
}>, {}>;
|
|
1159
|
+
declare class DestinationReport extends DestinationReport_base {}
|
|
1160
|
+
declare const DestinationResearcher: Agent.Definition<typeof DestinationBrief, typeof DestinationReport, "Consult lookup_destination exactly once for the briefed airport, then return only a JSON destination report.", Toolkit.Toolkit<{
|
|
1161
|
+
readonly lookup_destination: Tool.Tool<"lookup_destination", {
|
|
1162
|
+
readonly parameters: typeof DestinationQuery;
|
|
1163
|
+
readonly success: typeof DestinationFacts;
|
|
1164
|
+
readonly failure: typeof DestinationGuideUnavailable;
|
|
1165
|
+
readonly failureMode: "error";
|
|
1166
|
+
}, DestinationGuide>;
|
|
1167
|
+
}>, undefined, undefined, undefined> & {
|
|
1168
|
+
readonly id: import("effect/Brand").Brand<"@effect-agent/core/AgentId"> & "destination-researcher";
|
|
1169
|
+
};
|
|
1170
|
+
/** Deterministic guide lookup shared by the default and test-local guide Layers. */
|
|
1171
|
+
declare const destinationLookup: (query: DestinationQuery) => Effect.Effect<DestinationFacts, DestinationGuideUnavailable>;
|
|
1172
|
+
/** The report the scripted researcher writes after consulting the guide. */
|
|
1173
|
+
declare const destinationReportFor: (destination: string) => DestinationReport;
|
|
1174
|
+
declare const encodedDestinationReport: (destination: string) => string;
|
|
1175
|
+
declare const DestinationGuideLayer: Layer.Layer<DestinationGuide, never, CatalogLifecycle>;
|
|
1176
|
+
/** Child-side construction requirements of the delegation handler Layer. */
|
|
1177
|
+
declare const DestinationResearchSupportLayer: Layer.Layer<DestinationGuide | Tool.Handler<"lookup_destination">, never, CatalogLifecycle>;
|
|
1178
|
+
declare const DestinationResearchRequest_base: Schema.Class<DestinationResearchRequest, Schema.Struct<{
|
|
1179
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1180
|
+
readonly focus: Schema.NonEmptyString;
|
|
1181
|
+
}>, {}>;
|
|
1182
|
+
declare class DestinationResearchRequest extends DestinationResearchRequest_base {}
|
|
1183
|
+
declare const DestinationResearchFindings_base: Schema.Class<DestinationResearchFindings, Schema.Struct<{
|
|
1184
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1185
|
+
readonly summary: Schema.NonEmptyString;
|
|
1186
|
+
}>, {}>;
|
|
1187
|
+
declare class DestinationResearchFindings extends DestinationResearchFindings_base {}
|
|
1188
|
+
declare const DestinationResearchFailed_base: Schema.Class<DestinationResearchFailed, Schema.TaggedStruct<"DestinationResearchFailed", {
|
|
1189
|
+
readonly childErrorTag: Schema.NonEmptyString;
|
|
1190
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1191
|
+
declare class DestinationResearchFailed extends DestinationResearchFailed_base {}
|
|
1192
|
+
declare const ResearchDispatchGate_base: Context.ServiceClass<ResearchDispatchGate, "@effect-agent/testing/travel-planner/ResearchDispatchGate", {
|
|
1193
|
+
readonly awaitDispatch: (destination: string) => Effect.Effect<void>;
|
|
1194
|
+
}>;
|
|
1195
|
+
/**
|
|
1196
|
+
* Deterministic delegation-admission choreography seam. `prepareInput` awaits
|
|
1197
|
+
* this gate before the handler reserves budget or spawns, so tests can order
|
|
1198
|
+
* concurrent delegation preflights without sleeps. It also keeps the
|
|
1199
|
+
* projection's construction requirements honestly visible in the handler
|
|
1200
|
+
* Layer's `R`. The open Layer never waits.
|
|
1201
|
+
*/
|
|
1202
|
+
declare class ResearchDispatchGate extends ResearchDispatchGate_base {
|
|
1203
|
+
static readonly layerOpen: Layer.Layer<ResearchDispatchGate, never, never>;
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Finite per-invocation bounds (SUB-009): each child may use two Turns and
|
|
1207
|
+
* one Tool Call; the parent Run may establish at most two children with at
|
|
1208
|
+
* most two running concurrently.
|
|
1209
|
+
*/
|
|
1210
|
+
declare const destinationResearchPolicy: SubagentPolicy;
|
|
1211
|
+
declare const destinationResearchDelegation: Subagent.SubagentDelegation<"delegate_destination_research", typeof DestinationBrief, typeof DestinationReport, "Consult lookup_destination exactly once for the briefed airport, then return only a JSON destination report.", {
|
|
1212
|
+
readonly lookup_destination: Tool.Tool<"lookup_destination", {
|
|
1213
|
+
readonly parameters: typeof DestinationQuery;
|
|
1214
|
+
readonly success: typeof DestinationFacts;
|
|
1215
|
+
readonly failure: typeof DestinationGuideUnavailable;
|
|
1216
|
+
readonly failureMode: "error";
|
|
1217
|
+
}, DestinationGuide>;
|
|
1218
|
+
}, typeof DestinationResearchRequest, typeof DestinationResearchFindings, typeof DestinationResearchFailed, ResearchDispatchGate, never, "error"> & {
|
|
1219
|
+
readonly target: Agent.Definition<typeof DestinationBrief, typeof DestinationReport, "Consult lookup_destination exactly once for the briefed airport, then return only a JSON destination report.", Toolkit.Toolkit<{
|
|
1220
|
+
readonly lookup_destination: Tool.Tool<"lookup_destination", {
|
|
1221
|
+
readonly parameters: typeof DestinationQuery;
|
|
1222
|
+
readonly success: typeof DestinationFacts;
|
|
1223
|
+
readonly failure: typeof DestinationGuideUnavailable;
|
|
1224
|
+
readonly failureMode: "error";
|
|
1225
|
+
}, DestinationGuide>;
|
|
1226
|
+
}>, undefined, undefined, undefined> & {
|
|
1227
|
+
readonly id: import("effect/Brand").Brand<"@effect-agent/core/AgentId"> & "destination-researcher";
|
|
1228
|
+
};
|
|
1229
|
+
};
|
|
1230
|
+
/** Total mapping from every expected child Run failure to the declared Tool failure (SUB-028). */
|
|
1231
|
+
declare const mapResearchChildFailure: (failure: {
|
|
1232
|
+
readonly _tag: string;
|
|
1233
|
+
}) => DestinationResearchFailed;
|
|
1234
|
+
/** Runtime wiring: pair the immutable delegation with one explicit child Binding. */
|
|
1235
|
+
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, Subagent.SubagentLayerRequirements<typeof DestinationBrief, typeof DestinationReport, string, {
|
|
1236
|
+
readonly lookup_destination: Tool.Tool<"lookup_destination", {
|
|
1237
|
+
readonly parameters: typeof DestinationQuery;
|
|
1238
|
+
readonly success: typeof DestinationFacts;
|
|
1239
|
+
readonly failure: typeof DestinationGuideUnavailable;
|
|
1240
|
+
readonly failureMode: "error";
|
|
1241
|
+
}, DestinationGuide>;
|
|
1242
|
+
}, Provider, ModelProvides, ModelRequires, ResearchDispatchGate, never, never, {
|
|
1243
|
+
readonly _tag: string;
|
|
1244
|
+
}, never, undefined, undefined, undefined>>;
|
|
1245
|
+
declare const ResearchMission_base: Schema.Class<ResearchMission, Schema.Struct<{
|
|
1246
|
+
readonly request: Schema.NonEmptyString;
|
|
1247
|
+
readonly candidates: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">>;
|
|
1248
|
+
}>, {}>;
|
|
1249
|
+
declare class ResearchMission extends ResearchMission_base {}
|
|
1250
|
+
declare const DestinationRecommendation_base: Schema.Class<DestinationRecommendation, Schema.Struct<{
|
|
1251
|
+
readonly destination: Schema.brand<Schema.NonEmptyString, "@effect-agent/testing/travel-planner/AirportCode">;
|
|
1252
|
+
readonly summary: Schema.NonEmptyString;
|
|
1253
|
+
}>, {}>;
|
|
1254
|
+
declare class DestinationRecommendation extends DestinationRecommendation_base {}
|
|
1255
|
+
declare const DestinationShortlist_base: Schema.Class<DestinationShortlist, Schema.Struct<{
|
|
1256
|
+
readonly recommendations: Schema.$Array<typeof DestinationRecommendation>;
|
|
1257
|
+
readonly nextAction: Schema.Literal<"review">;
|
|
1258
|
+
}>, {}>;
|
|
1259
|
+
declare class DestinationShortlist extends DestinationShortlist_base {}
|
|
1260
|
+
/** Parent-only transcript markers used to prove child context isolation (SUB-006/015). */
|
|
1261
|
+
declare const coordinatorConfidentialMarker = "coordinator-vault-7q42";
|
|
1262
|
+
declare const missionConfidentialMarker = "traveler-dossier-19f";
|
|
1263
|
+
declare const TravelCoordinatorToolkit: Toolkit.Toolkit<{
|
|
1264
|
+
readonly delegate_destination_research: Tool.Tool<"delegate_destination_research", {
|
|
1265
|
+
readonly parameters: typeof DestinationResearchRequest;
|
|
1266
|
+
readonly success: typeof DestinationResearchFindings;
|
|
1267
|
+
readonly failure: Subagent.SubagentToolFailure<typeof DestinationResearchFailed>;
|
|
1268
|
+
readonly failureMode: "error";
|
|
1269
|
+
}, import("effect-agent/agent-runtime").AgentSpawner | import("effect-agent/run-event-sink").RunEventSink | import("effect-agent/agent-runtime").SubagentDurability>;
|
|
1270
|
+
}>;
|
|
1271
|
+
declare const TravelCoordinator: Agent.Definition<typeof ResearchMission, typeof DestinationShortlist, string, Toolkit.Toolkit<{
|
|
1272
|
+
readonly delegate_destination_research: Tool.Tool<"delegate_destination_research", {
|
|
1273
|
+
readonly parameters: typeof DestinationResearchRequest;
|
|
1274
|
+
readonly success: typeof DestinationResearchFindings;
|
|
1275
|
+
readonly failure: Subagent.SubagentToolFailure<typeof DestinationResearchFailed>;
|
|
1276
|
+
readonly failureMode: "error";
|
|
1277
|
+
}, import("effect-agent/agent-runtime").AgentSpawner | import("effect-agent/run-event-sink").RunEventSink | import("effect-agent/agent-runtime").SubagentDurability>;
|
|
1278
|
+
}>, undefined, undefined, undefined> & {
|
|
1279
|
+
readonly id: import("effect/Brand").Brand<"@effect-agent/core/AgentId"> & "travel-coordinator";
|
|
1280
|
+
};
|
|
1281
|
+
declare const researchMission: ResearchMission;
|
|
1282
|
+
declare const expectedDestinationShortlist: DestinationShortlist;
|
|
1283
|
+
interface DestinationResearchCall {
|
|
1284
|
+
readonly id: string;
|
|
1285
|
+
readonly destination: string;
|
|
1286
|
+
readonly focus: string;
|
|
1287
|
+
}
|
|
1288
|
+
/** One coordinator Turn that declares the given delegation Tool Calls in order. */
|
|
1289
|
+
declare const coordinatorResearchTurn: (calls: ReadonlyArray<DestinationResearchCall>) => ScriptedTurnInput;
|
|
1290
|
+
/** The coordinator's final structured-output Turn. */
|
|
1291
|
+
declare const coordinatorShortlistTurn: (shortlist: DestinationShortlist) => ScriptedTurnInput;
|
|
1292
|
+
/** Static researcher script for single-child tests: one guide lookup, then the report. */
|
|
1293
|
+
declare const researcherHappyPathTurns: (destination: string) => readonly [ScriptedTurnInput, ScriptedTurnInput];
|
|
1294
|
+
/**
|
|
1295
|
+
* Deterministic controls for parallel researcher children whose completions
|
|
1296
|
+
* are released in a caller-selected order (ReverseCompletionToolkitLayer
|
|
1297
|
+
* pattern). This is intentionally a test fixture: it uses no clock or sleep.
|
|
1298
|
+
*/
|
|
1299
|
+
interface DestinationResearcherControls {
|
|
1300
|
+
/** Await the first model request of the child researching this destination. */
|
|
1301
|
+
readonly awaitStarted: (destination: string) => Effect.Effect<void>;
|
|
1302
|
+
/** Allow the child researching this destination to produce its final report. */
|
|
1303
|
+
readonly release: (destination: string) => Effect.Effect<void>;
|
|
1304
|
+
/** JSON-encoded first-Turn child prompts in arrival order (isolation evidence). */
|
|
1305
|
+
readonly prompts: Effect.Effect<ReadonlyArray<string>>;
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Build a deterministic researcher Model whose per-child behavior is keyed by
|
|
1309
|
+
* the destination named in the child's own prompt: Turn one records the
|
|
1310
|
+
* prompt, signals `started`, and calls the guide Tool; Turn two waits for the
|
|
1311
|
+
* caller's `release` before writing the report. Each child Run builds the
|
|
1312
|
+
* Model Layer inside its own scope, so one `CatalogLifecycle` acquisition and
|
|
1313
|
+
* finalization is observed per child — the same acquire/release counting the
|
|
1314
|
+
* catalog Layers use to prove interruption reaches every finalizer.
|
|
1315
|
+
*/
|
|
1316
|
+
declare const makeDestinationResearcherModel: (destinations: ReadonlyArray<string>) => Effect.Effect<{
|
|
1317
|
+
controls: DestinationResearcherControls;
|
|
1318
|
+
model: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
|
|
1319
|
+
}, never, CatalogLifecycle>;
|
|
1320
|
+
//#endregion
|
|
1321
|
+
//#region src/fixtures/travel-planner/phase6.d.ts
|
|
1322
|
+
/** Platform-neutral bindings and canonical evidence shared by Node and Cloudflare tests. */
|
|
1323
|
+
declare const phase6TravelPlannerDeploymentId: string & import("effect/Brand").Brand<"@effect-agent/thread/DeploymentId">;
|
|
1324
|
+
/** Producer prefix of the DC host; each Object mints `{prefix}:{threadId}`. */
|
|
1325
|
+
declare const phase6TravelPlannerProducerPrefix = "travel-planner-p6-producer";
|
|
1326
|
+
/** The full producer identity one DC Thread Object mints for itself. */
|
|
1327
|
+
declare const phase6TravelPlannerProducerId: (threadId: string) => ProducerId;
|
|
1328
|
+
/**
|
|
1329
|
+
* Registration digests of the GATED planner Binding: the same `TravelPlannerPhase4` definition
|
|
1330
|
+
* bound to a model whose first response waits on a test gate, addressable separately so the
|
|
1331
|
+
* admission-limits rows can hold a lane busy deterministically without touching the ordinary
|
|
1332
|
+
* planner registration.
|
|
1333
|
+
*/
|
|
1334
|
+
declare const phase6GatedPlannerDefinitionDigests: DefinitionDigests;
|
|
1335
|
+
/** The run-specific identities the cross-platform normal form scrubs. */
|
|
1336
|
+
interface CrossPlatformEvidenceIdentity {
|
|
1337
|
+
/** The Thread lane the evidence came from. */
|
|
1338
|
+
readonly threadId: string;
|
|
1339
|
+
/** The host's deployment identity (`DeploymentId` on every record envelope). */
|
|
1340
|
+
readonly deploymentId: string;
|
|
1341
|
+
/** The full producer identity of the run (DN: configured; DC: `{prefix}:{threadId}`). */
|
|
1342
|
+
readonly producerId: string;
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* The CROSS-PLATFORM extension of `normalizeDurableTravelPlannerEvidence` (D-P6-6): after the
|
|
1346
|
+
* base normalization replaces the two ledger-minted identities (which also normalizes the
|
|
1347
|
+
* DC-format routable `{uuidv7}:{threadId}` Submission identities and everything derived
|
|
1348
|
+
* from them), this form additionally scrubs everything that legitimately differs between a DN
|
|
1349
|
+
* process and a DC Durable Object over the same scenario:
|
|
1350
|
+
*
|
|
1351
|
+
* - `RepairAnnotated` audit records are dropped BEFORE normalization and the canonical
|
|
1352
|
+
* sequence is renumbered to the surviving order: repairs are DUR-013 evidence of recovery
|
|
1353
|
+
* itself, legally present in a recovered run and legally absent from an uninterrupted
|
|
1354
|
+
* control (on DC even a CLEAN run carries one, because every pass reconciles before it
|
|
1355
|
+
* claims, so the ready lane's input is applied through the recovery path). Canonical ORDER
|
|
1356
|
+
* is the durability §5 claim; sequence contiguity is a platform artifact of who appended;
|
|
1357
|
+
* - the Thread identity (DC lanes mint unique names per test run);
|
|
1358
|
+
* - the deployment and producer identities (host configuration, not canonical semantics);
|
|
1359
|
+
* - `createdAt` commit timestamps (wall clock);
|
|
1360
|
+
* - 64-hex digests (they hash RAW content that legally embeds run-specific identity, so they
|
|
1361
|
+
* can never be byte-equal across runs; chain integrity is asserted separately by the
|
|
1362
|
+
* adapters and the convergence helpers).
|
|
1363
|
+
*
|
|
1364
|
+
* Two runs whose cross-platform normalized evidence is byte-equal took canonically equivalent
|
|
1365
|
+
* histories — the exact sense in which durability §5 permits storage differences while
|
|
1366
|
+
* requiring the same observable ordering. Both the DN and DC suites assert equality against
|
|
1367
|
+
* the one committed `phase6TravelPlannerGoldenEvidence`, so DN ≡ DC transitively.
|
|
1368
|
+
*/
|
|
1369
|
+
declare const normalizeCrossPlatformTravelPlannerEvidence: (records: readonly CanonicalRecordEnvelope[], receipt: Receipt, identity: CrossPlatformEvidenceIdentity) => Effect.Effect<Schema.Json, TravelPlannerDurableEvidenceError, never>;
|
|
1370
|
+
/** The P1/P4 happy-path Tool Call identities (scenarios.ts, byte-stable since P1). */
|
|
1371
|
+
declare const phase6FlightCallId = "flight-call-1";
|
|
1372
|
+
declare const phase6LodgingCallId = "lodging-call-1";
|
|
1373
|
+
declare const phase6ActivityCallId = "activity-call-1";
|
|
1374
|
+
/**
|
|
1375
|
+
* The P4 planner script (`phase1HappyPathTurns`) as a prompt-aware model: once the search
|
|
1376
|
+
* batch is committed history, every later request gets the plan — identical parts, so the DC
|
|
1377
|
+
* canonical evidence is byte-equivalent to the DN ScriptedModel run after normalization.
|
|
1378
|
+
*/
|
|
1379
|
+
declare const phase6PlannerModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
|
|
1380
|
+
/** Release the gated planner model for one `[gate:...]` marker. */
|
|
1381
|
+
declare const releasePhase6PlannerGate: (marker: string) => void;
|
|
1382
|
+
/** Re-close one gate marker (fresh suites reuse markers safely). */
|
|
1383
|
+
declare const resetPhase6PlannerGate: (marker: string) => void;
|
|
1384
|
+
/** A trip whose request text carries the gate marker the gated model waits on. */
|
|
1385
|
+
declare const phase6GatedTrip: (marker: string) => TripRequest;
|
|
1386
|
+
/**
|
|
1387
|
+
* The SAME planner behavior with a hanging first response: the model waits on the released
|
|
1388
|
+
* gate before answering, keeping its lane durably busy so queue-depth admission limits can be
|
|
1389
|
+
* exercised deterministically.
|
|
1390
|
+
*/
|
|
1391
|
+
declare const phase6GatedPlannerModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
|
|
1392
|
+
/** The shared external supplier desk instance (module-level external truth). */
|
|
1393
|
+
declare const phase6SupplierDesk: {
|
|
1394
|
+
readonly book: (request: SupplierBookRequest) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;
|
|
1395
|
+
readonly cancel: (bookingRef: BookingRef) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;
|
|
1396
|
+
readonly lookup: (idempotencyKey: string) => Effect.Effect<import("effect/Option").Option<SupplierBookingRecord>>;
|
|
1397
|
+
readonly bookings: Effect.Effect<ReadonlyArray<SupplierBookingRecord>>;
|
|
1398
|
+
readonly callCount: (idempotencyKey: string) => Effect.Effect<number>;
|
|
1399
|
+
readonly holdAfterWrite: (idempotencyKey: string) => Effect.Effect<SupplierHoldControls>;
|
|
1400
|
+
};
|
|
1401
|
+
/** Layer handing the shared desk to Bindings, reconcilers, and assertions. */
|
|
1402
|
+
declare const phase6SupplierDeskLayer: Layer.Layer<SupplierBookingDesk>;
|
|
1403
|
+
/**
|
|
1404
|
+
* The REAL P5 supplier reconciliation policy over the shared desk, closed to no requirements
|
|
1405
|
+
* so a Thread Object can install it directly: `book_flight` recovers only from supplier
|
|
1406
|
+
* truth (absence stays fail-closed `Uncertain` → durable Unknown Outcome), keyed Steps are
|
|
1407
|
+
* provably re-enterable.
|
|
1408
|
+
*/
|
|
1409
|
+
declare const phase6SupplierReconcilerLayer: Layer.Layer<ToolReconciler>;
|
|
1410
|
+
/** The deterministic booking Tool Call identity for one `[case:...]` marker. */
|
|
1411
|
+
declare const phase6BookingToolCallId: (marker: string) => string;
|
|
1412
|
+
/** The bookingRef the supplier desk mints for one marker's approved booking. */
|
|
1413
|
+
declare const phase6BookingRef: (marker: string) => string;
|
|
1414
|
+
/** A trip whose request text carries the per-lane booking case marker. */
|
|
1415
|
+
declare const phase6BookingTrip: (marker: string) => TripRequest;
|
|
1416
|
+
/**
|
|
1417
|
+
* The P5 booking script as a prompt-aware model: request 1 declares the approval-gated
|
|
1418
|
+
* `book_flight` call (identity derived from the lane's `[case:...]` marker so supplier
|
|
1419
|
+
* idempotency keys never collide across lanes); once that call is committed history, the model
|
|
1420
|
+
* writes the booking report.
|
|
1421
|
+
*/
|
|
1422
|
+
declare const phase6BookingModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
|
|
1423
|
+
/** Deterministic guide-lookup handler executions across every incarnation. */
|
|
1424
|
+
declare const phase6GuideInvocationCount: () => number;
|
|
1425
|
+
/** The one-candidate research mission of the DC delegation slice. */
|
|
1426
|
+
declare const phase6ResearchMission: ResearchMission;
|
|
1427
|
+
declare const phase6ResearchDestination = "LHR";
|
|
1428
|
+
/** The child's scripted guide-lookup Tool Call identity. */
|
|
1429
|
+
declare const phase6ChildLookupCallId = "lookup-LHR";
|
|
1430
|
+
/** Prompt-aware S2 coordinator: delegation call first, shortlist once it is history. */
|
|
1431
|
+
declare const phase6CoordinatorModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
|
|
1432
|
+
/** Allow the researcher's FIRST model response to proceed (sticky across incarnations). */
|
|
1433
|
+
declare const releasePhase6ResearcherGate: () => void;
|
|
1434
|
+
/** Re-close the researcher gate (each delegation scenario starts gated). */
|
|
1435
|
+
declare const resetPhase6ResearcherGate: () => void;
|
|
1436
|
+
/**
|
|
1437
|
+
* Prompt-aware S2 researcher: guide lookup first, report once it is history. The FIRST
|
|
1438
|
+
* response waits on the researcher gate — a stand-in for real model latency. The child's own
|
|
1439
|
+
* Object may legally start its Attempt the moment its routed admission commits, while the
|
|
1440
|
+
* parent is still appending the lineage record into the child's log; a child whose first
|
|
1441
|
+
* batch commits during that window races the parent's append on one tail. Real models answer
|
|
1442
|
+
* in seconds, so establishment always wins that race in production; the gate reproduces that
|
|
1443
|
+
* timing deterministically instead of relying on scheduler luck.
|
|
1444
|
+
*/
|
|
1445
|
+
declare const phase6ResearcherModel: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
|
|
1446
|
+
/**
|
|
1447
|
+
* Every phase-6 Travel Planner worker Binding, captured with its requirement Contexts:
|
|
1448
|
+
* the P4 planner and its gated twin, the P5 booking agent over the
|
|
1449
|
+
* shared supplier desk, and the S2 coordinator/researcher pair wired through the durable
|
|
1450
|
+
* delegation Layer. A Thread Object registers these via its `bindings` option; the
|
|
1451
|
+
* capture runs once per incarnation, and everything stateful the assertions rely on (desk,
|
|
1452
|
+
* guide counter, gates) lives at module level so it survives incarnation loss.
|
|
1453
|
+
*/
|
|
1454
|
+
declare const makePhase6TravelPlannerBindings: Effect.Effect<ReadonlyArray<ResolvedBinding>>;
|
|
1455
|
+
/**
|
|
1456
|
+
* The committed cross-platform normalized canonical evidence of ONE uninterrupted Travel
|
|
1457
|
+
* Planner planning Submission (the P1/P4 happy path: canonical input, the search Turn, three
|
|
1458
|
+
* Tool settlements, the plan Turn, one Settlement). `travel-planner-phase6.test.ts` asserts
|
|
1459
|
+
* the DN run equals this value and `travel-planner-dc.test.ts` asserts the DC run equals this
|
|
1460
|
+
* value, so the two platforms' canonical outcomes are byte-equivalent transitively — the P6
|
|
1461
|
+
* exit gate "Travel Planner produces equivalent canonical outcomes under DN and DC".
|
|
1462
|
+
*
|
|
1463
|
+
* Regenerate ONLY when the Travel Planner scenario itself changes, by printing either suite's
|
|
1464
|
+
* normalized value; both suites must then agree on the new golden.
|
|
1465
|
+
*/
|
|
1466
|
+
declare const phase6TravelPlannerGoldenEvidence: Schema.Json;
|
|
1467
|
+
//#endregion
|
|
1468
|
+
//#region src/fixtures/travel-planner/phase7.d.ts
|
|
1469
|
+
/** Explicit opt-in switch for live integration tests. */
|
|
1470
|
+
declare const PHASE7_LIVE_GATE_ENV = "EFFECT_AGENT_LIVE";
|
|
1471
|
+
/** The credential required by the Travel Planner live-model tests. */
|
|
1472
|
+
declare const PHASE7_LIVE_CREDENTIAL_ENV = "OPENAI_API_KEY";
|
|
1473
|
+
/** Structural shape of an environment without importing Node types. */
|
|
1474
|
+
interface Phase7LiveGateEnvironment {
|
|
1475
|
+
readonly [name: string]: string | undefined;
|
|
1476
|
+
}
|
|
1477
|
+
/** Enable live tests only when both the opt-in flag and credential are present. */
|
|
1478
|
+
declare const phase7LiveProfileEnabled: (env: Phase7LiveGateEnvironment) => boolean;
|
|
1479
|
+
//#endregion
|
|
1480
|
+
//#region src/fixtures/travel-planner/scenarios.d.ts
|
|
1481
|
+
declare const phase1Trip: TripRequest;
|
|
1482
|
+
declare const expectedTravelPlan: TravelPlan;
|
|
1483
|
+
declare const phase1HappyPathTurns: [{
|
|
1484
|
+
_tag: "Stream";
|
|
1485
|
+
parts: ({
|
|
1486
|
+
type: "tool-call";
|
|
1487
|
+
id: string;
|
|
1488
|
+
name: string;
|
|
1489
|
+
params: {
|
|
1490
|
+
origin: string;
|
|
1491
|
+
destination: string;
|
|
1492
|
+
departOn: string;
|
|
1493
|
+
travelers: number;
|
|
1494
|
+
nights?: undefined;
|
|
1495
|
+
};
|
|
1496
|
+
reason?: undefined;
|
|
1497
|
+
usage?: undefined;
|
|
1498
|
+
} | {
|
|
1499
|
+
type: "tool-call";
|
|
1500
|
+
id: string;
|
|
1501
|
+
name: string;
|
|
1502
|
+
params: {
|
|
1503
|
+
origin?: undefined;
|
|
1504
|
+
destination: string;
|
|
1505
|
+
departOn: string;
|
|
1506
|
+
nights: number;
|
|
1507
|
+
travelers: number;
|
|
1508
|
+
};
|
|
1509
|
+
reason?: undefined;
|
|
1510
|
+
usage?: undefined;
|
|
1511
|
+
} | {
|
|
1512
|
+
id?: undefined;
|
|
1513
|
+
name?: undefined;
|
|
1514
|
+
params?: undefined;
|
|
1515
|
+
type: "finish";
|
|
1516
|
+
reason: "tool-calls";
|
|
1517
|
+
usage: {
|
|
1518
|
+
inputTokens: {
|
|
1519
|
+
total: number;
|
|
1520
|
+
};
|
|
1521
|
+
outputTokens: {
|
|
1522
|
+
total: number;
|
|
1523
|
+
};
|
|
1524
|
+
};
|
|
1525
|
+
})[];
|
|
1526
|
+
termination: {
|
|
1527
|
+
_tag: "Complete";
|
|
1528
|
+
};
|
|
1529
|
+
}, {
|
|
1530
|
+
_tag: "Stream";
|
|
1531
|
+
parts: ({
|
|
1532
|
+
reason?: undefined;
|
|
1533
|
+
usage?: undefined;
|
|
1534
|
+
type: "text-start";
|
|
1535
|
+
id: string;
|
|
1536
|
+
delta?: undefined;
|
|
1537
|
+
} | {
|
|
1538
|
+
reason?: undefined;
|
|
1539
|
+
usage?: undefined;
|
|
1540
|
+
type: "text-delta";
|
|
1541
|
+
id: string;
|
|
1542
|
+
delta: string;
|
|
1543
|
+
} | {
|
|
1544
|
+
reason?: undefined;
|
|
1545
|
+
usage?: undefined;
|
|
1546
|
+
delta?: undefined;
|
|
1547
|
+
type: "text-end";
|
|
1548
|
+
id: string;
|
|
1549
|
+
} | {
|
|
1550
|
+
id?: undefined;
|
|
1551
|
+
delta?: undefined;
|
|
1552
|
+
type: "finish";
|
|
1553
|
+
reason: "stop";
|
|
1554
|
+
usage: {
|
|
1555
|
+
inputTokens: {
|
|
1556
|
+
total: number;
|
|
1557
|
+
};
|
|
1558
|
+
outputTokens: {
|
|
1559
|
+
total: number;
|
|
1560
|
+
};
|
|
1561
|
+
};
|
|
1562
|
+
})[];
|
|
1563
|
+
termination: {
|
|
1564
|
+
_tag: "Complete";
|
|
1565
|
+
};
|
|
1566
|
+
}];
|
|
1567
|
+
//#endregion
|
|
1568
|
+
//#region src/fixtures/travel-planner/subagents-durable.d.ts
|
|
1569
|
+
/** Registered coordinator and researcher bindings for durable delegation tests. */
|
|
1570
|
+
declare const s2TravelPlannerDeploymentId: string & import("effect/Brand").Brand<"@effect-agent/thread/DeploymentId">;
|
|
1571
|
+
declare const s2TravelPlannerProducerId: string & import("effect/Brand").Brand<"@effect-agent/thread/ProducerId">;
|
|
1572
|
+
declare const s2TravelPlannerPrincipal: string & import("effect/Brand").Brand<"@effect-agent/thread/Principal">;
|
|
1573
|
+
/** Redacted, deterministic parent (coordinator) definition digests for this fixture version. */
|
|
1574
|
+
declare const s2CoordinatorDigests: DefinitionDigests;
|
|
1575
|
+
/**
|
|
1576
|
+
* The exact child Binding digest strings the application declares on
|
|
1577
|
+
* `SubagentRuntimeOptions.durable.targetDigests` AND the host registers with
|
|
1578
|
+
* the host's binding array for the researcher Binding. The coordinator
|
|
1579
|
+
* stores and verifies them byte-for-byte (SUB-023); a host registration under
|
|
1580
|
+
* different strings is a `ChildCompatibilityFailure`, never a substitution.
|
|
1581
|
+
*/
|
|
1582
|
+
declare const s2ResearcherDigestStrings: {
|
|
1583
|
+
readonly agent: string;
|
|
1584
|
+
readonly model: string;
|
|
1585
|
+
readonly tools: string;
|
|
1586
|
+
};
|
|
1587
|
+
declare const s2ResearcherDigests: DefinitionDigests;
|
|
1588
|
+
/** Durable admission options for one coordinator Submission on one mission lane. */
|
|
1589
|
+
declare const s2TravelPlannerSubmitOptions: (threadId: ThreadId, idempotencyKey: IdempotencyKey) => DurableSubmitOptions;
|
|
1590
|
+
/** The structural submit slice of the coordinator Binding (`DurableAgentRuntime.submit`). */
|
|
1591
|
+
declare const s2CoordinatorSubmitAgent: {
|
|
1592
|
+
readonly definition: {
|
|
1593
|
+
readonly id: import("effect/Brand").Brand<"@effect-agent/core/AgentId"> & "travel-coordinator";
|
|
1594
|
+
readonly input: typeof ResearchMission;
|
|
1595
|
+
};
|
|
1596
|
+
};
|
|
1597
|
+
/**
|
|
1598
|
+
* The per-invocation reservation the durable handler computes from the S1
|
|
1599
|
+
* delegation policy (`delegationAllocationFromPolicy`): the conservation
|
|
1600
|
+
* evidence in the S2 tests checks the ledger reservation rows and the
|
|
1601
|
+
* canonical `SubagentJoined.finalAccounting` against exactly this value.
|
|
1602
|
+
*/
|
|
1603
|
+
declare const durableResearchAllocation: import("effect-agent/subagent-contract").SubagentReservationAmounts;
|
|
1604
|
+
/** The one scripted delegation Tool Call id of the durable coordinator Run. */
|
|
1605
|
+
declare const durableResearchCallId = "research-lhr-1";
|
|
1606
|
+
/** The child's own scripted guide-lookup Tool Call id. */
|
|
1607
|
+
declare const durableChildLookupCallId: (destination: string) => string;
|
|
1608
|
+
/** The projected finding the parent joins (only the advisory crosses, SUB-015). */
|
|
1609
|
+
declare const durableResearchFinding: (destination: string) => {
|
|
1610
|
+
destination: string & import("effect/Brand").Brand<"@effect-agent/testing/travel-planner/AirportCode">;
|
|
1611
|
+
summary: string;
|
|
1612
|
+
};
|
|
1613
|
+
/** The coordinator's expected final shortlist for one researched destination. */
|
|
1614
|
+
declare const durableResearchShortlist: (destination: string) => DestinationShortlist;
|
|
1615
|
+
/**
|
|
1616
|
+
* The deterministic guide facts in encoded (wire) form: the "supplier truth"
|
|
1617
|
+
* an authorized operator records through `resolveUnknown` when a child guide
|
|
1618
|
+
* lookup stopped at an Unknown Outcome (DUR-017 — the framework never guesses
|
|
1619
|
+
* or replays it).
|
|
1620
|
+
*/
|
|
1621
|
+
declare const encodedDestinationFacts: (destination: string) => unknown;
|
|
1622
|
+
/** One scripted model whose behavior is keyed by the global invocation index. */
|
|
1623
|
+
declare const makeInvocationCountingModel: (name: string, script: (call: number) => ReadonlyArray<Response.StreamPartEncoded>) => Effect.Effect<{
|
|
1624
|
+
model: Model.Model<"scripted", LanguageModel.LanguageModel, never>;
|
|
1625
|
+
calls: Effect.Effect<number, never, never>;
|
|
1626
|
+
prompts: Effect.Effect<readonly string[], never, never>;
|
|
1627
|
+
}, never, never>;
|
|
1628
|
+
/** Runtime wiring for the durable slice: the S1 delegation plus the S2 digest declaration. */
|
|
1629
|
+
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, Subagent.SubagentLayerRequirements<typeof DestinationBrief, typeof DestinationReport, string, {
|
|
1630
|
+
readonly lookup_destination: import("effect/unstable/ai/Tool").Tool<"lookup_destination", {
|
|
1631
|
+
readonly parameters: typeof DestinationQuery;
|
|
1632
|
+
readonly success: typeof DestinationFacts;
|
|
1633
|
+
readonly failure: typeof DestinationGuideUnavailable;
|
|
1634
|
+
readonly failureMode: "error";
|
|
1635
|
+
}, DestinationGuide>;
|
|
1636
|
+
}, Provider, ModelProvides, ModelRequires, ResearchDispatchGate, never, never, {
|
|
1637
|
+
readonly _tag: string;
|
|
1638
|
+
}, never, undefined, undefined, undefined>>;
|
|
1639
|
+
/** Optional overrides for one durable research harness. */
|
|
1640
|
+
interface DurableResearchHarnessOptions {
|
|
1641
|
+
/** Researched destination; defaults to "LHR". */
|
|
1642
|
+
readonly destination?: string | undefined;
|
|
1643
|
+
/** Delegation focus; defaults to "museums". */
|
|
1644
|
+
readonly focus?: string | undefined;
|
|
1645
|
+
/**
|
|
1646
|
+
* Digests the HOST registers the child Binding under; defaults to the exact
|
|
1647
|
+
* declared `s2ResearcherDigests`. Register different digests to force the
|
|
1648
|
+
* fail-closed `ChildCompatibilityFailure` path (SUB-023/SUB-032).
|
|
1649
|
+
*/
|
|
1650
|
+
readonly childRegistrationDigests?: DefinitionDigests | undefined;
|
|
1651
|
+
}
|
|
1652
|
+
/** One durable coordinator/researcher pair with observable invocation counters. */
|
|
1653
|
+
interface DurableResearchHarness {
|
|
1654
|
+
/** Host registrations for `NodeDurableAgentRuntimeOptions.bindings` (parent + child). */
|
|
1655
|
+
readonly bindings: ReadonlyArray<ResolvedBinding>;
|
|
1656
|
+
/** Total coordinator model invocations across every Attempt and runtime handle. */
|
|
1657
|
+
readonly parentModelCalls: Effect.Effect<number>;
|
|
1658
|
+
/** JSON-encoded coordinator prompts in request order. */
|
|
1659
|
+
readonly parentPrompts: Effect.Effect<ReadonlyArray<string>>;
|
|
1660
|
+
/** Total researcher model invocations across every Attempt and runtime handle. */
|
|
1661
|
+
readonly childModelCalls: Effect.Effect<number>;
|
|
1662
|
+
/** JSON-encoded researcher prompts in request order (context-isolation evidence). */
|
|
1663
|
+
readonly childPrompts: Effect.Effect<ReadonlyArray<string>>;
|
|
1664
|
+
/** Deterministic guide-lookup handler executions (ordinary child Tool side effects). */
|
|
1665
|
+
readonly guideInvocations: Effect.Effect<number>;
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* Build the S2 Travel Planner harness: an invocation-counting scripted
|
|
1669
|
+
* coordinator (Turn 1 declares the one delegation call, Turn 2 writes the
|
|
1670
|
+
* shortlist), an invocation-counting scripted researcher (Turn 1 consults the
|
|
1671
|
+
* guide, Turn 2 writes the report), and both worker Bindings captured with
|
|
1672
|
+
* their requirement Contexts via `DurableWorkerBinding.make` under the exact
|
|
1673
|
+
* fixture digests. The returned `bindings` are plain values: they can be
|
|
1674
|
+
* registered with several `NodeDurableAgentRuntime` stacks over the same SQLite
|
|
1675
|
+
* file while the counters keep counting across all of them.
|
|
1676
|
+
*/
|
|
1677
|
+
declare const makeDurableResearchHarness: (options?: DurableResearchHarnessOptions) => Effect.Effect<DurableResearchHarness, never, never>;
|
|
1678
|
+
//#endregion
|
|
1679
|
+
export { ActivityCatalog, ActivityCatalogLayer, ActivityQuery, ActivitySearchResult, ActivityUnavailable, AirportCode, BookFlight, BookItinerary, BookingRef, CancelBooking, CancelBookingRequest, CancellationConfirmation, CatalogLifecycle, CatalogLifecycleCounts, type CrossPlatformEvidenceIdentity, DestinationBrief, DestinationFacts, DestinationGuide, DestinationGuideLayer, DestinationGuideUnavailable, DestinationQuery, DestinationRecommendation, DestinationReport, type DestinationResearchCall, DestinationResearchFailed, DestinationResearchFindings, DestinationResearchRequest, DestinationResearchSupportLayer, DestinationResearcher, type DestinationResearcherControls, DestinationResearcherToolkit, DestinationResearcherToolkitLayer, DestinationShortlist, DeterministicIdGeneratorLayer, type DurableResearchHarness, type DurableResearchHarnessOptions, DurableSearchActivities, DurableSearchFlights, DurableSearchLodging, 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, type Phase7LiveGateEnvironment, QuoteId, ResearchDispatchGate, ResearchMission, ReverseCompletionToolkitLayer, SearchActivities, SearchFlights, SearchLodging, type SupplierBookRequest, SupplierBookingConfirmation, SupplierBookingDesk, SupplierBookingRecord, type SupplierHoldControls, SupplierOperation, SupplierUnavailable, TravelBookingReport, TravelCoordinator, TravelCoordinatorToolkit, TravelGuidance, TravelGuidanceLayer, TravelPlan, TravelPlanner, TravelPlannerBookingEvidenceError, type TravelPlannerCompletionControls, TravelPlannerDurableEvidenceError, TravelPlannerPhase2, TravelPlannerPhase2Toolkit, TravelPlannerPhase2ToolkitLayer, TravelPlannerPhase4, TravelPlannerPhase4Toolkit, TravelPlannerPhase4ToolkitLayer, TravelPlannerPhase5, TravelPlannerPhase5Toolkit, TravelPlannerPhase5ToolkitLayer, TravelPlannerProjectionError, TravelPlannerRuntimeLayer, TravelPlannerToolkit, TravelPlannerToolkitLayer, TravelSupplierReconcilerLayer, TravelerRef, TripRequest, assertSettledBookingsExistAtSupplier, bookFlightIdempotencyKey, cancelBookingIdempotencyKey, coordinatorConfidentialMarker, coordinatorResearchTurn, coordinatorShortlistTurn, destinationLookup, destinationReportFor, destinationResearchDelegation, destinationResearchHandlersLayer, destinationResearchPolicy, durableChildLookupCallId, durableDestinationResearchHandlersLayer, durableResearchAllocation, durableResearchCallId, durableResearchFinding, durableResearchShortlist, encodedDestinationFacts, encodedDestinationReport, expectedDestinationShortlist, expectedTravelPlan, itineraryStepIdempotencyKey, makeDestinationResearcherModel, makeDurableResearchHarness, makeInvocationCountingModel, makePhase3TravelPlannerCheckpoint, makePhase4TravelPlannerAgent, makePhase6TravelPlannerBindings, mapResearchChildFailure, missionConfidentialMarker, normalizeCrossPlatformTravelPlannerEvidence, normalizeDurableTravelPlannerEvidence, phase1HappyPathTurns, phase1Trip, phase3TravelPlannerBatches, phase3TravelPlannerCompletionBatch, phase3TravelPlannerDefinitionDigests, phase3TravelPlannerEncodedFixture, phase3TravelPlannerInitialBatch, phase3TravelPlannerProducerId, phase3TravelPlannerRunId, phase3TravelPlannerThreadId, phase4TravelPlannerDefinitionDigests, phase4TravelPlannerDeploymentId, phase4TravelPlannerPrincipal, phase4TravelPlannerProducerId, phase4TravelPlannerSubmitOptions, phase4TravelPlannerWorkerLayer, phase5TravelPlannerDefinitionDigests, phase5TravelPlannerDeploymentId, phase5TravelPlannerPrincipal, phase5TravelPlannerProducerId, 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, phase7LiveProfileEnabled, releasePhase6PlannerGate, releasePhase6ResearcherGate, researchMission, researcherHappyPathTurns, resetPhase6PlannerGate, resetPhase6ResearcherGate, s2CoordinatorDigests, s2CoordinatorSubmitAgent, s2ResearcherDigestStrings, s2ResearcherDigests, s2TravelPlannerDeploymentId, s2TravelPlannerPrincipal, s2TravelPlannerProducerId, s2TravelPlannerSubmitOptions, supplierBookingRefFor, travelPlanFromDurableSettlement, travelPlanFromProjection };
|
|
1680
|
+
//# sourceMappingURL=TravelPlanner.d.mts.map
|