@mnmal-ai/substrate 1.0.0-alpha.1 → 1.0.0-alpha.11

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 (47) hide show
  1. package/README.md +48 -6
  2. package/dist/boot-store-C5vNZJ3i.js +4065 -0
  3. package/dist/{runtime-metrics-DwpDJ8vz.d.ts → bridge-COu0Tg_h.d.ts} +2 -87
  4. package/dist/cli-BrwW4tjO.js +3144 -0
  5. package/dist/client.d.ts +129 -8
  6. package/dist/client.js +6 -5
  7. package/dist/{agent-token-BIboWOU0.js → env-utils-CGNazUNt.js} +31 -2
  8. package/dist/{errors-D4vKuwz8.d.ts → errors-BOllGhVx.d.ts} +15 -2
  9. package/dist/{index-D7mSOFlM.d.ts → index-Cp74OcmS.d.ts} +1 -1
  10. package/dist/node-version-C5FSmwJX.js +26 -0
  11. package/dist/pack.d.ts +2 -2
  12. package/dist/pack.js +1 -1
  13. package/dist/pg-edges-store-BLsbcXkk.js +381 -0
  14. package/dist/{plugin-BuQQEzL-.js → plugin-DIYm2cZE.js} +171 -18
  15. package/dist/proposals-bootstrap.js +6 -4
  16. package/dist/proposals.config.schema.json +5 -0
  17. package/dist/proposals.d.ts +14 -4
  18. package/dist/proposals.default-config.json +2 -1
  19. package/dist/proposals.js +2 -2
  20. package/dist/recall-bootstrap.js +13 -4
  21. package/dist/recall.config.schema.json +12 -0
  22. package/dist/recall.d.ts +53 -9
  23. package/dist/recall.js +2 -2
  24. package/dist/{repl-C52wyfMs.js → repl-B8gy0YM7.js} +63 -30
  25. package/dist/{row-ByLFE2Wx.d.ts → row-DwaDU4b-.d.ts} +58 -9
  26. package/dist/run-B18qtGKc.js +2012 -0
  27. package/dist/{plugin-t2g2wX0b.d.ts → schema-CijHRfuk.d.ts} +957 -16
  28. package/dist/script-C6DSa_Na.js +134 -0
  29. package/dist/sdk.d.ts +104 -16
  30. package/dist/sdk.js +5 -110
  31. package/dist/{src-DuopV8u7.js → src-Br6aDUti.js} +153 -20
  32. package/dist/{src-5hVbeiAu.js → src-D041j6GS.js} +697 -57
  33. package/dist/{src-YXlv_RyL.js → src-DK7VEQT6.js} +4099 -1040
  34. package/dist/{src-C4DzaIQZ.js → src-Dbvuel6w.js} +392 -282
  35. package/dist/{row-DK7lPZVe.js → src-DpPdw2oL.js} +11 -11
  36. package/dist/{src-zcyUofMJ.js → src-DptNGNYQ.js} +39 -15
  37. package/dist/src-gz4I1F29.js +5097 -0
  38. package/dist/substrate-admin.js +17 -781
  39. package/dist/substrate.js +4 -5476
  40. package/dist/testing.d.ts +582 -9
  41. package/dist/testing.js +39 -3
  42. package/dist/{ws-C72iVS5T.d.ts → ws-DC8OhMaV.d.ts} +2 -3
  43. package/package.json +22 -20
  44. package/dist/dataset-DOXGRz50.js +0 -1535
  45. package/dist/env-utils-B7SGmoeJ.js +0 -21
  46. package/dist/schema-g4FQLr0V.d.ts +0 -433
  47. package/dist/src-CjEwiKXw.js +0 -2327
package/dist/client.d.ts CHANGED
@@ -1,8 +1,6 @@
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 { B as QualifiedFrame, Cn as Row, an as RuntimeErrors, f as PackEnvelope, in as RuntimeErrorEntry, m as Schema, on as RuntimeMetrics, rn as ResolverStat, sn as SlowRequest, tn as ProcessStat } from "./schema-CijHRfuk.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, 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, dt as NlTrailEvent, f as checkRevocable, g as newlyGranted, h as grantEntriesConfer, i as allowVerbs, it as NlOutcome, j as not, k as encodeList, l as requireNamespace, m as grantCovers, n as row, o as denyVerbs, p as checkUpdatable, pt as NlWireEvent, q as resolveDefaultKidPath, r as allowAll, s as requireCapability, t as applyRowFilters, u as KeyMutationRefusal, ut as NlServedPack, v as revokedAtIso, w as grantEntryError, x as encodeGrant, y as Grant, z as makeTokenProvider } from "./row-DwaDU4b-.js";
3
+ import { s as SchemaDriftError } from "./index-Cp74OcmS.js";
6
4
  import { Signal } from "@preact/signals-core";
7
5
  //#region ../../packages/substrate-client/src/admin/surgery.d.ts
8
6
  type AdminDropCascade = 'refuse' | 'delete';
@@ -436,8 +434,8 @@ interface Diagnostic {
436
434
  * substrate's explanation.
437
435
  *
438
436
  * 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.
437
+ * honour. What is lost is the engine's operator and operand check, so a
438
+ * malformed filter fails later and less clearly, or not at all.
441
439
  */
442
440
  filterValidationSkipped?: string;
443
441
  /**
@@ -742,6 +740,129 @@ export declare class SubscribeError extends Error {
742
740
  constructor(message: string, code: string);
743
741
  }
744
742
  //#endregion
743
+ //#region ../../packages/substrate-client/src/from-env.d.ts
744
+ /**
745
+ * The capabilities a client asks for, from `SUBSTRATE_AGENT_CAPABILITIES` (csv),
746
+ * defaulting to `substrate-policy`'s default.
747
+ *
748
+ * Not `ADMIN_CAPABILITIES`: a dataset-registry key intersects the claim, but a
749
+ * file-registry key takes it verbatim, so a wider default would promote every
750
+ * agent on such a deployment to admin.
751
+ */
752
+ export declare function resolveAgentCapabilities(env: NodeJS.ProcessEnv): ReadonlyArray<string>;
753
+ interface ClientFromEnvOptions extends Omit<SubstrateClientOptions, 'endpoint' | 'token' | 'getToken'> {
754
+ env?: NodeJS.ProcessEnv;
755
+ /** Allow an unsigned client when no signing key is configured. Default false. */
756
+ allowAnonymous?: boolean;
757
+ }
758
+ interface ClientFromEnv {
759
+ client: SubstrateClient;
760
+ endpoint: string;
761
+ /** The signing kid, or null for an anonymous client. */
762
+ kid: string | null;
763
+ }
764
+ /**
765
+ * Builds a client from `SUBSTRATE_URL` and `SUBSTRATE_AGENT_KEY_ID` +
766
+ * `SUBSTRATE_AGENT_KEY_PATH`, signing every request as that kid.
767
+ *
768
+ * Redirects are refused and the token's audience is the endpoint's origin.
769
+ *
770
+ * @throws Error when `SUBSTRATE_URL` is unset or unsafe for a credential, when
771
+ * only one of the key pair is set, when the key cannot be read, or when no
772
+ * key is set and `allowAnonymous` is not.
773
+ */
774
+ export declare function createClientFromEnv(opts?: ClientFromEnvOptions): ClientFromEnv;
775
+ //#endregion
776
+ //#region ../../packages/substrate-client/src/script.d.ts
777
+ /**
778
+ * `read` refuses every mutation, `dry-run` records mutations without sending
779
+ * them, and `write` sends them up to `maxWrites` frames.
780
+ */
781
+ type ScriptMode = 'read' | 'dry-run' | 'write';
782
+ interface ScriptMutation {
783
+ frame: QualifiedFrame;
784
+ /** True when any op-key came back with data; a refused payload otherwise rolls back whole. */
785
+ applied: boolean;
786
+ errors?: PackEnvelope['errors'];
787
+ }
788
+ interface ScriptRecallInput {
789
+ query: string;
790
+ /** Required, as on every recall surface. */
791
+ namespace: string;
792
+ /** Required, as on every recall surface: there is no default type. */
793
+ type: string;
794
+ k?: number;
795
+ threshold?: number;
796
+ where?: Record<string, unknown>;
797
+ /** `true` for the whole row, or the fields to return beside `id`. Omit for the handle fields. */
798
+ row?: true | Record<string, true>;
799
+ }
800
+ interface ScriptRecallHit {
801
+ id: string;
802
+ namespace: string;
803
+ type: string;
804
+ score: number;
805
+ kind: 'seed' | 'expansion';
806
+ expandedFrom?: unknown;
807
+ row: Record<string, unknown>;
808
+ }
809
+ /** What a script's default export receives. */
810
+ interface ScriptContext {
811
+ readonly kid: string | null;
812
+ readonly mode: ScriptMode;
813
+ /** The caller's `--args` object; `{}` when none was passed. */
814
+ readonly args: Readonly<Record<string, unknown>>;
815
+ /**
816
+ * One query. Throws when a requested key is missing from `data`, which is a
817
+ * rejected frame, not an empty result.
818
+ */
819
+ query(frame: QualifiedFrame): Promise<PackEnvelope>;
820
+ /** Every row of a single-key query, paging until `hasMore` is false. */
821
+ queryAll(key: string, frame: {
822
+ params?: Record<string, unknown>;
823
+ fields?: unknown;
824
+ }): Promise<Record<string, unknown>[]>;
825
+ /** Recall hits, best first, through the `recall/Hit` frame. */
826
+ recall(input: ScriptRecallInput): Promise<ScriptRecallHit[]>;
827
+ /**
828
+ * One mutate payload (one transaction). Returns null in `dry-run`, and throws
829
+ * in `read`, past `maxWrites`, or when the server refuses any frame.
830
+ */
831
+ mutate(frame: QualifiedFrame): Promise<PackEnvelope | null>;
832
+ /** Writes to stderr; stdout carries only the result. */
833
+ log(...args: unknown[]): void;
834
+ }
835
+ interface ScriptReport {
836
+ ok: boolean;
837
+ kid: string | null;
838
+ mode: ScriptMode;
839
+ args: Record<string, unknown>;
840
+ result?: unknown;
841
+ error?: string;
842
+ mutations: ScriptMutation[];
843
+ warnings: string[];
844
+ stats: {
845
+ queries: number;
846
+ writes: number;
847
+ ms: number;
848
+ };
849
+ }
850
+ interface RunScriptOptions {
851
+ client: SubstrateClient;
852
+ kid: string | null;
853
+ mode?: ScriptMode;
854
+ args?: Record<string, unknown>;
855
+ maxWrites?: number;
856
+ maxPages?: number;
857
+ log?: (line: string) => void;
858
+ }
859
+ export declare const DEFAULT_MAX_WRITES = 50;
860
+ /**
861
+ * Runs `script` against a guarded context and reports everything it did,
862
+ * including the mutations applied before any failure.
863
+ */
864
+ export declare function runScript(script: (s: ScriptContext) => unknown, opts: RunScriptOptions): Promise<ScriptReport>;
865
+ //#endregion
745
866
  //#region ../../packages/substrate-client/src/subscribe-rows.d.ts
746
867
  /**
747
868
  * Fold one subscribe event into `current`, returning the next row list. Pure:
@@ -779,4 +900,4 @@ export declare function tokenAudience(baseUrl: string): string;
779
900
  /** `fetchImpl` with redirects refused: a redirect would carry the credential to wherever it points. */
780
901
  export declare function noRedirectFetch(fetchImpl?: typeof fetch): typeof fetch;
781
902
  //#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 };
903
+ 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 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 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 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 };
package/dist/client.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
- import { a as makeAuthorizationProvider, c as resolveDefaultKeyPath, i as isEncryptedKey, l as resolveDefaultKidPath, n as DEFAULT_CAPABILITIES, o as makeTokenProvider, r as adminClaimCapabilities, s as resolveAdminCredential, t as ADMIN_CAPABILITIES } from "./agent-token-BIboWOU0.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-DK7lPZVe.js";
4
- import { g as SchemaDriftError } from "./src-C4DzaIQZ.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-DuopV8u7.js";
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 "./src-DpPdw2oL.js";
4
+ import { f as SchemaDriftError } from "./src-Dbvuel6w.js";
5
+ import { C as diagnose, S as DIAGNOSE_CHECKS, _ 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-Br6aDUti.js";
6
+ import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-C6DSa_Na.js";
6
7
 
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 };
8
+ 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, 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, tokenAudience, watchRows };
@@ -111,7 +111,7 @@ function adminClaimCapabilities(env) {
111
111
  return custom === void 0 || custom.length === 0 || ADMIN_CAPABILITIES.includes(custom) ? ADMIN_CAPABILITIES : [...ADMIN_CAPABILITIES, custom];
112
112
  }
113
113
  function b64url(buf) {
114
- return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
114
+ return buf.toString("base64url");
115
115
  }
116
116
  function sign$1(kid, key, ns, capabilities, aud) {
117
117
  const now = Math.floor(Date.now() / 1e3);
@@ -197,4 +197,33 @@ function makeAuthorizationProvider(cred, opts = {}) {
197
197
  }
198
198
 
199
199
  //#endregion
200
- export { makeAuthorizationProvider as a, resolveDefaultKeyPath as c, isEncryptedKey as i, resolveDefaultKidPath as l, DEFAULT_CAPABILITIES as n, makeTokenProvider as o, adminClaimCapabilities as r, resolveAdminCredential as s, ADMIN_CAPABILITIES as t };
200
+ //#region ../../packages/substrate-types/src/env-utils.ts
201
+ /**
202
+ * Pure env-string parsing helpers shared by plugins and deployment helpers
203
+ * (e.g. `substrate-sentinel-client`) without a substrate-sdk runtime dep.
204
+ */
205
+ /**
206
+ * Strict positive-integer env parsing. Returns `fallback` when `raw` is
207
+ * undefined (env var unset). Throws with `envVar` in the message when `raw`
208
+ * is set but not a positive integer — never falls back on invalid input, so
209
+ * a config typo fails at boot.
210
+ */
211
+ function parsePositiveInt(raw, envVar, fallback) {
212
+ if (raw === void 0) return fallback;
213
+ const n = Number(raw);
214
+ if (!Number.isFinite(n) || !Number.isInteger(n) || n <= 0) throw new Error(`${envVar} must be a positive integer (got '${raw}')`);
215
+ return n;
216
+ }
217
+ /**
218
+ * `url` with its trailing slashes removed, for joining a configured base URL
219
+ * to a path. A loop rather than `/\/+$/`, which backtracks quadratically on a
220
+ * long run of slashes that does not end the string.
221
+ */
222
+ function trimTrailingSlashes(url) {
223
+ let end = url.length;
224
+ while (end > 0 && url.charCodeAt(end - 1) === 47) end--;
225
+ return url.slice(0, end);
226
+ }
227
+
228
+ //#endregion
229
+ export { adminClaimCapabilities as a, makeTokenProvider as c, resolveDefaultKidPath as d, DEFAULT_CAPABILITIES as i, resolveAdminCredential as l, trimTrailingSlashes as n, isEncryptedKey as o, ADMIN_CAPABILITIES as r, makeAuthorizationProvider as s, parsePositiveInt as t, resolveDefaultKeyPath as u };
@@ -1,5 +1,18 @@
1
- import { h as EdgeRef, p as Edge } from "./schema-g4FQLr0V.js";
1
+ import { fn as EdgeRef, un as Edge } from "./schema-CijHRfuk.js";
2
2
  //#region ../../packages/substrate-types/src/errors.d.ts
3
+ /** Refusal codes for the typed-edge-walk grammar. */
4
+ declare const WALKS_NEED_PARTITIONED = "walks_need_partitioned";
5
+ declare const WALKS_IN_SUBSCRIPTION = "walks_in_subscription";
6
+ declare const WALKS_IN_MUTATION = "walks_in_mutation";
7
+ declare const ROW_POLICY_BLOCKS_WALK = "row_policy_blocks_walk";
8
+ declare const WALK_BUDGET_EXCEEDED = "walk_budget_exceeded";
9
+ declare const WALKS_UNSUPPORTED_STORE = "walks_unsupported_store";
10
+ /**
11
+ * A walk construct refused where it cannot be answered: inside a struct, over
12
+ * a list or struct-nested crossRef, under a reused field name, on a virtual
13
+ * type, or on a read path that does not evaluate walks.
14
+ */
15
+ declare const WALK_UNSUPPORTED_REF = "walk_unsupported_ref";
3
16
  /**
4
17
  * Throwable by a resolver to surface a structured per-frame error with a
5
18
  * caller-chosen `code` instead of the generic `resolver_error`. The engine's
@@ -127,4 +140,4 @@ declare function isResolverFrameError(err: unknown): err is ResolverFrameError;
127
140
  */
128
141
  declare function isRestrictViolation(err: unknown): err is RestrictViolation;
129
142
  //#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 };
143
+ export { isRestrictViolation as _, ReservedField as a, UnsupportedFilterError as c, WALKS_NEED_PARTITIONED as d, WALKS_UNSUPPORTED_STORE as f, isResolverFrameError as g, isAuthCause as h, ROW_POLICY_BLOCKS_WALK as i, WALKS_IN_MUTATION as l, WALK_UNSUPPORTED_REF as m, MissingReferentError as n, ResolverFrameError as o, WALK_BUDGET_EXCEEDED as p, NamespaceMismatch as r, RestrictViolation as s, BridgeUnreachableError as t, WALKS_IN_SUBSCRIPTION as u };
@@ -1,4 +1,4 @@
1
- import { l as PackEnvelope, n as FieldDef, s as FieldInput, u as Schema } from "./schema-g4FQLr0V.js";
1
+ import { f as PackEnvelope, i as FieldDef, l as FieldInput, m as Schema } from "./schema-CijHRfuk.js";
2
2
  import { pack as packFrame, unpack as unpackFrame } from "msgpackr";
3
3
  //#region ../../packages/substrate-pack/src/decoder.d.ts
4
4
  interface DecodeContext {
@@ -0,0 +1,26 @@
1
+ import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
+ //#region src/node-version.ts
3
+ /** The oldest Node the binaries run on; matches `engines.node` in package.json. */
4
+ const MIN_NODE_VERSION = "26.12.1";
5
+ /** Returns a refusal message when `version` (e.g. `process.versions.node`) is below the minimum, else null. */
6
+ function nodeVersionRefusal(version) {
7
+ const have = version.split(".").map(Number);
8
+ const want = MIN_NODE_VERSION.split(".").map(Number);
9
+ for (let i = 0; i < 3; i++) {
10
+ const a = have[i] ?? 0;
11
+ const b = want[i] ?? 0;
12
+ if (a > b) return null;
13
+ if (a < b) return `substrate requires Node ${MIN_NODE_VERSION} or newer; this is Node ${version}`;
14
+ }
15
+ return null;
16
+ }
17
+ /** Exits the process with a refusal when the running Node is below the minimum. */
18
+ function assertNodeVersion() {
19
+ const refusal = nodeVersionRefusal(process.versions.node);
20
+ if (refusal === null) return;
21
+ process.stderr.write(`${refusal}\n`);
22
+ process.exit(1);
23
+ }
24
+
25
+ //#endregion
26
+ export { assertNodeVersion as t };
package/dist/pack.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { l as PackEnvelope, n as FieldDef, s as FieldInput, u as Schema } from "./schema-g4FQLr0V.js";
2
- import { a as DecodeEnvelopeCtx, c as decodeEnvelope, i as DecodeContext, l as decodePositional, n as packFrame, o as PackDecodeError, r as unpackFrame, s as SchemaDriftError, t as WS_SUBPROTOCOL_SUBSTRATE_PACK, u as decodePositionalFromFieldDef } from "./index-D7mSOFlM.js";
1
+ import { f as PackEnvelope, i as FieldDef, l as FieldInput, m as Schema } from "./schema-CijHRfuk.js";
2
+ import { a as DecodeEnvelopeCtx, c as decodeEnvelope, i as DecodeContext, l as decodePositional, n as packFrame, o as PackDecodeError, r as unpackFrame, s as SchemaDriftError, t as WS_SUBPROTOCOL_SUBSTRATE_PACK, u as decodePositionalFromFieldDef } from "./index-Cp74OcmS.js";
3
3
  //#region ../../packages/substrate-pack/src/content-type.d.ts
4
4
  /**
5
5
  * Content-type negotiation. Spec: §7.0.
package/dist/pack.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
- import { _ as decodeEnvelope, a as buildDecodePlan, c as isPlainRequestData, d as PackEncodeError, f as encodeEnvelope, g as SchemaDriftError, h as PackDecodeError, i as applyDecodePlanInPlace, l as decodeStreamChunk, m as encodePositionalFromFieldDef, n as packFrame, o as decodeWsEnvelope, p as encodePositional, r as unpackFrame, s as encodeWsFrame, t as WS_SUBPROTOCOL_SUBSTRATE_PACK, u as encodeStreamChunk, v as decodePositional, y as decodePositionalFromFieldDef } from "./src-C4DzaIQZ.js";
2
+ import { _ as encodeEnvelope, a as buildDecodePlan, c as isPlainRequestData, d as PackDecodeError, f as SchemaDriftError, g as PackEncodeError, h as decodePositionalFromFieldDef, i as applyDecodePlanInPlace, l as decodeStreamChunk, m as decodePositional, n as packFrame, o as decodeWsEnvelope, p as decodeEnvelope, r as unpackFrame, s as encodeWsFrame, t as WS_SUBPROTOCOL_SUBSTRATE_PACK, u as encodeStreamChunk, v as encodePositional, y as encodePositionalFromFieldDef } from "./src-Dbvuel6w.js";
3
3
  import { n as acceptsPack, t as PACK_MIME } from "./content-type-C7T28xNb.js";
4
4
 
5
5
  export { PACK_MIME, PackDecodeError, PackEncodeError, SchemaDriftError, WS_SUBPROTOCOL_SUBSTRATE_PACK, acceptsPack, applyDecodePlanInPlace, buildDecodePlan, decodeEnvelope, decodePositional, decodePositionalFromFieldDef, decodeStreamChunk, decodeWsEnvelope, encodeEnvelope, encodePositional, encodePositionalFromFieldDef, encodeStreamChunk, encodeWsFrame, isPlainRequestData, packFrame, unpackFrame };