@effect-agent/testing 0.1.0-beta.85 → 0.1.0-beta.87
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 +12 -11
- package/dist/Certification.mjs +77 -40
- package/dist/Certification.mjs.map +1 -1
- package/dist/Chaos.d.mts +5 -5
- package/dist/Chaos.mjs +20 -20
- package/dist/Chaos.mjs.map +1 -1
- package/dist/CodeExecutorConformance.d.mts +2 -2
- package/dist/CodeExecutorConformance.mjs +2 -2
- package/dist/CodeExecutorConformance.mjs.map +1 -1
- package/dist/CodeExecutorSubstitute.d.mts +2 -2
- package/dist/CodeExecutorSubstitute.mjs +2 -2
- package/dist/CodeExecutorSubstitute.mjs.map +1 -1
- package/dist/DocsResearcher.d.mts +14 -14
- package/dist/DocsResearcher.mjs +15 -15
- package/dist/DocsResearcher.mjs.map +1 -1
- package/dist/TravelPlanner.d.mts +20 -21
- package/dist/TravelPlanner.mjs +18 -18
- package/dist/TravelPlanner.mjs.map +1 -1
- package/dist/{deterministic-layers-Eka0fMZq.mjs → deterministic-layers-D5owIoke.mjs} +8 -8
- package/dist/deterministic-layers-D5owIoke.mjs.map +1 -0
- package/package.json +1 -1
- package/src/Certification.ts +149 -97
- package/src/Chaos.ts +21 -31
- package/src/CodeExecutorConformance.ts +3 -3
- package/src/CodeExecutorSubstitute.ts +3 -3
- package/src/fixtures/docs-researcher/definition.ts +6 -6
- package/src/fixtures/docs-researcher/harness.ts +9 -13
- package/src/fixtures/docs-researcher/mcp.ts +3 -3
- package/src/fixtures/travel-planner/definition.ts +2 -2
- package/src/fixtures/travel-planner/deterministic-layers.ts +5 -5
- package/src/fixtures/travel-planner/phase2.ts +2 -2
- package/src/fixtures/travel-planner/phase3.ts +5 -5
- package/src/fixtures/travel-planner/phase4.ts +8 -8
- package/src/fixtures/travel-planner/phase5.ts +9 -13
- package/src/fixtures/travel-planner/phase6.ts +7 -7
- package/src/fixtures/travel-planner/subagents-durable.ts +11 -13
- package/src/fixtures/travel-planner/subagents.ts +6 -6
- package/src/internal/certification-report.ts +25 -0
- package/dist/deterministic-layers-Eka0fMZq.mjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as Subagent from "@effect-agent/capabilities/Subagent";
|
|
2
|
-
import { SubagentPolicy, SubagentRuntime } from "@effect-agent/capabilities/Subagent";
|
|
3
|
-
import * as Agent from "@effect-agent/core/Agent";
|
|
4
|
-
import { AgentPolicy } from "@effect-agent/core/AgentPolicy";
|
|
5
|
-
import { type RuntimeBinding } from "@effect-agent/engine/AgentRuntime";
|
|
6
1
|
import { Context, Effect, Schema } from "effect";
|
|
2
|
+
import * as Agent from "effect-agent/agent";
|
|
3
|
+
import { AgentPolicy } from "effect-agent/agent-policy";
|
|
4
|
+
import { type RuntimeBinding } from "effect-agent/agent-runtime";
|
|
5
|
+
import * as Subagent from "effect-agent/subagent";
|
|
6
|
+
import { SubagentPolicy } from "effect-agent/subagent";
|
|
7
7
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
8
8
|
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
@@ -283,7 +283,7 @@ export const docsSummaryHandlersLayer = <Provider, ModelProvides, ModelRequires>
|
|
|
283
283
|
ModelRequires
|
|
284
284
|
>,
|
|
285
285
|
) =>
|
|
286
|
-
|
|
286
|
+
Subagent.layer(delegateDocumentSummary, childBinding, {
|
|
287
287
|
mapChildFailure: mapSummaryChildFailure,
|
|
288
288
|
durable: { targetDigests: docsSummarizerDigestStrings },
|
|
289
289
|
});
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { connectMcp, type McpDiscovery } from "@effect-agent/capabilities/Mcp";
|
|
2
|
-
import {
|
|
3
|
-
Redactor,
|
|
4
|
-
type RedactedPreview,
|
|
5
|
-
type RedactionError,
|
|
6
|
-
} from "@effect-agent/capabilities/Redaction";
|
|
7
|
-
import { SubagentReservationsMemoryLive } from "@effect-agent/capabilities/SubagentReservations";
|
|
8
|
-
import * as Agent from "@effect-agent/core/Agent";
|
|
9
|
-
import { type ThreadId } from "@effect-agent/core/Identifiers";
|
|
10
|
-
import { DurableWorkerBinding, type ResolvedBinding } from "@effect-agent/thread/AgentRegistration";
|
|
11
|
-
import { type DurableSubmitOptions } from "@effect-agent/thread/DurableAgentRuntime";
|
|
12
|
-
import { DefinitionDigests, DeploymentId, Digest, ProducerId } from "@effect-agent/thread/Records";
|
|
13
|
-
import { Principal, type IdempotencyKey } from "@effect-agent/thread/SubmissionLedger";
|
|
14
1
|
import type { Crypto } from "effect";
|
|
15
2
|
import { Effect, Layer, Ref, Schema, Stream } from "effect";
|
|
3
|
+
import * as Agent from "effect-agent/agent";
|
|
4
|
+
import { DurableWorkerBinding, type ResolvedBinding } from "effect-agent/agent-registration";
|
|
5
|
+
import { type DurableSubmitOptions } from "effect-agent/durable-agent-runtime";
|
|
6
|
+
import { type ThreadId } from "effect-agent/identifiers";
|
|
7
|
+
import { connectMcp, type McpDiscovery } from "effect-agent/mcp";
|
|
8
|
+
import { DefinitionDigests, DeploymentId, Digest, ProducerId } from "effect-agent/records";
|
|
9
|
+
import { Redactor, type RedactedPreview, type RedactionError } from "effect-agent/redaction";
|
|
10
|
+
import { SubagentReservationsMemoryLive } from "effect-agent/subagent-reservations";
|
|
11
|
+
import { Principal, type IdempotencyKey } from "effect-agent/submission-ledger";
|
|
16
12
|
import { LanguageModel, Model, type Response } from "effect/unstable/ai";
|
|
17
13
|
|
|
18
14
|
import { DeterministicIdGeneratorLayer } from "../travel-planner/deterministic-layers.ts";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { JsonSchema } from "effect";
|
|
2
|
+
import { Effect, JsonPointer, Layer, Schema } from "effect";
|
|
1
3
|
import {
|
|
2
4
|
McpConnectionRequest,
|
|
3
5
|
McpConnector,
|
|
4
6
|
McpServerIdentity,
|
|
5
7
|
McpToolkitMismatch,
|
|
6
8
|
type McpConnection,
|
|
7
|
-
} from "
|
|
8
|
-
import type { JsonSchema } from "effect";
|
|
9
|
-
import { Effect, JsonPointer, Layer, Schema } from "effect";
|
|
9
|
+
} from "effect-agent/mcp";
|
|
10
10
|
import { Tool } from "effect/unstable/ai";
|
|
11
11
|
import * as McpSchema from "effect/unstable/ai/McpSchema";
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as Agent from "@effect-agent/core/Agent";
|
|
2
|
-
import { AgentPolicy } from "@effect-agent/core/AgentPolicy";
|
|
3
1
|
import { Context, Effect, Schema } from "effect";
|
|
2
|
+
import * as Agent from "effect-agent/agent";
|
|
3
|
+
import { AgentPolicy } from "effect-agent/agent-policy";
|
|
4
4
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
5
5
|
|
|
6
6
|
export const AirportCode = Schema.NonEmptyString.pipe(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ThreadId, RunId, TurnId } from "@effect-agent/core/Identifiers";
|
|
2
|
-
import { IdGenerator } from "@effect-agent/core/IdGenerator";
|
|
3
|
-
import { RunContextPreparationPassthrough } from "@effect-agent/engine/RunOptions";
|
|
4
|
-
import { ThreadHistory } from "@effect-agent/engine/ThreadHistory";
|
|
5
1
|
import { Context, Deferred, Effect, Layer, Option, Ref, Schema } from "effect";
|
|
2
|
+
import { IdGenerator } from "effect-agent/id-generator";
|
|
3
|
+
import { ThreadId, RunId, TurnId } from "effect-agent/identifiers";
|
|
4
|
+
import { RunContextPreparationPassthrough } from "effect-agent/run-options";
|
|
5
|
+
import { ThreadHistory } from "effect-agent/thread-history";
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
ActivityCatalog,
|
|
@@ -464,7 +464,7 @@ export const DeterministicIdGeneratorLayer = Layer.effect(
|
|
|
464
464
|
|
|
465
465
|
export const TravelPlannerRuntimeLayer = Layer.mergeAll(
|
|
466
466
|
RunContextPreparationPassthrough,
|
|
467
|
-
ThreadHistory.
|
|
467
|
+
ThreadHistory.layer,
|
|
468
468
|
TravelPlannerToolkitLayer,
|
|
469
469
|
FlightCatalogLayer,
|
|
470
470
|
LodgingCatalogLayer,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as Agent from "@effect-agent/core/Agent";
|
|
2
|
-
import { AgentPolicy } from "@effect-agent/core/AgentPolicy";
|
|
3
1
|
import { Context, Effect, Schema } from "effect";
|
|
2
|
+
import * as Agent from "effect-agent/agent";
|
|
3
|
+
import { AgentPolicy } from "effect-agent/agent-policy";
|
|
4
4
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
5
5
|
|
|
6
6
|
import {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { AgentId, ThreadId, RunId, SubmissionId } from "effect-agent/identifiers";
|
|
2
3
|
import {
|
|
3
4
|
BatchId,
|
|
4
5
|
CanonicalBatch,
|
|
@@ -8,10 +9,9 @@ import {
|
|
|
8
9
|
ProducerId,
|
|
9
10
|
RecordEnvelope,
|
|
10
11
|
RecordId,
|
|
11
|
-
} from "
|
|
12
|
-
import { ThreadProjection } from "
|
|
13
|
-
import { ThreadCheckpoint } from "
|
|
14
|
-
import { Effect, Schema } from "effect";
|
|
12
|
+
} from "effect-agent/records";
|
|
13
|
+
import { ThreadProjection } from "effect-agent/thread-projection";
|
|
14
|
+
import { ThreadCheckpoint } from "effect-agent/thread-store";
|
|
15
15
|
|
|
16
16
|
import { TravelPlan, TripRequest } from "./definition.ts";
|
|
17
17
|
import { expectedTravelPlan, phase1Trip } from "./scenarios.ts";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Effect, Layer, Schema } from "effect";
|
|
2
|
+
import * as Agent from "effect-agent/agent";
|
|
3
|
+
import { AgentPolicy } from "effect-agent/agent-policy";
|
|
4
|
+
import { type DurableSubmitOptions, type Receipt } from "effect-agent/durable-agent-runtime";
|
|
5
|
+
import { ToolExecutionClass } from "effect-agent/durable-step";
|
|
6
|
+
import { type ThreadId } from "effect-agent/identifiers";
|
|
6
7
|
import {
|
|
7
8
|
CanonicalRecordEnvelope,
|
|
8
9
|
DefinitionDigests,
|
|
9
10
|
DeploymentId,
|
|
10
11
|
Digest,
|
|
11
12
|
ProducerId,
|
|
12
|
-
} from "
|
|
13
|
-
import { Principal, type IdempotencyKey } from "
|
|
14
|
-
import { Effect, Layer, Schema } from "effect";
|
|
13
|
+
} from "effect-agent/records";
|
|
14
|
+
import { Principal, type IdempotencyKey } from "effect-agent/submission-ledger";
|
|
15
15
|
import { Model, Tool, Toolkit } from "effect/unstable/ai";
|
|
16
16
|
|
|
17
17
|
import { ScriptedModel, type ScriptedTurnInput } from "../../ScriptedModel.ts";
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ToolExecutionClass,
|
|
8
|
-
} from "@effect-agent/engine/DurableStep";
|
|
9
|
-
import { type DurableSubmitOptions } from "@effect-agent/thread/DurableAgentRuntime";
|
|
1
|
+
import { Effect, Layer, Option, Schema } from "effect";
|
|
2
|
+
import * as Agent from "effect-agent/agent";
|
|
3
|
+
import { AgentPolicy } from "effect-agent/agent-policy";
|
|
4
|
+
import { type DurableSubmitOptions } from "effect-agent/durable-agent-runtime";
|
|
5
|
+
import { DurableStep, DurableStepError, ToolExecutionClass } from "effect-agent/durable-step";
|
|
6
|
+
import { type ThreadId } from "effect-agent/identifiers";
|
|
10
7
|
import {
|
|
11
8
|
DefinitionDigests,
|
|
12
9
|
DeploymentId,
|
|
@@ -14,16 +11,15 @@ import {
|
|
|
14
11
|
PersistedJson,
|
|
15
12
|
ProducerId,
|
|
16
13
|
type CanonicalRecordEnvelope,
|
|
17
|
-
} from "
|
|
18
|
-
import { Principal, type IdempotencyKey } from "
|
|
14
|
+
} from "effect-agent/records";
|
|
15
|
+
import { Principal, type IdempotencyKey } from "effect-agent/submission-ledger";
|
|
19
16
|
import {
|
|
20
17
|
ReconciliationCompleted,
|
|
21
18
|
ReconciliationSafeToRetry,
|
|
22
19
|
ReconciliationUncertain,
|
|
23
20
|
ToolReconciler,
|
|
24
21
|
ToolReconcilerError,
|
|
25
|
-
} from "
|
|
26
|
-
import { Effect, Layer, Option, Schema } from "effect";
|
|
22
|
+
} from "effect-agent/tool-reconciler";
|
|
27
23
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
28
24
|
|
|
29
25
|
import {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as Agent from "
|
|
3
|
-
import { DurableWorkerBinding, type ResolvedBinding } from "
|
|
4
|
-
import { type Receipt } from "
|
|
1
|
+
import { Duration, Effect, Layer, Schema, Stream } from "effect";
|
|
2
|
+
import * as Agent from "effect-agent/agent";
|
|
3
|
+
import { DurableWorkerBinding, type ResolvedBinding } from "effect-agent/agent-registration";
|
|
4
|
+
import { type Receipt } from "effect-agent/durable-agent-runtime";
|
|
5
5
|
import {
|
|
6
6
|
DefinitionDigests,
|
|
7
7
|
DeploymentId,
|
|
8
8
|
Digest,
|
|
9
9
|
ProducerId,
|
|
10
10
|
type CanonicalRecordEnvelope,
|
|
11
|
-
} from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
} from "effect-agent/records";
|
|
12
|
+
import { SubagentReservationsMemoryLive } from "effect-agent/subagent-reservations";
|
|
13
|
+
import { type ToolReconciler } from "effect-agent/tool-reconciler";
|
|
14
14
|
import { LanguageModel, Model, type Response } from "effect/unstable/ai";
|
|
15
15
|
|
|
16
16
|
import { TravelPlan, TripRequest } from "./definition.ts";
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
delegationAllocationFromPolicy,
|
|
3
|
-
SubagentRuntime,
|
|
4
|
-
} from "@effect-agent/capabilities/Subagent";
|
|
5
|
-
import { SubagentReservationsMemoryLive } from "@effect-agent/capabilities/SubagentReservations";
|
|
6
|
-
import * as Agent from "@effect-agent/core/Agent";
|
|
7
|
-
import { type ThreadId } from "@effect-agent/core/Identifiers";
|
|
8
|
-
import { type RuntimeBinding } from "@effect-agent/engine/AgentRuntime";
|
|
9
|
-
import { DurableWorkerBinding, type ResolvedBinding } from "@effect-agent/thread/AgentRegistration";
|
|
10
|
-
import { type DurableSubmitOptions } from "@effect-agent/thread/DurableAgentRuntime";
|
|
11
|
-
import { DefinitionDigests, DeploymentId, Digest, ProducerId } from "@effect-agent/thread/Records";
|
|
12
|
-
import { Principal, type IdempotencyKey } from "@effect-agent/thread/SubmissionLedger";
|
|
13
1
|
import { Effect, Layer, Ref, Schema, Stream } from "effect";
|
|
2
|
+
import * as Agent from "effect-agent/agent";
|
|
3
|
+
import { DurableWorkerBinding, type ResolvedBinding } from "effect-agent/agent-registration";
|
|
4
|
+
import { type RuntimeBinding } from "effect-agent/agent-runtime";
|
|
5
|
+
import { type DurableSubmitOptions } from "effect-agent/durable-agent-runtime";
|
|
6
|
+
import { type ThreadId } from "effect-agent/identifiers";
|
|
7
|
+
import { DefinitionDigests, DeploymentId, Digest, ProducerId } from "effect-agent/records";
|
|
8
|
+
import * as Subagent from "effect-agent/subagent";
|
|
9
|
+
import { delegationAllocationFromPolicy } from "effect-agent/subagent";
|
|
10
|
+
import { SubagentReservationsMemoryLive } from "effect-agent/subagent-reservations";
|
|
11
|
+
import { Principal, type IdempotencyKey } from "effect-agent/submission-ledger";
|
|
14
12
|
import { LanguageModel, Model, type Response, type Toolkit } from "effect/unstable/ai";
|
|
15
13
|
|
|
16
14
|
import { DeterministicIdGeneratorLayer } from "./deterministic-layers.ts";
|
|
@@ -253,7 +251,7 @@ export const durableDestinationResearchHandlersLayer = <Provider, ModelProvides,
|
|
|
253
251
|
ModelRequires
|
|
254
252
|
>,
|
|
255
253
|
) =>
|
|
256
|
-
|
|
254
|
+
Subagent.layer(destinationResearchDelegation, childBinding, {
|
|
257
255
|
mapChildFailure: mapResearchChildFailure,
|
|
258
256
|
durable: { targetDigests: s2ResearcherDigestStrings },
|
|
259
257
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as Subagent from "@effect-agent/capabilities/Subagent";
|
|
2
|
-
import { SubagentPolicy, SubagentRuntime } from "@effect-agent/capabilities/Subagent";
|
|
3
|
-
import * as Agent from "@effect-agent/core/Agent";
|
|
4
|
-
import { AgentPolicy } from "@effect-agent/core/AgentPolicy";
|
|
5
|
-
import { type RuntimeBinding } from "@effect-agent/engine/AgentRuntime";
|
|
6
1
|
import { Context, Deferred, Effect, Layer, Ref, Schema, Stream } from "effect";
|
|
2
|
+
import * as Agent from "effect-agent/agent";
|
|
3
|
+
import { AgentPolicy } from "effect-agent/agent-policy";
|
|
4
|
+
import { type RuntimeBinding } from "effect-agent/agent-runtime";
|
|
5
|
+
import * as Subagent from "effect-agent/subagent";
|
|
6
|
+
import { SubagentPolicy } from "effect-agent/subagent";
|
|
7
7
|
import { LanguageModel, Model, type Response, Tool, Toolkit } from "effect/unstable/ai";
|
|
8
8
|
|
|
9
9
|
import type { ScriptedTurnInput } from "../../ScriptedModel.ts";
|
|
@@ -269,7 +269,7 @@ export const destinationResearchHandlersLayer = <Provider, ModelProvides, ModelR
|
|
|
269
269
|
ModelRequires
|
|
270
270
|
>,
|
|
271
271
|
) =>
|
|
272
|
-
|
|
272
|
+
Subagent.layer(destinationResearchDelegation, childBinding, {
|
|
273
273
|
mapChildFailure: mapResearchChildFailure,
|
|
274
274
|
});
|
|
275
275
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CertificationReport } from "effect-agent/testing/certification";
|
|
2
|
+
|
|
3
|
+
/** Fold executed results without acquiring adapters or claiming coverage from citations. */
|
|
4
|
+
export const makeCertificationReport = (
|
|
5
|
+
results: Pick<CertificationReport, "adapter" | "generatedAt" | "tier1" | "tier2" | "tier3">,
|
|
6
|
+
): CertificationReport => {
|
|
7
|
+
const { adapter, tier1, tier2, tier3 } = results;
|
|
8
|
+
|
|
9
|
+
const ok =
|
|
10
|
+
tier1.every((result) => result.status === "passed") &&
|
|
11
|
+
tier2.every((result) => result.status !== "failed") &&
|
|
12
|
+
tier3.cases.every((result) => result.status === "passed");
|
|
13
|
+
|
|
14
|
+
return CertificationReport.make({
|
|
15
|
+
format: "effect-agent/certification@2",
|
|
16
|
+
...results,
|
|
17
|
+
ok,
|
|
18
|
+
fullyCertified:
|
|
19
|
+
ok &&
|
|
20
|
+
adapter.durability !== "non-durable" &&
|
|
21
|
+
tier3.status === "exercised" &&
|
|
22
|
+
tier3.cases.length > 0 &&
|
|
23
|
+
tier3.cases.every((result) => result.suite === "real-loss"),
|
|
24
|
+
});
|
|
25
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deterministic-layers-Eka0fMZq.mjs","names":[],"sources":["../src/fixtures/travel-planner/definition.ts","../src/fixtures/travel-planner/deterministic-layers.ts"],"sourcesContent":["import * as Agent from \"@effect-agent/core/Agent\";\nimport { AgentPolicy } from \"@effect-agent/core/AgentPolicy\";\nimport { Context, Effect, Schema } from \"effect\";\nimport { Tool, Toolkit } from \"effect/unstable/ai\";\n\nexport const AirportCode = Schema.NonEmptyString.pipe(\n Schema.brand(\"@effect-agent/testing/travel-planner/AirportCode\"),\n);\n\nexport type AirportCode = typeof AirportCode.Type;\n\nexport const QuoteId = Schema.NonEmptyString.pipe(\n Schema.brand(\"@effect-agent/testing/travel-planner/QuoteId\"),\n);\n\nexport type QuoteId = typeof QuoteId.Type;\n\nexport class TripRequest extends Schema.Class<TripRequest>(\"TripRequest\")({\n request: Schema.NonEmptyString,\n origin: AirportCode,\n destination: AirportCode,\n departOn: Schema.String,\n nights: Schema.Int.check(Schema.isGreaterThan(0)),\n travelers: Schema.Int.check(Schema.isGreaterThan(0)),\n budgetCents: Schema.Int.check(Schema.isGreaterThan(0)),\n currency: Schema.Literal(\"USD\"),\n}) {}\n\nexport class FlightQuery extends Schema.Class<FlightQuery>(\"FlightQuery\")({\n origin: AirportCode,\n destination: AirportCode,\n departOn: Schema.String,\n travelers: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\nexport class LodgingQuery extends Schema.Class<LodgingQuery>(\"LodgingQuery\")({\n destination: AirportCode,\n departOn: Schema.String,\n nights: Schema.Int.check(Schema.isGreaterThan(0)),\n travelers: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\nexport class ActivityQuery extends Schema.Class<ActivityQuery>(\"ActivityQuery\")({\n destination: AirportCode,\n departOn: Schema.String,\n nights: Schema.Int.check(Schema.isGreaterThan(0)),\n travelers: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\nexport class FlightOption extends Schema.Class<FlightOption>(\"FlightOption\")({\n quoteId: QuoteId,\n flight: Schema.String,\n estimatedCents: Schema.Int.check(Schema.isGreaterThan(0)),\n currency: Schema.Literal(\"USD\"),\n}) {}\n\nexport class LodgingOption extends Schema.Class<LodgingOption>(\"LodgingOption\")({\n lodging: Schema.String,\n estimatedCents: Schema.Int.check(Schema.isGreaterThan(0)),\n currency: Schema.Literal(\"USD\"),\n}) {}\n\n/** A successful empty activity search is distinct from supplier unavailability. */\nexport class ActivitySearchResult extends Schema.Class<ActivitySearchResult>(\n \"ActivitySearchResult\",\n)({\n activities: Schema.Array(Schema.String),\n}) {}\n\nexport class Itinerary extends Schema.Class<Itinerary>(\"Itinerary\")({\n title: Schema.String,\n route: Schema.String,\n dates: Schema.String,\n flight: Schema.String,\n lodging: Schema.String,\n activities: Schema.Array(Schema.String),\n estimatedTotalCents: Schema.Int.check(Schema.isGreaterThan(0)),\n currency: Schema.Literal(\"USD\"),\n quoteId: QuoteId,\n assumptions: Schema.Array(Schema.String),\n unresolvedConstraints: Schema.Array(Schema.String),\n nextAction: Schema.Literal(\"review\"),\n}) {}\n\nexport class TravelPlan extends Schema.Class<TravelPlan>(\"TravelPlan\")({\n itineraries: Schema.Array(Itinerary),\n}) {}\n\nconst unavailableFields = { query: Schema.String, message: Schema.String };\n\nexport class FlightUnavailable extends Schema.TaggedError<FlightUnavailable>()(\n \"FlightUnavailable\",\n unavailableFields,\n) {}\n\nexport class LodgingUnavailable extends Schema.TaggedError<LodgingUnavailable>()(\n \"LodgingUnavailable\",\n unavailableFields,\n) {}\n\nexport class ActivityUnavailable extends Schema.TaggedError<ActivityUnavailable>()(\n \"ActivityUnavailable\",\n unavailableFields,\n) {}\n\nexport class GuidanceFailure extends Schema.TaggedError<GuidanceFailure>()(\"GuidanceFailure\", {\n message: Schema.String,\n}) {}\n\nexport class FlightCatalog extends Context.Service<\n FlightCatalog,\n { readonly search: (query: FlightQuery) => Effect.Effect<FlightOption, FlightUnavailable> }\n>()(\"@effect-agent/testing/travel-planner/FlightCatalog\") {}\n\nexport class LodgingCatalog extends Context.Service<\n LodgingCatalog,\n { readonly search: (query: LodgingQuery) => Effect.Effect<LodgingOption, LodgingUnavailable> }\n>()(\"@effect-agent/testing/travel-planner/LodgingCatalog\") {}\n\nexport class ActivityCatalog extends Context.Service<\n ActivityCatalog,\n {\n readonly search: (\n query: ActivityQuery,\n ) => Effect.Effect<ActivitySearchResult, ActivityUnavailable>;\n }\n>()(\"@effect-agent/testing/travel-planner/ActivityCatalog\") {}\n\nexport class TravelGuidance extends Context.Service<\n TravelGuidance,\n { readonly instructions: (input: TripRequest) => Effect.Effect<string, GuidanceFailure> }\n>()(\"@effect-agent/testing/travel-planner/TravelGuidance\") {}\n\nexport const SearchFlights = Tool.make(\"search_flights\", {\n parameters: FlightQuery,\n success: FlightOption,\n failure: FlightUnavailable,\n failureMode: \"error\",\n dependencies: [FlightCatalog],\n});\n\nexport const SearchLodging = Tool.make(\"search_lodging\", {\n parameters: LodgingQuery,\n success: LodgingOption,\n failure: LodgingUnavailable,\n failureMode: \"error\",\n dependencies: [LodgingCatalog],\n});\n\nexport const SearchActivities = Tool.make(\"search_activities\", {\n parameters: ActivityQuery,\n success: ActivitySearchResult,\n failure: ActivityUnavailable,\n failureMode: \"error\",\n dependencies: [ActivityCatalog],\n});\n\nexport const TravelPlannerToolkit = Toolkit.make(SearchFlights, SearchLodging, SearchActivities);\n\nexport const TravelPlannerToolkitLayer = TravelPlannerToolkit.toLayer({\n search_flights: (query) => Effect.flatMap(FlightCatalog, (catalog) => catalog.search(query)),\n search_lodging: (query) => Effect.flatMap(LodgingCatalog, (catalog) => catalog.search(query)),\n search_activities: (query) => Effect.flatMap(ActivityCatalog, (catalog) => catalog.search(query)),\n});\n\nexport const TravelPlanner = Agent.make(\"travel-planner\", {\n input: TripRequest,\n output: TravelPlan,\n instructions: (input) =>\n Effect.flatMap(TravelGuidance, (guidance) => guidance.instructions(input)),\n toolkit: TravelPlannerToolkit,\n policy: AgentPolicy.make({\n maxTurns: 2,\n maxToolCalls: 3,\n maxDuration: \"30 seconds\",\n toolConcurrency: 3,\n }),\n description: \"Build one review-only itinerary from bounded parallel deterministic searches.\",\n metadata: { deploymentClass: \"E\", phase: \"P1\" },\n});\n","import { ThreadId, RunId, TurnId } from \"@effect-agent/core/Identifiers\";\nimport { IdGenerator } from \"@effect-agent/core/IdGenerator\";\nimport { RunContextPreparationPassthrough } from \"@effect-agent/engine/RunOptions\";\nimport { ThreadHistory } from \"@effect-agent/engine/ThreadHistory\";\nimport { Context, Deferred, Effect, Layer, Option, Ref, Schema } from \"effect\";\n\nimport {\n ActivityCatalog,\n ActivitySearchResult,\n ActivityUnavailable,\n FlightCatalog,\n FlightOption,\n FlightUnavailable,\n LodgingCatalog,\n LodgingOption,\n LodgingUnavailable,\n QuoteId,\n TravelGuidance,\n TravelPlannerToolkit,\n TravelPlannerToolkitLayer,\n} from \"./definition.ts\";\n\nexport class CatalogLifecycleCounts extends Schema.Class<CatalogLifecycleCounts>(\n \"CatalogLifecycleCounts\",\n)({\n acquired: Schema.Natural,\n finalized: Schema.Natural,\n}) {}\n\nexport class CatalogLifecycle extends Context.Service<\n CatalogLifecycle,\n {\n readonly markAcquired: Effect.Effect<void>;\n readonly markFinalized: Effect.Effect<void>;\n readonly counts: Effect.Effect<CatalogLifecycleCounts>;\n }\n>()(\"@effect-agent/testing/travel-planner/CatalogLifecycle\") {\n static readonly layerNoDeps = Layer.effect(\n this,\n Effect.gen(function* () {\n const acquired = yield* Ref.make(0);\n const finalized = yield* Ref.make(0);\n\n return CatalogLifecycle.of({\n markAcquired: Ref.update(acquired, (n) => n + 1),\n markFinalized: Ref.update(finalized, (n) => n + 1),\n counts: Effect.all({ acquired: Ref.get(acquired), finalized: Ref.get(finalized) }).pipe(\n Effect.map((counts) => CatalogLifecycleCounts.make(counts)),\n ),\n });\n }),\n );\n}\n\nconst flight = FlightOption.make({\n quoteId: Schema.decodeSync(QuoteId)(\"quote-sfo-lhr-001\"),\n flight: \"EA 218 · nonstop · SFO 18:40 → LHR 13:05+1\",\n estimatedCents: 180_000,\n currency: \"USD\",\n});\n\nconst lodging = LodgingOption.make({\n lodging: \"Bloomsbury House · refundable studio · 4 nights\",\n estimatedCents: 104_000,\n currency: \"USD\",\n});\n\nconst activities = ActivitySearchResult.make({\n activities: [\"British Museum timed entry\", \"Thames evening walk\"],\n});\n\n/**\n * Deterministic controls for a Tool batch whose completions are released in a\n * caller-selected order. This is intentionally a test fixture: it uses no\n * clock or sleep and lets engine scheduler tests prove parallel starts and\n * declaration-order prompt materialization.\n */\nexport interface TravelPlannerCompletionControls {\n readonly flightStarted: Effect.Effect<void>;\n readonly lodgingStarted: Effect.Effect<void>;\n readonly activityStarted: Effect.Effect<void>;\n readonly releaseFlight: Effect.Effect<void>;\n readonly releaseLodging: Effect.Effect<void>;\n readonly releaseActivity: Effect.Effect<void>;\n}\n\nexport const ReverseCompletionToolkitLayer = Effect.gen(function* () {\n const flightStarted = yield* Deferred.make<void>();\n const lodgingStarted = yield* Deferred.make<void>();\n const activityStarted = yield* Deferred.make<void>();\n const releaseFlight = yield* Deferred.make<void>();\n const releaseLodging = yield* Deferred.make<void>();\n const releaseActivity = yield* Deferred.make<void>();\n\n const awaitRelease = <A>(\n started: Deferred.Deferred<void>,\n release: Deferred.Deferred<void>,\n value: A,\n ) =>\n Deferred.succeed(started, undefined).pipe(\n Effect.andThen(Deferred.await(release)),\n Effect.as(value),\n );\n\n return {\n controls: {\n flightStarted: Deferred.await(flightStarted),\n lodgingStarted: Deferred.await(lodgingStarted),\n activityStarted: Deferred.await(activityStarted),\n releaseFlight: Deferred.succeed(releaseFlight, undefined).pipe(Effect.asVoid),\n releaseLodging: Deferred.succeed(releaseLodging, undefined).pipe(Effect.asVoid),\n releaseActivity: Deferred.succeed(releaseActivity, undefined).pipe(Effect.asVoid),\n },\n layer: TravelPlannerToolkit.toLayer({\n search_flights: () => awaitRelease(flightStarted, releaseFlight, flight),\n search_lodging: () => awaitRelease(lodgingStarted, releaseLodging, lodging),\n search_activities: () => awaitRelease(activityStarted, releaseActivity, activities),\n }),\n };\n});\n\nexport const FlightCatalogLayer = Layer.effect(\n FlightCatalog,\n Effect.gen(function* () {\n const lifecycle = yield* CatalogLifecycle;\n\n yield* Effect.acquireRelease(lifecycle.markAcquired, () => lifecycle.markFinalized);\n\n return FlightCatalog.of({\n search: (query) =>\n query.origin === query.destination\n ? Effect.fail(\n FlightUnavailable.make({\n query: `${query.origin}-${query.destination}`,\n message: \"Origin and destination must differ.\",\n }),\n )\n : Effect.succeed(flight),\n });\n }),\n);\n\nexport const LodgingCatalogLayer = Layer.effect(\n LodgingCatalog,\n Effect.gen(function* () {\n const lifecycle = yield* CatalogLifecycle;\n\n yield* Effect.acquireRelease(lifecycle.markAcquired, () => lifecycle.markFinalized);\n\n return LodgingCatalog.of({\n search: (query) =>\n query.nights < 1\n ? Effect.fail(\n LodgingUnavailable.make({\n query: query.destination,\n message: \"At least one night is required.\",\n }),\n )\n : Effect.succeed(lodging),\n });\n }),\n);\n\nexport const ActivityCatalogLayer = Layer.effect(\n ActivityCatalog,\n Effect.gen(function* () {\n const lifecycle = yield* CatalogLifecycle;\n\n yield* Effect.acquireRelease(lifecycle.markAcquired, () => lifecycle.markFinalized);\n\n return ActivityCatalog.of({\n search: (query) =>\n query.destination === \"\"\n ? Effect.fail(\n ActivityUnavailable.make({\n query: query.destination,\n message: \"Destination is required.\",\n }),\n )\n : Effect.succeed(activities),\n });\n }),\n);\n\n/** Stable supplier-side booking identity, minted deterministically from the idempotency key. */\nexport const BookingRef = Schema.NonEmptyString.pipe(\n Schema.brand(\"@effect-agent/testing/travel-planner/BookingRef\"),\n);\n\nexport type BookingRef = typeof BookingRef.Type;\n\n/** The supplier desk operations the P5 booking Tools and Steps invoke. */\nexport const SupplierOperation = Schema.Literals([\n \"book-flight\",\n \"cancel-booking\",\n \"reserve-flight\",\n \"reserve-lodging\",\n \"issue-confirmation\",\n]);\n\nexport type SupplierOperation = typeof SupplierOperation.Type;\n\n/**\n * One row of external supplier truth. The desk deduplicates by `idempotencyKey` — replaying a\n * call with the same key returns this exact record without creating a second booking — which is\n * precisely the honesty model of DUR-010: the framework never makes an external call\n * exactly-once; the supplier's idempotency key does.\n */\nexport class SupplierBookingRecord extends Schema.Class<SupplierBookingRecord>(\n \"@effect-agent/testing/travel-planner/SupplierBookingRecord\",\n)({\n bookingRef: BookingRef,\n idempotencyKey: Schema.NonEmptyString,\n operation: SupplierOperation,\n detail: Schema.NonEmptyString,\n status: Schema.Literals([\"confirmed\", \"cancelled\"]),\n}) {}\n\nexport class SupplierUnavailable extends Schema.TaggedError<SupplierUnavailable>()(\n \"SupplierUnavailable\",\n { message: Schema.String },\n) {}\n\nexport interface SupplierBookRequest {\n readonly operation: SupplierOperation;\n readonly idempotencyKey: string;\n readonly detail: string;\n}\n\n/** Controls returned by an armed crash window (`holdAfterWrite`). */\nexport interface SupplierHoldControls {\n /** Resolves once the armed call has performed its supplier write and is blocked. */\n readonly held: Effect.Effect<void>;\n /** Releases the blocked call (tests that interrupt the Attempt never call this). */\n readonly release: Effect.Effect<void>;\n}\n\n/** The desk-internal idempotency key of one cancellation: cancel is idempotent by bookingRef. */\nexport const cancelBookingIdempotencyKey = (bookingRef: string): string =>\n `cancel-booking:${bookingRef}`;\n\n/** The deterministic bookingRef the desk mints for one idempotency key. */\nexport const supplierBookingRefFor = (idempotencyKey: string): BookingRef =>\n Schema.decodeSync(BookingRef)(`ref:${idempotencyKey}`);\n\ninterface SupplierHoldWindow {\n readonly held: Deferred.Deferred<void>;\n readonly release: Deferred.Deferred<void>;\n}\n\ninterface SupplierDeskState {\n readonly bookings: ReadonlyMap<string, SupplierBookingRecord>;\n readonly counts: ReadonlyMap<string, number>;\n readonly holds: ReadonlyMap<string, SupplierHoldWindow>;\n}\n\n/**\n * The deterministic in-memory supplier: an idempotency-keyed booking store with per-key call\n * counters and injectable crash windows.\n *\n * - `book`/`cancel` always count the call (at-least-once execution stays observable), then\n * dedupe the external effect by idempotency key — the supplier-side contract the P5 Tools and\n * Steps rely on.\n * - `holdAfterWrite` arms a one-shot crash window: the next call with that key performs its\n * supplier write, signals `held`, and never returns. Interrupting the Attempt at that point\n * models \"the external effect happened but no outcome was recorded\" without any wall clock.\n * - `bookings`/`lookup` expose external truth for the reconciler and for never-fabricate\n * assertions.\n */\nexport class SupplierBookingDesk extends Context.Service<\n SupplierBookingDesk,\n {\n readonly book: (\n request: SupplierBookRequest,\n ) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;\n readonly cancel: (\n bookingRef: BookingRef,\n ) => Effect.Effect<SupplierBookingRecord, SupplierUnavailable>;\n readonly lookup: (\n idempotencyKey: string,\n ) => Effect.Effect<Option.Option<SupplierBookingRecord>>;\n readonly bookings: Effect.Effect<ReadonlyArray<SupplierBookingRecord>>;\n readonly callCount: (idempotencyKey: string) => Effect.Effect<number>;\n readonly holdAfterWrite: (idempotencyKey: string) => Effect.Effect<SupplierHoldControls>;\n }\n>()(\"@effect-agent/testing/travel-planner/SupplierBookingDesk\") {\n static readonly layer: Layer.Layer<SupplierBookingDesk> = Layer.effect(\n this,\n Effect.gen(function* () {\n const state = yield* Ref.make<SupplierDeskState>({\n bookings: new Map(),\n counts: new Map(),\n holds: new Map(),\n });\n\n const enterHold = (hold: Option.Option<SupplierHoldWindow>) =>\n Option.isSome(hold)\n ? Deferred.succeed(hold.value.held, undefined).pipe(\n Effect.andThen(Deferred.await(hold.value.release)),\n )\n : Effect.void;\n\n const book = (request: SupplierBookRequest) =>\n Ref.modify(state, (current) => {\n const counts = new Map(current.counts).set(\n request.idempotencyKey,\n (current.counts.get(request.idempotencyKey) ?? 0) + 1,\n );\n\n const existing = current.bookings.get(request.idempotencyKey);\n\n const record =\n existing ??\n SupplierBookingRecord.make({\n bookingRef: supplierBookingRefFor(request.idempotencyKey),\n idempotencyKey: request.idempotencyKey,\n operation: request.operation,\n detail: request.detail,\n status: \"confirmed\",\n });\n\n const bookings =\n existing === undefined\n ? new Map(current.bookings).set(request.idempotencyKey, record)\n : current.bookings;\n\n const hold = Option.fromNullishOr(current.holds.get(request.idempotencyKey));\n\n const holds = Option.isSome(hold)\n ? (() => {\n const next = new Map(current.holds);\n\n next.delete(request.idempotencyKey);\n\n return next;\n })()\n : current.holds;\n\n return [\n { record, hold },\n { bookings, counts, holds },\n ] as const;\n }).pipe(Effect.flatMap(({ hold, record }) => enterHold(hold).pipe(Effect.as(record))));\n\n const cancel = (bookingRef: BookingRef) =>\n Ref.modify(state, (current) => {\n const key = cancelBookingIdempotencyKey(bookingRef);\n const counts = new Map(current.counts).set(key, (current.counts.get(key) ?? 0) + 1);\n\n const existingEntry = [...current.bookings.entries()].find(\n ([, record]) => record.bookingRef === bookingRef,\n );\n\n if (existingEntry === undefined) {\n return [\n { record: Option.none<SupplierBookingRecord>(), hold: Option.none() },\n { ...current, counts },\n ] as const;\n }\n const [storeKey, existing] = existingEntry;\n\n const cancelled =\n existing.status === \"cancelled\"\n ? existing\n : SupplierBookingRecord.make({ ...existing, status: \"cancelled\" });\n\n const bookings = new Map(current.bookings).set(storeKey, cancelled);\n const hold = Option.fromNullishOr(current.holds.get(key));\n\n const holds = Option.isSome(hold)\n ? (() => {\n const next = new Map(current.holds);\n\n next.delete(key);\n\n return next;\n })()\n : current.holds;\n\n return [\n { record: Option.some(cancelled), hold },\n { bookings, counts, holds },\n ] as const;\n }).pipe(\n Effect.flatMap(({ hold, record }) =>\n Option.isNone(record)\n ? Effect.fail(\n SupplierUnavailable.make({\n message: `The supplier desk has no booking under ${bookingRef}.`,\n }),\n )\n : enterHold(hold).pipe(Effect.as(record.value)),\n ),\n );\n\n return SupplierBookingDesk.of({\n book,\n cancel,\n lookup: (idempotencyKey) =>\n Ref.get(state).pipe(\n Effect.map((current) => Option.fromNullishOr(current.bookings.get(idempotencyKey))),\n ),\n bookings: Ref.get(state).pipe(Effect.map((current) => [...current.bookings.values()])),\n callCount: (idempotencyKey) =>\n Ref.get(state).pipe(Effect.map((current) => current.counts.get(idempotencyKey) ?? 0)),\n holdAfterWrite: (idempotencyKey) =>\n Effect.gen(function* () {\n const held = yield* Deferred.make<void>();\n const release = yield* Deferred.make<void>();\n\n yield* Ref.update(state, (current) => ({\n ...current,\n holds: new Map(current.holds).set(idempotencyKey, { held, release }),\n }));\n\n return {\n held: Deferred.await(held),\n release: Deferred.succeed(release, undefined).pipe(Effect.asVoid),\n };\n }),\n });\n }),\n );\n}\n\nexport const TravelGuidanceLayer = Layer.succeed(\n TravelGuidance,\n TravelGuidance.of({\n instructions: (input) =>\n Effect.succeed(\n [\n \"You are the Effect Agent Travel Planner P1 interpreter fixture.\",\n `The user asked: ${input.request}`,\n \"Call search_flights, search_lodging, and search_activities exactly once in one Tool batch.\",\n \"Then return only a JSON object of exactly this shape, no prose:\",\n '{\"itineraries\": [{\"title\": \"<short itinerary name>\", \"route\": \"<origin-destination>\", \"dates\": \"<date range>\", \"flight\": \"<flight description from the Tool result>\", \"lodging\": \"<lodging description from the Tool result>\", \"activities\": [\"<activity>\", \"...\"], \"estimatedTotalCents\": <positive integer total in cents>, \"currency\": \"USD\", \"quoteId\": \"<quoteId from the flight Tool result>\", \"assumptions\": [\"<assumption>\", \"...\"], \"unresolvedConstraints\": [], \"nextAction\": \"review\"}]}',\n \"Use the Tool results verbatim; activity results may legitimately be an empty array.\",\n \"This is read-only planning. Require review before any mutation.\",\n ].join(\"\\n\"),\n ),\n }),\n);\n\nexport const DeterministicIdGeneratorLayer = Layer.effect(\n IdGenerator,\n Effect.gen(function* () {\n const thread = yield* Ref.make(0);\n const run = yield* Ref.make(0);\n const turn = yield* Ref.make(0);\n\n return IdGenerator.of({\n nextThreadId: Ref.updateAndGet(thread, (n) => n + 1).pipe(\n Effect.map((n) => Schema.decodeSync(ThreadId)(`thread-${n}`)),\n ),\n nextRunId: Ref.updateAndGet(run, (n) => n + 1).pipe(\n Effect.map((n) => Schema.decodeSync(RunId)(`run-${n}`)),\n ),\n nextTurnId: Ref.updateAndGet(turn, (n) => n + 1).pipe(\n Effect.map((n) => Schema.decodeSync(TurnId)(`turn-${n}`)),\n ),\n });\n }),\n);\n\nexport const TravelPlannerRuntimeLayer = Layer.mergeAll(\n RunContextPreparationPassthrough,\n ThreadHistory.layerTransient,\n TravelPlannerToolkitLayer,\n FlightCatalogLayer,\n LodgingCatalogLayer,\n ActivityCatalogLayer,\n TravelGuidanceLayer,\n DeterministicIdGeneratorLayer,\n).pipe(Layer.provide(CatalogLifecycle.layerNoDeps));\n"],"mappings":";;;;;;;;;AAKA,MAAa,cAAc,OAAO,eAAe,KAC/C,OAAO,MAAM,kDAAkD,CACjE;AAIA,MAAa,UAAU,OAAO,eAAe,KAC3C,OAAO,MAAM,8CAA8C,CAC7D;AAIA,IAAa,cAAb,cAAiC,OAAO,MAAmB,aAAa,CAAC,CAAC;CACxE,SAAS,OAAO;CAChB,QAAQ;CACR,aAAa;CACb,UAAU,OAAO;CACjB,QAAQ,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;CAChD,WAAW,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;CACnD,aAAa,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;CACrD,UAAU,OAAO,QAAQ,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