@aeolus-fleet/common 0.24.0 → 0.25.0

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.
@@ -56,10 +56,10 @@ export declare const shipDetailOutputSchema: z.ZodObject<{
56
56
  lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
57
57
  ping: z.ZodNullable<z.ZodObject<{
58
58
  state: z.ZodEnum<{
59
+ acknowledged: "acknowledged";
59
60
  undeliverable: "undeliverable";
60
61
  waiting: "waiting";
61
62
  answered: "answered";
62
- received: "received";
63
63
  }>;
64
64
  sentAt: z.ZodISODateTime;
65
65
  answeredAt: z.ZodNullable<z.ZodISODateTime>;
@@ -151,8 +151,13 @@ export declare const timelineEntrySchema: z.ZodObject<{
151
151
  StartingPromptIssued: "StartingPromptIssued";
152
152
  OperatorPasswordReset: "OperatorPasswordReset";
153
153
  MessageAccepted: "MessageAccepted";
154
- DeliveryClaimed: "DeliveryClaimed";
154
+ LeasePushed: "LeasePushed";
155
+ DeliveryReceived: "DeliveryReceived";
156
+ DeliveryHanded: "DeliveryHanded";
155
157
  DeliveryAcknowledged: "DeliveryAcknowledged";
158
+ DeliveryHandled: "DeliveryHandled";
159
+ DeliveryNotHandled: "DeliveryNotHandled";
160
+ DeliveryOverdue: "DeliveryOverdue";
156
161
  DeliveryUndeliverable: "DeliveryUndeliverable";
157
162
  DeliveryReturned: "DeliveryReturned";
158
163
  ShipRetired: "ShipRetired";
@@ -160,6 +165,7 @@ export declare const timelineEntrySchema: z.ZodObject<{
160
165
  DeliveryDismissed: "DeliveryDismissed";
161
166
  ShipRenamed: "ShipRenamed";
162
167
  ShipReported: "ShipReported";
168
+ TurnReported: "TurnReported";
163
169
  SignInTicketIssued: "SignInTicketIssued";
164
170
  FleetLimitsChanged: "FleetLimitsChanged";
165
171
  ViewerSessionStarted: "ViewerSessionStarted";
@@ -228,8 +234,13 @@ export declare const shipTimelineOutputSchema: z.ZodArray<z.ZodObject<{
228
234
  StartingPromptIssued: "StartingPromptIssued";
229
235
  OperatorPasswordReset: "OperatorPasswordReset";
230
236
  MessageAccepted: "MessageAccepted";
231
- DeliveryClaimed: "DeliveryClaimed";
237
+ LeasePushed: "LeasePushed";
238
+ DeliveryReceived: "DeliveryReceived";
239
+ DeliveryHanded: "DeliveryHanded";
232
240
  DeliveryAcknowledged: "DeliveryAcknowledged";
241
+ DeliveryHandled: "DeliveryHandled";
242
+ DeliveryNotHandled: "DeliveryNotHandled";
243
+ DeliveryOverdue: "DeliveryOverdue";
233
244
  DeliveryUndeliverable: "DeliveryUndeliverable";
234
245
  DeliveryReturned: "DeliveryReturned";
235
246
  ShipRetired: "ShipRetired";
@@ -237,6 +248,7 @@ export declare const shipTimelineOutputSchema: z.ZodArray<z.ZodObject<{
237
248
  DeliveryDismissed: "DeliveryDismissed";
238
249
  ShipRenamed: "ShipRenamed";
239
250
  ShipReported: "ShipReported";
251
+ TurnReported: "TurnReported";
240
252
  SignInTicketIssued: "SignInTicketIssued";
241
253
  FleetLimitsChanged: "FleetLimitsChanged";
242
254
  ViewerSessionStarted: "ViewerSessionStarted";
@@ -317,8 +329,11 @@ export declare const listedMessageSchema: z.ZodObject<{
317
329
  id: z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>;
318
330
  state: z.ZodEnum<{
319
331
  pending: "pending";
320
- delivered: "delivered";
332
+ received: "received";
333
+ handed: "handed";
321
334
  acknowledged: "acknowledged";
335
+ handled: "handled";
336
+ notHandled: "notHandled";
322
337
  undeliverable: "undeliverable";
323
338
  dismissed: "dismissed";
324
339
  abandoned: "abandoned";
@@ -327,6 +342,7 @@ export declare const listedMessageSchema: z.ZodObject<{
327
342
  id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
328
343
  name: z.ZodString;
329
344
  }, z.core.$strip>>;
345
+ isPulled: z.ZodBoolean;
330
346
  }, z.core.$strip>;
331
347
  }, z.core.$strip>;
332
348
  export type ListedMessage = z.infer<typeof listedMessageSchema>;
@@ -356,8 +372,11 @@ export declare const shipMessagesOutputSchema: z.ZodArray<z.ZodObject<{
356
372
  id: z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>;
357
373
  state: z.ZodEnum<{
358
374
  pending: "pending";
359
- delivered: "delivered";
375
+ received: "received";
376
+ handed: "handed";
360
377
  acknowledged: "acknowledged";
378
+ handled: "handled";
379
+ notHandled: "notHandled";
361
380
  undeliverable: "undeliverable";
362
381
  dismissed: "dismissed";
363
382
  abandoned: "abandoned";
@@ -366,21 +385,76 @@ export declare const shipMessagesOutputSchema: z.ZodArray<z.ZodObject<{
366
385
  id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
367
386
  name: z.ZodString;
368
387
  }, z.core.$strip>>;
388
+ isPulled: z.ZodBoolean;
369
389
  }, z.core.$strip>;
370
390
  }, z.core.$strip>>;
371
391
  /** Input of `fleet.message`. */
372
392
  export declare const messageInputSchema: z.ZodObject<{
373
393
  messageId: z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>;
374
394
  }, z.core.$strip>;
375
- /** The event types that change a delivery: its history. */
376
- export declare const DELIVERY_HISTORY_TYPES: readonly ["MessageAccepted", "DeliveryClaimed", "DeliveryReturned", "DeliveryAcknowledged", "DeliveryUndeliverable", "DeliveryAbandoned", "DeliveryDismissed"];
377
- /** One change to a delivery: when, which ship held it and where its session ran, and the claims counted by then. */
395
+ /** The event types of a delivery's way through: its history. */
396
+ export declare const DELIVERY_HISTORY_TYPES: readonly ["MessageAccepted", "DeliveryReceived", "DeliveryHanded", "DeliveryReturned", "DeliveryAcknowledged", "DeliveryHandled", "DeliveryNotHandled", "DeliveryOverdue", "DeliveryUndeliverable", "DeliveryAbandoned", "DeliveryDismissed"];
397
+ /** The 10 and 60 minute clocks (decision 0040): handed and not confirmed, or waiting while the session is idle or busy. */
398
+ export declare const OVERDUE_CLOCKS: readonly ["notConfirmed", "idle", "busy"];
399
+ export declare const overdueClockSchema: z.ZodEnum<{
400
+ idle: "idle";
401
+ busy: "busy";
402
+ notConfirmed: "notConfirmed";
403
+ }>;
404
+ export type OverdueClock = z.infer<typeof overdueClockSchema>;
405
+ /** Why a lease ended, as its LeaseRevoked says. */
406
+ export declare const LEASE_END_REASONS: readonly ["released", "retired", "deregistered", "takenOver", "signedOut", "passwordReset"];
407
+ export declare const leaseEndReasonSchema: z.ZodEnum<{
408
+ retired: "retired";
409
+ released: "released";
410
+ deregistered: "deregistered";
411
+ takenOver: "takenOver";
412
+ signedOut: "signedOut";
413
+ passwordReset: "passwordReset";
414
+ }>;
415
+ export type LeaseEndReason = z.infer<typeof leaseEndReasonSchema>;
416
+ /**
417
+ * The computer side of a pushed lease, which receives and hands over for its
418
+ * session (decision 0040): the trierarch that crewed it, named by its ship,
419
+ * which is named for its computer, or the plugin watcher of a session crewed
420
+ * by hand.
421
+ */
422
+ export declare const computerSideSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
423
+ kind: z.ZodLiteral<"trierarch">;
424
+ trierarch: z.ZodObject<{
425
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
426
+ name: z.ZodString;
427
+ }, z.core.$strip>;
428
+ }, z.core.$strip>, z.ZodObject<{
429
+ kind: z.ZodLiteral<"pluginWatcher">;
430
+ }, z.core.$strip>], "kind">;
431
+ export type ComputerSide = z.infer<typeof computerSideSchema>;
432
+ /** Who holds a delivery now: the fleet, a computer side, or the agent. */
433
+ export declare const deliveryHolderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
434
+ kind: z.ZodLiteral<"fleet">;
435
+ }, z.core.$strip>, z.ZodObject<{
436
+ kind: z.ZodLiteral<"trierarch">;
437
+ trierarch: z.ZodObject<{
438
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
439
+ name: z.ZodString;
440
+ }, z.core.$strip>;
441
+ }, z.core.$strip>, z.ZodObject<{
442
+ kind: z.ZodLiteral<"pluginWatcher">;
443
+ }, z.core.$strip>, z.ZodObject<{
444
+ kind: z.ZodLiteral<"agent">;
445
+ }, z.core.$strip>], "kind">;
446
+ export type DeliveryHolder = z.infer<typeof deliveryHolderSchema>;
447
+ /** One step of a delivery's way: when, which ship held it and where its session ran, and what the step says of itself. */
378
448
  export declare const deliveryHistoryEntrySchema: z.ZodObject<{
379
449
  seq: z.ZodNumber;
380
450
  type: z.ZodEnum<{
381
451
  MessageAccepted: "MessageAccepted";
382
- DeliveryClaimed: "DeliveryClaimed";
452
+ DeliveryReceived: "DeliveryReceived";
453
+ DeliveryHanded: "DeliveryHanded";
383
454
  DeliveryAcknowledged: "DeliveryAcknowledged";
455
+ DeliveryHandled: "DeliveryHandled";
456
+ DeliveryNotHandled: "DeliveryNotHandled";
457
+ DeliveryOverdue: "DeliveryOverdue";
384
458
  DeliveryUndeliverable: "DeliveryUndeliverable";
385
459
  DeliveryReturned: "DeliveryReturned";
386
460
  DeliveryAbandoned: "DeliveryAbandoned";
@@ -402,9 +476,110 @@ export declare const deliveryHistoryEntrySchema: z.ZodObject<{
402
476
  }, z.core.$strip>>;
403
477
  harness: z.ZodNullable<z.ZodString>;
404
478
  attempts: z.ZodNullable<z.ZodNumber>;
479
+ by: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
480
+ kind: z.ZodLiteral<"trierarch">;
481
+ trierarch: z.ZodObject<{
482
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
483
+ name: z.ZodString;
484
+ }, z.core.$strip>;
485
+ }, z.core.$strip>, z.ZodObject<{
486
+ kind: z.ZodLiteral<"pluginWatcher">;
487
+ }, z.core.$strip>], "kind">>;
488
+ handOverNumber: z.ZodNullable<z.ZodInt>;
489
+ isAgain: z.ZodBoolean;
490
+ isOnceMore: z.ZodBoolean;
491
+ overdue: z.ZodNullable<z.ZodObject<{
492
+ clock: z.ZodEnum<{
493
+ idle: "idle";
494
+ busy: "busy";
495
+ notConfirmed: "notConfirmed";
496
+ }>;
497
+ minutes: z.ZodInt;
498
+ }, z.core.$strip>>;
499
+ leaseEnd: z.ZodNullable<z.ZodEnum<{
500
+ retired: "retired";
501
+ released: "released";
502
+ deregistered: "deregistered";
503
+ takenOver: "takenOver";
504
+ signedOut: "signedOut";
505
+ passwordReset: "passwordReset";
506
+ }>>;
405
507
  }, z.core.$strip>;
406
508
  export type DeliveryHistoryEntry = z.infer<typeof deliveryHistoryEntrySchema>;
407
- /** Output of `fleet.message`: the envelope, the payload and the delivery with its history, newest first. */
509
+ /**
510
+ * Where a delivery stands on its way: who holds it, since when its state
511
+ * holds, whether a plain receive handed it (pulled), the overdue clock argo
512
+ * was told of that still stands, the lease that holds it or waits for it with
513
+ * its computer side and its turn, and the crew its trierarch runs.
514
+ */
515
+ export declare const deliveryWaySchema: z.ZodObject<{
516
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
517
+ kind: z.ZodLiteral<"fleet">;
518
+ }, z.core.$strip>, z.ZodObject<{
519
+ kind: z.ZodLiteral<"trierarch">;
520
+ trierarch: z.ZodObject<{
521
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
522
+ name: z.ZodString;
523
+ }, z.core.$strip>;
524
+ }, z.core.$strip>, z.ZodObject<{
525
+ kind: z.ZodLiteral<"pluginWatcher">;
526
+ }, z.core.$strip>, z.ZodObject<{
527
+ kind: z.ZodLiteral<"agent">;
528
+ }, z.core.$strip>], "kind">>;
529
+ since: z.ZodISODateTime;
530
+ isPulled: z.ZodBoolean;
531
+ overdue: z.ZodNullable<z.ZodObject<{
532
+ clock: z.ZodEnum<{
533
+ idle: "idle";
534
+ busy: "busy";
535
+ notConfirmed: "notConfirmed";
536
+ }>;
537
+ minutes: z.ZodInt;
538
+ toldAt: z.ZodISODateTime;
539
+ }, z.core.$strip>>;
540
+ lease: z.ZodNullable<z.ZodObject<{
541
+ by: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
542
+ kind: z.ZodLiteral<"trierarch">;
543
+ trierarch: z.ZodObject<{
544
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
545
+ name: z.ZodString;
546
+ }, z.core.$strip>;
547
+ }, z.core.$strip>, z.ZodObject<{
548
+ kind: z.ZodLiteral<"pluginWatcher">;
549
+ }, z.core.$strip>], "kind">>;
550
+ isEnded: z.ZodBoolean;
551
+ turn: z.ZodNullable<z.ZodObject<{
552
+ turn: z.ZodEnum<{
553
+ idle: "idle";
554
+ busy: "busy";
555
+ }>;
556
+ at: z.ZodISODateTime;
557
+ }, z.core.$strip>>;
558
+ }, z.core.$strip>>;
559
+ crew: z.ZodNullable<z.ZodObject<{
560
+ status: z.ZodEnum<{
561
+ crewing: "crewing";
562
+ running: "running";
563
+ restarting: "restarting";
564
+ crashed: "crashed";
565
+ releasing: "releasing";
566
+ }>;
567
+ attempt: z.ZodInt;
568
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
569
+ }, z.core.$strip>>;
570
+ }, z.core.$strip>;
571
+ export type DeliveryWay = z.infer<typeof deliveryWaySchema>;
572
+ /** A reply to a message: the message that answers it, oldest first. */
573
+ export declare const messageReplySchema: z.ZodObject<{
574
+ id: z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>;
575
+ sender: z.ZodObject<{
576
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
577
+ name: z.ZodString;
578
+ }, z.core.$strip>;
579
+ sentAt: z.ZodISODateTime;
580
+ }, z.core.$strip>;
581
+ export type MessageReply = z.infer<typeof messageReplySchema>;
582
+ /** Output of `fleet.message`: the envelope, the payload, its replies and the delivery with its way and its history, newest first. */
408
583
  export declare const messageOutputSchema: z.ZodObject<{
409
584
  id: z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>;
410
585
  recipient: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -426,12 +601,23 @@ export declare const messageOutputSchema: z.ZodObject<{
426
601
  name: z.ZodString;
427
602
  }, z.core.$strip>;
428
603
  payload: z.ZodString;
604
+ replies: z.ZodArray<z.ZodObject<{
605
+ id: z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>;
606
+ sender: z.ZodObject<{
607
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
608
+ name: z.ZodString;
609
+ }, z.core.$strip>;
610
+ sentAt: z.ZodISODateTime;
611
+ }, z.core.$strip>>;
429
612
  delivery: z.ZodObject<{
430
613
  id: z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>;
431
614
  state: z.ZodEnum<{
432
615
  pending: "pending";
433
- delivered: "delivered";
616
+ received: "received";
617
+ handed: "handed";
434
618
  acknowledged: "acknowledged";
619
+ handled: "handled";
620
+ notHandled: "notHandled";
435
621
  undeliverable: "undeliverable";
436
622
  dismissed: "dismissed";
437
623
  abandoned: "abandoned";
@@ -441,12 +627,72 @@ export declare const messageOutputSchema: z.ZodObject<{
441
627
  id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
442
628
  name: z.ZodString;
443
629
  }, z.core.$strip>>;
630
+ way: z.ZodObject<{
631
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
632
+ kind: z.ZodLiteral<"fleet">;
633
+ }, z.core.$strip>, z.ZodObject<{
634
+ kind: z.ZodLiteral<"trierarch">;
635
+ trierarch: z.ZodObject<{
636
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
637
+ name: z.ZodString;
638
+ }, z.core.$strip>;
639
+ }, z.core.$strip>, z.ZodObject<{
640
+ kind: z.ZodLiteral<"pluginWatcher">;
641
+ }, z.core.$strip>, z.ZodObject<{
642
+ kind: z.ZodLiteral<"agent">;
643
+ }, z.core.$strip>], "kind">>;
644
+ since: z.ZodISODateTime;
645
+ isPulled: z.ZodBoolean;
646
+ overdue: z.ZodNullable<z.ZodObject<{
647
+ clock: z.ZodEnum<{
648
+ idle: "idle";
649
+ busy: "busy";
650
+ notConfirmed: "notConfirmed";
651
+ }>;
652
+ minutes: z.ZodInt;
653
+ toldAt: z.ZodISODateTime;
654
+ }, z.core.$strip>>;
655
+ lease: z.ZodNullable<z.ZodObject<{
656
+ by: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
657
+ kind: z.ZodLiteral<"trierarch">;
658
+ trierarch: z.ZodObject<{
659
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
660
+ name: z.ZodString;
661
+ }, z.core.$strip>;
662
+ }, z.core.$strip>, z.ZodObject<{
663
+ kind: z.ZodLiteral<"pluginWatcher">;
664
+ }, z.core.$strip>], "kind">>;
665
+ isEnded: z.ZodBoolean;
666
+ turn: z.ZodNullable<z.ZodObject<{
667
+ turn: z.ZodEnum<{
668
+ idle: "idle";
669
+ busy: "busy";
670
+ }>;
671
+ at: z.ZodISODateTime;
672
+ }, z.core.$strip>>;
673
+ }, z.core.$strip>>;
674
+ crew: z.ZodNullable<z.ZodObject<{
675
+ status: z.ZodEnum<{
676
+ crewing: "crewing";
677
+ running: "running";
678
+ restarting: "restarting";
679
+ crashed: "crashed";
680
+ releasing: "releasing";
681
+ }>;
682
+ attempt: z.ZodInt;
683
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
684
+ }, z.core.$strip>>;
685
+ }, z.core.$strip>;
444
686
  history: z.ZodArray<z.ZodObject<{
445
687
  seq: z.ZodNumber;
446
688
  type: z.ZodEnum<{
447
689
  MessageAccepted: "MessageAccepted";
448
- DeliveryClaimed: "DeliveryClaimed";
690
+ DeliveryReceived: "DeliveryReceived";
691
+ DeliveryHanded: "DeliveryHanded";
449
692
  DeliveryAcknowledged: "DeliveryAcknowledged";
693
+ DeliveryHandled: "DeliveryHandled";
694
+ DeliveryNotHandled: "DeliveryNotHandled";
695
+ DeliveryOverdue: "DeliveryOverdue";
450
696
  DeliveryUndeliverable: "DeliveryUndeliverable";
451
697
  DeliveryReturned: "DeliveryReturned";
452
698
  DeliveryAbandoned: "DeliveryAbandoned";
@@ -468,7 +714,140 @@ export declare const messageOutputSchema: z.ZodObject<{
468
714
  }, z.core.$strip>>;
469
715
  harness: z.ZodNullable<z.ZodString>;
470
716
  attempts: z.ZodNullable<z.ZodNumber>;
717
+ by: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
718
+ kind: z.ZodLiteral<"trierarch">;
719
+ trierarch: z.ZodObject<{
720
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
721
+ name: z.ZodString;
722
+ }, z.core.$strip>;
723
+ }, z.core.$strip>, z.ZodObject<{
724
+ kind: z.ZodLiteral<"pluginWatcher">;
725
+ }, z.core.$strip>], "kind">>;
726
+ handOverNumber: z.ZodNullable<z.ZodInt>;
727
+ isAgain: z.ZodBoolean;
728
+ isOnceMore: z.ZodBoolean;
729
+ overdue: z.ZodNullable<z.ZodObject<{
730
+ clock: z.ZodEnum<{
731
+ idle: "idle";
732
+ busy: "busy";
733
+ notConfirmed: "notConfirmed";
734
+ }>;
735
+ minutes: z.ZodInt;
736
+ }, z.core.$strip>>;
737
+ leaseEnd: z.ZodNullable<z.ZodEnum<{
738
+ retired: "retired";
739
+ released: "released";
740
+ deregistered: "deregistered";
741
+ takenOver: "takenOver";
742
+ signedOut: "signedOut";
743
+ passwordReset: "passwordReset";
744
+ }>>;
471
745
  }, z.core.$strip>>;
472
746
  }, z.core.$strip>;
473
747
  }, z.core.$strip>;
474
748
  export type MessageDetail = z.infer<typeof messageOutputSchema>;
749
+ /**
750
+ * Output of `fleet.shipWay`: a ship's side of the way (#756). The open
751
+ * lease's computer side (null: a pull lease, which no trierarch or plugin
752
+ * serves) and its turn as the hooks reported it, then how many deliveries
753
+ * wait for it and the oldest of them, sent first, with its way. No lease while
754
+ * no session crews the ship.
755
+ */
756
+ export declare const shipWayOutputSchema: z.ZodObject<{
757
+ lease: z.ZodNullable<z.ZodObject<{
758
+ by: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
759
+ kind: z.ZodLiteral<"trierarch">;
760
+ trierarch: z.ZodObject<{
761
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
762
+ name: z.ZodString;
763
+ }, z.core.$strip>;
764
+ }, z.core.$strip>, z.ZodObject<{
765
+ kind: z.ZodLiteral<"pluginWatcher">;
766
+ }, z.core.$strip>], "kind">>;
767
+ turn: z.ZodNullable<z.ZodObject<{
768
+ turn: z.ZodEnum<{
769
+ idle: "idle";
770
+ busy: "busy";
771
+ }>;
772
+ at: z.ZodISODateTime;
773
+ }, z.core.$strip>>;
774
+ }, z.core.$strip>>;
775
+ waiting: z.ZodInt;
776
+ oldest: z.ZodNullable<z.ZodObject<{
777
+ messageId: z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>;
778
+ sentAt: z.ZodISODateTime;
779
+ contentType: z.ZodString;
780
+ delivery: z.ZodObject<{
781
+ id: z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>;
782
+ state: z.ZodEnum<{
783
+ pending: "pending";
784
+ received: "received";
785
+ handed: "handed";
786
+ acknowledged: "acknowledged";
787
+ handled: "handled";
788
+ notHandled: "notHandled";
789
+ undeliverable: "undeliverable";
790
+ dismissed: "dismissed";
791
+ abandoned: "abandoned";
792
+ }>;
793
+ attempts: z.ZodInt;
794
+ way: z.ZodObject<{
795
+ holder: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
796
+ kind: z.ZodLiteral<"fleet">;
797
+ }, z.core.$strip>, z.ZodObject<{
798
+ kind: z.ZodLiteral<"trierarch">;
799
+ trierarch: z.ZodObject<{
800
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
801
+ name: z.ZodString;
802
+ }, z.core.$strip>;
803
+ }, z.core.$strip>, z.ZodObject<{
804
+ kind: z.ZodLiteral<"pluginWatcher">;
805
+ }, z.core.$strip>, z.ZodObject<{
806
+ kind: z.ZodLiteral<"agent">;
807
+ }, z.core.$strip>], "kind">>;
808
+ since: z.ZodISODateTime;
809
+ isPulled: z.ZodBoolean;
810
+ overdue: z.ZodNullable<z.ZodObject<{
811
+ clock: z.ZodEnum<{
812
+ idle: "idle";
813
+ busy: "busy";
814
+ notConfirmed: "notConfirmed";
815
+ }>;
816
+ minutes: z.ZodInt;
817
+ toldAt: z.ZodISODateTime;
818
+ }, z.core.$strip>>;
819
+ lease: z.ZodNullable<z.ZodObject<{
820
+ by: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
821
+ kind: z.ZodLiteral<"trierarch">;
822
+ trierarch: z.ZodObject<{
823
+ id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
824
+ name: z.ZodString;
825
+ }, z.core.$strip>;
826
+ }, z.core.$strip>, z.ZodObject<{
827
+ kind: z.ZodLiteral<"pluginWatcher">;
828
+ }, z.core.$strip>], "kind">>;
829
+ isEnded: z.ZodBoolean;
830
+ turn: z.ZodNullable<z.ZodObject<{
831
+ turn: z.ZodEnum<{
832
+ idle: "idle";
833
+ busy: "busy";
834
+ }>;
835
+ at: z.ZodISODateTime;
836
+ }, z.core.$strip>>;
837
+ }, z.core.$strip>>;
838
+ crew: z.ZodNullable<z.ZodObject<{
839
+ status: z.ZodEnum<{
840
+ crewing: "crewing";
841
+ running: "running";
842
+ restarting: "restarting";
843
+ crashed: "crashed";
844
+ releasing: "releasing";
845
+ }>;
846
+ attempt: z.ZodInt;
847
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
848
+ }, z.core.$strip>>;
849
+ }, z.core.$strip>;
850
+ }, z.core.$strip>;
851
+ }, z.core.$strip>>;
852
+ }, z.core.$strip>;
853
+ export type ShipWay = z.infer<typeof shipWayOutputSchema>;
@@ -2,8 +2,9 @@ import { z } from 'zod';
2
2
  import { deliveryStateSchema, eventTypeSchema, locationKindSchema } from '../fleet/index.js';
3
3
  import { idSchema } from '../ids/index.js';
4
4
  import { listedShipSchema } from './fleet.js';
5
- import { crewRequestSchema } from './crew-request.js';
5
+ import { crewRequestSchema, crewStatusSchema } from './crew-request.js';
6
6
  import { reportSchema } from './report.js';
7
+ import { turnStateSchema } from './turn.js';
7
8
  /**
8
9
  * Inputs and outputs of the history procedures, for the ship page: one ship,
9
10
  * its timeline from the event log, its messages, and one message with the
@@ -82,45 +83,134 @@ export const listedMessageSchema = z.object({
82
83
  state: deliveryStateSchema,
83
84
  /** The ship holding or having acknowledged it; null while pending. */
84
85
  claimedBy: partySchema.nullable(),
86
+ /** Handed by a plain receive, with no hand-over number: it reads handed (pulled). False in every other state. */
87
+ isPulled: z.boolean(),
85
88
  }),
86
89
  });
87
90
  /** Output of `fleet.shipMessages`: the messages the ship sent, was sent or claimed, newest first. */
88
91
  export const shipMessagesOutputSchema = z.array(listedMessageSchema);
89
92
  /** Input of `fleet.message`. */
90
93
  export const messageInputSchema = z.object({ messageId: idSchema('message') });
91
- /** The event types that change a delivery: its history. */
94
+ /** The event types of a delivery's way through: its history. */
92
95
  export const DELIVERY_HISTORY_TYPES = [
93
96
  'MessageAccepted',
94
- 'DeliveryClaimed',
97
+ 'DeliveryReceived',
98
+ 'DeliveryHanded',
95
99
  'DeliveryReturned',
96
100
  'DeliveryAcknowledged',
101
+ 'DeliveryHandled',
102
+ 'DeliveryNotHandled',
103
+ 'DeliveryOverdue',
97
104
  'DeliveryUndeliverable',
98
105
  'DeliveryAbandoned',
99
106
  'DeliveryDismissed',
100
107
  ];
101
- /** One change to a delivery: when, which ship held it and where its session ran, and the claims counted by then. */
108
+ /** The 10 and 60 minute clocks (decision 0040): handed and not confirmed, or waiting while the session is idle or busy. */
109
+ export const OVERDUE_CLOCKS = ['notConfirmed', 'idle', 'busy'];
110
+ export const overdueClockSchema = z.enum(OVERDUE_CLOCKS);
111
+ /** Why a lease ended, as its LeaseRevoked says. */
112
+ export const LEASE_END_REASONS = ['released', 'retired', 'deregistered', 'takenOver', 'signedOut', 'passwordReset'];
113
+ export const leaseEndReasonSchema = z.enum(LEASE_END_REASONS);
114
+ /**
115
+ * The computer side of a pushed lease, which receives and hands over for its
116
+ * session (decision 0040): the trierarch that crewed it, named by its ship,
117
+ * which is named for its computer, or the plugin watcher of a session crewed
118
+ * by hand.
119
+ */
120
+ export const computerSideSchema = z.discriminatedUnion('kind', [
121
+ z.object({ kind: z.literal('trierarch'), trierarch: partySchema }),
122
+ z.object({ kind: z.literal('pluginWatcher') }),
123
+ ]);
124
+ /** Who holds a delivery now: the fleet, a computer side, or the agent. */
125
+ export const deliveryHolderSchema = z.discriminatedUnion('kind', [
126
+ z.object({ kind: z.literal('fleet') }),
127
+ ...computerSideSchema.options,
128
+ z.object({ kind: z.literal('agent') }),
129
+ ]);
130
+ /** One step of a delivery's way: when, which ship held it and where its session ran, and what the step says of itself. */
102
131
  export const deliveryHistoryEntrySchema = z.object({
103
132
  seq: z.number().int().positive(),
104
133
  type: z.enum(DELIVERY_HISTORY_TYPES),
105
134
  occurredAt: isoTime,
106
- /** The ship that claimed, returned or acknowledged it; null when it was stored. */
135
+ /** The ship that received, was handed, returned or acknowledged it; null when it was stored. */
107
136
  ship: partySchema.nullable(),
108
- /** Where the claiming session ran, for a claim. */
137
+ /** Where the claiming session ran, for a hand-over. */
109
138
  location: z.object({ kind: locationKindSchema, description: z.string().nullable() }).nullable(),
110
- /** The harness the claiming session ran in, for a claim. */
139
+ /** The harness the claiming session ran in, for a hand-over. */
111
140
  harness: z.string().nullable(),
112
- /** The claims counted so far, where the event records them. */
141
+ /** The attempts counted so far, where the event records them. */
113
142
  attempts: z.number().int().nonnegative().nullable(),
143
+ /** The computer side that received it or handed it over, on a pushed lease; null otherwise. */
144
+ by: computerSideSchema.nullable(),
145
+ /** The number of a pushed hand-over; null for a plain receive's (pulled). */
146
+ handOverNumber: z.int().min(1).nullable(),
147
+ /** A push receive of a delivery its crew already held: nothing changed. */
148
+ isAgain: z.boolean(),
149
+ /** A confirmed message handed once more after its turn died. */
150
+ isOnceMore: z.boolean(),
151
+ /** Which clock ran out and after how long, for DeliveryOverdue. */
152
+ overdue: z.object({ clock: overdueClockSchema, minutes: z.int().min(1) }).nullable(),
153
+ /** Why the lease ended, for DeliveryReturned. */
154
+ leaseEnd: leaseEndReasonSchema.nullable(),
155
+ });
156
+ /**
157
+ * Where a delivery stands on its way: who holds it, since when its state
158
+ * holds, whether a plain receive handed it (pulled), the overdue clock argo
159
+ * was told of that still stands, the lease that holds it or waits for it with
160
+ * its computer side and its turn, and the crew its trierarch runs.
161
+ */
162
+ export const deliveryWaySchema = z.object({
163
+ holder: deliveryHolderSchema.nullable(),
164
+ since: isoTime,
165
+ isPulled: z.boolean(),
166
+ overdue: z.object({ clock: overdueClockSchema, minutes: z.int().min(1), toldAt: isoTime }).nullable(),
167
+ lease: z
168
+ .object({
169
+ /** Null on a pull lease. */
170
+ by: computerSideSchema.nullable(),
171
+ isEnded: z.boolean(),
172
+ turn: z.object({ turn: turnStateSchema, at: isoTime }).nullable(),
173
+ })
174
+ .nullable(),
175
+ crew: z.object({ status: crewStatusSchema, attempt: z.int().min(0), startedAt: isoTime.nullable() }).nullable(),
114
176
  });
115
- /** Output of `fleet.message`: the envelope, the payload and the delivery with its history, newest first. */
177
+ /** A reply to a message: the message that answers it, oldest first. */
178
+ export const messageReplySchema = z.object({ id: idSchema('message'), sender: partySchema, sentAt: isoTime });
179
+ /** Output of `fleet.message`: the envelope, the payload, its replies and the delivery with its way and its history, newest first. */
116
180
  export const messageOutputSchema = listedMessageSchema.omit({ preview: true, delivery: true }).extend({
117
181
  payload: z.string(),
182
+ replies: z.array(messageReplySchema),
118
183
  delivery: z.object({
119
184
  id: idSchema('delivery'),
120
185
  state: deliveryStateSchema,
121
186
  attempts: z.number().int().nonnegative(),
122
187
  claimedBy: partySchema.nullable(),
188
+ way: deliveryWaySchema,
123
189
  history: z.array(deliveryHistoryEntrySchema),
124
190
  }),
125
191
  });
192
+ /**
193
+ * Output of `fleet.shipWay`: a ship's side of the way (#756). The open
194
+ * lease's computer side (null: a pull lease, which no trierarch or plugin
195
+ * serves) and its turn as the hooks reported it, then how many deliveries
196
+ * wait for it and the oldest of them, sent first, with its way. No lease while
197
+ * no session crews the ship.
198
+ */
199
+ export const shipWayOutputSchema = z.object({
200
+ lease: z
201
+ .object({
202
+ by: computerSideSchema.nullable(),
203
+ turn: z.object({ turn: turnStateSchema, at: isoTime }).nullable(),
204
+ })
205
+ .nullable(),
206
+ waiting: z.int().min(0),
207
+ oldest: z
208
+ .object({
209
+ messageId: idSchema('message'),
210
+ sentAt: isoTime,
211
+ contentType: z.string(),
212
+ delivery: z.object({ id: idSchema('delivery'), state: deliveryStateSchema, attempts: z.int().min(0), way: deliveryWaySchema }),
213
+ })
214
+ .nullable(),
215
+ });
126
216
  //# sourceMappingURL=history.js.map