@isoplan/protocol 0.15.1 → 0.17.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.
@@ -146,8 +146,8 @@ export declare const HelloMessageSchema: z.ZodObject<{
146
146
  * runner can open them, and `orca` and `desktop` only where `orca` and `desktop` are said. The server
147
147
  * sends a start with a `mode` only to a runner that says `starts`, and only one of its places: a
148
148
  * runner from before 0.10.0 drops the field it doesn't know and would run the session from the floor.
149
- * `experts` (protocol 0.13.0): this runner hosts experts. It answers `hosting` with `experts`, and
150
- * takes `answer-expert` requests; the server sends neither to a runner that didn't say it.
149
+ * `experts` (protocol 0.13.0 to 0.16.0, the relay of experts' questions through the server) is gone:
150
+ * a 0.17.0 runner never says it, and an older runner's hello still parses, with it dropped.
151
151
  * `hiddenStarts` (protocol 0.14.0, isoplan-app#315): this runner can start a session from the floor
152
152
  * hidden (a start's `hidden`), in a clone Isoplan keeps for itself. The server sends `hidden` only to
153
153
  * a runner that says it: a runner from before 0.14.0 drops the field it doesn't know and would start
@@ -159,6 +159,10 @@ export declare const HelloMessageSchema: z.ZodObject<{
159
159
  * `expert-creation-suggestion-dismissals`, `draft-office-wide-expert-creation-suggestion`,
160
160
  * `create-expert-from-suggestion` and `expert-creation-suggestion-ended`; the server sends none of
161
161
  * these to a runner that didn't say it.
162
+ * `expertInstances` (protocol 0.17.0, isoplan-app#340): this runner keeps instances of experts set
163
+ * up from their expert records and answers its own sessions' questions from them; it sends and
164
+ * takes the messages of "Expert records and instances" (see `expert-directory`). The server sends
165
+ * none of them to a runner that didn't say it.
162
166
  */
163
167
  export declare const RunnerHelloMessageSchema: z.ZodObject<{
164
168
  type: z.ZodLiteral<"runner">;
@@ -185,9 +189,9 @@ export declare const RunnerHelloMessageSchema: z.ZodObject<{
185
189
  orca: "orca";
186
190
  terminal: "terminal";
187
191
  }>>>;
188
- experts: z.ZodOptional<z.ZodLiteral<true>>;
189
192
  hiddenStarts: z.ZodOptional<z.ZodLiteral<true>>;
190
193
  canCreateExpertsFromSuggestions: z.ZodOptional<z.ZodLiteral<true>>;
194
+ expertInstances: z.ZodOptional<z.ZodLiteral<true>>;
191
195
  }, z.core.$strip>;
192
196
  /** All of the session's facts. Sent on connect and on repair. */
193
197
  export declare const FullMessageSchema: z.ZodObject<{
@@ -639,7 +643,7 @@ export declare const OwnerMessageRefusalSchema: z.ZodEnum<{
639
643
  "no-submit": "no-submit";
640
644
  "not-owner": "not-owner";
641
645
  }>;
642
- /** The most experts a runner lists, or a session is told it may ask (protocol 0.13.0). */
646
+ /** The most experts a session is told it may ask (protocol 0.13.0). */
643
647
  export declare const MAX_EXPERTS = 20;
644
648
  /** The longest subject an expert lists: what to ask it about, and before which changes. */
645
649
  export declare const MAX_EXPERT_SUBJECT_LENGTH = 1000;
@@ -650,30 +654,23 @@ export declare const MAX_EXPERT_SUBJECT_LENGTH = 1000;
650
654
  export declare const MAX_EXPERT_ANSWER_LENGTH = 8000;
651
655
  /** An expert's name, as its file is named: `~/.claude/isoplan/experts/<name>.json`. */
652
656
  export declare const ExpertNameSchema: z.ZodString;
653
- /** Every situation ask_expert tells its agent about, by a stable code. */
657
+ /**
658
+ * Every situation ask_expert tells its agent about, by a stable code. `EXPERT_NOT_SET_UP` (protocol
659
+ * 0.17.0): this computer has no instance of the expert yet, so its set-up is offered. No 0.17.0 side
660
+ * sends `EXPERT_QUEUED` or `EXPERT_DROPPED`; an office from before 0.17.0 may still send them in a
661
+ * late end. `EXPERT_QUESTION_HELD` is gone (0.17.0): a runner made it, and no office ever sent it.
662
+ */
654
663
  export declare const ExpertCodeSchema: z.ZodEnum<{
655
664
  EXPERT_CAP: "EXPERT_CAP";
656
665
  EXPERT_DROPPED: "EXPERT_DROPPED";
657
666
  EXPERT_FORK_FAILED: "EXPERT_FORK_FAILED";
667
+ EXPERT_NOT_SET_UP: "EXPERT_NOT_SET_UP";
658
668
  EXPERT_PLUGIN_OLD: "EXPERT_PLUGIN_OLD";
659
- EXPERT_QUESTION_HELD: "EXPERT_QUESTION_HELD";
660
669
  EXPERT_QUEUED: "EXPERT_QUEUED";
661
670
  EXPERT_RUNNER_UNREACHABLE: "EXPERT_RUNNER_UNREACHABLE";
662
671
  EXPERT_STARTING: "EXPERT_STARTING";
663
672
  EXPERT_UNKNOWN: "EXPERT_UNKNOWN";
664
673
  }>;
665
- /** `starting`: no generation of it has passed its proof question yet; `ready`: its junior answers; `failed`: its last grounding failed and none answers. */
666
- export declare const ExpertStateSchema: z.ZodEnum<{
667
- failed: "failed";
668
- ready: "ready";
669
- starting: "starting";
670
- }>;
671
- /** The host's caps, from the expert file: questions per asking session per day, open questions per asking session, the expert's daily token budget. */
672
- export declare const ExpertCapSchema: z.ZodEnum<{
673
- "asker-day": "asker-day";
674
- "asker-open": "asker-open";
675
- "expert-tokens": "expert-tokens";
676
- }>;
677
674
  /** The most folders or globs an expert's area names (protocol 0.15.0). */
678
675
  export declare const MAX_AREA_PATHS = 20;
679
676
  /**
@@ -682,53 +679,16 @@ export declare const MAX_AREA_PATHS = 20;
682
679
  */
683
680
  export declare const expertDisplayName: (key: string) => string;
684
681
  /**
685
- * One expert a runner hosts, as it lists it to an office server whose list takes its repo. `senior`
686
- * (protocol 0.14.0): it has a senior generation, which its junior can ask (see `expert-senior`);
687
- * absent from an older runner. `areas` (protocol 0.15.0): the folders and globs of its repo it
688
- * covers, from its file, so the office never suggests creating an expert on a folder one already covers;
689
- * absent from an older runner, or when its file names none. An older server ignores both.
682
+ * One expert a session may ask: `repo` is its project's short name, `host` a person's name: the
683
+ * hosting person's until 0.17.0, and from 0.17.0 the expert's owner's, kept so an older plugin still
684
+ * parses it.
690
685
  */
691
- export declare const ExpertListingSchema: z.ZodObject<{
692
- name: z.ZodString;
693
- project: z.ZodObject<{
694
- id: z.ZodString;
695
- name: z.ZodString;
696
- }, z.core.$strip>;
697
- subject: z.ZodString;
698
- state: z.ZodEnum<{
699
- failed: "failed";
700
- ready: "ready";
701
- starting: "starting";
702
- }>;
703
- senior: z.ZodOptional<z.ZodBoolean>;
704
- areas: z.ZodOptional<z.ZodArray<z.ZodString>>;
705
- }, z.core.$strip>;
706
- /** One expert a session may ask: `repo` is its project's short name, `host` the hosting person's name. */
707
686
  export declare const ExpertRightSchema: z.ZodObject<{
708
687
  name: z.ZodString;
709
688
  subject: z.ZodString;
710
689
  repo: z.ZodString;
711
690
  host: z.ZodString;
712
691
  }, z.core.$strip>;
713
- /**
714
- * Why the host's runner won't answer an expert question, beside an `unavailable` refusal's `detail`:
715
- * one of the expert file's caps is reached (`frees`, when it frees), the fork couldn't answer, or this
716
- * machine hosts no expert by that name now.
717
- */
718
- export declare const ExpertRefusalSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
719
- code: z.ZodLiteral<"EXPERT_CAP">;
720
- cap: z.ZodEnum<{
721
- "asker-day": "asker-day";
722
- "asker-open": "asker-open";
723
- "expert-tokens": "expert-tokens";
724
- }>;
725
- limit: z.ZodNumber;
726
- frees: z.ZodOptional<z.ZodISODateTime>;
727
- }, z.core.$strip>, z.ZodObject<{
728
- code: z.ZodLiteral<"EXPERT_FORK_FAILED">;
729
- }, z.core.$strip>, z.ZodObject<{
730
- code: z.ZodLiteral<"EXPERT_UNKNOWN">;
731
- }, z.core.$strip>], "code">;
732
692
  /** A cap on the answers a machine gives: a room's per hour, the owner's per day, or the owner's tokens per day. */
733
693
  export declare const CapSchema: z.ZodEnum<{
734
694
  "owner-day": "owner-day";
@@ -783,14 +743,6 @@ export declare const ReplyMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
783
743
  v: z.ZodLiteral<1>;
784
744
  id: z.ZodString;
785
745
  kind: z.ZodLiteral<"focus">;
786
- }, z.core.$strip>, z.ZodObject<{
787
- type: z.ZodLiteral<"reply">;
788
- v: z.ZodLiteral<1>;
789
- id: z.ZodString;
790
- kind: z.ZodLiteral<"answer-expert">;
791
- answer: z.ZodString;
792
- commit: z.ZodString;
793
- branch: z.ZodString;
794
746
  }, z.core.$strip>], "kind">;
795
747
  /**
796
748
  * A request the machine won't answer, sent in place of its reply. `over-cap` names the cap it would
@@ -830,20 +782,6 @@ export declare const RefusalMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
830
782
  "no-submit": "no-submit";
831
783
  "not-owner": "not-owner";
832
784
  }>>;
833
- expert: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
834
- code: z.ZodLiteral<"EXPERT_CAP">;
835
- cap: z.ZodEnum<{
836
- "asker-day": "asker-day";
837
- "asker-open": "asker-open";
838
- "expert-tokens": "expert-tokens";
839
- }>;
840
- limit: z.ZodNumber;
841
- frees: z.ZodOptional<z.ZodISODateTime>;
842
- }, z.core.$strip>, z.ZodObject<{
843
- code: z.ZodLiteral<"EXPERT_FORK_FAILED">;
844
- }, z.core.$strip>, z.ZodObject<{
845
- code: z.ZodLiteral<"EXPERT_UNKNOWN">;
846
- }, z.core.$strip>], "code">>;
847
785
  }, z.core.$strip>], "reason">;
848
786
  /**
849
787
  * The sender's session handed its room over with the command: its agent wrote the brief and pushed.
@@ -936,46 +874,6 @@ export declare const AskedAckMessageSchema: z.ZodObject<{
936
874
  v: z.ZodLiteral<1>;
937
875
  question: z.ZodString;
938
876
  }, z.core.$strip>;
939
- /**
940
- * The experts this runner hosts (protocol 0.13.0), as it lists them to this office server, each one
941
- * whose repo the server's approved list takes. Sent only by a runner that said `experts`, only while
942
- * its link is up (never through the reply outbox), and never on a connection before that
943
- * connection's first `hosting`. The runner works the listing out again on every `hosting`, on every
944
- * change to its experts and every few minutes, and sends it when it differs from the last one it
945
- * sent on the connection; the first on a connection is always sent, even an empty one. It sends none
946
- * while it has no approved list. Each one replaces the last. Names are unique.
947
- */
948
- export declare const ExpertsMessageSchema: z.ZodObject<{
949
- type: z.ZodLiteral<"experts">;
950
- v: z.ZodLiteral<1>;
951
- experts: z.ZodArray<z.ZodObject<{
952
- name: z.ZodString;
953
- project: z.ZodObject<{
954
- id: z.ZodString;
955
- name: z.ZodString;
956
- }, z.core.$strip>;
957
- subject: z.ZodString;
958
- state: z.ZodEnum<{
959
- failed: "failed";
960
- ready: "ready";
961
- starting: "starting";
962
- }>;
963
- senior: z.ZodOptional<z.ZodBoolean>;
964
- areas: z.ZodOptional<z.ZodArray<z.ZodString>>;
965
- }, z.core.$strip>>;
966
- }, z.core.$strip>;
967
- /**
968
- * The junior answering the `answer-expert` request `id` has asked its senior (protocol 0.14.0), so
969
- * the floor can show the senior joining the question's meeting. It carries no text: nothing of the
970
- * question or of what the junior asked. Sent once per request, when the junior first asks, only to a
971
- * server whose `hosting` says `expertSenior`, and only while the link is up (never through the reply
972
- * outbox): a server from before 0.14.0, which doesn't say it, is never sent one.
973
- */
974
- export declare const ExpertSeniorMessageSchema: z.ZodObject<{
975
- type: z.ZodLiteral<"expert-senior">;
976
- v: z.ZodLiteral<1>;
977
- id: z.ZodString;
978
- }, z.core.$strip>;
979
877
  /**
980
878
  * A session asks an expert a question (protocol 0.13.0), on its own short link with the session's
981
879
  * hello, as ask-room is. `key` is the tool call's id: asked again under it, it is the same question.
@@ -984,6 +882,8 @@ export declare const ExpertSeniorMessageSchema: z.ZodObject<{
984
882
  * pairing codes, as for ask-room). It is a message of its own, not an ask-room with an expert, so a
985
883
  * server from before experts refuses it rather than asking a room. The session then polls it with
986
884
  * ask-check and acks its end with asked-ack, as for a room question.
885
+ * From 0.17.0 a server answers it only with an error `EXPERT_PLUGIN_OLD`, and a 0.17.0 plugin never
886
+ * sends it: it asks its own computer's instance of the expert (see `expert-question`).
987
887
  */
988
888
  export declare const AskExpertMessageSchema: z.ZodObject<{
989
889
  type: z.ZodLiteral<"ask-expert">;
@@ -1007,10 +907,20 @@ export declare const MAX_EXPERT_CREATION_SUGGESTION_DISMISSALS = 1000;
1007
907
  * and `proof`, as the runner's local model wrote them and the secret check passed them. `why`, the
1008
908
  * signals that passed their thresholds, each other one 0: `share`, the share of the session's context
1009
909
  * spent reading and searching the folder (0 to 1), and `tokens`, those tokens, which are one signal;
1010
- * `minutes`, the time spent there; `corrections`, the person's corrections there. `at`: when it was
1011
- * suggested. Of its text, only these leave the machine, under ADR 0004's case for an expert creation
1012
- * suggestion's draft.
910
+ * `minutes`, the time spent there; `corrections`, the person's corrections there. `repetition`
911
+ * (from 0.16.0, a session's suggestion only), what was done in its area again, which suggested it:
912
+ * its `folder`, the file read most, was read in `readings` turns over `sessions` sessions, the
913
+ * area's `files` read again with it; or its folder was searched `searches` times. An older runner
914
+ * sends none, and an older side ignores it. `at`: when it was suggested. Of its text, only these
915
+ * leave the machine, under ADR 0004's case for an expert creation suggestion's draft.
1013
916
  */
917
+ export declare const ExpertCreationSuggestionRepetitionSchema: z.ZodUnion<readonly [z.ZodObject<{
918
+ readings: z.ZodNumber;
919
+ sessions: z.ZodNumber;
920
+ files: z.ZodNumber;
921
+ }, z.core.$strip>, z.ZodObject<{
922
+ searches: z.ZodNumber;
923
+ }, z.core.$strip>]>;
1014
924
  export declare const ExpertCreationSuggestionMessageSchema: z.ZodObject<{
1015
925
  type: z.ZodLiteral<"expert-creation-suggestion">;
1016
926
  v: z.ZodLiteral<1>;
@@ -1038,6 +948,13 @@ export declare const ExpertCreationSuggestionMessageSchema: z.ZodObject<{
1038
948
  minutes: z.ZodNumber;
1039
949
  corrections: z.ZodNumber;
1040
950
  }, z.core.$strip>;
951
+ repetition: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
952
+ readings: z.ZodNumber;
953
+ sessions: z.ZodNumber;
954
+ files: z.ZodNumber;
955
+ }, z.core.$strip>, z.ZodObject<{
956
+ searches: z.ZodNumber;
957
+ }, z.core.$strip>]>>;
1041
958
  at: z.ZodISODateTime;
1042
959
  }, z.core.$strip>;
1043
960
  /**
@@ -1085,6 +1002,236 @@ export declare const ExpertCreationProgressMessageSchema: z.ZodObject<{
1085
1002
  }>;
1086
1003
  detail: z.ZodOptional<z.ZodString>;
1087
1004
  }, z.core.$strip>;
1005
+ /** The most expert records an `expert-directory` or an `expert-instance-states` names. */
1006
+ export declare const MAX_EXPERT_RECORDS = 1000;
1007
+ /** The most times an `expert-questions-asked-on-your-other-computers` lists for the last day. */
1008
+ export declare const MAX_EXPERT_QUESTION_TIMES_IN_THE_LAST_DAY = 1000;
1009
+ /**
1010
+ * Which expert record: made by the server when the record is made, so a record made again under the
1011
+ * key of a deleted one is told apart from the old one.
1012
+ */
1013
+ export declare const ExpertRecordIdSchema: z.ZodUUID;
1014
+ /**
1015
+ * What every computer's instance of an expert shares, as its owner's expert file says it: its key;
1016
+ * its project, one with a remote, never a folder on one computer (`local:`); its subject; the model
1017
+ * it grounds with; the context, in tokens, at which its junior is promoted (`promoteAtTokens`); the
1018
+ * folders and globs of its repo it covers (`areas`); and its proof question with the answer expected.
1019
+ * The rest of an expert file is that computer's own, and never leaves it.
1020
+ */
1021
+ export declare const ExpertDefinitionSchema: z.ZodObject<{
1022
+ key: z.ZodString;
1023
+ project: z.ZodObject<{
1024
+ id: z.ZodString;
1025
+ name: z.ZodString;
1026
+ }, z.core.$strip>;
1027
+ subject: z.ZodString;
1028
+ model: z.ZodString;
1029
+ promoteAtTokens: z.ZodNumber;
1030
+ areas: z.ZodArray<z.ZodString>;
1031
+ proof: z.ZodObject<{
1032
+ question: z.ZodString;
1033
+ answer: z.ZodString;
1034
+ }, z.core.$strip>;
1035
+ }, z.core.$strip>;
1036
+ /**
1037
+ * Where this computer's instance of the expert `key` stands, set up from (or, on its owner's
1038
+ * computer, published as) the record `expertRecordId`: `setting-up`, with its `step` (`cloning`,
1039
+ * finding this computer's checkout of the project or cloning it; `grounding`; `proof`); `ready`, its
1040
+ * junior answers; or `failed`, with its `failure`: `clone`, the project couldn't be cloned, with
1041
+ * git's words in `detail`, secret-checked on this computer; `proof`, its proof question failed;
1042
+ * `key-used-here`, this computer has its own expert with that key, whose publish was refused
1043
+ * `key-taken`, so the record can't be set up here until that one is renamed; `other`, with why in
1044
+ * `detail`. `senior`: it has a senior generation, which its junior can ask. `groundingTokens`: its
1045
+ * junior's context after grounding. No definition field: the record has it.
1046
+ */
1047
+ export declare const ExpertInstanceStateSchema: z.ZodObject<{
1048
+ key: z.ZodString;
1049
+ expertRecordId: z.ZodUUID;
1050
+ state: z.ZodEnum<{
1051
+ failed: "failed";
1052
+ ready: "ready";
1053
+ "setting-up": "setting-up";
1054
+ }>;
1055
+ step: z.ZodOptional<z.ZodEnum<{
1056
+ cloning: "cloning";
1057
+ grounding: "grounding";
1058
+ proof: "proof";
1059
+ }>>;
1060
+ senior: z.ZodOptional<z.ZodLiteral<true>>;
1061
+ groundingTokens: z.ZodOptional<z.ZodNumber>;
1062
+ failure: z.ZodOptional<z.ZodObject<{
1063
+ why: z.ZodEnum<{
1064
+ clone: "clone";
1065
+ "key-used-here": "key-used-here";
1066
+ other: "other";
1067
+ proof: "proof";
1068
+ }>;
1069
+ detail: z.ZodOptional<z.ZodString>;
1070
+ }, z.core.$strip>>;
1071
+ }, z.core.$strip>;
1072
+ /**
1073
+ * One expert record in an `expert-directory`: one whose project an office holds. `owner` is the
1074
+ * expert's owner, `yours` marks a record this runner's person owns, `revision` is its definition's
1075
+ * revision now, and `groundingTokens` a junior's context after grounding, as an instance last said.
1076
+ */
1077
+ export declare const ExpertDirectoryEntrySchema: z.ZodObject<{
1078
+ key: z.ZodString;
1079
+ expertRecordId: z.ZodUUID;
1080
+ project: z.ZodObject<{
1081
+ id: z.ZodString;
1082
+ name: z.ZodString;
1083
+ }, z.core.$strip>;
1084
+ owner: z.ZodObject<{
1085
+ id: z.ZodString;
1086
+ name: z.ZodString;
1087
+ }, z.core.$strip>;
1088
+ yours: z.ZodOptional<z.ZodLiteral<true>>;
1089
+ revision: z.ZodNumber;
1090
+ groundingTokens: z.ZodOptional<z.ZodNumber>;
1091
+ }, z.core.$strip>;
1092
+ /**
1093
+ * The owner's runner publishes the expert's definition from the expert file (protocol 0.17.0), after
1094
+ * checking it for secrets on this computer (a match sends nothing). `basedOn`: the record and
1095
+ * revision this computer last had of it from this server; absent for a file never published there.
1096
+ * Sent on each new connection while the file differs from that revision, and on each change. The
1097
+ * server answers `expert-definition-result`; the same definition and `basedOn` again get the same
1098
+ * result.
1099
+ */
1100
+ export declare const ExpertDefinitionMessageSchema: z.ZodObject<{
1101
+ type: z.ZodLiteral<"expert-definition">;
1102
+ v: z.ZodLiteral<1>;
1103
+ definition: z.ZodObject<{
1104
+ key: z.ZodString;
1105
+ project: z.ZodObject<{
1106
+ id: z.ZodString;
1107
+ name: z.ZodString;
1108
+ }, z.core.$strip>;
1109
+ subject: z.ZodString;
1110
+ model: z.ZodString;
1111
+ promoteAtTokens: z.ZodNumber;
1112
+ areas: z.ZodArray<z.ZodString>;
1113
+ proof: z.ZodObject<{
1114
+ question: z.ZodString;
1115
+ answer: z.ZodString;
1116
+ }, z.core.$strip>;
1117
+ }, z.core.$strip>;
1118
+ basedOn: z.ZodOptional<z.ZodObject<{
1119
+ expertRecordId: z.ZodUUID;
1120
+ revision: z.ZodNumber;
1121
+ }, z.core.$strip>>;
1122
+ }, z.core.$strip>;
1123
+ /**
1124
+ * Send this computer the record `expertRecordId` of the expert `key` (protocol 0.17.0), answered
1125
+ * with `expert-record`. Sent only once this computer has a checkout or clone of the record's
1126
+ * project, and again after each new connection's first `expert-directory` while it is still wanted.
1127
+ */
1128
+ export declare const ExpertRecordWantedMessageSchema: z.ZodObject<{
1129
+ type: z.ZodLiteral<"expert-record-wanted">;
1130
+ v: z.ZodLiteral<1>;
1131
+ key: z.ZodString;
1132
+ expertRecordId: z.ZodUUID;
1133
+ }, z.core.$strip>;
1134
+ /**
1135
+ * Every instance on this computer of this server's expert records whose project this server takes
1136
+ * (protocol 0.17.0), the whole list each time: the first on each connection always, even an empty
1137
+ * one, then only when it differs. An instance set up from one office server is never named to
1138
+ * another. Each key once.
1139
+ */
1140
+ export declare const ExpertInstanceStatesMessageSchema: z.ZodObject<{
1141
+ type: z.ZodLiteral<"expert-instance-states">;
1142
+ v: z.ZodLiteral<1>;
1143
+ instances: z.ZodArray<z.ZodObject<{
1144
+ key: z.ZodString;
1145
+ expertRecordId: z.ZodUUID;
1146
+ state: z.ZodEnum<{
1147
+ failed: "failed";
1148
+ ready: "ready";
1149
+ "setting-up": "setting-up";
1150
+ }>;
1151
+ step: z.ZodOptional<z.ZodEnum<{
1152
+ cloning: "cloning";
1153
+ grounding: "grounding";
1154
+ proof: "proof";
1155
+ }>>;
1156
+ senior: z.ZodOptional<z.ZodLiteral<true>>;
1157
+ groundingTokens: z.ZodOptional<z.ZodNumber>;
1158
+ failure: z.ZodOptional<z.ZodObject<{
1159
+ why: z.ZodEnum<{
1160
+ clone: "clone";
1161
+ "key-used-here": "key-used-here";
1162
+ other: "other";
1163
+ proof: "proof";
1164
+ }>;
1165
+ detail: z.ZodOptional<z.ZodString>;
1166
+ }, z.core.$strip>>;
1167
+ }, z.core.$strip>>;
1168
+ }, z.core.$strip>;
1169
+ /**
1170
+ * A question this computer's session asked the expert `key` (protocol 0.17.0), as a record with no
1171
+ * words: never the question's or the answer's text. `id` is the tool call's id, `session` the asking
1172
+ * session as its hello names it (`claude-code:<id>`), `blocking` whether its agent waited, `state`
1173
+ * where it stands (`asking`, `answered` or `dropped`, with its `code`), `senior` that its junior asked
1174
+ * its senior, and `askedAt` and `endedAt` when it was asked and ended. Sent at each change of state,
1175
+ * and again after each new connection's first `expert-directory` until its end has gone. The same
1176
+ * `id` and `state` again is the same record.
1177
+ */
1178
+ export declare const ExpertQuestionMessageSchema: z.ZodObject<{
1179
+ type: z.ZodLiteral<"expert-question">;
1180
+ v: z.ZodLiteral<1>;
1181
+ id: z.ZodString;
1182
+ key: z.ZodString;
1183
+ expertRecordId: z.ZodUUID;
1184
+ session: z.ZodString;
1185
+ blocking: z.ZodBoolean;
1186
+ state: z.ZodEnum<{
1187
+ answered: "answered";
1188
+ asking: "asking";
1189
+ dropped: "dropped";
1190
+ }>;
1191
+ code: z.ZodOptional<z.ZodEnum<{
1192
+ EXPERT_CAP: "EXPERT_CAP";
1193
+ EXPERT_DROPPED: "EXPERT_DROPPED";
1194
+ EXPERT_FORK_FAILED: "EXPERT_FORK_FAILED";
1195
+ EXPERT_NOT_SET_UP: "EXPERT_NOT_SET_UP";
1196
+ EXPERT_PLUGIN_OLD: "EXPERT_PLUGIN_OLD";
1197
+ EXPERT_QUEUED: "EXPERT_QUEUED";
1198
+ EXPERT_RUNNER_UNREACHABLE: "EXPERT_RUNNER_UNREACHABLE";
1199
+ EXPERT_STARTING: "EXPERT_STARTING";
1200
+ EXPERT_UNKNOWN: "EXPERT_UNKNOWN";
1201
+ }>>;
1202
+ senior: z.ZodOptional<z.ZodLiteral<true>>;
1203
+ askedAt: z.ZodISODateTime;
1204
+ endedAt: z.ZodOptional<z.ZodISODateTime>;
1205
+ }, z.core.$strip>;
1206
+ /**
1207
+ * An agent on this computer asked the expert `key`, of which this computer has no instance, so its
1208
+ * person is offered to set it up (protocol 0.17.0, ADR 0013). Sent once per computer per record,
1209
+ * ever, and again after each new connection's first `expert-directory` until it has gone. A repeat
1210
+ * for the same record, person and computer changes nothing. No text of the question.
1211
+ */
1212
+ export declare const ExpertSetUpOfferedMessageSchema: z.ZodObject<{
1213
+ type: z.ZodLiteral<"expert-set-up-offered">;
1214
+ v: z.ZodLiteral<1>;
1215
+ key: z.ZodString;
1216
+ expertRecordId: z.ZodUUID;
1217
+ }, z.core.$strip>;
1218
+ /**
1219
+ * This computer's instance of the expert `key`, whose record isn't its person's own, failed its proof
1220
+ * question at `revision` until its tries ran out (protocol 0.17.0), for the expert's owner to see:
1221
+ * `answer`, what its fork answered, secret-checked on this computer, or `answerHeld`, that it matched
1222
+ * a secret pattern and so isn't sent. Exactly one of the two. Sent once per revision, and again after
1223
+ * each new connection's first `expert-directory` until it has gone. A repeat for the same record,
1224
+ * computer and revision changes nothing.
1225
+ */
1226
+ export declare const ExpertProofFailedMessageSchema: z.ZodObject<{
1227
+ type: z.ZodLiteral<"expert-proof-failed">;
1228
+ v: z.ZodLiteral<1>;
1229
+ key: z.ZodString;
1230
+ expertRecordId: z.ZodUUID;
1231
+ revision: z.ZodNumber;
1232
+ answer: z.ZodOptional<z.ZodString>;
1233
+ answerHeld: z.ZodOptional<z.ZodLiteral<true>>;
1234
+ }, z.core.$strip>;
1088
1235
  /**
1089
1236
  * What a runner says of the driven sessions it holds (protocol 0.5.0), sent only by a runner that said
1090
1237
  * `drive`. `started`, `output` (for an output request or a release) and `handed-back` answer a `drive`
@@ -1369,9 +1516,9 @@ export declare const DataLayerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
1369
1516
  orca: "orca";
1370
1517
  terminal: "terminal";
1371
1518
  }>>>;
1372
- experts: z.ZodOptional<z.ZodLiteral<true>>;
1373
1519
  hiddenStarts: z.ZodOptional<z.ZodLiteral<true>>;
1374
1520
  canCreateExpertsFromSuggestions: z.ZodOptional<z.ZodLiteral<true>>;
1521
+ expertInstances: z.ZodOptional<z.ZodLiteral<true>>;
1375
1522
  }, z.core.$strip>, z.ZodObject<{
1376
1523
  type: z.ZodLiteral<"full">;
1377
1524
  v: z.ZodLiteral<1>;
@@ -1847,14 +1994,6 @@ export declare const DataLayerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
1847
1994
  v: z.ZodLiteral<1>;
1848
1995
  id: z.ZodString;
1849
1996
  kind: z.ZodLiteral<"focus">;
1850
- }, z.core.$strip>, z.ZodObject<{
1851
- type: z.ZodLiteral<"reply">;
1852
- v: z.ZodLiteral<1>;
1853
- id: z.ZodString;
1854
- kind: z.ZodLiteral<"answer-expert">;
1855
- answer: z.ZodString;
1856
- commit: z.ZodString;
1857
- branch: z.ZodString;
1858
1997
  }, z.core.$strip>], "kind">, z.ZodDiscriminatedUnion<[z.ZodObject<{
1859
1998
  type: z.ZodLiteral<"refusal">;
1860
1999
  v: z.ZodLiteral<1>;
@@ -1887,20 +2026,6 @@ export declare const DataLayerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
1887
2026
  "no-submit": "no-submit";
1888
2027
  "not-owner": "not-owner";
1889
2028
  }>>;
1890
- expert: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1891
- code: z.ZodLiteral<"EXPERT_CAP">;
1892
- cap: z.ZodEnum<{
1893
- "asker-day": "asker-day";
1894
- "asker-open": "asker-open";
1895
- "expert-tokens": "expert-tokens";
1896
- }>;
1897
- limit: z.ZodNumber;
1898
- frees: z.ZodOptional<z.ZodISODateTime>;
1899
- }, z.core.$strip>, z.ZodObject<{
1900
- code: z.ZodLiteral<"EXPERT_FORK_FAILED">;
1901
- }, z.core.$strip>, z.ZodObject<{
1902
- code: z.ZodLiteral<"EXPERT_UNKNOWN">;
1903
- }, z.core.$strip>], "code">>;
1904
2029
  }, z.core.$strip>], "reason">, z.ZodObject<{
1905
2030
  type: z.ZodLiteral<"hand-over">;
1906
2031
  v: z.ZodLiteral<1>;
@@ -2167,34 +2292,12 @@ export declare const DataLayerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
2167
2292
  branches: z.ZodOptional<z.ZodArray<z.ZodString>>;
2168
2293
  }, z.core.$strip>>;
2169
2294
  }, z.core.$strip>], "kind">, z.ZodObject<{
2170
- type: z.ZodLiteral<"experts">;
2171
- v: z.ZodLiteral<1>;
2172
- experts: z.ZodArray<z.ZodObject<{
2173
- name: z.ZodString;
2174
- project: z.ZodObject<{
2175
- id: z.ZodString;
2176
- name: z.ZodString;
2177
- }, z.core.$strip>;
2178
- subject: z.ZodString;
2179
- state: z.ZodEnum<{
2180
- failed: "failed";
2181
- ready: "ready";
2182
- starting: "starting";
2183
- }>;
2184
- senior: z.ZodOptional<z.ZodBoolean>;
2185
- areas: z.ZodOptional<z.ZodArray<z.ZodString>>;
2186
- }, z.core.$strip>>;
2187
- }, z.core.$strip>, z.ZodObject<{
2188
2295
  type: z.ZodLiteral<"ask-expert">;
2189
2296
  v: z.ZodLiteral<1>;
2190
2297
  expert: z.ZodString;
2191
2298
  question: z.ZodString;
2192
2299
  blocking: z.ZodBoolean;
2193
2300
  key: z.ZodString;
2194
- }, z.core.$strip>, z.ZodObject<{
2195
- type: z.ZodLiteral<"expert-senior">;
2196
- v: z.ZodLiteral<1>;
2197
- id: z.ZodString;
2198
2301
  }, z.core.$strip>, z.ZodObject<{
2199
2302
  type: z.ZodLiteral<"expert-creation-suggestion">;
2200
2303
  v: z.ZodLiteral<1>;
@@ -2222,6 +2325,13 @@ export declare const DataLayerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
2222
2325
  minutes: z.ZodNumber;
2223
2326
  corrections: z.ZodNumber;
2224
2327
  }, z.core.$strip>;
2328
+ repetition: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
2329
+ readings: z.ZodNumber;
2330
+ sessions: z.ZodNumber;
2331
+ files: z.ZodNumber;
2332
+ }, z.core.$strip>, z.ZodObject<{
2333
+ searches: z.ZodNumber;
2334
+ }, z.core.$strip>]>>;
2225
2335
  at: z.ZodISODateTime;
2226
2336
  }, z.core.$strip>, z.ZodObject<{
2227
2337
  type: z.ZodLiteral<"expert-creation-suggestion-ended">;
@@ -2244,6 +2354,101 @@ export declare const DataLayerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
2244
2354
  ready: "ready";
2245
2355
  }>;
2246
2356
  detail: z.ZodOptional<z.ZodString>;
2357
+ }, z.core.$strip>, z.ZodObject<{
2358
+ type: z.ZodLiteral<"expert-definition">;
2359
+ v: z.ZodLiteral<1>;
2360
+ definition: z.ZodObject<{
2361
+ key: z.ZodString;
2362
+ project: z.ZodObject<{
2363
+ id: z.ZodString;
2364
+ name: z.ZodString;
2365
+ }, z.core.$strip>;
2366
+ subject: z.ZodString;
2367
+ model: z.ZodString;
2368
+ promoteAtTokens: z.ZodNumber;
2369
+ areas: z.ZodArray<z.ZodString>;
2370
+ proof: z.ZodObject<{
2371
+ question: z.ZodString;
2372
+ answer: z.ZodString;
2373
+ }, z.core.$strip>;
2374
+ }, z.core.$strip>;
2375
+ basedOn: z.ZodOptional<z.ZodObject<{
2376
+ expertRecordId: z.ZodUUID;
2377
+ revision: z.ZodNumber;
2378
+ }, z.core.$strip>>;
2379
+ }, z.core.$strip>, z.ZodObject<{
2380
+ type: z.ZodLiteral<"expert-record-wanted">;
2381
+ v: z.ZodLiteral<1>;
2382
+ key: z.ZodString;
2383
+ expertRecordId: z.ZodUUID;
2384
+ }, z.core.$strip>, z.ZodObject<{
2385
+ type: z.ZodLiteral<"expert-instance-states">;
2386
+ v: z.ZodLiteral<1>;
2387
+ instances: z.ZodArray<z.ZodObject<{
2388
+ key: z.ZodString;
2389
+ expertRecordId: z.ZodUUID;
2390
+ state: z.ZodEnum<{
2391
+ failed: "failed";
2392
+ ready: "ready";
2393
+ "setting-up": "setting-up";
2394
+ }>;
2395
+ step: z.ZodOptional<z.ZodEnum<{
2396
+ cloning: "cloning";
2397
+ grounding: "grounding";
2398
+ proof: "proof";
2399
+ }>>;
2400
+ senior: z.ZodOptional<z.ZodLiteral<true>>;
2401
+ groundingTokens: z.ZodOptional<z.ZodNumber>;
2402
+ failure: z.ZodOptional<z.ZodObject<{
2403
+ why: z.ZodEnum<{
2404
+ clone: "clone";
2405
+ "key-used-here": "key-used-here";
2406
+ other: "other";
2407
+ proof: "proof";
2408
+ }>;
2409
+ detail: z.ZodOptional<z.ZodString>;
2410
+ }, z.core.$strip>>;
2411
+ }, z.core.$strip>>;
2412
+ }, z.core.$strip>, z.ZodObject<{
2413
+ type: z.ZodLiteral<"expert-question">;
2414
+ v: z.ZodLiteral<1>;
2415
+ id: z.ZodString;
2416
+ key: z.ZodString;
2417
+ expertRecordId: z.ZodUUID;
2418
+ session: z.ZodString;
2419
+ blocking: z.ZodBoolean;
2420
+ state: z.ZodEnum<{
2421
+ answered: "answered";
2422
+ asking: "asking";
2423
+ dropped: "dropped";
2424
+ }>;
2425
+ code: z.ZodOptional<z.ZodEnum<{
2426
+ EXPERT_CAP: "EXPERT_CAP";
2427
+ EXPERT_DROPPED: "EXPERT_DROPPED";
2428
+ EXPERT_FORK_FAILED: "EXPERT_FORK_FAILED";
2429
+ EXPERT_NOT_SET_UP: "EXPERT_NOT_SET_UP";
2430
+ EXPERT_PLUGIN_OLD: "EXPERT_PLUGIN_OLD";
2431
+ EXPERT_QUEUED: "EXPERT_QUEUED";
2432
+ EXPERT_RUNNER_UNREACHABLE: "EXPERT_RUNNER_UNREACHABLE";
2433
+ EXPERT_STARTING: "EXPERT_STARTING";
2434
+ EXPERT_UNKNOWN: "EXPERT_UNKNOWN";
2435
+ }>>;
2436
+ senior: z.ZodOptional<z.ZodLiteral<true>>;
2437
+ askedAt: z.ZodISODateTime;
2438
+ endedAt: z.ZodOptional<z.ZodISODateTime>;
2439
+ }, z.core.$strip>, z.ZodObject<{
2440
+ type: z.ZodLiteral<"expert-set-up-offered">;
2441
+ v: z.ZodLiteral<1>;
2442
+ key: z.ZodString;
2443
+ expertRecordId: z.ZodUUID;
2444
+ }, z.core.$strip>, z.ZodObject<{
2445
+ type: z.ZodLiteral<"expert-proof-failed">;
2446
+ v: z.ZodLiteral<1>;
2447
+ key: z.ZodString;
2448
+ expertRecordId: z.ZodUUID;
2449
+ revision: z.ZodNumber;
2450
+ answer: z.ZodOptional<z.ZodString>;
2451
+ answerHeld: z.ZodOptional<z.ZodLiteral<true>>;
2247
2452
  }, z.core.$strip>], "type">;
2248
2453
  /** Asks the data layer to send its facts in full. */
2249
2454
  export declare const RepairMessageSchema: z.ZodObject<{
@@ -2339,20 +2544,6 @@ export declare const RequestMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
2339
2544
  id: z.ZodString;
2340
2545
  kind: z.ZodLiteral<"focus">;
2341
2546
  handoff: z.ZodString;
2342
- }, z.core.$strip>, z.ZodObject<{
2343
- type: z.ZodLiteral<"request">;
2344
- v: z.ZodLiteral<1>;
2345
- id: z.ZodString;
2346
- kind: z.ZodLiteral<"answer-expert">;
2347
- expert: z.ZodString;
2348
- questionId: z.ZodString;
2349
- question: z.ZodString;
2350
- blocking: z.ZodBoolean;
2351
- from: z.ZodObject<{
2352
- id: z.ZodString;
2353
- name: z.ZodString;
2354
- }, z.core.$strip>;
2355
- asker: z.ZodString;
2356
2547
  }, z.core.$strip>], "kind">;
2357
2548
  /**
2358
2549
  * The request is over (its handoff was cancelled, dismissed or replaced): the machine drops what it
@@ -2444,7 +2635,8 @@ export declare const HandedOverMessageSchema: z.ZodObject<{
2444
2635
  * An answered or dropped question is sent again down the session's own link until it is acked.
2445
2636
  * A question asked of an expert (protocol 0.13.0) has `expert`, and `owner` is the host's name; its
2446
2637
  * `code` says where it stands for ask_expert, and an answered one has the `commit` and `branch` its
2447
- * answer describes.
2638
+ * answer describes. From 0.17.0 no office sends one for an expert's question, which the asker's own
2639
+ * runner answers, though an office from before 0.17.0 may still send a late end.
2448
2640
  */
2449
2641
  export declare const AskedMessageSchema: z.ZodObject<{
2450
2642
  type: z.ZodLiteral<"asked">;
@@ -2467,8 +2659,8 @@ export declare const AskedMessageSchema: z.ZodObject<{
2467
2659
  EXPERT_CAP: "EXPERT_CAP";
2468
2660
  EXPERT_DROPPED: "EXPERT_DROPPED";
2469
2661
  EXPERT_FORK_FAILED: "EXPERT_FORK_FAILED";
2662
+ EXPERT_NOT_SET_UP: "EXPERT_NOT_SET_UP";
2470
2663
  EXPERT_PLUGIN_OLD: "EXPERT_PLUGIN_OLD";
2471
- EXPERT_QUESTION_HELD: "EXPERT_QUESTION_HELD";
2472
2664
  EXPERT_QUEUED: "EXPERT_QUEUED";
2473
2665
  EXPERT_RUNNER_UNREACHABLE: "EXPERT_RUNNER_UNREACHABLE";
2474
2666
  EXPERT_STARTING: "EXPERT_STARTING";
@@ -2507,21 +2699,6 @@ export declare const ExpertRightsMessageSchema: z.ZodObject<{
2507
2699
  host: z.ZodString;
2508
2700
  }, z.core.$strip>>;
2509
2701
  }, z.core.$strip>;
2510
- /**
2511
- * Which of this runner's experts the server shows in at least one office (protocol 0.13.0), sent only
2512
- * to a runner that said `experts`: once its hello is let in (as the server last kept them, or none),
2513
- * after each `experts` message, and whenever the offices change. The runner sends no `experts` on a
2514
- * connection before that connection's first `hosting`, so a server from before experts, which sends
2515
- * none, is never sent one.
2516
- * `expertSenior` (protocol 0.14.0): this server reads `expert-senior`, so the runner may send it. A
2517
- * server that reads it says it on every `hosting`; the runner goes by the connection's last one.
2518
- */
2519
- export declare const HostingMessageSchema: z.ZodObject<{
2520
- type: z.ZodLiteral<"hosting">;
2521
- v: z.ZodLiteral<1>;
2522
- listed: z.ZodArray<z.ZodString>;
2523
- expertSenior: z.ZodOptional<z.ZodLiteral<true>>;
2524
- }, z.core.$strip>;
2525
2702
  /**
2526
2703
  * A person acting on a driven session from the floor (protocol 0.5.0), sent only to a runner that said
2527
2704
  * `drive`, and only to the owner's own runner. `by` is the person acting, whom the runner checks is its
@@ -2772,6 +2949,193 @@ export declare const ServerExpertCreationSuggestionEndedMessageSchema: z.ZodDisc
2772
2949
  refused: "refused";
2773
2950
  }>;
2774
2951
  }, z.core.$strip>], "why">;
2952
+ /**
2953
+ * Every expert record whose project an office on this server holds (protocol 0.17.0), the whole list
2954
+ * each time, each marked `yours` for this runner's person, and the caps of asks.json that the
2955
+ * asker's runner checks over its person's questions on all their computers (`asking`): open
2956
+ * questions per person per expert, questions per person in the last day, and the hours after which
2957
+ * a question still unanswered ends. Sent to a runner that said `expertInstances` once its hello is
2958
+ * let in, even an empty one, and whenever it changes; the first on a connection opens the family on
2959
+ * it (see "Expert records and instances"). Each key once.
2960
+ */
2961
+ export declare const ExpertDirectoryMessageSchema: z.ZodObject<{
2962
+ type: z.ZodLiteral<"expert-directory">;
2963
+ v: z.ZodLiteral<1>;
2964
+ experts: z.ZodArray<z.ZodObject<{
2965
+ key: z.ZodString;
2966
+ expertRecordId: z.ZodUUID;
2967
+ project: z.ZodObject<{
2968
+ id: z.ZodString;
2969
+ name: z.ZodString;
2970
+ }, z.core.$strip>;
2971
+ owner: z.ZodObject<{
2972
+ id: z.ZodString;
2973
+ name: z.ZodString;
2974
+ }, z.core.$strip>;
2975
+ yours: z.ZodOptional<z.ZodLiteral<true>>;
2976
+ revision: z.ZodNumber;
2977
+ groundingTokens: z.ZodOptional<z.ZodNumber>;
2978
+ }, z.core.$strip>>;
2979
+ asking: z.ZodObject<{
2980
+ openPerPersonPerExpert: z.ZodNumber;
2981
+ perPersonPerDay: z.ZodNumber;
2982
+ maxAgeHours: z.ZodNumber;
2983
+ }, z.core.$strip>;
2984
+ }, z.core.$strip>;
2985
+ /**
2986
+ * The expert record `expertRecordId` at `revision`, with its definition (protocol 0.17.0): in answer
2987
+ * to `expert-record-wanted`, and sent unasked when the revision changes to every linked runner whose
2988
+ * `expert-instance-states` has that record at `grounding` or `proof`, `ready`, or failed for a reason
2989
+ * other than `clone` or `key-used-here`; a runner still cloning asks once it has the project.
2990
+ * `owner` is the expert's owner, and `yours` marks it as this runner's person's own.
2991
+ */
2992
+ export declare const ExpertRecordMessageSchema: z.ZodObject<{
2993
+ type: z.ZodLiteral<"expert-record">;
2994
+ v: z.ZodLiteral<1>;
2995
+ expertRecordId: z.ZodUUID;
2996
+ revision: z.ZodNumber;
2997
+ owner: z.ZodObject<{
2998
+ id: z.ZodString;
2999
+ name: z.ZodString;
3000
+ }, z.core.$strip>;
3001
+ yours: z.ZodOptional<z.ZodLiteral<true>>;
3002
+ definition: z.ZodObject<{
3003
+ key: z.ZodString;
3004
+ project: z.ZodObject<{
3005
+ id: z.ZodString;
3006
+ name: z.ZodString;
3007
+ }, z.core.$strip>;
3008
+ subject: z.ZodString;
3009
+ model: z.ZodString;
3010
+ promoteAtTokens: z.ZodNumber;
3011
+ areas: z.ZodArray<z.ZodString>;
3012
+ proof: z.ZodObject<{
3013
+ question: z.ZodString;
3014
+ answer: z.ZodString;
3015
+ }, z.core.$strip>;
3016
+ }, z.core.$strip>;
3017
+ }, z.core.$strip>;
3018
+ /**
3019
+ * The answer to `expert-definition` for the expert `key` (protocol 0.17.0): `published`, as the record
3020
+ * `expertRecordId` at `revision` (a definition unchanged keeps its revision); or `refused`, for its
3021
+ * `reason`: `edited-elsewhere`, the record changed since the revision `basedOn` named, so the runner
3022
+ * writes the record's `definition`, at `revision`, into the expert file; `key-taken`, another
3023
+ * person's expert has the key; `not-owner`, the record `basedOn` named is now another person's, its
3024
+ * owner changed; `project-not-in-an-office`, no office on this server holds its project; `deleted`,
3025
+ * the record `basedOn` named was deleted on the floor.
3026
+ */
3027
+ export declare const ExpertDefinitionResultMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3028
+ type: z.ZodLiteral<"expert-definition-result">;
3029
+ v: z.ZodLiteral<1>;
3030
+ key: z.ZodString;
3031
+ outcome: z.ZodLiteral<"published">;
3032
+ expertRecordId: z.ZodUUID;
3033
+ revision: z.ZodNumber;
3034
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
3035
+ type: z.ZodLiteral<"expert-definition-result">;
3036
+ v: z.ZodLiteral<1>;
3037
+ key: z.ZodString;
3038
+ outcome: z.ZodLiteral<"refused">;
3039
+ reason: z.ZodLiteral<"edited-elsewhere">;
3040
+ expertRecordId: z.ZodUUID;
3041
+ revision: z.ZodNumber;
3042
+ definition: z.ZodObject<{
3043
+ key: z.ZodString;
3044
+ project: z.ZodObject<{
3045
+ id: z.ZodString;
3046
+ name: z.ZodString;
3047
+ }, z.core.$strip>;
3048
+ subject: z.ZodString;
3049
+ model: z.ZodString;
3050
+ promoteAtTokens: z.ZodNumber;
3051
+ areas: z.ZodArray<z.ZodString>;
3052
+ proof: z.ZodObject<{
3053
+ question: z.ZodString;
3054
+ answer: z.ZodString;
3055
+ }, z.core.$strip>;
3056
+ }, z.core.$strip>;
3057
+ }, z.core.$strip>, z.ZodObject<{
3058
+ type: z.ZodLiteral<"expert-definition-result">;
3059
+ v: z.ZodLiteral<1>;
3060
+ key: z.ZodString;
3061
+ outcome: z.ZodLiteral<"refused">;
3062
+ reason: z.ZodEnum<{
3063
+ deleted: "deleted";
3064
+ "key-taken": "key-taken";
3065
+ "not-owner": "not-owner";
3066
+ "project-not-in-an-office": "project-not-in-an-office";
3067
+ }>;
3068
+ }, z.core.$strip>], "reason">], "outcome">;
3069
+ /**
3070
+ * The expert record `expertRecordId` of the expert `key` was deleted on the floor, by `by` (protocol
3071
+ * 0.17.0): sent to every linked runner then, and to each runner that links within the 30 days after.
3072
+ * A runner acts on it only where its files are tied to that record, never another record of the key.
3073
+ */
3074
+ export declare const ExpertDeletedMessageSchema: z.ZodObject<{
3075
+ type: z.ZodLiteral<"expert-deleted">;
3076
+ v: z.ZodLiteral<1>;
3077
+ key: z.ZodString;
3078
+ expertRecordId: z.ZodUUID;
3079
+ by: z.ZodObject<{
3080
+ id: z.ZodString;
3081
+ name: z.ZodString;
3082
+ }, z.core.$strip>;
3083
+ }, z.core.$strip>;
3084
+ /**
3085
+ * Set up this computer's instance of the expert `key` from the record `expertRecordId` (protocol
3086
+ * 0.17.0): its person's one click on the floor, or Try again after a failure (`again`, which grounds
3087
+ * it again now). Sent to that person's own runner on the computer they chose; `by` is the account
3088
+ * that runner said hello as, which the runner checks is its own, starting nothing otherwise. Nothing
3089
+ * is queued: the server refuses at once when that runner isn't linked. How the set-up goes, the
3090
+ * runner says in `expert-instance-states`.
3091
+ */
3092
+ export declare const SetUpExpertInstanceMessageSchema: z.ZodObject<{
3093
+ type: z.ZodLiteral<"set-up-expert-instance">;
3094
+ v: z.ZodLiteral<1>;
3095
+ request: z.ZodString;
3096
+ key: z.ZodString;
3097
+ expertRecordId: z.ZodUUID;
3098
+ by: z.ZodObject<{
3099
+ id: z.ZodString;
3100
+ name: z.ZodString;
3101
+ }, z.core.$strip>;
3102
+ again: z.ZodOptional<z.ZodLiteral<true>>;
3103
+ }, z.core.$strip>;
3104
+ /**
3105
+ * The offer to set up the expert `key` on this computer, from the record `expertRecordId`, ended
3106
+ * (protocol 0.17.0): `dismissed` on the floor; `expired`; `set-up`, an instance of it is listed; or
3107
+ * `gone`, the record was deleted or its project left every office. Sent to that person's runner on
3108
+ * that computer when it ends, and on each link for every offer of that computer that ended in the 30
3109
+ * days after it was offered.
3110
+ */
3111
+ export declare const ExpertSetUpOfferEndedMessageSchema: z.ZodObject<{
3112
+ type: z.ZodLiteral<"expert-set-up-offer-ended">;
3113
+ v: z.ZodLiteral<1>;
3114
+ key: z.ZodString;
3115
+ expertRecordId: z.ZodUUID;
3116
+ why: z.ZodEnum<{
3117
+ dismissed: "dismissed";
3118
+ expired: "expired";
3119
+ gone: "gone";
3120
+ "set-up": "set-up";
3121
+ }>;
3122
+ }, z.core.$strip>;
3123
+ /**
3124
+ * This runner's person's questions to experts on their other computers (protocol 0.17.0), from the
3125
+ * records those computers' runners sent (`expert-question`): `open`, how many are open per expert,
3126
+ * and `askedAtInTheLastDay`, when each of the last day's was asked. The runner adds its own and
3127
+ * checks the directory's `asking` caps against the total. Sent after the directory on each link, and
3128
+ * whenever those records change.
3129
+ */
3130
+ export declare const ExpertQuestionsAskedOnYourOtherComputersMessageSchema: z.ZodObject<{
3131
+ type: z.ZodLiteral<"expert-questions-asked-on-your-other-computers">;
3132
+ v: z.ZodLiteral<1>;
3133
+ open: z.ZodArray<z.ZodObject<{
3134
+ key: z.ZodString;
3135
+ count: z.ZodNumber;
3136
+ }, z.core.$strip>>;
3137
+ askedAtInTheLastDay: z.ZodArray<z.ZodISODateTime>;
3138
+ }, z.core.$strip>;
2775
3139
  export declare const OfficeServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2776
3140
  type: z.ZodLiteral<"repair">;
2777
3141
  v: z.ZodLiteral<1>;
@@ -2846,20 +3210,6 @@ export declare const OfficeServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
2846
3210
  id: z.ZodString;
2847
3211
  kind: z.ZodLiteral<"focus">;
2848
3212
  handoff: z.ZodString;
2849
- }, z.core.$strip>, z.ZodObject<{
2850
- type: z.ZodLiteral<"request">;
2851
- v: z.ZodLiteral<1>;
2852
- id: z.ZodString;
2853
- kind: z.ZodLiteral<"answer-expert">;
2854
- expert: z.ZodString;
2855
- questionId: z.ZodString;
2856
- question: z.ZodString;
2857
- blocking: z.ZodBoolean;
2858
- from: z.ZodObject<{
2859
- id: z.ZodString;
2860
- name: z.ZodString;
2861
- }, z.core.$strip>;
2862
- asker: z.ZodString;
2863
3213
  }, z.core.$strip>], "kind">, z.ZodObject<{
2864
3214
  type: z.ZodLiteral<"release">;
2865
3215
  v: z.ZodLiteral<1>;
@@ -2936,8 +3286,8 @@ export declare const OfficeServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
2936
3286
  EXPERT_CAP: "EXPERT_CAP";
2937
3287
  EXPERT_DROPPED: "EXPERT_DROPPED";
2938
3288
  EXPERT_FORK_FAILED: "EXPERT_FORK_FAILED";
3289
+ EXPERT_NOT_SET_UP: "EXPERT_NOT_SET_UP";
2939
3290
  EXPERT_PLUGIN_OLD: "EXPERT_PLUGIN_OLD";
2940
- EXPERT_QUESTION_HELD: "EXPERT_QUESTION_HELD";
2941
3291
  EXPERT_QUEUED: "EXPERT_QUEUED";
2942
3292
  EXPERT_RUNNER_UNREACHABLE: "EXPERT_RUNNER_UNREACHABLE";
2943
3293
  EXPERT_STARTING: "EXPERT_STARTING";
@@ -3094,11 +3444,6 @@ export declare const OfficeServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
3094
3444
  repo: z.ZodString;
3095
3445
  host: z.ZodString;
3096
3446
  }, z.core.$strip>>;
3097
- }, z.core.$strip>, z.ZodObject<{
3098
- type: z.ZodLiteral<"hosting">;
3099
- v: z.ZodLiteral<1>;
3100
- listed: z.ZodArray<z.ZodString>;
3101
- expertSenior: z.ZodOptional<z.ZodLiteral<true>>;
3102
3447
  }, z.core.$strip>, z.ZodObject<{
3103
3448
  type: z.ZodLiteral<"create-expert-from-suggestion">;
3104
3449
  v: z.ZodLiteral<1>;
@@ -3156,7 +3501,135 @@ export declare const OfficeServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
3156
3501
  expired: "expired";
3157
3502
  refused: "refused";
3158
3503
  }>;
3159
- }, z.core.$strip>], "why">], "type">;
3504
+ }, z.core.$strip>], "why">, z.ZodObject<{
3505
+ type: z.ZodLiteral<"expert-directory">;
3506
+ v: z.ZodLiteral<1>;
3507
+ experts: z.ZodArray<z.ZodObject<{
3508
+ key: z.ZodString;
3509
+ expertRecordId: z.ZodUUID;
3510
+ project: z.ZodObject<{
3511
+ id: z.ZodString;
3512
+ name: z.ZodString;
3513
+ }, z.core.$strip>;
3514
+ owner: z.ZodObject<{
3515
+ id: z.ZodString;
3516
+ name: z.ZodString;
3517
+ }, z.core.$strip>;
3518
+ yours: z.ZodOptional<z.ZodLiteral<true>>;
3519
+ revision: z.ZodNumber;
3520
+ groundingTokens: z.ZodOptional<z.ZodNumber>;
3521
+ }, z.core.$strip>>;
3522
+ asking: z.ZodObject<{
3523
+ openPerPersonPerExpert: z.ZodNumber;
3524
+ perPersonPerDay: z.ZodNumber;
3525
+ maxAgeHours: z.ZodNumber;
3526
+ }, z.core.$strip>;
3527
+ }, z.core.$strip>, z.ZodObject<{
3528
+ type: z.ZodLiteral<"expert-record">;
3529
+ v: z.ZodLiteral<1>;
3530
+ expertRecordId: z.ZodUUID;
3531
+ revision: z.ZodNumber;
3532
+ owner: z.ZodObject<{
3533
+ id: z.ZodString;
3534
+ name: z.ZodString;
3535
+ }, z.core.$strip>;
3536
+ yours: z.ZodOptional<z.ZodLiteral<true>>;
3537
+ definition: z.ZodObject<{
3538
+ key: z.ZodString;
3539
+ project: z.ZodObject<{
3540
+ id: z.ZodString;
3541
+ name: z.ZodString;
3542
+ }, z.core.$strip>;
3543
+ subject: z.ZodString;
3544
+ model: z.ZodString;
3545
+ promoteAtTokens: z.ZodNumber;
3546
+ areas: z.ZodArray<z.ZodString>;
3547
+ proof: z.ZodObject<{
3548
+ question: z.ZodString;
3549
+ answer: z.ZodString;
3550
+ }, z.core.$strip>;
3551
+ }, z.core.$strip>;
3552
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
3553
+ type: z.ZodLiteral<"expert-definition-result">;
3554
+ v: z.ZodLiteral<1>;
3555
+ key: z.ZodString;
3556
+ outcome: z.ZodLiteral<"published">;
3557
+ expertRecordId: z.ZodUUID;
3558
+ revision: z.ZodNumber;
3559
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
3560
+ type: z.ZodLiteral<"expert-definition-result">;
3561
+ v: z.ZodLiteral<1>;
3562
+ key: z.ZodString;
3563
+ outcome: z.ZodLiteral<"refused">;
3564
+ reason: z.ZodLiteral<"edited-elsewhere">;
3565
+ expertRecordId: z.ZodUUID;
3566
+ revision: z.ZodNumber;
3567
+ definition: z.ZodObject<{
3568
+ key: z.ZodString;
3569
+ project: z.ZodObject<{
3570
+ id: z.ZodString;
3571
+ name: z.ZodString;
3572
+ }, z.core.$strip>;
3573
+ subject: z.ZodString;
3574
+ model: z.ZodString;
3575
+ promoteAtTokens: z.ZodNumber;
3576
+ areas: z.ZodArray<z.ZodString>;
3577
+ proof: z.ZodObject<{
3578
+ question: z.ZodString;
3579
+ answer: z.ZodString;
3580
+ }, z.core.$strip>;
3581
+ }, z.core.$strip>;
3582
+ }, z.core.$strip>, z.ZodObject<{
3583
+ type: z.ZodLiteral<"expert-definition-result">;
3584
+ v: z.ZodLiteral<1>;
3585
+ key: z.ZodString;
3586
+ outcome: z.ZodLiteral<"refused">;
3587
+ reason: z.ZodEnum<{
3588
+ deleted: "deleted";
3589
+ "key-taken": "key-taken";
3590
+ "not-owner": "not-owner";
3591
+ "project-not-in-an-office": "project-not-in-an-office";
3592
+ }>;
3593
+ }, z.core.$strip>], "reason">], "outcome">, z.ZodObject<{
3594
+ type: z.ZodLiteral<"expert-deleted">;
3595
+ v: z.ZodLiteral<1>;
3596
+ key: z.ZodString;
3597
+ expertRecordId: z.ZodUUID;
3598
+ by: z.ZodObject<{
3599
+ id: z.ZodString;
3600
+ name: z.ZodString;
3601
+ }, z.core.$strip>;
3602
+ }, z.core.$strip>, z.ZodObject<{
3603
+ type: z.ZodLiteral<"set-up-expert-instance">;
3604
+ v: z.ZodLiteral<1>;
3605
+ request: z.ZodString;
3606
+ key: z.ZodString;
3607
+ expertRecordId: z.ZodUUID;
3608
+ by: z.ZodObject<{
3609
+ id: z.ZodString;
3610
+ name: z.ZodString;
3611
+ }, z.core.$strip>;
3612
+ again: z.ZodOptional<z.ZodLiteral<true>>;
3613
+ }, z.core.$strip>, z.ZodObject<{
3614
+ type: z.ZodLiteral<"expert-set-up-offer-ended">;
3615
+ v: z.ZodLiteral<1>;
3616
+ key: z.ZodString;
3617
+ expertRecordId: z.ZodUUID;
3618
+ why: z.ZodEnum<{
3619
+ dismissed: "dismissed";
3620
+ expired: "expired";
3621
+ gone: "gone";
3622
+ "set-up": "set-up";
3623
+ }>;
3624
+ }, z.core.$strip>, z.ZodObject<{
3625
+ type: z.ZodLiteral<"expert-questions-asked-on-your-other-computers">;
3626
+ v: z.ZodLiteral<1>;
3627
+ open: z.ZodArray<z.ZodObject<{
3628
+ key: z.ZodString;
3629
+ count: z.ZodNumber;
3630
+ }, z.core.$strip>>;
3631
+ askedAtInTheLastDay: z.ZodArray<z.ZodISODateTime>;
3632
+ }, z.core.$strip>], "type">;
3160
3633
  export type HandoffRepo = z.infer<typeof HandoffRepoSchema>;
3161
3634
  export type Handoff = z.infer<typeof HandoffSchema>;
3162
3635
  export type HelloMessage = z.infer<typeof HelloMessageSchema>;
@@ -3200,18 +3673,28 @@ export type DriveRefusal = Extract<DrivenMessage, {
3200
3673
  kind: "refused";
3201
3674
  }>;
3202
3675
  export type DriveRefusalReason = DriveRefusal["reason"];
3203
- export type ExpertListing = z.infer<typeof ExpertListingSchema>;
3204
3676
  export type ExpertRight = z.infer<typeof ExpertRightSchema>;
3205
3677
  export type ExpertCode = z.infer<typeof ExpertCodeSchema>;
3206
- export type ExpertState = z.infer<typeof ExpertStateSchema>;
3207
- export type ExpertCap = z.infer<typeof ExpertCapSchema>;
3208
- export type ExpertRefusal = z.infer<typeof ExpertRefusalSchema>;
3209
- export type ExpertsMessage = z.infer<typeof ExpertsMessageSchema>;
3210
3678
  export type AskExpertMessage = z.infer<typeof AskExpertMessageSchema>;
3211
3679
  export type ExpertRightsMessage = z.infer<typeof ExpertRightsMessageSchema>;
3212
- export type HostingMessage = z.infer<typeof HostingMessageSchema>;
3213
- export type ExpertSeniorMessage = z.infer<typeof ExpertSeniorMessageSchema>;
3680
+ export type ExpertDefinition = z.infer<typeof ExpertDefinitionSchema>;
3681
+ export type ExpertInstanceState = z.infer<typeof ExpertInstanceStateSchema>;
3682
+ export type ExpertDirectoryEntry = z.infer<typeof ExpertDirectoryEntrySchema>;
3683
+ export type ExpertDefinitionMessage = z.infer<typeof ExpertDefinitionMessageSchema>;
3684
+ export type ExpertRecordWantedMessage = z.infer<typeof ExpertRecordWantedMessageSchema>;
3685
+ export type ExpertInstanceStatesMessage = z.infer<typeof ExpertInstanceStatesMessageSchema>;
3686
+ export type ExpertQuestionMessage = z.infer<typeof ExpertQuestionMessageSchema>;
3687
+ export type ExpertSetUpOfferedMessage = z.infer<typeof ExpertSetUpOfferedMessageSchema>;
3688
+ export type ExpertProofFailedMessage = z.infer<typeof ExpertProofFailedMessageSchema>;
3689
+ export type ExpertDirectoryMessage = z.infer<typeof ExpertDirectoryMessageSchema>;
3690
+ export type ExpertRecordMessage = z.infer<typeof ExpertRecordMessageSchema>;
3691
+ export type ExpertDefinitionResultMessage = z.infer<typeof ExpertDefinitionResultMessageSchema>;
3692
+ export type ExpertDeletedMessage = z.infer<typeof ExpertDeletedMessageSchema>;
3693
+ export type SetUpExpertInstanceMessage = z.infer<typeof SetUpExpertInstanceMessageSchema>;
3694
+ export type ExpertSetUpOfferEndedMessage = z.infer<typeof ExpertSetUpOfferEndedMessageSchema>;
3695
+ export type ExpertQuestionsAskedOnYourOtherComputersMessage = z.infer<typeof ExpertQuestionsAskedOnYourOtherComputersMessageSchema>;
3214
3696
  export type ExpertCreationSuggestionMessage = z.infer<typeof ExpertCreationSuggestionMessageSchema>;
3697
+ export type ExpertCreationSuggestionRepetition = z.infer<typeof ExpertCreationSuggestionRepetitionSchema>;
3215
3698
  export type RunnerExpertCreationSuggestionEndedMessage = z.infer<typeof RunnerExpertCreationSuggestionEndedMessageSchema>;
3216
3699
  export type ExpertCreationProgressState = z.infer<typeof ExpertCreationProgressStateSchema>;
3217
3700
  export type ExpertCreationProgressMessage = z.infer<typeof ExpertCreationProgressMessageSchema>;