@effect-agent/testing 0.0.1-beta.5 → 0.1.0-beta.10

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/index.mjs CHANGED
@@ -2,9 +2,10 @@ import { McpConnectionRequest, McpConnector, McpServerIdentity, McpToolkitMismat
2
2
  import { Agent, AgentId, AgentPolicy, ConversationId, IdGenerator, RunId, SubmissionId, ToolCallId, TurnId } from "@effect-agent/core";
3
3
  import { DurableStep, DurableStepError, ToolExecutionClass } from "@effect-agent/engine";
4
4
  import { AbortCommand, AgentBindingResolver, ApprovalDecisionCommand, BatchId, CanonicalBatch, CanonicalRecordEnvelope, CertificationReport, CertificationSweepResult, CertificationTierThreeReport, CertifiedAdapterIdentity, ConversationCheckpoint, ConversationExportRequest, ConversationProjection, ConversationStore, DEFAULT_OWNERSHIP_LEASE_DURATION, DefinitionDigests, DeploymentId, Digest, DurableAgentRuntime, DurableRuntimeConfig, DurableRuntimeFailpoint, DurableRuntimeFailpointError, DurableRuntimeFailpointLocation, DurableRuntimeFailpointTestControl, DurableWorkerBinding, IdempotencyKey, LoadCheckpointRequest, ObligationThresholds, PersistedJson, Principal, ProducerId, ReconciliationCompleted, ReconciliationSafeToRetry, ReconciliationUncertain, RecordEnvelope, RecordId, ResolutionAbortSubmission, ResolutionCompletedWithResult, ResolutionNeverHappened, ResolutionSafeToRetry, SubmissionLedger, SubmissionLookupById, ToolReconciler, ToolReconcilerError, UnknownResolutionCommand, WakeScheduler, certifyPorts, childConversationIdFor, verifyConversationInvariants } from "@effect-agent/session";
5
- import { Cause, Clock, Context, DateTime, Deferred, Duration, Effect, Exit, Layer, Option, Ref, Schema, Stream } from "effect";
5
+ import { Cause, Clock, Context, DateTime, Deferred, Duration, Effect, Exit, Fiber, Layer, Option, Queue, Ref, Schema, Stream } from "effect";
6
6
  import { FastCheck, TestClock } from "effect/testing";
7
7
  import { AiError, LanguageModel, Model, Response, Tool, Toolkit } from "effect/unstable/ai";
8
+ import { CodeExecutionHost, CodeExecutionLimits, CodeExecutionNamespace, CodeExecutionProtocolError, CodeExecutionRequest, CodeExecutionResourceUse, CodeExecutionResult, CodeExecutionTimeoutError, CodeExecutor, CodeExecutorUnsupportedError, CodeHostCall, CodeHostCallFailure, CodeHostCallLimitError, CodeHostCallResult, CodeHostCallSuccess, CodeOutputLimitError, CodeProgramFailedError, CodeSourceError, NetworkAllowlist, NetworkDisabled, SandboxImplementation } from "@effect-agent/sandbox";
8
9
  import * as McpSchema from "effect/unstable/ai/McpSchema";
9
10
  //#region src/certification.ts
10
11
  /** The six Tier-2 scenario shapes in sweep order. */
@@ -28,6 +29,7 @@ const CERTIFICATION_SCENARIOS = [
28
29
  */
29
30
  const TIER2_UNREACHED_LOCATIONS = [
30
31
  "abort:after-intent",
32
+ "compaction:after-canonical-append",
31
33
  "resolve:after-intent",
32
34
  "subagent:after-child-abort-intent"
33
35
  ];
@@ -1260,6 +1262,566 @@ const runChaosPlan = Effect.fn("Chaos.runChaosPlan")(function* (plan, options) {
1260
1262
  });
1261
1263
  });
1262
1264
  //#endregion
1265
+ //#region src/code-executor-conformance.ts
1266
+ /**
1267
+ * Shared `CodeExecutor` conformance (TEST-015). Every adapter — the
1268
+ * deterministic `unisolated` substitute and each isolated adapter — runs
1269
+ * `codeExecutorConformanceCases` verbatim. Enforcement cases that only genuine
1270
+ * isolation can prove (ambient network denial, synchronous CPU runaway
1271
+ * termination) are NOT here; they belong to isolated adapters only
1272
+ * (testing spec §8.1).
1273
+ *
1274
+ * Cases assume the live `Clock` (the wall-clock case uses a short real
1275
+ * deadline) and take one fresh executor pass per case, so a suite may share
1276
+ * one executor Layer across cases.
1277
+ */
1278
+ var CodeExecutorConformanceViolation = class extends Schema.TaggedError()("CodeExecutorConformanceViolation", {
1279
+ caseName: Schema.String,
1280
+ message: Schema.String
1281
+ }) {};
1282
+ const baseLimits = CodeExecutionLimits.make({
1283
+ maxSourceBytes: 64 * 1024,
1284
+ maxWallTime: Duration.seconds(10),
1285
+ maxLogBytes: 16 * 1024,
1286
+ maxResultBytes: 64 * 1024,
1287
+ maxHostCalls: 8,
1288
+ maxHostCallArgumentBytes: 16 * 1024,
1289
+ maxHostCallResultBytes: 32 * 1024
1290
+ });
1291
+ const warehouseNamespace = CodeExecutionNamespace.make({
1292
+ name: "warehouse",
1293
+ methods: ["query", "count"]
1294
+ });
1295
+ const makeRequest = (source, overrides) => CodeExecutionRequest.make({
1296
+ language: "javascript",
1297
+ source,
1298
+ namespaces: overrides?.namespaces ?? [],
1299
+ network: overrides?.network ?? NetworkDisabled.make(),
1300
+ limits: overrides?.limits ?? baseLimits
1301
+ });
1302
+ const unusedHost = { call: () => Effect.die(/* @__PURE__ */ new Error("this conformance case expected no host call to reach the CodeExecutionHost")) };
1303
+ const respondingHost = (respond) => {
1304
+ const calls = [];
1305
+ return {
1306
+ calls,
1307
+ host: { call: (call) => Effect.sync(() => {
1308
+ calls.push(call);
1309
+ return respond(call);
1310
+ }) }
1311
+ };
1312
+ };
1313
+ const runPass = (request, host) => Effect.gen(function* () {
1314
+ return yield* (yield* CodeExecutor).execute(request).pipe(Effect.provideService(CodeExecutionHost, CodeExecutionHost.of(host)));
1315
+ }).pipe(Effect.scoped);
1316
+ const violation = (caseName, message) => CodeExecutorConformanceViolation.make({
1317
+ caseName,
1318
+ message
1319
+ });
1320
+ const preview = (value) => {
1321
+ try {
1322
+ return JSON.stringify(value)?.slice(0, 200) ?? String(value).slice(0, 200);
1323
+ } catch {
1324
+ return String(value).slice(0, 200);
1325
+ }
1326
+ };
1327
+ const expectSuccess = (caseName, request, host, check) => runPass(request, host).pipe(Effect.mapError((error) => violation(caseName, `expected success, got ${error._tag}: ${preview(error)}`)), Effect.flatMap((result) => {
1328
+ const complaint = check(result);
1329
+ return complaint === void 0 ? Effect.void : Effect.fail(violation(caseName, complaint));
1330
+ }));
1331
+ const expectFailure = (caseName, request, host, tag, check) => runPass(request, host).pipe(Effect.flip, Effect.mapError((result) => violation(caseName, `expected ${tag}, but the pass succeeded with ${preview(result.value)}`)), Effect.flatMap((error) => {
1332
+ if (error._tag !== tag) return Effect.fail(violation(caseName, `expected ${tag}, got ${error._tag}: ${preview(error)}`));
1333
+ const complaint = check?.(error);
1334
+ return complaint === void 0 ? Effect.void : Effect.fail(violation(caseName, complaint));
1335
+ }));
1336
+ const codeExecutorConformanceCases = (options) => {
1337
+ const posture = options.implementation;
1338
+ return [
1339
+ {
1340
+ name: "TEST-015 executes bounded JSON computation and returns the program value",
1341
+ run: expectSuccess("TEST-015 executes bounded JSON computation and returns the program value", makeRequest("async () => { const xs = [1, 2, 3].map((n) => n * 2); return { xs, sum: xs.reduce((a, b) => a + b, 0) }; }"), unusedHost, (result) => JSON.stringify(result.value) === JSON.stringify({
1342
+ xs: [
1343
+ 2,
1344
+ 4,
1345
+ 6
1346
+ ],
1347
+ sum: 12
1348
+ }) ? void 0 : `unexpected program value ${preview(result.value)}`)
1349
+ },
1350
+ {
1351
+ name: "CAP-015 reports its isolation posture honestly in results and errors",
1352
+ run: Effect.gen(function* () {
1353
+ const caseName = "CAP-015 reports its isolation posture honestly in results and errors";
1354
+ const result = yield* runPass(makeRequest("async () => 1"), unusedHost).pipe(Effect.mapError((error) => violation(caseName, `expected success, got ${error._tag}`)));
1355
+ if (result.implementation.isolation !== posture.isolation || result.implementation.identity !== posture.identity) return yield* violation(caseName, `result posture ${preview(result.implementation)} does not match the declared ${preview(posture)}`);
1356
+ const error = yield* runPass(makeRequest("async () => {"), unusedHost).pipe(Effect.flip, Effect.mapError(() => violation(caseName, "expected the invalid-source pass to fail")));
1357
+ if (error.implementation === void 0 || error.implementation.isolation !== posture.isolation || error.implementation.identity !== posture.identity) return yield* violation(caseName, `error posture ${preview(error.implementation)} does not match the declared ${preview(posture)}`);
1358
+ })
1359
+ },
1360
+ {
1361
+ name: "TEST-015 routes host calls through the CodeExecutionHost in program order",
1362
+ run: Effect.gen(function* () {
1363
+ const caseName = "TEST-015 routes host calls through the CodeExecutionHost in program order";
1364
+ const { host, calls } = respondingHost((call) => call.method === "query" ? CodeHostCallSuccess.make({ value: { rows: [
1365
+ 1,
1366
+ 2,
1367
+ 3
1368
+ ] } }) : CodeHostCallSuccess.make({ value: 3 }));
1369
+ const result = yield* runPass(makeRequest("async () => { const q = await warehouse.query({ sql: 'select' }); const c = await warehouse.count({ table: 't' }); return { rows: q.rows, count: c }; }", { namespaces: [warehouseNamespace] }), host).pipe(Effect.mapError((error) => violation(caseName, `expected success, got ${error._tag}: ${preview(error)}`)));
1370
+ if (JSON.stringify(result.value) !== JSON.stringify({
1371
+ rows: [
1372
+ 1,
1373
+ 2,
1374
+ 3
1375
+ ],
1376
+ count: 3
1377
+ })) return yield* violation(caseName, `unexpected value ${preview(result.value)}`);
1378
+ const observed = calls.map((call) => `${call.namespace}.${call.method}`);
1379
+ if (JSON.stringify(observed) !== JSON.stringify(["warehouse.query", "warehouse.count"])) return yield* violation(caseName, `unexpected host call order ${preview(observed)}`);
1380
+ if (result.resourceUse.hostCalls !== 2) return yield* violation(caseName, `expected 2 accounted host calls, got ${result.resourceUse.hostCalls}`);
1381
+ })
1382
+ },
1383
+ {
1384
+ name: "TEST-015 a caught failed host call lets the program branch on the envelope",
1385
+ run: expectSuccess("TEST-015 a caught failed host call lets the program branch on the envelope", makeRequest("async () => { try { await warehouse.query({ sql: 'x' }); return 'unreachable'; } catch (envelope) { return { caught: envelope }; } }", { namespaces: [warehouseNamespace] }), respondingHost(() => CodeHostCallFailure.make({ error: {
1386
+ _tag: "ToolInputError",
1387
+ message: "bad input"
1388
+ } })).host, (result) => JSON.stringify(result.value) === JSON.stringify({ caught: {
1389
+ _tag: "ToolInputError",
1390
+ message: "bad input"
1391
+ } }) ? void 0 : `the envelope did not round-trip: ${preview(result.value)}`)
1392
+ },
1393
+ {
1394
+ name: "TEST-015 an uncaught failed host call fails the program with the envelope",
1395
+ run: expectFailure("TEST-015 an uncaught failed host call fails the program with the envelope", makeRequest("async () => warehouse.query({ sql: 'x' })", { namespaces: [warehouseNamespace] }), respondingHost(() => CodeHostCallFailure.make({ error: {
1396
+ _tag: "PolicyDenied",
1397
+ message: "denied"
1398
+ } })).host, "CodeProgramFailedError", (error) => error._tag === "CodeProgramFailedError" && error.reason === "rejected" && JSON.stringify(error.thrown) === JSON.stringify({
1399
+ _tag: "PolicyDenied",
1400
+ message: "denied"
1401
+ }) ? void 0 : `unexpected failure detail ${preview(error)}`)
1402
+ },
1403
+ {
1404
+ name: "TEST-015 fails typed on syntactically invalid source",
1405
+ run: expectFailure("TEST-015 fails typed on syntactically invalid source", makeRequest("async () => {"), unusedHost, "CodeSourceError", (error) => error._tag === "CodeSourceError" && error.reason === "invalid" ? void 0 : `expected reason invalid, got ${preview(error)}`)
1406
+ },
1407
+ {
1408
+ name: "TEST-015 fails typed when the expression is not one async function",
1409
+ run: expectFailure("TEST-015 fails typed when the expression is not one async function", makeRequest("1 + 1"), unusedHost, "CodeSourceError", (error) => error._tag === "CodeSourceError" && error.reason === "not-a-function" ? void 0 : `expected reason not-a-function, got ${preview(error)}`)
1410
+ },
1411
+ {
1412
+ name: "TEST-015 fails typed on source larger than the declared byte limit",
1413
+ run: expectFailure("TEST-015 fails typed on source larger than the declared byte limit", makeRequest(`async () => "${"x".repeat(2e3)}"`, { limits: CodeExecutionLimits.make({
1414
+ ...baseLimits,
1415
+ maxSourceBytes: 256
1416
+ }) }), unusedHost, "CodeSourceError", (error) => error._tag === "CodeSourceError" && error.reason === "oversized" ? void 0 : `expected reason oversized, got ${preview(error)}`)
1417
+ },
1418
+ {
1419
+ name: "TEST-015 terminates a never-settling program at the wall-clock deadline",
1420
+ run: expectFailure("TEST-015 terminates a never-settling program at the wall-clock deadline", makeRequest("async () => { await new Promise(() => {}); return 1; }", { limits: CodeExecutionLimits.make({
1421
+ ...baseLimits,
1422
+ maxWallTime: Duration.millis(250)
1423
+ }) }), unusedHost, "CodeExecutionTimeoutError")
1424
+ },
1425
+ {
1426
+ name: "TEST-015 fails typed when console output exceeds its byte budget",
1427
+ run: expectFailure("TEST-015 fails typed when console output exceeds its byte budget", makeRequest("async () => { for (let i = 0; i < 64; i += 1) { console.log('x'.repeat(256)); } return 1; }", { limits: CodeExecutionLimits.make({
1428
+ ...baseLimits,
1429
+ maxLogBytes: 2048
1430
+ }) }), unusedHost, "CodeOutputLimitError", (error) => error._tag === "CodeOutputLimitError" && error.surface === "logs" ? void 0 : `expected surface logs, got ${preview(error)}`)
1431
+ },
1432
+ {
1433
+ name: "TEST-015 fails typed when the final result exceeds its byte budget",
1434
+ run: expectFailure("TEST-015 fails typed when the final result exceeds its byte budget", makeRequest("async () => 'y'.repeat(4096)", { limits: CodeExecutionLimits.make({
1435
+ ...baseLimits,
1436
+ maxResultBytes: 1024
1437
+ }) }), unusedHost, "CodeOutputLimitError", (error) => error._tag === "CodeOutputLimitError" && error.surface === "result" ? void 0 : `expected surface result, got ${preview(error)}`)
1438
+ },
1439
+ {
1440
+ name: "TEST-015 fails typed when host calls exceed the executor cap",
1441
+ run: Effect.gen(function* () {
1442
+ const caseName = "TEST-015 fails typed when host calls exceed the executor cap";
1443
+ const { host, calls } = respondingHost(() => CodeHostCallSuccess.make({ value: null }));
1444
+ yield* expectFailure(caseName, makeRequest("async () => { await warehouse.query({}); await warehouse.query({}); await warehouse.query({}); return 1; }", {
1445
+ namespaces: [warehouseNamespace],
1446
+ limits: CodeExecutionLimits.make({
1447
+ ...baseLimits,
1448
+ maxHostCalls: 2
1449
+ })
1450
+ }), host, "CodeHostCallLimitError");
1451
+ if (calls.length !== 2) return yield* violation(caseName, `expected exactly 2 dispatched host calls under a cap of 2, observed ${calls.length}`);
1452
+ })
1453
+ },
1454
+ {
1455
+ name: "TEST-015 fails typed on a host outcome outside the protocol schema",
1456
+ run: expectFailure("TEST-015 fails typed on a host outcome outside the protocol schema", makeRequest("async () => warehouse.query({})", { namespaces: [warehouseNamespace] }), { call: () => Effect.succeed({ bogus: true }) }, "CodeExecutionProtocolError")
1457
+ },
1458
+ {
1459
+ name: "TEST-015 surfaces an uncaught program throw with its bounded log capture",
1460
+ run: expectFailure("TEST-015 surfaces an uncaught program throw with its bounded log capture", makeRequest("async () => { console.log('before the failure'); throw new Error('deliberate'); }"), unusedHost, "CodeProgramFailedError", (error) => error._tag === "CodeProgramFailedError" && error.reason === "threw" && error.logs.some((line) => line.includes("before the failure")) ? void 0 : `expected a threw failure carrying the log capture, got ${preview(error)}`)
1461
+ },
1462
+ {
1463
+ name: "TEST-015 fails typed when the program returns a non-JSON value",
1464
+ run: expectFailure("TEST-015 fails typed when the program returns a non-JSON value", makeRequest("async () => (() => 1)"), unusedHost, "CodeProgramFailedError", (error) => error._tag === "CodeProgramFailedError" && error.reason === "non-json-result" ? void 0 : `expected reason non-json-result, got ${preview(error)}`)
1465
+ },
1466
+ {
1467
+ name: "CAP-015 rejects a network allowlist it cannot enforce with a typed unsupported error",
1468
+ run: expectFailure("CAP-015 rejects a network allowlist it cannot enforce with a typed unsupported error", makeRequest("async () => 1", { network: NetworkAllowlist.make({
1469
+ domains: ["example.com"],
1470
+ ports: [443]
1471
+ }) }), unusedHost, "CodeExecutorUnsupportedError", (error) => error._tag === "CodeExecutorUnsupportedError" && error.feature === "network" ? void 0 : `expected feature network, got ${preview(error)}`)
1472
+ },
1473
+ {
1474
+ name: "TEST-015 interruption reaches in-flight host calls and pass teardown",
1475
+ run: Effect.gen(function* () {
1476
+ const caseName = "TEST-015 interruption reaches in-flight host calls and pass teardown";
1477
+ const started = yield* Deferred.make();
1478
+ const witness = { hostCallInterrupted: false };
1479
+ const fiber = yield* runPass(makeRequest("async () => warehouse.query({})", { namespaces: [warehouseNamespace] }), { call: () => Deferred.succeed(started, void 0).pipe(Effect.andThen(Effect.never), Effect.ensuring(Effect.sync(() => {
1480
+ witness.hostCallInterrupted = true;
1481
+ }))) }).pipe(Effect.forkChild);
1482
+ if ((yield* Effect.raceFirst(Deferred.await(started).pipe(Effect.as("started")), Fiber.join(fiber).pipe(Effect.exit, Effect.as("exited")))) === "exited") return yield* violation(caseName, "the pass settled before any host call reached the CodeExecutionHost");
1483
+ yield* Fiber.interrupt(fiber);
1484
+ if (!witness.hostCallInterrupted) return yield* violation(caseName, "interrupting the pass did not interrupt the in-flight host call");
1485
+ })
1486
+ }
1487
+ ];
1488
+ };
1489
+ //#endregion
1490
+ //#region src/code-executor-substitute.ts
1491
+ /**
1492
+ * The deterministic in-process executor substitute (C1 of ADR-0017). It runs
1493
+ * the generated program on the host JavaScript engine with best-effort global
1494
+ * shadowing only, so it self-identifies as `unisolated` and is never a
1495
+ * security boundary (CAP-010, CAP-015). It exists to prove the public
1496
+ * `CodeExecutor` contract and to drive deterministic capability tests.
1497
+ */
1498
+ const inProcessCodeExecutorImplementation = SandboxImplementation.make({
1499
+ isolation: "unisolated",
1500
+ identity: "in-process-javascript"
1501
+ });
1502
+ const MAX_LOG_LINES = 4096;
1503
+ const MAX_LOG_LINE_CHARACTERS = 16e3;
1504
+ const MAX_THROWN_CHARACTERS = 4e3;
1505
+ const utf8ByteLength = (value) => new TextEncoder().encode(value).byteLength;
1506
+ /**
1507
+ * Ambient globals shadowed inside the harness. Shadowing blocks the obvious
1508
+ * identifier paths only; a determined program can still escape, which is
1509
+ * exactly why this executor reports `unisolated` and the isolated network and
1510
+ * CPU enforcement conformance cases run only against isolated adapters.
1511
+ */
1512
+ const shadowedGlobals = [
1513
+ "fetch",
1514
+ "process",
1515
+ "require",
1516
+ "module",
1517
+ "exports",
1518
+ "global",
1519
+ "globalThis",
1520
+ "XMLHttpRequest",
1521
+ "WebSocket",
1522
+ "Deno",
1523
+ "Bun"
1524
+ ];
1525
+ var LogLimitSignal = class {
1526
+ observed;
1527
+ constructor(observed) {
1528
+ this.observed = observed;
1529
+ }
1530
+ };
1531
+ var EvaluationThrew = class {
1532
+ inner;
1533
+ constructor(inner) {
1534
+ this.inner = inner;
1535
+ }
1536
+ };
1537
+ var NotAFunction = class {
1538
+ actual;
1539
+ constructor(actual) {
1540
+ this.actual = actual;
1541
+ }
1542
+ };
1543
+ /**
1544
+ * Total, defect-free rendering of untrusted values: a hostile Proxy can throw
1545
+ * from property access, `toString`, and `Symbol.toPrimitive`, and an expected
1546
+ * program failure must never escape the typed channel as a defect while its
1547
+ * diagnostics are being serialized.
1548
+ */
1549
+ const formatLogValue = (value) => {
1550
+ try {
1551
+ if (typeof value === "string") return value;
1552
+ return JSON.stringify(value) ?? String(value);
1553
+ } catch {
1554
+ try {
1555
+ return String(value);
1556
+ } catch {
1557
+ return "[unprintable value]";
1558
+ }
1559
+ }
1560
+ };
1561
+ const makeConsole = (capture, limits) => {
1562
+ const write = (...values) => {
1563
+ const joined = values.map(formatLogValue).join(" ");
1564
+ const line = joined.length > MAX_LOG_LINE_CHARACTERS ? `${joined.slice(0, MAX_LOG_LINE_CHARACTERS - 1)}…` : joined;
1565
+ const bytes = utf8ByteLength(line);
1566
+ if (capture.lines.length >= MAX_LOG_LINES || capture.bytes + bytes > limits.maxLogBytes) throw new LogLimitSignal(capture.bytes + bytes);
1567
+ capture.lines.push(line);
1568
+ capture.bytes += bytes;
1569
+ };
1570
+ return {
1571
+ debug: write,
1572
+ error: write,
1573
+ info: write,
1574
+ log: write,
1575
+ warn: write
1576
+ };
1577
+ };
1578
+ const buildNamespaceObject = (namespace, offer) => {
1579
+ const methods = {};
1580
+ for (const method of namespace.methods) methods[method] = (argument) => new Promise((resolve, reject) => {
1581
+ offer({
1582
+ namespace: namespace.name,
1583
+ method,
1584
+ argument,
1585
+ resolve,
1586
+ reject
1587
+ });
1588
+ });
1589
+ return methods;
1590
+ };
1591
+ const boundedText = (value) => {
1592
+ try {
1593
+ return (value instanceof Error ? `${value.name}: ${value.message}` : formatLogValue(value)).slice(0, MAX_THROWN_CHARACTERS);
1594
+ } catch {
1595
+ return "[unserializable thrown value]";
1596
+ }
1597
+ };
1598
+ /** Schema decoding of hostile values may itself throw through trap getters. */
1599
+ const safeDecodeJson = (value) => {
1600
+ try {
1601
+ return Schema.decodeUnknownOption(Schema.Json)(value);
1602
+ } catch {
1603
+ return Option.none();
1604
+ }
1605
+ };
1606
+ const boundedThrown = (value) => {
1607
+ const decoded = safeDecodeJson(value);
1608
+ if (Option.isSome(decoded)) try {
1609
+ const encoded = JSON.stringify(decoded.value);
1610
+ if (encoded !== void 0 && encoded.length <= MAX_THROWN_CHARACTERS) return decoded.value;
1611
+ } catch {}
1612
+ return boundedText(value);
1613
+ };
1614
+ const encodedJsonByteLength = (value) => {
1615
+ try {
1616
+ const encoded = JSON.stringify(value);
1617
+ return encoded === void 0 ? void 0 : utf8ByteLength(encoded);
1618
+ } catch {
1619
+ return;
1620
+ }
1621
+ };
1622
+ /** Host outcomes are protocol input; a hostile value must not defect mid-decode. */
1623
+ const decodeHostOutcome = (value) => {
1624
+ try {
1625
+ return Schema.decodeUnknownOption(CodeHostCallResult)(value);
1626
+ } catch {
1627
+ return Option.none();
1628
+ }
1629
+ };
1630
+ const validateRequest = (request) => Effect.gen(function* () {
1631
+ if (request.network._tag !== "NetworkDisabled") return yield* CodeExecutorUnsupportedError.make({
1632
+ implementation: inProcessCodeExecutorImplementation,
1633
+ feature: "network",
1634
+ message: "The unisolated in-process executor cannot enforce an egress allowlist; only NetworkDisabled is accepted, and even that is shadowed rather than enforced"
1635
+ });
1636
+ if (request.limits.cpuMillis !== void 0) return yield* CodeExecutorUnsupportedError.make({
1637
+ implementation: inProcessCodeExecutorImplementation,
1638
+ feature: "cpu-limit",
1639
+ message: "The unisolated in-process executor shares the host engine and cannot enforce a CPU limit"
1640
+ });
1641
+ const reservedNames = /* @__PURE__ */ new Set([...shadowedGlobals, "console"]);
1642
+ const seen = /* @__PURE__ */ new Set();
1643
+ for (const namespace of request.namespaces) {
1644
+ if (reservedNames.has(namespace.name) || seen.has(namespace.name)) return yield* CodeExecutorUnsupportedError.make({
1645
+ implementation: inProcessCodeExecutorImplementation,
1646
+ feature: "namespaces",
1647
+ message: `Namespace ${namespace.name} collides with a harness binding or another namespace`
1648
+ });
1649
+ seen.add(namespace.name);
1650
+ }
1651
+ const sourceBytes = utf8ByteLength(request.source);
1652
+ if (sourceBytes > request.limits.maxSourceBytes) return yield* CodeSourceError.make({
1653
+ implementation: inProcessCodeExecutorImplementation,
1654
+ reason: "oversized",
1655
+ message: `Source is ${sourceBytes} bytes; the request allows ${request.limits.maxSourceBytes}`
1656
+ });
1657
+ });
1658
+ const serveHostCalls = (host, queue, limits, capture, counter) => Effect.gen(function* () {
1659
+ while (true) {
1660
+ const pending = yield* Queue.take(queue);
1661
+ counter.calls += 1;
1662
+ if (counter.calls > limits.maxHostCalls) return yield* CodeHostCallLimitError.make({
1663
+ implementation: inProcessCodeExecutorImplementation,
1664
+ limit: limits.maxHostCalls,
1665
+ logs: [...capture.lines]
1666
+ });
1667
+ const argument = safeDecodeJson(pending.argument);
1668
+ if (Option.isNone(argument)) {
1669
+ pending.reject(/* @__PURE__ */ new TypeError("host call arguments must be JSON values"));
1670
+ continue;
1671
+ }
1672
+ const argumentBytes = encodedJsonByteLength(argument.value);
1673
+ if (argumentBytes === void 0 || argumentBytes > limits.maxHostCallArgumentBytes) return yield* CodeOutputLimitError.make({
1674
+ implementation: inProcessCodeExecutorImplementation,
1675
+ surface: "host-call-argument",
1676
+ limit: limits.maxHostCallArgumentBytes,
1677
+ observed: argumentBytes ?? 0,
1678
+ logs: [...capture.lines]
1679
+ });
1680
+ const rawOutcome = yield* host.call(CodeHostCall.make({
1681
+ namespace: pending.namespace,
1682
+ method: pending.method,
1683
+ argument: argument.value
1684
+ }));
1685
+ const outcome = decodeHostOutcome(rawOutcome);
1686
+ if (Option.isNone(outcome)) return yield* CodeExecutionProtocolError.make({
1687
+ implementation: inProcessCodeExecutorImplementation,
1688
+ message: "The execution host returned a value outside the CodeHostCallResult schema"
1689
+ });
1690
+ if (outcome.value._tag === "CodeHostCallFailure") {
1691
+ pending.reject(outcome.value.error);
1692
+ continue;
1693
+ }
1694
+ const resultBytes = encodedJsonByteLength(outcome.value.value);
1695
+ if (resultBytes === void 0 || resultBytes > limits.maxHostCallResultBytes) return yield* CodeOutputLimitError.make({
1696
+ implementation: inProcessCodeExecutorImplementation,
1697
+ surface: "host-call-result",
1698
+ limit: limits.maxHostCallResultBytes,
1699
+ observed: resultBytes ?? 0,
1700
+ logs: [...capture.lines]
1701
+ });
1702
+ pending.resolve(outcome.value.value);
1703
+ }
1704
+ });
1705
+ const classifyProgramFailure = (thrown, limits, capture) => {
1706
+ const inner = thrown instanceof EvaluationThrew ? thrown.inner : thrown;
1707
+ if (inner instanceof LogLimitSignal) return CodeOutputLimitError.make({
1708
+ implementation: inProcessCodeExecutorImplementation,
1709
+ surface: "logs",
1710
+ limit: limits.maxLogBytes,
1711
+ observed: inner.observed,
1712
+ logs: [...capture.lines]
1713
+ });
1714
+ if (inner instanceof NotAFunction) return CodeSourceError.make({
1715
+ implementation: inProcessCodeExecutorImplementation,
1716
+ reason: "not-a-function",
1717
+ message: `The source expression evaluated to ${inner.actual}; it must evaluate to one async function`
1718
+ });
1719
+ const reason = thrown instanceof EvaluationThrew || inner instanceof Error ? "threw" : "rejected";
1720
+ return CodeProgramFailedError.make({
1721
+ implementation: inProcessCodeExecutorImplementation,
1722
+ reason,
1723
+ thrown: boundedThrown(inner),
1724
+ message: boundedText(inner),
1725
+ logs: [...capture.lines]
1726
+ });
1727
+ };
1728
+ const executeInProcess = Effect.fn("InProcessCodeExecutor.execute")(function* (request) {
1729
+ yield* validateRequest(request);
1730
+ const host = yield* CodeExecutionHost;
1731
+ const capture = {
1732
+ lines: [],
1733
+ bytes: 0
1734
+ };
1735
+ const counter = { calls: 0 };
1736
+ const queue = yield* Queue.unbounded();
1737
+ const factory = yield* Effect.try({
1738
+ try: () => new Function(...shadowedGlobals, "console", ...request.namespaces.map((namespace) => namespace.name), `"use strict";\nreturn (\n${request.source}\n);`),
1739
+ catch: (cause) => CodeSourceError.make({
1740
+ implementation: inProcessCodeExecutorImplementation,
1741
+ reason: "invalid",
1742
+ message: boundedText(cause)
1743
+ })
1744
+ });
1745
+ const harnessConsole = makeConsole(capture, request.limits);
1746
+ let issuedHostCalls = 0;
1747
+ const namespaceObjects = request.namespaces.map((namespace) => buildNamespaceObject(namespace, (pending) => {
1748
+ issuedHostCalls += 1;
1749
+ if (issuedHostCalls > request.limits.maxHostCalls + 1) {
1750
+ pending.reject(/* @__PURE__ */ new Error(`host-call limit of ${request.limits.maxHostCalls} exceeded`));
1751
+ return;
1752
+ }
1753
+ Queue.offerUnsafe(queue, pending);
1754
+ }));
1755
+ const server = yield* serveHostCalls(host, queue, request.limits, capture, counter).pipe(Effect.forkScoped);
1756
+ const program = Effect.tryPromise({
1757
+ try: async () => {
1758
+ let candidate;
1759
+ try {
1760
+ candidate = factory(...shadowedGlobals.map(() => void 0), harnessConsole, ...namespaceObjects);
1761
+ } catch (cause) {
1762
+ throw new EvaluationThrew(cause);
1763
+ }
1764
+ if (typeof candidate !== "function") throw new EvaluationThrew(new NotAFunction(typeof candidate));
1765
+ let outcome;
1766
+ try {
1767
+ outcome = candidate();
1768
+ } catch (cause) {
1769
+ throw new EvaluationThrew(cause);
1770
+ }
1771
+ return await Promise.resolve(outcome);
1772
+ },
1773
+ catch: (thrown) => classifyProgramFailure(thrown, request.limits, capture)
1774
+ });
1775
+ const startedAt = yield* Clock.currentTimeMillis;
1776
+ const returned = yield* Effect.raceFirst(program, Fiber.join(server)).pipe(Effect.timeoutOrElse({
1777
+ duration: request.limits.maxWallTime,
1778
+ orElse: () => CodeExecutionTimeoutError.make({
1779
+ implementation: inProcessCodeExecutorImplementation,
1780
+ kind: "wall-clock",
1781
+ maxWallTime: request.limits.maxWallTime,
1782
+ logs: [...capture.lines]
1783
+ })
1784
+ }), Effect.ensuring(Fiber.interrupt(server)));
1785
+ const finishedAt = yield* Clock.currentTimeMillis;
1786
+ if (issuedHostCalls > request.limits.maxHostCalls) return yield* CodeHostCallLimitError.make({
1787
+ implementation: inProcessCodeExecutorImplementation,
1788
+ limit: request.limits.maxHostCalls,
1789
+ logs: [...capture.lines]
1790
+ });
1791
+ const value = yield* Schema.decodeUnknownEffect(Schema.Json)(returned).pipe(Effect.mapError(() => CodeProgramFailedError.make({
1792
+ implementation: inProcessCodeExecutorImplementation,
1793
+ reason: "non-json-result",
1794
+ thrown: null,
1795
+ message: "The program must return a JSON value",
1796
+ logs: [...capture.lines]
1797
+ })));
1798
+ const resultBytes = encodedJsonByteLength(value);
1799
+ if (resultBytes === void 0 || resultBytes > request.limits.maxResultBytes) return yield* CodeOutputLimitError.make({
1800
+ implementation: inProcessCodeExecutorImplementation,
1801
+ surface: "result",
1802
+ limit: request.limits.maxResultBytes,
1803
+ observed: resultBytes ?? 0,
1804
+ logs: [...capture.lines]
1805
+ });
1806
+ return CodeExecutionResult.make({
1807
+ implementation: inProcessCodeExecutorImplementation,
1808
+ value,
1809
+ logs: [...capture.lines],
1810
+ resourceUse: CodeExecutionResourceUse.make({
1811
+ wallTime: Duration.millis(Math.max(0, finishedAt - startedAt)),
1812
+ hostCalls: counter.calls,
1813
+ logBytes: capture.bytes,
1814
+ resultBytes
1815
+ })
1816
+ });
1817
+ });
1818
+ /**
1819
+ * Layer providing the unisolated in-process `CodeExecutor` substitute. The
1820
+ * per-pass `CodeExecutionHost` stays in the caller's requirement channel, the
1821
+ * same as every real adapter.
1822
+ */
1823
+ const inProcessCodeExecutorLayer = Layer.succeed(CodeExecutor)(CodeExecutor.of({ execute: executeInProcess }));
1824
+ //#endregion
1263
1825
  //#region src/fixtures/docs-researcher/definition.ts
1264
1826
  const ResearchDocumentId = Schema.NonEmptyString.check(Schema.isMaxLength(64)).pipe(Schema.brand("@effect-agent/testing/docs-researcher/ResearchDocumentId"));
1265
1827
  const BoundedTitle = Schema.NonEmptyString.check(Schema.isMaxLength(120));
@@ -3958,6 +4520,8 @@ const phase6TravelPlannerGoldenEvidence = [
3958
4520
  runId: "run:{submissionId}",
3959
4521
  turnId: "turn:run:{submissionId}:1",
3960
4522
  turn: 1,
4523
+ inputTokens: 128,
4524
+ outputTokens: 96,
3961
4525
  messages: { content: [
3962
4526
  {
3963
4527
  options: {},
@@ -4099,6 +4663,8 @@ const phase6TravelPlannerGoldenEvidence = [
4099
4663
  runId: "run:{submissionId}",
4100
4664
  turnId: "turn:run:{submissionId}:2",
4101
4665
  turn: 2,
4666
+ inputTokens: 128,
4667
+ outputTokens: 96,
4102
4668
  messages: { content: [{
4103
4669
  options: {},
4104
4670
  role: "assistant",
@@ -4200,6 +4766,6 @@ const PHASE7_LIVE_CREDENTIAL_ENV = "OPENAI_API_KEY";
4200
4766
  */
4201
4767
  const phase7LiveProfileEnabled = (env) => env["EFFECT_AGENT_LIVE"] === "1" && (env["OPENAI_API_KEY"] ?? "") !== "";
4202
4768
  //#endregion
4203
- export { ActivityCatalog, ActivityCatalogLayer, ActivityQuery, ActivitySearchResult, ActivityUnavailable, AirportCode, BookFlight, BookItinerary, BookingRef, BoundedSummary, CERTIFICATION_SCENARIOS, CancelBooking, CancelBookingRequest, CancellationConfirmation, CatalogLifecycle, CatalogLifecycleCounts, ChaosApprovalDecision, ChaosConvergenceFailure, ChaosLaneReport, ChaosPlan, ChaosPlanReport, ChaosResolutionKind, ChaosScenarioKind, ChaosSubmissionSpec, DEFAULT_CHAOS_SEED, DestinationBrief, DestinationFacts, DestinationGuide, DestinationGuideLayer, DestinationGuideUnavailable, DestinationQuery, DestinationRecommendation, DestinationReport, DestinationResearchFailed, DestinationResearchFindings, DestinationResearchRequest, DestinationResearchSupportLayer, DestinationResearcher, DestinationResearcherToolkit, DestinationResearcherToolkitLayer, DestinationShortlist, DeterministicIdGeneratorLayer, DocContentToolkit, DocSummarizer, DocsMcpDiscoveryEvidence, DocsResearcher, DocsResearcherToolkit, DocumentLibrary, DocumentQuery, DocumentSummary, DocumentSummaryFailed, DocumentUnavailable, DurableSearchActivities, DurableSearchFlights, DurableSearchLodging, FetchDocument, FlightBookingRequest, FlightCatalog, FlightCatalogLayer, FlightOption, FlightQuery, FlightUnavailable, GuidanceFailure, HoldItinerary, Itinerary, ItineraryBookingRequest, ItineraryConfirmation, ItineraryHold, ItineraryHoldGateway, ItineraryHoldRequest, ItineraryHoldUnavailable, LodgingCatalog, LodgingCatalogLayer, LodgingOption, LodgingQuery, LodgingUnavailable, LookupDestination, PHASE7_LIVE_CREDENTIAL_ENV, PHASE7_LIVE_GATE_ENV, QuoteId, ResearchDigest, ResearchDispatchGate, ResearchDocument, ResearchDocumentId, ResearchMission, ResearchRequest, ReverseCompletionToolkitLayer, ScriptedGeneratePart, ScriptedGenerateTurn, ScriptedModel, ScriptedStreamPart, ScriptedStreamTermination, ScriptedStreamTurn, ScriptedTurn, SearchActivities, SearchFlights, SearchLodging, SummaryBrief, SummaryFinding, SummaryRequest, SupplierBookingConfirmation, SupplierBookingDesk, SupplierBookingRecord, SupplierOperation, SupplierUnavailable, TIER2_UNREACHED_LOCATIONS, TravelBookingReport, TravelCoordinator, TravelCoordinatorToolkit, TravelGuidance, TravelGuidanceLayer, TravelPlan, TravelPlanner, TravelPlannerBookingEvidenceError, TravelPlannerBookingProfile, TravelPlannerCloudflareProfile, TravelPlannerDurabilityProfile, TravelPlannerDurableEvidenceError, TravelPlannerPersistenceProfile, TravelPlannerPhase2, TravelPlannerPhase2Toolkit, TravelPlannerPhase2ToolkitLayer, TravelPlannerPhase4, TravelPlannerPhase4Toolkit, TravelPlannerPhase4ToolkitLayer, TravelPlannerPhase5, TravelPlannerPhase5Toolkit, TravelPlannerPhase5ToolkitLayer, TravelPlannerPhase7Profile, TravelPlannerProjectionError, TravelPlannerRuntimeLayer, TravelPlannerSubagentDurabilityProfile, TravelPlannerToolkit, TravelPlannerToolkitLayer, TravelSupplierReconcilerLayer, TravelerRef, TripRequest, assertDiscoveryMatchesAuthoredToolkit, assertSettledBookingsExistAtSupplier, bookFlightIdempotencyKey, cancelBookingIdempotencyKey, certifyDurableAdapters, chaosSeedFromEnv, coordinatorConfidentialMarker, coordinatorResearchTurn, coordinatorShortlistTurn, delegateDocumentSummary, destinationLookup, destinationReportFor, destinationResearchDelegation, destinationResearchHandlersLayer, destinationResearchPolicy, docContentToolkitLayer, docsCoordinatorConfidentialMarker, docsCoordinatorDigests, docsDocumentBodySecret, docsMcpConnectorLayer, docsMcpIdentity, docsMcpMismatchedConnectorLayer, docsMcpOversizedConnectorLayer, docsMcpRequest, docsMissionConfidentialMarker, docsResearcherDeploymentId, docsResearcherPrincipal, docsResearcherProducerId, docsResearcherSubmitAgent, docsResearcherSubmitOptions, docsSummarizerDigestStrings, docsSummarizerDigests, docsSummaryHandlersLayer, documentBodyPhrase, documentSummaryFor, documentSummaryPolicy, durableChildLookupCallId, durableDestinationResearchHandlersLayer, durableResearchAllocation, durableResearchCallId, durableResearchFinding, durableResearchShortlist, encodedDestinationFacts, encodedDestinationReport, encodedDocumentSummary, expectedDestinationShortlist, expectedResearchDigest, expectedTravelPlan, fetchCallId, generateChaosPlans, itineraryStepIdempotencyKey, makeDestinationResearcherModel, makeDocsResearcherHarness, makeDurableResearchHarness, makeInvocationCountingModel, makePhase3TravelPlannerCheckpoint, makePhase4TravelPlannerAgent, makePhase6TravelPlannerBindings, mapResearchChildFailure, mapSummaryChildFailure, missionConfidentialMarker, normalizeCrossPlatformTravelPlannerEvidence, normalizeDurableTravelPlannerEvidence, phase0HappyPathTurns, phase0Trip, phase1HappyPathTurns, phase1Trip, phase3TravelPlannerBatches, phase3TravelPlannerCompletionBatch, phase3TravelPlannerConversationId, phase3TravelPlannerDefinitionDigests, phase3TravelPlannerEncodedFixture, phase3TravelPlannerInitialBatch, phase3TravelPlannerProducerId, phase3TravelPlannerProfile, phase3TravelPlannerRunId, phase4TravelPlannerDefinitionDigests, phase4TravelPlannerDeploymentId, phase4TravelPlannerPrincipal, phase4TravelPlannerProducerId, phase4TravelPlannerProfile, phase4TravelPlannerSubmitOptions, phase4TravelPlannerWorkerLayer, phase5TravelPlannerDefinitionDigests, phase5TravelPlannerDeploymentId, phase5TravelPlannerPrincipal, phase5TravelPlannerProducerId, phase5TravelPlannerProfile, phase5TravelPlannerSubmitOptions, phase5TravelPlannerWorkerLayer, phase6ActivityCallId, phase6BookingModel, phase6BookingRef, phase6BookingToolCallId, phase6BookingTrip, phase6ChildLookupCallId, phase6CoordinatorModel, phase6FlightCallId, phase6GatedPlannerDefinitionDigests, phase6GatedPlannerModel, phase6GatedTrip, phase6GuideInvocationCount, phase6LodgingCallId, phase6PlannerModel, phase6ResearchDestination, phase6ResearchMission, phase6ResearcherModel, phase6SupplierDesk, phase6SupplierDeskLayer, phase6SupplierReconcilerLayer, phase6TravelPlannerDeploymentId, phase6TravelPlannerGoldenEvidence, phase6TravelPlannerProducerId, phase6TravelPlannerProducerPrefix, phase6TravelPlannerProfile, phase7LiveProfileEnabled, phase7TravelPlannerProfile, redactedDocumentPreview, releasePhase6PlannerGate, releasePhase6ResearcherGate, researchCorpusDocumentIds, researchDocumentFor, researchDocumentLookup, researchMission, researchMissionRequest, researcherHappyPathTurns, resetPhase6PlannerGate, resetPhase6ResearcherGate, resolveTierThree, runChaosPlan, s2CoordinatorDigests, s2CoordinatorSubmitAgent, s2ResearcherDigestStrings, s2ResearcherDigests, s2TravelPlannerDeploymentId, s2TravelPlannerPrincipal, s2TravelPlannerProducerId, s2TravelPlannerProfile, s2TravelPlannerSubmitOptions, summarizeCallId, supplierBookingRefFor, tier2NeverFiredLocations, travelPlanFromDurableSettlement, travelPlanFromProjection };
4769
+ export { ActivityCatalog, ActivityCatalogLayer, ActivityQuery, ActivitySearchResult, ActivityUnavailable, AirportCode, BookFlight, BookItinerary, BookingRef, BoundedSummary, CERTIFICATION_SCENARIOS, CancelBooking, CancelBookingRequest, CancellationConfirmation, CatalogLifecycle, CatalogLifecycleCounts, ChaosApprovalDecision, ChaosConvergenceFailure, ChaosLaneReport, ChaosPlan, ChaosPlanReport, ChaosResolutionKind, ChaosScenarioKind, ChaosSubmissionSpec, CodeExecutorConformanceViolation, DEFAULT_CHAOS_SEED, DestinationBrief, DestinationFacts, DestinationGuide, DestinationGuideLayer, DestinationGuideUnavailable, DestinationQuery, DestinationRecommendation, DestinationReport, DestinationResearchFailed, DestinationResearchFindings, DestinationResearchRequest, DestinationResearchSupportLayer, DestinationResearcher, DestinationResearcherToolkit, DestinationResearcherToolkitLayer, DestinationShortlist, DeterministicIdGeneratorLayer, DocContentToolkit, DocSummarizer, DocsMcpDiscoveryEvidence, DocsResearcher, DocsResearcherToolkit, DocumentLibrary, DocumentQuery, DocumentSummary, DocumentSummaryFailed, DocumentUnavailable, DurableSearchActivities, DurableSearchFlights, DurableSearchLodging, FetchDocument, FlightBookingRequest, FlightCatalog, FlightCatalogLayer, FlightOption, FlightQuery, FlightUnavailable, GuidanceFailure, HoldItinerary, Itinerary, ItineraryBookingRequest, ItineraryConfirmation, ItineraryHold, ItineraryHoldGateway, ItineraryHoldRequest, ItineraryHoldUnavailable, LodgingCatalog, LodgingCatalogLayer, LodgingOption, LodgingQuery, LodgingUnavailable, LookupDestination, PHASE7_LIVE_CREDENTIAL_ENV, PHASE7_LIVE_GATE_ENV, QuoteId, ResearchDigest, ResearchDispatchGate, ResearchDocument, ResearchDocumentId, ResearchMission, ResearchRequest, ReverseCompletionToolkitLayer, ScriptedGeneratePart, ScriptedGenerateTurn, ScriptedModel, ScriptedStreamPart, ScriptedStreamTermination, ScriptedStreamTurn, ScriptedTurn, SearchActivities, SearchFlights, SearchLodging, SummaryBrief, SummaryFinding, SummaryRequest, SupplierBookingConfirmation, SupplierBookingDesk, SupplierBookingRecord, SupplierOperation, SupplierUnavailable, TIER2_UNREACHED_LOCATIONS, TravelBookingReport, TravelCoordinator, TravelCoordinatorToolkit, TravelGuidance, TravelGuidanceLayer, TravelPlan, TravelPlanner, TravelPlannerBookingEvidenceError, TravelPlannerBookingProfile, TravelPlannerCloudflareProfile, TravelPlannerDurabilityProfile, TravelPlannerDurableEvidenceError, TravelPlannerPersistenceProfile, TravelPlannerPhase2, TravelPlannerPhase2Toolkit, TravelPlannerPhase2ToolkitLayer, TravelPlannerPhase4, TravelPlannerPhase4Toolkit, TravelPlannerPhase4ToolkitLayer, TravelPlannerPhase5, TravelPlannerPhase5Toolkit, TravelPlannerPhase5ToolkitLayer, TravelPlannerPhase7Profile, TravelPlannerProjectionError, TravelPlannerRuntimeLayer, TravelPlannerSubagentDurabilityProfile, TravelPlannerToolkit, TravelPlannerToolkitLayer, TravelSupplierReconcilerLayer, TravelerRef, TripRequest, assertDiscoveryMatchesAuthoredToolkit, assertSettledBookingsExistAtSupplier, bookFlightIdempotencyKey, cancelBookingIdempotencyKey, certifyDurableAdapters, chaosSeedFromEnv, codeExecutorConformanceCases, coordinatorConfidentialMarker, coordinatorResearchTurn, coordinatorShortlistTurn, delegateDocumentSummary, destinationLookup, destinationReportFor, destinationResearchDelegation, destinationResearchHandlersLayer, destinationResearchPolicy, docContentToolkitLayer, docsCoordinatorConfidentialMarker, docsCoordinatorDigests, docsDocumentBodySecret, docsMcpConnectorLayer, docsMcpIdentity, docsMcpMismatchedConnectorLayer, docsMcpOversizedConnectorLayer, docsMcpRequest, docsMissionConfidentialMarker, docsResearcherDeploymentId, docsResearcherPrincipal, docsResearcherProducerId, docsResearcherSubmitAgent, docsResearcherSubmitOptions, docsSummarizerDigestStrings, docsSummarizerDigests, docsSummaryHandlersLayer, documentBodyPhrase, documentSummaryFor, documentSummaryPolicy, durableChildLookupCallId, durableDestinationResearchHandlersLayer, durableResearchAllocation, durableResearchCallId, durableResearchFinding, durableResearchShortlist, encodedDestinationFacts, encodedDestinationReport, encodedDocumentSummary, expectedDestinationShortlist, expectedResearchDigest, expectedTravelPlan, fetchCallId, generateChaosPlans, inProcessCodeExecutorImplementation, inProcessCodeExecutorLayer, itineraryStepIdempotencyKey, makeDestinationResearcherModel, makeDocsResearcherHarness, makeDurableResearchHarness, makeInvocationCountingModel, makePhase3TravelPlannerCheckpoint, makePhase4TravelPlannerAgent, makePhase6TravelPlannerBindings, mapResearchChildFailure, mapSummaryChildFailure, missionConfidentialMarker, normalizeCrossPlatformTravelPlannerEvidence, normalizeDurableTravelPlannerEvidence, phase0HappyPathTurns, phase0Trip, phase1HappyPathTurns, phase1Trip, phase3TravelPlannerBatches, phase3TravelPlannerCompletionBatch, phase3TravelPlannerConversationId, phase3TravelPlannerDefinitionDigests, phase3TravelPlannerEncodedFixture, phase3TravelPlannerInitialBatch, phase3TravelPlannerProducerId, phase3TravelPlannerProfile, phase3TravelPlannerRunId, phase4TravelPlannerDefinitionDigests, phase4TravelPlannerDeploymentId, phase4TravelPlannerPrincipal, phase4TravelPlannerProducerId, phase4TravelPlannerProfile, phase4TravelPlannerSubmitOptions, phase4TravelPlannerWorkerLayer, phase5TravelPlannerDefinitionDigests, phase5TravelPlannerDeploymentId, phase5TravelPlannerPrincipal, phase5TravelPlannerProducerId, phase5TravelPlannerProfile, phase5TravelPlannerSubmitOptions, phase5TravelPlannerWorkerLayer, phase6ActivityCallId, phase6BookingModel, phase6BookingRef, phase6BookingToolCallId, phase6BookingTrip, phase6ChildLookupCallId, phase6CoordinatorModel, phase6FlightCallId, phase6GatedPlannerDefinitionDigests, phase6GatedPlannerModel, phase6GatedTrip, phase6GuideInvocationCount, phase6LodgingCallId, phase6PlannerModel, phase6ResearchDestination, phase6ResearchMission, phase6ResearcherModel, phase6SupplierDesk, phase6SupplierDeskLayer, phase6SupplierReconcilerLayer, phase6TravelPlannerDeploymentId, phase6TravelPlannerGoldenEvidence, phase6TravelPlannerProducerId, phase6TravelPlannerProducerPrefix, phase6TravelPlannerProfile, phase7LiveProfileEnabled, phase7TravelPlannerProfile, redactedDocumentPreview, releasePhase6PlannerGate, releasePhase6ResearcherGate, researchCorpusDocumentIds, researchDocumentFor, researchDocumentLookup, researchMission, researchMissionRequest, researcherHappyPathTurns, resetPhase6PlannerGate, resetPhase6ResearcherGate, resolveTierThree, runChaosPlan, s2CoordinatorDigests, s2CoordinatorSubmitAgent, s2ResearcherDigestStrings, s2ResearcherDigests, s2TravelPlannerDeploymentId, s2TravelPlannerPrincipal, s2TravelPlannerProducerId, s2TravelPlannerProfile, s2TravelPlannerSubmitOptions, summarizeCallId, supplierBookingRefFor, tier2NeverFiredLocations, travelPlanFromDurableSettlement, travelPlanFromProjection };
4204
4770
 
4205
4771
  //# sourceMappingURL=index.mjs.map