keri-ts 2.2.4 → 2.2.5

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.
Files changed (233) hide show
  1. package/esm/keri/npm/src/_dnt.polyfills.js +14 -14
  2. package/esm/keri/npm/src/acdc/registering.js +19 -0
  3. package/esm/keri/npm/src/acdc/salting.js +4 -0
  4. package/esm/keri/npm/src/app/bootstrap/authenticating.js +32 -10
  5. package/esm/keri/npm/src/app/bootstrap/oobiery.js +363 -30
  6. package/esm/keri/npm/src/app/credentials/credential-importing.js +33 -4
  7. package/esm/keri/npm/src/app/credentials/root-replicator.js +27 -15
  8. package/esm/keri/npm/src/app/credentials/schema-resolving.js +5 -1
  9. package/esm/keri/npm/src/app/credentials/tel-publishing.js +16 -7
  10. package/esm/keri/npm/src/app/delivery/forwarding.js +177 -43
  11. package/esm/keri/npm/src/app/delivery/relaying.js +232 -0
  12. package/esm/keri/npm/src/app/delivery/respondant.js +8 -5
  13. package/esm/keri/npm/src/app/exchanges/exchange-messaging.js +1 -1
  14. package/esm/keri/npm/src/app/exchanges/exchanging.js +65 -9
  15. package/esm/keri/npm/src/app/identity/delegating.js +66 -9
  16. package/esm/keri/npm/src/app/identity/habbing.js +190 -71
  17. package/esm/keri/npm/src/app/identity/keeping.js +111 -39
  18. package/esm/keri/npm/src/app/identity/retire-identifier.js +98 -0
  19. package/esm/keri/npm/src/app/ipex/disclosure-replaying.js +116 -0
  20. package/esm/keri/npm/src/app/ipex/group-ipex.js +122 -25
  21. package/esm/keri/npm/src/app/ipex/group-issuance.js +109 -23
  22. package/esm/keri/npm/src/app/ipex/ipex-discloser.js +36 -22
  23. package/esm/keri/npm/src/app/ipex/ipex-grouping.js +53 -3
  24. package/esm/keri/npm/src/app/ipex/ipex-v2.js +7 -2
  25. package/esm/keri/npm/src/app/ipex/issuance.js +131 -35
  26. package/esm/keri/npm/src/app/ipex/pending-presentations.js +4 -2
  27. package/esm/keri/npm/src/app/ipex/presenting.js +3 -18
  28. package/esm/keri/npm/src/app/ipex/receive-issuance.js +2 -1
  29. package/esm/keri/npm/src/app/ipex/unblinding-workflow.js +16 -3
  30. package/esm/keri/npm/src/app/mailbox/agent-inbox.js +292 -0
  31. package/esm/keri/npm/src/app/mailbox/forward-handler.js +298 -52
  32. package/esm/keri/npm/src/app/mailbox/kel-publisher.js +26 -31
  33. package/esm/keri/npm/src/app/mailbox/mailbox-poller.js +70 -62
  34. package/esm/keri/npm/src/app/mailbox/mailboxing.js +20 -4
  35. package/esm/keri/npm/src/app/multisig/counseling.js +71 -27
  36. package/esm/keri/npm/src/app/multisig/group-members.js +41 -5
  37. package/esm/keri/npm/src/app/multisig/grouping.js +50 -2
  38. package/esm/keri/npm/src/app/multisig/multisig-workflows.js +3 -18
  39. package/esm/keri/npm/src/app/multisig/proposing.js +1 -16
  40. package/esm/keri/npm/src/app/multisig/rejoin-group.js +99 -0
  41. package/esm/keri/npm/src/app/multisig/replace-member.js +29 -8
  42. package/esm/keri/npm/src/app/protocol/parsering.js +45 -17
  43. package/esm/keri/npm/src/app/protocol/protocol-processing.js +47 -21
  44. package/esm/keri/npm/src/app/queries/query-replies.js +0 -22
  45. package/esm/keri/npm/src/app/queries/relay-refresh.js +81 -0
  46. package/esm/keri/npm/src/app/queries/witness-inquisitor.js +180 -34
  47. package/esm/keri/npm/src/app/runtime/agent-runtime.js +41 -72
  48. package/esm/keri/npm/src/app/runtime/cue-runtime.js +45 -5
  49. package/esm/keri/npm/src/app/runtime/operation-owners.js +26 -56
  50. package/esm/keri/npm/src/app/runtime/workflow-contract.js +7 -4
  51. package/esm/keri/npm/src/app/transport/http-client.js +20 -2
  52. package/esm/keri/npm/src/app/transport/message-source.js +2 -1
  53. package/esm/keri/npm/src/app/transport/messengering.js +39 -8
  54. package/esm/keri/npm/src/app/witness/ingress.js +7 -0
  55. package/esm/keri/npm/src/app/witness/receipt-client.js +43 -16
  56. package/esm/keri/npm/src/app/witness/receipting.js +62 -20
  57. package/esm/keri/npm/src/cli/messaging/multisig.js +4 -3
  58. package/esm/keri/npm/src/core/errors.js +73 -0
  59. package/esm/keri/npm/src/core/kel/delegation-ancestry.js +11 -2
  60. package/esm/keri/npm/src/core/kel/eventing.js +25 -28
  61. package/esm/keri/npm/src/core/kel/kever.js +15 -9
  62. package/esm/keri/npm/src/core/mailbox/kram-policy.js +8 -0
  63. package/esm/keri/npm/src/core/mailbox/kram-pruning.js +25 -6
  64. package/esm/keri/npm/src/core/mailbox/kram-time.js +34 -6
  65. package/esm/keri/npm/src/core/mailbox/kraming.js +58 -2
  66. package/esm/keri/npm/src/core/routing.js +18 -25
  67. package/esm/keri/npm/src/core/scheming.js +12 -5
  68. package/esm/keri/npm/src/core/wire-fields.js +126 -0
  69. package/esm/keri/npm/src/db/basing.js +4 -13
  70. package/esm/keri/npm/src/db/core/indexeddb-persistence.js +3 -2
  71. package/esm/keri/npm/src/db/core/webdber.js +85 -27
  72. package/esm/keri/npm/src/db/mailbox/mailboxing.js +13 -0
  73. package/esm/keri/npm/src/db/subing.js +4 -0
  74. package/esm/keri/npm/src/runtime/index.js +11 -5
  75. package/esm/keri/npm/src/time/mod.js +5 -0
  76. package/esm/keri/npm/src/vdr/credential-tsn-record.js +2 -7
  77. package/esm/keri/npm/src/vdr/eventing.js +28 -19
  78. package/esm/keri/npm/src/vdr/registry-tsn-record.js +3 -13
  79. package/esm/keri/npm/src/version.js +2 -2
  80. package/package.json +1 -1
  81. package/types/_dnt.polyfills.d.ts +9 -9
  82. package/types/_dnt.polyfills.d.ts.map +1 -1
  83. package/types/acdc/registering.d.ts +6 -0
  84. package/types/acdc/registering.d.ts.map +1 -1
  85. package/types/acdc/salting.d.ts.map +1 -1
  86. package/types/app/bootstrap/authenticating.d.ts +12 -2
  87. package/types/app/bootstrap/authenticating.d.ts.map +1 -1
  88. package/types/app/bootstrap/oobiery.d.ts +144 -7
  89. package/types/app/bootstrap/oobiery.d.ts.map +1 -1
  90. package/types/app/credentials/credential-importing.d.ts +8 -0
  91. package/types/app/credentials/credential-importing.d.ts.map +1 -1
  92. package/types/app/credentials/root-replicator.d.ts +19 -8
  93. package/types/app/credentials/root-replicator.d.ts.map +1 -1
  94. package/types/app/credentials/schema-resolving.d.ts.map +1 -1
  95. package/types/app/credentials/tel-publishing.d.ts +4 -2
  96. package/types/app/credentials/tel-publishing.d.ts.map +1 -1
  97. package/types/app/delivery/forwarding.d.ts +69 -5
  98. package/types/app/delivery/forwarding.d.ts.map +1 -1
  99. package/types/app/delivery/relaying.d.ts +144 -0
  100. package/types/app/delivery/relaying.d.ts.map +1 -0
  101. package/types/app/delivery/respondant.d.ts +9 -2
  102. package/types/app/delivery/respondant.d.ts.map +1 -1
  103. package/types/app/exchanges/exchanging.d.ts +36 -0
  104. package/types/app/exchanges/exchanging.d.ts.map +1 -1
  105. package/types/app/identity/delegating.d.ts +6 -0
  106. package/types/app/identity/delegating.d.ts.map +1 -1
  107. package/types/app/identity/habbing.d.ts +106 -19
  108. package/types/app/identity/habbing.d.ts.map +1 -1
  109. package/types/app/identity/keeping.d.ts +54 -19
  110. package/types/app/identity/keeping.d.ts.map +1 -1
  111. package/types/app/identity/retire-identifier.d.ts +24 -0
  112. package/types/app/identity/retire-identifier.d.ts.map +1 -0
  113. package/types/app/ipex/disclosure-replaying.d.ts +61 -0
  114. package/types/app/ipex/disclosure-replaying.d.ts.map +1 -0
  115. package/types/app/ipex/group-ipex.d.ts +60 -14
  116. package/types/app/ipex/group-ipex.d.ts.map +1 -1
  117. package/types/app/ipex/group-issuance.d.ts +48 -6
  118. package/types/app/ipex/group-issuance.d.ts.map +1 -1
  119. package/types/app/ipex/ipex-discloser.d.ts +14 -2
  120. package/types/app/ipex/ipex-discloser.d.ts.map +1 -1
  121. package/types/app/ipex/ipex-grouping.d.ts +23 -2
  122. package/types/app/ipex/ipex-grouping.d.ts.map +1 -1
  123. package/types/app/ipex/ipex-v2.d.ts +5 -2
  124. package/types/app/ipex/ipex-v2.d.ts.map +1 -1
  125. package/types/app/ipex/issuance.d.ts +35 -11
  126. package/types/app/ipex/issuance.d.ts.map +1 -1
  127. package/types/app/ipex/pending-presentations.d.ts +4 -2
  128. package/types/app/ipex/pending-presentations.d.ts.map +1 -1
  129. package/types/app/ipex/presenting.d.ts.map +1 -1
  130. package/types/app/ipex/receive-issuance.d.ts +2 -1
  131. package/types/app/ipex/receive-issuance.d.ts.map +1 -1
  132. package/types/app/ipex/unblinding-workflow.d.ts +4 -1
  133. package/types/app/ipex/unblinding-workflow.d.ts.map +1 -1
  134. package/types/app/mailbox/agent-inbox.d.ts +126 -0
  135. package/types/app/mailbox/agent-inbox.d.ts.map +1 -0
  136. package/types/app/mailbox/forward-handler.d.ts +114 -14
  137. package/types/app/mailbox/forward-handler.d.ts.map +1 -1
  138. package/types/app/mailbox/kel-publisher.d.ts +12 -22
  139. package/types/app/mailbox/kel-publisher.d.ts.map +1 -1
  140. package/types/app/mailbox/mailbox-poller.d.ts +40 -24
  141. package/types/app/mailbox/mailbox-poller.d.ts.map +1 -1
  142. package/types/app/mailbox/mailboxing.d.ts +19 -5
  143. package/types/app/mailbox/mailboxing.d.ts.map +1 -1
  144. package/types/app/multisig/counseling.d.ts +32 -11
  145. package/types/app/multisig/counseling.d.ts.map +1 -1
  146. package/types/app/multisig/group-members.d.ts +17 -1
  147. package/types/app/multisig/group-members.d.ts.map +1 -1
  148. package/types/app/multisig/grouping.d.ts +17 -1
  149. package/types/app/multisig/grouping.d.ts.map +1 -1
  150. package/types/app/multisig/multisig-workflows.d.ts +0 -8
  151. package/types/app/multisig/multisig-workflows.d.ts.map +1 -1
  152. package/types/app/multisig/proposing.d.ts +4 -19
  153. package/types/app/multisig/proposing.d.ts.map +1 -1
  154. package/types/app/multisig/rejoin-group.d.ts +119 -0
  155. package/types/app/multisig/rejoin-group.d.ts.map +1 -0
  156. package/types/app/multisig/replace-member.d.ts +15 -1
  157. package/types/app/multisig/replace-member.d.ts.map +1 -1
  158. package/types/app/protocol/parsering.d.ts +21 -2
  159. package/types/app/protocol/parsering.d.ts.map +1 -1
  160. package/types/app/protocol/protocol-processing.d.ts +25 -5
  161. package/types/app/protocol/protocol-processing.d.ts.map +1 -1
  162. package/types/app/queries/query-replies.d.ts +4 -8
  163. package/types/app/queries/query-replies.d.ts.map +1 -1
  164. package/types/app/queries/relay-refresh.d.ts +26 -0
  165. package/types/app/queries/relay-refresh.d.ts.map +1 -0
  166. package/types/app/queries/witness-inquisitor.d.ts +56 -5
  167. package/types/app/queries/witness-inquisitor.d.ts.map +1 -1
  168. package/types/app/runtime/agent-runtime.d.ts +34 -3
  169. package/types/app/runtime/agent-runtime.d.ts.map +1 -1
  170. package/types/app/runtime/cue-runtime.d.ts +15 -3
  171. package/types/app/runtime/cue-runtime.d.ts.map +1 -1
  172. package/types/app/runtime/operation-owners.d.ts +16 -26
  173. package/types/app/runtime/operation-owners.d.ts.map +1 -1
  174. package/types/app/runtime/workflow-contract.d.ts +21 -6
  175. package/types/app/runtime/workflow-contract.d.ts.map +1 -1
  176. package/types/app/transport/http-client.d.ts +9 -0
  177. package/types/app/transport/http-client.d.ts.map +1 -1
  178. package/types/app/transport/message-source.d.ts +6 -3
  179. package/types/app/transport/message-source.d.ts.map +1 -1
  180. package/types/app/transport/messengering.d.ts +10 -1
  181. package/types/app/transport/messengering.d.ts.map +1 -1
  182. package/types/app/witness/ingress.d.ts +1 -0
  183. package/types/app/witness/ingress.d.ts.map +1 -1
  184. package/types/app/witness/receipt-client.d.ts +19 -1
  185. package/types/app/witness/receipt-client.d.ts.map +1 -1
  186. package/types/app/witness/receipting.d.ts +24 -1
  187. package/types/app/witness/receipting.d.ts.map +1 -1
  188. package/types/cli/messaging/multisig.d.ts.map +1 -1
  189. package/types/core/cues.d.ts +53 -1
  190. package/types/core/cues.d.ts.map +1 -1
  191. package/types/core/errors.d.ts +32 -0
  192. package/types/core/errors.d.ts.map +1 -1
  193. package/types/core/kel/delegation-ancestry.d.ts.map +1 -1
  194. package/types/core/kel/eventing.d.ts.map +1 -1
  195. package/types/core/kel/kever-decisions.d.ts +3 -1
  196. package/types/core/kel/kever-decisions.d.ts.map +1 -1
  197. package/types/core/kel/kever.d.ts +7 -1
  198. package/types/core/kel/kever.d.ts.map +1 -1
  199. package/types/core/mailbox/kram-policy.d.ts +6 -0
  200. package/types/core/mailbox/kram-policy.d.ts.map +1 -1
  201. package/types/core/mailbox/kram-pruning.d.ts +5 -1
  202. package/types/core/mailbox/kram-pruning.d.ts.map +1 -1
  203. package/types/core/mailbox/kram-time.d.ts +26 -2
  204. package/types/core/mailbox/kram-time.d.ts.map +1 -1
  205. package/types/core/mailbox/kraming.d.ts +14 -1
  206. package/types/core/mailbox/kraming.d.ts.map +1 -1
  207. package/types/core/routing.d.ts +3 -7
  208. package/types/core/routing.d.ts.map +1 -1
  209. package/types/core/scheming.d.ts.map +1 -1
  210. package/types/core/wire-fields.d.ts +56 -0
  211. package/types/core/wire-fields.d.ts.map +1 -0
  212. package/types/db/basing.d.ts.map +1 -1
  213. package/types/db/core/indexeddb-persistence.d.ts +3 -2
  214. package/types/db/core/indexeddb-persistence.d.ts.map +1 -1
  215. package/types/db/core/webdber.d.ts +32 -6
  216. package/types/db/core/webdber.d.ts.map +1 -1
  217. package/types/db/exchange/exchange-records.d.ts +4 -0
  218. package/types/db/exchange/exchange-records.d.ts.map +1 -1
  219. package/types/db/mailbox/mailboxing.d.ts +10 -1
  220. package/types/db/mailbox/mailboxing.d.ts.map +1 -1
  221. package/types/db/subing.d.ts +2 -0
  222. package/types/db/subing.d.ts.map +1 -1
  223. package/types/runtime/index.d.ts +20 -14
  224. package/types/runtime/index.d.ts.map +1 -1
  225. package/types/time/mod.d.ts +2 -0
  226. package/types/time/mod.d.ts.map +1 -1
  227. package/types/vdr/credential-tsn-record.d.ts.map +1 -1
  228. package/types/vdr/eventing.d.ts.map +1 -1
  229. package/types/vdr/registry-tsn-record.d.ts.map +1 -1
  230. package/types/version.d.ts +2 -2
  231. package/esm/keri/npm/src/app/runtime/signer-conditions.js +0 -51
  232. package/types/app/runtime/signer-conditions.d.ts +0 -32
  233. package/types/app/runtime/signer-conditions.d.ts.map +0 -1
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Rebuild a lost group habitat record from the group's accepted key state.
3
+ *
4
+ * A host can lose its store while its member identifier survives: the member is re-adopted at open
5
+ * (`Habery.makeSignedHab` for a signer held outside the store), but the record of the group it belongs to
6
+ * is gone. The group's KEL is still held by a co-member and reachable by OOBI. `rejoinGroup` resolves that
7
+ * OOBI, waits until the group's key state is accepted locally, reads the signing and rotation members of the
8
+ * group's latest accepted establishment event (`acceptedGroupMembers`, KERIpy `GroupHab.acceptedMembers`),
9
+ * and records the group with `Habery.joinGroupHab`.
10
+ *
11
+ * Boundaries:
12
+ * - Membership is decided by accepted key state only, never by caller-supplied member lists, and only by
13
+ * the member lists: a member whose signing weight is 0 is a member like any other.
14
+ * - The group's key state names keys, not identifiers. Attributing each key to a member needs every
15
+ * member's KEL to be local, and a group OOBI carries the group's KEL only. A caller resolves the other
16
+ * members' OOBIs first (or the wait ends `timed-out` with `waiting: "member-key-state"`).
17
+ * - Remote outcomes are returned (`RejoinResult`); only programmer misuse throws. A result other than
18
+ * `joined` writes no habitat record; key state the OOBI taught stays, as for any resolution.
19
+ * - Only the record is rebuilt. Credentials, registry state and exchanges the store held come back by
20
+ * replay from a co-member (`listGroupDisclosures`, `exportDisclosureStream`, `importCredentialStream`); this call
21
+ * does not request it. `written: true` on the result says such a refill is due.
22
+ * - Dependencies are declared collaborators (ADR-0013); an `AgentRuntime` fits.
23
+ */
24
+ import type { Operation } from "effection";
25
+ import type { Oobiery } from "../bootstrap/oobiery.js";
26
+ import type { RootReplicator } from "../credentials/root-replicator.js";
27
+ import type { Hab, Habery } from "../identity/habbing.js";
28
+ import type { KelPublisher } from "../mailbox/kel-publisher.js";
29
+ import type { MailboxPoller } from "../mailbox/mailbox-poller.js";
30
+ import type { RuntimeClock } from "../runtime/runtime-clock.js";
31
+ import { type ChangeSink } from "../runtime/workflow-contract.js";
32
+ /** Collaborators of {@link rejoinGroup}. */
33
+ export interface RejoinDeps {
34
+ /** The Habery that holds `member`; the group record is written here. */
35
+ readonly hby: Habery;
36
+ /** Durable OOBI job owner; only its queueing entry is used. Something must be running it. */
37
+ readonly oobiery: Pick<Oobiery, "resolve">;
38
+ /** The runtime clock that bounds the wait. */
39
+ readonly clock: Pick<RuntimeClock, "now">;
40
+ /** Prompted for the group after a join, so the poller selects the group's mailboxes on its next tock. */
41
+ readonly mailboxPoller: Pick<MailboxPoller, "prompt">;
42
+ /** Prompted for the group after a join, so the group's KEL is posted to its mailboxes on the next tock. */
43
+ readonly kelPublisher: Pick<KelPublisher, "prompt">;
44
+ /** Prompted for the group after a join, or null for a runtime without one. */
45
+ readonly rootReplicator: Pick<RootReplicator, "prompt"> | null;
46
+ /** Told `{kind:"oobi"}` when the OOBI is queued and `{kind:"group"}` after a join. */
47
+ readonly changes?: ChangeSink;
48
+ }
49
+ /** What {@link rejoinGroup} needs. */
50
+ export interface RejoinInput {
51
+ /** OOBI of the group, served by a co-member that holds its KEL. */
52
+ oobi: string;
53
+ /** Group prefix. */
54
+ group: string;
55
+ /** The Habery's single-signature habitat that is a member in the group's accepted key state. */
56
+ member: Hab;
57
+ /** Local alias the group record takes. */
58
+ alias: string;
59
+ /** Wait budget on `deps.clock`, from queueing the OOBI to the member lists being readable. */
60
+ timeoutMs: number;
61
+ /** Namespace of the alias; the default namespace when absent. */
62
+ domain?: string;
63
+ }
64
+ /** What a `timed-out` rejoin was still waiting for. */
65
+ export type RejoinWait =
66
+ /** The OOBI had not reached a terminal state. */
67
+ "oobi"
68
+ /** The OOBI is done but the group has no accepted key state here (for example, an event is in escrow). */
69
+ | "group-key-state"
70
+ /** The member is in the group's accepted key state, but not every key of it can be attributed to a local KEL. */
71
+ | "member-key-state";
72
+ /**
73
+ * Outcome of {@link rejoinGroup}:
74
+ * - `joined`: the record names `member`; `smids` and `rmids` are the accepted members recorded (on a repeat,
75
+ * the members already recorded). `written` is true when this call wrote the record and false when it found the
76
+ * record already there. A written record means this identifier was already a member and this store had no record
77
+ * of the group, so the store holds none of the group's credentials either: the embedder's signal to refill them
78
+ * from a co-member.
79
+ * - `not-member`: `member` is in neither the signing nor the rotation members of the accepted state.
80
+ * - `oobi-failed`: the OOBI failed and the group has no accepted key state here; `reason` is the Oobiery's.
81
+ * - `timed-out`: the budget expired; `waiting` says on what.
82
+ *
83
+ * Only `joined` writes a habitat record.
84
+ */
85
+ export type RejoinResult = {
86
+ outcome: "joined";
87
+ group: string;
88
+ alias: string;
89
+ smids: readonly string[];
90
+ rmids: readonly string[];
91
+ written: boolean;
92
+ } | {
93
+ outcome: "not-member";
94
+ group: string;
95
+ member: string;
96
+ } | {
97
+ outcome: "oobi-failed";
98
+ group: string;
99
+ reason: string;
100
+ } | {
101
+ outcome: "timed-out";
102
+ group: string;
103
+ timeoutMs: number;
104
+ waiting: RejoinWait;
105
+ };
106
+ /**
107
+ * Resolve `input.oobi`, wait for the group's accepted key state, and record the group with `input.member` as
108
+ * its local member, using the accepted members. Then the mailbox poller, the KEL publisher and the root
109
+ * replicator are prompted for the group, so each acts for it on its next tock. Creates no event and signs
110
+ * nothing. Observe-only: the host must already run the runtime's workers (see `workflow-contract.ts`).
111
+ *
112
+ * A record that already names `member` returns `joined` at once with `written: false`, with no OOBI and no write.
113
+ *
114
+ * @throws ValidationError for misuse: `member` is not a local single-signature habitat, `group` is a local
115
+ * single-signature habitat, the group already has a local record naming a different member (use
116
+ * `replaceGroupMember`), or `alias` is bound to another prefix.
117
+ */
118
+ export declare function rejoinGroup(deps: RejoinDeps, input: RejoinInput): Operation<RejoinResult>;
119
+ //# sourceMappingURL=rejoin-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rejoin-group.d.ts","sourceRoot":"","sources":["../../../src/app/multisig/rejoin-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,M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ACZ,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,uDAAuD;AACvD,MAAM,MAAM,UAAU;AACpB,iDAAiD;AAC/C,MAAM;AACR,0GAA0G;GACxG,iBAAiB;AACnB,iHAAiH;GAC/G,kBAAkB,CAAC;AAEvB;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,GACpB;IACA,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAClB,GACC;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AASpF;;;;;;;;;;;GAWG;AACH,wBAAiB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC,YAAY,CAAC,CA0B1F"}
@@ -1,4 +1,5 @@
1
1
  import type { Hab } from "../identity/habbing.js";
2
+ import { type RetiredIdentifier } from "../identity/retire-identifier.js";
2
3
  import type { AgentRuntime } from "../runtime/agent-runtime.js";
3
4
  /** What {@link replaceGroupMember} needs. */
4
5
  export interface ReplaceGroupMemberInput {
@@ -10,7 +11,17 @@ export interface ReplaceGroupMemberInput {
10
11
  smids: readonly string[];
11
12
  /** The group's accepted rotation members; defaults to `smids`. */
12
13
  rmids?: readonly string[];
14
+ /** Keep the previous member as a local identifier instead of retiring it. Default false. */
15
+ keepPrevious?: boolean;
13
16
  }
17
+ /** What became of the previous member: retired, or kept as a local identifier with the reason. */
18
+ export type PreviousMemberOutcome = {
19
+ kind: "retired";
20
+ retired: RetiredIdentifier;
21
+ } | {
22
+ kind: "kept";
23
+ reason: string;
24
+ };
14
25
  /** What {@link replaceGroupMember} did. */
15
26
  export interface ReplacedGroupMember {
16
27
  /** The member the record named before. */
@@ -19,9 +30,12 @@ export interface ReplacedGroupMember {
19
30
  issuance: string[];
20
31
  /** Grants of the Unblind operations ended. */
21
32
  unblinding: string[];
33
+ /** Whether the previous member was retired, and why not when it was kept. */
34
+ previousMember: PreviousMemberOutcome;
22
35
  }
23
36
  /**
24
- * Replace the local member of `input.group`, then end live operations bound to the previous one.
37
+ * Replace the local member of `input.group`, end live operations bound to the previous one, then retire the
38
+ * previous one unless it is kept (see the module doc).
25
39
  *
26
40
  * @throws ValidationError when `joinGroupHab` refuses: the group has no accepted state, the previous member is
27
41
  * still a member of it, or the new one is not.
@@ -1 +1 @@
1
- {"version":3,"file":"replace-member.d.ts","sourceRoot":"","sources":["../../../src/app/multisig/replace-member.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,6CAA6C;AAC7C,MAAM,WAAW,uBAAuB;IACtC,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,4GAA4G;IAC5G,MAAM,EAAE,GAAG,CAAC;IACZ,0EAA0E;IAC1E,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,kEAAkE;IAClE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B;AAED,2CAA2C;AAC3C,MAAM,WAAW,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AC;IACrB,6EAA6E;IAC7E,cAAc,EAAE,qBAAqB,CAAC;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,uBAAuB,GAAG,mBAAmB,CAe7G"}
@@ -32,6 +32,8 @@ export interface ExchangerLike {
32
32
  mailboxAid?: string | null;
33
33
  /** Receiver-observed time supplied by local intake, independent of signed wire. */
34
34
  receiverTime?: string;
35
+ /** Retained history from a finite local import, admitted without KRAM (`DispatchOptions.retained`). */
36
+ retained?: boolean;
35
37
  }): Operation<void | ExchangeDecision>;
36
38
  }
37
39
  export interface TelDispatchArgs {
@@ -120,13 +122,30 @@ export interface DispatchResult {
120
122
  * @param messageKevery Authoritative shared message-policy/KRAM processor when distinct from input Kevery.
121
123
  * @param registry V2 registry intake over accepted public KEL state, without requiring a local alias.
122
124
  * @param qvy Optional auxiliary query owner; receives full evidence after v2 message admission.
125
+ * @param retained Whether this is retained history from a finite local import (`DispatchOptions.retained`): a v2
126
+ * `exn`/`xip` then skips KRAM intake and reaches the Exchanger marked retained. Network intake never sets it.
123
127
  * @returns The processed envelope and protocol-specific decision data.
124
128
  * @throws Unsupported input and infrastructure/handler failures follow their owning processor contracts.
125
129
  */
126
130
  export declare function dispatchEnvelope(envelope: KeriDispatchEnvelope, revery: Revery, kevery: Kevery, exchanger?: ExchangerLike, tevery?: Tevery, verifier?: Verifier, mailboxAid?: string | null,
127
131
  /** Long-lived v2 message policy/KRAM owner; input-specific Kevery handles KEL and legacy traffic. */
128
- messageKevery?: Kevery, registry?: RegistryObserver, qvy?: AuxiliaryQueryProcessor): Operation<DispatchResult>;
129
- /** Project one complete frame for message routing without an intermediate event array. */
132
+ messageKevery?: Kevery, registry?: RegistryObserver, qvy?: AuxiliaryQueryProcessor, retained?: boolean): Operation<DispatchResult>;
133
+ /**
134
+ * Whether a frame carries nested messages that no completed consumer owns.
135
+ *
136
+ * Only supported exchange routes, IPEX disclosure `xip`s and the v2 Unblind query retain parent-owned children; any
137
+ * other frame with children is unsupported input. A remote frame is refused as one invalid message
138
+ * (`ProtocolProcessor.dispatch`); {@link envelopeFromFrame} refuses it with a `ValidationError`.
139
+ */
140
+ export declare function hasUnsupportedNests(message: CesrFrame): boolean;
141
+ /**
142
+ * Project one complete frame for message routing without an intermediate event array.
143
+ *
144
+ * Only completed consumers may retain parent-owned children through normalization. A frame with children no consumer
145
+ * owns is usually a remote child nested inside a parent (a BUP inside an Unblind query, an event inside a multisig or
146
+ * IPEX exchange): it is refused with a `ValidationError`, which the parent's processor reports as its own typed
147
+ * refusal (an invalid-message drop, a rejected escrow row), never a fault that ends the runtime.
148
+ */
130
149
  export declare function envelopeFromFrame(message: CesrFrame, local?: boolean): KeriDispatchEnvelope;
131
150
  /** Own an auxiliary query's normalized full proof and public nested evidence beyond synchronous intake. */
132
151
  export declare function copyAuxiliaryQuery(envelope: KeriDispatchEnvelope): KeriDispatchEnvelope;
@@ -1 +1 @@
1
- {"version":3,"file":"parsering.d.ts","sourceRoot":"","sources":["../../../src/app/protocol/parsering.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,UAAU,EACV,UAAU,EACV,KAAK,SAAS,EACd,KAAK,EAKL,SAAS,EAUT,QAAQ,EAER,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,EAEL,MAAM,EACN,SAAS,EAGT,KAAK,UAAU,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACxE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EAAE,SAAS,GAAG,OAAO,CAQ/D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,EAClB,KAAK,UAAQ,GACZ,oBAAoB,CAqBtB;AAED,2GAA2G;AAC3G,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,oBAAoB,CA0CvF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,QAAQ,GAAE,SAAS,UAAU,EAAO,GAAG,UAAU,CAenH;AAED,kEAAkE;AAClE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,UAAQ,GAAG,oBAAoB,CAM3F;AAED,yFAAyF;AACzF,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,oBAAoB,GAC7B,aAAa,CAcf"}
@@ -19,8 +19,8 @@ import { type AuxiliaryQueryProcessor, type DispatchResult } from "./parsering.j
19
19
  * which runs one full pass per cycle. A pass is never skipped or shortened; this is the time others get between passes.
20
20
  */
21
21
  export declare const ESCROW_TOCK_MS = 31.25;
22
- /** Protocol choices for a frame; input owners separately own cancellation and parsing. */
23
- export interface DispatchOptions {
22
+ /** Protocol choices any input may make for a frame; input owners separately own cancellation and parsing. */
23
+ export interface IntakeOptions {
24
24
  /** Whether the frame arrived through local witness/controller intake. */
25
25
  local?: boolean;
26
26
  /** Hosted mailbox endpoint provenance, independent of the signed sender. */
@@ -28,6 +28,19 @@ export interface DispatchOptions {
28
28
  /** Advance durable escrows after capturing this frame's decision and direct replies. */
29
29
  escrows?: boolean;
30
30
  }
31
+ /** Intake choices plus `retained`, which only a finite, caller-initiated local import sets. */
32
+ export interface DispatchOptions extends IntakeOptions {
33
+ /**
34
+ * The frame is retained history the caller already holds, read back from a store (an exported disclosure stream),
35
+ * not a message arriving now. A v2 `exn`/`xip` then skips KRAM intake: its original stamp is long past the
36
+ * receiver's window by design, and KRAM's replay protection guards live intake, not a local copy of accepted
37
+ * history. Nothing else is relaxed: sender policy still applies, the Exchanger still authenticates every signature
38
+ * against the sender's key state and runs the route's verify, escrows behave as usual, and queries and replies
39
+ * still pass KRAM. The Exchanger keeps the fact (see `ExchangeInput.retained`). Network inputs (HTTP, TCP, mailbox,
40
+ * witness ingress, the Reactor) take {@link IntakeOptions}, which cannot carry it.
41
+ */
42
+ retained?: boolean;
43
+ }
31
44
  /** Exact processed evidence and mailbox authorization captured at the query decision. */
32
45
  export interface ProtocolDispatchResult extends DispatchResult {
33
46
  /** Current request authorization, never inferred solely from a matching reply SAID. */
@@ -62,6 +75,8 @@ export declare class ProtocolProcessor {
62
75
  /** Shared live request correlations; each requesting connection owns its slots. */
63
76
  readonly replies: QueryReplies;
64
77
  readonly qvy?: AuxiliaryQueryProcessor | undefined;
78
+ /** Relaying host: served senders' queries about remote subjects refresh this host's own view of them. */
79
+ readonly relaying: boolean;
65
80
  /**
66
81
  * Bind long-lived semantic owners and register their reply routes exactly once.
67
82
  *
@@ -75,6 +90,8 @@ export declare class ProtocolProcessor {
75
90
  * @param cues Application output Deck consumed by the composed cue router.
76
91
  * @param replies Shared live request correlations captured before application publication.
77
92
  * @param qvy Optional caller-owned auxiliary query receiver; owns its authorization and lifecycle.
93
+ * @param relaying Whether this domain is a relaying host's (the agent side of relay mode): a served sender's query
94
+ * about a remote subject then also publishes the host's own refresh query cue (see `relayRefreshCue`).
78
95
  * @throws TypeError for inconsistent stores or cue bindings.
79
96
  */
80
97
  constructor(
@@ -95,7 +112,9 @@ export declare class ProtocolProcessor {
95
112
  /** Ordinary application cues; the composed cue router is the consumer. */
96
113
  cues: Deck<AgentCue>,
97
114
  /** Shared live request correlations; each requesting connection owns its slots. */
98
- replies: QueryReplies, qvy?: AuxiliaryQueryProcessor | undefined);
115
+ replies: QueryReplies, qvy?: AuxiliaryQueryProcessor | undefined,
116
+ /** Relaying host: served senders' queries about remote subjects refresh this host's own view of them. */
117
+ relaying?: boolean);
99
118
  /**
100
119
  * Construct an input-owned Kevery with identical store, policy and cue bindings; register no routes.
101
120
  *
@@ -106,14 +125,15 @@ export declare class ProtocolProcessor {
106
125
  * Process one frame and publish its committed protocol cues before returning decision data.
107
126
  *
108
127
  * @param frame Complete hydrated frame whose evidence remains valid for this operation.
109
- * @param options Local intake policy, hosted mailbox provenance and whether to advance escrows.
128
+ * @param options Local intake policy, hosted mailbox provenance, whether to advance escrows, and whether the frame is
129
+ * retained history from a finite local import.
110
130
  * @param kvy Input-specific Kevery in this domain; defaults to the shared owner.
111
131
  * @returns Exact dispatch result and current mailbox authorization at its synchronous query decision.
112
132
  * A message refused by validation after extraction is an `invalidMessage` drop, so the caller
113
133
  * continues with the next frame as KERIpy's parser does.
114
134
  * @throws Domain mismatch, infrastructure/handler or cleanup errors propagate; publication still runs in the dispatch finalizer.
115
135
  */
116
- dispatch(frame: CesrFrame, { local, mailboxAid, escrows }?: DispatchOptions, kvy?: Kevery): Operation<ProtocolDispatchResult>;
136
+ dispatch(frame: CesrFrame, { local, mailboxAid, escrows, retained }?: DispatchOptions, kvy?: Kevery): Operation<ProtocolDispatchResult>;
117
137
  /** Capture direct replies before handing ordinary protocol records to the application consumer. */
118
138
  private publishCues;
119
139
  /** Advance configured escrow owners; each scan joins its own I/O and handler cleanup. */
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-processing.d.ts","sourceRoot":"","sources":["../../../src/app/protocol/protocol-processing.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAA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wF;IAC/E,GAAG,EAAE,SAAS;IACvB,uFAAuF;IAC9E,GAAG,EAAE,MAAM,GAAG,IAAI;IAC3B,sEAAsE;IAC7D,GAAG,EAAE,QAAQ,GAAG,IAAI;IAC7B,6EAA6E;IACpE,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAC1C,sFAAsF;IACrE,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC;IAC7C,0EAA0E;IACjE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC;IAC7B,mFAAmF;IAC1E,OAAO,EAAE,YAAY,EACrB,GAAG,CAAC,EAAE,uBAAuB,YAAA;IACtC,yGAAyG;IAChG,QAAQ,GAAE,OAAe;IAapC;;;;OAIG;IACH,UAAU,IAAI,MAAM;IAWpB;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,KAAK,EAAE,SAAS,EAChB,EAAE,KAAsB,EAAE,UAAU,EAAE,OAAe,EAAE,QAAgB,EAAE,GAAE,eAAoB,EAC/F,GAAG,GAAE,MAAiB,GACrB,SAAS,CAAC,sBAAsB,CAAC;IAiDpC,mGAAmG;IACnG,OAAO,CAAC,WAAW;IAKnB,yFAAyF;IACxF,kBAAkB,IAAI,SAAS,CAAC,IAAI,CAAC;IAQtC;;;;;;OAMG;IACH,0BAA0B,IAAI,IAAI;IAQlC,0FAA0F;IAC1F,OAAO,CAAC,sBAAsB;IAK9B,qFAAqF;IACrF,OAAO,CAAE,cAAc;IAUvB;;;;;;;;;;OAUG;IACF,QAAQ,CAAC,KAAK,GAAE,YAA0B,EAAE,MAAM,GAAE,QAAQ,CAAC,UAAU,CAAmB,GAAG,SAAS,CAAC,KAAK,CAAC;CAW/G;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAMtE"}
@@ -10,15 +10,11 @@ interface QueryReplyBatch {
10
10
  */
11
11
  readonly cues: readonly DirectReply[];
12
12
  }
13
- /** A request correlation slot; close it when its HTTP/TCP request completes or is cancelled. */
13
+ /**
14
+ * A request correlation slot; close it when its HTTP/TCP request completes or is cancelled.
15
+ * A request that waits for its reply reads `ready` on its own loop; the slot tells nobody.
16
+ */
14
17
  export interface QueryReply {
15
- /**
16
- * Observe this existing slot without queues or retained Promise waiters; one observer at a time.
17
- *
18
- * @param notify Synchronous wake-up callback, including already-ready/closed state.
19
- * @returns Unsubscribe function; cancellation must call it.
20
- */
21
- observeReady(notify: () => void): () => void;
22
18
  /** Whether a captured batch is available for request-owned consumption. */
23
19
  readonly ready: boolean;
24
20
  /** Take the receipt/witness or ordered TSN pair. */
@@ -1 +1 @@
1
- {"version":3,"file":"query-replies.d.ts","sourceRoot":"","sources":["../../../src/app/queries/query-replies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,yFAAyF;AACzF,KAAK,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAelE,wDAAwD;AACxD,UAAU,eAAe;IACvB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;CACvC;AAED,gGAAgG;AAChG,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC7C,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,oDAAoD;IACpD,OAAO,IAAI,eAAe,GAAG,SAAS,CAAC;IACvC,kFAAkF;IAClF,OAAO,IAAI,eAAe,GAAG,SAAS,CAAC;IACvC,wFAAwF;IACxF,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;;;GAMG;AACH,qBAAa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;IAQX,OAAO,CAAC,QAAQ,CAAC,SAAS;IAPtC,8FAA8F;IAC9F,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;IACvD;;;;OAIG;gBAC0B,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;IAEtD;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAIjC;;;;;;OAMG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU;IAInD;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IA6ClB;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI;CAyBtC"}
@@ -0,0 +1,26 @@
1
+ import type { QueryCue } from "../../core/cues.js";
2
+ import type { Habery } from "../identity/habbing.js";
3
+ import { type DispatchResult } from "../protocol/parsering.js";
4
+ /**
5
+ * Decide whether one processed query makes a relaying host refresh its view of the subject, and return the query cue
6
+ * that does it.
7
+ *
8
+ * Every condition must hold:
9
+ * - the message is a remote (not local) `logs` or `ksn` query the KEL owner accepted or escrowed;
10
+ * - its subject `q.i` is not a prefix of this Habery;
11
+ * - its requester is authenticated (see {@link authenticatedRequester}) and served by a local host under the shared
12
+ * `servingHost` rule (an accepted mailbox or agent end role naming the host);
13
+ * - the host can address an attester for the subject now ({@link addressableAttesters}: one with an accepted
14
+ * location), so the request is sent on the querier's next pass instead of waiting in its queue.
15
+ *
16
+ * The cue is `{ route: "logs", q: {} }` for the subject, signed by the serving host: one full replay from the
17
+ * attester covers both routes, since `ksn` is answered from the same key state. A `tels` query is not refreshed:
18
+ * its wire body names the registry and credential but not the issuer the querier selects attesters by.
19
+ *
20
+ * @param hby Borrowed habitats and accepted-state store of the relaying host.
21
+ * @param result Processed envelope and the decision its owner made.
22
+ * @param mailboxAid Receiving hosted endpoint AID, or null when the request named none.
23
+ * @returns The refresh query cue, or null when this query refreshes nothing.
24
+ */
25
+ export declare function relayRefreshCue(hby: Habery, result: DispatchResult, mailboxAid: string | null): QueryCue | null;
26
+ //# sourceMappingURL=relay-refresh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-refresh.d.ts","sourceRoot":"","sources":["../../../src/app/queries/relay-refresh.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,KAAK,cAAc,EAA6B,MAAM,0BAA0B,CAAC;AAuB1F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,CAa/G"}
@@ -1,10 +1,26 @@
1
1
  import { type Operation } from "effection";
2
2
  import type { QueryCue, QueryRequest } from "../../core/cues.js";
3
3
  import { Deck } from "../../core/deck.js";
4
+ import { type Relay } from "../delivery/relaying.js";
4
5
  import type { Hab, Habery } from "../identity/habbing.js";
5
6
  import type { ProtocolProcessor } from "../protocol/protocol-processing.js";
6
7
  import type { RuntimeClock } from "../runtime/runtime-clock.js";
7
- import type { HttpClient } from "../transport/http-client.js";
8
+ import { type HttpClient } from "../transport/http-client.js";
9
+ /**
10
+ * Delivery passes an ordinary request may rotate with a ready signer but no reachable attester before it is dropped:
11
+ * about five minutes at the protocol tock. Any remote party can cause such requests (every unverified reply signed by
12
+ * an unknown prefix yields a `query` cue), so without a bound they would rotate in the queue forever.
13
+ */
14
+ export declare const UNADDRESSED_QUERY_PASS_LIMIT = 9600;
15
+ /**
16
+ * The attesters of an ordinary query for `pre` that can be sent to now: those {@link queryAttesters} selects that also
17
+ * have an accepted location.
18
+ *
19
+ * @param hab Local habitat whose accepted-state store is read.
20
+ * @param pre Subject AID whose accepted endpoint roles and locations are consulted.
21
+ * @returns Addressable attester AIDs of the first eligible role; empty when none can be reached now.
22
+ */
23
+ export declare function addressableAttesters(hab: Hab, pre: string): string[];
8
24
  /**
9
25
  * KERIpy-shaped query sender, independent from semantic query completion.
10
26
  *
@@ -43,6 +59,8 @@ export declare class WitnessInquisitor {
43
59
  private closed;
44
60
  /** Explicit default signer; null requires a unique local habitat. */
45
61
  private hab;
62
+ /** The agent every query is addressed and sent to (an edge); null selects ordinary attesters. */
63
+ readonly relay: Relay | null;
46
64
  /**
47
65
  * Bind actual protocol and I/O collaborators; acquire no store or network lifetime.
48
66
  *
@@ -50,9 +68,10 @@ export declare class WitnessInquisitor {
50
68
  * @param protocol Borrowed same-database processor for incoming query replies.
51
69
  * @param http Borrowed HTTP implementation selected by composition.
52
70
  * @param clock Borrowed clock for transport deadlines; times are milliseconds.
71
+ * @param relay The agent every query goes to; null selects attesters from accepted endpoint roles.
53
72
  * @param hab Optional default local signer; null requires an unambiguous sole habitat.
54
73
  */
55
- constructor(hby: Habery, protocol: ProtocolProcessor, http: HttpClient, clock: RuntimeClock, hab?: Hab | null);
74
+ constructor(hby: Habery, protocol: ProtocolProcessor, http: HttpClient, clock: RuntimeClock, relay: Relay | null, hab?: Hab | null);
56
75
  /**
57
76
  * Select the local habitat used when queued requests have no explicit signer.
58
77
  *
@@ -61,6 +80,10 @@ export declare class WitnessInquisitor {
61
80
  configure({ hab }?: {
62
81
  hab?: Hab | null;
63
82
  }): void;
83
+ /** The explicitly configured default signer, or null when the sole local habitat is used. */
84
+ get defaultSigner(): string | null;
85
+ /** Whether a queued request names `signer` as its explicit signer. */
86
+ hasRequestsSignedBy(signer: string): boolean;
64
87
  /** Deferred instructions and active sends are this sender's only pending work. */
65
88
  hasPendingWork(): boolean;
66
89
  /**
@@ -77,6 +100,16 @@ export declare class WitnessInquisitor {
77
100
  * @param hab Optional local signer hint when the cue has no explicit signer.
78
101
  */
79
102
  enqueueCue(cue: QueryCue, hab?: Hab | null): void;
103
+ /**
104
+ * Admit a routed query cue unless an identical request is already queued: same subject, route, filters, signer,
105
+ * attester and witness overrides, with the signer resolved as {@link enqueueCue} resolves it. A relaying host's cue
106
+ * router uses this, so the queries of the many edges it serves about one subject leave one request queued; a request
107
+ * already taken for delivery is no longer queued, so a later cue queues the next one.
108
+ *
109
+ * @param cue Typed query cue; missing route/subject produces no request.
110
+ * @param hab Optional local signer hint when the cue has no explicit signer.
111
+ */
112
+ enqueueCueOnce(cue: QueryCue, hab?: Hab | null): void;
80
113
  /** Include actual query I/O in convergence; pending instructions have their own queue. */
81
114
  get hasPendingDelivery(): boolean;
82
115
  /**
@@ -131,12 +164,30 @@ export declare class WitnessInquisitor {
131
164
  * Resolve/sign one selected query and introduction immediately before its attempt.
132
165
  *
133
166
  * @param request Deferred unsigned request; nested query values must remain immutable.
134
- * @returns Prepared packet, or null when signer/attester evidence is unresolved.
135
- * @throws A selected attester with no endpoint URL throws; source removal remains with the caller.
167
+ * The attester is chosen at random among the eligible ones (the explicit `src`, the `wits` overrides, or the first
168
+ * eligible endpoint role) that have an accepted location. An attester without one is never promoted to another
169
+ * role; when none of the eligible attesters can be reached the request is unresolved, like a signer that cannot sign
170
+ * yet, so no endpoint condition ends the delivery loop or fails a caller's pass.
171
+ *
172
+ * @param request Deferred unsigned request; nested query values must remain immutable.
173
+ * @returns Prepared packet, or null when signer/attester evidence is unresolved, no eligible attester has an
174
+ * accepted location, or the signer cannot sign yet.
136
175
  */
137
176
  private prepareRequest;
138
177
  /**
139
- * Return the first eligible role’s attester IDs; preparation chooses one randomly.
178
+ * Address one query to the relay and sign it for the relay's location. The relay must have an accepted location
179
+ * and the signer must have authorized it as mailbox (where the answer is stored); until then the request stays
180
+ * unresolved and is tried again on a later pass, as for a signer that cannot sign yet.
181
+ *
182
+ * @param hab Local signing habitat.
183
+ * @param request Deferred unsigned request; its `src` and `wits` are not consulted.
184
+ * @param relay The configured relay agent, which is the attester.
185
+ * @returns Prepared packet for the relay, or null while {@link relayRefusal} refuses the relay for this signer.
186
+ */
187
+ private prepareRelayRequest;
188
+ /**
189
+ * Return the first eligible role’s attester IDs; preparation chooses one randomly. With a relay, the relay is the
190
+ * only attester.
140
191
  *
141
192
  * @param pre Subject AID whose accepted endpoint roles are consulted.
142
193
  * @param options Optional local signer AID and remote witness/attester overrides; neither selects a transport implementation.
@@ -1 +1 @@
1
- {"version":3,"file":"witness-inquisitor.d.ts","sourceRoot":"","sources":["../../../src/app/queries/witness-inquisitor.ts"],"names":[],"mappings":"AAWA,OAAO,EAAQ,KAAK,SAAS,EAAY,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAoB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AA+F9D;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB;IAC5B,wDAAwD;IACxD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,mEAAmE;IACnE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,oDAAoD;IACpD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,gEAAgE;IAChE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,sDAAsD;IACtD,OAAO,CAAC,UAAU,CAAS;IAC3B,sDAAsD;IACtD,OAAO,CAAC,MAAM,CAAC,CAAkB;IACjC,2EAA2E;IAC3E,OAAO,CAAC,YAAY,CAAC,CAAgB;IACrC,yEAAyE;IACzE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;IACrD,+EAA+E;IAC/E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ACF,WAAW,IAAI,SAAS,CAAC,IAAI,CAAC;IAK/B;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAkDpB;;;;;;;OAOG;IACH,OAAO,CAAE,gBAAgB;IAmBzB;;;;OAIG;IACF,KAAK,IAAI,SAAS,CAAC,IAAI,CAAC;IAOzB;;;;;OAKG;IACF,SAAS,CAAC,MAAM,GAAE,MAAyB,GAAG,SAAS,CAAC,KAAK,CAAC;IAW/D;;;;;;;;;;OAUG;IACH,OAAO,CAAC,aAAa;IAIrB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,cAAc;IAuBtB;;;;;;;;;OASG;IACH,OAAO,CAAC,mBAAmB;IAO3B;;;;;;;OAOG;IACH,YAAY,CACV,GAAG,EAAE,MAAM,EACX,EAAE,MAAM,EAAE,IAAI,EAAE,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAAO,GAC1D,MAAM,EAAE;CASZ"}
@@ -15,6 +15,7 @@ import { Authenticator } from "../bootstrap/authenticating.js";
15
15
  import { Oobiery, type OobiJob } from "../bootstrap/oobiery.js";
16
16
  import type { RootReplicator } from "../credentials/root-replicator.js";
17
17
  import { Poster } from "../delivery/forwarding.js";
18
+ import { type Relay } from "../delivery/relaying.js";
18
19
  import { ReplyStreams } from "../delivery/reply-streams.js";
19
20
  import { Respondant } from "../delivery/respondant.js";
20
21
  import { Exchanger } from "../exchanges/exchanging.js";
@@ -37,7 +38,7 @@ import { IpexAuxiliaries } from "./ipex-auxiliaries.js";
37
38
  import { type OperationStores, type RuntimeOperations } from "./operation-owners.js";
38
39
  import type { RetryPolicy } from "./retry-backoff.js";
39
40
  import type { RuntimeClock } from "./runtime-clock.js";
40
- import { SignerConditions } from "./signer-conditions.js";
41
+ import { type ChangeSink } from "./workflow-contract.js";
41
42
  export type { KeriDispatchEnvelope, OobiJob, TransIdxSigGroup };
42
43
  /**
43
44
  * Shared runtime composition root owned by one `Habery`.
@@ -59,6 +60,11 @@ export interface AgentRuntime {
59
60
  hby: Habery;
60
61
  /** Provider mailbox store, borrowed when injected and otherwise owned when enabled. */
61
62
  mailboxer: Mailboxer | null;
63
+ /**
64
+ * Whether this runtime relays for served senders (the agent side of relay mode, `AgentRuntimeOptions.relaying`).
65
+ * A host reads it to serve the OOBI of any identifier whose KEL it holds, the edge's replay source.
66
+ */
67
+ readonly relaying: boolean;
62
68
  /** Persistent notice store; ownership follows explicit injection. */
63
69
  noter: Noter | null;
64
70
  /** Configured notice producer, sharing the composed signer and signaler. */
@@ -67,6 +73,8 @@ export interface AgentRuntime {
67
73
  signaler: Signaler | null;
68
74
  /** Ordinary protocol facts, consumed by the composed cue workers. */
69
75
  cues: Deck<AgentCue>;
76
+ /** Where the cue worker publishes `kramRefused` cues: the injected operation sink, else the Signaler's; null with neither. */
77
+ readonly changes: ChangeSink | null;
70
78
  /** Demand-driven input lifetime; protocol decisions stay with ProtocolProcessor. */
71
79
  reactor: Reactor;
72
80
  /** Shared protocol mutations, publication and background escrow processing. */
@@ -111,8 +119,6 @@ export interface AgentRuntime {
111
119
  counselor: Counselor;
112
120
  /** Tells an identifier's mailboxes its KEL after a rotation; `runAgentRuntime` runs its fiber. */
113
121
  kelPublisher: KelPublisher;
114
- /** Loops waiting for a signer the host released; empty when nothing waits. */
115
- signerConditions: SignerConditions;
116
122
  /** Pacing of the owners loop `runAgentRuntime` runs. */
117
123
  readonly ownerPacing: Readonly<DoerPacing>;
118
124
  /** Pacing of the KEL publisher loop `runAgentRuntime` runs. */
@@ -170,6 +176,16 @@ export interface AgentRuntimeOptions {
170
176
  notifier?: Notifier;
171
177
  /** Construct a provider mailbox store. Omitted leaves it absent; injected mailboxer stays borrowed. */
172
178
  enableMailboxStore?: boolean;
179
+ /**
180
+ * Agent side of relay mode: `/fwd` intake delivers the child of a sender that authorized this host as its
181
+ * `mailbox` or `agent`, through this runtime's own ingress to a local habitat and through its Poster to anyone
182
+ * else. Requires a mailbox store, which hosts `/fwd` intake. The `/oobis` handler then resolves an OOBI only
183
+ * for such a sender. A `logs` or `ksn` query from such a sender about a subject that is not local also makes
184
+ * this runtime query the subject's own endpoints for it (`relayRefreshCue`), and the cue router queues no
185
+ * query identical to one already queued. Omitted or false keeps store-only intake, accepts `/oobis` from any
186
+ * sender and never refreshes.
187
+ */
188
+ relaying?: boolean;
173
189
  /**
174
190
  * Header and poll-window overrides, in milliseconds, for this runtime's mailbox poller. Omitted values keep
175
191
  * the poller defaults; a short `maxPollDurationMs` makes polls turn over quickly for an embedder or test.
@@ -221,6 +237,16 @@ export interface AgentRuntimeOptions {
221
237
  * `"closed"` refuses any Grant missing a far node. Neither mode escrows.
222
238
  */
223
239
  grantWalk?: AcdcWalkPolicy;
240
+ /**
241
+ * The agent this runtime sends, queries and polls through, which makes it an edge. Every HTTP and TCP request
242
+ * is refused unless it goes to the relay's OOBI origin or an accepted relay location. Poster forwards every
243
+ * message to the relay, every query is addressed to the relay, and the relay is the only mailbox polled. Each
244
+ * needs a mailbox end role naming the relay: from the wrapper or query signer (a group's local member) to send,
245
+ * and from the polled subject (a group itself) to poll. The Oobiery fetches only the relay's origin: it asks the
246
+ * relay to resolve any other OOBI and reads the result from the relay's OOBI endpoint. The relay's OOBI
247
+ * is queued when its location is not yet accepted. Omitted, the runtime is a forwarder and delivers directly.
248
+ */
249
+ relay?: Relay;
224
250
  }
225
251
  /** Summary of pending runtime-backed durable work for bounded command hosts. */
226
252
  export interface RuntimePendingState {
@@ -391,6 +417,11 @@ export { runtimeTurn } from "./runtime-turn.js";
391
417
  * delegation and ordinary query sending. The finalizer halts children in reverse
392
418
  * order; store ownership remains with the composition scope.
393
419
  *
420
+ * Each loop is a plain spawned fixed-tock doer. A loop that signs for a local habitat reads `Hab.canSign()` on its
421
+ * tock and skips a habitat that cannot sign yet (a store opened without its signer); a later `Manager.hold` lets
422
+ * that habitat act on the next tock. A `SignerNotHeldError` that still escapes a loop is a fault: the loop ends
423
+ * and the failure ends this operation.
424
+ *
394
425
  * @param runtime Borrowed composed runtime; caller owns its worker and store lifetime.
395
426
  * @param options Optional default query/cue signer, remote pollMailbox switch
396
427
  * (default true) and command-owned queryCues Deck. Wire queryCues before starting