@mnmal-ai/substrate 1.0.0-alpha.2 → 1.0.0-alpha.21

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 (53) hide show
  1. package/README.md +64 -14
  2. package/dist/boot-store-Dz6PGwNY.js +4079 -0
  3. package/dist/{runtime-metrics-DwpDJ8vz.d.ts → bridge-BeVye_Oj.d.ts} +2 -87
  4. package/dist/cli-CH7M6ZTQ.js +3383 -0
  5. package/dist/client.browser.js +2485 -0
  6. package/dist/client.d.ts +273 -135
  7. package/dist/client.js +6 -6
  8. package/dist/cluster-worker.js +0 -1
  9. package/dist/{content-type-C7T28xNb.js → content-type-wLljot5M.js} +0 -1
  10. package/dist/{env-utils-CGNazUNt.js → env-utils-s25Z1YSA.js} +0 -1
  11. package/dist/{errors-D4vKuwz8.d.ts → errors-CoHLKAX0.d.ts} +44 -4
  12. package/dist/{fake-DUVtKVSE.js → fake-DdXtb-m8.js} +0 -1
  13. package/dist/{index-D7mSOFlM.d.ts → index-D7XRAGC6.d.ts} +7 -11
  14. package/dist/msgpackr-Dq18g6Ds.js +16 -0
  15. package/dist/node-version-BtK_Nq6z.js +32 -0
  16. package/dist/pack.d.ts +75 -11
  17. package/dist/pack.js +4 -4
  18. package/dist/pg-edges-store-Dnaxesmy.js +443 -0
  19. package/dist/{plugin-QuJN9pG_.js → plugin-BIz4Pr5-.js} +132 -8
  20. package/dist/proposals-bootstrap.js +6 -5
  21. package/dist/proposals.config.schema.json +5 -0
  22. package/dist/proposals.d.ts +17 -5
  23. package/dist/proposals.default-config.json +2 -1
  24. package/dist/proposals.js +2 -3
  25. package/dist/recall-bootstrap.js +5 -4
  26. package/dist/recall.config.schema.json +6 -0
  27. package/dist/recall.d.ts +35 -6
  28. package/dist/recall.js +2 -3
  29. package/dist/{repl-C52wyfMs.js → repl-BUkd9DPZ.js} +65 -33
  30. package/dist/{row-ByLFE2Wx.d.ts → row-aEWVHEsf.d.ts} +92 -12
  31. package/dist/run-Cu9w5Y10.js +2435 -0
  32. package/dist/{plugin-t2g2wX0b.d.ts → schema-DwnXxdjk.d.ts} +1293 -63
  33. package/dist/script-A9dxMRZA.js +143 -0
  34. package/dist/script-runner.js +77 -0
  35. package/dist/sdk.d.ts +227 -38
  36. package/dist/sdk.js +5 -110
  37. package/dist/semver-D_zdq0hi.js +17 -0
  38. package/dist/{src-DWm0iA88.js → src--accZ5Ka.js} +188 -87
  39. package/dist/{src-DMzc3HfW.js → src-BNdhH_Hx.js} +745 -851
  40. package/dist/{src-CG7giuHr.js → src-BQnDrs_E.js} +793 -75
  41. package/dist/{src-BLgbLq2k.js → src-B_kHkbsr.js} +780 -330
  42. package/dist/src-BbCUeMsI.js +7723 -0
  43. package/dist/{src-CHp3QyqB.js → src-BmJD4ScT.js} +9215 -3376
  44. package/dist/{row-DZ0Fnpc6.js → src-DmiUWOLp.js} +2 -1
  45. package/dist/substrate-admin.js +17 -782
  46. package/dist/substrate.js +4 -5487
  47. package/dist/testing.d.ts +730 -53
  48. package/dist/testing.js +20 -163
  49. package/dist/{ws-C72iVS5T.d.ts → ws-DJaKruX-.d.ts} +4 -5
  50. package/package.json +26 -26
  51. package/dist/dataset-BQ8egGl5.js +0 -1535
  52. package/dist/schema-g4FQLr0V.d.ts +0 -433
  53. package/dist/src-CXKnqeTW.js +0 -2339
package/dist/client.d.ts CHANGED
@@ -1,9 +1,122 @@
1
- import { E as Row, l as PackEnvelope, u as Schema } from "./schema-g4FQLr0V.js";
2
- import { a as RuntimeErrors, i as RuntimeErrorEntry, o as RuntimeMetrics, r as ResolverStat, s as SlowRequest, t as ProcessStat } from "./runtime-metrics-DwpDJ8vz.js";
3
- import { C as QualifiedFrame } from "./plugin-t2g2wX0b.js";
4
- import { A as and, B as SYSTEM_NAMESPACE, C as flattenGrant, D as parseGrantEntries, E as intersectGrants, F as TokenProviderOpts, G as resolveAdminCredential, H as isActiveAdminKeyRow, I as adminClaimCapabilities, J as NlAskRequest, K as resolveDefaultKeyPath, L as isEncryptedKey, M as or, N as ADMIN_CAPABILITIES, O as decodeList, P as DEFAULT_CAPABILITIES, R as makeAuthorizationProvider, S as expandFlat, T as grantIsUniform, U as AdminCredential, V as describeGrant, W as AdminEnv, Y as NlAskResult, _ as newlyGrantedPairs, a as denyAll, b as capabilitiesFor, c as requireIdentity, d as KeyUpdateRefusal, f as checkRevocable, ft as NlWireEvent, g as newlyGranted, h as grantEntriesConfer, i as allowVerbs, j as not, k as encodeList, l as requireNamespace, lt as NlServedPack, m as grantCovers, n as row, o as denyVerbs, p as checkUpdatable, q as resolveDefaultKidPath, r as allowAll, rt as NlOutcome, s as requireCapability, t as applyRowFilters, u as KeyMutationRefusal, ut as NlTrailEvent, v as revokedAtIso, w as grantEntryError, x as encodeGrant, y as Grant, z as makeTokenProvider } from "./row-ByLFE2Wx.js";
5
- import { s as SchemaDriftError } from "./index-D7mSOFlM.js";
1
+ import { Ln as Row, W as QualifiedFrame, dn as RuntimeErrors, f as PackEnvelope, fn as RuntimeMetrics, ln as ResolverStat, m as Schema, pn as SlowRequest, sn as ProcessStat, un as RuntimeErrorEntry } from "./schema-DwnXxdjk.js";
2
+ import { A as and, B as SYSTEM_NAMESPACE, C as flattenGrant, D as parseGrantEntries, E as intersectGrants, F as TokenProviderOpts, G as resolveAdminCredential, H as isActiveAdminKeyRow, I as adminClaimCapabilities, K as resolveDefaultKeyPath, L as isEncryptedKey, M as or, N as ADMIN_CAPABILITIES, O as decodeList, P as DEFAULT_CAPABILITIES, R as makeAuthorizationProvider, S as expandFlat, T as grantIsUniform, U as AdminCredential, V as describeGrant, W as AdminEnv, X as NlAskResult, Y as NlAskRequest, _ as newlyGrantedPairs, a as denyAll, at as NlOutcome, b as capabilitiesFor, c as requireIdentity, d as KeyUpdateRefusal, dt as NlServedPack, f as checkRevocable, ft as NlTrailEvent, g as newlyGranted, h as grantEntriesConfer, i as allowVerbs, j as not, k as encodeList, l as requireNamespace, m as grantCovers, mt as NlWireEvent, n as row, o as denyVerbs, p as checkUpdatable, q as resolveDefaultKidPath, r as allowAll, s as requireCapability, t as applyRowFilters, u as KeyMutationRefusal, v as revokedAtIso, w as grantEntryError, x as encodeGrant, y as Grant, z as makeTokenProvider } from "./row-aEWVHEsf.js";
3
+ import { o as SchemaDriftError } from "./index-D7XRAGC6.js";
6
4
  import { Signal } from "@preact/signals-core";
5
+ //#region ../../packages/substrate-client/src/transport/h2-fetch.d.ts
6
+ /**
7
+ * A fetch-shaped function over `node:http2`: the transport seam's HTTP/2
8
+ * adapter for Node and Bun (Todo #1850, Decision #625).
9
+ *
10
+ * One `ClientHttp2Session` per origin, opened on first use and shared by every
11
+ * request to it; concurrent first calls share the pending connect. A session is
12
+ * dropped on GOAWAY, close or error, and the next request opens a new one. An
13
+ * idle session is unref'd, so a short-lived process exits without `close()`.
14
+ * `http:` origins use HTTP/2 with prior knowledge (h2c); `https:` origins verify
15
+ * the server against `ca`, or the process's default trust (which includes
16
+ * NODE_EXTRA_CA_CERTS). Certificate checks are never turned off.
17
+ *
18
+ * Imports node builtins only.
19
+ */
20
+ type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
21
+ interface H2FetchOptions {
22
+ /** PEM of a CA to trust for `https:` origins, beside the default trust. */
23
+ ca?: string | Uint8Array;
24
+ /** Give up on opening a session after this long. Default 10 000 ms. */
25
+ connectTimeoutMs?: number;
26
+ }
27
+ type H2Fetch = FetchLike & {
28
+ close(): Promise<void>;
29
+ };
30
+ export declare function createH2Fetch(opts?: H2FetchOptions): H2Fetch;
31
+ //#endregion
32
+ //#region ../../packages/substrate-client/src/admin/diagnose.d.ts
33
+ /**
34
+ * `ok` — asked and answered yes. `no` — asked and answered no. `skip` — NOT
35
+ * ASKED, because a precondition failed.
36
+ */
37
+ type DoctorStatus = 'ok' | 'no' | 'skip';
38
+ interface DoctorCheck {
39
+ /** Stable short label, safe to grep for in a support thread. */
40
+ readonly name: string;
41
+ readonly status: DoctorStatus;
42
+ /** What was measured, in the terms the operator typed. */
43
+ readonly detail: string;
44
+ /** Present on `no` — the next command, not a restatement of the failure. */
45
+ readonly fix?: string;
46
+ /** The HTTP status that decided this verdict, when a response decided it. Match on this,
47
+ * never on `detail`, which is prose for an operator and free to change. */
48
+ readonly httpStatus?: number;
49
+ }
50
+ interface DoctorReport {
51
+ readonly checks: readonly DoctorCheck[];
52
+ /** 0 when nothing answered `no`. Skips do not fail the run; they are visible. */
53
+ readonly exitCode: number;
54
+ }
55
+ interface DirectoryReconciliation {
56
+ /** Inactive directory row, live signing credential — the dangerous direction. */
57
+ readonly retiredWithLiveKey: readonly string[];
58
+ /** Live credential, no directory row, not admin-exempt. */
59
+ readonly liveKeyWithoutRow: readonly string[];
60
+ /** Active directory row with a live credential that is not admin-capable. */
61
+ readonly agentKids: readonly string[];
62
+ }
63
+ /**
64
+ * Reconciles live Key rows against AgentIdentity rows, returning retired
65
+ * identities that still hold a live key and live keys with no directory row.
66
+ *
67
+ * Admin keys are exempt from the second list by CAPABILITY, never by kid: the
68
+ * bootstrap root of trust has no directory row by design.
69
+ *
70
+ * A row whose `active` is absent counts as ACTIVE — only an explicit `false`
71
+ * deactivates. Rows predating the field must not read as decommissioned.
72
+ * A key row with no string kid is unmatchable and ignored (doctor is not a
73
+ * corruption scanner).
74
+ */
75
+ export declare function reconcileIdentities(keys: readonly Row[], identities: readonly Row[], adminCapability: string): DirectoryReconciliation;
76
+ /**
77
+ * What diagnose measured, as data. A field is ABSENT when the check that measures it did not
78
+ * run — absent never means empty, so a reader cannot take "not looked" for "none found".
79
+ */
80
+ interface DiagnoseFacts {
81
+ readonly adminKids?: readonly string[];
82
+ readonly liveKeyCount?: number;
83
+ readonly retiredWithLiveKey?: readonly string[];
84
+ readonly liveKeyWithoutRow?: readonly string[];
85
+ readonly agentKids?: readonly string[];
86
+ }
87
+ /** The identity the server resolved, when the identity check passed; else null. */
88
+ interface DiagnoseResult extends DoctorReport {
89
+ readonly identity: string | null;
90
+ readonly facts: DiagnoseFacts;
91
+ }
92
+ type DiagnoseCredential = {
93
+ readonly authorization: () => string;
94
+ readonly label: string;
95
+ } |
96
+ /** `fix` replaces the default advice, which names the admin env: a caller diagnosing some
97
+ * other identity knows what that identity needs. */
98
+ {
99
+ readonly error: string;
100
+ readonly fix?: string;
101
+ };
102
+ interface DiagnoseOpts {
103
+ readonly baseUrl: string;
104
+ readonly credential: DiagnoseCredential;
105
+ /** Default 'admin'. */
106
+ readonly adminCapability?: string;
107
+ /** Default true. False: the admin-only checks are skipped as not asked, not failed. */
108
+ readonly expectAdmin?: boolean;
109
+ readonly fetch?: FetchLike;
110
+ }
111
+ /** Every check `diagnose` can emit, in dependency order: what a caller marks NOT ASKED when it
112
+ * cannot run diagnose at all (the CLI's direct-to-postgres target). */
113
+ export declare const DIAGNOSE_CHECKS: readonly string[];
114
+ /**
115
+ * Runs every check against `opts.baseUrl`, in dependency order. A failure
116
+ * short-circuits its dependants into explicit skips.
117
+ */
118
+ export declare function diagnose(opts: DiagnoseOpts): Promise<DiagnoseResult>;
119
+ //#endregion
7
120
  //#region ../../packages/substrate-client/src/admin/surgery.d.ts
8
121
  type AdminDropCascade = 'refuse' | 'delete';
9
122
  interface AdminDropNamespaceInput {
@@ -278,94 +391,6 @@ interface AdminApi extends SurgeryApi {
278
391
  }): Promise<AdminInviteResult>;
279
392
  }
280
393
  //#endregion
281
- //#region ../../packages/substrate-client/src/admin/diagnose.d.ts
282
- /**
283
- * `ok` — asked and answered yes. `no` — asked and answered no. `skip` — NOT
284
- * ASKED, because a precondition failed.
285
- */
286
- type DoctorStatus = 'ok' | 'no' | 'skip';
287
- interface DoctorCheck {
288
- /** Stable short label, safe to grep for in a support thread. */
289
- readonly name: string;
290
- readonly status: DoctorStatus;
291
- /** What was measured, in the terms the operator typed. */
292
- readonly detail: string;
293
- /** Present on `no` — the next command, not a restatement of the failure. */
294
- readonly fix?: string;
295
- /** The HTTP status that decided this verdict, when a response decided it. Match on this,
296
- * never on `detail`, which is prose for an operator and free to change. */
297
- readonly httpStatus?: number;
298
- }
299
- interface DoctorReport {
300
- readonly checks: readonly DoctorCheck[];
301
- /** 0 when nothing answered `no`. Skips do not fail the run; they are visible. */
302
- readonly exitCode: number;
303
- }
304
- interface DirectoryReconciliation {
305
- /** Inactive directory row, live signing credential — the dangerous direction. */
306
- readonly retiredWithLiveKey: readonly string[];
307
- /** Live credential, no directory row, not admin-exempt. */
308
- readonly liveKeyWithoutRow: readonly string[];
309
- /** Active directory row with a live credential that is not admin-capable. */
310
- readonly agentKids: readonly string[];
311
- }
312
- /**
313
- * Reconciles live Key rows against AgentIdentity rows, returning retired
314
- * identities that still hold a live key and live keys with no directory row.
315
- *
316
- * Admin keys are exempt from the second list by CAPABILITY, never by kid: the
317
- * bootstrap root of trust has no directory row by design.
318
- *
319
- * A row whose `active` is absent counts as ACTIVE — only an explicit `false`
320
- * deactivates. Rows predating the field must not read as decommissioned.
321
- * A key row with no string kid is unmatchable and ignored (doctor is not a
322
- * corruption scanner).
323
- */
324
- export declare function reconcileIdentities(keys: readonly Row[], identities: readonly Row[], adminCapability: string): DirectoryReconciliation;
325
- /**
326
- * What diagnose measured, as data. A field is ABSENT when the check that measures it did not
327
- * run — absent never means empty, so a reader cannot take "not looked" for "none found".
328
- */
329
- interface DiagnoseFacts {
330
- readonly adminKids?: readonly string[];
331
- readonly liveKeyCount?: number;
332
- readonly retiredWithLiveKey?: readonly string[];
333
- readonly liveKeyWithoutRow?: readonly string[];
334
- readonly agentKids?: readonly string[];
335
- }
336
- /** The identity the server resolved, when the identity check passed; else null. */
337
- interface DiagnoseResult extends DoctorReport {
338
- readonly identity: string | null;
339
- readonly facts: DiagnoseFacts;
340
- }
341
- type DiagnoseCredential = {
342
- readonly authorization: () => string;
343
- readonly label: string;
344
- } |
345
- /** `fix` replaces the default advice, which names the admin env: a caller diagnosing some
346
- * other identity knows what that identity needs. */
347
- {
348
- readonly error: string;
349
- readonly fix?: string;
350
- };
351
- interface DiagnoseOpts {
352
- readonly baseUrl: string;
353
- readonly credential: DiagnoseCredential;
354
- /** Default 'admin'. */
355
- readonly adminCapability?: string;
356
- /** Default true. False: the admin-only checks are skipped as not asked, not failed. */
357
- readonly expectAdmin?: boolean;
358
- readonly fetch?: typeof fetch;
359
- }
360
- /** Every check `diagnose` can emit, in dependency order: what a caller marks NOT ASKED when it
361
- * cannot run diagnose at all (the CLI's direct-to-postgres target). */
362
- export declare const DIAGNOSE_CHECKS: readonly string[];
363
- /**
364
- * Runs every check against `opts.baseUrl`, in dependency order. A failure
365
- * short-circuits its dependants into explicit skips.
366
- */
367
- export declare function diagnose(opts: DiagnoseOpts): Promise<DiagnoseResult>;
368
- //#endregion
369
394
  //#region ../../packages/substrate-client/src/admin/onboard.d.ts
370
395
  type OnboardStepStatus = 'done' | 'todo' | 'blocked' | 'skipped';
371
396
  type OnboardAction = {
@@ -436,8 +461,8 @@ interface Diagnostic {
436
461
  * substrate's explanation.
437
462
  *
438
463
  * Results are still correct — a substrate refuses a predicate it cannot
439
- * honour. What is lost is the indexed-field check, so an unindexed filter
440
- * SCANS instead of being rejected.
464
+ * honour. What is lost is the engine's operator and operand check, so a
465
+ * malformed filter fails later and less clearly, or not at all.
441
466
  */
442
467
  filterValidationSkipped?: string;
443
468
  /**
@@ -474,18 +499,7 @@ export declare function collectDiagnostics(envDiagnostics: EnvelopeDiagnostics |
474
499
  */
475
500
  export declare function createDefaultDiagnosticsSink(): DiagnosticsSink;
476
501
  //#endregion
477
- //#region ../../packages/substrate-client/src/transport/ws.d.ts
478
- type WsEncoding = 'json' | 'pack';
479
- /**
480
- * Minimal constructor shape for an injectable WebSocket implementation.
481
- * Must be node-ws-compatible when headers are needed: `(url, protocols?,
482
- * { headers })`. The WHATWG/browser constructor matches the first two
483
- * parameters and simply cannot receive headers.
484
- */
485
- type WebSocketImpl = new (url: string, protocols?: string | string[], options?: {
486
- headers?: Record<string, string>;
487
- }) => unknown;
488
- /** Bounded auto-resubscribe policy for overload teardowns (contract class 1). */
502
+ //#region ../../packages/substrate-client/src/transport/frame-event.d.ts
489
503
  interface WsOverloadResubscribeOpts {
490
504
  /** Master switch. Default true. `false` restores terminal-on-overload. */
491
505
  enabled?: boolean;
@@ -606,35 +620,30 @@ interface SubstrateClientOptions {
606
620
  * Sync providers are accepted so `@mnmal-ai/substrate-policy`'s synchronous
607
621
  * `makeTokenProvider` is usable directly; the transports `await` either way.
608
622
  */
609
- getToken?: () => string | Promise<string>;
610
- fetch?: typeof fetch;
623
+ getToken?: () => string | undefined | Promise<string | undefined>;
624
+ fetch?: FetchLike;
611
625
  reconnect?: {
612
626
  baseDelayMs?: number;
613
627
  maxDelayMs?: number;
614
628
  jitter?: number;
615
629
  };
616
630
  /**
617
- * Wire encoding for the WS surface (subscribe + stream). Default `json`.
618
- * `pack` advertises the `substrate-pack` subprotocol at handshake; the connection
619
- * then exclusively speaks msgpack frames with positionally-encoded `data`,
620
- * which the client decodes back to named-object rows using the cached
621
- * federated schema. Negotiated once per WS connection — distinct from the
622
- * per-call HTTP `wire` opt because the WS subprotocol is a handshake-time
623
- * choice.
631
+ * Wire encoding of subscribe and stream bodies: length-prefixed JSON frames,
632
+ * or substrate-pack frames decoded back to named rows with the cached
633
+ * federated schema. Default `json`; `CallOpts.wire` overrides it per call.
634
+ */
635
+ streamWire?: 'json' | 'pack';
636
+ /**
637
+ * Drop and re-subscribe a frame stream that sends nothing, heartbeats
638
+ * included, for this many milliseconds: a connection that died without
639
+ * closing. Default 65 000, a little over three server heartbeats. `0` disables.
624
640
  */
625
- wsEncoding?: WsEncoding;
641
+ streamIdleMs?: number;
626
642
  /**
627
643
  * Auto-resubscribe policy for `subscription_overloaded` teardowns. Default:
628
644
  * enabled with 3 attempts. See the README "Terminal-aware resubscribe" section.
629
645
  */
630
646
  overloadResubscribe?: WsOverloadResubscribeOpts;
631
- /**
632
- * Explicit WebSocket implementation for the subscribe/stream surface. Must
633
- * be node-ws-compatible (`new (url, protocols?, { headers })`) so the
634
- * bearer can ride the upgrade. Defaults to node-ws under Node and the
635
- * global WebSocket elsewhere — see WsTransportOpts.webSocket.
636
- */
637
- webSocket?: WebSocketImpl;
638
647
  /**
639
648
  * Sink for non-fatal envelope diagnostics (`_diagnostics`) on query/mutate
640
649
  * responses: projection keys the type does not declare, a where-clause that
@@ -654,15 +663,17 @@ interface CallOpts {
654
663
  export declare class SubstrateClient {
655
664
  #private;
656
665
  constructor(opts: SubstrateClientOptions);
657
- /** Natural-language ask (SSE or JSON) and the served namespace pack. Requires the substrate-nl plugin. */
666
+ /** Natural-language ask (frame stream or JSON) and the served namespace pack. Requires the substrate-nl plugin. */
658
667
  get nl(): NlApi;
659
668
  /** The admin-gated routes. Needs an identity whose grant confers `admin`. */
660
669
  get admin(): AdminApi;
661
670
  federatedSchema(): Promise<Record<string, Schema>>;
662
671
  query(frame: QualifiedFrame, opts?: CallOpts): Promise<PackEnvelope>;
663
672
  mutate(frame: QualifiedFrame, opts?: CallOpts): Promise<PackEnvelope>;
664
- subscribe(frame: QualifiedFrame, _opts?: CallOpts): AsyncIterable<SubscribeEvent>;
665
- stream(frame: QualifiedFrame, _opts?: CallOpts): AsyncIterable<SubscribeEvent>;
673
+ /** A live query: a snapshot, then deltas. `opts.wire` and `opts.signal` apply. */
674
+ subscribe(frame: QualifiedFrame, opts?: CallOpts): AsyncIterable<SubscribeEvent>;
675
+ /** A one-shot streamed resolver: chunks, then `end`. `opts.wire` and `opts.signal` apply. */
676
+ stream(frame: QualifiedFrame, opts?: CallOpts): AsyncIterable<SubscribeEvent>;
666
677
  /**
667
678
  * Live typed-row view over a single-key subscription. Subscribes under the
668
679
  * hood, folds snapshot/add/update/remove into the current row-set, and yields
@@ -672,7 +683,7 @@ export declare class SubstrateClient {
672
683
  *
673
684
  * Completes when the subscription ends; throws on an error frame — the same
674
685
  * contract as `subscribe`. Breaking the consuming `for await` cancels the
675
- * underlying WS subscription. Reconnect / overload-resubscribe are handled by
686
+ * underlying subscription. Reconnect / overload-resubscribe are handled by
676
687
  * `subscribe`; each fresh snapshot atomically replaces the row-set.
677
688
  *
678
689
  * Single-qualified-key only: multi-key frames throw; use `subscribe` for
@@ -742,6 +753,101 @@ export declare class SubscribeError extends Error {
742
753
  constructor(message: string, code: string);
743
754
  }
744
755
  //#endregion
756
+ //#region ../../packages/substrate-client/src/script.d.ts
757
+ /**
758
+ * `read` refuses every mutation, `dry-run` records mutations without sending
759
+ * them, and `write` sends them up to `maxWrites` frames.
760
+ */
761
+ type ScriptMode = 'read' | 'dry-run' | 'write';
762
+ interface ScriptMutation {
763
+ frame: QualifiedFrame;
764
+ /** True when any op-key came back with data; a refused payload otherwise rolls back whole. */
765
+ applied: boolean;
766
+ errors?: PackEnvelope['errors'];
767
+ }
768
+ interface ScriptRecallInput {
769
+ query: string;
770
+ /** Required, as on every recall surface. */
771
+ namespace: string;
772
+ /** Required, as on every recall surface: there is no default type. */
773
+ type: string;
774
+ k?: number;
775
+ threshold?: number;
776
+ where?: Record<string, unknown>;
777
+ /** `true` for the whole row, or the fields to return beside `id`. Omit for the handle fields. */
778
+ row?: true | Record<string, true>;
779
+ }
780
+ interface ScriptRecallHit {
781
+ id: string;
782
+ namespace: string;
783
+ type: string;
784
+ score: number;
785
+ kind: 'seed' | 'expansion';
786
+ expandedFrom?: unknown;
787
+ row: Record<string, unknown>;
788
+ }
789
+ /** What a script's default export receives. */
790
+ interface ScriptContext {
791
+ readonly kid: string | null;
792
+ readonly mode: ScriptMode;
793
+ /** The caller's `--args` object; `{}` when none was passed. */
794
+ readonly args: Readonly<Record<string, unknown>>;
795
+ /**
796
+ * One query. Throws when a requested key is missing from `data`, which is a
797
+ * rejected frame, not an empty result.
798
+ */
799
+ query(frame: QualifiedFrame): Promise<PackEnvelope>;
800
+ /** Every row of a single-key query, paging until `hasMore` is false. */
801
+ queryAll(key: string, frame: {
802
+ params?: Record<string, unknown>;
803
+ fields?: unknown;
804
+ }): Promise<Record<string, unknown>[]>;
805
+ /** Recall hits, best first, through the `recall/Hit` frame. */
806
+ recall(input: ScriptRecallInput): Promise<ScriptRecallHit[]>;
807
+ /**
808
+ * The federated schema, one namespace's schema, or one type's. Throws naming
809
+ * an unknown namespace or type.
810
+ */
811
+ schema(namespace?: string, type?: string): Promise<unknown>;
812
+ /**
813
+ * One mutate payload (one transaction). Returns null in `dry-run`, and throws
814
+ * in `read`, past `maxWrites`, or when the server refuses any frame.
815
+ */
816
+ mutate(frame: QualifiedFrame): Promise<PackEnvelope | null>;
817
+ /** Writes to stderr; stdout carries only the result. */
818
+ log(...args: unknown[]): void;
819
+ }
820
+ interface ScriptReport {
821
+ ok: boolean;
822
+ kid: string | null;
823
+ mode: ScriptMode;
824
+ args: Record<string, unknown>;
825
+ result?: unknown;
826
+ error?: string;
827
+ mutations: ScriptMutation[];
828
+ warnings: string[];
829
+ stats: {
830
+ queries: number;
831
+ writes: number;
832
+ ms: number;
833
+ };
834
+ }
835
+ interface RunScriptOptions {
836
+ client: SubstrateClient;
837
+ kid: string | null;
838
+ mode?: ScriptMode;
839
+ args?: Record<string, unknown>;
840
+ maxWrites?: number;
841
+ maxPages?: number;
842
+ log?: (line: string) => void;
843
+ }
844
+ export declare const DEFAULT_MAX_WRITES = 50;
845
+ /**
846
+ * Runs `script` against a guarded context and reports everything it did,
847
+ * including the mutations applied before any failure.
848
+ */
849
+ export declare function runScript(script: (s: ScriptContext) => unknown, opts: RunScriptOptions): Promise<ScriptReport>;
850
+ //#endregion
745
851
  //#region ../../packages/substrate-client/src/subscribe-rows.d.ts
746
852
  /**
747
853
  * Fold one subscribe event into `current`, returning the next row list. Pure:
@@ -762,21 +868,53 @@ export declare function reduceSubscribeRows<T>(current: T[], qualifiedKey: strin
762
868
  * A delta that does not change the set (e.g. an `update` whose row has no id) is
763
869
  * not re-yielded. Cancellation: breaking the consuming `for await` (or calling
764
870
  * `.return()`) propagates to the source iterable's `return()` through the inner
765
- * `for await`, cancelling the underlying WS subscription.
871
+ * `for await`, cancelling the underlying subscription.
766
872
  */
767
873
  export declare function watchRows<T>(events: AsyncIterable<SubscribeEvent>, qualifiedKey: string): AsyncGenerator<T[]>;
768
874
  //#endregion
769
875
  //#region ../../packages/substrate-client/src/token-target.d.ts
770
- /**
771
- * Where a freshly minted credential may be sent: an https origin, or plain
772
- * http only to a loopback host, where nothing on the network can read it.
773
- */
774
876
  /**
775
877
  * @returns the origin of `baseUrl`, which a token for it names as its `aud`.
776
878
  * @throws Error when `baseUrl` is not a URL, or is plain http to a non-loopback host.
777
879
  */
778
880
  export declare function tokenAudience(baseUrl: string): string;
779
881
  /** `fetchImpl` with redirects refused: a redirect would carry the credential to wherever it points. */
780
- export declare function noRedirectFetch(fetchImpl?: typeof fetch): typeof fetch;
882
+ export declare function noRedirectFetch(fetchImpl?: FetchLike): FetchLike;
883
+ //#endregion
884
+ //#region ../../packages/substrate-client/src/transport/default-fetch.d.ts
885
+ export declare const substrateFetch: FetchLike;
886
+ //#endregion
887
+ //#region ../../packages/substrate-client/src/from-env.d.ts
888
+ /**
889
+ * The capabilities a client asks for, from `SUBSTRATE_AGENT_CAPABILITIES` (csv),
890
+ * defaulting to `substrate-policy`'s default.
891
+ *
892
+ * Not `ADMIN_CAPABILITIES`: a dataset-registry key intersects the claim, but a
893
+ * file-registry key takes it verbatim, so a wider default would promote every
894
+ * agent on such a deployment to admin.
895
+ */
896
+ export declare function resolveAgentCapabilities(env: NodeJS.ProcessEnv): ReadonlyArray<string>;
897
+ interface ClientFromEnvOptions extends Omit<SubstrateClientOptions, 'endpoint' | 'token' | 'getToken'> {
898
+ env?: NodeJS.ProcessEnv;
899
+ /** Allow an unsigned client when no signing key is configured. Default false. */
900
+ allowAnonymous?: boolean;
901
+ }
902
+ interface ClientFromEnv {
903
+ client: SubstrateClient;
904
+ endpoint: string;
905
+ /** The signing kid, or null for an anonymous client. */
906
+ kid: string | null;
907
+ }
908
+ /**
909
+ * Builds a client from `SUBSTRATE_URL` and `SUBSTRATE_AGENT_KEY_ID` +
910
+ * `SUBSTRATE_AGENT_KEY_PATH`, signing every request as that kid.
911
+ *
912
+ * Redirects are refused and the token's audience is the endpoint's origin.
913
+ *
914
+ * @throws Error when `SUBSTRATE_URL` is unset or unsafe for a credential, when
915
+ * only one of the key pair is set, when the key cannot be read, or when no
916
+ * key is set and `allowAnonymous` is not.
917
+ */
918
+ export declare function createClientFromEnv(opts?: ClientFromEnvOptions): ClientFromEnv;
781
919
  //#endregion
782
- export { ADMIN_CAPABILITIES, type AdminApi, type AdminBackfillChunk, type AdminBackfillInput, type AdminBackfillSummary, type AdminCredential, type AdminDropCascade, type AdminDropNamespaceInput, type AdminDropResult, type AdminDropTypeInput, type AdminEmbedStats, type AdminEnv, type AdminGrantChange, type AdminInviteInput, type AdminInviteResult, type AdminKeyAlgorithm, type AdminKeyRow, type AdminNormaliseInput, type AdminNormaliseResult, type AdminRegisterInput, type AdminRegisterResult, type AdminReindexInput, type AdminReindexPage, type AdminRevokeResult, type AdminUpdateResult, type CallOpts, DEFAULT_CAPABILITIES, type DiagnoseCredential, type DiagnoseFacts, type DiagnoseOpts, type DiagnoseResult, type Diagnostic, type DiagnosticsSink, type DirectoryReconciliation, type DoctorCheck, type DoctorReport, type DoctorStatus, type Grant, type KeyMutationRefusal, type KeyUpdateRefusal, type NlApi, type NlAskRequest, type NlAskResult, type NlOutcome, type NlServedPack, type NlTrailEvent, type NlWireEvent, type OnboardAction, type OnboardStep, type OnboardStepStatus, type PlanOnboardingOpts, type ProcessStat, type QualifiedFrame, type ResolverStat, type RuntimeErrorEntry, type RuntimeErrors, type RuntimeMetrics, SYSTEM_NAMESPACE, SchemaDriftError, type SlowRequest, type SubscribeEvent, type SubstrateClientOptions, type SurgeryApi, type TokenProviderOpts, type WebSocketImpl, type WsOverloadResubscribeOpts, adminClaimCapabilities, allowAll, allowVerbs, and, applyRowFilters, capabilitiesFor, checkRevocable, checkUpdatable, decodeList, denyAll, denyVerbs, describeGrant, encodeGrant, encodeList, expandFlat, flattenGrant, grantCovers, grantEntriesConfer, grantEntryError, grantIsUniform, intersectGrants, isActiveAdminKeyRow, isEncryptedKey, makeAuthorizationProvider, makeTokenProvider, newlyGranted, newlyGrantedPairs, not, or, parseGrantEntries, requireCapability, requireIdentity, requireNamespace, resolveAdminCredential, resolveDefaultKeyPath, resolveDefaultKidPath, revokedAtIso, row };
920
+ export { ADMIN_CAPABILITIES, type AdminApi, type AdminBackfillChunk, type AdminBackfillInput, type AdminBackfillSummary, type AdminCredential, type AdminDropCascade, type AdminDropNamespaceInput, type AdminDropResult, type AdminDropTypeInput, type AdminEmbedStats, type AdminEnv, type AdminGrantChange, type AdminInviteInput, type AdminInviteResult, type AdminKeyAlgorithm, type AdminKeyRow, type AdminNormaliseInput, type AdminNormaliseResult, type AdminRegisterInput, type AdminRegisterResult, type AdminReindexInput, type AdminReindexPage, type AdminRevokeResult, type AdminUpdateResult, type CallOpts, type ClientFromEnv, type ClientFromEnvOptions, DEFAULT_CAPABILITIES, type DiagnoseCredential, type DiagnoseFacts, type DiagnoseOpts, type DiagnoseResult, type Diagnostic, type DiagnosticsSink, type DirectoryReconciliation, type DoctorCheck, type DoctorReport, type DoctorStatus, type FetchLike, type Grant, type H2Fetch, type H2FetchOptions, type KeyMutationRefusal, type KeyUpdateRefusal, type NlApi, type NlAskRequest, type NlAskResult, type NlOutcome, type NlServedPack, type NlTrailEvent, type NlWireEvent, type OnboardAction, type OnboardStep, type OnboardStepStatus, type PlanOnboardingOpts, type ProcessStat, type QualifiedFrame, type ResolverStat, type RunScriptOptions, type RuntimeErrorEntry, type RuntimeErrors, type RuntimeMetrics, SYSTEM_NAMESPACE, SchemaDriftError, type ScriptContext, type ScriptMode, type ScriptMutation, type ScriptRecallHit, type ScriptRecallInput, type ScriptReport, type SlowRequest, type SubscribeEvent, type SubstrateClientOptions, type SurgeryApi, type TokenProviderOpts, type WsOverloadResubscribeOpts, adminClaimCapabilities, allowAll, allowVerbs, and, applyRowFilters, capabilitiesFor, checkRevocable, checkUpdatable, decodeList, denyAll, denyVerbs, describeGrant, encodeGrant, encodeList, expandFlat, flattenGrant, grantCovers, grantEntriesConfer, grantEntryError, grantIsUniform, intersectGrants, isActiveAdminKeyRow, isEncryptedKey, makeAuthorizationProvider, makeTokenProvider, newlyGranted, newlyGrantedPairs, not, or, parseGrantEntries, requireCapability, requireIdentity, requireNamespace, resolveAdminCredential, resolveDefaultKeyPath, resolveDefaultKidPath, revokedAtIso, row };
package/dist/client.js CHANGED
@@ -1,7 +1,7 @@
1
- import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
- import { a as adminClaimCapabilities, c as makeTokenProvider, d as resolveDefaultKidPath, i as DEFAULT_CAPABILITIES, l as resolveAdminCredential, o as isEncryptedKey, r as ADMIN_CAPABILITIES, s as makeAuthorizationProvider, u as resolveDefaultKeyPath } from "./env-utils-CGNazUNt.js";
3
- import { A as expandFlat, C as not, D as isActiveAdminKeyRow, E as describeGrant, F as parseGrantEntries, I as decodeList, L as encodeList, M as grantEntryError, N as grantIsUniform, O as capabilitiesFor, P as intersectGrants, S as and, T as SYSTEM_NAMESPACE, _ as grantCovers, a as denyAll, b as newlyGrantedPairs, c as requireIdentity, g as checkUpdatable, h as checkRevocable, i as allowVerbs, j as flattenGrant, k as encodeGrant, l as requireNamespace, n as row, o as denyVerbs, r as allowAll, s as requireCapability, t as applyRowFilters, v as grantEntriesConfer, w as or, x as revokedAtIso, y as newlyGranted } from "./row-DZ0Fnpc6.js";
4
- import { g as SchemaDriftError } from "./src-BLgbLq2k.js";
5
- import { S as reconcileIdentities, _ as currentStep, a as createDefaultDiagnosticsSink, b as DIAGNOSE_CHECKS, c as AuthError, d as AdminBackfillError, f as BACKFILL_CHUNK, g as STEP_MARKS, h as SKIPPABLE_STEPS, i as collectDiagnostics, l as NetworkError, m as ONBOARD_STEPS, n as tokenAudience, o as reduceSubscribeRows, p as CURRENT_MARK, r as SubstrateClient, s as watchRows, t as noRedirectFetch, u as SubscribeError, v as planOnboarding, x as diagnose, y as requiredOutstanding } from "./src-DMzc3HfW.js";
1
+ import { a as adminClaimCapabilities, c as makeTokenProvider, d as resolveDefaultKidPath, i as DEFAULT_CAPABILITIES, l as resolveAdminCredential, o as isEncryptedKey, r as ADMIN_CAPABILITIES, s as makeAuthorizationProvider, u as resolveDefaultKeyPath } from "./env-utils-s25Z1YSA.js";
2
+ import { A as expandFlat, C as not, D as isActiveAdminKeyRow, E as describeGrant, F as parseGrantEntries, I as decodeList, L as encodeList, M as grantEntryError, N as grantIsUniform, O as capabilitiesFor, P as intersectGrants, S as and, T as SYSTEM_NAMESPACE, _ as grantCovers, a as denyAll, b as newlyGrantedPairs, c as requireIdentity, g as checkUpdatable, h as checkRevocable, i as allowVerbs, j as flattenGrant, k as encodeGrant, l as requireNamespace, n as row, o as denyVerbs, r as allowAll, s as requireCapability, t as applyRowFilters, v as grantEntriesConfer, w as or, x as revokedAtIso, y as newlyGranted } from "./src-DmiUWOLp.js";
3
+ import { x as SchemaDriftError } from "./src-B_kHkbsr.js";
4
+ import { C as diagnose, E as createH2Fetch, S as DIAGNOSE_CHECKS, T as substrateFetch, _ as SKIPPABLE_STEPS, a as SubstrateClient, b as planOnboarding, c as reduceSubscribeRows, d as NetworkError, f as SubscribeError, g as ONBOARD_STEPS, h as CURRENT_MARK, i as tokenAudience, l as watchRows, m as BACKFILL_CHUNK, n as resolveAgentCapabilities, o as collectDiagnostics, p as AdminBackfillError, r as noRedirectFetch, s as createDefaultDiagnosticsSink, t as createClientFromEnv, u as AuthError, v as STEP_MARKS, w as reconcileIdentities, x as requiredOutstanding, y as currentStep } from "./src-BNdhH_Hx.js";
5
+ import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-A9dxMRZA.js";
6
6
 
7
- export { ADMIN_CAPABILITIES, AdminBackfillError, AuthError, BACKFILL_CHUNK, CURRENT_MARK, DEFAULT_CAPABILITIES, DIAGNOSE_CHECKS, NetworkError, ONBOARD_STEPS, SKIPPABLE_STEPS, STEP_MARKS, SYSTEM_NAMESPACE, SchemaDriftError, SubscribeError, SubstrateClient, adminClaimCapabilities, allowAll, allowVerbs, and, applyRowFilters, capabilitiesFor, checkRevocable, checkUpdatable, collectDiagnostics, createDefaultDiagnosticsSink, currentStep, decodeList, denyAll, denyVerbs, describeGrant, diagnose, encodeGrant, encodeList, expandFlat, flattenGrant, grantCovers, grantEntriesConfer, grantEntryError, grantIsUniform, intersectGrants, isActiveAdminKeyRow, isEncryptedKey, makeAuthorizationProvider, makeTokenProvider, newlyGranted, newlyGrantedPairs, noRedirectFetch, not, or, parseGrantEntries, planOnboarding, reconcileIdentities, reduceSubscribeRows, requireCapability, requireIdentity, requireNamespace, requiredOutstanding, resolveAdminCredential, resolveDefaultKeyPath, resolveDefaultKidPath, revokedAtIso, row, tokenAudience, watchRows };
7
+ export { ADMIN_CAPABILITIES, AdminBackfillError, AuthError, BACKFILL_CHUNK, CURRENT_MARK, DEFAULT_CAPABILITIES, DEFAULT_MAX_WRITES, DIAGNOSE_CHECKS, NetworkError, ONBOARD_STEPS, SKIPPABLE_STEPS, STEP_MARKS, SYSTEM_NAMESPACE, SchemaDriftError, SubscribeError, SubstrateClient, adminClaimCapabilities, allowAll, allowVerbs, and, applyRowFilters, capabilitiesFor, checkRevocable, checkUpdatable, collectDiagnostics, createClientFromEnv, createDefaultDiagnosticsSink, createH2Fetch, currentStep, decodeList, denyAll, denyVerbs, describeGrant, diagnose, encodeGrant, encodeList, expandFlat, flattenGrant, grantCovers, grantEntriesConfer, grantEntryError, grantIsUniform, intersectGrants, isActiveAdminKeyRow, isEncryptedKey, makeAuthorizationProvider, makeTokenProvider, newlyGranted, newlyGrantedPairs, noRedirectFetch, not, or, parseGrantEntries, planOnboarding, reconcileIdentities, reduceSubscribeRows, requireCapability, requireIdentity, requireNamespace, requiredOutstanding, resolveAdminCredential, resolveAgentCapabilities, resolveDefaultKeyPath, resolveDefaultKidPath, revokedAtIso, row, runScript, substrateFetch, tokenAudience, watchRows };
@@ -1,4 +1,3 @@
1
- import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
1
  import { parentPort } from "node:worker_threads";
3
2
  import { WasmClusterer } from "@mnmal-ai/holomap-clusterer";
4
3
 
@@ -1,4 +1,3 @@
1
- import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
1
  //#region ../../packages/substrate-pack/src/content-type.ts
3
2
  /**
4
3
  * Content-type negotiation. Spec: §7.0.
@@ -1,4 +1,3 @@
1
- import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
1
  import { readFileSync } from "node:fs";
3
2
  import { homedir } from "node:os";
4
3
  import { join } from "node:path";
@@ -1,5 +1,28 @@
1
- import { h as EdgeRef, p as Edge } from "./schema-g4FQLr0V.js";
1
+ import { En as EdgeRef, wn as Edge } from "./schema-DwnXxdjk.js";
2
2
  //#region ../../packages/substrate-types/src/errors.d.ts
3
+ /** A by-filter write matched more rows than `SUBSTRATE_FILTER_WRITE_MAX_MATCH`; nothing changed. */
4
+ declare const FILTER_TOO_BROAD = "filter_too_broad";
5
+ /** Refusal codes for the typed-edge-walk grammar. */
6
+ declare const WALKS_NEED_PARTITIONED = "walks_need_partitioned";
7
+ declare const WALKS_IN_SUBSCRIPTION = "walks_in_subscription";
8
+ declare const WALKS_IN_MUTATION = "walks_in_mutation";
9
+ declare const ROW_POLICY_BLOCKS_WALK = "row_policy_blocks_walk";
10
+ declare const WALK_BUDGET_EXCEEDED = "walk_budget_exceeded";
11
+ declare const WALKS_UNSUPPORTED_STORE = "walks_unsupported_store";
12
+ /** A read cancelled by the store's statement timeout; `details: { timeoutMs }`. */
13
+ declare const QUERY_TIMEOUT = "query_timeout";
14
+ /** No store connection came free within the wait limit, so the request never started; retry later. */
15
+ declare const STORE_BUSY = "store_busy";
16
+ /** An aggregate or expression whose value leaves its type's range (an int64 sum past 2^63-1); the same code on every engine. */
17
+ declare const VALUE_OUT_OF_RANGE = "value_out_of_range";
18
+ /** A regex call on the memory evaluator that would take more steps than its budget; `details: { budget }`. */
19
+ declare const REGEX_BUDGET_EXCEEDED = "regex_budget_exceeded";
20
+ /**
21
+ * A walk construct refused where it cannot be answered: inside a struct, over
22
+ * a list or struct-nested crossRef, under a reused field name, on a virtual
23
+ * type, or on a read path that does not evaluate walks.
24
+ */
25
+ declare const WALK_UNSUPPORTED_REF = "walk_unsupported_ref";
3
26
  /**
4
27
  * Throwable by a resolver to surface a structured per-frame error with a
5
28
  * caller-chosen `code` instead of the generic `resolver_error`. The engine's
@@ -29,6 +52,8 @@ declare class ResolverFrameError extends Error {
29
52
  readonly details?: Record<string, unknown>;
30
53
  constructor(code: string, message: string, details?: Record<string, unknown>);
31
54
  }
55
+ /** `filter_too_broad`: a by-filter write on `<namespace>/<type>` matched more than `maxMatch` rows. */
56
+ declare function filterTooBroad(namespace: string, type: string, maxMatch: number): ResolverFrameError;
32
57
  /**
33
58
  * Thrown by a write-path resolver when a crossRef declaring `onMissing: 'reject'`
34
59
  * references a target that does not exist (or has been tombstoned). Extends
@@ -78,11 +103,12 @@ declare class NamespaceMismatch extends Error {
78
103
  }
79
104
  /**
80
105
  * Thrown by `Dataset.updateField` when the caller targets a reserved
81
- * field name (e.g. `_deletedAt`). Spec §4.5.
106
+ * field name (e.g. `_deletedAt`), and by any other write path that refuses
107
+ * one; `how` names that path in the message. Spec §4.5.
82
108
  */
83
109
  declare class ReservedField extends Error {
84
110
  readonly name = "ReservedField";
85
- constructor(field: string);
111
+ constructor(field: string, how?: string);
86
112
  }
87
113
  /**
88
114
  * The `(auth)` tag `HttpBridgeClient` appends to a 401/403 cause. Single
@@ -105,6 +131,20 @@ declare class BridgeUnreachableError extends Error {
105
131
  readonly cause: unknown;
106
132
  constructor(bridgeName: string, baseUrl: string, cause: unknown);
107
133
  }
134
+ /**
135
+ * Thrown by a `BatchResolver` to refuse element `index` of its args list. The
136
+ * engine rolls back the whole array and reports `cause` as the per-element
137
+ * resolver would have: a `ResolverFrameError` or `RestrictViolation` keeps
138
+ * its code at `[key]`, and `batched_frame_rolled_back` names the element.
139
+ */
140
+ declare class BatchElementError extends Error {
141
+ readonly index: number;
142
+ readonly cause: unknown;
143
+ readonly name = "BatchElementError";
144
+ constructor(index: number, cause: unknown);
145
+ }
146
+ /** Recognise a {@link BatchElementError} across module-realm boundaries. */
147
+ declare function isBatchElementError(err: unknown): err is BatchElementError;
108
148
  /**
109
149
  * Recognise a {@link ResolverFrameError} across module-realm boundaries.
110
150
  *
@@ -127,4 +167,4 @@ declare function isResolverFrameError(err: unknown): err is ResolverFrameError;
127
167
  */
128
168
  declare function isRestrictViolation(err: unknown): err is RestrictViolation;
129
169
  //#endregion
130
- export { ResolverFrameError as a, isAuthCause as c, ReservedField as i, isResolverFrameError as l, MissingReferentError as n, RestrictViolation as o, NamespaceMismatch as r, UnsupportedFilterError as s, BridgeUnreachableError as t, isRestrictViolation as u };
170
+ export { isBatchElementError as C, isAuthCause as S, isRestrictViolation as T, WALKS_NEED_PARTITIONED as _, NamespaceMismatch as a, WALK_UNSUPPORTED_REF as b, ROW_POLICY_BLOCKS_WALK as c, RestrictViolation as d, STORE_BUSY as f, WALKS_IN_SUBSCRIPTION as g, WALKS_IN_MUTATION as h, MissingReferentError as i, ReservedField as l, VALUE_OUT_OF_RANGE as m, BridgeUnreachableError as n, QUERY_TIMEOUT as o, UnsupportedFilterError as p, FILTER_TOO_BROAD as r, REGEX_BUDGET_EXCEEDED as s, BatchElementError as t, ResolverFrameError as u, WALKS_UNSUPPORTED_STORE as v, isResolverFrameError as w, filterTooBroad as x, WALK_BUDGET_EXCEEDED as y };
@@ -1,4 +1,3 @@
1
- import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
1
  import { createHash } from "node:crypto";
3
2
 
4
3
  //#region ../../packages/substrate-embedder/src/fake.ts