@effect-agent/testing 0.0.1-beta.6 → 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.d.mts CHANGED
@@ -141,7 +141,7 @@ declare const ChaosPlan_base: Schema.Class<ChaosPlan, Schema.Struct<{
141
141
  readonly lanes: Schema.Int;
142
142
  readonly submissions: Schema.NonEmptyArray<typeof ChaosSubmissionSpec>;
143
143
  /** Coordinator failpoint arms, consumed one per round (each fails every hit that round). */
144
- readonly failpointArms: Schema.$Array<Schema.Literals<readonly ["submit:after-admit", "submit:after-materialize", "claim:after-claim", "input:after-canonical-append", "turn:after-canonical-append", "turn:after-response-append", "turn:after-results-append", "tools:after-prepared-append", "step:after-step-append", "approval:after-request-append", "approval:after-suspend", "join:after-claim", "join:after-canonical-append", "resolve:after-intent", "terminalize:after-reserve", "terminalize:after-canonical-append", "abort:after-intent", "subagent:after-reserve", "subagent:after-request-append", "subagent:after-admit", "subagent:after-child-ready", "subagent:after-start-append", "subagent:after-sibling-settle", "subagent:after-suspend", "subagent:after-child-abort-intent", "subagent:after-join-append", "subagent:after-release-pending", "subagent:after-release"]>>;
144
+ readonly failpointArms: Schema.$Array<Schema.Literals<readonly ["submit:after-admit", "submit:after-materialize", "claim:after-claim", "input:after-canonical-append", "turn:after-canonical-append", "turn:after-response-append", "turn:after-results-append", "compaction:after-canonical-append", "tools:after-prepared-append", "step:after-step-append", "approval:after-request-append", "approval:after-suspend", "join:after-claim", "join:after-canonical-append", "resolve:after-intent", "terminalize:after-reserve", "terminalize:after-canonical-append", "abort:after-intent", "subagent:after-reserve", "subagent:after-request-append", "subagent:after-admit", "subagent:after-child-ready", "subagent:after-start-append", "subagent:after-sibling-settle", "subagent:after-suspend", "subagent:after-child-abort-intent", "subagent:after-join-append", "subagent:after-release-pending", "subagent:after-release"]>>;
145
145
  /** Adapter-owned failpoint arms (e.g. SQLite `ledger:*`/`append:*` locations). */
146
146
  readonly adapterArms: Schema.$Array<Schema.String>;
147
147
  /** Flattened submission indices to abort mid-plan (modulo the submission count). */
@@ -365,7 +365,7 @@ declare const delegateDocumentSummary: import("@effect-agent/capabilities").Suba
365
365
  readonly failure: typeof DocumentUnavailable;
366
366
  readonly failureMode: "error";
367
367
  }, DocumentLibrary>;
368
- }, typeof SummaryRequest, typeof SummaryFinding, typeof DocumentSummaryFailed, never, never>;
368
+ }, typeof SummaryRequest, typeof SummaryFinding, typeof DocumentSummaryFailed, never, never, "error">;
369
369
  /** Total mapping from every expected child Run failure to the declared Tool failure (SUB-028). */
370
370
  declare const mapSummaryChildFailure: (failure: {
371
371
  readonly _tag: string;
@@ -401,10 +401,20 @@ declare class ResearchDigest extends ResearchDigest_base {}
401
401
  declare const docsCoordinatorConfidentialMarker = "docs-coordinator-vault-19x";
402
402
  declare const docsMissionConfidentialMarker = "docs-mission-dossier-42f";
403
403
  declare const DocsResearcherToolkit: Toolkit.Toolkit<{
404
- readonly delegate_document_summary: import("@effect-agent/capabilities").SubagentTool<"delegate_document_summary", typeof SummaryRequest, typeof SummaryFinding, typeof DocumentSummaryFailed>;
404
+ readonly delegate_document_summary: Tool.Tool<"delegate_document_summary", {
405
+ readonly parameters: typeof SummaryRequest;
406
+ readonly success: typeof SummaryFinding;
407
+ readonly failure: import("@effect-agent/capabilities").SubagentToolFailure<typeof DocumentSummaryFailed>;
408
+ readonly failureMode: "error";
409
+ }, import("@effect-agent/engine").AgentSpawner | import("@effect-agent/core").IdGenerator | import("@effect-agent/engine").RunEventSink | import("@effect-agent/engine").SubagentDurability>;
405
410
  }>;
406
411
  declare const DocsResearcher: import("@effect-agent/core").Definition<typeof ResearchRequest, typeof ResearchDigest, string, Toolkit.Toolkit<{
407
- readonly delegate_document_summary: import("@effect-agent/capabilities").SubagentTool<"delegate_document_summary", typeof SummaryRequest, typeof SummaryFinding, typeof DocumentSummaryFailed>;
412
+ readonly delegate_document_summary: Tool.Tool<"delegate_document_summary", {
413
+ readonly parameters: typeof SummaryRequest;
414
+ readonly success: typeof SummaryFinding;
415
+ readonly failure: import("@effect-agent/capabilities").SubagentToolFailure<typeof DocumentSummaryFailed>;
416
+ readonly failureMode: "error";
417
+ }, import("@effect-agent/engine").AgentSpawner | import("@effect-agent/core").IdGenerator | import("@effect-agent/engine").RunEventSink | import("@effect-agent/engine").SubagentDurability>;
408
418
  }>>;
409
419
  /** The default two-document research mission. */
410
420
  declare const researchMissionRequest: ResearchRequest;
@@ -983,6 +993,42 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
983
993
  readonly createdAt: string;
984
994
  readonly deploymentId: string;
985
995
  readonly payload: {
996
+ readonly _tag: "AbortRequested";
997
+ readonly submissionId: string;
998
+ readonly author: string;
999
+ readonly reason: string;
1000
+ } | {
1001
+ readonly _tag: "ToolCallResolved";
1002
+ readonly runId: string;
1003
+ readonly toolCallId: string;
1004
+ readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
1005
+ readonly author: string;
1006
+ readonly reason: string;
1007
+ } | {
1008
+ readonly _tag: "ToolCallPrepared";
1009
+ readonly runId: string;
1010
+ readonly turnId: string;
1011
+ readonly turn: number;
1012
+ readonly toolCallId: string;
1013
+ readonly toolName: string;
1014
+ readonly parameters: Schema.Json;
1015
+ readonly parametersDigest: string;
1016
+ } | {
1017
+ readonly _tag: "ToolCallUnknown";
1018
+ readonly runId: string;
1019
+ readonly turn: number;
1020
+ readonly toolCallId: string;
1021
+ readonly toolName: string;
1022
+ readonly reason: string;
1023
+ } | {
1024
+ readonly _tag: "ToolApprovalDecided";
1025
+ readonly runId: string;
1026
+ readonly turn: number;
1027
+ readonly toolCallId: string;
1028
+ readonly decision: "approved" | "denied";
1029
+ readonly resolver: string;
1030
+ readonly reason: string;
1031
+ } | {
986
1032
  readonly _tag: "ConversationCreated";
987
1033
  readonly agentId: string;
988
1034
  readonly definitions: {
@@ -1007,15 +1053,9 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1007
1053
  readonly turn: number;
1008
1054
  readonly messages: Schema.Json;
1009
1055
  readonly messagesDigest: string;
1010
- } | {
1011
- readonly _tag: "ToolCallPrepared";
1012
- readonly runId: string;
1013
- readonly turnId: string;
1014
- readonly turn: number;
1015
- readonly toolCallId: string;
1016
- readonly toolName: string;
1017
- readonly parameters: Schema.Json;
1018
- readonly parametersDigest: string;
1056
+ readonly inputTokens?: number | undefined;
1057
+ readonly outputTokens?: number | undefined;
1058
+ readonly costMicrousd?: number | undefined;
1019
1059
  } | {
1020
1060
  readonly _tag: "ToolCallSettled";
1021
1061
  readonly runId: string;
@@ -1023,20 +1063,6 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1023
1063
  readonly toolName: string;
1024
1064
  readonly result: Schema.Json;
1025
1065
  readonly isFailure: boolean;
1026
- } | {
1027
- readonly _tag: "ToolCallUnknown";
1028
- readonly runId: string;
1029
- readonly turn: number;
1030
- readonly toolCallId: string;
1031
- readonly toolName: string;
1032
- readonly reason: string;
1033
- } | {
1034
- readonly _tag: "ToolCallResolved";
1035
- readonly runId: string;
1036
- readonly toolCallId: string;
1037
- readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
1038
- readonly author: string;
1039
- readonly reason: string;
1040
1066
  } | {
1041
1067
  readonly _tag: "ToolStepSettled";
1042
1068
  readonly runId: string;
@@ -1052,14 +1078,6 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1052
1078
  readonly toolCallId: string;
1053
1079
  readonly toolName: string;
1054
1080
  readonly parametersDigest: string;
1055
- } | {
1056
- readonly _tag: "ToolApprovalDecided";
1057
- readonly runId: string;
1058
- readonly turn: number;
1059
- readonly toolCallId: string;
1060
- readonly decision: "approved" | "denied";
1061
- readonly resolver: string;
1062
- readonly reason: string;
1063
1081
  } | {
1064
1082
  readonly _tag: "ModelResponseInterrupted";
1065
1083
  readonly runId: string;
@@ -1069,8 +1087,10 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1069
1087
  } | {
1070
1088
  readonly _tag: "CompactionCreated";
1071
1089
  readonly runId: string;
1072
- readonly sourceDigest: string;
1073
- readonly summary: string;
1090
+ readonly turn: number;
1091
+ readonly kind: "clear-tool-results" | "summarize";
1092
+ readonly coversThrough: number;
1093
+ readonly summary?: string | undefined;
1074
1094
  } | {
1075
1095
  readonly _tag: "RunFailed";
1076
1096
  readonly runId: string;
@@ -1079,11 +1099,6 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1079
1099
  readonly _tag: "RunCompleted";
1080
1100
  readonly runId: string;
1081
1101
  readonly output: Schema.Json;
1082
- } | {
1083
- readonly _tag: "AbortRequested";
1084
- readonly submissionId: string;
1085
- readonly author: string;
1086
- readonly reason: string;
1087
1102
  } | {
1088
1103
  readonly _tag: "SubmissionSettled";
1089
1104
  readonly submissionId: string;
@@ -1092,6 +1107,7 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1092
1107
  readonly outcome: "aborted" | "completed" | "failed";
1093
1108
  readonly runId?: string | undefined;
1094
1109
  readonly result?: Schema.Json | undefined;
1110
+ readonly finishReason?: "budget-exhausted" | undefined;
1095
1111
  } | {
1096
1112
  readonly _tag: "SubagentRequested";
1097
1113
  readonly runId: string;
@@ -1163,6 +1179,42 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1163
1179
  readonly createdAt: string;
1164
1180
  readonly deploymentId: string;
1165
1181
  readonly payload: {
1182
+ readonly _tag: "AbortRequested";
1183
+ readonly submissionId: string;
1184
+ readonly author: string;
1185
+ readonly reason: string;
1186
+ } | {
1187
+ readonly _tag: "ToolCallResolved";
1188
+ readonly runId: string;
1189
+ readonly toolCallId: string;
1190
+ readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
1191
+ readonly author: string;
1192
+ readonly reason: string;
1193
+ } | {
1194
+ readonly _tag: "ToolCallPrepared";
1195
+ readonly runId: string;
1196
+ readonly turnId: string;
1197
+ readonly turn: number;
1198
+ readonly toolCallId: string;
1199
+ readonly toolName: string;
1200
+ readonly parameters: Schema.Json;
1201
+ readonly parametersDigest: string;
1202
+ } | {
1203
+ readonly _tag: "ToolCallUnknown";
1204
+ readonly runId: string;
1205
+ readonly turn: number;
1206
+ readonly toolCallId: string;
1207
+ readonly toolName: string;
1208
+ readonly reason: string;
1209
+ } | {
1210
+ readonly _tag: "ToolApprovalDecided";
1211
+ readonly runId: string;
1212
+ readonly turn: number;
1213
+ readonly toolCallId: string;
1214
+ readonly decision: "approved" | "denied";
1215
+ readonly resolver: string;
1216
+ readonly reason: string;
1217
+ } | {
1166
1218
  readonly _tag: "ConversationCreated";
1167
1219
  readonly agentId: string;
1168
1220
  readonly definitions: {
@@ -1187,15 +1239,9 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1187
1239
  readonly turn: number;
1188
1240
  readonly messages: Schema.Json;
1189
1241
  readonly messagesDigest: string;
1190
- } | {
1191
- readonly _tag: "ToolCallPrepared";
1192
- readonly runId: string;
1193
- readonly turnId: string;
1194
- readonly turn: number;
1195
- readonly toolCallId: string;
1196
- readonly toolName: string;
1197
- readonly parameters: Schema.Json;
1198
- readonly parametersDigest: string;
1242
+ readonly inputTokens?: number | undefined;
1243
+ readonly outputTokens?: number | undefined;
1244
+ readonly costMicrousd?: number | undefined;
1199
1245
  } | {
1200
1246
  readonly _tag: "ToolCallSettled";
1201
1247
  readonly runId: string;
@@ -1203,20 +1249,6 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1203
1249
  readonly toolName: string;
1204
1250
  readonly result: Schema.Json;
1205
1251
  readonly isFailure: boolean;
1206
- } | {
1207
- readonly _tag: "ToolCallUnknown";
1208
- readonly runId: string;
1209
- readonly turn: number;
1210
- readonly toolCallId: string;
1211
- readonly toolName: string;
1212
- readonly reason: string;
1213
- } | {
1214
- readonly _tag: "ToolCallResolved";
1215
- readonly runId: string;
1216
- readonly toolCallId: string;
1217
- readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
1218
- readonly author: string;
1219
- readonly reason: string;
1220
1252
  } | {
1221
1253
  readonly _tag: "ToolStepSettled";
1222
1254
  readonly runId: string;
@@ -1232,14 +1264,6 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1232
1264
  readonly toolCallId: string;
1233
1265
  readonly toolName: string;
1234
1266
  readonly parametersDigest: string;
1235
- } | {
1236
- readonly _tag: "ToolApprovalDecided";
1237
- readonly runId: string;
1238
- readonly turn: number;
1239
- readonly toolCallId: string;
1240
- readonly decision: "approved" | "denied";
1241
- readonly resolver: string;
1242
- readonly reason: string;
1243
1267
  } | {
1244
1268
  readonly _tag: "ModelResponseInterrupted";
1245
1269
  readonly runId: string;
@@ -1249,8 +1273,10 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1249
1273
  } | {
1250
1274
  readonly _tag: "CompactionCreated";
1251
1275
  readonly runId: string;
1252
- readonly sourceDigest: string;
1253
- readonly summary: string;
1276
+ readonly turn: number;
1277
+ readonly kind: "clear-tool-results" | "summarize";
1278
+ readonly coversThrough: number;
1279
+ readonly summary?: string | undefined;
1254
1280
  } | {
1255
1281
  readonly _tag: "RunFailed";
1256
1282
  readonly runId: string;
@@ -1259,11 +1285,6 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1259
1285
  readonly _tag: "RunCompleted";
1260
1286
  readonly runId: string;
1261
1287
  readonly output: Schema.Json;
1262
- } | {
1263
- readonly _tag: "AbortRequested";
1264
- readonly submissionId: string;
1265
- readonly author: string;
1266
- readonly reason: string;
1267
1288
  } | {
1268
1289
  readonly _tag: "SubmissionSettled";
1269
1290
  readonly submissionId: string;
@@ -1272,6 +1293,7 @@ declare const phase3TravelPlannerEncodedFixture: readonly {
1272
1293
  readonly outcome: "aborted" | "completed" | "failed";
1273
1294
  readonly runId?: string | undefined;
1274
1295
  readonly result?: Schema.Json | undefined;
1296
+ readonly finishReason?: "budget-exhausted" | undefined;
1275
1297
  } | {
1276
1298
  readonly _tag: "SubagentRequested";
1277
1299
  readonly runId: string;
@@ -2772,7 +2794,7 @@ declare const destinationResearchDelegation: import("@effect-agent/capabilities"
2772
2794
  readonly failure: typeof DestinationGuideUnavailable;
2773
2795
  readonly failureMode: "error";
2774
2796
  }, DestinationGuide>;
2775
- }, typeof DestinationResearchRequest, typeof DestinationResearchFindings, typeof DestinationResearchFailed, ResearchDispatchGate, never>;
2797
+ }, typeof DestinationResearchRequest, typeof DestinationResearchFindings, typeof DestinationResearchFailed, ResearchDispatchGate, never, "error">;
2776
2798
  /** Total mapping from every expected child Run failure to the declared Tool failure (SUB-028). */
2777
2799
  declare const mapResearchChildFailure: (failure: {
2778
2800
  readonly _tag: string;
@@ -2807,10 +2829,20 @@ declare class DestinationShortlist extends DestinationShortlist_base {}
2807
2829
  declare const coordinatorConfidentialMarker = "coordinator-vault-7q42";
2808
2830
  declare const missionConfidentialMarker = "traveler-dossier-19f";
2809
2831
  declare const TravelCoordinatorToolkit: Toolkit.Toolkit<{
2810
- readonly delegate_destination_research: import("@effect-agent/capabilities").SubagentTool<"delegate_destination_research", typeof DestinationResearchRequest, typeof DestinationResearchFindings, typeof DestinationResearchFailed>;
2832
+ readonly delegate_destination_research: Tool.Tool<"delegate_destination_research", {
2833
+ readonly parameters: typeof DestinationResearchRequest;
2834
+ readonly success: typeof DestinationResearchFindings;
2835
+ readonly failure: import("@effect-agent/capabilities").SubagentToolFailure<typeof DestinationResearchFailed>;
2836
+ readonly failureMode: "error";
2837
+ }, import("@effect-agent/engine").AgentSpawner | import("@effect-agent/core").IdGenerator | import("@effect-agent/engine").RunEventSink | import("@effect-agent/engine").SubagentDurability>;
2811
2838
  }>;
2812
2839
  declare const TravelCoordinator: import("@effect-agent/core").Definition<typeof ResearchMission, typeof DestinationShortlist, string, Toolkit.Toolkit<{
2813
- readonly delegate_destination_research: import("@effect-agent/capabilities").SubagentTool<"delegate_destination_research", typeof DestinationResearchRequest, typeof DestinationResearchFindings, typeof DestinationResearchFailed>;
2840
+ readonly delegate_destination_research: Tool.Tool<"delegate_destination_research", {
2841
+ readonly parameters: typeof DestinationResearchRequest;
2842
+ readonly success: typeof DestinationResearchFindings;
2843
+ readonly failure: import("@effect-agent/capabilities").SubagentToolFailure<typeof DestinationResearchFailed>;
2844
+ readonly failureMode: "error";
2845
+ }, import("@effect-agent/engine").AgentSpawner | import("@effect-agent/core").IdGenerator | import("@effect-agent/engine").RunEventSink | import("@effect-agent/engine").SubagentDurability>;
2814
2846
  }>>;
2815
2847
  declare const researchMission: ResearchMission;
2816
2848
  declare const expectedDestinationShortlist: DestinationShortlist;
package/dist/index.mjs CHANGED
@@ -29,6 +29,7 @@ const CERTIFICATION_SCENARIOS = [
29
29
  */
30
30
  const TIER2_UNREACHED_LOCATIONS = [
31
31
  "abort:after-intent",
32
+ "compaction:after-canonical-append",
32
33
  "resolve:after-intent",
33
34
  "subagent:after-child-abort-intent"
34
35
  ];
@@ -4519,6 +4520,8 @@ const phase6TravelPlannerGoldenEvidence = [
4519
4520
  runId: "run:{submissionId}",
4520
4521
  turnId: "turn:run:{submissionId}:1",
4521
4522
  turn: 1,
4523
+ inputTokens: 128,
4524
+ outputTokens: 96,
4522
4525
  messages: { content: [
4523
4526
  {
4524
4527
  options: {},
@@ -4660,6 +4663,8 @@ const phase6TravelPlannerGoldenEvidence = [
4660
4663
  runId: "run:{submissionId}",
4661
4664
  turnId: "turn:run:{submissionId}:2",
4662
4665
  turn: 2,
4666
+ inputTokens: 128,
4667
+ outputTokens: 96,
4663
4668
  messages: { content: [{
4664
4669
  options: {},
4665
4670
  role: "assistant",