@effect-agent/storage-cloudflare 0.1.0-beta.77 → 0.1.0-beta.78

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.
@@ -350,6 +350,81 @@ declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCall | Le
350
350
  readonly createdAt: string;
351
351
  readonly deploymentId: string;
352
352
  readonly payload: {
353
+ readonly _tag: "SubmissionSettled";
354
+ readonly submissionId: string;
355
+ readonly settlementId: string;
356
+ readonly receiptId: string;
357
+ readonly outcome: "aborted" | "completed" | "failed";
358
+ readonly runId?: string | undefined;
359
+ readonly result?: Schema.Json | undefined;
360
+ readonly runDisposition?: Schema.Json | undefined;
361
+ readonly finishReason?: "budget-exhausted" | undefined;
362
+ readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
363
+ readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
364
+ readonly usageSummary?: {
365
+ readonly modelCalls: number;
366
+ readonly inputTokens: {
367
+ readonly total: number;
368
+ readonly uncached: number;
369
+ readonly cacheRead: number;
370
+ readonly cacheWrite: number;
371
+ };
372
+ readonly outputTokens: {
373
+ readonly total: number;
374
+ readonly text: number;
375
+ readonly reasoning: number;
376
+ };
377
+ readonly costMicrousd: number;
378
+ readonly byModel: readonly {
379
+ readonly provider: string;
380
+ readonly model: string;
381
+ readonly responseModel?: string | undefined;
382
+ readonly serviceTier?: string | undefined;
383
+ readonly pricingVersion?: string | undefined;
384
+ readonly modelCalls: number;
385
+ readonly inputTokens: {
386
+ readonly total: number;
387
+ readonly uncached: number;
388
+ readonly cacheRead: number;
389
+ readonly cacheWrite: number;
390
+ };
391
+ readonly outputTokens: {
392
+ readonly total: number;
393
+ readonly text: number;
394
+ readonly reasoning: number;
395
+ };
396
+ readonly costMicrousd: number;
397
+ }[];
398
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
399
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
400
+ readonly unobservedModelCalls?: number | undefined;
401
+ } | undefined;
402
+ readonly uncommittedModelUsage?: readonly {
403
+ readonly provider: string;
404
+ readonly model: string;
405
+ readonly serviceTier?: string | undefined;
406
+ readonly pricingVersion?: string | undefined;
407
+ readonly response?: {
408
+ readonly id?: string | undefined;
409
+ readonly model?: string | undefined;
410
+ } | undefined;
411
+ readonly purpose?: "summary" | "turn" | undefined;
412
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
413
+ readonly pricingStatus?: "estimated" | "unknown" | undefined;
414
+ readonly inputTokens: {
415
+ readonly total: number;
416
+ readonly uncached: number;
417
+ readonly cacheRead: number;
418
+ readonly cacheWrite: number;
419
+ };
420
+ readonly outputTokens: {
421
+ readonly total: number;
422
+ readonly text: number;
423
+ readonly reasoning: number;
424
+ };
425
+ readonly costMicrousd: number;
426
+ }[] | undefined;
427
+ } | {
353
428
  readonly _tag: "ThreadCreated";
354
429
  readonly agentId: string;
355
430
  readonly definitions: {
@@ -529,81 +604,6 @@ declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCall | Le
529
604
  readonly submissionId: string;
530
605
  readonly author: string;
531
606
  readonly reason: string;
532
- } | {
533
- readonly _tag: "SubmissionSettled";
534
- readonly submissionId: string;
535
- readonly settlementId: string;
536
- readonly receiptId: string;
537
- readonly outcome: "aborted" | "completed" | "failed";
538
- readonly runId?: string | undefined;
539
- readonly result?: Schema.Json | undefined;
540
- readonly runDisposition?: Schema.Json | undefined;
541
- readonly finishReason?: "budget-exhausted" | undefined;
542
- readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
543
- readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
544
- readonly usageSummary?: {
545
- readonly modelCalls: number;
546
- readonly inputTokens: {
547
- readonly total: number;
548
- readonly uncached: number;
549
- readonly cacheRead: number;
550
- readonly cacheWrite: number;
551
- };
552
- readonly outputTokens: {
553
- readonly total: number;
554
- readonly text: number;
555
- readonly reasoning: number;
556
- };
557
- readonly costMicrousd: number;
558
- readonly byModel: readonly {
559
- readonly provider: string;
560
- readonly model: string;
561
- readonly responseModel?: string | undefined;
562
- readonly serviceTier?: string | undefined;
563
- readonly pricingVersion?: string | undefined;
564
- readonly modelCalls: number;
565
- readonly inputTokens: {
566
- readonly total: number;
567
- readonly uncached: number;
568
- readonly cacheRead: number;
569
- readonly cacheWrite: number;
570
- };
571
- readonly outputTokens: {
572
- readonly total: number;
573
- readonly text: number;
574
- readonly reasoning: number;
575
- };
576
- readonly costMicrousd: number;
577
- }[];
578
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
579
- readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
580
- readonly unobservedModelCalls?: number | undefined;
581
- } | undefined;
582
- readonly uncommittedModelUsage?: readonly {
583
- readonly provider: string;
584
- readonly model: string;
585
- readonly serviceTier?: string | undefined;
586
- readonly pricingVersion?: string | undefined;
587
- readonly response?: {
588
- readonly id?: string | undefined;
589
- readonly model?: string | undefined;
590
- } | undefined;
591
- readonly purpose?: "summary" | "turn" | undefined;
592
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
593
- readonly pricingStatus?: "estimated" | "unknown" | undefined;
594
- readonly inputTokens: {
595
- readonly total: number;
596
- readonly uncached: number;
597
- readonly cacheRead: number;
598
- readonly cacheWrite: number;
599
- };
600
- readonly outputTokens: {
601
- readonly total: number;
602
- readonly text: number;
603
- readonly reasoning: number;
604
- };
605
- readonly costMicrousd: number;
606
- }[] | undefined;
607
607
  } | {
608
608
  readonly _tag: "SubagentRequested";
609
609
  readonly runId: string;
@@ -674,6 +674,24 @@ declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCall | Le
674
674
  readonly childResultDigest: string;
675
675
  readonly projectedResultDigest: string;
676
676
  readonly usageSummary: Schema.Json;
677
+ readonly usage?: {
678
+ readonly modelCalls: number;
679
+ readonly inputTokens: number;
680
+ readonly outputTokens: number;
681
+ readonly costMicrousd: number;
682
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
683
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
684
+ readonly unobservedModelCalls?: number | undefined;
685
+ } | undefined;
686
+ readonly delegatedUsage?: {
687
+ readonly modelCalls: number;
688
+ readonly inputTokens: number;
689
+ readonly outputTokens: number;
690
+ readonly costMicrousd: number;
691
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
692
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
693
+ readonly unobservedModelCalls?: number | undefined;
694
+ } | undefined;
677
695
  readonly reservationId: string;
678
696
  readonly finalAccounting: Schema.Json;
679
697
  } | {
@@ -945,6 +963,81 @@ declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCall | Le
945
963
  readonly createdAt: string;
946
964
  readonly deploymentId: string;
947
965
  readonly payload: {
966
+ readonly _tag: "SubmissionSettled";
967
+ readonly submissionId: string;
968
+ readonly settlementId: string;
969
+ readonly receiptId: string;
970
+ readonly outcome: "aborted" | "completed" | "failed";
971
+ readonly runId?: string | undefined;
972
+ readonly result?: Schema.Json | undefined;
973
+ readonly runDisposition?: Schema.Json | undefined;
974
+ readonly finishReason?: "budget-exhausted" | undefined;
975
+ readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
976
+ readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
977
+ readonly usageSummary?: {
978
+ readonly modelCalls: number;
979
+ readonly inputTokens: {
980
+ readonly total: number;
981
+ readonly uncached: number;
982
+ readonly cacheRead: number;
983
+ readonly cacheWrite: number;
984
+ };
985
+ readonly outputTokens: {
986
+ readonly total: number;
987
+ readonly text: number;
988
+ readonly reasoning: number;
989
+ };
990
+ readonly costMicrousd: number;
991
+ readonly byModel: readonly {
992
+ readonly provider: string;
993
+ readonly model: string;
994
+ readonly responseModel?: string | undefined;
995
+ readonly serviceTier?: string | undefined;
996
+ readonly pricingVersion?: string | undefined;
997
+ readonly modelCalls: number;
998
+ readonly inputTokens: {
999
+ readonly total: number;
1000
+ readonly uncached: number;
1001
+ readonly cacheRead: number;
1002
+ readonly cacheWrite: number;
1003
+ };
1004
+ readonly outputTokens: {
1005
+ readonly total: number;
1006
+ readonly text: number;
1007
+ readonly reasoning: number;
1008
+ };
1009
+ readonly costMicrousd: number;
1010
+ }[];
1011
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1012
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1013
+ readonly unobservedModelCalls?: number | undefined;
1014
+ } | undefined;
1015
+ readonly uncommittedModelUsage?: readonly {
1016
+ readonly provider: string;
1017
+ readonly model: string;
1018
+ readonly serviceTier?: string | undefined;
1019
+ readonly pricingVersion?: string | undefined;
1020
+ readonly response?: {
1021
+ readonly id?: string | undefined;
1022
+ readonly model?: string | undefined;
1023
+ } | undefined;
1024
+ readonly purpose?: "summary" | "turn" | undefined;
1025
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1026
+ readonly pricingStatus?: "estimated" | "unknown" | undefined;
1027
+ readonly inputTokens: {
1028
+ readonly total: number;
1029
+ readonly uncached: number;
1030
+ readonly cacheRead: number;
1031
+ readonly cacheWrite: number;
1032
+ };
1033
+ readonly outputTokens: {
1034
+ readonly total: number;
1035
+ readonly text: number;
1036
+ readonly reasoning: number;
1037
+ };
1038
+ readonly costMicrousd: number;
1039
+ }[] | undefined;
1040
+ } | {
948
1041
  readonly _tag: "ThreadCreated";
949
1042
  readonly agentId: string;
950
1043
  readonly definitions: {
@@ -1068,137 +1161,62 @@ declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCall | Le
1068
1161
  readonly _tag: "ToolCallResolved";
1069
1162
  readonly runId: string;
1070
1163
  readonly toolCallId: string;
1071
- readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
1072
- readonly author: string;
1073
- readonly reason: string;
1074
- } | {
1075
- readonly _tag: "ToolStepSettled";
1076
- readonly runId: string;
1077
- readonly toolCallId: string;
1078
- readonly stepName: string;
1079
- readonly output: Schema.Json;
1080
- readonly outputDigest: string;
1081
- } | {
1082
- readonly _tag: "ToolApprovalRequested";
1083
- readonly runId: string;
1084
- readonly turnId: string;
1085
- readonly turn: number;
1086
- readonly toolCallId: string;
1087
- readonly toolName: string;
1088
- readonly parametersDigest: string;
1089
- } | {
1090
- readonly _tag: "ToolApprovalDecided";
1091
- readonly runId: string;
1092
- readonly turn: number;
1093
- readonly toolCallId: string;
1094
- readonly decision: "approved" | "denied";
1095
- readonly resolver: string;
1096
- readonly reason: string;
1097
- } | {
1098
- readonly _tag: "ModelResponseInterrupted";
1099
- readonly runId: string;
1100
- readonly supersededEpoch: number;
1101
- readonly attemptId: string;
1102
- readonly reason: string;
1103
- } | {
1104
- readonly _tag: "CompactionCreated";
1105
- readonly runId: string;
1106
- readonly turn: number;
1107
- readonly kind: "clear-tool-results" | "rollover" | "summarize";
1108
- readonly coversThrough: number;
1109
- readonly summary?: string | undefined;
1110
- readonly handoff?: string | undefined;
1111
- } | {
1112
- readonly _tag: "RunFailed";
1113
- readonly runId: string;
1114
- readonly failure: Schema.Json;
1115
- } | {
1116
- readonly _tag: "RunCompleted";
1117
- readonly runId: string;
1118
- readonly output: Schema.Json;
1119
- readonly runDisposition?: Schema.Json | undefined;
1120
- readonly finishReason?: "budget-exhausted" | undefined;
1121
- readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
1122
- } | {
1123
- readonly _tag: "AbortRequested";
1124
- readonly submissionId: string;
1125
- readonly author: string;
1126
- readonly reason: string;
1127
- } | {
1128
- readonly _tag: "SubmissionSettled";
1129
- readonly submissionId: string;
1130
- readonly settlementId: string;
1131
- readonly receiptId: string;
1132
- readonly outcome: "aborted" | "completed" | "failed";
1133
- readonly runId?: string | undefined;
1134
- readonly result?: Schema.Json | undefined;
1135
- readonly runDisposition?: Schema.Json | undefined;
1136
- readonly finishReason?: "budget-exhausted" | undefined;
1137
- readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
1138
- readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
1139
- readonly usageSummary?: {
1140
- readonly modelCalls: number;
1141
- readonly inputTokens: {
1142
- readonly total: number;
1143
- readonly uncached: number;
1144
- readonly cacheRead: number;
1145
- readonly cacheWrite: number;
1146
- };
1147
- readonly outputTokens: {
1148
- readonly total: number;
1149
- readonly text: number;
1150
- readonly reasoning: number;
1151
- };
1152
- readonly costMicrousd: number;
1153
- readonly byModel: readonly {
1154
- readonly provider: string;
1155
- readonly model: string;
1156
- readonly responseModel?: string | undefined;
1157
- readonly serviceTier?: string | undefined;
1158
- readonly pricingVersion?: string | undefined;
1159
- readonly modelCalls: number;
1160
- readonly inputTokens: {
1161
- readonly total: number;
1162
- readonly uncached: number;
1163
- readonly cacheRead: number;
1164
- readonly cacheWrite: number;
1165
- };
1166
- readonly outputTokens: {
1167
- readonly total: number;
1168
- readonly text: number;
1169
- readonly reasoning: number;
1170
- };
1171
- readonly costMicrousd: number;
1172
- }[];
1173
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1174
- readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1175
- readonly unobservedModelCalls?: number | undefined;
1176
- } | undefined;
1177
- readonly uncommittedModelUsage?: readonly {
1178
- readonly provider: string;
1179
- readonly model: string;
1180
- readonly serviceTier?: string | undefined;
1181
- readonly pricingVersion?: string | undefined;
1182
- readonly response?: {
1183
- readonly id?: string | undefined;
1184
- readonly model?: string | undefined;
1185
- } | undefined;
1186
- readonly purpose?: "summary" | "turn" | undefined;
1187
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1188
- readonly pricingStatus?: "estimated" | "unknown" | undefined;
1189
- readonly inputTokens: {
1190
- readonly total: number;
1191
- readonly uncached: number;
1192
- readonly cacheRead: number;
1193
- readonly cacheWrite: number;
1194
- };
1195
- readonly outputTokens: {
1196
- readonly total: number;
1197
- readonly text: number;
1198
- readonly reasoning: number;
1199
- };
1200
- readonly costMicrousd: number;
1201
- }[] | undefined;
1164
+ readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
1165
+ readonly author: string;
1166
+ readonly reason: string;
1167
+ } | {
1168
+ readonly _tag: "ToolStepSettled";
1169
+ readonly runId: string;
1170
+ readonly toolCallId: string;
1171
+ readonly stepName: string;
1172
+ readonly output: Schema.Json;
1173
+ readonly outputDigest: string;
1174
+ } | {
1175
+ readonly _tag: "ToolApprovalRequested";
1176
+ readonly runId: string;
1177
+ readonly turnId: string;
1178
+ readonly turn: number;
1179
+ readonly toolCallId: string;
1180
+ readonly toolName: string;
1181
+ readonly parametersDigest: string;
1182
+ } | {
1183
+ readonly _tag: "ToolApprovalDecided";
1184
+ readonly runId: string;
1185
+ readonly turn: number;
1186
+ readonly toolCallId: string;
1187
+ readonly decision: "approved" | "denied";
1188
+ readonly resolver: string;
1189
+ readonly reason: string;
1190
+ } | {
1191
+ readonly _tag: "ModelResponseInterrupted";
1192
+ readonly runId: string;
1193
+ readonly supersededEpoch: number;
1194
+ readonly attemptId: string;
1195
+ readonly reason: string;
1196
+ } | {
1197
+ readonly _tag: "CompactionCreated";
1198
+ readonly runId: string;
1199
+ readonly turn: number;
1200
+ readonly kind: "clear-tool-results" | "rollover" | "summarize";
1201
+ readonly coversThrough: number;
1202
+ readonly summary?: string | undefined;
1203
+ readonly handoff?: string | undefined;
1204
+ } | {
1205
+ readonly _tag: "RunFailed";
1206
+ readonly runId: string;
1207
+ readonly failure: Schema.Json;
1208
+ } | {
1209
+ readonly _tag: "RunCompleted";
1210
+ readonly runId: string;
1211
+ readonly output: Schema.Json;
1212
+ readonly runDisposition?: Schema.Json | undefined;
1213
+ readonly finishReason?: "budget-exhausted" | undefined;
1214
+ readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
1215
+ } | {
1216
+ readonly _tag: "AbortRequested";
1217
+ readonly submissionId: string;
1218
+ readonly author: string;
1219
+ readonly reason: string;
1202
1220
  } | {
1203
1221
  readonly _tag: "SubagentRequested";
1204
1222
  readonly runId: string;
@@ -1269,6 +1287,24 @@ declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCall | Le
1269
1287
  readonly childResultDigest: string;
1270
1288
  readonly projectedResultDigest: string;
1271
1289
  readonly usageSummary: Schema.Json;
1290
+ readonly usage?: {
1291
+ readonly modelCalls: number;
1292
+ readonly inputTokens: number;
1293
+ readonly outputTokens: number;
1294
+ readonly costMicrousd: number;
1295
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1296
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1297
+ readonly unobservedModelCalls?: number | undefined;
1298
+ } | undefined;
1299
+ readonly delegatedUsage?: {
1300
+ readonly modelCalls: number;
1301
+ readonly inputTokens: number;
1302
+ readonly outputTokens: number;
1303
+ readonly costMicrousd: number;
1304
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1305
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1306
+ readonly unobservedModelCalls?: number | undefined;
1307
+ } | undefined;
1272
1308
  readonly reservationId: string;
1273
1309
  readonly finalAccounting: Schema.Json;
1274
1310
  } | {
@@ -1869,6 +1905,81 @@ declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?:
1869
1905
  readonly createdAt: string;
1870
1906
  readonly deploymentId: string;
1871
1907
  readonly payload: {
1908
+ readonly _tag: "SubmissionSettled";
1909
+ readonly submissionId: string;
1910
+ readonly settlementId: string;
1911
+ readonly receiptId: string;
1912
+ readonly outcome: "aborted" | "completed" | "failed";
1913
+ readonly runId?: string | undefined;
1914
+ readonly result?: Schema.Json | undefined;
1915
+ readonly runDisposition?: Schema.Json | undefined;
1916
+ readonly finishReason?: "budget-exhausted" | undefined;
1917
+ readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
1918
+ readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
1919
+ readonly usageSummary?: {
1920
+ readonly modelCalls: number;
1921
+ readonly inputTokens: {
1922
+ readonly total: number;
1923
+ readonly uncached: number;
1924
+ readonly cacheRead: number;
1925
+ readonly cacheWrite: number;
1926
+ };
1927
+ readonly outputTokens: {
1928
+ readonly total: number;
1929
+ readonly text: number;
1930
+ readonly reasoning: number;
1931
+ };
1932
+ readonly costMicrousd: number;
1933
+ readonly byModel: readonly {
1934
+ readonly provider: string;
1935
+ readonly model: string;
1936
+ readonly responseModel?: string | undefined;
1937
+ readonly serviceTier?: string | undefined;
1938
+ readonly pricingVersion?: string | undefined;
1939
+ readonly modelCalls: number;
1940
+ readonly inputTokens: {
1941
+ readonly total: number;
1942
+ readonly uncached: number;
1943
+ readonly cacheRead: number;
1944
+ readonly cacheWrite: number;
1945
+ };
1946
+ readonly outputTokens: {
1947
+ readonly total: number;
1948
+ readonly text: number;
1949
+ readonly reasoning: number;
1950
+ };
1951
+ readonly costMicrousd: number;
1952
+ }[];
1953
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1954
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
1955
+ readonly unobservedModelCalls?: number | undefined;
1956
+ } | undefined;
1957
+ readonly uncommittedModelUsage?: readonly {
1958
+ readonly provider: string;
1959
+ readonly model: string;
1960
+ readonly serviceTier?: string | undefined;
1961
+ readonly pricingVersion?: string | undefined;
1962
+ readonly response?: {
1963
+ readonly id?: string | undefined;
1964
+ readonly model?: string | undefined;
1965
+ } | undefined;
1966
+ readonly purpose?: "summary" | "turn" | undefined;
1967
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
1968
+ readonly pricingStatus?: "estimated" | "unknown" | undefined;
1969
+ readonly inputTokens: {
1970
+ readonly total: number;
1971
+ readonly uncached: number;
1972
+ readonly cacheRead: number;
1973
+ readonly cacheWrite: number;
1974
+ };
1975
+ readonly outputTokens: {
1976
+ readonly total: number;
1977
+ readonly text: number;
1978
+ readonly reasoning: number;
1979
+ };
1980
+ readonly costMicrousd: number;
1981
+ }[] | undefined;
1982
+ } | {
1872
1983
  readonly _tag: "ThreadCreated";
1873
1984
  readonly agentId: string;
1874
1985
  readonly definitions: {
@@ -2014,115 +2125,40 @@ declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?:
2014
2125
  readonly _tag: "ToolApprovalDecided";
2015
2126
  readonly runId: string;
2016
2127
  readonly turn: number;
2017
- readonly toolCallId: string;
2018
- readonly decision: "approved" | "denied";
2019
- readonly resolver: string;
2020
- readonly reason: string;
2021
- } | {
2022
- readonly _tag: "ModelResponseInterrupted";
2023
- readonly runId: string;
2024
- readonly supersededEpoch: number;
2025
- readonly attemptId: string;
2026
- readonly reason: string;
2027
- } | {
2028
- readonly _tag: "CompactionCreated";
2029
- readonly runId: string;
2030
- readonly turn: number;
2031
- readonly kind: "clear-tool-results" | "rollover" | "summarize";
2032
- readonly coversThrough: number;
2033
- readonly summary?: string | undefined;
2034
- readonly handoff?: string | undefined;
2035
- } | {
2036
- readonly _tag: "RunFailed";
2037
- readonly runId: string;
2038
- readonly failure: Schema.Json;
2039
- } | {
2040
- readonly _tag: "RunCompleted";
2041
- readonly runId: string;
2042
- readonly output: Schema.Json;
2043
- readonly runDisposition?: Schema.Json | undefined;
2044
- readonly finishReason?: "budget-exhausted" | undefined;
2045
- readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
2046
- } | {
2047
- readonly _tag: "AbortRequested";
2048
- readonly submissionId: string;
2049
- readonly author: string;
2050
- readonly reason: string;
2051
- } | {
2052
- readonly _tag: "SubmissionSettled";
2053
- readonly submissionId: string;
2054
- readonly settlementId: string;
2055
- readonly receiptId: string;
2056
- readonly outcome: "aborted" | "completed" | "failed";
2057
- readonly runId?: string | undefined;
2058
- readonly result?: Schema.Json | undefined;
2059
- readonly runDisposition?: Schema.Json | undefined;
2060
- readonly finishReason?: "budget-exhausted" | undefined;
2061
- readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
2062
- readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
2063
- readonly usageSummary?: {
2064
- readonly modelCalls: number;
2065
- readonly inputTokens: {
2066
- readonly total: number;
2067
- readonly uncached: number;
2068
- readonly cacheRead: number;
2069
- readonly cacheWrite: number;
2070
- };
2071
- readonly outputTokens: {
2072
- readonly total: number;
2073
- readonly text: number;
2074
- readonly reasoning: number;
2075
- };
2076
- readonly costMicrousd: number;
2077
- readonly byModel: readonly {
2078
- readonly provider: string;
2079
- readonly model: string;
2080
- readonly responseModel?: string | undefined;
2081
- readonly serviceTier?: string | undefined;
2082
- readonly pricingVersion?: string | undefined;
2083
- readonly modelCalls: number;
2084
- readonly inputTokens: {
2085
- readonly total: number;
2086
- readonly uncached: number;
2087
- readonly cacheRead: number;
2088
- readonly cacheWrite: number;
2089
- };
2090
- readonly outputTokens: {
2091
- readonly total: number;
2092
- readonly text: number;
2093
- readonly reasoning: number;
2094
- };
2095
- readonly costMicrousd: number;
2096
- }[];
2097
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2098
- readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
2099
- readonly unobservedModelCalls?: number | undefined;
2100
- } | undefined;
2101
- readonly uncommittedModelUsage?: readonly {
2102
- readonly provider: string;
2103
- readonly model: string;
2104
- readonly serviceTier?: string | undefined;
2105
- readonly pricingVersion?: string | undefined;
2106
- readonly response?: {
2107
- readonly id?: string | undefined;
2108
- readonly model?: string | undefined;
2109
- } | undefined;
2110
- readonly purpose?: "summary" | "turn" | undefined;
2111
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2112
- readonly pricingStatus?: "estimated" | "unknown" | undefined;
2113
- readonly inputTokens: {
2114
- readonly total: number;
2115
- readonly uncached: number;
2116
- readonly cacheRead: number;
2117
- readonly cacheWrite: number;
2118
- };
2119
- readonly outputTokens: {
2120
- readonly total: number;
2121
- readonly text: number;
2122
- readonly reasoning: number;
2123
- };
2124
- readonly costMicrousd: number;
2125
- }[] | undefined;
2128
+ readonly toolCallId: string;
2129
+ readonly decision: "approved" | "denied";
2130
+ readonly resolver: string;
2131
+ readonly reason: string;
2132
+ } | {
2133
+ readonly _tag: "ModelResponseInterrupted";
2134
+ readonly runId: string;
2135
+ readonly supersededEpoch: number;
2136
+ readonly attemptId: string;
2137
+ readonly reason: string;
2138
+ } | {
2139
+ readonly _tag: "CompactionCreated";
2140
+ readonly runId: string;
2141
+ readonly turn: number;
2142
+ readonly kind: "clear-tool-results" | "rollover" | "summarize";
2143
+ readonly coversThrough: number;
2144
+ readonly summary?: string | undefined;
2145
+ readonly handoff?: string | undefined;
2146
+ } | {
2147
+ readonly _tag: "RunFailed";
2148
+ readonly runId: string;
2149
+ readonly failure: Schema.Json;
2150
+ } | {
2151
+ readonly _tag: "RunCompleted";
2152
+ readonly runId: string;
2153
+ readonly output: Schema.Json;
2154
+ readonly runDisposition?: Schema.Json | undefined;
2155
+ readonly finishReason?: "budget-exhausted" | undefined;
2156
+ readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
2157
+ } | {
2158
+ readonly _tag: "AbortRequested";
2159
+ readonly submissionId: string;
2160
+ readonly author: string;
2161
+ readonly reason: string;
2126
2162
  } | {
2127
2163
  readonly _tag: "SubagentRequested";
2128
2164
  readonly runId: string;
@@ -2193,6 +2229,24 @@ declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?:
2193
2229
  readonly childResultDigest: string;
2194
2230
  readonly projectedResultDigest: string;
2195
2231
  readonly usageSummary: Schema.Json;
2232
+ readonly usage?: {
2233
+ readonly modelCalls: number;
2234
+ readonly inputTokens: number;
2235
+ readonly outputTokens: number;
2236
+ readonly costMicrousd: number;
2237
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2238
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
2239
+ readonly unobservedModelCalls?: number | undefined;
2240
+ } | undefined;
2241
+ readonly delegatedUsage?: {
2242
+ readonly modelCalls: number;
2243
+ readonly inputTokens: number;
2244
+ readonly outputTokens: number;
2245
+ readonly costMicrousd: number;
2246
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2247
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
2248
+ readonly unobservedModelCalls?: number | undefined;
2249
+ } | undefined;
2196
2250
  readonly reservationId: string;
2197
2251
  readonly finalAccounting: Schema.Json;
2198
2252
  } | {
@@ -2486,6 +2540,81 @@ declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?:
2486
2540
  readonly createdAt: string;
2487
2541
  readonly deploymentId: string;
2488
2542
  readonly payload: {
2543
+ readonly _tag: "SubmissionSettled";
2544
+ readonly submissionId: string;
2545
+ readonly settlementId: string;
2546
+ readonly receiptId: string;
2547
+ readonly outcome: "aborted" | "completed" | "failed";
2548
+ readonly runId?: string | undefined;
2549
+ readonly result?: Schema.Json | undefined;
2550
+ readonly runDisposition?: Schema.Json | undefined;
2551
+ readonly finishReason?: "budget-exhausted" | undefined;
2552
+ readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
2553
+ readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
2554
+ readonly usageSummary?: {
2555
+ readonly modelCalls: number;
2556
+ readonly inputTokens: {
2557
+ readonly total: number;
2558
+ readonly uncached: number;
2559
+ readonly cacheRead: number;
2560
+ readonly cacheWrite: number;
2561
+ };
2562
+ readonly outputTokens: {
2563
+ readonly total: number;
2564
+ readonly text: number;
2565
+ readonly reasoning: number;
2566
+ };
2567
+ readonly costMicrousd: number;
2568
+ readonly byModel: readonly {
2569
+ readonly provider: string;
2570
+ readonly model: string;
2571
+ readonly responseModel?: string | undefined;
2572
+ readonly serviceTier?: string | undefined;
2573
+ readonly pricingVersion?: string | undefined;
2574
+ readonly modelCalls: number;
2575
+ readonly inputTokens: {
2576
+ readonly total: number;
2577
+ readonly uncached: number;
2578
+ readonly cacheRead: number;
2579
+ readonly cacheWrite: number;
2580
+ };
2581
+ readonly outputTokens: {
2582
+ readonly total: number;
2583
+ readonly text: number;
2584
+ readonly reasoning: number;
2585
+ };
2586
+ readonly costMicrousd: number;
2587
+ }[];
2588
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2589
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
2590
+ readonly unobservedModelCalls?: number | undefined;
2591
+ } | undefined;
2592
+ readonly uncommittedModelUsage?: readonly {
2593
+ readonly provider: string;
2594
+ readonly model: string;
2595
+ readonly serviceTier?: string | undefined;
2596
+ readonly pricingVersion?: string | undefined;
2597
+ readonly response?: {
2598
+ readonly id?: string | undefined;
2599
+ readonly model?: string | undefined;
2600
+ } | undefined;
2601
+ readonly purpose?: "summary" | "turn" | undefined;
2602
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2603
+ readonly pricingStatus?: "estimated" | "unknown" | undefined;
2604
+ readonly inputTokens: {
2605
+ readonly total: number;
2606
+ readonly uncached: number;
2607
+ readonly cacheRead: number;
2608
+ readonly cacheWrite: number;
2609
+ };
2610
+ readonly outputTokens: {
2611
+ readonly total: number;
2612
+ readonly text: number;
2613
+ readonly reasoning: number;
2614
+ };
2615
+ readonly costMicrousd: number;
2616
+ }[] | undefined;
2617
+ } | {
2489
2618
  readonly _tag: "ThreadCreated";
2490
2619
  readonly agentId: string;
2491
2620
  readonly definitions: {
@@ -2665,81 +2794,6 @@ declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?:
2665
2794
  readonly submissionId: string;
2666
2795
  readonly author: string;
2667
2796
  readonly reason: string;
2668
- } | {
2669
- readonly _tag: "SubmissionSettled";
2670
- readonly submissionId: string;
2671
- readonly settlementId: string;
2672
- readonly receiptId: string;
2673
- readonly outcome: "aborted" | "completed" | "failed";
2674
- readonly runId?: string | undefined;
2675
- readonly result?: Schema.Json | undefined;
2676
- readonly runDisposition?: Schema.Json | undefined;
2677
- readonly finishReason?: "budget-exhausted" | undefined;
2678
- readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
2679
- readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
2680
- readonly usageSummary?: {
2681
- readonly modelCalls: number;
2682
- readonly inputTokens: {
2683
- readonly total: number;
2684
- readonly uncached: number;
2685
- readonly cacheRead: number;
2686
- readonly cacheWrite: number;
2687
- };
2688
- readonly outputTokens: {
2689
- readonly total: number;
2690
- readonly text: number;
2691
- readonly reasoning: number;
2692
- };
2693
- readonly costMicrousd: number;
2694
- readonly byModel: readonly {
2695
- readonly provider: string;
2696
- readonly model: string;
2697
- readonly responseModel?: string | undefined;
2698
- readonly serviceTier?: string | undefined;
2699
- readonly pricingVersion?: string | undefined;
2700
- readonly modelCalls: number;
2701
- readonly inputTokens: {
2702
- readonly total: number;
2703
- readonly uncached: number;
2704
- readonly cacheRead: number;
2705
- readonly cacheWrite: number;
2706
- };
2707
- readonly outputTokens: {
2708
- readonly total: number;
2709
- readonly text: number;
2710
- readonly reasoning: number;
2711
- };
2712
- readonly costMicrousd: number;
2713
- }[];
2714
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2715
- readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
2716
- readonly unobservedModelCalls?: number | undefined;
2717
- } | undefined;
2718
- readonly uncommittedModelUsage?: readonly {
2719
- readonly provider: string;
2720
- readonly model: string;
2721
- readonly serviceTier?: string | undefined;
2722
- readonly pricingVersion?: string | undefined;
2723
- readonly response?: {
2724
- readonly id?: string | undefined;
2725
- readonly model?: string | undefined;
2726
- } | undefined;
2727
- readonly purpose?: "summary" | "turn" | undefined;
2728
- readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2729
- readonly pricingStatus?: "estimated" | "unknown" | undefined;
2730
- readonly inputTokens: {
2731
- readonly total: number;
2732
- readonly uncached: number;
2733
- readonly cacheRead: number;
2734
- readonly cacheWrite: number;
2735
- };
2736
- readonly outputTokens: {
2737
- readonly total: number;
2738
- readonly text: number;
2739
- readonly reasoning: number;
2740
- };
2741
- readonly costMicrousd: number;
2742
- }[] | undefined;
2743
2797
  } | {
2744
2798
  readonly _tag: "SubagentRequested";
2745
2799
  readonly runId: string;
@@ -2810,6 +2864,24 @@ declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?:
2810
2864
  readonly childResultDigest: string;
2811
2865
  readonly projectedResultDigest: string;
2812
2866
  readonly usageSummary: Schema.Json;
2867
+ readonly usage?: {
2868
+ readonly modelCalls: number;
2869
+ readonly inputTokens: number;
2870
+ readonly outputTokens: number;
2871
+ readonly costMicrousd: number;
2872
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2873
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
2874
+ readonly unobservedModelCalls?: number | undefined;
2875
+ } | undefined;
2876
+ readonly delegatedUsage?: {
2877
+ readonly modelCalls: number;
2878
+ readonly inputTokens: number;
2879
+ readonly outputTokens: number;
2880
+ readonly costMicrousd: number;
2881
+ readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
2882
+ readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
2883
+ readonly unobservedModelCalls?: number | undefined;
2884
+ } | undefined;
2813
2885
  readonly reservationId: string;
2814
2886
  readonly finalAccounting: Schema.Json;
2815
2887
  } | {
@@ -3081,26 +3153,6 @@ declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?:
3081
3153
  } | {
3082
3154
  readonly _tag: "PortFailed";
3083
3155
  readonly failure: {
3084
- readonly _tag: "FenceRejected";
3085
- readonly threadId: string;
3086
- readonly actualEpoch: number;
3087
- readonly attemptedEpoch: number;
3088
- } | {
3089
- readonly _tag: "ThreadStoreError";
3090
- readonly operation: string;
3091
- readonly message: string;
3092
- readonly cause?: Schema.Json | undefined;
3093
- } | {
3094
- readonly _tag: "ThreadNotMaterialized";
3095
- readonly threadId: string;
3096
- } | {
3097
- readonly _tag: "AppendConflict";
3098
- readonly threadId: string;
3099
- readonly batchId: string;
3100
- readonly reason: "batch-digest" | "record-identity" | "tail";
3101
- readonly actualTailSequence?: number | undefined;
3102
- readonly actualTailDigest?: string | undefined;
3103
- } | {
3104
3156
  readonly _tag: "AdmissionConflict";
3105
3157
  readonly threadId: string;
3106
3158
  readonly principal: string;
@@ -3120,6 +3172,14 @@ declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?:
3120
3172
  readonly _tag: "SettlementConflict";
3121
3173
  readonly submissionId: string;
3122
3174
  readonly existingOutcome: "aborted" | "completed" | "failed";
3175
+ } | {
3176
+ readonly _tag: "ThreadNotMaterialized";
3177
+ readonly threadId: string;
3178
+ } | {
3179
+ readonly _tag: "FenceRejected";
3180
+ readonly threadId: string;
3181
+ readonly actualEpoch: number;
3182
+ readonly attemptedEpoch: number;
3123
3183
  } | {
3124
3184
  readonly _tag: "JoinedToHost";
3125
3185
  readonly submissionId: string;
@@ -3127,6 +3187,18 @@ declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?:
3127
3187
  } | {
3128
3188
  readonly _tag: "PortProtocolError";
3129
3189
  readonly message: string;
3190
+ } | {
3191
+ readonly _tag: "ThreadStoreError";
3192
+ readonly operation: string;
3193
+ readonly message: string;
3194
+ readonly cause?: Schema.Json | undefined;
3195
+ } | {
3196
+ readonly _tag: "AppendConflict";
3197
+ readonly threadId: string;
3198
+ readonly batchId: string;
3199
+ readonly reason: "batch-digest" | "record-identity" | "tail";
3200
+ readonly actualTailSequence?: number | undefined;
3201
+ readonly actualTailDigest?: string | undefined;
3130
3202
  };
3131
3203
  }, Schema.SchemaError, never>;
3132
3204
  declare const decodePortResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<PortFailed | PortSucceeded, Schema.SchemaError, never>;