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

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 (228) hide show
  1. package/README.md +316 -0
  2. package/dist/backend.d.ts +3 -0
  3. package/dist/backend.d.ts.map +1 -1
  4. package/dist/backend.js +7 -0
  5. package/dist/backend.js.map +1 -1
  6. package/dist/blob-contract.d.ts +80 -0
  7. package/dist/blob-contract.d.ts.map +1 -0
  8. package/dist/blob-contract.js +131 -0
  9. package/dist/blob-contract.js.map +1 -0
  10. package/dist/blob-journal.d.ts +117 -0
  11. package/dist/blob-journal.d.ts.map +1 -0
  12. package/dist/blob-journal.js +168 -0
  13. package/dist/blob-journal.js.map +1 -0
  14. package/dist/bundle-health/index.d.ts +14 -0
  15. package/dist/bundle-health/index.d.ts.map +1 -0
  16. package/dist/bundle-health/index.js +12 -0
  17. package/dist/bundle-health/index.js.map +1 -0
  18. package/dist/bundle-health/kind-findings.d.ts +44 -0
  19. package/dist/bundle-health/kind-findings.d.ts.map +1 -0
  20. package/dist/bundle-health/kind-findings.js +68 -0
  21. package/dist/bundle-health/kind-findings.js.map +1 -0
  22. package/dist/bundle-health/legacy-page.d.ts +39 -0
  23. package/dist/bundle-health/legacy-page.d.ts.map +1 -0
  24. package/dist/bundle-health/legacy-page.js +50 -0
  25. package/dist/bundle-health/legacy-page.js.map +1 -0
  26. package/dist/bundle-health/report.d.ts +202 -0
  27. package/dist/bundle-health/report.d.ts.map +1 -0
  28. package/dist/bundle-health/report.js +438 -0
  29. package/dist/bundle-health/report.js.map +1 -0
  30. package/dist/engine.d.ts +1 -1
  31. package/dist/engine.d.ts.map +1 -1
  32. package/dist/engine.js.map +1 -1
  33. package/dist/file-journaled-backend-internal.d.ts +2 -0
  34. package/dist/file-journaled-backend-internal.d.ts.map +1 -1
  35. package/dist/file-journaled-backend-internal.js +2 -0
  36. package/dist/file-journaled-backend-internal.js.map +1 -1
  37. package/dist/file-journaled-backend.d.ts +14 -2
  38. package/dist/file-journaled-backend.d.ts.map +1 -1
  39. package/dist/file-journaled-backend.js +245 -37
  40. package/dist/file-journaled-backend.js.map +1 -1
  41. package/dist/hosted-client/binding.d.ts +7 -0
  42. package/dist/hosted-client/binding.d.ts.map +1 -0
  43. package/dist/hosted-client/binding.js +10 -0
  44. package/dist/hosted-client/binding.js.map +1 -0
  45. package/dist/hosted-client/blob-delivery.d.ts +61 -0
  46. package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
  47. package/dist/hosted-client/blob-delivery.js +147 -0
  48. package/dist/hosted-client/blob-delivery.js.map +1 -0
  49. package/dist/hosted-client/bundle-listing.d.ts +46 -0
  50. package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
  51. package/dist/hosted-client/bundle-listing.js +36 -0
  52. package/dist/hosted-client/bundle-listing.js.map +1 -0
  53. package/dist/hosted-client/client.d.ts +155 -0
  54. package/dist/hosted-client/client.d.ts.map +1 -0
  55. package/dist/hosted-client/client.js +278 -0
  56. package/dist/hosted-client/client.js.map +1 -0
  57. package/dist/hosted-client/errors.d.ts +16 -0
  58. package/dist/hosted-client/errors.d.ts.map +1 -0
  59. package/dist/hosted-client/errors.js +22 -0
  60. package/dist/hosted-client/errors.js.map +1 -0
  61. package/dist/hosted-client/index.d.ts +23 -0
  62. package/dist/hosted-client/index.d.ts.map +1 -0
  63. package/dist/hosted-client/index.js +25 -0
  64. package/dist/hosted-client/index.js.map +1 -0
  65. package/dist/hosted-client/node.d.ts +70 -0
  66. package/dist/hosted-client/node.d.ts.map +1 -0
  67. package/dist/hosted-client/node.js +214 -0
  68. package/dist/hosted-client/node.js.map +1 -0
  69. package/dist/hosted-client/reference.d.ts +12 -0
  70. package/dist/hosted-client/reference.d.ts.map +1 -0
  71. package/dist/hosted-client/reference.js +29 -0
  72. package/dist/hosted-client/reference.js.map +1 -0
  73. package/dist/hosted-client/write.d.ts +200 -0
  74. package/dist/hosted-client/write.d.ts.map +1 -0
  75. package/dist/hosted-client/write.js +401 -0
  76. package/dist/hosted-client/write.js.map +1 -0
  77. package/dist/hosted-transport/answer-rows.d.ts +29 -2
  78. package/dist/hosted-transport/answer-rows.d.ts.map +1 -1
  79. package/dist/hosted-transport/answer-rows.js +60 -2
  80. package/dist/hosted-transport/answer-rows.js.map +1 -1
  81. package/dist/hosted-transport/blob-reads.d.ts +35 -0
  82. package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
  83. package/dist/hosted-transport/blob-reads.js +179 -0
  84. package/dist/hosted-transport/blob-reads.js.map +1 -0
  85. package/dist/hosted-transport/blob-write.d.ts +34 -0
  86. package/dist/hosted-transport/blob-write.d.ts.map +1 -0
  87. package/dist/hosted-transport/blob-write.js +115 -0
  88. package/dist/hosted-transport/blob-write.js.map +1 -0
  89. package/dist/hosted-transport/carrier.d.ts +8 -9
  90. package/dist/hosted-transport/carrier.d.ts.map +1 -1
  91. package/dist/hosted-transport/carrier.js +40 -41
  92. package/dist/hosted-transport/carrier.js.map +1 -1
  93. package/dist/hosted-transport/index.d.ts +4 -4
  94. package/dist/hosted-transport/index.d.ts.map +1 -1
  95. package/dist/hosted-transport/index.js +4 -4
  96. package/dist/hosted-transport/index.js.map +1 -1
  97. package/dist/hosted-transport/read-adapter.d.ts +6 -0
  98. package/dist/hosted-transport/read-adapter.d.ts.map +1 -1
  99. package/dist/hosted-transport/read-adapter.js +11 -0
  100. package/dist/hosted-transport/read-adapter.js.map +1 -1
  101. package/dist/hosted-transport/whole-document-transport.d.ts +1 -1
  102. package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -1
  103. package/dist/hosted-transport/whole-document-transport.js +20 -12
  104. package/dist/hosted-transport/whole-document-transport.js.map +1 -1
  105. package/dist/index.d.ts +5 -2
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +5 -2
  108. package/dist/index.js.map +1 -1
  109. package/dist/journaled-backend.d.ts +10 -2
  110. package/dist/journaled-backend.d.ts.map +1 -1
  111. package/dist/journaled-backend.js +3 -3
  112. package/dist/journaled-backend.js.map +1 -1
  113. package/dist/kinds-load.js +4 -4
  114. package/dist/kinds-load.js.map +1 -1
  115. package/dist/kinds.d.ts.map +1 -1
  116. package/dist/kinds.js +3 -2
  117. package/dist/kinds.js.map +1 -1
  118. package/dist/link-types.d.ts +26 -0
  119. package/dist/link-types.d.ts.map +1 -0
  120. package/dist/link-types.js +57 -0
  121. package/dist/link-types.js.map +1 -0
  122. package/dist/paths.d.ts +16 -0
  123. package/dist/paths.d.ts.map +1 -1
  124. package/dist/paths.js +25 -0
  125. package/dist/paths.js.map +1 -1
  126. package/dist/platform.d.ts +4 -0
  127. package/dist/platform.d.ts.map +1 -1
  128. package/dist/platform.js +16 -0
  129. package/dist/platform.js.map +1 -1
  130. package/dist/query-filter.d.ts +9 -0
  131. package/dist/query-filter.d.ts.map +1 -1
  132. package/dist/query-filter.js +19 -3
  133. package/dist/query-filter.js.map +1 -1
  134. package/dist/recipe-lifecycle/errors.d.ts +77 -0
  135. package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
  136. package/dist/recipe-lifecycle/errors.js +96 -0
  137. package/dist/recipe-lifecycle/errors.js.map +1 -0
  138. package/dist/recipe-lifecycle/evolution.d.ts +71 -0
  139. package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
  140. package/dist/recipe-lifecycle/evolution.js +659 -0
  141. package/dist/recipe-lifecycle/evolution.js.map +1 -0
  142. package/dist/recipe-lifecycle/index.d.ts +23 -0
  143. package/dist/recipe-lifecycle/index.d.ts.map +1 -0
  144. package/dist/recipe-lifecycle/index.js +19 -0
  145. package/dist/recipe-lifecycle/index.js.map +1 -0
  146. package/dist/recipe-lifecycle/install.d.ts +111 -0
  147. package/dist/recipe-lifecycle/install.d.ts.map +1 -0
  148. package/dist/recipe-lifecycle/install.js +412 -0
  149. package/dist/recipe-lifecycle/install.js.map +1 -0
  150. package/dist/recipe-lifecycle/legacy-aliases.d.ts +16 -0
  151. package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
  152. package/dist/recipe-lifecycle/legacy-aliases.js +51 -0
  153. package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
  154. package/dist/recipe-lifecycle/stamp.d.ts +98 -0
  155. package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
  156. package/dist/recipe-lifecycle/stamp.js +260 -0
  157. package/dist/recipe-lifecycle/stamp.js.map +1 -0
  158. package/dist/recipes.d.ts +5 -0
  159. package/dist/recipes.d.ts.map +1 -1
  160. package/dist/recipes.js +5 -0
  161. package/dist/recipes.js.map +1 -1
  162. package/dist/record-overlay/apply.d.ts +43 -0
  163. package/dist/record-overlay/apply.d.ts.map +1 -0
  164. package/dist/record-overlay/apply.js +490 -0
  165. package/dist/record-overlay/apply.js.map +1 -0
  166. package/dist/record-overlay/canonical.d.ts +14 -0
  167. package/dist/record-overlay/canonical.d.ts.map +1 -0
  168. package/dist/record-overlay/canonical.js +31 -0
  169. package/dist/record-overlay/canonical.js.map +1 -0
  170. package/dist/record-overlay/digest.d.ts +4 -0
  171. package/dist/record-overlay/digest.d.ts.map +1 -0
  172. package/dist/record-overlay/digest.js +11 -0
  173. package/dist/record-overlay/digest.js.map +1 -0
  174. package/dist/record-overlay/errors.d.ts +40 -0
  175. package/dist/record-overlay/errors.d.ts.map +1 -0
  176. package/dist/record-overlay/errors.js +51 -0
  177. package/dist/record-overlay/errors.js.map +1 -0
  178. package/dist/record-overlay/findings.d.ts +5 -0
  179. package/dist/record-overlay/findings.d.ts.map +1 -0
  180. package/dist/record-overlay/findings.js +83 -0
  181. package/dist/record-overlay/findings.js.map +1 -0
  182. package/dist/record-overlay/index.d.ts +23 -0
  183. package/dist/record-overlay/index.d.ts.map +1 -0
  184. package/dist/record-overlay/index.js +21 -0
  185. package/dist/record-overlay/index.js.map +1 -0
  186. package/dist/record-overlay/plan.d.ts +12 -0
  187. package/dist/record-overlay/plan.d.ts.map +1 -0
  188. package/dist/record-overlay/plan.js +284 -0
  189. package/dist/record-overlay/plan.js.map +1 -0
  190. package/dist/record-overlay/policy.d.ts +60 -0
  191. package/dist/record-overlay/policy.d.ts.map +1 -0
  192. package/dist/record-overlay/policy.js +209 -0
  193. package/dist/record-overlay/policy.js.map +1 -0
  194. package/dist/record-overlay/redact.d.ts +3 -0
  195. package/dist/record-overlay/redact.d.ts.map +1 -0
  196. package/dist/record-overlay/redact.js +27 -0
  197. package/dist/record-overlay/redact.js.map +1 -0
  198. package/dist/record-overlay/signal-kind.d.ts +30 -0
  199. package/dist/record-overlay/signal-kind.d.ts.map +1 -0
  200. package/dist/record-overlay/signal-kind.js +38 -0
  201. package/dist/record-overlay/signal-kind.js.map +1 -0
  202. package/dist/record-overlay/signal-text.d.ts +45 -0
  203. package/dist/record-overlay/signal-text.d.ts.map +1 -0
  204. package/dist/record-overlay/signal-text.js +116 -0
  205. package/dist/record-overlay/signal-text.js.map +1 -0
  206. package/dist/record-overlay/source-index.d.ts +19 -0
  207. package/dist/record-overlay/source-index.d.ts.map +1 -0
  208. package/dist/record-overlay/source-index.js +102 -0
  209. package/dist/record-overlay/source-index.js.map +1 -0
  210. package/dist/record-overlay/types.d.ts +286 -0
  211. package/dist/record-overlay/types.d.ts.map +1 -0
  212. package/dist/record-overlay/types.js +2 -0
  213. package/dist/record-overlay/types.js.map +1 -0
  214. package/dist/remote-operations.js +5 -2
  215. package/dist/remote-operations.js.map +1 -1
  216. package/dist/storage.d.ts +5 -1
  217. package/dist/storage.d.ts.map +1 -1
  218. package/dist/storage.js +4 -1
  219. package/dist/storage.js.map +1 -1
  220. package/dist/uncertain-write.d.ts +107 -6
  221. package/dist/uncertain-write.d.ts.map +1 -1
  222. package/dist/uncertain-write.js +67 -32
  223. package/dist/uncertain-write.js.map +1 -1
  224. package/dist/write-identity.d.ts +5 -0
  225. package/dist/write-identity.d.ts.map +1 -0
  226. package/dist/write-identity.js +9 -0
  227. package/dist/write-identity.js.map +1 -0
  228. package/package.json +21 -1
package/README.md CHANGED
@@ -124,6 +124,322 @@ cleanup. Policies are structural snapshots: public data and methods are captured
124
124
  may continue to observe live operating-system facts. Do not use opaque private fields or methods
125
125
  pre-bound to a mutable receiver.
126
126
 
127
+ ## Recipe lifecycle
128
+
129
+ `@superbee/core/recipe-lifecycle` installs and evolves a parsed recipe on any bundle. The caller
130
+ acquires the recipe (`parseRecipeFiles` from `@superbee/core/recipes` turns files into a
131
+ `LoadedRecipe`) and presents the results; the `superbee` CLI is one such caller. It uses no Node
132
+ globals or builtins, so it runs in Node, a browser or a Worker over any storage backend.
133
+
134
+ ```ts
135
+ import { MemoryBackend } from "@superbee/core/memory-backend";
136
+ import { parseRecipeFiles } from "@superbee/core/recipes";
137
+ import { applyRecipeEvolution, installRecipe, planRecipeEvolution } from "@superbee/core/recipe-lifecycle";
138
+
139
+ const bundle = { root: "memory://glossary", backend: new MemoryBackend() };
140
+ const v1 = parseRecipeFiles(glossaryV1Files, "memory:glossary@1");
141
+ if (!v1.ok) throw new Error(v1.error.message);
142
+ await installRecipe(bundle, v1.recipe);
143
+
144
+ const v2 = parseRecipeFiles(glossaryV2Files, "memory:glossary@2");
145
+ if (!v2.ok) throw new Error(v2.error.message);
146
+ const plan = await planRecipeEvolution(bundle, v2.recipe);
147
+ if (plan.ready && plan.writes > 0) {
148
+ await applyRecipeEvolution(bundle, v2.recipe, plan.plan_token, { actor: "process:glossary-sync" });
149
+ }
150
+ ```
151
+
152
+ `installRecipe` is create-only: each convention, View pair and Reference is written with an
153
+ expect-absent compare-and-swap, an existing convention is left untouched (its row reports
154
+ `source_differs` when it differs from the recipe), and a differing View or Reference target is
155
+ refused before anything is written. `planRecipeEvolution` is read-only: it merges each recipe
156
+ convention into the installed one additively, rechecks existing instances, and returns blockers
157
+ and a `plan_token` bound to everything it read. `applyRecipeEvolution` recomputes the plan,
158
+ refuses a different token, and writes each changed convention at exactly the version the plan
159
+ saw. The bundle has no cross-document transaction, so a failure part way reports the definitions
160
+ written and those still pending.
161
+
162
+ Every convention either path writes carries an `x_recipe` stamp in the same write: the recipe's
163
+ id, version, declared convention count (`of`), `recipeSourceDigest` of the recipe, the
164
+ `definitionDigest` of the convention as written, and the `digest_rules` version. A plan's
165
+ `changed` is about content only; its `writes` also counts conventions whose stamp is stale or
166
+ missing, so a ready plan with `writes > 0` has work to apply. `installedRecipes(conventions,
167
+ known?)` reads each recipe's state (`installed`, `partial`, `diverged`, `unknown`) from the stamps
168
+ alone, without the recipe source.
169
+
170
+ Failures are typed subclasses of `RecipeLifecycleError`: `RecipeInputError` (the recipe cannot
171
+ target this bundle's edition), `RecipeAssetConflict` (`recipe`, `key`), `RecipeEditionChanged`,
172
+ `RecipeEvolutionPlanChanged` (`expected`, `current`), `RecipeEvolutionBlocked` (`blockers`),
173
+ `RecipeEvolutionInterrupted` (`reason`, `completed`, `pending`, `cause`) and
174
+ `RecipeEvolutionPostcondition` (`reason`, `completed`).
175
+
176
+ ## Record overlay
177
+
178
+ `@superbee/core/record-overlay` is the write half of binding documents to external records. A
179
+ Source Feed policy names the fields a feed owns; the caller fetches and diffs its records and hands
180
+ the changes to the planner. It uses no Node globals or builtins, so it runs in Node, a browser or a
181
+ Worker over any storage backend.
182
+
183
+ ```ts
184
+ import { MemoryBackend } from "@superbee/core/memory-backend";
185
+ import { buildKindRegistry } from "@superbee/core/kinds";
186
+ import { applyRecordOverlay, buildSourceIndex, planRecordOverlay, readOverlayPolicy } from "@superbee/core/record-overlay";
187
+
188
+ const bundle = { root: "memory://guide", backend: new MemoryBackend() };
189
+ const registry = buildKindRegistry(conventionDocs);
190
+ const guide = { bundle, registry, okfVersion: "0.2" as const };
191
+ const policy = readOverlayPolicy(sourceFeedDoc, { targetKind: registry.kinds.get("Event") });
192
+ const overlays = await buildSourceIndex(bundle, { type: policy.target_kind });
193
+ const plan = await planRecordOverlay({ content: guide, ops: guide, policy, changes, observedAt, overlays });
194
+ const receipt = await applyRecordOverlay(plan, { content: guide, ops: guide, policy, actor: "process:calendar-sync", overlays });
195
+ ```
196
+
197
+ For each owned field the plan compares the last accepted feed value, the new feed value and the
198
+ document's value: a document that already says the new value is left alone, one that still says
199
+ the old value is written, and anything else is an `OVERLAY_DOC_CONFLICT` with a Signal, so an
200
+ editor's override is never overwritten. Each step carries the version it was planned against.
201
+ `applyRecordOverlay` writes every step through `mutateDocument` with a guard core builds itself and
202
+ runs on the fresh read: an owned-field write reaches documents of the policy's target Kind only,
203
+ may change only owned and derived fields, never the body, and needs the record's `sources`
204
+ identity; a Signal may be created only as a new, unclaimed document of the attention Kind under its
205
+ path, and updated only in a fixed set of fields plus one appended observation line. Signal writes
206
+ are bound to the provider of the policy the caller passes, never to a field of the plan, and an id
207
+ held by another provider's Signal is refused. A Signal's text must be the planner's rendering of
208
+ its own fields and the run (its observation line, links to the plan's feed and to documents, the
209
+ adoption hint): every plan the planner makes passes, and other text is a held `INVALID_INPUT` row,
210
+ so a mismatch is visible and planned again rather than dropped. Nothing of the
211
+ target Kind is created and nothing is deleted. A feed never owns its target's work state: the
212
+ progress storage fields and the target Kind's claim fields are refused like `status`. The
213
+ attention Kind (default `Signal`) must declare a claim owner and state field and the fields
214
+ `change_kind`, `observed_at`, `provider`, `external_id` and `diff_summary`.
215
+
216
+ Site rules are hooks with safe defaults: `textGate` (identity), `interval` (none, so a disappeared
217
+ record is always raised), `correlate`, `sourceProperties` (an upsert of the record's `sources`
218
+ entry in the same write, OKF v0.2 only), `assertCandidate` (site candidate checks after the core
219
+ guards) and `deriveFields` (fields such as `updated_at` written in the same version). Refusals are
220
+ receipt rows with a `REFUSAL_CODES` code; `RETRYABLE` and `HOLD_STORE` say which leave a record to be
221
+ planned again. A value core's write policy refuses (an OKF v0.2 field type, for example) is a held
222
+ `INVALID_INPUT` row, so one bad record never stops the rest of a run. A malformed plan (an unknown
223
+ step, a non-canonical target, written values that are not JSON data with finite numbers, prototype
224
+ keys, non-scalar or identity `sources` properties), actor or bundle edition throws `OverlayRefusal`
225
+ before any write, and so does a plan with owned-field steps whose policy names no declared target
226
+ Kind or whose owned or derived list names a field a feed can never own.
227
+
228
+ `SourceIndex` holds one head read for a whole run. It is bounded to that run: an edited or deleted
229
+ overlay is still caught at write time, but a second document given an identity during the run is
230
+ only refused as ambiguous on the next run.
231
+
232
+ ## Bundle health
233
+
234
+ `@superbee/core/bundle-health` computes the health report behind `superbee status` from a core
235
+ `Bundle` on any backend: malformed documents, Kind lint and conformance debt, registry warnings,
236
+ unresolved links, orphans, freshness and invalid timestamps, trust tiers, the two graph lints, the
237
+ View surface, cross-bundle links, the OKF v0.1 upgrade finding and legacy naming. It uses no Node
238
+ globals or builtins, so it runs in Node, a browser or a Worker. The caller presents the report;
239
+ the CLI adds row caps, help text and its home and sync blocks.
240
+
241
+ ```ts
242
+ import { MemoryBackend } from "@superbee/core/memory-backend";
243
+ import { bundleHealth } from "@superbee/core/bundle-health";
244
+
245
+ const bundle = { root: "memory://guide", backend: new MemoryBackend() };
246
+ const report = await bundleHealth(bundle, { now: new Date() });
247
+ const gate = { malformed: report.malformed.length, kind_warnings: report.kindLint.length, unresolved_links: report.unresolvedLinks.length };
248
+ ```
249
+
250
+ The report reads only: one Kind registry load, one lenient query, two prefix-scoped blob listings
251
+ and one root-index read, with every finding derived in memory. A document whose frontmatter does
252
+ not parse is a `malformed` row (the root index first), never a thrown error. Top-level keys are
253
+ camelCase; rows keep snake_case keys (`age_ms`, `bundle_id`, `incompatible_values`) and arrive
254
+ whole, in report order, for the caller to cap. Sections whose presence depends on the bundle are
255
+ null when absent: `conformanceDebt` without any declared Kind, `trust` outside a non-empty v0.2
256
+ bundle, `crossBundle` without `docs/dependencies` or any `okf:` link, `okfUpgrade` outside a v0.1
257
+ bundle with a workflow-status collision. `crossLinkTypeViolations` is always an array, because a
258
+ local edge under a qualified declaration needs no dependencies. The stored values in
259
+ `invalidStaleAfter`, `invalidTimestamps` and `invalidLegacyTimestamps` are made JSON-safe;
260
+ `missingExpectedLinks[].status` is the raw stored value.
261
+
262
+ Nothing outside the bundle is read unless the caller binds it. `bindings` is a map of bound copies
263
+ by alias, or a hook core calls exactly once, after every read and with its own parse of
264
+ `docs/dependencies` (a self alias already dropped as `DEP_SELF`, using `selfBundleId` when
265
+ `docs/bundle` declares no id). Whatever the hook throws propagates unchanged. Each binding's
266
+ verdict comes from core's resolver, and `dependencies[].bound` is the binding's `label`.
267
+
268
+ `bundleKindFindings(documents, okfVersion, { actor, producer })` answers a different question:
269
+ which Kind problems a strict host write would refuse, preparing each document as its first edit,
270
+ so a timestamp or actor the write supplies is no finding. The CLI's publish preview runs it; the
271
+ report's `kindLint` stays advisory. Both use core's one validator, `validateAgainstKind`.
272
+
273
+ ## Hosted client
274
+
275
+ `@superbee/core/hosted-client` is the headless client of a hosted Superbee's sync routes
276
+ (`/sync/v1`). It is a supported public API under core's normal versioning; the `superbee` CLI uses
277
+ it. It runs wherever `fetch` does (Node, a browser or a Worker) and reads identity (`whoami`),
278
+ the bundle list (`bundles`, with `readBundleListing`), documents (`reader`), document history
279
+ (`history`) and operations run by id (`listOperations`, `runOperation`). `within(slug)` returns
280
+ the same client naming every bundle-scoped request's bundle as `<slug>/<bundle-id>`.
281
+
282
+ ```ts
283
+ import { bearerCredentials, createHostedClient } from "@superbee/core/hosted-client";
284
+
285
+ const client = createHostedClient({
286
+ target: { origin: "https://mcp.getsuperbee.com", syncPrefix: "/sync/v1" },
287
+ credentials: bearerCredentials(() => getToken()),
288
+ });
289
+ const identity = await client.whoami();
290
+ ```
291
+
292
+ The target is the origin and the sync prefix: `/sync/v1`, or `/agents/<id>/sync/v1` for an agent
293
+ connection. `syncRoutePrefix({ origin, audience })` derives the prefix from a protected-resource
294
+ audience and returns null when the audience has none. `credentials` is the transport carrier's
295
+ own credential provider: an async function returning the headers for one request. It is called
296
+ before every request, so it may renew a short-lived token. `bearerCredentials` builds one from a
297
+ token getter. The client never logs credentials, and its errors carry the route and code, never a
298
+ token.
299
+
300
+ Failures are typed and carry no wording for any particular surface:
301
+
302
+ - `HostedCarrierError`: transport. `denied` means no credential (nothing was sent) or the request
303
+ was refused before sending; `unavailable` means the answer is unknown. `isAnswerTooLarge`
304
+ distinguishes an answer larger than its bound.
305
+ - `MalformedAnswer` (`code` `MALFORMED_ANSWER`, `route`): the host answered something the
306
+ contract does not admit. Retrying gets the same answer.
307
+ - `RemoteError` (`code`, `status`): the host refused the request, with its own code.
308
+ - `HostedRouteNotServed` (`code` `ROUTE_NOT_SERVED`, status 404, `route`): a `RemoteError` for a
309
+ host from before the route.
310
+
311
+ Operation and history refusals the host states in a `200` (and `bundle_not_found`,
312
+ `unknown_operation` and `invalid_input`) come back as `{ ok: false, refusal }`, not as errors.
313
+
314
+ ### Writing a document
315
+
316
+ `write` sends one whole serialized document (frontmatter and body, as a file holds it) to a hosted
317
+ bundle: a create of an absent id, or a replace at exactly the version the caller read.
318
+
319
+ ```ts
320
+ const created = await client.write("notes", { id: "notes/today", document: text, expectAbsent: true });
321
+ const replaced = await client.write("notes", { id: "notes/today", document: edited, expectedVersion: version });
322
+ ```
323
+
324
+ It returns one of:
325
+
326
+ - `{ status: "committed", version }`: the host stored it; `version` is the new head.
327
+ - `{ status: "conflict", reason: "version_conflict", currentVersion }`: the document is not at the
328
+ expected version (for a create: it exists). `currentVersion` is the version the host serves, or
329
+ null when it serves none. Nothing was written.
330
+ - `{ status: "conflict", reason: "concurrent_change" }`: another write to the bundle overlapped
331
+ this one past the host's own retries. Nothing was written.
332
+ - `{ status: "refused", code, message }`: the host refused this write (`validation_failed`,
333
+ `invalid_input`, `AUTH_REQUIRED`, `PERMISSION_DENIED`, a sync quota's `REQUEST_CAPACITY_*`, or
334
+ `read_only` when the bundle serves no writes). Nothing was written.
335
+ - `{ status: "unknown", requestId }`: the host may or may not hold the write.
336
+
337
+ Every result names its `requestId`. A conflict is final for that identity: the client never
338
+ resends it, under that identity or a new one. Read the document and decide; another attempt is a
339
+ new `write`.
340
+
341
+ A write needs the bundle's capabilities (whether it serves writes, its OKF edition, the write
342
+ bound and the retention window). The client reads them once per bundle and workspace and holds the
343
+ answer for `capabilitiesTtlMs` (default 60,000 ms), shared by the client and its `within` clients
344
+ and never by `reader()`. So a write costs one round trip while its bundle's capabilities are fresh,
345
+ and two when they are read first; concurrent writes to one bundle share one read. A write refused
346
+ `read_only`, `invalid_input`, `validation_failed` or `PERMISSION_DENIED` (which is how a
347
+ `bundle_not_found` write answer arrives), or whose result is `unknown`, drops the held answer, and
348
+ a capabilities read that fails is never held, so the next write reads them again. Set
349
+ `capabilitiesTtlMs: 0` to read them before every write. The retention window that decides a
350
+ resend after an `absent` lookup (below) is never taken from a held answer: it is read again then.
351
+
352
+ Each write has one request identity and carries the client's binding, a digest of a random id the
353
+ client mints once (its `within` clients share it). When an answer is lost (a transport failure or
354
+ a deadline after sending), the client looks the identity up on the host and reports what the host
355
+ recorded. The host's outcome route tells a request it never received ("absent") from one still in
356
+ progress ("pending"), and the shared transport keeps the two apart. On either answer `write`
357
+ sends the same identity once more, which the host applies at most once; after "pending", an
358
+ earlier delivery is known to be held. Absence counts as
359
+ evidence only within the retention window the host serves in its capabilities
360
+ (`operationsRetentionMs`, less an hour's margin); past it, the result stays `unknown` and nothing
361
+ is resent. The client measures an intent's age by its own clock against the host's window, so that
362
+ margin holds only while the client's clock is within an hour of the host's. A resend refused before
363
+ it reaches the host's execution (no credential, access withdrawn, a spent quota) leaves the result
364
+ `unknown` too, since the first delivery may still commit; after a "pending" lookup, so does any
365
+ refusal before execution, a gateway's `400` included. The result's `refusal` (`{ code, message }`)
366
+ names that refusal, so an app can say why the write is waiting (for example, access withdrawn)
367
+ while it stays held; only the call that met the refusal reports it. Absence alone never settles
368
+ such a write: a delayed first delivery is authorized when it arrives, so it can still commit once
369
+ access returns. When the lookups themselves fail, or the caller's `signal` aborts after sending, the
370
+ result is `unknown`.
371
+
372
+ An `unknown` write can be resolved later in two ways:
373
+
374
+ - `lookupWrite(requestId)` makes one outcome lookup and never sends the write. When the host holds
375
+ no outcome yet (absent or pending), the answer stays `unknown`.
376
+ - `settleWrite(requestId)` looks the identity up and, when the host never recorded it within its
377
+ retention window or holds it pending, sends the same identity once more, as `write` would have.
378
+
379
+ Both answer `{ status: "unrecorded", requestId }` when the intent store holds no write under that
380
+ identity: it was never recorded there, or it already settled and left the store. Both return
381
+ `unknown` when the bundle's capabilities cannot be read, because the write may already have left.
382
+ `settleWrite` only looks up, sending nothing, when the host serves the bundle no writes. A
383
+ `signal` already aborted when `write`, `lookupWrite` or `settleWrite` is called is thrown as its
384
+ reason before any request; an abort during delivery leaves the write `unknown` and held.
385
+ `write` instead throws that failure, because it has sent nothing yet.
386
+
387
+ Until it settles, a write is held in an intent store: its operation, bundle (and workspace),
388
+ document id, document and digest, expected version, request identity and binding, which is
389
+ everything needed to rebuild the lookup exactly. The default store is in memory and lives as long
390
+ as the client. Pass `intentStore` (`put`, `get`, `delete`, and optionally `list`) to keep intents
391
+ durable across restarts; lookups use the binding recorded with each intent. A service that
392
+ restarts with a durable store calls `heldWrites()` to find the writes that never settled
393
+ (including any recorded but never sent), then settles each with `settleWrite`. `heldWrites()`
394
+ throws `HostedIntentsNotListable` when the store has no `list`. A settled write leaves the store.
395
+
396
+ `write(..., { requestId })` with the identity of a held write resumes that write and applies
397
+ nothing new. A different write under a held identity, including the same write named in another
398
+ workspace, is refused before sending. The host refuses an identity it recorded for another
399
+ document (`invalid_input`). Calls on one client that name the same identity run one after another.
400
+
401
+ `write` throws only before anything is sent: a malformed input (`TypeError`), the typed error of
402
+ its capabilities read, or a failure of the intent store to record the write. Document deletion is
403
+ not part of `write`.
404
+
405
+ ### Export download (Node only)
406
+
407
+ `@superbee/core/hosted-client/node` downloads and verifies a hosted bundle's portable export. It
408
+ is a supported public API under the same versioning. It is Node-only because verification
409
+ (`@superbee/core/portable-export`) needs Node; `@superbee/core/hosted-client` never imports it,
410
+ so the client itself stays browser-safe.
411
+
412
+ ```ts
413
+ import { bearerCredentials, createHostedClient } from "@superbee/core/hosted-client";
414
+ import { downloadExport, EXPORT_WINDOW_MS } from "@superbee/core/hosted-client/node";
415
+ import { materializeExport } from "@superbee/core/portable-export";
416
+
417
+ const client = createHostedClient({ target, credentials: bearerCredentials(getToken), deadlineMs: EXPORT_WINDOW_MS });
418
+ const verified = await downloadExport(client, "team.notes", { signal });
419
+ const folder = await materializeExport(verified, parentDirectory);
420
+ ```
421
+
422
+ `downloadExport(client, bundleId, { signal })` returns a `VerifiedExport`: every document,
423
+ reserved file and blob at the bundle's latest confirmed revision, read whole and checked against
424
+ the host's digest manifests. It writes nothing. A stopped, tampered or oversized export never
425
+ becomes a result; placing the files is the caller's (`materializeExport`, or its own staging). It
426
+ reads a paged export one page at a time and joins the pages. On a host from before paging it reads
427
+ the whole archive. A bundle that changes between pages is read again from its first page, up to
428
+ three attempts, and a busy or stopped page is asked for once more. Create the client with
429
+ `deadlineMs: EXPORT_WINDOW_MS` (60 s), the host's export window; the default 15 s can cut a large
430
+ bundle. A `within(slug)` client names the bundle in that workspace.
431
+
432
+ Failures are typed:
433
+
434
+ - `HostedCarrierError`, `HostedRouteNotServed` (a host without the export route) and
435
+ `RemoteError` (the host's refusal: `bundle_not_found`, `result_too_large`, `validation_failed`,
436
+ an unauthenticated bearer and so on), as for the rest of the client.
437
+ - `ExportArchiveError` (`problem`): the verifier refused the archive. `incomplete` means the host
438
+ stopped it, and the same request may succeed.
439
+ - `HostedExportError` (`problem`): `stopped` (the answer's body failed part way), `too_large`
440
+ (past `MAX_EXPORT_BYTES`) or `source_changed` (the bundle kept changing between pages).
441
+ - The signal's reason, once `signal` or the client's own signal aborts.
442
+
127
443
  ## Release compatibility
128
444
 
129
445
  This migration describes the source after the Windows extraction. Previously published versions
package/dist/backend.d.ts CHANGED
@@ -60,6 +60,9 @@ export declare class FilesystemBackend implements StorageBackend {
60
60
  readonly backlinks: false;
61
61
  };
62
62
  }
63
+ /** Read-only exact-spelling metadata observation for a safe blob pathname. Reads no body and
64
+ * creates no directories; alias/unsafe observations retain the identity owner's typed refusal. */
65
+ export declare function probeFilesystemPath(backend: FilesystemBackend, key: string): Promise<"exact" | "absent">;
63
66
  /** Internal exact-byte authority for the publication adapter; not part of StorageBackend. */
64
67
  export declare function readRawFilesystemDocument(backend: FilesystemBackend, id: ConceptId): Promise<{
65
68
  bytes: Uint8Array;
@@ -1 +1 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA+BH,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,WAAW,EACX,YAAY,EACb,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAoErE;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,cAAc;;IAItD;;;;OAIG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,wBAA6B;IAM1D,IAAI,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;IA6BxC,QAAQ,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAwBjD,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IA0BpF,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;IAiBpE,QAAQ,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IA6B/C,MAAM,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAmB3C,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE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BAA6B,CAAC,OAAO,EAAE,iBAAiB,GAAG;IACzE,IAAI,CAAC,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACtE,MAAM,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;CAChC,CAiBA;AAED,sEAAsE;AACtE,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,CAUzD;AAED,oEAAoE;AACpE,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAAC,CAazD"}
package/dist/backend.js CHANGED
@@ -374,6 +374,13 @@ function publicationContext(backend) {
374
374
  throw new InvalidInputError("Unknown filesystem backend publication source.");
375
375
  return context;
376
376
  }
377
+ /** Read-only exact-spelling metadata observation for a safe blob pathname. Reads no body and
378
+ * creates no directories; alias/unsafe observations retain the identity owner's typed refusal. */
379
+ export async function probeFilesystemPath(backend, key) {
380
+ assertSafeBlobKey(key);
381
+ const { root, port } = publicationContext(backend);
382
+ return (await probeExact(port, root, key)).state;
383
+ }
377
384
  /** Internal exact-byte authority for the publication adapter; not part of StorageBackend. */
378
385
  export async function readRawFilesystemDocument(backend, id) {
379
386
  return readRawDocumentIn(backend, id);
@@ -1 +1 @@
1
- {"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,sB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KAAK,GAAG,CAAC,CAAqB,CAAC;QAC3D,qBAAqB,CAAC,GAAG,CAAC,CAAC;QAC3B,0BAA0B,CAAC,IAAI,CAAC,CAAC;QACjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IACvB,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClG,CAAC"}
@@ -0,0 +1,80 @@
1
+ import type { Version } from "./types.js";
2
+ export declare const BLOB_OPERATION_IDS: readonly ["blobs.create.v1", "blobs.replace.v1", "blobs.delete.v1"];
3
+ export type BlobOperationId = (typeof BLOB_OPERATION_IDS)[number];
4
+ /** Pins retained in an intent. A delete has no replacement digest/type and creates name absence. */
5
+ export type BlobWriteExpected = {
6
+ operationId: "blobs.create.v1";
7
+ key: string;
8
+ expectedVersion: null;
9
+ expectedContentType: null;
10
+ version: Version;
11
+ contentType: string;
12
+ } | {
13
+ operationId: "blobs.replace.v1";
14
+ key: string;
15
+ expectedVersion: Version;
16
+ expectedContentType: string;
17
+ version: Version;
18
+ contentType: string;
19
+ } | {
20
+ operationId: "blobs.delete.v1";
21
+ key: string;
22
+ expectedVersion: Version;
23
+ expectedContentType: string;
24
+ };
25
+ export type BlobWriteSuccess = {
26
+ ok: true;
27
+ operationId: "blobs.create.v1" | "blobs.replace.v1";
28
+ data: {
29
+ key: string;
30
+ version: Version;
31
+ contentType: string;
32
+ changed: boolean;
33
+ };
34
+ } | {
35
+ ok: true;
36
+ operationId: "blobs.delete.v1";
37
+ data: {
38
+ key: string;
39
+ version: Version;
40
+ contentType: string;
41
+ deleted: true;
42
+ };
43
+ };
44
+ export type BlobWriteErrorCode = "version_conflict" | "insufficient_scope" | "bundle_not_found" | "concurrent_change" | "backend_unavailable" | "request_capacity" | "deletions_held" | "write_outcome_unknown";
45
+ export type BlobWriteFailure = {
46
+ ok: false;
47
+ operationId: BlobOperationId;
48
+ error: {
49
+ code: BlobWriteErrorCode;
50
+ message: string;
51
+ retryable: false;
52
+ writeState: "not_applied" | "unknown";
53
+ expected?: Version | null;
54
+ actual?: Version | null;
55
+ expectedContentType?: string | null;
56
+ actualContentType?: string | null;
57
+ scope?: "principal" | "bundle";
58
+ resetAt?: string;
59
+ deletions?: number;
60
+ baseline?: number;
61
+ };
62
+ };
63
+ export type BlobWriteResult = BlobWriteSuccess | BlobWriteFailure;
64
+ export declare function isBlobContentType(value: unknown): value is string;
65
+ export declare function isSafeBlobKey(value: unknown): value is string;
66
+ export declare function isBlobWriteExpected(expected: BlobWriteExpected): boolean;
67
+ /** A blob result answers every version and MIME pin retained in the original intent. Success
68
+ * names a replacement head, or a delete's removed head; it never invents a tombstone. */
69
+ export declare function decodeBlobWriteResult(raw: unknown, expected: BlobWriteExpected): BlobWriteResult;
70
+ export interface BlobHead {
71
+ readonly key: string;
72
+ readonly version: string;
73
+ readonly contentType: string;
74
+ }
75
+ export declare function assertBlobKey(key: string): void;
76
+ export declare function captureBlobHead(value: unknown): BlobHead;
77
+ export declare function encodeBlobKey(key: string): string;
78
+ /** Snapshot the strict retained payload before any asynchronous admission. */
79
+ export declare function captureBlobWriteExpected(intent: BlobWriteExpected): BlobWriteExpected;
80
+ //# sourceMappingURL=blob-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob-contract.d.ts","sourceRoot":"","sources":["../src/blob-contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,eAAO,MAAM,kBAAkB,qEAAqF,CAAC;AACrH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,oGAAoG;AACpG,MAAM,MAAM,iBAAi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