@heynixie/contract 0.76.0 → 0.77.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.
package/dist/index.js CHANGED
@@ -176,11 +176,13 @@ var forgettableKinds = [
176
176
  "task.step_errored",
177
177
  "task_message",
178
178
  "tool_called",
179
- "tool_result"
179
+ "tool_result",
180
+ "worker.run_ended",
181
+ "worker.turn_ended"
180
182
  ];
181
183
  // src/contract/contract.ts
182
184
  import { eventIterator as eventIterator2, oc as oc2 } from "@orpc/contract";
183
- import { z as z26 } from "zod";
185
+ import { z as z37 } from "zod";
184
186
 
185
187
  // src/span/span-schema.ts
186
188
  import { z } from "zod";
@@ -404,8 +406,8 @@ var memoryItemSchema = z8.object({
404
406
  changedAt: z8.date(),
405
407
  createdAt: z8.date(),
406
408
  forgottenAt: z8.date().nullable(),
409
+ isBridge: z8.boolean(),
407
410
  isPinned: z8.boolean(),
408
- isSensitive: z8.boolean(),
409
411
  itemID: z8.string(),
410
412
  kind: kindSchema,
411
413
  origin: originSchema,
@@ -443,6 +445,8 @@ var memoryVersionSchema = z8.object({
443
445
  evidence: evidenceSchema.nullable(),
444
446
  evidenceQuote: z8.string().nullable(),
445
447
  image: ownerImageSchema.nullable(),
448
+ isBridge: z8.boolean(),
449
+ isRemoved: z8.boolean(),
446
450
  origin: originSchema,
447
451
  proposalID: z8.string().nullable(),
448
452
  recordedAt: z8.date(),
@@ -469,7 +473,6 @@ var reviewReasonSchema = z8.enum([
469
473
  "other",
470
474
  "self_note",
471
475
  "from_photo",
472
- "sensitive",
473
476
  "subject_change",
474
477
  "labels",
475
478
  "ask_rule"
@@ -491,7 +494,6 @@ var memoryProposalSchema = z8.object({
491
494
  evidence: evidenceSchema.nullable(),
492
495
  image: ownerImageSchema.nullable(),
493
496
  isPinned: z8.boolean(),
494
- isSensitive: z8.boolean(),
495
497
  itemID: z8.string(),
496
498
  kind: kindSchema,
497
499
  labels: proposalLabelsSchema.nullable(),
@@ -577,7 +579,11 @@ var memoryViewContract = {
577
579
  restore: memoryChange.input(versionTargetSchema).output(versionResultSchema),
578
580
  listNotices: memoryView.input(z8.object({ thread: z8.string().min(1).max(200) })).output(z8.object({ notices: z8.array(memoryNoticeSchema) })),
579
581
  undo: memoryChange.errors({
580
- PINNED_CORE_FULL: { message: "The undo takes the pinned core past its budget", status: 409 }
582
+ PINNED_CORE_FULL: { message: "The undo takes the pinned core past its budget", status: 409 },
583
+ VERSION_REMOVED: {
584
+ message: "The earlier version was removed with a message it quoted",
585
+ status: 409
586
+ }
581
587
  }).input(versionTargetSchema).output(versionResultSchema),
582
588
  keep: memoryChange.input(versionTargetSchema).output(versionResultSchema),
583
589
  previewForget: memoryView.errors({
@@ -591,7 +597,6 @@ var memoryViewContract = {
591
597
  pin: memoryChange.errors({
592
598
  PINNED_CORE_FULL: { message: "The pin takes the pinned core past its budget", status: 409 }
593
599
  }).input(versionTargetSchema.extend({ isPinned: z8.boolean() })).output(z8.object({ isPinned: z8.boolean(), itemID: z8.string() })),
594
- markSensitive: memoryChange.input(z8.object({ clientActionID: z8.uuid(), isSensitive: z8.boolean(), itemID: itemIDSchema })).output(z8.object({ isSensitive: z8.boolean(), itemID: z8.string() })),
595
600
  ...memoryExportContract,
596
601
  ...momentContract
597
602
  };
@@ -805,6 +810,72 @@ var approvalContract = {
805
810
  answerProposals: signedIn.errors(reusedIDErrors).input(batchInputSchema).output(batchResultSchema)
806
811
  };
807
812
 
813
+ // src/contract/clipped-payload-schema.ts
814
+ import { z as z12 } from "zod";
815
+ var fieldSchema = z12.enum(["toolCall.input", "toolCall.content", "worker.text", "worker.detail"]);
816
+ var pathStepSchema = z12.union([z12.string(), z12.number()]);
817
+ var clippedPayloadSchema = z12.object({
818
+ field: fieldSchema,
819
+ path: z12.array(pathStepSchema),
820
+ bytes: z12.number()
821
+ });
822
+
823
+ // src/contract/definition-notice-schema.ts
824
+ import { z as z13 } from "zod";
825
+ var definitionNoticeSchema = z13.object({
826
+ definitionID: z13.string(),
827
+ name: z13.string().nullable(),
828
+ operation: z13.enum(["add", "change", "remove", "undo"]),
829
+ shortID: z13.string(),
830
+ changeID: z13.string(),
831
+ hasVersion: z13.boolean(),
832
+ rendered: z13.string().nullable(),
833
+ next: z13.string().nullable(),
834
+ state: z13.enum(["in_force", "superseded", "adopted", "retired"]),
835
+ isUnreadable: z13.boolean()
836
+ });
837
+
838
+ // src/contract/definitions-contract.ts
839
+ import { z as z14 } from "zod";
840
+ var operationSchema = z14.enum(["add", "change", "remove", "undo"]);
841
+ var headSchema = z14.object({
842
+ changeID: z14.string(),
843
+ shortID: z14.string(),
844
+ operation: operationSchema
845
+ });
846
+ var replacedSchema = z14.object({ head: headSchema });
847
+ var undo = signedIn.errors(reusedIDErrors).errors({
848
+ NOT_STARTED: { message: "Task definitions are not ready yet", status: 503 },
849
+ NOT_FOUND: { message: "No change has this ID", status: 404 },
850
+ REPLACED: {
851
+ message: "A later change replaced this one",
852
+ status: 409,
853
+ data: replacedSchema
854
+ },
855
+ REPO_MOVED: {
856
+ message: "The definitions repo changed this definition since",
857
+ status: 409,
858
+ data: z14.object({ seedSequence: z14.int().nonnegative() })
859
+ },
860
+ NOT_IN_FORCE: {
861
+ message: "The change is no longer in force",
862
+ status: 409,
863
+ data: z14.object({ cause: z14.enum(["one_shot_fired", "one_shot_skipped", "kept_repo"]) })
864
+ },
865
+ ONE_SHOT_OVER_REPO: {
866
+ message: "A one-time trigger cannot go back over a definition in the repo",
867
+ status: 409
868
+ },
869
+ ONE_SHOT_PAST: { message: "The time of that one-time trigger has passed", status: 409 }
870
+ });
871
+ var definitionsContract = {
872
+ undo: undo.input(z14.object({ clientActionID: z14.uuid(), changeID: z14.string().min(1).max(64) })).output(z14.object({
873
+ definitionID: z14.string(),
874
+ changeID: z14.string(),
875
+ restored: z14.literal("repo").optional()
876
+ }))
877
+ };
878
+
808
879
  // src/contract/image-limits.ts
809
880
  var imageLimits = {
810
881
  count: 4,
@@ -820,10 +891,10 @@ var imageNotFoundError = {
820
891
  };
821
892
 
822
893
  // src/contract/image-refused-error.ts
823
- import { z as z12 } from "zod";
824
- var imageRefusedDataSchema = z12.object({
825
- position: z12.int().nonnegative().nullable(),
826
- reason: z12.enum(["too_many", "too_large", "unsupported_type"])
894
+ import { z as z15 } from "zod";
895
+ var imageRefusedDataSchema = z15.object({
896
+ position: z15.int().nonnegative().nullable(),
897
+ reason: z15.enum(["too_many", "too_large", "unsupported_type"])
827
898
  });
828
899
  var imageRefusedError = {
829
900
  message: "An image is too large, of a type nixie does not take, or one too many",
@@ -831,108 +902,160 @@ var imageRefusedError = {
831
902
  data: imageRefusedDataSchema
832
903
  };
833
904
 
905
+ // src/contract/listed-task-schema.ts
906
+ import { z as z17 } from "zod";
907
+
908
+ // src/contract/thread-schema.ts
909
+ import { z as z16 } from "zod";
910
+ var threadSchema = z16.string().min(1).max(200);
911
+
912
+ // src/contract/listed-task-schema.ts
913
+ var taskStateSchema = z17.enum([
914
+ "ready",
915
+ "running",
916
+ "waiting",
917
+ "paused",
918
+ "stopped",
919
+ "done",
920
+ "failed",
921
+ "closed"
922
+ ]);
923
+ var listedStateSchema = z17.enum([...taskStateSchema.options, "idle", "finished", "asleep"]);
924
+ var runFireSchema = z17.object({
925
+ scheduledFor: z17.string(),
926
+ firedAt: z17.string(),
927
+ isCatchUp: z17.boolean()
928
+ });
929
+ var taskControlSchema = z17.enum(["pause", "resume", "stop", "restart", "close", "interrupt"]);
930
+ var actionCountSchema = z17.int().nonnegative();
931
+ var listedTaskSchema = z17.object({
932
+ actions: z17.object({
933
+ cancelled: actionCountSchema,
934
+ queued: actionCountSchema,
935
+ started: actionCountSchema
936
+ }),
937
+ brief: z17.string(),
938
+ closedBy: z17.enum(["owner", "nixie", "disposable"]).optional(),
939
+ controls: z17.array(taskControlSchema),
940
+ definitionID: z17.string().optional(),
941
+ disposable: z17.boolean().nullable(),
942
+ fire: runFireSchema.nullable().optional(),
943
+ isPauseRequested: z17.boolean(),
944
+ isPausedByNixie: z17.boolean(),
945
+ isTakingMessages: z17.boolean(),
946
+ lastActivityAt: z17.date(),
947
+ listedState: listedStateSchema.optional(),
948
+ name: z17.string(),
949
+ nextRunAt: z17.string().optional(),
950
+ runner: z17.string(),
951
+ state: taskStateSchema,
952
+ taskID: threadSchema,
953
+ wakeable: z17.boolean().optional(),
954
+ waitingOn: threadSchema.optional()
955
+ });
956
+
834
957
  // src/contract/passkey-contract.ts
835
- import { z as z20 } from "zod";
958
+ import { z as z25 } from "zod";
836
959
 
837
960
  // src/contract/challenge-for-schema.ts
838
- import { z as z13 } from "zod";
839
- var challengeForSchema = z13.discriminatedUnion("kind", [
840
- z13.object({
841
- kind: z13.literal("answer"),
842
- proposalID: z13.string().min(1).max(200),
843
- actionHash: z13.string().min(1),
961
+ import { z as z18 } from "zod";
962
+ var challengeForSchema = z18.discriminatedUnion("kind", [
963
+ z18.object({
964
+ kind: z18.literal("answer"),
965
+ proposalID: z18.string().min(1).max(200),
966
+ actionHash: z18.string().min(1),
844
967
  choice: choiceSchema,
845
- ruleHash: z13.string().optional()
968
+ ruleHash: z18.string().optional()
846
969
  }),
847
- z13.object({
848
- kind: z13.literal("unknown_outcome"),
849
- actionID: z13.string().min(1).max(200),
850
- choice: z13.literal("retry")
970
+ z18.object({
971
+ kind: z18.literal("unknown_outcome"),
972
+ actionID: z18.string().min(1).max(200),
973
+ choice: z18.literal("retry")
851
974
  }),
852
- z13.object({ kind: z13.literal("register") }),
853
- z13.object({ kind: z13.literal("revoke"), passkeyID: z13.string().min(1).max(200) })
975
+ z18.object({ kind: z18.literal("register") }),
976
+ z18.object({ kind: z18.literal("revoke"), passkeyID: z18.string().min(1).max(200) })
854
977
  ]);
855
978
 
856
979
  // src/contract/creation-options-schema.ts
857
- import { z as z17 } from "zod";
980
+ import { z as z22 } from "zod";
858
981
 
859
982
  // src/contract/credential-descriptor-schema.ts
860
- import { z as z15 } from "zod";
983
+ import { z as z20 } from "zod";
861
984
 
862
985
  // src/contract/transports-schema.ts
863
- import { z as z14 } from "zod";
864
- var transportSchema = z14.string().max(40);
865
- var transportsSchema = z14.array(transportSchema).max(10);
986
+ import { z as z19 } from "zod";
987
+ var transportSchema = z19.string().max(40);
988
+ var transportsSchema = z19.array(transportSchema).max(10);
866
989
 
867
990
  // src/contract/credential-descriptor-schema.ts
868
- var credentialDescriptorSchema = z15.object({
991
+ var credentialDescriptorSchema = z20.object({
869
992
  id: base64URLSchema,
870
- type: z15.literal("public-key"),
993
+ type: z20.literal("public-key"),
871
994
  transports: transportsSchema.optional()
872
995
  });
873
996
 
874
997
  // src/contract/user-verification-schema.ts
875
- import { z as z16 } from "zod";
876
- var userVerificationSchema = z16.enum(["required", "preferred", "discouraged"]);
998
+ import { z as z21 } from "zod";
999
+ var userVerificationSchema = z21.enum(["required", "preferred", "discouraged"]);
877
1000
 
878
1001
  // src/contract/creation-options-schema.ts
879
- var userSchema = z17.object({ id: base64URLSchema, name: z17.string(), displayName: z17.string() });
880
- var parameterSchema = z17.object({ type: z17.literal("public-key"), alg: z17.int() });
881
- var selectionSchema = z17.object({
1002
+ var userSchema = z22.object({ id: base64URLSchema, name: z22.string(), displayName: z22.string() });
1003
+ var parameterSchema = z22.object({ type: z22.literal("public-key"), alg: z22.int() });
1004
+ var selectionSchema = z22.object({
882
1005
  residentKey: userVerificationSchema,
883
- requireResidentKey: z17.boolean(),
1006
+ requireResidentKey: z22.boolean(),
884
1007
  userVerification: userVerificationSchema
885
1008
  });
886
- var creationOptionsSchema = z17.object({
887
- rp: z17.object({ id: z17.string(), name: z17.string() }),
1009
+ var creationOptionsSchema = z22.object({
1010
+ rp: z22.object({ id: z22.string(), name: z22.string() }),
888
1011
  user: userSchema,
889
1012
  challenge: base64URLSchema,
890
- pubKeyCredParams: z17.array(parameterSchema),
891
- timeout: z17.int().positive(),
892
- excludeCredentials: z17.array(credentialDescriptorSchema),
1013
+ pubKeyCredParams: z22.array(parameterSchema),
1014
+ timeout: z22.int().positive(),
1015
+ excludeCredentials: z22.array(credentialDescriptorSchema),
893
1016
  authenticatorSelection: selectionSchema,
894
- attestation: z17.enum(["none", "indirect", "direct", "enterprise"])
1017
+ attestation: z22.enum(["none", "indirect", "direct", "enterprise"])
895
1018
  });
896
1019
 
897
1020
  // src/contract/registration-response-schema.ts
898
- import { z as z18 } from "zod";
899
- var attestationSchema = z18.object({
1021
+ import { z as z23 } from "zod";
1022
+ var attestationSchema = z23.object({
900
1023
  clientDataJSON: base64URLSchema,
901
1024
  attestationObject: base64URLSchema,
902
1025
  authenticatorData: base64URLSchema.optional(),
903
1026
  transports: transportsSchema.optional(),
904
- publicKeyAlgorithm: z18.int().optional(),
1027
+ publicKeyAlgorithm: z23.int().optional(),
905
1028
  publicKey: base64URLSchema.optional()
906
1029
  });
907
- var registrationResponseSchema = z18.object({
1030
+ var registrationResponseSchema = z23.object({
908
1031
  id: base64URLSchema,
909
1032
  rawId: base64URLSchema,
910
1033
  response: attestationSchema,
911
- authenticatorAttachment: z18.enum(["cross-platform", "platform"]).optional(),
912
- clientExtensionResults: z18.object({}),
913
- type: z18.literal("public-key")
1034
+ authenticatorAttachment: z23.enum(["cross-platform", "platform"]).optional(),
1035
+ clientExtensionResults: z23.object({}),
1036
+ type: z23.literal("public-key")
914
1037
  });
915
1038
 
916
1039
  // src/contract/request-options-schema.ts
917
- import { z as z19 } from "zod";
918
- var requestOptionsSchema = z19.object({
1040
+ import { z as z24 } from "zod";
1041
+ var requestOptionsSchema = z24.object({
919
1042
  challenge: base64URLSchema,
920
- rpId: z19.string(),
921
- allowCredentials: z19.array(credentialDescriptorSchema),
1043
+ rpId: z24.string(),
1044
+ allowCredentials: z24.array(credentialDescriptorSchema),
922
1045
  userVerification: userVerificationSchema,
923
- timeout: z19.int().positive()
1046
+ timeout: z24.int().positive()
924
1047
  });
925
1048
 
926
1049
  // src/contract/passkey-contract.ts
927
- var clientActionIDSchema = z20.uuid();
928
- var listedPasskeySchema = z20.object({
929
- passkeyID: z20.string(),
930
- label: z20.string(),
931
- synced: z20.boolean(),
932
- authorizedBy: z20.string(),
933
- registeredAt: z20.date(),
934
- lastUsedAt: z20.date().nullable(),
935
- revokedAt: z20.date().nullable()
1050
+ var clientActionIDSchema = z25.uuid();
1051
+ var listedPasskeySchema = z25.object({
1052
+ passkeyID: z25.string(),
1053
+ label: z25.string(),
1054
+ synced: z25.boolean(),
1055
+ authorizedBy: z25.string(),
1056
+ registeredAt: z25.date(),
1057
+ lastUsedAt: z25.date().nullable(),
1058
+ revokedAt: z25.date().nullable()
936
1059
  });
937
1060
  var registrationErrors = {
938
1061
  ...passkeyFailedError,
@@ -944,43 +1067,71 @@ var registrationErrors = {
944
1067
  ORIGIN_CHANGED: { message: "Live passkeys hold another origin", status: 409 }
945
1068
  };
946
1069
  var passkeyContract = {
947
- challenge: signedIn.errors(noPasskeyError).input(z20.object({ for: challengeForSchema })).output(z20.object({ options: requestOptionsSchema })),
1070
+ challenge: signedIn.errors(noPasskeyError).input(z25.object({ for: challengeForSchema })).output(z25.object({ options: requestOptionsSchema })),
948
1071
  registrationOptions: signedIn.errors(registrationErrors).errors({
949
1072
  CODE_REQUIRED: { message: "A host code is required", status: 403 },
950
1073
  CODE_INVALID: { message: "The host code is unknown, used or lapsed", status: 403 }
951
- }).input(z20.object({
952
- code: z20.string().min(1).max(100).optional(),
1074
+ }).input(z25.object({
1075
+ code: z25.string().min(1).max(100).optional(),
953
1076
  passkey: authenticationResponseSchema.optional()
954
- })).output(z20.object({ options: creationOptionsSchema })),
1077
+ })).output(z25.object({ options: creationOptionsSchema })),
955
1078
  register: signedIn.errors(reusedIDErrors).errors({
956
1079
  REGISTRATION_FAILED: {
957
1080
  message: "The registration failed",
958
1081
  status: 400,
959
- data: z20.object({ reason: z20.string() })
1082
+ data: z25.object({ reason: z25.string() })
960
1083
  },
961
1084
  TOO_MANY_PASSKEYS: registrationErrors.TOO_MANY_PASSKEYS,
962
1085
  ORIGIN_UNSUPPORTED: registrationErrors.ORIGIN_UNSUPPORTED
963
- }).input(z20.object({
1086
+ }).input(z25.object({
964
1087
  clientActionID: clientActionIDSchema,
965
1088
  response: registrationResponseSchema,
966
- label: z20.string().min(1).max(64).optional()
967
- })).output(z20.object({ passkeyID: z20.string() })),
968
- list: signedIn.output(z20.object({ passkeys: z20.array(listedPasskeySchema) })),
969
- revoke: signedIn.errors(reusedIDErrors).errors(passkeyFailedError).errors({ NOT_FOUND: { message: "No passkey has this ID", status: 404 } }).input(z20.object({
1089
+ label: z25.string().min(1).max(64).optional()
1090
+ })).output(z25.object({ passkeyID: z25.string() })),
1091
+ list: signedIn.output(z25.object({ passkeys: z25.array(listedPasskeySchema) })),
1092
+ revoke: signedIn.errors(reusedIDErrors).errors(passkeyFailedError).errors({ NOT_FOUND: { message: "No passkey has this ID", status: 404 } }).input(z25.object({
970
1093
  clientActionID: clientActionIDSchema,
971
- passkeyID: z20.string().min(1).max(200),
1094
+ passkeyID: z25.string().min(1).max(200),
972
1095
  passkey: authenticationResponseSchema
973
- })).output(z20.object({ revokedAt: z20.date() }))
1096
+ })).output(z25.object({ revokedAt: z25.date() }))
974
1097
  };
975
1098
 
976
1099
  // src/contract/pause-state-schema.ts
977
- import { z as z21 } from "zod";
978
- var pauseCauseSchema = z21.enum(["restore", "owner", "spending"]);
979
- var pauseStateSchema = z21.object({ cause: pauseCauseSchema, since: z21.date() }).nullable();
1100
+ import { z as z26 } from "zod";
1101
+ var pauseCauseSchema = z26.enum(["restore", "owner", "spending"]);
1102
+ var pauseStateSchema = z26.object({ cause: pauseCauseSchema, since: z26.date() }).nullable();
1103
+
1104
+ // src/contract/read-payload-contract.ts
1105
+ import { z as z28 } from "zod";
1106
+
1107
+ // src/contract/sequence-schema.ts
1108
+ import { z as z27 } from "zod";
1109
+ var sequenceSchema = z27.int().nonnegative();
1110
+
1111
+ // src/contract/read-payload-contract.ts
1112
+ var jsonObjectSchema = z28.record(z28.string(), z28.unknown());
1113
+ var readableSchema = z28.object({
1114
+ status: z28.literal("readable"),
1115
+ toolCall: z28.object({ input: jsonObjectSchema.optional(), content: jsonObjectSchema.optional() }).optional(),
1116
+ worker: z28.object({ text: z28.string().optional(), detail: z28.string().optional() }).optional()
1117
+ });
1118
+ var forgottenSchema = z28.object({ status: z28.literal("forgotten") });
1119
+ var unreadableSchema = z28.object({ status: z28.literal("unreadable") });
1120
+ var payloadSchema = z28.discriminatedUnion("status", [
1121
+ readableSchema,
1122
+ forgottenSchema,
1123
+ unreadableSchema
1124
+ ]);
1125
+ var notFoundError = {
1126
+ message: "No record on this thread has this sequence",
1127
+ status: 404
1128
+ };
1129
+ var inputSchema = z28.object({ thread: threadSchema, sequence: sequenceSchema });
1130
+ var readPayloadContract = signedIn.errors({ RECORD_NOT_FOUND: notFoundError }).input(inputSchema).output(payloadSchema);
980
1131
 
981
1132
  // src/contract/recovery-schema.ts
982
- import { z as z22 } from "zod";
983
- var taskStateSchema = z22.enum([
1133
+ import { z as z29 } from "zod";
1134
+ var taskStateSchema2 = z29.enum([
984
1135
  "ready",
985
1136
  "running",
986
1137
  "waiting",
@@ -990,29 +1141,29 @@ var taskStateSchema = z22.enum([
990
1141
  "failed",
991
1142
  "closed"
992
1143
  ]);
993
- var taskToCheckSchema = z22.object({
994
- taskID: z22.string(),
995
- name: z22.string(),
996
- stateAtBackup: taskStateSchema,
997
- wasRunning: z22.boolean(),
998
- pendingActions: z22.int().nonnegative()
999
- });
1000
- var recoverySchema = z22.object({
1001
- restoredAt: z22.date(),
1002
- backupTakenAt: z22.date(),
1003
- toCheck: z22.array(taskToCheckSchema)
1144
+ var taskToCheckSchema = z29.object({
1145
+ taskID: z29.string(),
1146
+ name: z29.string(),
1147
+ stateAtBackup: taskStateSchema2,
1148
+ wasRunning: z29.boolean(),
1149
+ pendingActions: z29.int().nonnegative()
1150
+ });
1151
+ var recoverySchema = z29.object({
1152
+ restoredAt: z29.date(),
1153
+ backupTakenAt: z29.date(),
1154
+ toCheck: z29.array(taskToCheckSchema)
1004
1155
  }).nullable();
1005
1156
 
1006
1157
  // src/contract/rule-contract.ts
1007
- import { z as z23 } from "zod";
1008
- var ruleIDSchema = z23.string().min(1).max(200);
1009
- var revisionSchema = z23.int().positive();
1010
- var ruleSchema = z23.object({
1011
- ruleID: z23.string(),
1158
+ import { z as z30 } from "zod";
1159
+ var ruleIDSchema = z30.string().min(1).max(200);
1160
+ var revisionSchema = z30.int().positive();
1161
+ var ruleSchema = z30.object({
1162
+ ruleID: z30.string(),
1012
1163
  revision: revisionSchema,
1013
- sentence: z23.string(),
1014
- outcome: z23.enum(["allow", "ask", "deny"]),
1015
- destinations: z23.array(z23.string())
1164
+ sentence: z30.string(),
1165
+ outcome: z30.enum(["allow", "ask", "deny"]),
1166
+ destinations: z30.array(z30.string())
1016
1167
  });
1017
1168
  var notFound = { NOT_FOUND: { message: "No rule has this ID", status: 404 } };
1018
1169
  var ruleChange = signedIn.errors(reusedIDErrors).errors({
@@ -1020,29 +1171,29 @@ var ruleChange = signedIn.errors(reusedIDErrors).errors({
1020
1171
  CONFLICT: {
1021
1172
  message: "The rule changed since the notice showed it",
1022
1173
  status: 409,
1023
- data: z23.object({ revision: revisionSchema })
1174
+ data: z30.object({ revision: revisionSchema })
1024
1175
  },
1025
1176
  NOT_ALLOWED: {
1026
1177
  message: "The rule takes no such change",
1027
1178
  status: 403,
1028
- data: z23.object({ reason: z23.enum(["widens", "empty", "mandate"]) })
1179
+ data: z30.object({ reason: z30.enum(["widens", "empty", "mandate"]) })
1029
1180
  }
1030
1181
  });
1031
- var currentHashSchema = z23.object({ current: z23.object({ actionHash: z23.string() }) });
1032
- var closedStateSchema = z23.object({
1033
- state: z23.enum(["approved", "declined", "lapsed", "withdrawn"])
1034
- });
1035
- var proposalIDSchema = z23.string().min(1).max(64);
1036
- var ruleFormSchema = z23.record(z23.string(), z23.unknown());
1037
- var mandateRuleSchema = z23.object({ ruleID: z23.string(), sentence: z23.string() });
1038
- var mandateSchema = z23.object({
1039
- mandateID: z23.string(),
1040
- title: z23.string().nullable(),
1041
- rules: z23.array(mandateRuleSchema),
1042
- startedAt: z23.date(),
1043
- expires: z23.date()
1044
- });
1045
- var faultsSchema = z23.object({ faults: z23.array(z23.string()) });
1182
+ var currentHashSchema = z30.object({ current: z30.object({ actionHash: z30.string() }) });
1183
+ var closedStateSchema = z30.object({
1184
+ state: z30.enum(["approved", "declined", "lapsed", "withdrawn"])
1185
+ });
1186
+ var proposalIDSchema = z30.string().min(1).max(64);
1187
+ var ruleFormSchema = z30.record(z30.string(), z30.unknown());
1188
+ var mandateRuleSchema = z30.object({ ruleID: z30.string(), sentence: z30.string() });
1189
+ var mandateSchema = z30.object({
1190
+ mandateID: z30.string(),
1191
+ title: z30.string().nullable(),
1192
+ rules: z30.array(mandateRuleSchema),
1193
+ startedAt: z30.date(),
1194
+ expires: z30.date()
1195
+ });
1196
+ var faultsSchema = z30.object({ faults: z30.array(z30.string()) });
1046
1197
  var invalid = {
1047
1198
  INVALID: {
1048
1199
  message: "The rule or the mandate breaks the rule format or its limits",
@@ -1050,16 +1201,16 @@ var invalid = {
1050
1201
  data: faultsSchema
1051
1202
  }
1052
1203
  };
1053
- var destinationsSchema = z23.array(z23.string().regex(/^\S+$/u)).max(100);
1204
+ var destinationsSchema = z30.array(z30.string().regex(/^\S+$/u)).max(100);
1054
1205
  var ruleContract = {
1055
- readRule: signedIn.errors(notFound).input(z23.object({ ruleID: ruleIDSchema })).output(ruleSchema),
1056
- removeRule: ruleChange.input(z23.object({ ruleID: ruleIDSchema, revision: revisionSchema, clientActionID: z23.uuid() })).output(z23.object({ ruleID: z23.string() })),
1057
- editRule: ruleChange.input(z23.object({
1206
+ readRule: signedIn.errors(notFound).input(z30.object({ ruleID: ruleIDSchema })).output(ruleSchema),
1207
+ removeRule: ruleChange.input(z30.object({ ruleID: ruleIDSchema, revision: revisionSchema, clientActionID: z30.uuid() })).output(z30.object({ ruleID: z30.string() })),
1208
+ editRule: ruleChange.input(z30.object({
1058
1209
  ruleID: ruleIDSchema,
1059
1210
  revision: revisionSchema,
1060
1211
  destinations: destinationsSchema,
1061
- clientActionID: z23.uuid()
1062
- })).output(z23.object({ ruleID: z23.string(), revision: revisionSchema })),
1212
+ clientActionID: z30.uuid()
1213
+ })).output(z30.object({ ruleID: z30.string(), revision: revisionSchema })),
1063
1214
  editProposedRule: signedIn.errors(reusedIDErrors).errors({
1064
1215
  ...invalid,
1065
1216
  NOT_FOUND: { message: "No proposed rule has this ID", status: 404 },
@@ -1073,194 +1224,331 @@ var ruleContract = {
1073
1224
  status: 409,
1074
1225
  data: closedStateSchema
1075
1226
  }
1076
- }).input(z23.object({
1227
+ }).input(z30.object({
1077
1228
  proposalID: proposalIDSchema,
1078
- actionHash: z23.string(),
1229
+ actionHash: z30.string(),
1079
1230
  rule: ruleFormSchema,
1080
- clientActionID: z23.uuid()
1081
- })).output(z23.object({ proposalID: z23.string() })),
1082
- proposeMandate: signedIn.errors(reusedIDErrors).errors(invalid).input(z23.object({
1083
- title: z23.string(),
1084
- rules: z23.array(ruleFormSchema),
1085
- expires: z23.string().optional(),
1086
- clientActionID: z23.uuid()
1087
- })).output(z23.object({ proposalID: z23.string(), mandateID: z23.string(), expires: z23.date() })),
1088
- listMandates: signedIn.output(z23.object({ mandates: z23.array(mandateSchema) })),
1089
- endMandate: signedIn.errors(reusedIDErrors).errors({ NOT_FOUND: { message: "No mandate has this ID", status: 404 } }).input(z23.object({ mandateID: z23.string().min(1).max(64), clientActionID: z23.uuid() })).output(z23.object({ mandateID: z23.string(), state: z23.enum(["ended", "expired"]) }))
1231
+ clientActionID: z30.uuid()
1232
+ })).output(z30.object({ proposalID: z30.string() })),
1233
+ proposeMandate: signedIn.errors(reusedIDErrors).errors(invalid).input(z30.object({
1234
+ title: z30.string(),
1235
+ rules: z30.array(ruleFormSchema),
1236
+ expires: z30.string().optional(),
1237
+ clientActionID: z30.uuid()
1238
+ })).output(z30.object({ proposalID: z30.string(), mandateID: z30.string(), expires: z30.date() })),
1239
+ listMandates: signedIn.output(z30.object({ mandates: z30.array(mandateSchema) })),
1240
+ endMandate: signedIn.errors(reusedIDErrors).errors({ NOT_FOUND: { message: "No mandate has this ID", status: 404 } }).input(z30.object({ mandateID: z30.string().min(1).max(64), clientActionID: z30.uuid() })).output(z30.object({ mandateID: z30.string(), state: z30.enum(["ended", "expired"]) }))
1090
1241
  };
1091
1242
 
1092
1243
  // src/contract/task-schema.ts
1093
- import { z as z24 } from "zod";
1094
- var taskSchema2 = z24.object({
1095
- error: z24.string().optional(),
1096
- errorLimit: z24.int().positive().optional(),
1097
- errors: z24.int().positive().optional(),
1098
- isWaitingForRetry: z24.boolean().optional(),
1099
- readCursor: z24.int().nonnegative().optional(),
1100
- reason: z24.string().optional(),
1101
- retryAt: z24.date().optional(),
1102
- stepKey: z24.string().optional(),
1103
- taskID: z24.string()
1244
+ import { z as z31 } from "zod";
1245
+ var taskSchema2 = z31.object({
1246
+ error: z31.string().optional(),
1247
+ errorLimit: z31.int().positive().optional(),
1248
+ errors: z31.int().positive().optional(),
1249
+ isWaitingForRetry: z31.boolean().optional(),
1250
+ readCursor: z31.int().nonnegative().optional(),
1251
+ reason: z31.string().optional(),
1252
+ retryAt: z31.date().optional(),
1253
+ stepKey: z31.string().optional(),
1254
+ taskID: z31.string()
1104
1255
  });
1105
1256
 
1106
1257
  // src/contract/tool-call-schema.ts
1107
- import { z as z25 } from "zod";
1108
- var jsonObjectSchema = z25.record(z25.string(), z25.unknown());
1109
- var toolCallSchema = z25.object({
1110
- callID: z25.string(),
1111
- content: jsonObjectSchema.optional(),
1112
- input: jsonObjectSchema.optional(),
1113
- outcome: z25.string().optional(),
1114
- tool: z25.string().optional()
1258
+ import { z as z32 } from "zod";
1259
+ var jsonObjectSchema2 = z32.record(z32.string(), z32.unknown());
1260
+ var toolCallSchema = z32.object({
1261
+ callID: z32.string(),
1262
+ content: jsonObjectSchema2.optional(),
1263
+ input: jsonObjectSchema2.optional(),
1264
+ outcome: z32.string().optional(),
1265
+ runID: z32.string().optional(),
1266
+ tool: z32.string().optional()
1115
1267
  });
1116
1268
 
1117
- // src/contract/contract.ts
1118
- var clientActionIDSchema2 = z26.uuid();
1119
- var sequenceSchema = z26.int().nonnegative();
1120
- var threadSchema = z26.string().min(1).max(200);
1121
- var imageSchema = z26.object({ mediaType: z26.enum(imageLimits.mediaTypes) });
1122
- var imageFilesSchema = z26.array(z26.file());
1123
- var imageRefSchema = z26.object({
1124
- position: z26.int().nonnegative(),
1269
+ // src/contract/view-contract.ts
1270
+ import { z as z35 } from "zod";
1271
+
1272
+ // src/contract/trigger-schema.ts
1273
+ import { z as z34 } from "zod";
1274
+
1275
+ // src/contract/schedule-schema.ts
1276
+ import { z as z33 } from "zod";
1277
+
1278
+ // src/contract/is-time-zone.ts
1279
+ function isTimeZone(zone) {
1280
+ try {
1281
+ return new Intl.DateTimeFormat("en-US", { timeZone: zone }).resolvedOptions().timeZone !== "";
1282
+ } catch {
1283
+ return false;
1284
+ }
1285
+ }
1286
+
1287
+ // src/contract/schedule-schema.ts
1288
+ var clockTimeSchema = z33.string().regex(/^(?:[01]\d|2[0-3]):[0-5]\d$/u, "a time is HH:MM, 24-hour");
1289
+ var minutesSchema = z33.strictObject({
1290
+ minutes: z33.int().min(5).max(1440)
1291
+ });
1292
+ var weekdaySchema = z33.enum(["mon", "tue", "wed", "thu", "fri", "sat", "sun"]);
1293
+ var scheduleSchema = z33.strictObject({
1294
+ every: z33.union([z33.enum(["day", "week", "hour"]), minutesSchema]),
1295
+ at: clockTimeSchema.optional(),
1296
+ on: weekdaySchema.optional(),
1297
+ window: z33.strictObject({ from: clockTimeSchema, until: clockTimeSchema }).optional(),
1298
+ idleMinutes: z33.int().min(1).max(720).optional(),
1299
+ zone: z33.string().refine((zone) => zone === "owner" || isTimeZone(zone), "a zone is owner or an IANA zone").default("owner"),
1300
+ catchUp: z33.enum(["once", "skip"]).default("once")
1301
+ }).superRefine((schedule, context) => {
1302
+ const isCalendar = schedule.every === "day" || schedule.every === "week";
1303
+ if (isCalendar && schedule.at === undefined && schedule.window === undefined) {
1304
+ context.addIssue({ code: "custom", message: "day and week need at or window" });
1305
+ }
1306
+ if (isCalendar && schedule.at !== undefined && schedule.window !== undefined) {
1307
+ context.addIssue({ code: "custom", message: "at and window never come together" });
1308
+ }
1309
+ if (!isCalendar && schedule.at !== undefined) {
1310
+ context.addIssue({ code: "custom", message: "hour and minutes schedules take no at" });
1311
+ }
1312
+ if (!isCalendar && schedule.window !== undefined) {
1313
+ context.addIssue({ code: "custom", message: "hour and minutes schedules take no window" });
1314
+ }
1315
+ if (schedule.every === "week" && schedule.on === undefined) {
1316
+ context.addIssue({ code: "custom", message: "a week schedule needs on" });
1317
+ }
1318
+ if (schedule.every !== "week" && schedule.on !== undefined) {
1319
+ context.addIssue({ code: "custom", message: "only a week schedule takes on" });
1320
+ }
1321
+ if (schedule.idleMinutes !== undefined && schedule.window === undefined) {
1322
+ context.addIssue({ code: "custom", message: "idleMinutes needs window" });
1323
+ }
1324
+ });
1325
+
1326
+ // src/contract/trigger-schema.ts
1327
+ var triggerAtSchema = z34.iso.datetime({ offset: true });
1328
+ var triggerSchema = z34.union([
1329
+ z34.strictObject({ schedule: scheduleSchema }),
1330
+ z34.strictObject({ at: triggerAtSchema })
1331
+ ]);
1332
+
1333
+ // src/contract/view-contract.ts
1334
+ var skipReasonSchema = z35.enum([
1335
+ "too_late",
1336
+ "catch_up_off",
1337
+ "window_closed",
1338
+ "still_running",
1339
+ "task_held"
1340
+ ]);
1341
+ var endedRunSchema = z35.object({
1342
+ runID: z35.string(),
1343
+ taskID: threadSchema,
1344
+ definitionID: z35.string().nullable(),
1345
+ startedAt: z35.date(),
1346
+ endedAt: z35.date(),
1125
1347
  sequence: sequenceSchema,
1126
- thread: threadSchema
1348
+ cause: z35.string(),
1349
+ endedBy: z35.string(),
1350
+ carriesRunID: z35.string().nullable(),
1351
+ reportID: z35.string(),
1352
+ delivery: z35.enum(["wake", "next_turn", "kept"]),
1353
+ fire: runFireSchema.nullable(),
1354
+ used: z35.object({ turns: z35.number(), dollars: z35.number() })
1355
+ });
1356
+ var reportEntrySchema = z35.object({
1357
+ definitionID: z35.string(),
1358
+ name: z35.string(),
1359
+ kind: z35.enum(["late", "skipped"]),
1360
+ scheduledFor: z35.string(),
1361
+ firedAt: z35.string().nullable(),
1362
+ lateBySeconds: z35.number().nullable(),
1363
+ reason: skipReasonSchema.nullable(),
1364
+ sequence: sequenceSchema
1127
1365
  });
1128
- var versionRefSchema = z26.object({
1129
- itemID: z26.string().min(1).max(200),
1130
- version: z26.int().nonnegative()
1366
+ var listedDefinitionSchema = z35.object({
1367
+ definitionID: z35.string(),
1368
+ name: z35.string(),
1369
+ enabled: z35.boolean(),
1370
+ target: z35.enum(["task", "conversation"]),
1371
+ trigger: triggerSchema.nullable(),
1372
+ rendered: z35.string().nullable(),
1373
+ next: z35.string().nullable(),
1374
+ tools: z35.array(z35.string()),
1375
+ origin: z35.enum(["definitions", "nixie"]),
1376
+ createdBy: z35.object({
1377
+ sequence: sequenceSchema,
1378
+ kind: z35.enum(["definition.changed", "definitions_seeded"])
1379
+ }),
1380
+ taskID: threadSchema.nullable(),
1381
+ isUnreadable: z35.boolean()
1131
1382
  });
1132
- var recallItemSchema = versionRefSchema.extend({ score: z26.number().optional() });
1133
- var recallSchema = z26.object({ items: z26.array(recallItemSchema) });
1134
- var ratingItemSchema = versionRefSchema.extend({
1135
- hasNote: z26.boolean(),
1136
- verdict: z26.enum(["helpful", "noise", "misleading"])
1383
+ var viewContract = {
1384
+ tasks: {
1385
+ listEnded: signedIn.input(z35.object({
1386
+ limit: z35.int().min(1).max(100),
1387
+ before: sequenceSchema.optional(),
1388
+ definitionID: z35.string().min(1).max(200).optional()
1389
+ })).output(z35.object({
1390
+ tasks: z35.array(listedTaskSchema),
1391
+ runs: z35.array(endedRunSchema),
1392
+ next: sequenceSchema.nullable()
1393
+ }))
1394
+ },
1395
+ triggers: {
1396
+ report: signedIn.input(z35.object({
1397
+ since: z35.string().regex(/^\d{4}-\d{2}-\d{2}$/u),
1398
+ definitionID: z35.string().min(1).max(200).optional()
1399
+ })).output(z35.object({ entries: z35.array(reportEntrySchema) }))
1400
+ },
1401
+ definitions: {
1402
+ listTasks: signedIn.output(z35.object({ definitions: z35.array(listedDefinitionSchema) }))
1403
+ }
1404
+ };
1405
+
1406
+ // src/contract/worker-view-schema.ts
1407
+ import { z as z36 } from "zod";
1408
+ var usedSchema = z36.object({
1409
+ minutes: z36.number(),
1410
+ turns: z36.number(),
1411
+ tokens: z36.number(),
1412
+ dollars: z36.number()
1413
+ });
1414
+ var startedSchema = z36.object({
1415
+ phase: z36.literal("started"),
1416
+ workerRunID: z36.string(),
1417
+ shortID: z36.string(),
1418
+ callID: z36.string(),
1419
+ model: z36.string(),
1420
+ tools: z36.array(z36.string()),
1421
+ limits: usedSchema,
1422
+ isTaskLimit: z36.boolean()
1423
+ });
1424
+ var turnSchema = z36.object({
1425
+ phase: z36.literal("turn"),
1426
+ workerRunID: z36.string(),
1427
+ callID: z36.string(),
1428
+ turn: z36.number(),
1429
+ tokens: z36.number(),
1430
+ dollars: z36.number(),
1431
+ text: z36.string().optional()
1432
+ });
1433
+ var endedSchema = z36.object({
1434
+ phase: z36.literal("ended"),
1435
+ workerRunID: z36.string(),
1436
+ callID: z36.string(),
1437
+ outcome: z36.string(),
1438
+ limit: z36.string().optional(),
1439
+ used: usedSchema,
1440
+ detail: z36.string().optional()
1441
+ });
1442
+ var workerViewSchema = z36.discriminatedUnion("phase", [
1443
+ startedSchema,
1444
+ turnSchema,
1445
+ endedSchema
1446
+ ]);
1447
+
1448
+ // src/contract/contract.ts
1449
+ var clientActionIDSchema2 = z37.uuid();
1450
+ var imageSchema = z37.object({ mediaType: z37.enum(imageLimits.mediaTypes) });
1451
+ var imageFilesSchema = z37.array(z37.file());
1452
+ var imageRefSchema = z37.object({
1453
+ position: z37.int().nonnegative(),
1454
+ sequence: sequenceSchema,
1455
+ thread: threadSchema
1137
1456
  });
1138
- var ratingSchema = z26.object({
1139
- items: z26.array(ratingItemSchema),
1140
- ratedBy: z26.string().optional(),
1141
- recalledSequence: sequenceSchema
1457
+ var versionRefSchema = z37.object({
1458
+ itemID: z37.string().min(1).max(200),
1459
+ version: z37.int().nonnegative()
1142
1460
  });
1143
- var tokenCountSchema = z26.int().nonnegative();
1144
- var contextSchema = z26.object({ size: tokenCountSchema, window: z26.int().positive() });
1145
- var compactionSchema = z26.object({
1461
+ var recallItemSchema = versionRefSchema.extend({ score: z37.number().optional() });
1462
+ var recallSchema = z37.object({ items: z37.array(recallItemSchema) });
1463
+ var tokenCountSchema = z37.int().nonnegative();
1464
+ var contextSchema = z37.object({ size: tokenCountSchema, window: z37.int().positive() });
1465
+ var compactionSchema = z37.object({
1146
1466
  postTokens: tokenCountSchema.optional(),
1147
1467
  preTokens: tokenCountSchema,
1148
- trigger: z26.enum(["manual", "auto"])
1468
+ trigger: z37.enum(["manual", "auto"])
1149
1469
  });
1150
- var summarySchema = z26.object({
1470
+ var summarySchema = z37.object({
1151
1471
  contextSize: tokenCountSchema.optional(),
1152
1472
  summaryTokens: tokenCountSchema,
1153
- text: z26.string().optional(),
1154
- trigger: z26.enum(["threshold", "overflow"])
1155
- });
1156
- var compactionFailureSchema = z26.object({ failures: z26.int().positive() });
1157
- var ratingNoteRefSchema = z26.object({
1158
- itemID: z26.string().min(1).max(200),
1159
- sequence: sequenceSchema
1160
- });
1161
- var ratingNoteSchema = ratingNoteRefSchema.extend({
1162
- status: z26.enum(["readable", "shredded", "unreadable", "missing"]),
1163
- text: z26.string().optional()
1473
+ text: z37.string().optional(),
1474
+ trigger: z37.enum(["threshold", "overflow"])
1164
1475
  });
1476
+ var compactionFailureSchema = z37.object({ failures: z37.int().positive() });
1165
1477
  var versionTextSchema = versionRefSchema.extend({
1166
- status: z26.enum(["readable", "shredded", "unreadable", "missing"]),
1167
- text: z26.string().optional()
1478
+ status: z37.enum(["readable", "shredded", "unreadable", "missing"]),
1479
+ text: z37.string().optional()
1168
1480
  });
1169
- var listedActionSchema = z26.object({ actionID: z26.string(), tool: z26.string() });
1170
- var taskMessageSchema = z26.object({
1481
+ var listedActionSchema = z37.object({ actionID: z37.string(), tool: z37.string() });
1482
+ var taskMessageSchema = z37.object({
1171
1483
  from: threadSchema,
1172
- fromName: z26.string(),
1173
- hop: z26.int().nonnegative(),
1174
- kind: z26.string(),
1175
- messageID: z26.string(),
1176
- replyTo: z26.string().optional(),
1177
- text: z26.string().optional(),
1484
+ fromName: z37.string(),
1485
+ hop: z37.int().nonnegative(),
1486
+ kind: z37.string(),
1487
+ messageID: z37.string(),
1488
+ replyTo: z37.string().optional(),
1489
+ text: z37.string().optional(),
1178
1490
  to: threadSchema,
1179
- woke: z26.boolean()
1491
+ woke: z37.boolean()
1180
1492
  });
1181
- var exchangeNoticeSchema = z26.object({
1182
- link: z26.object({ label: z26.string(), messageID: z26.string(), taskID: threadSchema }),
1183
- text: z26.string()
1493
+ var exchangeNoticeSchema = z37.object({
1494
+ link: z37.object({ label: z37.string(), messageID: z37.string(), taskID: threadSchema }),
1495
+ text: z37.string()
1184
1496
  });
1185
- var recordSchema = z26.object({
1497
+ var reminderSchema = z37.object({
1498
+ brief: z37.string(),
1499
+ scheduledFor: z37.iso.datetime({ offset: true }),
1500
+ lateBySeconds: z37.number().nullable()
1501
+ });
1502
+ var recordSchema = z37.object({
1503
+ clipped: z37.array(clippedPayloadSchema).optional(),
1186
1504
  compaction: compactionSchema.optional(),
1187
1505
  exchangeNotice: exchangeNoticeSchema.optional(),
1506
+ reminder: reminderSchema.optional(),
1188
1507
  compactionFailure: compactionFailureSchema.optional(),
1189
- forget: z26.object({ sequence: sequenceSchema }).optional(),
1508
+ forget: z37.object({ sequence: sequenceSchema }).optional(),
1190
1509
  context: contextSchema.optional(),
1191
- isRemoved: z26.literal(true).optional(),
1192
- isSilentTurn: z26.literal(true).optional(),
1193
- kind: z26.string(),
1194
- message: z26.object({
1195
- clientMessageId: z26.uuid().optional(),
1196
- images: z26.array(imageSchema).optional(),
1197
- spans: z26.array(spanSchema).optional(),
1198
- text: z26.string()
1510
+ definitionNotice: definitionNoticeSchema.optional(),
1511
+ isRemoved: z37.literal(true).optional(),
1512
+ isSilentTurn: z37.literal(true).optional(),
1513
+ kind: z37.string(),
1514
+ message: z37.object({
1515
+ clientMessageId: z37.uuid().optional(),
1516
+ images: z37.array(imageSchema).optional(),
1517
+ spans: z37.array(spanSchema).optional(),
1518
+ text: z37.string()
1199
1519
  }).optional(),
1200
- moment: z26.object({ momentID: z26.string(), shortID: z26.string(), title: z26.string().optional() }).optional(),
1201
- rating: ratingSchema.optional(),
1202
- proposal: z26.object({ proposalID: z26.string(), shortID: z26.string() }).optional(),
1520
+ moment: z37.object({ momentID: z37.string(), shortID: z37.string(), title: z37.string().optional() }).optional(),
1521
+ proposal: z37.object({ proposalID: z37.string(), shortID: z37.string() }).optional(),
1203
1522
  recall: recallSchema.optional(),
1204
- recordedAt: z26.date(),
1205
- removal: z26.object({ kind: z26.string(), sequence: sequenceSchema, callSequence: sequenceSchema.optional() }).optional(),
1523
+ recordedAt: z37.date(),
1524
+ removal: z37.object({ kind: z37.string(), sequence: sequenceSchema, callSequence: sequenceSchema.optional() }).optional(),
1206
1525
  sequence: sequenceSchema,
1207
- stop: z26.object({ cancelledActions: z26.array(listedActionSchema) }).optional(),
1526
+ stop: z37.object({ cancelledActions: z37.array(listedActionSchema) }).optional(),
1208
1527
  summary: summarySchema.optional(),
1209
1528
  thread: threadSchema,
1210
1529
  task: taskSchema2.optional(),
1211
1530
  taskMessage: taskMessageSchema.optional(),
1212
- toolCall: toolCallSchema.optional()
1531
+ toolCall: toolCallSchema.optional(),
1532
+ worker: workerViewSchema.optional()
1213
1533
  });
1214
- var writerErrorSchema = z26.object({ at: z26.date(), code: z26.string(), message: z26.string().nullable() }).nullable();
1215
- var sessionSchema = z26.object({
1216
- createdAt: z26.date(),
1217
- current: z26.boolean(),
1218
- deviceName: z26.string(),
1219
- lastUsedAt: z26.date(),
1220
- sessionID: z26.uuid()
1534
+ var writerErrorSchema = z37.object({ at: z37.date(), code: z37.string(), message: z37.string().nullable() }).nullable();
1535
+ var sessionSchema = z37.object({
1536
+ createdAt: z37.date(),
1537
+ current: z37.boolean(),
1538
+ deviceName: z37.string(),
1539
+ lastUsedAt: z37.date(),
1540
+ sessionID: z37.uuid()
1221
1541
  });
1222
1542
  var checkedAction = signedIn.errors(reusedIDErrors);
1223
- var taskStateSchema2 = z26.enum([
1224
- "ready",
1225
- "running",
1226
- "waiting",
1227
- "paused",
1228
- "stopped",
1229
- "done",
1230
- "failed",
1231
- "closed"
1232
- ]);
1233
- var taskControlSchema = z26.enum(["pause", "resume", "stop", "restart", "close", "interrupt"]);
1234
- var actionCountSchema = z26.int().nonnegative();
1235
- var forgetPreviewItemSchema = z26.object({ itemID: z26.string(), text: z26.string() });
1236
- var recordForgetPreviewSchema = z26.object({
1543
+ var forgetPreviewItemSchema = z37.object({ itemID: z37.string(), text: z37.string() });
1544
+ var recordForgetPreviewSchema = z37.object({
1237
1545
  momentCount: actionCountSchema,
1238
- memoryItems: z26.array(forgetPreviewItemSchema)
1239
- });
1240
- var listedTaskSchema = z26.object({
1241
- actions: z26.object({
1242
- cancelled: actionCountSchema,
1243
- queued: actionCountSchema,
1244
- started: actionCountSchema
1245
- }),
1246
- brief: z26.string(),
1247
- closedBy: z26.enum(["owner", "nixie", "disposable"]).optional(),
1248
- controls: z26.array(taskControlSchema),
1249
- disposable: z26.boolean().nullable(),
1250
- isPauseRequested: z26.boolean(),
1251
- isPausedByNixie: z26.boolean(),
1252
- isTakingMessages: z26.boolean(),
1253
- lastActivityAt: z26.date(),
1254
- name: z26.string(),
1255
- runner: z26.string(),
1256
- state: taskStateSchema2,
1257
- taskID: threadSchema,
1258
- waitingOn: threadSchema.optional()
1546
+ memoryItems: z37.array(forgetPreviewItemSchema)
1259
1547
  });
1260
- var controlledTaskSchema = z26.object({
1261
- controlledAt: z26.date(),
1262
- isPauseRequested: z26.boolean(),
1263
- state: taskStateSchema2,
1548
+ var controlledTaskSchema = z37.object({
1549
+ controlledAt: z37.date(),
1550
+ isPauseRequested: z37.boolean(),
1551
+ state: taskStateSchema,
1264
1552
  taskID: threadSchema
1265
1553
  });
1266
1554
  var taskControl = checkedAction.errors({
@@ -1268,62 +1556,67 @@ var taskControl = checkedAction.errors({
1268
1556
  TASK_STATE_REFUSED: {
1269
1557
  message: "The task is in a state that does not take this control",
1270
1558
  status: 409,
1271
- data: z26.object({ isPauseRequested: z26.boolean(), state: taskStateSchema2 })
1559
+ data: z37.object({ isPauseRequested: z37.boolean(), state: taskStateSchema })
1272
1560
  },
1273
1561
  RUNNER_LACKS_CONTROL: {
1274
1562
  message: "The runner of the task does not take this control",
1275
1563
  status: 409
1276
1564
  }
1277
- }).input(z26.object({ clientActionID: clientActionIDSchema2, taskID: threadSchema })).output(controlledTaskSchema);
1278
- var markedTaskSchema = z26.object({
1279
- changedAt: z26.date(),
1280
- disposable: z26.boolean(),
1565
+ }).input(z37.object({ clientActionID: clientActionIDSchema2, taskID: threadSchema })).output(controlledTaskSchema);
1566
+ var markedTaskSchema = z37.object({
1567
+ changedAt: z37.date(),
1568
+ disposable: z37.boolean(),
1281
1569
  taskID: threadSchema
1282
1570
  });
1283
- var nixieControl = checkedAction.input(z26.object({ clientActionID: clientActionIDSchema2 })).output(z26.object({ paused: pauseStateSchema }));
1284
- var backupNoticeSchema = z26.object({
1285
- cause: z26.enum(["failed", "missing"]),
1286
- sequence: z26.int().positive(),
1287
- raisedAt: z26.date()
1288
- });
1289
- var followRecords = signedIn.input(z26.object({ afterSequence: sequenceSchema, thread: threadSchema.optional() })).output(eventIterator2(z26.object({ record: recordSchema })));
1571
+ var nixieControl = checkedAction.input(z37.object({ clientActionID: clientActionIDSchema2 })).output(z37.object({ paused: pauseStateSchema }));
1572
+ var backupNoticeSchema = z37.object({
1573
+ cause: z37.enum(["failed", "missing"]),
1574
+ sequence: z37.int().positive(),
1575
+ raisedAt: z37.date()
1576
+ });
1577
+ var followRecords = signedIn.input(z37.object({
1578
+ afterSequence: sequenceSchema,
1579
+ clipPayloads: z37.boolean().optional(),
1580
+ thread: threadSchema.optional()
1581
+ })).output(eventIterator2(z37.object({ record: recordSchema })));
1290
1582
  var contract = {
1291
1583
  conversation: {
1292
- read: signedIn.errors({ THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 } }).input(z26.object({
1584
+ read: signedIn.errors({ THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 } }).input(z37.object({
1293
1585
  beforeSequence: sequenceSchema.optional(),
1294
- limit: z26.int().min(1).max(200).optional(),
1586
+ clipPayloads: z37.boolean().optional(),
1587
+ limit: z37.int().min(1).max(200).optional(),
1295
1588
  thread: threadSchema
1296
- })).output(z26.object({
1297
- hasEarlier: z26.boolean(),
1589
+ })).output(z37.object({
1590
+ hasEarlier: z37.boolean(),
1298
1591
  readAtSequence: sequenceSchema,
1299
- records: z26.array(recordSchema),
1592
+ records: z37.array(recordSchema),
1300
1593
  lastStepEnd: recordSchema.nullable().optional()
1301
1594
  })),
1302
1595
  send: checkedAction.errors({
1303
1596
  IMAGE_REFUSED: imageRefusedError,
1304
1597
  THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 }
1305
- }).input(z26.object({
1598
+ }).input(z37.object({
1306
1599
  clientMessageId: clientActionIDSchema2,
1307
1600
  images: imageFilesSchema.optional(),
1308
- spans: z26.array(spanSchema).max(1e5),
1309
- text: z26.string().min(1).max(1e5),
1601
+ spans: z37.array(spanSchema).max(1e5),
1602
+ text: z37.string().min(1).max(1e5),
1310
1603
  thread: threadSchema,
1311
- timeZone: z26.string().min(1).max(100).optional(),
1312
- writtenAt: z26.iso.datetime().optional()
1313
- })).output(z26.object({ duplicate: z26.boolean(), sequence: sequenceSchema })),
1604
+ timeZone: z37.string().min(1).max(100).optional(),
1605
+ writtenAt: z37.iso.datetime().optional()
1606
+ })).output(z37.object({ duplicate: z37.boolean(), sequence: sequenceSchema })),
1314
1607
  retry: checkedAction.errors({
1315
1608
  NOTHING_TO_RETRY: {
1316
1609
  message: "The last turn of the conversation did not fail, or it runs again already",
1317
1610
  status: 409
1318
1611
  }
1319
- }).input(z26.object({ clientActionID: clientActionIDSchema2 })).output(z26.object({ retriedAt: z26.date() })),
1320
- readImage: signedIn.errors({ IMAGE_NOT_FOUND: imageNotFoundError }).input(imageRefSchema).output(z26.file()),
1612
+ }).input(z37.object({ clientActionID: clientActionIDSchema2 })).output(z37.object({ retriedAt: z37.date() })),
1613
+ readImage: signedIn.errors({ IMAGE_NOT_FOUND: imageNotFoundError }).input(imageRefSchema).output(z37.file()),
1321
1614
  previewForget: signedIn.errors({
1322
1615
  RECORD_NOT_FOUND: {
1323
1616
  message: "No record on this thread with its own text that a forget removes has this sequence",
1324
1617
  status: 404
1325
1618
  }
1326
- }).input(z26.object({ thread: threadSchema, sequence: sequenceSchema })).output(recordForgetPreviewSchema),
1619
+ }).input(z37.object({ thread: threadSchema, sequence: sequenceSchema })).output(recordForgetPreviewSchema),
1327
1620
  forget: checkedAction.errors({
1328
1621
  RECORD_NOT_FOUND: {
1329
1622
  message: "No record on this thread with its own text that a forget removes has this sequence",
@@ -1333,25 +1626,34 @@ var contract = {
1333
1626
  message: "The queued action has not run yet. Cancel it, or wait for it to run.",
1334
1627
  status: 409
1335
1628
  }
1336
- }).input(z26.object({
1629
+ }).input(z37.object({
1337
1630
  clientActionID: clientActionIDSchema2,
1338
1631
  sequence: sequenceSchema,
1339
1632
  thread: threadSchema
1340
- })).output(z26.object({ forgottenAt: z26.date(), backup: forgetBackupSchema }))
1633
+ })).output(z37.object({ forgottenAt: z37.date(), backup: forgetBackupSchema }))
1341
1634
  },
1342
1635
  tasks: {
1343
- list: signedIn.output(z26.object({ readAtSequence: sequenceSchema, tasks: z26.array(listedTaskSchema) })),
1344
- read: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z26.object({ taskID: threadSchema })).output(listedTaskSchema),
1345
- readActions: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z26.object({ taskID: threadSchema })).output(z26.object({
1346
- queued: z26.array(listedActionSchema),
1347
- started: z26.array(listedActionSchema)
1636
+ list: signedIn.input(z37.object({
1637
+ definitionID: z37.string().min(1).max(200).optional(),
1638
+ states: z37.array(listedStateSchema).min(1).max(11).refine((states) => new Set(states).size === states.length, {
1639
+ message: "Each state may appear once"
1640
+ }).optional()
1641
+ }).optional()).output(z37.object({ readAtSequence: sequenceSchema, tasks: z37.array(listedTaskSchema) })),
1642
+ read: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z37.object({ taskID: threadSchema })).output(listedTaskSchema),
1643
+ readActions: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z37.object({ taskID: threadSchema })).output(z37.object({
1644
+ queued: z37.array(listedActionSchema),
1645
+ started: z37.array(listedActionSchema)
1348
1646
  })),
1349
1647
  pause: taskControl,
1350
1648
  resume: taskControl,
1351
1649
  stop: taskControl,
1352
1650
  restart: taskControl,
1353
1651
  close: taskControl.errors({
1354
- CONVERSATION_NEVER_CLOSES: { message: "The conversation is never closed", status: 409 }
1652
+ CONVERSATION_NEVER_CLOSES: { message: "The conversation is never closed", status: 409 },
1653
+ DEFINITION_TASK_NEVER_CLOSES: {
1654
+ message: "The task of a definition is never closed",
1655
+ status: 409
1656
+ }
1355
1657
  }),
1356
1658
  interrupt: taskControl,
1357
1659
  setDisposable: checkedAction.errors({
@@ -1360,40 +1662,42 @@ var contract = {
1360
1662
  TASK_STATE_REFUSED: {
1361
1663
  message: "The task is in a state that does not take this change",
1362
1664
  status: 409,
1363
- data: z26.object({ state: taskStateSchema2 })
1665
+ data: z37.object({ state: taskStateSchema })
1364
1666
  }
1365
- }).input(z26.object({
1667
+ }).input(z37.object({
1366
1668
  clientActionID: clientActionIDSchema2,
1367
- disposable: z26.boolean(),
1669
+ disposable: z37.boolean(),
1368
1670
  taskID: threadSchema
1369
- })).output(markedTaskSchema)
1671
+ })).output(markedTaskSchema),
1672
+ ...viewContract.tasks
1370
1673
  },
1371
1674
  memory: {
1372
- readVersions: signedIn.input(z26.object({ versions: z26.array(versionRefSchema).min(1).max(100) })).output(z26.object({ versions: z26.array(versionTextSchema) })),
1373
- readRatingNotes: signedIn.input(z26.object({ notes: z26.array(ratingNoteRefSchema).min(1).max(100) })).output(z26.object({ notes: z26.array(ratingNoteSchema) })),
1374
- writerStatus: signedIn.route({ deprecated: true }).output(z26.object({
1375
- isEnabled: z26.boolean(),
1376
- backlog: z26.int().nonnegative(),
1377
- batches: z26.int().nonnegative(),
1675
+ readVersions: signedIn.input(z37.object({ versions: z37.array(versionRefSchema).min(1).max(100) })).output(z37.object({ versions: z37.array(versionTextSchema) })),
1676
+ writerStatus: signedIn.route({ deprecated: true }).output(z37.object({
1677
+ isEnabled: z37.boolean(),
1678
+ backlog: z37.int().nonnegative(),
1679
+ batches: z37.int().nonnegative(),
1378
1680
  cursor: sequenceSchema,
1379
- failures: z26.int().nonnegative(),
1380
- isCatchingUp: z26.boolean(),
1681
+ failures: z37.int().nonnegative(),
1682
+ isCatchingUp: z37.boolean(),
1381
1683
  lastError: writerErrorSchema,
1382
- retryAt: z26.date().nullable()
1684
+ retryAt: z37.date().nullable()
1383
1685
  })),
1384
1686
  ...memoryViewContract
1385
1687
  },
1386
1688
  nixie: {
1387
- read: signedIn.output(z26.object({ paused: pauseStateSchema })),
1689
+ read: signedIn.output(z37.object({ paused: pauseStateSchema })),
1388
1690
  pause: nixieControl,
1389
1691
  resume: nixieControl
1390
1692
  },
1391
1693
  recovery: {
1392
- read: signedIn.output(z26.object({ recovery: recoverySchema }))
1694
+ read: signedIn.output(z37.object({ recovery: recoverySchema }))
1393
1695
  },
1394
1696
  backups: {
1395
- readNotice: signedIn.output(z26.object({ notice: backupNoticeSchema.nullable() }))
1697
+ readNotice: signedIn.output(z37.object({ notice: backupNoticeSchema.nullable() }))
1396
1698
  },
1699
+ triggers: viewContract.triggers,
1700
+ definitions: { ...viewContract.definitions, ...definitionsContract },
1397
1701
  rules: ruleContract,
1398
1702
  approvals: approvalContract,
1399
1703
  passkeys: passkeyContract,
@@ -1401,7 +1705,8 @@ var contract = {
1401
1705
  follow: followRecords.route({ deprecated: true })
1402
1706
  },
1403
1707
  records: {
1404
- follow: followRecords
1708
+ follow: followRecords,
1709
+ readPayload: readPayloadContract
1405
1710
  },
1406
1711
  sessions: {
1407
1712
  enrol: oc2.errors(reusedIDErrors).errors({
@@ -1409,28 +1714,28 @@ var contract = {
1409
1714
  message: "The enrolment code is unknown, used or lapsed",
1410
1715
  status: 400
1411
1716
  }
1412
- }).input(z26.object({
1717
+ }).input(z37.object({
1413
1718
  clientActionID: clientActionIDSchema2,
1414
- code: z26.string().min(1).max(100),
1415
- deviceName: z26.string().min(1).max(100),
1416
- tokenDelivery: z26.enum(["cookie", "bearer"])
1417
- })).output(z26.object({ sessionID: z26.uuid(), token: z26.string().optional() })),
1418
- issueCode: checkedAction.input(z26.object({ clientActionID: clientActionIDSchema2 })).output(z26.object({ code: z26.string(), expiresAt: z26.date() })),
1419
- list: signedIn.output(z26.object({ sessions: z26.array(sessionSchema) })),
1420
- revoke: checkedAction.errors({ SESSION_NOT_FOUND: { message: "No session has this ID", status: 404 } }).input(z26.object({ clientActionID: clientActionIDSchema2, sessionID: z26.uuid() })).output(z26.object({ revokedAt: z26.date() }))
1719
+ code: z37.string().min(1).max(100),
1720
+ deviceName: z37.string().min(1).max(100),
1721
+ tokenDelivery: z37.enum(["cookie", "bearer"])
1722
+ })).output(z37.object({ sessionID: z37.uuid(), token: z37.string().optional() })),
1723
+ issueCode: checkedAction.input(z37.object({ clientActionID: clientActionIDSchema2 })).output(z37.object({ code: z37.string(), expiresAt: z37.date() })),
1724
+ list: signedIn.output(z37.object({ sessions: z37.array(sessionSchema) })),
1725
+ revoke: checkedAction.errors({ SESSION_NOT_FOUND: { message: "No session has this ID", status: 404 } }).input(z37.object({ clientActionID: clientActionIDSchema2, sessionID: z37.uuid() })).output(z37.object({ revokedAt: z37.date() }))
1421
1726
  }
1422
1727
  };
1423
1728
  // src/contract/host-contract.ts
1424
1729
  import { oc as oc6 } from "@orpc/contract";
1425
- import { z as z35 } from "zod";
1730
+ import { z as z46 } from "zod";
1426
1731
 
1427
1732
  // src/contract/action-proposal-schema.ts
1428
- import { z as z27 } from "zod";
1429
- var actionProposalSchema = z27.object({
1430
- proposalID: z27.string(),
1431
- tool: z27.string(),
1432
- effects: z27.array(z27.string()),
1433
- cause: z27.enum([
1733
+ import { z as z38 } from "zod";
1734
+ var actionProposalSchema = z38.object({
1735
+ proposalID: z38.string(),
1736
+ tool: z38.string(),
1737
+ effects: z38.array(z38.string()),
1738
+ cause: z38.enum([
1434
1739
  "outside_steering",
1435
1740
  "always_ask",
1436
1741
  "ask_rule",
@@ -1438,81 +1743,81 @@ var actionProposalSchema = z27.object({
1438
1743
  "direct_request",
1439
1744
  "repeat"
1440
1745
  ]),
1441
- sentence: z27.string(),
1442
- destinations: z27.array(z27.string()),
1443
- createdAt: z27.date(),
1444
- lapseAt: z27.date()
1746
+ sentence: z38.string(),
1747
+ destinations: z38.array(z38.string()),
1748
+ createdAt: z38.date(),
1749
+ lapseAt: z38.date()
1445
1750
  });
1446
1751
 
1447
1752
  // src/contract/forgotten-items-schema.ts
1448
- import { z as z28 } from "zod";
1449
- var forgottenItemsSchema = z28.object({
1450
- itemIDs: z28.array(z28.string()),
1753
+ import { z as z39 } from "zod";
1754
+ var forgottenItemsSchema = z39.object({
1755
+ itemIDs: z39.array(z39.string()),
1451
1756
  backup: forgetBackupSchema
1452
1757
  });
1453
1758
 
1454
1759
  // src/contract/host-mandates-contract.ts
1455
1760
  import { oc as oc3 } from "@orpc/contract";
1456
- import { z as z29 } from "zod";
1761
+ import { z as z40 } from "zod";
1457
1762
  var mandates = oc3.errors({
1458
1763
  NOT_FOUND: { message: "no mandate has that ID", status: 404 }
1459
1764
  });
1460
- var hostMandateRuleSchema = z29.object({ ruleID: z29.string(), sentence: z29.string() });
1461
- var hostMandateSchema = z29.object({
1462
- mandateID: z29.string(),
1463
- title: z29.string().nullable(),
1464
- rules: z29.array(hostMandateRuleSchema),
1465
- startedAt: z29.date(),
1466
- expires: z29.date()
1765
+ var hostMandateRuleSchema = z40.object({ ruleID: z40.string(), sentence: z40.string() });
1766
+ var hostMandateSchema = z40.object({
1767
+ mandateID: z40.string(),
1768
+ title: z40.string().nullable(),
1769
+ rules: z40.array(hostMandateRuleSchema),
1770
+ startedAt: z40.date(),
1771
+ expires: z40.date()
1467
1772
  });
1468
1773
  var hostMandatesContract = {
1469
- list: mandates.output(z29.array(hostMandateSchema)),
1470
- end: mandates.input(z29.strictObject({ mandateID: z29.string().min(1) })).output(z29.object({ mandateID: z29.string(), state: z29.enum(["ended", "expired"]) }))
1774
+ list: mandates.output(z40.array(hostMandateSchema)),
1775
+ end: mandates.input(z40.strictObject({ mandateID: z40.string().min(1) })).output(z40.object({ mandateID: z40.string(), state: z40.enum(["ended", "expired"]) }))
1471
1776
  };
1472
1777
 
1473
1778
  // src/contract/host-passkey-contract.ts
1474
1779
  import { oc as oc4 } from "@orpc/contract";
1475
- import { z as z30 } from "zod";
1476
- var hostPasskeySchema = z30.object({
1477
- passkeyID: z30.string(),
1478
- label: z30.string(),
1479
- synced: z30.boolean(),
1480
- origin: z30.string(),
1481
- registeredBy: z30.string(),
1482
- authorizedBy: z30.string(),
1483
- registeredAt: z30.date(),
1484
- lastUsedAt: z30.date().nullable(),
1485
- revokedAt: z30.date().nullable()
1780
+ import { z as z41 } from "zod";
1781
+ var hostPasskeySchema = z41.object({
1782
+ passkeyID: z41.string(),
1783
+ label: z41.string(),
1784
+ synced: z41.boolean(),
1785
+ origin: z41.string(),
1786
+ registeredBy: z41.string(),
1787
+ authorizedBy: z41.string(),
1788
+ registeredAt: z41.date(),
1789
+ lastUsedAt: z41.date().nullable(),
1790
+ revokedAt: z41.date().nullable()
1486
1791
  });
1487
1792
  var hostPasskeyContract = {
1488
- issueCode: oc4.output(z30.object({ code: z30.string(), expiresAt: z30.date() })),
1489
- list: oc4.output(z30.array(hostPasskeySchema)),
1793
+ issueCode: oc4.output(z41.object({ code: z41.string(), expiresAt: z41.date() })),
1794
+ list: oc4.output(z41.array(hostPasskeySchema)),
1490
1795
  revoke: oc4.errors({
1491
1796
  PASSKEY_NOT_FOUND: { message: "no passkey has that ID", status: 404 }
1492
- }).input(z30.strictObject({ passkeyID: z30.string().min(1) })).output(z30.object({ passkeyID: z30.string(), revokedAt: z30.date() }))
1797
+ }).input(z41.strictObject({ passkeyID: z41.string().min(1) })).output(z41.object({ passkeyID: z41.string(), revokedAt: z41.date() }))
1493
1798
  };
1494
1799
 
1495
1800
  // src/contract/known-contact-schema.ts
1496
- import { z as z31 } from "zod";
1497
- var knownContactSchema = z31.object({
1498
- contactID: z31.string(),
1499
- name: z31.string().nullable(),
1500
- destination: z31.string().nullable(),
1501
- markedAt: z31.date()
1801
+ import { z as z42 } from "zod";
1802
+ var knownContactSchema = z42.object({
1803
+ contactID: z42.string(),
1804
+ name: z42.string().nullable(),
1805
+ destination: z42.string().nullable(),
1806
+ markedAt: z42.date()
1502
1807
  });
1503
1808
 
1504
1809
  // src/contract/turn-inputs-contract.ts
1505
1810
  import { oc as oc5 } from "@orpc/contract";
1506
- import { z as z34 } from "zod";
1811
+ import { z as z45 } from "zod";
1507
1812
 
1508
1813
  // src/contract/input-miss-schema.ts
1509
- import { z as z32 } from "zod";
1510
- var inputMissSchema = z32.object({
1511
- missID: z32.string(),
1512
- captureID: z32.string().nullable(),
1513
- taskID: z32.string(),
1514
- stepRunID: z32.string(),
1515
- reason: z32.enum([
1814
+ import { z as z43 } from "zod";
1815
+ var inputMissSchema = z43.object({
1816
+ missID: z43.string(),
1817
+ captureID: z43.string().nullable(),
1818
+ taskID: z43.string(),
1819
+ stepRunID: z43.string(),
1820
+ reason: z43.enum([
1516
1821
  "queue_full",
1517
1822
  "spool_full",
1518
1823
  "spool_write_failed",
@@ -1524,45 +1829,45 @@ var inputMissSchema = z32.object({
1524
1829
  "intake_failed",
1525
1830
  "holds_own_value"
1526
1831
  ]),
1527
- count: z32.int().positive(),
1528
- writer: z32.string().nullable(),
1529
- counter: z32.int().nullable(),
1530
- createdAt: z32.date()
1832
+ count: z43.int().positive(),
1833
+ writer: z43.string().nullable(),
1834
+ counter: z43.int().nullable(),
1835
+ createdAt: z43.date()
1531
1836
  });
1532
1837
 
1533
1838
  // src/contract/logged-input-schema.ts
1534
- import { z as z33 } from "zod";
1535
- var loggedInputSchema = z33.object({
1536
- inputID: z33.string(),
1537
- captureID: z33.string(),
1538
- taskID: z33.string(),
1539
- stepRunID: z33.string(),
1540
- writer: z33.string(),
1541
- counter: z33.int(),
1542
- role: z33.string(),
1543
- profile: z33.string(),
1544
- model: z33.string(),
1545
- harness: z33.string(),
1546
- api: z33.string(),
1547
- endpoint: z33.string(),
1548
- route: z33.string(),
1549
- isRewritten: z33.boolean(),
1550
- upstreamStatus: z33.int(),
1551
- bytes: z33.int(),
1552
- intakeSequence: z33.int(),
1553
- receivedAt: z33.date(),
1554
- takenAt: z33.date(),
1555
- state: z33.enum(["writing", "stored", "missing", "removed"]),
1556
- removedCause: z33.enum(["retention_days", "retention_bytes", "forget", "dropped", "restore", "reset"]).nullable()
1839
+ import { z as z44 } from "zod";
1840
+ var loggedInputSchema = z44.object({
1841
+ inputID: z44.string(),
1842
+ captureID: z44.string(),
1843
+ taskID: z44.string(),
1844
+ stepRunID: z44.string(),
1845
+ writer: z44.string(),
1846
+ counter: z44.int(),
1847
+ role: z44.string(),
1848
+ profile: z44.string(),
1849
+ model: z44.string(),
1850
+ harness: z44.string(),
1851
+ api: z44.string(),
1852
+ endpoint: z44.string(),
1853
+ route: z44.string(),
1854
+ isRewritten: z44.boolean(),
1855
+ upstreamStatus: z44.int(),
1856
+ bytes: z44.int(),
1857
+ intakeSequence: z44.int(),
1858
+ receivedAt: z44.date(),
1859
+ takenAt: z44.date(),
1860
+ state: z44.enum(["writing", "stored", "missing", "removed"]),
1861
+ removedCause: z44.enum(["retention_days", "retention_bytes", "forget", "dropped", "restore", "reset"]).nullable()
1557
1862
  });
1558
1863
 
1559
1864
  // src/contract/turn-inputs-contract.ts
1560
- var turnInputOn = z34.strictObject({
1561
- state: z34.literal("on"),
1562
- forMs: z34.int().positive().nullable()
1865
+ var turnInputOn = z45.strictObject({
1866
+ state: z45.literal("on"),
1867
+ forMs: z45.int().positive().nullable()
1563
1868
  });
1564
- var turnInputOff = z34.strictObject({ state: z34.literal("off"), drop: z34.boolean() });
1565
- var turnInputSetSchema = z34.discriminatedUnion("state", [turnInputOn, turnInputOff]);
1869
+ var turnInputOff = z45.strictObject({ state: z45.literal("off"), drop: z45.boolean() });
1870
+ var turnInputSetSchema = z45.discriminatedUnion("state", [turnInputOn, turnInputOff]);
1566
1871
  var turnInputs = oc5.errors({
1567
1872
  NOT_FOUND: { message: "no logged request has that ID", status: 404 },
1568
1873
  REMOVED: { message: "that request is removed or its body is missing", status: 410 },
@@ -1572,27 +1877,27 @@ var turnInputs = oc5.errors({
1572
1877
  },
1573
1878
  NOT_CONFIGURED: { message: "the turn-input log is not configured", status: 409 }
1574
1879
  });
1575
- var listedInputsSchema = z34.object({
1576
- inputs: z34.array(loggedInputSchema),
1577
- misses: z34.array(inputMissSchema)
1880
+ var listedInputsSchema = z45.object({
1881
+ inputs: z45.array(loggedInputSchema),
1882
+ misses: z45.array(inputMissSchema)
1578
1883
  });
1579
1884
  var turnInputsContract = {
1580
- list: turnInputs.input(z34.strictObject({ limit: z34.int().positive().max(500).default(50) })).output(listedInputsSchema),
1581
- open: turnInputs.input(z34.strictObject({ inputID: z34.string().min(1) })).output(z34.object({ inputID: z34.string(), body: z34.base64() })),
1582
- set: turnInputs.input(turnInputSetSchema).output(z34.object({ state: z34.enum(["on", "off"]), until: z34.number().nullable() }))
1885
+ list: turnInputs.input(z45.strictObject({ limit: z45.int().positive().max(500).default(50) })).output(listedInputsSchema),
1886
+ open: turnInputs.input(z45.strictObject({ inputID: z45.string().min(1) })).output(z45.object({ inputID: z45.string(), body: z45.base64() })),
1887
+ set: turnInputs.input(turnInputSetSchema).output(z45.object({ state: z45.enum(["on", "off"]), until: z45.number().nullable() }))
1583
1888
  };
1584
1889
 
1585
1890
  // src/contract/host-contract.ts
1586
- var versionRefSchema2 = z35.object({ itemID: z35.string(), version: z35.int().positive() });
1587
- var versionTargetSchema2 = z35.strictObject({
1588
- itemID: z35.string().min(1),
1589
- version: z35.int().positive()
1590
- });
1591
- var itemTextSchema = z35.string().max(2000).regex(/\S/u);
1592
- var proposalOriginSchema2 = z35.enum(["owner", "conversation", "task"]);
1593
- var memoryOriginSchema = z35.enum([...proposalOriginSchema2.options, "lapse"]);
1594
- var contentSourceSchema = z35.enum(["owner", "owner_data", "untrusted"]);
1595
- var reviewReasonSchema2 = z35.enum([
1891
+ var versionRefSchema2 = z46.object({ itemID: z46.string(), version: z46.int().positive() });
1892
+ var versionTargetSchema2 = z46.strictObject({
1893
+ itemID: z46.string().min(1),
1894
+ version: z46.int().positive()
1895
+ });
1896
+ var itemTextSchema = z46.string().max(2000).regex(/\S/u);
1897
+ var proposalOriginSchema2 = z46.enum(["owner", "conversation", "task"]);
1898
+ var memoryOriginSchema = z46.enum([...proposalOriginSchema2.options, "lapse"]);
1899
+ var contentSourceSchema = z46.enum(["owner", "owner_data", "untrusted"]);
1900
+ var reviewReasonSchema2 = z46.enum([
1596
1901
  "no_quote",
1597
1902
  "quote_not_typed",
1598
1903
  "quote_in_quoted_block",
@@ -1607,72 +1912,72 @@ var reviewReasonSchema2 = z35.enum([
1607
1912
  "other",
1608
1913
  "self_note",
1609
1914
  "from_photo",
1610
- "sensitive",
1611
1915
  "subject_change",
1612
1916
  "labels",
1613
1917
  "ask_rule"
1614
1918
  ]);
1615
- var proposalSourceSchema2 = z35.object({
1919
+ var proposalSourceSchema2 = z46.object({
1616
1920
  origin: proposalOriginSchema2,
1617
- thread: z35.string().nullable(),
1618
- proposedAt: z35.date()
1619
- });
1620
- var pendingProposalSchema = z35.object({
1621
- proposalID: z35.string(),
1622
- operation: z35.enum(["remember", "retire", "pin"]),
1623
- itemID: z35.string(),
1624
- targetVersion: z35.int().nullable(),
1625
- isPinned: z35.boolean(),
1626
- subject: z35.enum(["owner", "self", "shared"]),
1627
- newSubject: z35.enum(["owner", "self", "shared"]).nullable(),
1628
- isSensitive: z35.boolean(),
1629
- kind: z35.enum(["fact", "self"]),
1921
+ thread: z46.string().nullable(),
1922
+ proposedAt: z46.date()
1923
+ });
1924
+ var pendingProposalSchema = z46.object({
1925
+ proposalID: z46.string(),
1926
+ operation: z46.enum(["remember", "retire", "pin"]),
1927
+ itemID: z46.string(),
1928
+ targetVersion: z46.int().nullable(),
1929
+ isPinned: z46.boolean(),
1930
+ subject: z46.enum(["owner", "self", "shared"]),
1931
+ newSubject: z46.enum(["owner", "self", "shared"]).nullable(),
1932
+ kind: z46.enum(["fact", "self"]),
1630
1933
  reason: reviewReasonSchema2,
1631
- actionHash: z35.string(),
1934
+ actionHash: z46.string(),
1632
1935
  origin: proposalOriginSchema2,
1633
1936
  source: contentSourceSchema,
1634
- createdAt: z35.date(),
1635
- lapseAt: z35.date(),
1636
- sources: z35.array(proposalSourceSchema2),
1637
- text: z35.string(),
1638
- quote: z35.string().nullable()
1639
- });
1640
- var closeMatchSchema2 = z35.object({ itemID: z35.string(), version: z35.int(), text: z35.string() });
1641
- var approvalResultSchema = z35.discriminatedUnion("status", [
1642
- z35.object({ status: z35.literal("applied"), itemID: z35.string(), version: z35.int() }),
1643
- z35.object({ status: z35.literal("close_match"), item: closeMatchSchema2 })
1937
+ createdAt: z46.date(),
1938
+ lapseAt: z46.date(),
1939
+ sources: z46.array(proposalSourceSchema2),
1940
+ text: z46.string(),
1941
+ quote: z46.string().nullable()
1942
+ });
1943
+ var closeMatchSchema2 = z46.object({ itemID: z46.string(), version: z46.int(), text: z46.string() });
1944
+ var approvalResultSchema = z46.discriminatedUnion("status", [
1945
+ z46.object({ status: z46.literal("applied"), itemID: z46.string(), version: z46.int() }),
1946
+ z46.object({ status: z46.literal("close_match"), item: closeMatchSchema2 })
1644
1947
  ]);
1645
- var historyVersionSchema = z35.object({
1646
- version: z35.int(),
1647
- change: z35.enum(["created", "edited", "retired", "restored", "undone"]),
1648
- state: z35.enum(["active", "retired"]),
1948
+ var historyVersionSchema = z46.object({
1949
+ version: z46.int(),
1950
+ change: z46.enum(["created", "edited", "retired", "restored", "undone"]),
1951
+ state: z46.enum(["active", "retired"]),
1649
1952
  origin: memoryOriginSchema,
1650
1953
  source: contentSourceSchema,
1651
- recordedAt: z35.date(),
1652
- status: z35.enum(["readable", "shredded", "unreadable"]),
1653
- text: z35.string().nullable()
1654
- });
1655
- var itemHistorySchema = z35.object({
1656
- itemID: z35.string(),
1657
- subject: z35.enum(["owner", "self", "shared"]),
1658
- kind: z35.enum(["fact", "self"]),
1659
- state: z35.enum(["active", "retired", "forgetting", "forgotten"]),
1660
- versions: z35.array(historyVersionSchema)
1661
- });
1662
- var proposalAnswerSchema = z35.strictObject({
1663
- proposalID: z35.string().min(1),
1664
- actionHash: z35.string().min(1)
1665
- });
1666
- var hostSessionSchema = z35.object({
1667
- sessionID: z35.string(),
1668
- deviceName: z35.string(),
1669
- createdAt: z35.date(),
1670
- lastUsedAt: z35.date()
1671
- });
1672
- var subjectCountSchema = z35.object({
1673
- owner: z35.int().nonnegative(),
1674
- shared: z35.int().nonnegative(),
1675
- self: z35.int().nonnegative()
1954
+ recordedAt: z46.date(),
1955
+ isRemoved: z46.boolean(),
1956
+ isBridge: z46.boolean(),
1957
+ status: z46.enum(["readable", "shredded", "unreadable"]),
1958
+ text: z46.string().nullable()
1959
+ });
1960
+ var itemHistorySchema = z46.object({
1961
+ itemID: z46.string(),
1962
+ subject: z46.enum(["owner", "self", "shared"]),
1963
+ kind: z46.enum(["fact", "self"]),
1964
+ state: z46.enum(["active", "retired", "forgetting", "forgotten"]),
1965
+ versions: z46.array(historyVersionSchema)
1966
+ });
1967
+ var proposalAnswerSchema = z46.strictObject({
1968
+ proposalID: z46.string().min(1),
1969
+ actionHash: z46.string().min(1)
1970
+ });
1971
+ var hostSessionSchema = z46.object({
1972
+ sessionID: z46.string(),
1973
+ deviceName: z46.string(),
1974
+ createdAt: z46.date(),
1975
+ lastUsedAt: z46.date()
1976
+ });
1977
+ var subjectCountSchema = z46.object({
1978
+ owner: z46.int().nonnegative(),
1979
+ shared: z46.int().nonnegative(),
1980
+ self: z46.int().nonnegative()
1676
1981
  });
1677
1982
  var memory = oc6.errors({
1678
1983
  MEMORY_NOT_STARTED: { message: "the memory store has not started yet", status: 503 },
@@ -1687,28 +1992,28 @@ var memory = oc6.errors({
1687
1992
  PIN_EDIT: { message: "a pin takes no edited text", status: 400 },
1688
1993
  SELF_NOTE_REFUSED: { message: "a self-note never takes that change", status: 409 }
1689
1994
  });
1690
- var skillFileSchema = z35.object({ path: z35.string(), text: z35.string() });
1691
- var pendingSkillProposalSchema = z35.object({
1692
- proposalID: z35.string(),
1693
- name: z35.string(),
1694
- skillHash: z35.string(),
1695
- baseHash: z35.string().nullable(),
1696
- files: z35.array(skillFileSchema),
1697
- inForce: z35.object({
1698
- skillHash: z35.string(),
1699
- origin: z35.enum(["definitions", "vendored", "nixie"]),
1700
- files: z35.array(skillFileSchema)
1995
+ var skillFileSchema = z46.object({ path: z46.string(), text: z46.string() });
1996
+ var pendingSkillProposalSchema = z46.object({
1997
+ proposalID: z46.string(),
1998
+ name: z46.string(),
1999
+ skillHash: z46.string(),
2000
+ baseHash: z46.string().nullable(),
2001
+ files: z46.array(skillFileSchema),
2002
+ inForce: z46.object({
2003
+ skillHash: z46.string(),
2004
+ origin: z46.enum(["definitions", "vendored", "nixie"]),
2005
+ files: z46.array(skillFileSchema)
1701
2006
  }).nullable(),
1702
- untypedToken: z35.object({ kind: z35.string(), raw: z35.string() }).nullable(),
1703
- thread: z35.string().nullable(),
1704
- provenance: z35.object({ runID: z35.string(), callID: z35.string(), profile: z35.string() }),
1705
- createdAt: z35.date(),
1706
- lapseAt: z35.date(),
1707
- isStale: z35.boolean()
2007
+ untypedToken: z46.object({ kind: z46.string(), raw: z46.string() }).nullable(),
2008
+ thread: z46.string().nullable(),
2009
+ provenance: z46.object({ runID: z46.string(), callID: z46.string(), profile: z46.string() }),
2010
+ createdAt: z46.date(),
2011
+ lapseAt: z46.date(),
2012
+ isStale: z46.boolean()
1708
2013
  });
1709
- var skillAnswerSchema = z35.strictObject({
1710
- proposalID: z35.string().min(1),
1711
- skillHash: z35.string().min(1)
2014
+ var skillAnswerSchema = z46.strictObject({
2015
+ proposalID: z46.string().min(1),
2016
+ skillHash: z46.string().min(1)
1712
2017
  });
1713
2018
  var skills = oc6.errors({
1714
2019
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
@@ -1718,38 +2023,38 @@ var skills = oc6.errors({
1718
2023
  SKILL_CHECK: { message: "the files fail the seed checks", status: 400 },
1719
2024
  WRONG_STATE: { message: "the skill nixie wrote is no longer in force", status: 409 }
1720
2025
  });
1721
- var definitionsSkillSchema = z35.object({ skillHash: z35.string(), origin: z35.enum(["definitions", "vendored"]) }).nullable();
1722
- var writtenSkillSchema = z35.object({
1723
- approvalID: z35.string(),
1724
- proposalID: z35.string(),
1725
- name: z35.string(),
1726
- skillHash: z35.string(),
2026
+ var definitionsSkillSchema = z46.object({ skillHash: z46.string(), origin: z46.enum(["definitions", "vendored"]) }).nullable();
2027
+ var writtenSkillSchema = z46.object({
2028
+ approvalID: z46.string(),
2029
+ proposalID: z46.string(),
2030
+ name: z46.string(),
2031
+ skillHash: z46.string(),
1727
2032
  base: definitionsSkillSchema,
1728
2033
  definitions: definitionsSkillSchema,
1729
- isConflict: z35.boolean(),
1730
- pullRequestURL: z35.url().nullable(),
1731
- approvedAt: z35.date()
1732
- });
1733
- var promptPartFileSchema = z35.object({ path: z35.string(), text: z35.string() });
1734
- var promptEntrySchema = z35.record(z35.string(), z35.string());
1735
- var pendingPromptProposalSchema = z35.object({
1736
- proposalID: z35.string(),
1737
- promptID: z35.string(),
1738
- proposalHash: z35.string(),
1739
- baseHash: z35.string().nullable(),
2034
+ isConflict: z46.boolean(),
2035
+ pullRequestURL: z46.url().nullable(),
2036
+ approvedAt: z46.date()
2037
+ });
2038
+ var promptPartFileSchema = z46.object({ path: z46.string(), text: z46.string() });
2039
+ var promptEntrySchema = z46.record(z46.string(), z46.string());
2040
+ var pendingPromptProposalSchema = z46.object({
2041
+ proposalID: z46.string(),
2042
+ promptID: z46.string(),
2043
+ proposalHash: z46.string(),
2044
+ baseHash: z46.string().nullable(),
1740
2045
  entry: promptEntrySchema,
1741
- files: z35.array(promptPartFileSchema),
1742
- reason: z35.string(),
1743
- inForce: z35.object({ parts: promptEntrySchema, template: z35.string().nullable() }).nullable(),
1744
- thread: z35.string().nullable(),
1745
- provenance: z35.object({ runID: z35.string(), callID: z35.string(), profile: z35.string() }),
1746
- createdAt: z35.date(),
1747
- lapseAt: z35.date(),
1748
- isStale: z35.boolean()
1749
- });
1750
- var promptAnswerSchema = z35.strictObject({
1751
- proposalID: z35.string().min(1),
1752
- proposalHash: z35.string().min(1)
2046
+ files: z46.array(promptPartFileSchema),
2047
+ reason: z46.string(),
2048
+ inForce: z46.object({ parts: promptEntrySchema, template: z46.string().nullable() }).nullable(),
2049
+ thread: z46.string().nullable(),
2050
+ provenance: z46.object({ runID: z46.string(), callID: z46.string(), profile: z46.string() }),
2051
+ createdAt: z46.date(),
2052
+ lapseAt: z46.date(),
2053
+ isStale: z46.boolean()
2054
+ });
2055
+ var promptAnswerSchema = z46.strictObject({
2056
+ proposalID: z46.string().min(1),
2057
+ proposalHash: z46.string().min(1)
1753
2058
  });
1754
2059
  var prompts = oc6.errors({
1755
2060
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
@@ -1758,59 +2063,63 @@ var prompts = oc6.errors({
1758
2063
  STALE_BASE: { message: "the override in force moved past the proposal", status: 409 },
1759
2064
  PROMPT_CHECK: { message: "the override fails the definitions checks", status: 400 }
1760
2065
  });
1761
- var ruleVersionSchema = z35.object({ ruleHash: z35.string(), sentence: z35.string() }).nullable();
1762
- var ruleInForceSchema = z35.object({
1763
- ruleID: z35.string(),
1764
- revision: z35.int().positive(),
1765
- ruleHash: z35.string(),
1766
- sentence: z35.string(),
1767
- origin: z35.enum(["definitions", "nixie"]),
1768
- changeID: z35.string().nullable(),
1769
- lastFiredAt: z35.date().nullable()
1770
- });
1771
- var ruleConflictSchema = z35.object({
1772
- ruleID: z35.string(),
1773
- changeID: z35.string(),
2066
+ var ruleVersionSchema = z46.object({ ruleHash: z46.string(), sentence: z46.string() }).nullable();
2067
+ var ruleInForceSchema = z46.object({
2068
+ ruleID: z46.string(),
2069
+ revision: z46.int().positive(),
2070
+ ruleHash: z46.string(),
2071
+ sentence: z46.string(),
2072
+ origin: z46.enum(["definitions", "nixie"]),
2073
+ changeID: z46.string().nullable(),
2074
+ lastFiredAt: z46.date().nullable()
2075
+ });
2076
+ var ruleConflictSchema = z46.object({
2077
+ ruleID: z46.string(),
2078
+ changeID: z46.string(),
1774
2079
  nixie: ruleVersionSchema,
1775
2080
  repo: ruleVersionSchema,
1776
2081
  base: ruleVersionSchema,
1777
- changedBy: z35.enum(["owner", "nixie"]),
1778
- reason: z35.string(),
1779
- changedAt: z35.date()
2082
+ changedBy: z46.enum(["owner", "nixie"]),
2083
+ reason: z46.string(),
2084
+ changedAt: z46.date()
1780
2085
  });
1781
- var ruleProposalChangeSchema = z35.object({
1782
- ruleID: z35.string(),
2086
+ var ruleProposalChangeSchema = z46.object({
2087
+ ruleID: z46.string(),
1783
2088
  before: ruleVersionSchema,
1784
2089
  after: ruleVersionSchema
1785
2090
  });
1786
- var effectChangeSchema = z35.object({
1787
- tool: z35.string(),
1788
- remove: z35.array(z35.string()),
1789
- sentence: z35.string()
2091
+ var effectChangeSchema = z46.object({
2092
+ tool: z46.string(),
2093
+ remove: z46.array(z46.string()),
2094
+ sentence: z46.string()
1790
2095
  });
1791
- var pendingRuleProposalSchema = z35.object({
1792
- proposalID: z35.string(),
1793
- changes: z35.array(ruleProposalChangeSchema),
1794
- effectChanges: z35.array(effectChangeSchema),
1795
- createdAt: z35.date(),
1796
- lapseAt: z35.date()
2096
+ var pendingRuleProposalSchema = z46.object({
2097
+ proposalID: z46.string(),
2098
+ changes: z46.array(ruleProposalChangeSchema),
2099
+ effectChanges: z46.array(effectChangeSchema),
2100
+ createdAt: z46.date(),
2101
+ lapseAt: z46.date()
1797
2102
  });
1798
- var ruleProposalAnswerSchema = z35.strictObject({ proposalID: z35.string().min(1) });
2103
+ var ruleProposalAnswerSchema = z46.strictObject({ proposalID: z46.string().min(1) });
1799
2104
  var ruleProposalRejectionSchema = ruleProposalAnswerSchema.extend({
1800
- reason: z35.string().max(500).regex(/\S/u)
2105
+ reason: z46.string().max(500).regex(/\S/u)
1801
2106
  });
1802
2107
  var actionRejectionSchema = ruleProposalAnswerSchema.extend({
1803
- reason: z35.string().max(500).regex(/\S/u).optional()
2108
+ reason: z46.string().max(500).regex(/\S/u).optional()
1804
2109
  });
1805
2110
  var ruleProposalErrors = {
1806
2111
  NOT_FOUND: { message: "nothing has that ID", status: 404 },
1807
2112
  PROPOSAL_CLOSED: { message: "the proposal is answered, withdrawn or lapsed", status: 409 }
1808
2113
  };
1809
2114
  var rules = oc6.errors(ruleProposalErrors);
2115
+ var definitions = oc6.errors({
2116
+ NOT_FOUND: { message: "the definition has no conflict with the repo", status: 404 },
2117
+ DEFINITIONS_NOT_STARTED: { message: "nixie has not started its definitions yet", status: 503 }
2118
+ });
1810
2119
  var contacts = oc6.errors({
1811
2120
  NOT_FOUND: { message: "no known contact has that ID", status: 404 }
1812
2121
  });
1813
- var hostTaskStateSchema = z35.enum([
2122
+ var hostTaskStateSchema = z46.enum([
1814
2123
  "ready",
1815
2124
  "running",
1816
2125
  "waiting",
@@ -1830,29 +2139,29 @@ var taskControl2 = oc6.errors({
1830
2139
  message: "the runner of the task does not take this control",
1831
2140
  status: 409
1832
2141
  }
1833
- }).input(z35.strictObject({ taskID: z35.string().min(1) })).output(z35.object({
1834
- taskID: z35.string(),
2142
+ }).input(z46.strictObject({ taskID: z46.string().min(1) })).output(z46.object({
2143
+ taskID: z46.string(),
1835
2144
  state: hostTaskStateSchema,
1836
- isPauseRequested: z35.boolean()
2145
+ isPauseRequested: z46.boolean()
1837
2146
  }));
1838
2147
  var hostContract = {
1839
- reset: oc6.output(z35.object({
1840
- resetAt: z35.date(),
1841
- lastSequence: z35.int().nonnegative(),
1842
- keptSessions: z35.int().nonnegative()
2148
+ reset: oc6.output(z46.object({
2149
+ resetAt: z46.date(),
2150
+ lastSequence: z46.int().nonnegative(),
2151
+ keptSessions: z46.int().nonnegative()
1843
2152
  })),
1844
- resetConversations: oc6.output(z35.object({
1845
- resetAt: z35.date(),
1846
- lastSequence: z35.int().nonnegative(),
1847
- shreddedRecords: z35.int().nonnegative(),
2153
+ resetConversations: oc6.output(z46.object({
2154
+ resetAt: z46.date(),
2155
+ lastSequence: z46.int().nonnegative(),
2156
+ shreddedRecords: z46.int().nonnegative(),
1848
2157
  backup: forgetBackupSchema
1849
2158
  })),
1850
2159
  nixie: {
1851
- pause: oc6.output(z35.object({ paused: pauseStateSchema })),
1852
- resume: oc6.output(z35.object({ paused: pauseStateSchema }))
2160
+ pause: oc6.output(z46.object({ paused: pauseStateSchema })),
2161
+ resume: oc6.output(z46.object({ paused: pauseStateSchema }))
1853
2162
  },
1854
2163
  recovery: {
1855
- read: oc6.output(z35.object({ recovery: recoverySchema }))
2164
+ read: oc6.output(z46.object({ recovery: recoverySchema }))
1856
2165
  },
1857
2166
  tasks: {
1858
2167
  pause: taskControl2,
@@ -1860,166 +2169,218 @@ var hostContract = {
1860
2169
  stop: taskControl2,
1861
2170
  restart: taskControl2,
1862
2171
  close: taskControl2.errors({
1863
- CONVERSATION_NEVER_CLOSES: { message: "the conversation is never closed", status: 409 }
2172
+ CONVERSATION_NEVER_CLOSES: { message: "the conversation is never closed", status: 409 },
2173
+ DEFINITION_TASK_NEVER_CLOSES: {
2174
+ message: "the task of a definition is never closed",
2175
+ status: 409
2176
+ }
1864
2177
  }),
1865
2178
  interrupt: taskControl2,
1866
2179
  raise: oc6.errors({
1867
2180
  TASK_NOT_FOUND: { message: "no task has that ID", status: 404 },
1868
2181
  TASK_NOT_AT_LIMIT: { message: "the task is not paused at its limit", status: 409 },
1869
2182
  LIMIT_NOT_RAISED: { message: "the new limits are not above the old ones", status: 409 }
1870
- }).input(z35.strictObject({
1871
- taskID: z35.string().min(1),
1872
- turns: z35.int().positive().optional(),
1873
- dollars: z35.number().positive().optional()
2183
+ }).input(z46.strictObject({
2184
+ taskID: z46.string().min(1),
2185
+ turns: z46.int().positive().optional(),
2186
+ dollars: z46.number().positive().optional()
1874
2187
  }).refine((input) => input.turns !== undefined || input.dollars !== undefined, {
1875
2188
  message: "a raise sets turns, dollars or both"
1876
- })).output(z35.object({
1877
- taskID: z35.string(),
2189
+ })).output(z46.object({
2190
+ taskID: z46.string(),
1878
2191
  state: hostTaskStateSchema,
1879
- isPauseRequested: z35.boolean(),
1880
- turns: z35.int().positive(),
1881
- dollars: z35.number().positive()
2192
+ isPauseRequested: z46.boolean(),
2193
+ turns: z46.int().positive(),
2194
+ dollars: z46.number().positive()
1882
2195
  }))
1883
2196
  },
1884
2197
  sessions: {
1885
- issueCode: oc6.output(z35.object({ code: z35.string(), expiresAt: z35.date() })),
1886
- list: oc6.output(z35.array(hostSessionSchema)),
2198
+ issueCode: oc6.output(z46.object({ code: z46.string(), expiresAt: z46.date() })),
2199
+ list: oc6.output(z46.array(hostSessionSchema)),
1887
2200
  label: oc6.errors({
1888
2201
  SESSION_NOT_FOUND: {
1889
2202
  message: "no device session that is still signed in has that ID",
1890
2203
  status: 404
1891
2204
  },
1892
2205
  LABEL_INVALID: { message: "a label holds 1 to 100 characters besides spaces", status: 400 }
1893
- }).input(z35.strictObject({ sessionID: z35.string().min(1), label: z35.string() })).output(z35.object({ sessionID: z35.string(), label: z35.string() }))
2206
+ }).input(z46.strictObject({ sessionID: z46.string().min(1), label: z46.string() })).output(z46.object({ sessionID: z46.string(), label: z46.string() }))
1894
2207
  },
1895
2208
  passkeys: hostPasskeyContract,
1896
2209
  memory: {
1897
2210
  proposals: {
1898
- list: memory.output(z35.array(pendingProposalSchema)),
2211
+ list: memory.output(z46.array(pendingProposalSchema)),
1899
2212
  approve: memory.input(proposalAnswerSchema.extend({
1900
2213
  revisionOf: versionTargetSchema2.optional(),
1901
- ignoreCloseMatch: z35.boolean().optional(),
2214
+ ignoreCloseMatch: z46.boolean().optional(),
1902
2215
  editedText: itemTextSchema.optional()
1903
2216
  })).output(approvalResultSchema),
1904
- reject: memory.input(proposalAnswerSchema.extend({ reason: z35.string().max(500).regex(/\S/u).optional() })).output(z35.object({ proposalID: z35.string() }))
2217
+ reject: memory.input(proposalAnswerSchema.extend({ reason: z46.string().max(500).regex(/\S/u).optional() })).output(z46.object({ proposalID: z46.string() }))
1905
2218
  },
1906
- subjects: memory.output(z35.object({ items: subjectCountSchema, proposals: subjectCountSchema })),
2219
+ subjects: memory.output(z46.object({ items: subjectCountSchema, proposals: subjectCountSchema })),
1907
2220
  items: {
1908
- read: memory.input(z35.strictObject({ itemID: z35.string().min(1) })).output(itemHistorySchema),
2221
+ read: memory.input(z46.strictObject({ itemID: z46.string().min(1) })).output(itemHistorySchema),
1909
2222
  edit: memory.input(versionTargetSchema2.extend({ text: itemTextSchema })).output(versionRefSchema2),
1910
2223
  retire: memory.input(versionTargetSchema2).output(versionRefSchema2),
1911
2224
  restore: memory.input(versionTargetSchema2).output(versionRefSchema2),
1912
- forget: memory.input(versionTargetSchema2).output(z35.object({ itemID: z35.string(), backup: forgetBackupSchema })),
2225
+ forget: memory.input(versionTargetSchema2).output(z46.object({ itemID: z46.string(), backup: forgetBackupSchema })),
1913
2226
  forgetAll: memory.output(forgottenItemsSchema),
1914
- pin: memory.input(z35.strictObject({ itemID: z35.string().min(1), isPinned: z35.boolean() })).output(z35.object({ itemID: z35.string(), isPinned: z35.boolean() }))
2227
+ pin: memory.input(z46.strictObject({ itemID: z46.string().min(1), isPinned: z46.boolean() })).output(z46.object({ itemID: z46.string(), isPinned: z46.boolean() }))
1915
2228
  }
1916
2229
  },
1917
2230
  skills: {
1918
2231
  proposals: {
1919
- list: skills.output(z35.array(pendingSkillProposalSchema)),
1920
- approve: skills.input(skillAnswerSchema.extend({ files: z35.array(skillFileSchema).min(1).optional() })).output(z35.object({ proposalID: z35.string(), approvalID: z35.string(), skillHash: z35.string() })),
1921
- reject: skills.input(skillAnswerSchema.extend({ reason: z35.string().max(500).regex(/\S/u) })).output(z35.object({ proposalID: z35.string() }))
2232
+ list: skills.output(z46.array(pendingSkillProposalSchema)),
2233
+ approve: skills.input(skillAnswerSchema.extend({ files: z46.array(skillFileSchema).min(1).optional() })).output(z46.object({ proposalID: z46.string(), approvalID: z46.string(), skillHash: z46.string() })),
2234
+ reject: skills.input(skillAnswerSchema.extend({ reason: z46.string().max(500).regex(/\S/u) })).output(z46.object({ proposalID: z46.string() }))
1922
2235
  },
1923
2236
  written: {
1924
- list: skills.output(z35.array(writtenSkillSchema)),
1925
- resolve: skills.input(z35.strictObject({
1926
- approvalID: z35.string().min(1),
1927
- keep: z35.enum(["nixie", "definitions"])
1928
- })).output(z35.object({ approvalID: z35.string(), keep: z35.enum(["nixie", "definitions"]) }))
2237
+ list: skills.output(z46.array(writtenSkillSchema)),
2238
+ resolve: skills.input(z46.strictObject({
2239
+ approvalID: z46.string().min(1),
2240
+ keep: z46.enum(["nixie", "definitions"])
2241
+ })).output(z46.object({ approvalID: z46.string(), keep: z46.enum(["nixie", "definitions"]) }))
1929
2242
  }
1930
2243
  },
1931
2244
  rules: {
1932
- list: rules.output(z35.array(ruleInForceSchema)),
1933
- conflicts: rules.output(z35.array(ruleConflictSchema)),
1934
- resolve: rules.input(z35.strictObject({ ruleID: z35.string().min(1), keep: z35.enum(["nixie", "repo"]) })).output(z35.object({ ruleID: z35.string(), changeID: z35.string(), keep: z35.enum(["nixie", "repo"]) })),
2245
+ list: rules.output(z46.array(ruleInForceSchema)),
2246
+ conflicts: rules.output(z46.array(ruleConflictSchema)),
2247
+ resolve: rules.input(z46.strictObject({ ruleID: z46.string().min(1), keep: z46.enum(["nixie", "repo"]) })).output(z46.object({ ruleID: z46.string(), changeID: z46.string(), keep: z46.enum(["nixie", "repo"]) })),
1935
2248
  proposals: {
1936
- list: rules.output(z35.array(pendingRuleProposalSchema)),
1937
- approve: rules.input(ruleProposalAnswerSchema).output(z35.object({ proposalID: z35.string() })),
1938
- reject: rules.input(ruleProposalRejectionSchema).output(z35.object({ proposalID: z35.string() }))
2249
+ list: rules.output(z46.array(pendingRuleProposalSchema)),
2250
+ approve: rules.input(ruleProposalAnswerSchema).output(z46.object({ proposalID: z46.string() })),
2251
+ reject: rules.input(ruleProposalRejectionSchema).output(z46.object({ proposalID: z46.string() }))
1939
2252
  }
1940
2253
  },
2254
+ definitions: {
2255
+ resolve: definitions.input(z46.strictObject({ definitionID: z46.string().min(1), keep: z46.enum(["nixie", "repo"]) })).output(z46.object({
2256
+ definitionID: z46.string(),
2257
+ changeID: z46.string(),
2258
+ keep: z46.enum(["nixie", "repo"])
2259
+ }))
2260
+ },
1941
2261
  actions: {
1942
2262
  proposals: {
1943
- list: rules.output(z35.array(actionProposalSchema)),
1944
- approve: rules.input(ruleProposalAnswerSchema).output(z35.object({ proposalID: z35.string() })),
1945
- reject: rules.input(actionRejectionSchema).output(z35.object({ proposalID: z35.string() }))
2263
+ list: rules.output(z46.array(actionProposalSchema)),
2264
+ approve: rules.input(ruleProposalAnswerSchema).output(z46.object({ proposalID: z46.string() })),
2265
+ reject: rules.input(actionRejectionSchema).output(z46.object({ proposalID: z46.string() }))
1946
2266
  }
1947
2267
  },
1948
2268
  mandates: hostMandatesContract,
1949
2269
  contacts: {
1950
- list: contacts.output(z35.array(knownContactSchema)),
1951
- markKnown: contacts.input(z35.strictObject({
1952
- destination: z35.string().min(1).max(500),
1953
- name: z35.string().min(1).max(200).optional()
1954
- })).output(z35.object({ contact: knownContactSchema, isNew: z35.boolean() })),
1955
- unmark: contacts.input(z35.strictObject({ contactID: z35.string().min(1) })).output(z35.object({ contactID: z35.string() }))
2270
+ list: contacts.output(z46.array(knownContactSchema)),
2271
+ markKnown: contacts.input(z46.strictObject({
2272
+ destination: z46.string().min(1).max(500),
2273
+ name: z46.string().min(1).max(200).optional()
2274
+ })).output(z46.object({ contact: knownContactSchema, isNew: z46.boolean() })),
2275
+ unmark: contacts.input(z46.strictObject({ contactID: z46.string().min(1) })).output(z46.object({ contactID: z46.string() }))
1956
2276
  },
1957
2277
  turnInputs: turnInputsContract,
1958
2278
  prompts: {
1959
2279
  proposals: {
1960
- list: prompts.output(z35.array(pendingPromptProposalSchema)),
2280
+ list: prompts.output(z46.array(pendingPromptProposalSchema)),
1961
2281
  approve: prompts.input(promptAnswerSchema.extend({
1962
2282
  entry: promptEntrySchema.optional(),
1963
- files: z35.array(promptPartFileSchema).optional()
1964
- })).output(z35.object({ proposalID: z35.string(), approvalID: z35.string(), proposalHash: z35.string() })),
1965
- reject: prompts.input(promptAnswerSchema.extend({ reason: z35.string().max(500).regex(/\S/u) })).output(z35.object({ proposalID: z35.string() }))
2283
+ files: z46.array(promptPartFileSchema).optional()
2284
+ })).output(z46.object({ proposalID: z46.string(), approvalID: z46.string(), proposalHash: z46.string() })),
2285
+ reject: prompts.input(promptAnswerSchema.extend({ reason: z46.string().max(500).regex(/\S/u) })).output(z46.object({ proposalID: z46.string() }))
1966
2286
  }
1967
2287
  }
1968
2288
  };
1969
- // src/contract/is-time-zone.ts
1970
- function isTimeZone(zone) {
1971
- try {
1972
- return new Intl.DateTimeFormat("en-US", { timeZone: zone }).resolvedOptions().timeZone !== "";
1973
- } catch {
1974
- return false;
2289
+ // src/contract/payload-clip-bytes.ts
2290
+ var payloadClipBytes = 4096;
2291
+
2292
+ // src/contract/clip-record-payloads.ts
2293
+ function clipRecordPayloads(record) {
2294
+ const clipped = [];
2295
+ let toolCall = record.toolCall;
2296
+ let worker = record.worker;
2297
+ if (toolCall !== undefined) {
2298
+ const input = clipObjectField(toolCall.input, "toolCall.input", clipped);
2299
+ const content = clipObjectField(toolCall.content, "toolCall.content", clipped);
2300
+ const { input: _input, content: _content, ...rest } = toolCall;
2301
+ toolCall = {
2302
+ ...rest,
2303
+ ...input === undefined ? {} : { input },
2304
+ ...content === undefined ? {} : { content }
2305
+ };
2306
+ }
2307
+ if (worker?.phase === "turn" && worker.text !== undefined) {
2308
+ const cut = cutString(worker.text);
2309
+ if (cut !== null) {
2310
+ clipped.push({ field: "worker.text", path: [], bytes: cut.bytes });
2311
+ worker = { ...worker, text: cut.text };
2312
+ }
2313
+ }
2314
+ if (worker?.phase === "ended" && worker.detail !== undefined) {
2315
+ const cut = cutString(worker.detail);
2316
+ if (cut !== null) {
2317
+ clipped.push({ field: "worker.detail", path: [], bytes: cut.bytes });
2318
+ worker = { ...worker, detail: cut.text };
2319
+ }
1975
2320
  }
2321
+ if (clipped.length === 0) {
2322
+ return record;
2323
+ }
2324
+ return {
2325
+ ...record,
2326
+ clipped,
2327
+ ...toolCall === undefined ? {} : { toolCall },
2328
+ ...worker === undefined ? {} : { worker }
2329
+ };
1976
2330
  }
1977
- // src/contract/schedule-schema.ts
1978
- import { z as z36 } from "zod";
1979
- var clockTimeSchema = z36.string().regex(/^(?:[01]\d|2[0-3]):[0-5]\d$/u, "a time is HH:MM, 24-hour");
1980
- var minutesSchema = z36.strictObject({
1981
- minutes: z36.int().min(5).max(1440)
1982
- });
1983
- var weekdaySchema = z36.enum(["mon", "tue", "wed", "thu", "fri", "sat", "sun"]);
1984
- var scheduleSchema = z36.strictObject({
1985
- every: z36.union([z36.enum(["day", "week", "hour"]), minutesSchema]),
1986
- at: clockTimeSchema.optional(),
1987
- on: weekdaySchema.optional(),
1988
- window: z36.strictObject({ from: clockTimeSchema, until: clockTimeSchema }).optional(),
1989
- idleMinutes: z36.int().min(1).max(720).optional(),
1990
- zone: z36.string().refine((zone) => zone === "owner" || isTimeZone(zone), "a zone is owner or an IANA zone").default("owner"),
1991
- catchUp: z36.enum(["once", "skip"]).default("once")
1992
- }).superRefine((schedule, context) => {
1993
- const isCalendar = schedule.every === "day" || schedule.every === "week";
1994
- if (isCalendar && schedule.at === undefined && schedule.window === undefined) {
1995
- context.addIssue({ code: "custom", message: "day and week need at or window" });
2331
+ var maxFieldBytes = 64 * 1024;
2332
+ function clipObjectField(value, field, clipped) {
2333
+ if (value === undefined) {
2334
+ return;
1996
2335
  }
1997
- if (isCalendar && schedule.at !== undefined && schedule.window !== undefined) {
1998
- context.addIssue({ code: "custom", message: "at and window never come together" });
2336
+ const found = [];
2337
+ const cut = clipValue(value, field, [], found);
2338
+ const size = byteLength(JSON.stringify(cut));
2339
+ if (size > maxFieldBytes) {
2340
+ clipped.push({ field, path: [], bytes: byteLength(JSON.stringify(value)) });
2341
+ return;
1999
2342
  }
2000
- if (!isCalendar && schedule.at !== undefined) {
2001
- context.addIssue({ code: "custom", message: "hour and minutes schedules take no at" });
2343
+ clipped.push(...found);
2344
+ return isObject(cut) ? cut : value;
2345
+ }
2346
+ function clipValue(value, field, path, found) {
2347
+ if (typeof value === "string") {
2348
+ const cut = cutString(value);
2349
+ if (cut === null) {
2350
+ return value;
2351
+ }
2352
+ found.push({ field, path, bytes: cut.bytes });
2353
+ return cut.text;
2002
2354
  }
2003
- if (!isCalendar && schedule.window !== undefined) {
2004
- context.addIssue({ code: "custom", message: "hour and minutes schedules take no window" });
2355
+ if (Array.isArray(value)) {
2356
+ return value.map((item, index) => clipValue(item, field, [...path, index], found));
2005
2357
  }
2006
- if (schedule.every === "week" && schedule.on === undefined) {
2007
- context.addIssue({ code: "custom", message: "a week schedule needs on" });
2358
+ if (isObject(value)) {
2359
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [
2360
+ key,
2361
+ clipValue(item, field, [...path, key], found)
2362
+ ]));
2008
2363
  }
2009
- if (schedule.every !== "week" && schedule.on !== undefined) {
2010
- context.addIssue({ code: "custom", message: "only a week schedule takes on" });
2364
+ return value;
2365
+ }
2366
+ var decoder = new TextDecoder;
2367
+ function cutString(text) {
2368
+ const bytes = new TextEncoder().encode(text);
2369
+ if (bytes.length <= payloadClipBytes) {
2370
+ return null;
2011
2371
  }
2012
- if (schedule.idleMinutes !== undefined && schedule.window === undefined) {
2013
- context.addIssue({ code: "custom", message: "idleMinutes needs window" });
2372
+ let end = payloadClipBytes;
2373
+ while (end > 0 && ((bytes[end] ?? 0) & 192) === 128) {
2374
+ end -= 1;
2014
2375
  }
2015
- });
2016
- // src/contract/trigger-schema.ts
2017
- import { z as z37 } from "zod";
2018
- var triggerAtSchema = z37.iso.datetime({ offset: true });
2019
- var triggerSchema = z37.union([
2020
- z37.strictObject({ schedule: scheduleSchema }),
2021
- z37.strictObject({ at: triggerAtSchema })
2022
- ]);
2376
+ return { text: decoder.decode(bytes.subarray(0, end)), bytes: bytes.length };
2377
+ }
2378
+ function isObject(value) {
2379
+ return typeof value === "object" && value !== null && !Array.isArray(value);
2380
+ }
2381
+ function byteLength(text) {
2382
+ return new TextEncoder().encode(text).length;
2383
+ }
2023
2384
  // src/contract/session-cookie-name.ts
2024
2385
  var sessionCookieName = "nixie_session";
2025
2386
 
@@ -2030,11 +2391,11 @@ function renderSessionCookie(token) {
2030
2391
  return `${sessionCookieName}=${token ?? ""}; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=${maxAgeS}`;
2031
2392
  }
2032
2393
  // src/message/task-message-input-schema.ts
2033
- import { z as z39 } from "zod";
2394
+ import { z as z48 } from "zod";
2034
2395
 
2035
2396
  // src/message/task-message-kind-schema.ts
2036
- import { z as z38 } from "zod";
2037
- var taskMessageKindSchema = z38.enum([
2397
+ import { z as z47 } from "zod";
2398
+ var taskMessageKindSchema = z47.enum([
2038
2399
  "progress",
2039
2400
  "question",
2040
2401
  "request",
@@ -2044,40 +2405,46 @@ var taskMessageKindSchema = z38.enum([
2044
2405
  ]);
2045
2406
 
2046
2407
  // src/message/task-message-input-schema.ts
2047
- var taskMessageInputSchema = z39.object({
2048
- to: z39.string(),
2408
+ var taskMessageInputSchema = z48.object({
2409
+ to: z48.string(),
2049
2410
  kind: taskMessageKindSchema,
2050
- body: z39.string(),
2051
- replyTo: z39.string().optional(),
2052
- onBehalfOf: z39.string().array().optional(),
2053
- wake: z39.boolean().optional()
2411
+ body: z48.string(),
2412
+ replyTo: z48.string().optional(),
2413
+ onBehalfOf: z48.string().array().optional(),
2414
+ wake: z48.boolean().optional()
2054
2415
  });
2055
2416
  // src/message/task-message-result-schema.ts
2056
- import { z as z40 } from "zod";
2057
- var taskMessageResultSchema = z40.object({
2058
- messageID: z40.string(),
2059
- woke: z40.boolean(),
2060
- hop: z40.int().nonnegative(),
2061
- note: z40.string().optional()
2417
+ import { z as z49 } from "zod";
2418
+ var taskMessageResultSchema = z49.object({
2419
+ messageID: z49.string(),
2420
+ woke: z49.boolean(),
2421
+ hop: z49.int().nonnegative(),
2422
+ note: z49.string().optional()
2062
2423
  });
2063
2424
  export {
2064
2425
  buildPendingInput,
2065
2426
  buildQueryUtils,
2066
2427
  buildSpanState,
2067
2428
  clientHeaderName,
2429
+ clipRecordPayloads,
2068
2430
  contract,
2069
2431
  forgettableKinds,
2070
2432
  hostContract,
2071
2433
  imageLimits,
2072
2434
  isTimeZone,
2435
+ listedStateSchema,
2436
+ payloadClipBytes,
2073
2437
  pickSpanSource,
2074
2438
  renderSessionCookie,
2439
+ runFireSchema,
2075
2440
  scheduleSchema,
2076
2441
  sessionCookieName,
2442
+ skipReasonSchema,
2077
2443
  spanSchema,
2078
2444
  taskMessageInputSchema,
2079
2445
  taskMessageKindSchema,
2080
2446
  taskMessageResultSchema,
2081
2447
  triggerAtSchema,
2082
- triggerSchema
2448
+ triggerSchema,
2449
+ workerViewSchema
2083
2450
  };