@deepseek-ai/dsh-api-session-controller 0.2.0-rc.2 → 0.2.1-alpha.1

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.
@@ -131,22 +131,22 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
131
131
  'label': z.string(),
132
132
  'seq': z.intersection(z.number(), z.unknown()),
133
133
  })]).optional(),
134
- 'goal': z.union([z.literal(null), z.object({
135
- 'goal': z.object({
136
- 'objective': z.string().readonly(),
137
- 'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
138
- 'blockedReason': z.object({
139
- 'code': z.string().readonly(),
140
- 'message': z.string().readonly(),
141
- }).readonly().optional(),
142
- 'maxGoalRounds': z.number().readonly(),
143
- 'id': z.intersection(z.string(), z.unknown()).readonly(),
144
- 'revision': z.number().readonly(),
145
- }).readonly(),
146
- 'roundsStarted': z.number().readonly(),
147
- 'createdAt': z.number().readonly(),
148
- 'updatedAt': z.number().readonly(),
149
- })]).optional(),
134
+ 'tokenUsage': z.object({
135
+ 'uncachedInputTokens': z.number(),
136
+ 'outputTokens': z.number(),
137
+ 'cacheReadTokens': z.number(),
138
+ 'cacheWriteTokens': z.number(),
139
+ }).optional(),
140
+ 'contextPressure': z.object({
141
+ 'pressureTokens': z.number().optional(),
142
+ 'projectedTokens': z.number().optional(),
143
+ 'contextWindow': z.number().optional(),
144
+ }).optional(),
145
+ 'contextBreakdown': z.object({
146
+ 'systemTokens': z.number(),
147
+ 'toolsTokens': z.number(),
148
+ 'messageTokens': z.number(),
149
+ }).optional(),
150
150
  'userQuestions': z.object({
151
151
  'active': z.array(z.object({
152
152
  'callId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -177,6 +177,22 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = ()
177
177
  })).readonly(),
178
178
  })).readonly(),
179
179
  }).optional(),
180
+ 'goal': z.union([z.literal(null), z.object({
181
+ 'goal': z.object({
182
+ 'objective': z.string().readonly(),
183
+ 'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
184
+ 'blockedReason': z.object({
185
+ 'code': z.string().readonly(),
186
+ 'message': z.string().readonly(),
187
+ }).readonly().optional(),
188
+ 'maxGoalRounds': z.number().readonly(),
189
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
190
+ 'revision': z.number().readonly(),
191
+ }).readonly(),
192
+ 'roundsStarted': z.number().readonly(),
193
+ 'createdAt': z.number().readonly(),
194
+ 'updatedAt': z.number().readonly(),
195
+ })]).optional(),
180
196
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema5())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema5()))])).readonly()).readonly(),
181
197
  })).readonly().readonly(),
182
198
  }).readonly(),
@@ -333,22 +349,22 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = ()
333
349
  'label': z.string(),
334
350
  'seq': z.intersection(z.number(), z.unknown()),
335
351
  })]).optional(),
336
- 'goal': z.union([z.literal(null), z.object({
337
- 'goal': z.object({
338
- 'objective': z.string().readonly(),
339
- 'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
340
- 'blockedReason': z.object({
341
- 'code': z.string().readonly(),
342
- 'message': z.string().readonly(),
343
- }).readonly().optional(),
344
- 'maxGoalRounds': z.number().readonly(),
345
- 'id': z.intersection(z.string(), z.unknown()).readonly(),
346
- 'revision': z.number().readonly(),
347
- }).readonly(),
348
- 'roundsStarted': z.number().readonly(),
349
- 'createdAt': z.number().readonly(),
350
- 'updatedAt': z.number().readonly(),
351
- })]).optional(),
352
+ 'tokenUsage': z.object({
353
+ 'uncachedInputTokens': z.number(),
354
+ 'outputTokens': z.number(),
355
+ 'cacheReadTokens': z.number(),
356
+ 'cacheWriteTokens': z.number(),
357
+ }).optional(),
358
+ 'contextPressure': z.object({
359
+ 'pressureTokens': z.number().optional(),
360
+ 'projectedTokens': z.number().optional(),
361
+ 'contextWindow': z.number().optional(),
362
+ }).optional(),
363
+ 'contextBreakdown': z.object({
364
+ 'systemTokens': z.number(),
365
+ 'toolsTokens': z.number(),
366
+ 'messageTokens': z.number(),
367
+ }).optional(),
352
368
  'userQuestions': z.object({
353
369
  'active': z.array(z.object({
354
370
  'callId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -379,6 +395,22 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = ()
379
395
  })).readonly(),
380
396
  })).readonly(),
381
397
  }).optional(),
398
+ 'goal': z.union([z.literal(null), z.object({
399
+ 'goal': z.object({
400
+ 'objective': z.string().readonly(),
401
+ 'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
402
+ 'blockedReason': z.object({
403
+ 'code': z.string().readonly(),
404
+ 'message': z.string().readonly(),
405
+ }).readonly().optional(),
406
+ 'maxGoalRounds': z.number().readonly(),
407
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
408
+ 'revision': z.number().readonly(),
409
+ }).readonly(),
410
+ 'roundsStarted': z.number().readonly(),
411
+ 'createdAt': z.number().readonly(),
412
+ 'updatedAt': z.number().readonly(),
413
+ })]).optional(),
382
414
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3()))])).readonly()).readonly(),
383
415
  }).readonly(),
384
416
  'assistantStream': z.object({
@@ -525,22 +557,22 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
525
557
  'label': z.string(),
526
558
  'seq': z.intersection(z.number(), z.unknown()),
527
559
  })]).optional(),
528
- 'goal': z.union([z.literal(null), z.object({
529
- 'goal': z.object({
530
- 'objective': z.string().readonly(),
531
- 'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
532
- 'blockedReason': z.object({
533
- 'code': z.string().readonly(),
534
- 'message': z.string().readonly(),
535
- }).readonly().optional(),
536
- 'maxGoalRounds': z.number().readonly(),
537
- 'id': z.intersection(z.string(), z.unknown()).readonly(),
538
- 'revision': z.number().readonly(),
539
- }).readonly(),
540
- 'roundsStarted': z.number().readonly(),
541
- 'createdAt': z.number().readonly(),
542
- 'updatedAt': z.number().readonly(),
543
- })]).optional(),
560
+ 'tokenUsage': z.object({
561
+ 'uncachedInputTokens': z.number(),
562
+ 'outputTokens': z.number(),
563
+ 'cacheReadTokens': z.number(),
564
+ 'cacheWriteTokens': z.number(),
565
+ }).optional(),
566
+ 'contextPressure': z.object({
567
+ 'pressureTokens': z.number().optional(),
568
+ 'projectedTokens': z.number().optional(),
569
+ 'contextWindow': z.number().optional(),
570
+ }).optional(),
571
+ 'contextBreakdown': z.object({
572
+ 'systemTokens': z.number(),
573
+ 'toolsTokens': z.number(),
574
+ 'messageTokens': z.number(),
575
+ }).optional(),
544
576
  'userQuestions': z.object({
545
577
  'active': z.array(z.object({
546
578
  'callId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -571,6 +603,22 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = () =>
571
603
  })).readonly(),
572
604
  })).readonly(),
573
605
  }).optional(),
606
+ 'goal': z.union([z.literal(null), z.object({
607
+ 'goal': z.object({
608
+ 'objective': z.string().readonly(),
609
+ 'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
610
+ 'blockedReason': z.object({
611
+ 'code': z.string().readonly(),
612
+ 'message': z.string().readonly(),
613
+ }).readonly().optional(),
614
+ 'maxGoalRounds': z.number().readonly(),
615
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
616
+ 'revision': z.number().readonly(),
617
+ }).readonly(),
618
+ 'roundsStarted': z.number().readonly(),
619
+ 'createdAt': z.number().readonly(),
620
+ 'updatedAt': z.number().readonly(),
621
+ })]).optional(),
574
622
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema()))])).readonly()).readonly(),
575
623
  }).readonly().optional(),
576
624
  })).readonly(),
@@ -732,22 +780,22 @@ const _deepseek_ai_dsh_api_session_controller_session_projections_result$schema
732
780
  'label': z.string(),
733
781
  'seq': z.intersection(z.number(), z.unknown()),
734
782
  })]).optional(),
735
- 'goal': z.union([z.literal(null), z.object({
736
- 'goal': z.object({
737
- 'objective': z.string().readonly(),
738
- 'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
739
- 'blockedReason': z.object({
740
- 'code': z.string().readonly(),
741
- 'message': z.string().readonly(),
742
- }).readonly().optional(),
743
- 'maxGoalRounds': z.number().readonly(),
744
- 'id': z.intersection(z.string(), z.unknown()).readonly(),
745
- 'revision': z.number().readonly(),
746
- }).readonly(),
747
- 'roundsStarted': z.number().readonly(),
748
- 'createdAt': z.number().readonly(),
749
- 'updatedAt': z.number().readonly(),
750
- })]).optional(),
783
+ 'tokenUsage': z.object({
784
+ 'uncachedInputTokens': z.number(),
785
+ 'outputTokens': z.number(),
786
+ 'cacheReadTokens': z.number(),
787
+ 'cacheWriteTokens': z.number(),
788
+ }).optional(),
789
+ 'contextPressure': z.object({
790
+ 'pressureTokens': z.number().optional(),
791
+ 'projectedTokens': z.number().optional(),
792
+ 'contextWindow': z.number().optional(),
793
+ }).optional(),
794
+ 'contextBreakdown': z.object({
795
+ 'systemTokens': z.number(),
796
+ 'toolsTokens': z.number(),
797
+ 'messageTokens': z.number(),
798
+ }).optional(),
751
799
  'userQuestions': z.object({
752
800
  'active': z.array(z.object({
753
801
  'callId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -778,6 +826,22 @@ const _deepseek_ai_dsh_api_session_controller_session_projections_result$schema
778
826
  })).readonly(),
779
827
  })).readonly(),
780
828
  }).optional(),
829
+ 'goal': z.union([z.literal(null), z.object({
830
+ 'goal': z.object({
831
+ 'objective': z.string().readonly(),
832
+ 'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
833
+ 'blockedReason': z.object({
834
+ 'code': z.string().readonly(),
835
+ 'message': z.string().readonly(),
836
+ }).readonly().optional(),
837
+ 'maxGoalRounds': z.number().readonly(),
838
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
839
+ 'revision': z.number().readonly(),
840
+ }).readonly(),
841
+ 'roundsStarted': z.number().readonly(),
842
+ 'createdAt': z.number().readonly(),
843
+ 'updatedAt': z.number().readonly(),
844
+ })]).optional(),
781
845
  }), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4())), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4()))])).readonly()).readonly(),
782
846
  })]))
783
847
  let _deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema$value
@@ -953,7 +1017,7 @@ export const TYPERT_REMOTE = {
953
1017
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionAttachmentValue',
954
1018
  create: _deepseek_ai_dsh_api_session_controller_session_attachment_result$schema,
955
1019
  },
956
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":437,"column":3},
1020
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":444,"column":3},
957
1021
  },
958
1022
  {
959
1023
  id: '@deepseek-ai/dsh-api-session-controller#session/cancel',
@@ -978,7 +1042,7 @@ export const TYPERT_REMOTE = {
978
1042
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionCancelValue',
979
1043
  create: _deepseek_ai_dsh_api_session_controller_session_cancel_result$schema,
980
1044
  },
981
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":457,"column":3},
1045
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":464,"column":3},
982
1046
  },
983
1047
  {
984
1048
  id: '@deepseek-ai/dsh-api-session-controller#session/canOpenWorkspacePath',
@@ -993,7 +1057,7 @@ export const TYPERT_REMOTE = {
993
1057
  typeSymbol: '@deepseek-ai/dsh-api-session-controller#session/canOpenWorkspacePath:result',
994
1058
  create: _deepseek_ai_dsh_api_session_controller_session_canOpenWorkspacePath_result$schema,
995
1059
  },
996
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":319,"column":3},
1060
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":326,"column":3},
997
1061
  },
998
1062
  {
999
1063
  id: '@deepseek-ai/dsh-api-session-controller#session/control',
@@ -1010,7 +1074,7 @@ export const TYPERT_REMOTE = {
1010
1074
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionControlFrame',
1011
1075
  create: _deepseek_ai_dsh_api_session_controller_session_control_result$schema,
1012
1076
  },
1013
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":520,"column":3},
1077
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":527,"column":3},
1014
1078
  },
1015
1079
  {
1016
1080
  id: '@deepseek-ai/dsh-api-session-controller#session/create',
@@ -1035,7 +1099,7 @@ export const TYPERT_REMOTE = {
1035
1099
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionCreateValue',
1036
1100
  create: _deepseek_ai_dsh_api_session_controller_session_create_result$schema,
1037
1101
  },
1038
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":273,"column":3},
1102
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":280,"column":3},
1039
1103
  },
1040
1104
  {
1041
1105
  id: '@deepseek-ai/dsh-api-session-controller#session/follow',
@@ -1062,7 +1126,7 @@ export const TYPERT_REMOTE = {
1062
1126
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionFollowFrame',
1063
1127
  create: _deepseek_ai_dsh_api_session_controller_session_follow_result$schema,
1064
1128
  },
1065
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":480,"column":3},
1129
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":487,"column":3},
1066
1130
  },
1067
1131
  {
1068
1132
  id: '@deepseek-ai/dsh-api-session-controller#session/fork',
@@ -1087,7 +1151,7 @@ export const TYPERT_REMOTE = {
1087
1151
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionForkValue',
1088
1152
  create: _deepseek_ai_dsh_api_session_controller_session_fork_result$schema,
1089
1153
  },
1090
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":415,"column":3},
1154
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":422,"column":3},
1091
1155
  },
1092
1156
  {
1093
1157
  id: '@deepseek-ai/dsh-api-session-controller#session/initializeDefaultModel',
@@ -1102,7 +1166,7 @@ export const TYPERT_REMOTE = {
1102
1166
  typeSymbol: '@deepseek-ai/dsh-api-session-controller#session/initializeDefaultModel:result',
1103
1167
  create: _deepseek_ai_dsh_api_session_controller_session_initializeDefaultModel_result$schema,
1104
1168
  },
1105
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":292,"column":9},
1169
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":299,"column":9},
1106
1170
  },
1107
1171
  {
1108
1172
  id: '@deepseek-ai/dsh-api-session-controller#session/list',
@@ -1128,7 +1192,7 @@ export const TYPERT_REMOTE = {
1128
1192
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionListValue',
1129
1193
  create: _deepseek_ai_dsh_api_session_controller_session_list_result$schema,
1130
1194
  },
1131
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":252,"column":9},
1195
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":259,"column":9},
1132
1196
  },
1133
1197
  {
1134
1198
  id: '@deepseek-ai/dsh-api-session-controller#session/modelCatalog',
@@ -1143,7 +1207,7 @@ export const TYPERT_REMOTE = {
1143
1207
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#ModelCatalog',
1144
1208
  create: _deepseek_ai_dsh_api_session_controller_session_modelCatalog_result$schema,
1145
1209
  },
1146
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":310,"column":3},
1210
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":317,"column":3},
1147
1211
  },
1148
1212
  {
1149
1213
  id: '@deepseek-ai/dsh-api-session-controller#session/openWorkspacePath',
@@ -1169,7 +1233,7 @@ export const TYPERT_REMOTE = {
1169
1233
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionOpenWorkspacePathValue',
1170
1234
  create: _deepseek_ai_dsh_api_session_controller_session_openWorkspacePath_result$schema,
1171
1235
  },
1172
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":340,"column":9},
1236
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":347,"column":9},
1173
1237
  },
1174
1238
  {
1175
1239
  id: '@deepseek-ai/dsh-api-session-controller#session/page',
@@ -1195,7 +1259,7 @@ export const TYPERT_REMOTE = {
1195
1259
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionPage',
1196
1260
  create: _deepseek_ai_dsh_api_session_controller_session_page_result$schema,
1197
1261
  },
1198
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":468,"column":3},
1262
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":475,"column":3},
1199
1263
  },
1200
1264
  {
1201
1265
  id: '@deepseek-ai/dsh-api-session-controller#session/projections',
@@ -1221,7 +1285,7 @@ export const TYPERT_REMOTE = {
1221
1285
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionProjectionsValue',
1222
1286
  create: _deepseek_ai_dsh_api_session_controller_session_projections_result$schema,
1223
1287
  },
1224
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":491,"column":9},
1288
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":498,"column":9},
1225
1289
  },
1226
1290
  {
1227
1291
  id: '@deepseek-ai/dsh-api-session-controller#session/prompt',
@@ -1247,7 +1311,7 @@ export const TYPERT_REMOTE = {
1247
1311
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionPromptValue',
1248
1312
  create: _deepseek_ai_dsh_api_session_controller_session_prompt_result$schema,
1249
1313
  },
1250
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":426,"column":3},
1314
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":433,"column":3},
1251
1315
  },
1252
1316
  {
1253
1317
  id: '@deepseek-ai/dsh-api-session-controller#session/rename',
@@ -1272,7 +1336,7 @@ export const TYPERT_REMOTE = {
1272
1336
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionRenameValue',
1273
1337
  create: _deepseek_ai_dsh_api_session_controller_session_rename_result$schema,
1274
1338
  },
1275
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":403,"column":3},
1339
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":410,"column":3},
1276
1340
  },
1277
1341
  {
1278
1342
  id: '@deepseek-ai/dsh-api-session-controller#session/search',
@@ -1298,7 +1362,7 @@ export const TYPERT_REMOTE = {
1298
1362
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionSearchValue',
1299
1363
  create: _deepseek_ai_dsh_api_session_controller_session_search_result$schema,
1300
1364
  },
1301
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":263,"column":3},
1365
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":270,"column":3},
1302
1366
  },
1303
1367
  {
1304
1368
  id: '@deepseek-ai/dsh-api-session-controller#session/selectModel',
@@ -1323,7 +1387,7 @@ export const TYPERT_REMOTE = {
1323
1387
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionSelectModelValue',
1324
1388
  create: _deepseek_ai_dsh_api_session_controller_session_selectModel_result$schema,
1325
1389
  },
1326
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":283,"column":3},
1390
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":290,"column":3},
1327
1391
  },
1328
1392
  {
1329
1393
  id: '@deepseek-ai/dsh-api-session-controller#session/updateQueue',
@@ -1348,7 +1412,7 @@ export const TYPERT_REMOTE = {
1348
1412
  typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionUpdateQueueValue',
1349
1413
  create: _deepseek_ai_dsh_api_session_controller_session_updateQueue_result$schema,
1350
1414
  },
1351
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":447,"column":3},
1415
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":454,"column":3},
1352
1416
  },
1353
1417
  {
1354
1418
  id: '@deepseek-ai/dsh-api-session-controller#session/workspacePathApplications',
@@ -1374,7 +1438,7 @@ export const TYPERT_REMOTE = {
1374
1438
  typeSymbol: '@deepseek-ai/dsh-api-session-controller#session/workspacePathApplications:result',
1375
1439
  create: _deepseek_ai_dsh_api_session_controller_session_workspacePathApplications_result$schema,
1376
1440
  },
1377
- sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":370,"column":9},
1441
+ sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":377,"column":9},
1378
1442
  },
1379
1443
  {
1380
1444
  id: '@deepseek-ai/dsh-api-session-controller#skills/list',
@@ -22,7 +22,13 @@ declare module '@deepseek-ai/cordis' {
22
22
  export interface Config {
23
23
  /** Override platform desktop-opener detection. */
24
24
  readonly nativeOpen?: boolean;
25
+ /** Positive integral milliseconds of list work before yielding between complete rows. */
26
+ readonly listWorkSliceMs?: number;
25
27
  }
28
+ /** Deployment policy after schema defaults have been applied. */
29
+ type ResolvedConfig = Config & {
30
+ readonly listWorkSliceMs: number;
31
+ };
26
32
  /** Host integrations replaceable by direct unit tests. */
27
33
  export interface SessionControllerInternals {
28
34
  /** Native default-application handoff. */
@@ -39,7 +45,7 @@ export interface SessionControllerInternals {
39
45
  /** Host service backing the generated `ctx.remote.session` namespace. */
40
46
  export declare class SessionController extends TypertRemoteService {
41
47
  static inject: string[];
42
- static Config: z<Config>;
48
+ static Config: z<Config, ResolvedConfig>;
43
49
  private readonly agents;
44
50
  private readonly commands;
45
51
  private readonly controlState;
@@ -53,7 +59,7 @@ export declare class SessionController extends TypertRemoteService {
53
59
  private readonly promotions;
54
60
  /**
55
61
  * @param ctx - Host context containing the Session capability assembly.
56
- * @param config - native-opener deployment policy.
62
+ * @param config - native-opener and list-scheduling deployment policy.
57
63
  * @param internals - host integrations replaceable by direct unit tests.
58
64
  */
59
65
  constructor(ctx: Context, config: Config, internals?: SessionControllerInternals);
@@ -74,7 +80,7 @@ export declare class SessionController extends TypertRemoteService {
74
80
  /**
75
81
  * Read all visible Session rows without resuming an Agent.
76
82
  * @param _request - reserved empty list request.
77
- * @param signal - cancellation for persistence reads.
83
+ * @param signal - cancellation for persistence reads and summary generation.
78
84
  * @returns visible Session summaries ordered by activity.
79
85
  */
80
86
  list(_request: SessionListRequest, signal: AbortSignal): Promise<SessionListValue>;
@@ -187,6 +187,7 @@ let SessionController = (() => {
187
187
  ];
188
188
  static Config = z.object({
189
189
  nativeOpen: z.boolean(),
190
+ listWorkSliceMs: z.natural().min(1).default(16),
190
191
  });
191
192
  agents = __runInitializers(this, _instanceExtraInitializers);
192
193
  commands;
@@ -201,11 +202,12 @@ let SessionController = (() => {
201
202
  promotions = new Set();
202
203
  /**
203
204
  * @param ctx - Host context containing the Session capability assembly.
204
- * @param config - native-opener deployment policy.
205
+ * @param config - native-opener and list-scheduling deployment policy.
205
206
  * @param internals - host integrations replaceable by direct unit tests.
206
207
  */
207
208
  constructor(ctx, config, internals = {}) {
208
209
  super(ctx, 'sessionController', { namespace: 'session' });
210
+ const resolved = SessionController.Config(config);
209
211
  installModelSelectionProjection(ctx);
210
212
  this.agents = new ApiSessionAgentController(ctx);
211
213
  this.commands = new SessionCommandController(ctx, this.agents, process.cwd());
@@ -222,7 +224,7 @@ let SessionController = (() => {
222
224
  await Promise.allSettled([...this.promotions]);
223
225
  }, 'session-controller.promotions');
224
226
  this.history = new SessionHistoryController(ctx, (observation) => { this.promote(observation); });
225
- this.listState = new ApiSessionList(ctx);
227
+ this.listState = new ApiSessionList(ctx, resolved.listWorkSliceMs);
226
228
  this.fileApplications = internals.fileApplications ?? nativeFileApplications;
227
229
  this.openFileApplication = internals.openFileApplication ?? openNativeFileApplication;
228
230
  this.openPath = internals.openPath ?? openNativeAssociatedPath;
@@ -318,7 +320,7 @@ let SessionController = (() => {
318
320
  /**
319
321
  * Read all visible Session rows without resuming an Agent.
320
322
  * @param _request - reserved empty list request.
321
- * @param signal - cancellation for persistence reads.
323
+ * @param signal - cancellation for persistence reads and summary generation.
322
324
  * @returns visible Session summaries ordered by activity.
323
325
  */
324
326
  async list(_request, signal) {
@@ -19,8 +19,12 @@ export declare function truncateUnicodeCodePoints(value: string, maximum: number
19
19
  /** Owns list projection registration, bounded cold summaries, and authorized search. */
20
20
  export declare class ApiSessionList {
21
21
  private readonly ctx;
22
- /** @param ctx - Host context carrying Session, query, persistence, and projection services. */
23
- constructor(ctx: Context);
22
+ private readonly workSliceMs;
23
+ /**
24
+ * @param ctx - Host context carrying Session, query, persistence, and projection services.
25
+ * @param workSliceMs - Resolved positive integral list-work budget in milliseconds.
26
+ */
27
+ constructor(ctx: Context, workSliceMs: number);
24
28
  /**
25
29
  * Build one current attached-Session summary.
26
30
  * @param session - attached Session to summarize.
@@ -29,7 +33,7 @@ export declare class ApiSessionList {
29
33
  summaryFor(session: Session): SessionSummary;
30
34
  /**
31
35
  * Read every visible attached and persisted Session without activating an Agent.
32
- * @param signal - optional cancellation for persistence reads.
36
+ * @param signal - optional cancellation for persistence reads and summary generation.
33
37
  * @returns visible Session summaries ordered by activity.
34
38
  */
35
39
  list(signal?: AbortSignal): Promise<SessionSummary[]>;
package/lib/types/list.js CHANGED
@@ -1,4 +1,6 @@
1
1
  /** Cold-safe Session list and search projection. */
2
+ import { performance } from 'node:perf_hooks';
3
+ import { scheduler } from 'node:timers/promises';
2
4
  import { SessionQueryError } from '@deepseek-ai/dsh-session-query';
3
5
  import { RemoteError } from '@deepseek-ai/dsh-typert-protocol';
4
6
  import { z } from 'zod';
@@ -53,9 +55,14 @@ export function truncateUnicodeCodePoints(value, maximum) {
53
55
  /** Owns list projection registration, bounded cold summaries, and authorized search. */
54
56
  export class ApiSessionList {
55
57
  ctx;
56
- /** @param ctx - Host context carrying Session, query, persistence, and projection services. */
57
- constructor(ctx) {
58
+ workSliceMs;
59
+ /**
60
+ * @param ctx - Host context carrying Session, query, persistence, and projection services.
61
+ * @param workSliceMs - Resolved positive integral list-work budget in milliseconds.
62
+ */
63
+ constructor(ctx, workSliceMs) {
58
64
  this.ctx = ctx;
65
+ this.workSliceMs = workSliceMs;
59
66
  ctx.sessionProjections.register({
60
67
  key: 'sessionListMetadata',
61
68
  stateSchema: sessionListMetadataSchema,
@@ -98,7 +105,7 @@ export class ApiSessionList {
98
105
  }
99
106
  /**
100
107
  * Read every visible attached and persisted Session without activating an Agent.
101
- * @param signal - optional cancellation for persistence reads.
108
+ * @param signal - optional cancellation for persistence reads and summary generation.
102
109
  * @returns visible Session summaries ordered by activity.
103
110
  */
104
111
  async list(signal) {
@@ -107,18 +114,32 @@ export class ApiSessionList {
107
114
  signal?.throwIfAborted();
108
115
  const items = [];
109
116
  const cold = [];
117
+ let yieldDeadline = performance.now() + this.workSliceMs;
110
118
  for (const record of records) {
119
+ signal?.throwIfAborted();
111
120
  const live = this.ctx.sessions.get(record.header.id);
112
121
  if (live !== undefined) {
113
122
  items.push(this.summaryFor(live));
114
- continue;
115
123
  }
116
- if (record.header.cwd === undefined)
117
- continue;
118
- cold.push(record.header);
124
+ else if (record.header.cwd !== undefined) {
125
+ cold.push(record.header);
126
+ }
127
+ if (performance.now() >= yieldDeadline) {
128
+ await scheduler.yield();
129
+ signal?.throwIfAborted();
130
+ yieldDeadline = performance.now() + this.workSliceMs;
131
+ }
119
132
  }
120
- for (const header of cold)
133
+ for (const header of cold) {
134
+ signal?.throwIfAborted();
121
135
  items.push(this.summarizeCold(header));
136
+ if (performance.now() >= yieldDeadline) {
137
+ await scheduler.yield();
138
+ signal?.throwIfAborted();
139
+ yieldDeadline = performance.now() + this.workSliceMs;
140
+ }
141
+ }
142
+ signal?.throwIfAborted();
122
143
  items.sort((left, right) => right.updatedAt - left.updatedAt);
123
144
  return items;
124
145
  }