@qilin-agent/schedule 0.0.0-stage → 3.1.4

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.
@@ -0,0 +1,30 @@
1
+ /* Generated by @qilin-agent/typert-generator from the Host FaceModel — do not edit. */
2
+ import type {
3
+ RemoteResult,
4
+ TypertRemoteContribution,
5
+ } from '@qilin-agent/typert-protocol'
6
+ import type { ScheduleCatalogEntry, ScheduleDeleteRequest, ScheduleDeleteResult, ScheduleDeliveryHistoryRequest, ScheduleDeliveryHistoryResult, ScheduleListRequest, ScheduleRecord, ScheduleUpdateRequest, ScheduleUpdateResult } from '@qilin-agent/schedule/client'
7
+
8
+ declare module '@qilin-agent/typert-protocol' {
9
+ interface TypertRemoteNamespace$7363686564756c65 {
10
+ catalog: () => Promise<RemoteResult<ScheduleCatalogEntry[]>>
11
+ delete: (request: ScheduleDeleteRequest, signal?: AbortSignal) => Promise<RemoteResult<ScheduleDeleteResult>>
12
+ history: (request: ScheduleDeliveryHistoryRequest) => Promise<RemoteResult<ScheduleDeliveryHistoryResult>>
13
+ list: (request: ScheduleListRequest) => Promise<RemoteResult<ScheduleRecord[]>>
14
+ update: (request: ScheduleUpdateRequest, signal?: AbortSignal) => Promise<RemoteResult<ScheduleUpdateResult>>
15
+ }
16
+ interface TypertRemoteMap {
17
+ 'schedule/catalog': () => Promise<RemoteResult<ScheduleCatalogEntry[]>>
18
+ 'schedule/delete': (request: ScheduleDeleteRequest, signal?: AbortSignal) => Promise<RemoteResult<ScheduleDeleteResult>>
19
+ 'schedule/history': (request: ScheduleDeliveryHistoryRequest) => Promise<RemoteResult<ScheduleDeliveryHistoryResult>>
20
+ 'schedule/list': (request: ScheduleListRequest) => Promise<RemoteResult<ScheduleRecord[]>>
21
+ 'schedule/update': (request: ScheduleUpdateRequest, signal?: AbortSignal) => Promise<RemoteResult<ScheduleUpdateResult>>
22
+ }
23
+ interface TypertRemoteNamespaceMap {
24
+ 'schedule': TypertRemoteNamespace$7363686564756c65
25
+ }
26
+ }
27
+
28
+ export declare const TYPERT_REMOTE: TypertRemoteContribution
29
+ export default TYPERT_REMOTE
30
+ //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -0,0 +1,480 @@
1
+ /* Generated by @qilin-agent/typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ let _qilin_agent_schedule_schedule_catalog_result$schema$value
5
+ const _qilin_agent_schedule_schedule_catalog_result$schema = () => (_qilin_agent_schedule_schedule_catalog_result$schema$value ??= z.array(z.union([z.intersection(z.object({
6
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
7
+ 'kind': z.literal("after").readonly(),
8
+ 'title': z.string().readonly(),
9
+ 'prompt': z.string().readonly(),
10
+ 'afterSeconds': z.number().readonly(),
11
+ 'scheduledAt': z.string().readonly(),
12
+ }), z.object({
13
+ 'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
14
+ 'status': z.union([z.literal("active"), z.literal("inactive")]).readonly(),
15
+ 'lastDelivery': z.object({
16
+ 'scheduledAt': z.string().readonly(),
17
+ 'deliveredAt': z.string().readonly(),
18
+ 'messageId': z.intersection(z.string(), z.unknown()).readonly(),
19
+ }).readonly().optional(),
20
+ })), z.intersection(z.object({
21
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
22
+ 'kind': z.literal("at").readonly(),
23
+ 'title': z.string().readonly(),
24
+ 'prompt': z.string().readonly(),
25
+ 'scheduledAt': z.string().readonly(),
26
+ }), z.object({
27
+ 'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
28
+ 'status': z.union([z.literal("active"), z.literal("inactive")]).readonly(),
29
+ 'lastDelivery': z.object({
30
+ 'scheduledAt': z.string().readonly(),
31
+ 'deliveredAt': z.string().readonly(),
32
+ 'messageId': z.intersection(z.string(), z.unknown()).readonly(),
33
+ }).readonly().optional(),
34
+ })), z.intersection(z.object({
35
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
36
+ 'kind': z.literal("every").readonly(),
37
+ 'title': z.string().readonly(),
38
+ 'prompt': z.string().readonly(),
39
+ 'everySeconds': z.number().readonly(),
40
+ 'scheduledAt': z.string().readonly(),
41
+ }), z.object({
42
+ 'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
43
+ 'status': z.union([z.literal("active"), z.literal("inactive")]).readonly(),
44
+ 'lastDelivery': z.object({
45
+ 'scheduledAt': z.string().readonly(),
46
+ 'deliveredAt': z.string().readonly(),
47
+ 'messageId': z.intersection(z.string(), z.unknown()).readonly(),
48
+ }).readonly().optional(),
49
+ })), z.intersection(z.object({
50
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
51
+ 'kind': z.literal("daily").readonly(),
52
+ 'title': z.string().readonly(),
53
+ 'prompt': z.string().readonly(),
54
+ 'time': z.string().readonly(),
55
+ 'timeZone': z.string().readonly(),
56
+ 'scheduledAt': z.string().readonly(),
57
+ }), z.object({
58
+ 'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
59
+ 'status': z.union([z.literal("active"), z.literal("inactive")]).readonly(),
60
+ 'lastDelivery': z.object({
61
+ 'scheduledAt': z.string().readonly(),
62
+ 'deliveredAt': z.string().readonly(),
63
+ 'messageId': z.intersection(z.string(), z.unknown()).readonly(),
64
+ }).readonly().optional(),
65
+ })), z.intersection(z.object({
66
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
67
+ 'kind': z.literal("weekly").readonly(),
68
+ 'title': z.string().readonly(),
69
+ 'prompt': z.string().readonly(),
70
+ 'time': z.string().readonly(),
71
+ 'timeZone': z.string().readonly(),
72
+ 'weekdays': z.array(z.number()).readonly(),
73
+ 'scheduledAt': z.string().readonly(),
74
+ }), z.object({
75
+ 'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
76
+ 'status': z.union([z.literal("active"), z.literal("inactive")]).readonly(),
77
+ 'lastDelivery': z.object({
78
+ 'scheduledAt': z.string().readonly(),
79
+ 'deliveredAt': z.string().readonly(),
80
+ 'messageId': z.intersection(z.string(), z.unknown()).readonly(),
81
+ }).readonly().optional(),
82
+ })), z.intersection(z.object({
83
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
84
+ 'kind': z.literal("cron").readonly(),
85
+ 'title': z.string().readonly(),
86
+ 'prompt': z.string().readonly(),
87
+ 'expression': z.string().readonly(),
88
+ 'timeZone': z.string().readonly(),
89
+ 'scheduledAt': z.string().readonly(),
90
+ }), z.object({
91
+ 'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
92
+ 'status': z.union([z.literal("active"), z.literal("inactive")]).readonly(),
93
+ 'lastDelivery': z.object({
94
+ 'scheduledAt': z.string().readonly(),
95
+ 'deliveredAt': z.string().readonly(),
96
+ 'messageId': z.intersection(z.string(), z.unknown()).readonly(),
97
+ }).readonly().optional(),
98
+ }))])))
99
+ let _qilin_agent_schedule_schedule_delete_parameter_0$schema$value
100
+ const _qilin_agent_schedule_schedule_delete_parameter_0$schema = () => (_qilin_agent_schedule_schedule_delete_parameter_0$schema$value ??= z.object({
101
+ 'id': z.intersection(z.string(), z.unknown()),
102
+ 'sessionId': z.intersection(z.string(), z.unknown()),
103
+ }))
104
+ let _qilin_agent_schedule_schedule_delete_result$schema$value
105
+ const _qilin_agent_schedule_schedule_delete_result$schema = () => (_qilin_agent_schedule_schedule_delete_result$schema$value ??= z.union([z.object({
106
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
107
+ 'deleted': z.literal(true).readonly(),
108
+ }), z.object({
109
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
110
+ 'deleted': z.literal(false).readonly(),
111
+ 'code': z.literal("schedule_not_found").readonly(),
112
+ })]))
113
+ let _qilin_agent_schedule_schedule_history_parameter_0$schema$value
114
+ const _qilin_agent_schedule_schedule_history_parameter_0$schema = () => (_qilin_agent_schedule_schedule_history_parameter_0$schema$value ??= z.object({
115
+ 'limit': z.number(),
116
+ 'before': z.intersection(z.string(), z.unknown()).optional(),
117
+ 'id': z.intersection(z.string(), z.unknown()),
118
+ 'sessionId': z.intersection(z.string(), z.unknown()),
119
+ }))
120
+ let _qilin_agent_schedule_schedule_history_result$schema$value
121
+ const _qilin_agent_schedule_schedule_history_result$schema = () => (_qilin_agent_schedule_schedule_history_result$schema$value ??= z.union([z.object({
122
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
123
+ 'records': z.array(z.object({
124
+ 'prompt': z.string().readonly().optional(),
125
+ 'scheduledAt': z.string().readonly(),
126
+ 'deliveredAt': z.string().readonly(),
127
+ 'messageId': z.intersection(z.string(), z.unknown()).readonly(),
128
+ })).readonly(),
129
+ 'earlierRecordsUnavailable': z.boolean().readonly(),
130
+ 'earlierRecordsPruned': z.boolean().readonly(),
131
+ 'retention': z.object({
132
+ 'days': z.number().readonly(),
133
+ 'records': z.number().readonly(),
134
+ }).readonly(),
135
+ 'nextBefore': z.intersection(z.string(), z.unknown()).readonly().optional(),
136
+ }), z.object({
137
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
138
+ 'code': z.union([z.literal("schedule_not_found"), z.literal("delivery_cursor_not_found")]).readonly(),
139
+ })]))
140
+ let _qilin_agent_schedule_schedule_list_parameter_0$schema$value
141
+ const _qilin_agent_schedule_schedule_list_parameter_0$schema = () => (_qilin_agent_schedule_schedule_list_parameter_0$schema$value ??= z.object({
142
+ 'sessionId': z.intersection(z.string(), z.unknown()),
143
+ }))
144
+ let _qilin_agent_schedule_schedule_list_result$schema$value
145
+ const _qilin_agent_schedule_schedule_list_result$schema = () => (_qilin_agent_schedule_schedule_list_result$schema$value ??= z.array(z.union([z.object({
146
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
147
+ 'kind': z.literal("after").readonly(),
148
+ 'title': z.string().readonly(),
149
+ 'prompt': z.string().readonly(),
150
+ 'afterSeconds': z.number().readonly(),
151
+ 'scheduledAt': z.string().readonly(),
152
+ }), z.object({
153
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
154
+ 'kind': z.literal("at").readonly(),
155
+ 'title': z.string().readonly(),
156
+ 'prompt': z.string().readonly(),
157
+ 'scheduledAt': z.string().readonly(),
158
+ }), z.object({
159
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
160
+ 'kind': z.literal("every").readonly(),
161
+ 'title': z.string().readonly(),
162
+ 'prompt': z.string().readonly(),
163
+ 'everySeconds': z.number().readonly(),
164
+ 'scheduledAt': z.string().readonly(),
165
+ }), z.object({
166
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
167
+ 'kind': z.literal("daily").readonly(),
168
+ 'title': z.string().readonly(),
169
+ 'prompt': z.string().readonly(),
170
+ 'time': z.string().readonly(),
171
+ 'timeZone': z.string().readonly(),
172
+ 'scheduledAt': z.string().readonly(),
173
+ }), z.object({
174
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
175
+ 'kind': z.literal("weekly").readonly(),
176
+ 'title': z.string().readonly(),
177
+ 'prompt': z.string().readonly(),
178
+ 'time': z.string().readonly(),
179
+ 'timeZone': z.string().readonly(),
180
+ 'weekdays': z.array(z.number()).readonly(),
181
+ 'scheduledAt': z.string().readonly(),
182
+ }), z.object({
183
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
184
+ 'kind': z.literal("cron").readonly(),
185
+ 'title': z.string().readonly(),
186
+ 'prompt': z.string().readonly(),
187
+ 'expression': z.string().readonly(),
188
+ 'timeZone': z.string().readonly(),
189
+ 'scheduledAt': z.string().readonly(),
190
+ })])))
191
+ let _qilin_agent_schedule_schedule_update_parameter_0$schema$value
192
+ const _qilin_agent_schedule_schedule_update_parameter_0$schema = () => (_qilin_agent_schedule_schedule_update_parameter_0$schema$value ??= z.object({
193
+ 'expected': z.union([z.object({
194
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
195
+ 'kind': z.literal("after").readonly(),
196
+ 'title': z.string().readonly(),
197
+ 'prompt': z.string().readonly(),
198
+ 'afterSeconds': z.number().readonly(),
199
+ 'scheduledAt': z.string().readonly(),
200
+ }), z.object({
201
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
202
+ 'kind': z.literal("at").readonly(),
203
+ 'title': z.string().readonly(),
204
+ 'prompt': z.string().readonly(),
205
+ 'scheduledAt': z.string().readonly(),
206
+ }), z.object({
207
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
208
+ 'kind': z.literal("every").readonly(),
209
+ 'title': z.string().readonly(),
210
+ 'prompt': z.string().readonly(),
211
+ 'everySeconds': z.number().readonly(),
212
+ 'scheduledAt': z.string().readonly(),
213
+ }), z.object({
214
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
215
+ 'kind': z.literal("daily").readonly(),
216
+ 'title': z.string().readonly(),
217
+ 'prompt': z.string().readonly(),
218
+ 'time': z.string().readonly(),
219
+ 'timeZone': z.string().readonly(),
220
+ 'scheduledAt': z.string().readonly(),
221
+ }), z.object({
222
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
223
+ 'kind': z.literal("weekly").readonly(),
224
+ 'title': z.string().readonly(),
225
+ 'prompt': z.string().readonly(),
226
+ 'time': z.string().readonly(),
227
+ 'timeZone': z.string().readonly(),
228
+ 'weekdays': z.array(z.number()).readonly(),
229
+ 'scheduledAt': z.string().readonly(),
230
+ }), z.object({
231
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
232
+ 'kind': z.literal("cron").readonly(),
233
+ 'title': z.string().readonly(),
234
+ 'prompt': z.string().readonly(),
235
+ 'expression': z.string().readonly(),
236
+ 'timeZone': z.string().readonly(),
237
+ 'scheduledAt': z.string().readonly(),
238
+ })]).readonly(),
239
+ 'change': z.union([z.object({
240
+ 'kind': z.literal("at").readonly(),
241
+ 'at': z.union([z.string(), z.object({
242
+ 'date': z.string().readonly(),
243
+ 'time': z.string().readonly(),
244
+ 'time_zone': z.string().readonly(),
245
+ })]).readonly(),
246
+ }), z.object({
247
+ 'kind': z.literal("every").readonly(),
248
+ 'every_seconds': z.number().readonly(),
249
+ }), z.object({
250
+ 'kind': z.literal("daily").readonly(),
251
+ 'daily': z.object({
252
+ 'time': z.string().readonly(),
253
+ 'time_zone': z.string().readonly(),
254
+ }).readonly(),
255
+ }), z.object({
256
+ 'kind': z.literal("weekly").readonly(),
257
+ 'weekly': z.object({
258
+ 'time': z.string().readonly(),
259
+ 'time_zone': z.string().readonly(),
260
+ 'weekdays': z.array(z.number()).readonly(),
261
+ }).readonly(),
262
+ }), z.object({
263
+ 'kind': z.literal("cron").readonly(),
264
+ 'cron': z.object({
265
+ 'expression': z.string().readonly(),
266
+ 'time_zone': z.string().readonly(),
267
+ }).readonly(),
268
+ })]).readonly().optional(),
269
+ 'id': z.intersection(z.string(), z.unknown()),
270
+ 'sessionId': z.intersection(z.string(), z.unknown()),
271
+ 'title': z.string().readonly().optional(),
272
+ 'prompt': z.string().readonly().optional(),
273
+ }))
274
+ let _qilin_agent_schedule_schedule_update_result$schema$value
275
+ const _qilin_agent_schedule_schedule_update_result$schema = () => (_qilin_agent_schedule_schedule_update_result$schema$value ??= z.union([z.object({
276
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
277
+ 'updated': z.boolean().readonly(),
278
+ 'record': z.union([z.object({
279
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
280
+ 'kind': z.literal("after").readonly(),
281
+ 'title': z.string().readonly(),
282
+ 'prompt': z.string().readonly(),
283
+ 'afterSeconds': z.number().readonly(),
284
+ 'scheduledAt': z.string().readonly(),
285
+ }), z.object({
286
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
287
+ 'kind': z.literal("at").readonly(),
288
+ 'title': z.string().readonly(),
289
+ 'prompt': z.string().readonly(),
290
+ 'scheduledAt': z.string().readonly(),
291
+ }), z.object({
292
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
293
+ 'kind': z.literal("every").readonly(),
294
+ 'title': z.string().readonly(),
295
+ 'prompt': z.string().readonly(),
296
+ 'everySeconds': z.number().readonly(),
297
+ 'scheduledAt': z.string().readonly(),
298
+ }), z.object({
299
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
300
+ 'kind': z.literal("daily").readonly(),
301
+ 'title': z.string().readonly(),
302
+ 'prompt': z.string().readonly(),
303
+ 'time': z.string().readonly(),
304
+ 'timeZone': z.string().readonly(),
305
+ 'scheduledAt': z.string().readonly(),
306
+ }), z.object({
307
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
308
+ 'kind': z.literal("weekly").readonly(),
309
+ 'title': z.string().readonly(),
310
+ 'prompt': z.string().readonly(),
311
+ 'time': z.string().readonly(),
312
+ 'timeZone': z.string().readonly(),
313
+ 'weekdays': z.array(z.number()).readonly(),
314
+ 'scheduledAt': z.string().readonly(),
315
+ }), z.object({
316
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
317
+ 'kind': z.literal("cron").readonly(),
318
+ 'title': z.string().readonly(),
319
+ 'prompt': z.string().readonly(),
320
+ 'expression': z.string().readonly(),
321
+ 'timeZone': z.string().readonly(),
322
+ 'scheduledAt': z.string().readonly(),
323
+ })]).readonly(),
324
+ }), z.object({
325
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
326
+ 'updated': z.literal(false).readonly(),
327
+ 'code': z.union([z.literal("schedule_not_found"), z.literal("schedule_ended"), z.literal("schedule_conflict")]).readonly(),
328
+ }), z.object({
329
+ 'code': z.literal("invalid_prompt").readonly(),
330
+ 'message': z.string().readonly(),
331
+ }), z.object({
332
+ 'code': z.literal("invalid_selector").readonly(),
333
+ 'message': z.string().readonly(),
334
+ }), z.object({
335
+ 'code': z.literal("invalid_rule").readonly(),
336
+ 'message': z.string().readonly(),
337
+ }), z.object({
338
+ 'code': z.literal("invalid_time_zone").readonly(),
339
+ 'message': z.string().readonly(),
340
+ }), z.object({
341
+ 'code': z.literal("not_future").readonly(),
342
+ 'message': z.string().readonly(),
343
+ }), z.object({
344
+ 'code': z.literal("time_out_of_range").readonly(),
345
+ 'message': z.string().readonly(),
346
+ }), z.object({
347
+ 'code': z.literal("frequency_too_high").readonly(),
348
+ 'message': z.string().readonly(),
349
+ }), z.object({
350
+ 'code': z.literal("subagent_session").readonly(),
351
+ 'message': z.string().readonly(),
352
+ }), z.object({
353
+ 'code': z.literal("internal_error").readonly(),
354
+ 'message': z.string().readonly(),
355
+ })]))
356
+
357
+ export const TYPERT_REMOTE = {
358
+ package: '@qilin-agent/schedule',
359
+ descriptors: [
360
+ {
361
+ id: '@qilin-agent/schedule#schedule/catalog',
362
+ service: 'schedule',
363
+ namespace: 'schedule',
364
+ method: 'catalog',
365
+ invocation: { kind: 'direct' },
366
+ parameters: [
367
+ ],
368
+ result: {
369
+ mode: 'strict',
370
+ typeSymbol: '@qilin-agent/schedule#schedule/catalog:result',
371
+ create: _qilin_agent_schedule_schedule_catalog_result$schema,
372
+ },
373
+ sourceLocation: {"file":"packages/schedule/schedule/src/index.ts","line":281,"column":9},
374
+ },
375
+ {
376
+ id: '@qilin-agent/schedule#schedule/delete',
377
+ service: 'schedule',
378
+ namespace: 'schedule',
379
+ method: 'delete',
380
+ invocation: { kind: 'direct' },
381
+ parameters: [
382
+ {
383
+ name: 'request',
384
+ wire: 'request',
385
+ source: 'json',
386
+ codec: {
387
+ mode: 'strict',
388
+ typeSymbol: '@qilin-agent/schedule/client#ScheduleDeleteRequest',
389
+ create: _qilin_agent_schedule_schedule_delete_parameter_0$schema,
390
+ },
391
+ },
392
+ ],
393
+ cancellation: { parameter: 'signal' },
394
+ result: {
395
+ mode: 'strict',
396
+ typeSymbol: '@qilin-agent/schedule/client#ScheduleDeleteResult',
397
+ create: _qilin_agent_schedule_schedule_delete_result$schema,
398
+ },
399
+ sourceLocation: {"file":"packages/schedule/schedule/src/index.ts","line":320,"column":9},
400
+ },
401
+ {
402
+ id: '@qilin-agent/schedule#schedule/history',
403
+ service: 'schedule',
404
+ namespace: 'schedule',
405
+ method: 'history',
406
+ invocation: { kind: 'direct' },
407
+ parameters: [
408
+ {
409
+ name: 'request',
410
+ wire: 'request',
411
+ source: 'json',
412
+ codec: {
413
+ mode: 'strict',
414
+ typeSymbol: '@qilin-agent/schedule/client#ScheduleDeliveryHistoryRequest',
415
+ create: _qilin_agent_schedule_schedule_history_parameter_0$schema,
416
+ },
417
+ },
418
+ ],
419
+ result: {
420
+ mode: 'strict',
421
+ typeSymbol: '@qilin-agent/schedule/client#ScheduleDeliveryHistoryResult',
422
+ create: _qilin_agent_schedule_schedule_history_result$schema,
423
+ },
424
+ sourceLocation: {"file":"packages/schedule/schedule/src/index.ts","line":299,"column":9},
425
+ },
426
+ {
427
+ id: '@qilin-agent/schedule#schedule/list',
428
+ service: 'schedule',
429
+ namespace: 'schedule',
430
+ method: 'list',
431
+ invocation: { kind: 'direct' },
432
+ parameters: [
433
+ {
434
+ name: 'request',
435
+ wire: 'request',
436
+ source: 'json',
437
+ codec: {
438
+ mode: 'strict',
439
+ typeSymbol: '@qilin-agent/schedule/client#ScheduleListRequest',
440
+ create: _qilin_agent_schedule_schedule_list_parameter_0$schema,
441
+ },
442
+ },
443
+ ],
444
+ result: {
445
+ mode: 'strict',
446
+ typeSymbol: '@qilin-agent/schedule#schedule/list:result',
447
+ create: _qilin_agent_schedule_schedule_list_result$schema,
448
+ },
449
+ sourceLocation: {"file":"packages/schedule/schedule/src/index.ts","line":267,"column":9},
450
+ },
451
+ {
452
+ id: '@qilin-agent/schedule#schedule/update',
453
+ service: 'schedule',
454
+ namespace: 'schedule',
455
+ method: 'update',
456
+ invocation: { kind: 'direct' },
457
+ parameters: [
458
+ {
459
+ name: 'request',
460
+ wire: 'request',
461
+ source: 'json',
462
+ codec: {
463
+ mode: 'strict',
464
+ typeSymbol: '@qilin-agent/schedule/client#ScheduleUpdateRequest',
465
+ create: _qilin_agent_schedule_schedule_update_parameter_0$schema,
466
+ },
467
+ },
468
+ ],
469
+ cancellation: { parameter: 'signal' },
470
+ result: {
471
+ mode: 'strict',
472
+ typeSymbol: '@qilin-agent/schedule/client#ScheduleUpdateResult',
473
+ create: _qilin_agent_schedule_schedule_update_result$schema,
474
+ },
475
+ sourceLocation: {"file":"packages/schedule/schedule/src/index.ts","line":347,"column":9},
476
+ },
477
+ ],
478
+ }
479
+
480
+ export default TYPERT_REMOTE
@@ -0,0 +1,3 @@
1
+ /** Browser-safe Schedule vocabulary. @module @qilin-agent/schedule/client */
2
+ export type * from './types.ts';
3
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,24 @@
1
+ /** Saved delivery interpretation and identity-based pagination without Session reads. */
2
+ import type { ScheduleTask } from './storage.ts';
3
+ import type { DeliveryRetentionBounds, ScheduleDeliveryHistoryRequest, ScheduleDeliveryHistoryResult, ScheduleDeliveryReceipt } from './types.ts';
4
+ /**
5
+ * Prepare one real inbox acknowledgment for the same task write as its status and target.
6
+ * Prunes to the configured window and record cap here, on the only write path: the
7
+ * domain publishes one whole-unit document per write, so an unbounded array would
8
+ * grow that document with every acknowledgment. The read path states no bound of
9
+ * its own, because a whole-unit document over the schema's limits refuses to open.
10
+ * @param task - Task supplying the immutable sent prompt and retained history.
11
+ * @param receipt - Acknowledgment obtained after successful Session flush.
12
+ * @param bounds - Configured retention window and record cap for the appended history.
13
+ * @returns Receipt and retained history; the caller publishes them only after task persistence.
14
+ */
15
+ export declare function appendDelivery(task: ScheduleTask, receipt: ScheduleDeliveryReceipt, bounds: DeliveryRetentionBounds): Required<Pick<ScheduleTask, 'lastDelivery' | 'deliveryHistory'>>;
16
+ /**
17
+ * Read one newest-first page in append order, independent of wall-clock ordering.
18
+ * @param task - Task already checked against the requested Session binding.
19
+ * @param request - Validated explicit page size and optional exclusive message cursor.
20
+ * @param retention - Current configured limits shared with the delivery writer.
21
+ * @returns Copied delivery records or a cursor-not-found result.
22
+ */
23
+ export declare function deliveryHistoryPage(task: ScheduleTask, request: ScheduleDeliveryHistoryRequest, retention: DeliveryRetentionBounds): ScheduleDeliveryHistoryResult;
24
+ //# sourceMappingURL=delivery-history.d.ts.map
@@ -0,0 +1,66 @@
1
+ /** Milliseconds in one day, the unit the retention window is stated in. */
2
+ const DAY_MS = 86_400_000;
3
+ /**
4
+ * Read retained history; missing history exposes only the actual legacy receipt.
5
+ * @param task - Immutable stored task.
6
+ * @returns Oldest-first retained deliveries without changing storage.
7
+ */
8
+ function deliveryHistoryOf(task) {
9
+ return task.deliveryHistory ?? {
10
+ records: task.lastDelivery === undefined ? [] : [task.lastDelivery],
11
+ earlierRecordsUnavailable: true,
12
+ };
13
+ }
14
+ /**
15
+ * Prepare one real inbox acknowledgment for the same task write as its status and target.
16
+ * Prunes to the configured window and record cap here, on the only write path: the
17
+ * domain publishes one whole-unit document per write, so an unbounded array would
18
+ * grow that document with every acknowledgment. The read path states no bound of
19
+ * its own, because a whole-unit document over the schema's limits refuses to open.
20
+ * @param task - Task supplying the immutable sent prompt and retained history.
21
+ * @param receipt - Acknowledgment obtained after successful Session flush.
22
+ * @param bounds - Configured retention window and record cap for the appended history.
23
+ * @returns Receipt and retained history; the caller publishes them only after task persistence.
24
+ */
25
+ export function appendDelivery(task, receipt, bounds) {
26
+ const history = deliveryHistoryOf(task);
27
+ const appended = [...history.records, { ...receipt, prompt: task.record.prompt }];
28
+ const floor = Date.parse(receipt.deliveredAt) - bounds.days * DAY_MS;
29
+ const retained = appended
30
+ .filter(record => Date.parse(record.deliveredAt) >= floor)
31
+ .slice(-bounds.records);
32
+ return {
33
+ lastDelivery: receipt,
34
+ deliveryHistory: {
35
+ records: retained,
36
+ earlierRecordsUnavailable: history.earlierRecordsUnavailable || retained.length !== appended.length,
37
+ earlierRecordsPruned: history.earlierRecordsPruned === true || retained.length !== appended.length,
38
+ },
39
+ };
40
+ }
41
+ /**
42
+ * Read one newest-first page in append order, independent of wall-clock ordering.
43
+ * @param task - Task already checked against the requested Session binding.
44
+ * @param request - Validated explicit page size and optional exclusive message cursor.
45
+ * @param retention - Current configured limits shared with the delivery writer.
46
+ * @returns Copied delivery records or a cursor-not-found result.
47
+ */
48
+ export function deliveryHistoryPage(task, request, retention) {
49
+ const history = deliveryHistoryOf(task);
50
+ const end = request.before === undefined
51
+ ? history.records.length
52
+ : history.records.findIndex(record => record.messageId === request.before);
53
+ if (end === -1)
54
+ return { id: request.id, code: 'delivery_cursor_not_found' };
55
+ const start = Math.max(0, end - request.limit);
56
+ const records = history.records.slice(start, end).reverse().map(({ prompt, ...receipt }) => ({
57
+ ...receipt, ...(prompt === undefined ? {} : { prompt }),
58
+ }));
59
+ const oldest = records.at(-1);
60
+ return {
61
+ id: request.id, records, earlierRecordsUnavailable: history.earlierRecordsUnavailable,
62
+ earlierRecordsPruned: history.earlierRecordsPruned === true, retention: { ...retention },
63
+ ...(oldest !== undefined && start > 0 ? { nextBefore: oldest.messageId } : {}),
64
+ };
65
+ }
66
+ //# sourceMappingURL=delivery-history.js.map