@superbee/core 0.2.0-pre.17 → 0.2.0-pre.19

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 (202) hide show
  1. package/README.md +515 -1
  2. package/dist/blob-journal.d.ts +187 -2
  3. package/dist/blob-journal.d.ts.map +1 -1
  4. package/dist/blob-journal.js +377 -5
  5. package/dist/blob-journal.js.map +1 -1
  6. package/dist/body-replace-guards.d.ts +50 -0
  7. package/dist/body-replace-guards.d.ts.map +1 -0
  8. package/dist/body-replace-guards.js +158 -0
  9. package/dist/body-replace-guards.js.map +1 -0
  10. package/dist/builtin-recipes/content.d.ts +93 -0
  11. package/dist/builtin-recipes/content.d.ts.map +1 -0
  12. package/dist/builtin-recipes/content.js +288 -0
  13. package/dist/builtin-recipes/content.js.map +1 -0
  14. package/dist/builtin-recipes.d.ts +10 -0
  15. package/dist/builtin-recipes.d.ts.map +1 -0
  16. package/dist/builtin-recipes.js +97 -0
  17. package/dist/builtin-recipes.js.map +1 -0
  18. package/dist/code-point-order.d.ts +8 -0
  19. package/dist/code-point-order.d.ts.map +1 -0
  20. package/dist/code-point-order.js +20 -0
  21. package/dist/code-point-order.js.map +1 -0
  22. package/dist/connectors.d.ts +223 -0
  23. package/dist/connectors.d.ts.map +1 -0
  24. package/dist/connectors.js +1143 -0
  25. package/dist/connectors.js.map +1 -0
  26. package/dist/document-field-actions.d.ts +18 -0
  27. package/dist/document-field-actions.d.ts.map +1 -1
  28. package/dist/document-field-actions.js +91 -29
  29. package/dist/document-field-actions.js.map +1 -1
  30. package/dist/document-mutation.d.ts +7 -9
  31. package/dist/document-mutation.d.ts.map +1 -1
  32. package/dist/document-mutation.js +16 -16
  33. package/dist/document-mutation.js.map +1 -1
  34. package/dist/file-journaled-backend.d.ts +31 -5
  35. package/dist/file-journaled-backend.d.ts.map +1 -1
  36. package/dist/file-journaled-backend.js +131 -118
  37. package/dist/file-journaled-backend.js.map +1 -1
  38. package/dist/hosted-client/blob-delivery.d.ts +6 -0
  39. package/dist/hosted-client/blob-delivery.d.ts.map +1 -1
  40. package/dist/hosted-client/blob-delivery.js +23 -1
  41. package/dist/hosted-client/blob-delivery.js.map +1 -1
  42. package/dist/hosted-client/blob-write.d.ts +386 -0
  43. package/dist/hosted-client/blob-write.d.ts.map +1 -0
  44. package/dist/hosted-client/blob-write.js +770 -0
  45. package/dist/hosted-client/blob-write.js.map +1 -0
  46. package/dist/hosted-client/client.d.ts +64 -0
  47. package/dist/hosted-client/client.d.ts.map +1 -1
  48. package/dist/hosted-client/client.js +31 -0
  49. package/dist/hosted-client/client.js.map +1 -1
  50. package/dist/hosted-client/directory.d.ts +46 -0
  51. package/dist/hosted-client/directory.d.ts.map +1 -0
  52. package/dist/hosted-client/directory.js +74 -0
  53. package/dist/hosted-client/directory.js.map +1 -0
  54. package/dist/hosted-client/errors.d.ts +10 -0
  55. package/dist/hosted-client/errors.d.ts.map +1 -1
  56. package/dist/hosted-client/errors.js +13 -0
  57. package/dist/hosted-client/errors.js.map +1 -1
  58. package/dist/hosted-client/inbox.d.ts +320 -0
  59. package/dist/hosted-client/inbox.d.ts.map +1 -0
  60. package/dist/hosted-client/inbox.js +379 -0
  61. package/dist/hosted-client/inbox.js.map +1 -0
  62. package/dist/hosted-client/index.d.ts +11 -4
  63. package/dist/hosted-client/index.d.ts.map +1 -1
  64. package/dist/hosted-client/index.js +11 -4
  65. package/dist/hosted-client/index.js.map +1 -1
  66. package/dist/hosted-client/journal.d.ts +103 -0
  67. package/dist/hosted-client/journal.d.ts.map +1 -0
  68. package/dist/hosted-client/journal.js +464 -0
  69. package/dist/hosted-client/journal.js.map +1 -0
  70. package/dist/hosted-client/node.d.ts +5 -1
  71. package/dist/hosted-client/node.d.ts.map +1 -1
  72. package/dist/hosted-client/node.js +6 -1
  73. package/dist/hosted-client/node.js.map +1 -1
  74. package/dist/hosted-client/write.d.ts +18 -1
  75. package/dist/hosted-client/write.d.ts.map +1 -1
  76. package/dist/hosted-client/write.js +24 -7
  77. package/dist/hosted-client/write.js.map +1 -1
  78. package/dist/hosted-transport/carrier.d.ts +10 -0
  79. package/dist/hosted-transport/carrier.d.ts.map +1 -1
  80. package/dist/hosted-transport/carrier.js +22 -2
  81. package/dist/hosted-transport/carrier.js.map +1 -1
  82. package/dist/index.d.ts +4 -1
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +3 -1
  85. package/dist/index.js.map +1 -1
  86. package/dist/kind-authoring.d.ts +170 -0
  87. package/dist/kind-authoring.d.ts.map +1 -0
  88. package/dist/kind-authoring.js +451 -0
  89. package/dist/kind-authoring.js.map +1 -0
  90. package/dist/kind-conformance-error.d.ts +15 -0
  91. package/dist/kind-conformance-error.d.ts.map +1 -0
  92. package/dist/kind-conformance-error.js +20 -0
  93. package/dist/kind-conformance-error.js.map +1 -0
  94. package/dist/kinds.d.ts +2 -0
  95. package/dist/kinds.d.ts.map +1 -1
  96. package/dist/kinds.js +7 -0
  97. package/dist/kinds.js.map +1 -1
  98. package/dist/recipe-lifecycle/stamp.d.ts +11 -0
  99. package/dist/recipe-lifecycle/stamp.d.ts.map +1 -1
  100. package/dist/recipe-lifecycle/stamp.js +6 -0
  101. package/dist/recipe-lifecycle/stamp.js.map +1 -1
  102. package/dist/record-overlay/apply.d.ts.map +1 -1
  103. package/dist/record-overlay/apply.js +52 -15
  104. package/dist/record-overlay/apply.js.map +1 -1
  105. package/dist/record-overlay/canonical.d.ts +8 -0
  106. package/dist/record-overlay/canonical.d.ts.map +1 -1
  107. package/dist/record-overlay/canonical.js +16 -0
  108. package/dist/record-overlay/canonical.js.map +1 -1
  109. package/dist/record-overlay/errors.d.ts +7 -3
  110. package/dist/record-overlay/errors.d.ts.map +1 -1
  111. package/dist/record-overlay/errors.js +7 -3
  112. package/dist/record-overlay/errors.js.map +1 -1
  113. package/dist/record-overlay/plan.d.ts.map +1 -1
  114. package/dist/record-overlay/plan.js +2 -1
  115. package/dist/record-overlay/plan.js.map +1 -1
  116. package/dist/record-overlay/policy.d.ts +10 -1
  117. package/dist/record-overlay/policy.d.ts.map +1 -1
  118. package/dist/record-overlay/policy.js +33 -14
  119. package/dist/record-overlay/policy.js.map +1 -1
  120. package/dist/record-overlay/types.d.ts +5 -0
  121. package/dist/record-overlay/types.d.ts.map +1 -1
  122. package/dist/search/contract.d.ts +151 -0
  123. package/dist/search/contract.d.ts.map +1 -0
  124. package/dist/search/contract.js +78 -0
  125. package/dist/search/contract.js.map +1 -0
  126. package/dist/search/errors.d.ts +30 -0
  127. package/dist/search/errors.d.ts.map +1 -0
  128. package/dist/search/errors.js +50 -0
  129. package/dist/search/errors.js.map +1 -0
  130. package/dist/search/identity.d.ts +12 -0
  131. package/dist/search/identity.d.ts.map +1 -0
  132. package/dist/search/identity.js +90 -0
  133. package/dist/search/identity.js.map +1 -0
  134. package/dist/search/index.d.ts +15 -0
  135. package/dist/search/index.d.ts.map +1 -0
  136. package/dist/search/index.js +14 -0
  137. package/dist/search/index.js.map +1 -0
  138. package/dist/search/memory-source.d.ts +25 -0
  139. package/dist/search/memory-source.d.ts.map +1 -0
  140. package/dist/search/memory-source.js +230 -0
  141. package/dist/search/memory-source.js.map +1 -0
  142. package/dist/search/rank.d.ts +34 -0
  143. package/dist/search/rank.d.ts.map +1 -0
  144. package/dist/search/rank.js +129 -0
  145. package/dist/search/rank.js.map +1 -0
  146. package/dist/search/row-text.d.ts +38 -0
  147. package/dist/search/row-text.d.ts.map +1 -0
  148. package/dist/search/row-text.js +88 -0
  149. package/dist/search/row-text.js.map +1 -0
  150. package/dist/search/search.d.ts +28 -0
  151. package/dist/search/search.d.ts.map +1 -0
  152. package/dist/search/search.js +240 -0
  153. package/dist/search/search.js.map +1 -0
  154. package/dist/search/source.d.ts +67 -0
  155. package/dist/search/source.d.ts.map +1 -0
  156. package/dist/search/source.js +2 -0
  157. package/dist/search/source.js.map +1 -0
  158. package/dist/search/text.d.ts +47 -0
  159. package/dist/search/text.d.ts.map +1 -0
  160. package/dist/search/text.js +148 -0
  161. package/dist/search/text.js.map +1 -0
  162. package/dist/source-engine/guard.d.ts +82 -0
  163. package/dist/source-engine/guard.d.ts.map +1 -0
  164. package/dist/source-engine/guard.js +396 -0
  165. package/dist/source-engine/guard.js.map +1 -0
  166. package/dist/source-engine/index.d.ts +24 -0
  167. package/dist/source-engine/index.d.ts.map +1 -0
  168. package/dist/source-engine/index.js +20 -0
  169. package/dist/source-engine/index.js.map +1 -0
  170. package/dist/source-engine/machine-state.d.ts +74 -0
  171. package/dist/source-engine/machine-state.d.ts.map +1 -0
  172. package/dist/source-engine/machine-state.js +48 -0
  173. package/dist/source-engine/machine-state.js.map +1 -0
  174. package/dist/source-engine/observe.d.ts +18 -0
  175. package/dist/source-engine/observe.d.ts.map +1 -0
  176. package/dist/source-engine/observe.js +598 -0
  177. package/dist/source-engine/observe.js.map +1 -0
  178. package/dist/source-engine/robots.d.ts +53 -0
  179. package/dist/source-engine/robots.d.ts.map +1 -0
  180. package/dist/source-engine/robots.js +158 -0
  181. package/dist/source-engine/robots.js.map +1 -0
  182. package/dist/source-engine/types.d.ts +285 -0
  183. package/dist/source-engine/types.d.ts.map +1 -0
  184. package/dist/source-engine/types.js +2 -0
  185. package/dist/source-engine/types.js.map +1 -0
  186. package/dist/source-harness/conformance.d.ts +16 -0
  187. package/dist/source-harness/conformance.d.ts.map +1 -0
  188. package/dist/source-harness/conformance.js +265 -0
  189. package/dist/source-harness/conformance.js.map +1 -0
  190. package/dist/source-harness/fixture.d.ts +95 -0
  191. package/dist/source-harness/fixture.d.ts.map +1 -0
  192. package/dist/source-harness/fixture.js +261 -0
  193. package/dist/source-harness/fixture.js.map +1 -0
  194. package/dist/source-harness/index.d.ts +22 -0
  195. package/dist/source-harness/index.d.ts.map +1 -0
  196. package/dist/source-harness/index.js +19 -0
  197. package/dist/source-harness/index.js.map +1 -0
  198. package/dist/source-harness/peer.d.ts +74 -0
  199. package/dist/source-harness/peer.d.ts.map +1 -0
  200. package/dist/source-harness/peer.js +106 -0
  201. package/dist/source-harness/peer.js.map +1 -0
  202. package/package.json +25 -1
@@ -0,0 +1,386 @@
1
+ import type { BlobHead } from "../blob-contract.js";
2
+ import { type BlobAdmissionCheck, type BlobDeletionHold, type BlobIntentPatch, type BlobIntentRecord, type BlobJournalGuard, type BlobJournaledBackend, type BlobNotDispatchedCode, type BlobTargetScope } from "../blob-journal.js";
3
+ import { type MetaRecord } from "../journaled-backend.js";
4
+ import type { OperationState, Sleep } from "../uncertain-write.js";
5
+ import type { Version } from "../types.js";
6
+ import { type HostedBlobHeads, type HostedBlobRead, type HostedCapabilities, type HostedCarrier } from "../hosted-transport/index.js";
7
+ import { type HostedBlobDeliveryOutcome } from "./blob-delivery.js";
8
+ import { type HostedWriteContext } from "./write.js";
9
+ /** The journal transaction a premises snapshot is taken for. */
10
+ export type BlobDriveStep = {
11
+ readonly kind: "admit";
12
+ readonly prepared: string;
13
+ } | {
14
+ readonly kind: "claim";
15
+ readonly record: BlobIntentRecord;
16
+ } | {
17
+ readonly kind: "persist";
18
+ readonly record: BlobIntentRecord;
19
+ readonly patch: BlobIntentPatch;
20
+ } | {
21
+ readonly kind: "retire";
22
+ readonly record: BlobIntentRecord;
23
+ } | {
24
+ readonly kind: "forget";
25
+ readonly record: BlobIntentRecord;
26
+ };
27
+ /** One read's guard, and the caller's own metadata changes, for the next transaction on the key. */
28
+ export interface BlobDriveSnapshot {
29
+ readonly guard: BlobJournalGuard;
30
+ readonly meta?: readonly MetaRecord[];
31
+ readonly removeMeta?: readonly string[];
32
+ /** Admission only: the unsettled same-bundle intents on the key this admission stands beside. */
33
+ readonly unsettled?: readonly BlobIntentRecord[];
34
+ }
35
+ /**
36
+ * A caller's own premises, checked in the same transactions as the owner's: `snapshot` reads the
37
+ * key's journal (with any named metadata) and returns that read's guard plus the metadata changes
38
+ * the step commits with it. Without it the owner reads the key's intents alone.
39
+ */
40
+ export interface BlobDrivePremises {
41
+ snapshot(key: string, step: BlobDriveStep): Promise<BlobDriveSnapshot>;
42
+ }
43
+ export interface JournaledBlobContext {
44
+ /** The trusted current target. A record of any other scope is never delivered. */
45
+ readonly scope: BlobTargetScope;
46
+ /** The carrier for `scope`, already qualified by its workspace when it has one. */
47
+ readonly carrier: HostedCarrier;
48
+ /**
49
+ * The bundle's capabilities. Called at most once per drive, and that one answer serves both the
50
+ * owner's checks before a claim and the delivery adapter, so they cannot disagree. A lookup-only
51
+ * drive calls it only through the adapter, where a failure leaves the outcome unknown.
52
+ */
53
+ readonly capabilities: () => Promise<HostedCapabilities>;
54
+ readonly signal?: AbortSignal;
55
+ readonly premises?: BlobDrivePremises;
56
+ readonly delivery?: {
57
+ readonly deadlineMs?: number;
58
+ readonly maxLookups?: number;
59
+ readonly lookupDelayMs?: number;
60
+ readonly sleep?: Sleep;
61
+ };
62
+ }
63
+ /**
64
+ * `admit`: admit `prepared` and submit it once. `settle`: submit a record whose every attempt is
65
+ * proven not applied (a deletion hold needs `acceptDeletes` of at least its count), otherwise look
66
+ * it up. `lookup`: look it up, never submitting.
67
+ */
68
+ export type JournaledBlobMode = {
69
+ readonly start: "admit";
70
+ readonly prepared: string;
71
+ readonly acceptDeletes?: number;
72
+ } | {
73
+ readonly start: "settle";
74
+ readonly acceptDeletes?: number;
75
+ } | {
76
+ readonly start: "lookup";
77
+ };
78
+ export type JournaledBlobResult =
79
+ /** Nothing was journaled: the input fails a check against the capabilities answer. */
80
+ {
81
+ readonly kind: "not-admitted";
82
+ readonly reason: "precondition";
83
+ readonly check: Extract<BlobAdmissionCheck, {
84
+ ok: false;
85
+ }>;
86
+ }
87
+ /** Nothing was journaled: another unsettled intent of the bundle holds the key. */
88
+ | {
89
+ readonly kind: "not-admitted";
90
+ readonly reason: "unsettled";
91
+ readonly unsettled: readonly string[];
92
+ }
93
+ /** Nothing was journaled or sent (admit), or claimed (settle): the host serves no blob writes. */
94
+ | {
95
+ readonly kind: "not-served";
96
+ readonly record?: BlobIntentRecord;
97
+ } | {
98
+ readonly kind: "unrecorded";
99
+ } | {
100
+ readonly kind: "scope-mismatch";
101
+ readonly record: BlobIntentRecord;
102
+ }
103
+ /** A deletion hold awaiting a person's acceptance; nothing was sent. */
104
+ | {
105
+ readonly kind: "held";
106
+ readonly record: BlobIntentRecord;
107
+ readonly hold: BlobDeletionHold;
108
+ }
109
+ /** A lookup of a record never sent, or proven not applied: nothing to ask the host. */
110
+ | {
111
+ readonly kind: "unsent";
112
+ readonly record: BlobIntentRecord;
113
+ }
114
+ /** A resendable record fails a check against the current capabilities; it was not claimed. */
115
+ | {
116
+ readonly kind: "not-sendable";
117
+ readonly record: BlobIntentRecord;
118
+ readonly check: Extract<BlobAdmissionCheck, {
119
+ ok: false;
120
+ }>;
121
+ }
122
+ /**
123
+ * The claim was proven never dispatched. `rolledBack`: the journal returned it to `pending`,
124
+ * resendable; otherwise it stays `in_flight` and only a lookup may settle it.
125
+ */
126
+ | {
127
+ readonly kind: "not-dispatched";
128
+ readonly record: BlobIntentRecord;
129
+ readonly code: BlobNotDispatchedCode;
130
+ readonly cause?: unknown;
131
+ readonly rolledBack: boolean;
132
+ } | {
133
+ readonly kind: "delivered";
134
+ /** The record as last persisted (the claim when `persisted` is false). */
135
+ readonly record: BlobIntentRecord;
136
+ readonly outcome: HostedBlobDeliveryOutcome;
137
+ /** Whether this drive submitted (false for a lookup or a receipt already held). */
138
+ readonly submitted: boolean;
139
+ readonly lookups: number;
140
+ /** False when the outcome could not be recorded: the record stays for a later lookup. */
141
+ readonly persisted: boolean;
142
+ readonly retired: boolean;
143
+ };
144
+ /**
145
+ * A held deletion's continuation named fewer deletions than the host holds. Nothing was claimed
146
+ * or sent; the record stays held.
147
+ */
148
+ export declare class HostedBlobDeletionsNotAccepted extends Error {
149
+ readonly code = "DELETIONS_NOT_ACCEPTED";
150
+ readonly requestId: string;
151
+ readonly deletions: number;
152
+ readonly baseline: number;
153
+ readonly accepted: number | undefined;
154
+ constructor(requestId: string, hold: BlobDeletionHold, accepted: number | undefined);
155
+ }
156
+ /**
157
+ * Drive one journaled blob intent: admit it (`admit`), make the fresh durable claim, deliver it
158
+ * through `performHostedBlobDelivery`, persist the patch and retire a terminal record.
159
+ *
160
+ * - Every check that could fail inside the adapter's send (the capability, the advertised byte
161
+ * bound, the key and MIME grammar) runs before admission and again before a claim, against the
162
+ * one capabilities answer the adapter is handed.
163
+ * - A claim proven never dispatched is rolled back to `pending` (typed `not_dispatched`), so it
164
+ * stays resendable: nothing reached the carrier (credentials, an aborted signal, a malformed
165
+ * identity, a local precondition), or the carrier refused it `denied`, which by its contract
166
+ * means nothing left. Anything after the carrier was invoked is `unknown`, lookup-only.
167
+ * - A failure to admit or to claim is thrown with nothing sent. A failure to record the outcome
168
+ * is not thrown: the record stays for a later lookup and `persisted` is false.
169
+ */
170
+ export declare function driveJournaledBlob(journal: BlobJournaledBackend, context: JournaledBlobContext, requestId: string, mode: JournaledBlobMode): Promise<JournaledBlobResult>;
171
+ /** What `forgetJournaledBlob` did. */
172
+ export type JournaledBlobForgetResult = {
173
+ readonly kind: "unrecorded";
174
+ } | {
175
+ readonly kind: "scope-mismatch";
176
+ readonly record: BlobIntentRecord;
177
+ }
178
+ /** Only an `unknown` record may be forgotten; settle an `in_flight` one first. */
179
+ | {
180
+ readonly kind: "not-unknown";
181
+ readonly record: BlobIntentRecord;
182
+ }
183
+ /** The lookup failed, was refused or malformed; nothing was forgotten. */
184
+ | {
185
+ readonly kind: "lookup-unavailable";
186
+ readonly record: BlobIntentRecord;
187
+ readonly cause: unknown;
188
+ } | {
189
+ readonly kind: "forgotten";
190
+ readonly record: BlobIntentRecord;
191
+ }
192
+ /** The lookup found the recorded outcome, persisted and (when possible) retired as a delivery's. */
193
+ | Extract<JournaledBlobResult, {
194
+ kind: "delivered";
195
+ }>;
196
+ /**
197
+ * Forget an `unknown` record after one fresh lookup answers `absent`. The record is removed, not
198
+ * settled: the earlier delivery may still commit, and only the host's compare-and-swap keeps a
199
+ * later write from losing that update. A lookup that finds the outcome settles it instead.
200
+ */
201
+ export declare function forgetJournaledBlob(journal: BlobJournaledBackend, context: JournaledBlobContext, requestId: string): Promise<JournaledBlobForgetResult>;
202
+ /** A head as a write's precondition: the version and content type it must find. */
203
+ export interface BlobPin {
204
+ readonly version: Version;
205
+ readonly contentType: string;
206
+ }
207
+ /** A create of an absent key, or a replace at exactly `expected` (a type-only change included). */
208
+ export type HostedBlobWriteInput = {
209
+ readonly key: string;
210
+ readonly bytes: Uint8Array;
211
+ readonly contentType: string;
212
+ readonly expectAbsent: true;
213
+ readonly expected?: never;
214
+ } | {
215
+ readonly key: string;
216
+ readonly bytes: Uint8Array;
217
+ readonly contentType: string;
218
+ readonly expected: BlobPin;
219
+ readonly expectAbsent?: never;
220
+ };
221
+ export interface HostedBlobDeleteInput {
222
+ readonly key: string;
223
+ readonly expected: BlobPin;
224
+ }
225
+ export interface HostedBlobWriteOptions {
226
+ /** The request identity, a lowercase UUID v4. Default: a fresh one. A held identity resumes its own write. */
227
+ readonly requestId?: string;
228
+ /** Ends this call's requests; an abort after sending leaves the outcome unknown. */
229
+ readonly signal?: AbortSignal;
230
+ /** A person's confirmation of the host's mass-delete hold: the count they accepted. Delete only. */
231
+ readonly acceptDeletes?: number;
232
+ }
233
+ export type HostedBlobOperation = "create" | "replace" | "delete";
234
+ /**
235
+ * A refusal's code. The host's own: a recorded refusal (`backend_unavailable`, ...), or one it
236
+ * answers before dispatch and never records (`insufficient_scope`, `bundle_not_found`,
237
+ * `request_capacity`), which is final for the identity when every earlier attempt was proven not
238
+ * applied; after an unclear attempt the write stays `unknown` instead. Or one the client names
239
+ * before sending (`invalid_input`, `scope_mismatch`, `unsettled_write`).
240
+ */
241
+ export type HostedBlobRefusalCode = "insufficient_scope" | "bundle_not_found" | "request_capacity" | "invalid_input" | "backend_unavailable" | "scope_mismatch" | "unsettled_write" | (string & {});
242
+ interface BlobResultBase {
243
+ readonly requestId: string;
244
+ readonly key: string;
245
+ readonly operation: HostedBlobOperation;
246
+ }
247
+ export type HostedBlobWriteResult = BlobResultBase & (
248
+ /** Applied. `head` is the new head, null after a delete; `changed` is false for a replace the head already matched. */
249
+ {
250
+ readonly status: "committed";
251
+ readonly head: BlobHead | null;
252
+ readonly changed?: boolean;
253
+ }
254
+ /** The head is not at the expected pin (a create: the key exists). `actual` is the head now, or null for none. Final. */
255
+ | {
256
+ readonly status: "conflict";
257
+ readonly reason: "version_conflict";
258
+ readonly actual: BlobPin | null;
259
+ }
260
+ /** Another write overlapped this one past the host's own retries; nothing was applied. Final. */
261
+ | {
262
+ readonly status: "conflict";
263
+ readonly reason: "concurrent_change";
264
+ readonly message: string;
265
+ } | {
266
+ readonly status: "refused";
267
+ readonly code: HostedBlobRefusalCode;
268
+ readonly message: string;
269
+ }
270
+ /** The host holds this mass delete (`428 deletions_held`); nothing was applied. `settleBlobWrite` with `acceptDeletes` continues it. */
271
+ | {
272
+ readonly status: "held";
273
+ readonly deletions: number;
274
+ readonly baseline: number;
275
+ }
276
+ /** The host may or may not hold the write. `lookupBlobWrite` or `settleBlobWrite` asks again. */
277
+ | {
278
+ readonly status: "unknown";
279
+ });
280
+ export type HostedBlobLookupResult = HostedBlobWriteResult
281
+ /** No blob write is held under the identity: never recorded, or settled and retired. */
282
+ | {
283
+ readonly status: "unrecorded";
284
+ readonly requestId: string;
285
+ }
286
+ /** Held, never sent (or proven not applied): nothing to look up. `settleBlobWrite` sends it. */
287
+ | (BlobResultBase & {
288
+ readonly status: "pending";
289
+ });
290
+ export type HostedBlobForgetResult = HostedBlobLookupResult
291
+ /** Removed from the journal after an `absent` lookup. The earlier delivery may still commit; the host's compare-and-swap prevents a lost update. */
292
+ | (BlobResultBase & {
293
+ readonly status: "forgotten";
294
+ })
295
+ /** Not forgotten: the record is not `unknown`, or its lookup did not answer `absent`. Nothing changed. */
296
+ | (BlobResultBase & {
297
+ readonly status: "kept";
298
+ readonly reason: "not_unknown" | "lookup_unavailable";
299
+ readonly state: OperationState;
300
+ });
301
+ /** A blob write the journal holds unsettled. */
302
+ export interface HostedBlobHeldWrite {
303
+ readonly requestId: string;
304
+ readonly bundleId: string;
305
+ /** The workspace slug the bundle was named in, or null. */
306
+ readonly workspace: string | null;
307
+ readonly key: string;
308
+ readonly operation: HostedBlobOperation;
309
+ readonly state: OperationState;
310
+ readonly attempts: number;
311
+ /** True when every attempt is proven not applied, so `settleBlobWrite` submits it. */
312
+ readonly resendable: boolean;
313
+ /** The host's mass-delete hold awaiting acceptance. */
314
+ readonly hold?: {
315
+ readonly deletions: number;
316
+ readonly baseline: number;
317
+ };
318
+ readonly createdAt: string;
319
+ }
320
+ /**
321
+ * Nothing was sent, and the write stays held under `requestId`: `held` is true when it is
322
+ * resendable (`settleBlobWrite` or the same `writeBlob` call sends it), false when the journal
323
+ * could not record that and only a lookup may settle it. `reason` says why it was not sent.
324
+ */
325
+ export declare class HostedBlobWriteNotSent extends Error {
326
+ readonly code = "BLOB_WRITE_NOT_SENT";
327
+ readonly requestId: string;
328
+ readonly reason: BlobNotDispatchedCode;
329
+ readonly held: boolean;
330
+ constructor(requestId: string, reason: BlobNotDispatchedCode, held: boolean, options?: {
331
+ cause?: unknown;
332
+ detail?: string;
333
+ });
334
+ }
335
+ /** What blob writes need from a client: its write context, origin, journal and per-request and per-key chains. */
336
+ export interface HostedBlobContext extends HostedWriteContext {
337
+ /** The client's origin as a target names it (`URL.origin`). */
338
+ readonly origin: string;
339
+ readonly blobJournal: BlobJournaledBackend;
340
+ /** One chain per request identity and one per key, shared by a client and its `within` clients. */
341
+ readonly blobLocks: Map<string, Promise<unknown>>;
342
+ }
343
+ /** `HostedClient.writeBlob`. */
344
+ export declare function hostedWriteBlob(context: HostedBlobContext, bundleId: string, input: HostedBlobWriteInput, options?: HostedBlobWriteOptions): Promise<HostedBlobWriteResult>;
345
+ /** `HostedClient.deleteBlob`. */
346
+ export declare function hostedDeleteBlob(context: HostedBlobContext, bundleId: string, input: HostedBlobDeleteInput, options?: HostedBlobWriteOptions): Promise<HostedBlobWriteResult>;
347
+ /** `HostedClient.lookupBlobWrite`: one outcome lookup of a held write; it never sends the write. */
348
+ export declare function hostedLookupBlobWrite(context: HostedBlobContext, requestId: string, options?: {
349
+ signal?: AbortSignal;
350
+ }): Promise<HostedBlobLookupResult>;
351
+ /**
352
+ * `HostedClient.settleBlobWrite`: submit a held write whose every attempt is proven not applied
353
+ * (pending or unknown, `attempts === notAppliedThrough`), otherwise look it up. An absent lookup
354
+ * is `unknown`, never a resend.
355
+ */
356
+ export declare function hostedSettleBlobWrite(context: HostedBlobContext, requestId: string, options?: {
357
+ signal?: AbortSignal;
358
+ acceptDeletes?: number;
359
+ }): Promise<HostedBlobLookupResult>;
360
+ /**
361
+ * `HostedClient.forgetBlobWrite`: drop an `unknown` write after one fresh lookup answers `absent`.
362
+ * The earlier delivery may still commit; the host's compare-and-swap prevents a lost update.
363
+ */
364
+ export declare function hostedForgetBlobWrite(context: HostedBlobContext, requestId: string, options?: {
365
+ signal?: AbortSignal;
366
+ }): Promise<HostedBlobForgetResult>;
367
+ /** `HostedClient.heldBlobWrites`: every unsettled blob write, after sweeping settled ones left by a crash. */
368
+ export declare function hostedHeldBlobWrites(context: HostedBlobContext): Promise<HostedBlobHeldWrite[]>;
369
+ /** `HostedClient.blobHeads`: the bundle's whole blob listing, verified against its digest. */
370
+ export declare function hostedBlobHeads(context: HostedBlobContext, bundleId: string, options?: {
371
+ signal?: AbortSignal;
372
+ }): Promise<HostedBlobHeads>;
373
+ /** `HostedClient.blobHead`: one key's head from the listing, or null when the key is absent. */
374
+ export declare function hostedBlobHead(context: HostedBlobContext, bundleId: string, key: string, options?: {
375
+ signal?: AbortSignal;
376
+ }): Promise<BlobHead | null>;
377
+ /**
378
+ * `HostedClient.readBlob`: the bytes at exactly `pin`, verified against its length, digest and
379
+ * content type; null when the key is no longer at that pin (the host's `409`).
380
+ */
381
+ export declare function hostedReadBlob(context: HostedBlobContext, bundleId: string, key: string, options: {
382
+ pin: BlobPin;
383
+ signal?: AbortSignal;
384
+ }): Promise<HostedBlobRead | null>;
385
+ export {};
386
+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