@adecore/agent-contracts 0.55.1 → 0.55.3

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/chat.d.ts CHANGED
@@ -21,6 +21,7 @@ export declare const ChatUsageSchema: z.ZodObject<{
21
21
  }, z.core.$strip>>;
22
22
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
23
23
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
24
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
24
25
  }, z.core.$strip>;
25
26
  export type ChatUsage = z.infer<typeof ChatUsageSchema>;
26
27
  export declare const CHAT_ATTACHMENTS_MAX_BYTES: number;
@@ -337,6 +338,7 @@ export declare const ChatInfoSchema: z.ZodObject<{
337
338
  }, z.core.$strip>>;
338
339
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
339
340
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
341
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
340
342
  }, z.core.$strip>;
341
343
  suggestedTitle: z.ZodOptional<z.ZodString>;
342
344
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -1103,6 +1105,7 @@ export declare const ChatCompactionItemSchema: z.ZodObject<{
1103
1105
  turnId: z.ZodNullable<z.ZodString>;
1104
1106
  kind: z.ZodLiteral<"compaction">;
1105
1107
  preTokens: z.ZodNullable<z.ZodNumber>;
1108
+ postTokens: z.ZodOptional<z.ZodNumber>;
1106
1109
  }, z.core.$strip>;
1107
1110
  export declare const ChatItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1108
1111
  id: z.ZodString;
@@ -1469,6 +1472,7 @@ export declare const ChatItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1469
1472
  turnId: z.ZodNullable<z.ZodString>;
1470
1473
  kind: z.ZodLiteral<"compaction">;
1471
1474
  preTokens: z.ZodNullable<z.ZodNumber>;
1475
+ postTokens: z.ZodOptional<z.ZodNumber>;
1472
1476
  }, z.core.$strip>], "kind">;
1473
1477
  export type ChatItem = z.infer<typeof ChatItemSchema>;
1474
1478
  export type ChatUserItem = z.infer<typeof ChatUserItemSchema>;
@@ -1854,6 +1858,7 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1854
1858
  turnId: z.ZodNullable<z.ZodString>;
1855
1859
  kind: z.ZodLiteral<"compaction">;
1856
1860
  preTokens: z.ZodNullable<z.ZodNumber>;
1861
+ postTokens: z.ZodOptional<z.ZodNumber>;
1857
1862
  }, z.core.$strip>], "kind">;
1858
1863
  historyIndex: z.ZodOptional<z.ZodNumber>;
1859
1864
  }, z.core.$strip>, z.ZodObject<{
@@ -2018,6 +2023,7 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2018
2023
  }, z.core.$strip>>;
2019
2024
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
2020
2025
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
2026
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
2021
2027
  }, z.core.$strip>;
2022
2028
  suggestedTitle: z.ZodOptional<z.ZodString>;
2023
2029
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -2186,6 +2192,7 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2186
2192
  }, z.core.$strip>>;
2187
2193
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
2188
2194
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
2195
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
2189
2196
  }, z.core.$strip>;
2190
2197
  suggestedTitle: z.ZodOptional<z.ZodString>;
2191
2198
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -2623,6 +2630,7 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2623
2630
  turnId: z.ZodNullable<z.ZodString>;
2624
2631
  kind: z.ZodLiteral<"compaction">;
2625
2632
  preTokens: z.ZodNullable<z.ZodNumber>;
2633
+ postTokens: z.ZodOptional<z.ZodNumber>;
2626
2634
  }, z.core.$strip>], "kind">>;
2627
2635
  }, z.core.$strip>], "type">;
2628
2636
  export type ChatEvent = z.infer<typeof ChatEventSchema>;
@@ -2995,6 +3003,7 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
2995
3003
  turnId: z.ZodNullable<z.ZodString>;
2996
3004
  kind: z.ZodLiteral<"compaction">;
2997
3005
  preTokens: z.ZodNullable<z.ZodNumber>;
3006
+ postTokens: z.ZodOptional<z.ZodNumber>;
2998
3007
  }, z.core.$strip>], "kind">;
2999
3008
  historyIndex: z.ZodOptional<z.ZodNumber>;
3000
3009
  }, z.core.$strip>, z.ZodObject<{
@@ -3159,6 +3168,7 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
3159
3168
  }, z.core.$strip>>;
3160
3169
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
3161
3170
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
3171
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
3162
3172
  }, z.core.$strip>;
3163
3173
  suggestedTitle: z.ZodOptional<z.ZodString>;
3164
3174
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -3327,6 +3337,7 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
3327
3337
  }, z.core.$strip>>;
3328
3338
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
3329
3339
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
3340
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
3330
3341
  }, z.core.$strip>;
3331
3342
  suggestedTitle: z.ZodOptional<z.ZodString>;
3332
3343
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -3764,6 +3775,7 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
3764
3775
  turnId: z.ZodNullable<z.ZodString>;
3765
3776
  kind: z.ZodLiteral<"compaction">;
3766
3777
  preTokens: z.ZodNullable<z.ZodNumber>;
3778
+ postTokens: z.ZodOptional<z.ZodNumber>;
3767
3779
  }, z.core.$strip>], "kind">>;
3768
3780
  }, z.core.$strip>], "type">;
3769
3781
  seq: z.ZodOptional<z.ZodNumber>;
@@ -4218,6 +4230,7 @@ export declare const ChatHistoryResultSchema: z.ZodObject<{
4218
4230
  turnId: z.ZodNullable<z.ZodString>;
4219
4231
  kind: z.ZodLiteral<"compaction">;
4220
4232
  preTokens: z.ZodNullable<z.ZodNumber>;
4233
+ postTokens: z.ZodOptional<z.ZodNumber>;
4221
4234
  }, z.core.$strip>], "kind">>;
4222
4235
  history: z.ZodObject<{
4223
4236
  start: z.ZodNumber;
@@ -4633,6 +4646,7 @@ export declare const ChatSubagentResultSchema: z.ZodObject<{
4633
4646
  turnId: z.ZodNullable<z.ZodString>;
4634
4647
  kind: z.ZodLiteral<"compaction">;
4635
4648
  preTokens: z.ZodNullable<z.ZodNumber>;
4649
+ postTokens: z.ZodOptional<z.ZodNumber>;
4636
4650
  }, z.core.$strip>], "kind">>;
4637
4651
  history: z.ZodObject<{
4638
4652
  start: z.ZodOptional<z.ZodNumber>;
@@ -4793,6 +4807,7 @@ export declare const ChatStatusEventSchema: z.ZodObject<{
4793
4807
  }, z.core.$strip>>;
4794
4808
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
4795
4809
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
4810
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
4796
4811
  }, z.core.$strip>;
4797
4812
  suggestedTitle: z.ZodOptional<z.ZodString>;
4798
4813
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -5059,6 +5074,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
5059
5074
  }, z.core.$strip>>;
5060
5075
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
5061
5076
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
5077
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
5062
5078
  }, z.core.$strip>;
5063
5079
  suggestedTitle: z.ZodOptional<z.ZodString>;
5064
5080
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -5496,6 +5512,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
5496
5512
  turnId: z.ZodNullable<z.ZodString>;
5497
5513
  kind: z.ZodLiteral<"compaction">;
5498
5514
  preTokens: z.ZodNullable<z.ZodNumber>;
5515
+ postTokens: z.ZodOptional<z.ZodNumber>;
5499
5516
  }, z.core.$strip>], "kind">>;
5500
5517
  history: z.ZodOptional<z.ZodObject<{
5501
5518
  start: z.ZodNumber;
@@ -5866,6 +5883,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
5866
5883
  turnId: z.ZodNullable<z.ZodString>;
5867
5884
  kind: z.ZodLiteral<"compaction">;
5868
5885
  preTokens: z.ZodNullable<z.ZodNumber>;
5886
+ postTokens: z.ZodOptional<z.ZodNumber>;
5869
5887
  }, z.core.$strip>], "kind">>>;
5870
5888
  seq: z.ZodOptional<z.ZodNumber>;
5871
5889
  events: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -6235,6 +6253,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
6235
6253
  turnId: z.ZodNullable<z.ZodString>;
6236
6254
  kind: z.ZodLiteral<"compaction">;
6237
6255
  preTokens: z.ZodNullable<z.ZodNumber>;
6256
+ postTokens: z.ZodOptional<z.ZodNumber>;
6238
6257
  }, z.core.$strip>], "kind">;
6239
6258
  historyIndex: z.ZodOptional<z.ZodNumber>;
6240
6259
  }, z.core.$strip>, z.ZodObject<{
@@ -6399,6 +6418,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
6399
6418
  }, z.core.$strip>>;
6400
6419
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
6401
6420
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
6421
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
6402
6422
  }, z.core.$strip>;
6403
6423
  suggestedTitle: z.ZodOptional<z.ZodString>;
6404
6424
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -6567,6 +6587,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
6567
6587
  }, z.core.$strip>>;
6568
6588
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
6569
6589
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
6590
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
6570
6591
  }, z.core.$strip>;
6571
6592
  suggestedTitle: z.ZodOptional<z.ZodString>;
6572
6593
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -7004,6 +7025,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
7004
7025
  turnId: z.ZodNullable<z.ZodString>;
7005
7026
  kind: z.ZodLiteral<"compaction">;
7006
7027
  preTokens: z.ZodNullable<z.ZodNumber>;
7028
+ postTokens: z.ZodOptional<z.ZodNumber>;
7007
7029
  }, z.core.$strip>], "kind">>;
7008
7030
  }, z.core.$strip>], "type">>>;
7009
7031
  bookmarks: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -7492,6 +7514,7 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
7492
7514
  turnId: z.ZodNullable<z.ZodString>;
7493
7515
  kind: z.ZodLiteral<"compaction">;
7494
7516
  preTokens: z.ZodNullable<z.ZodNumber>;
7517
+ postTokens: z.ZodOptional<z.ZodNumber>;
7495
7518
  }, z.core.$strip>], "kind">>>;
7496
7519
  }, z.core.$strip>;
7497
7520
  export type ChatAttachResult = z.infer<typeof ChatAttachResultSchema>;
@@ -7767,6 +7790,7 @@ export declare const ChatForkResultSchema: z.ZodObject<{
7767
7790
  }, z.core.$strip>>;
7768
7791
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
7769
7792
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
7793
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
7770
7794
  }, z.core.$strip>;
7771
7795
  suggestedTitle: z.ZodOptional<z.ZodString>;
7772
7796
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -7966,6 +7990,7 @@ export declare const ChatContinueOnResultSchema: z.ZodObject<{
7966
7990
  }, z.core.$strip>>;
7967
7991
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
7968
7992
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
7993
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
7969
7994
  }, z.core.$strip>;
7970
7995
  suggestedTitle: z.ZodOptional<z.ZodString>;
7971
7996
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -8179,6 +8204,7 @@ export declare const ChatListResultSchema: z.ZodObject<{
8179
8204
  }, z.core.$strip>>;
8180
8205
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
8181
8206
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
8207
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
8182
8208
  }, z.core.$strip>;
8183
8209
  suggestedTitle: z.ZodOptional<z.ZodString>;
8184
8210
  hidden: z.ZodOptional<z.ZodBoolean>;
package/dist/chat.js CHANGED
@@ -26,7 +26,9 @@ export const ChatUsageSchema = z.object({
26
26
  // How long the prompt cache of the main agent's last request lives, in milliseconds; absent while the CLI names no lifetime.
27
27
  cacheTtlMs: z.number().int().positive().optional(),
28
28
  // When that cache goes cold, in milliseconds since the epoch: its lifetime from the moment that request started.
29
- cacheExpiresAt: z.number().optional()
29
+ cacheExpiresAt: z.number().optional(),
30
+ // Set after a compaction whose CLI named no size: `contextTokens` is 0 until the next count, not an empty context.
31
+ contextPending: z.literal(true).optional()
30
32
  });
31
33
  // Base64 for 10 MiB leaves room for the prompt and envelope inside the 16 MiB transport frame.
32
34
  export const CHAT_ATTACHMENTS_MAX_BYTES = 10 * 1024 * 1024;
@@ -620,7 +622,9 @@ export const ChatNoteItemSchema = z.object({
620
622
  export const ChatCompactionItemSchema = z.object({
621
623
  ...base,
622
624
  kind: z.literal('compaction'),
623
- preTokens: z.number().int().nonnegative().nullable()
625
+ preTokens: z.number().int().nonnegative().nullable(),
626
+ // The size the CLI named right after the fold; absent when it named none.
627
+ postTokens: z.number().int().nonnegative().optional()
624
628
  });
625
629
  /*
626
630
  * Never a new member here, and never a new value in an enum a chat or a push already carries: the
@@ -113,6 +113,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
113
113
  }, z.core.$strip>>;
114
114
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
115
115
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
116
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
116
117
  }, z.core.$strip>;
117
118
  suggestedTitle: z.ZodOptional<z.ZodString>;
118
119
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -558,6 +559,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
558
559
  turnId: z.ZodNullable<z.ZodString>;
559
560
  kind: z.ZodLiteral<"compaction">;
560
561
  preTokens: z.ZodNullable<z.ZodNumber>;
562
+ postTokens: z.ZodOptional<z.ZodNumber>;
561
563
  }, z.core.$strip>], "kind">>;
562
564
  history: z.ZodObject<{
563
565
  start: z.ZodNumber;
@@ -666,6 +668,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
666
668
  }, z.core.$strip>>;
667
669
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
668
670
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
671
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
669
672
  }, z.core.$strip>;
670
673
  suggestedTitle: z.ZodOptional<z.ZodString>;
671
674
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -1103,6 +1106,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
1103
1106
  turnId: z.ZodNullable<z.ZodString>;
1104
1107
  kind: z.ZodLiteral<"compaction">;
1105
1108
  preTokens: z.ZodNullable<z.ZodNumber>;
1109
+ postTokens: z.ZodOptional<z.ZodNumber>;
1106
1110
  }, z.core.$strip>], "kind">>;
1107
1111
  history: z.ZodOptional<z.ZodObject<{
1108
1112
  start: z.ZodNumber;
@@ -1473,6 +1477,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
1473
1477
  turnId: z.ZodNullable<z.ZodString>;
1474
1478
  kind: z.ZodLiteral<"compaction">;
1475
1479
  preTokens: z.ZodNullable<z.ZodNumber>;
1480
+ postTokens: z.ZodOptional<z.ZodNumber>;
1476
1481
  }, z.core.$strip>], "kind">>>;
1477
1482
  seq: z.ZodOptional<z.ZodNumber>;
1478
1483
  events: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1842,6 +1847,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
1842
1847
  turnId: z.ZodNullable<z.ZodString>;
1843
1848
  kind: z.ZodLiteral<"compaction">;
1844
1849
  preTokens: z.ZodNullable<z.ZodNumber>;
1850
+ postTokens: z.ZodOptional<z.ZodNumber>;
1845
1851
  }, z.core.$strip>], "kind">;
1846
1852
  historyIndex: z.ZodOptional<z.ZodNumber>;
1847
1853
  }, z.core.$strip>, z.ZodObject<{
@@ -2006,6 +2012,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
2006
2012
  }, z.core.$strip>>;
2007
2013
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
2008
2014
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
2015
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
2009
2016
  }, z.core.$strip>;
2010
2017
  suggestedTitle: z.ZodOptional<z.ZodString>;
2011
2018
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -2174,6 +2181,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
2174
2181
  }, z.core.$strip>>;
2175
2182
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
2176
2183
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
2184
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
2177
2185
  }, z.core.$strip>;
2178
2186
  suggestedTitle: z.ZodOptional<z.ZodString>;
2179
2187
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -2611,6 +2619,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
2611
2619
  turnId: z.ZodNullable<z.ZodString>;
2612
2620
  kind: z.ZodLiteral<"compaction">;
2613
2621
  preTokens: z.ZodNullable<z.ZodNumber>;
2622
+ postTokens: z.ZodOptional<z.ZodNumber>;
2614
2623
  }, z.core.$strip>], "kind">>;
2615
2624
  }, z.core.$strip>], "type">>>;
2616
2625
  bookmarks: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -3099,6 +3108,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
3099
3108
  turnId: z.ZodNullable<z.ZodString>;
3100
3109
  kind: z.ZodLiteral<"compaction">;
3101
3110
  preTokens: z.ZodNullable<z.ZodNumber>;
3111
+ postTokens: z.ZodOptional<z.ZodNumber>;
3102
3112
  }, z.core.$strip>], "kind">>>;
3103
3113
  }, z.core.$strip>;
3104
3114
  };
@@ -3404,6 +3414,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
3404
3414
  }, z.core.$strip>>;
3405
3415
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
3406
3416
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
3417
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
3407
3418
  }, z.core.$strip>;
3408
3419
  suggestedTitle: z.ZodOptional<z.ZodString>;
3409
3420
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -3661,6 +3672,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
3661
3672
  }, z.core.$strip>>;
3662
3673
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
3663
3674
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
3675
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
3664
3676
  }, z.core.$strip>;
3665
3677
  suggestedTitle: z.ZodOptional<z.ZodString>;
3666
3678
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -3860,6 +3872,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
3860
3872
  }, z.core.$strip>>;
3861
3873
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
3862
3874
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
3875
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
3863
3876
  }, z.core.$strip>;
3864
3877
  suggestedTitle: z.ZodOptional<z.ZodString>;
3865
3878
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -4352,6 +4365,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4352
4365
  turnId: z.ZodNullable<z.ZodString>;
4353
4366
  kind: z.ZodLiteral<"compaction">;
4354
4367
  preTokens: z.ZodNullable<z.ZodNumber>;
4368
+ postTokens: z.ZodOptional<z.ZodNumber>;
4355
4369
  }, z.core.$strip>], "kind">>;
4356
4370
  history: z.ZodObject<{
4357
4371
  start: z.ZodOptional<z.ZodNumber>;
@@ -5237,6 +5251,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
5237
5251
  }, z.core.$strip>>;
5238
5252
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
5239
5253
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
5254
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
5240
5255
  }, z.core.$strip>;
5241
5256
  suggestedTitle: z.ZodOptional<z.ZodString>;
5242
5257
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -5682,6 +5697,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
5682
5697
  turnId: z.ZodNullable<z.ZodString>;
5683
5698
  kind: z.ZodLiteral<"compaction">;
5684
5699
  preTokens: z.ZodNullable<z.ZodNumber>;
5700
+ postTokens: z.ZodOptional<z.ZodNumber>;
5685
5701
  }, z.core.$strip>], "kind">;
5686
5702
  historyIndex: z.ZodOptional<z.ZodNumber>;
5687
5703
  }, z.core.$strip>, z.ZodObject<{
@@ -5846,6 +5862,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
5846
5862
  }, z.core.$strip>>;
5847
5863
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
5848
5864
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
5865
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
5849
5866
  }, z.core.$strip>;
5850
5867
  suggestedTitle: z.ZodOptional<z.ZodString>;
5851
5868
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -6014,6 +6031,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
6014
6031
  }, z.core.$strip>>;
6015
6032
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
6016
6033
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
6034
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
6017
6035
  }, z.core.$strip>;
6018
6036
  suggestedTitle: z.ZodOptional<z.ZodString>;
6019
6037
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -6451,6 +6469,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
6451
6469
  turnId: z.ZodNullable<z.ZodString>;
6452
6470
  kind: z.ZodLiteral<"compaction">;
6453
6471
  preTokens: z.ZodNullable<z.ZodNumber>;
6472
+ postTokens: z.ZodOptional<z.ZodNumber>;
6454
6473
  }, z.core.$strip>], "kind">>;
6455
6474
  }, z.core.$strip>], "type">;
6456
6475
  seq: z.ZodOptional<z.ZodNumber>;
@@ -6551,6 +6570,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
6551
6570
  }, z.core.$strip>>;
6552
6571
  cacheTtlMs: z.ZodOptional<z.ZodNumber>;
6553
6572
  cacheExpiresAt: z.ZodOptional<z.ZodNumber>;
6573
+ contextPending: z.ZodOptional<z.ZodLiteral<true>>;
6554
6574
  }, z.core.$strip>;
6555
6575
  suggestedTitle: z.ZodOptional<z.ZodString>;
6556
6576
  hidden: z.ZodOptional<z.ZodBoolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/agent-contracts",
3
- "version": "0.55.1",
3
+ "version": "0.55.3",
4
4
  "description": "Schemas and port contracts for agent chats, provider accounts, models and usage.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -81,8 +81,8 @@
81
81
  "test": "bun --conditions=source test"
82
82
  },
83
83
  "dependencies": {
84
- "@adecore/intelligent-ui": "0.55.1",
85
- "@adecore/utils": "0.55.1",
84
+ "@adecore/intelligent-ui": "0.55.3",
85
+ "@adecore/utils": "0.55.3",
86
86
  "zod": "^4.6.7"
87
87
  },
88
88
  "devDependencies": {
package/src/chat.ts CHANGED
@@ -31,7 +31,9 @@ export const ChatUsageSchema = z.object({
31
31
  // How long the prompt cache of the main agent's last request lives, in milliseconds; absent while the CLI names no lifetime.
32
32
  cacheTtlMs: z.number().int().positive().optional(),
33
33
  // When that cache goes cold, in milliseconds since the epoch: its lifetime from the moment that request started.
34
- cacheExpiresAt: z.number().optional()
34
+ cacheExpiresAt: z.number().optional(),
35
+ // Set after a compaction whose CLI named no size: `contextTokens` is 0 until the next count, not an empty context.
36
+ contextPending: z.literal(true).optional()
35
37
  });
36
38
  export type ChatUsage = z.infer<typeof ChatUsageSchema>;
37
39
 
@@ -741,7 +743,9 @@ export const ChatNoteItemSchema = z.object({
741
743
  export const ChatCompactionItemSchema = z.object({
742
744
  ...base,
743
745
  kind: z.literal('compaction'),
744
- preTokens: z.number().int().nonnegative().nullable()
746
+ preTokens: z.number().int().nonnegative().nullable(),
747
+ // The size the CLI named right after the fold; absent when it named none.
748
+ postTokens: z.number().int().nonnegative().optional()
745
749
  });
746
750
 
747
751
  /*