@mnmal-ai/substrate 1.0.0-beta.1 → 1.0.0-beta.3

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.
package/README.md CHANGED
@@ -22,7 +22,7 @@ A plugin package declares `@mnmal-ai/substrate` as a peer dependency and as a de
22
22
  | Subcommand | Purpose |
23
23
  |---|---|
24
24
  | `substrate serve` | Boot the HTTP server (default port 3100) |
25
- | `substrate mcp` | stdio MCP server; reads `SUBSTRATE_URL`, and `SUBSTRATE_MCP_TOOLS` (csv) to register only some tools |
25
+ | `substrate mcp` | stdio MCP server; reads `SUBSTRATE_URL`, and `SUBSTRATE_MCP_TOOLS` (csv of tool names, `core` or `all`; `core` is query, mutate, schema, recall, run, whoami; unset means `core`) |
26
26
  | `substrate init [dir] [flags]` | Scaffold a runtime directory (interactive; `--yes` for scripted use) |
27
27
  | `substrate ask <question…>` | Ask a natural-language question (needs `substrate-nl`) |
28
28
  | `substrate run <script.mts>` | Run a script against a signed, guarded client and print one JSON report |
@@ -1,11 +1,11 @@
1
- import { A as isReservedAutoCrudField, Bn as DEFAULT_FILTER_WRITE_LIMITS, Gt as WS_REASON_SERVER_RESTART, Ht as parseAuthConfig, It as HttpBridgeClient, Rt as buildContext, Z as MemoryEdgesStore, _ as AUDIT_EVENT_TYPE, a as composeFromManifests, bt as registerExtensionOperator, c as MemoryDataset, et as effectiveFilterOperators, g as buildAuditRow, h as SYSTEM_TYPE_DEFS, i as PluginLoadError, n as kernelMigrationTracking, o as DEFAULT_NAMESPACE, r as mountKernelRoute, s as compose, t as composeKernelPlugins, u as isStoreProfileName, vt as getExtensionOperator, xt as unregisterExtensionOperator, yt as listExtensionOperators } from "./src-CKSJ13p8.js";
1
+ import { A as isReservedAutoCrudField, Gt as WS_REASON_SERVER_RESTART, Ht as parseAuthConfig, It as HttpBridgeClient, Rt as buildContext, Vn as DEFAULT_FILTER_WRITE_LIMITS, Z as MemoryEdgesStore, _ as AUDIT_EVENT_TYPE, a as composeFromManifests, bt as registerExtensionOperator, c as MemoryDataset, et as effectiveFilterOperators, g as buildAuditRow, h as SYSTEM_TYPE_DEFS, i as PluginLoadError, n as kernelMigrationTracking, o as DEFAULT_NAMESPACE, r as mountKernelRoute, s as compose, t as composeKernelPlugins, u as isStoreProfileName, vt as getExtensionOperator, xt as unregisterExtensionOperator, yt as listExtensionOperators } from "./src-WYba7eEl.js";
2
2
  import { a as adminClaimCapabilities, d as resolveDefaultKidPath, l as resolveAdminCredential, n as trimTrailingSlashes, r as ADMIN_CAPABILITIES, s as makeAuthorizationProvider, t as parsePositiveInt, u as resolveDefaultKeyPath } from "./env-utils-s25Z1YSA.js";
3
3
  import { D as isActiveAdminKeyRow, E as describeGrant, L as encodeList, M as grantEntryError, T as SYSTEM_NAMESPACE, v as grantEntriesConfer } from "./src-DmiUWOLp.js";
4
4
  import { r as FRAMES_JSON_MIME, s as decodeStreamFrames, u as withIdleTimeout } from "./src-B_kHkbsr.js";
5
5
  import { C as diagnose, S as DIAGNOSE_CHECKS, T as substrateFetch, _ as SKIPPABLE_STEPS, b as planOnboarding, h as CURRENT_MARK, i as tokenAudience, v as STEP_MARKS, x as requiredOutstanding, y as currentStep } from "./src-FXO5JPyk.js";
6
- import { b as runMigrations, g as deriveListIndexMigration, h as assertTablesLayout, n as PgEdgesStore, p as assertNotMigrating, r as PgDataset, t as PgIdempotencyStore, v as pendingMigrations, y as runDerivedMigrations } from "./src-BMD2OE--.js";
7
- import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore } from "./src-CW7eRDss.js";
8
- import { et as memberKey } from "./plugin-CEOhrEme.js";
6
+ import { b as runMigrations, g as deriveListIndexMigration, h as assertTablesLayout, n as PgEdgesStore, p as assertNotMigrating, r as PgDataset, t as PgIdempotencyStore, v as pendingMigrations, y as runDerivedMigrations } from "./src-DQMA57_1.js";
7
+ import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore } from "./src-D-UHaQiB.js";
8
+ import { et as memberKey } from "./plugin-DkYf0ng8.js";
9
9
  import { existsSync, linkSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10
10
  import { homedir } from "node:os";
11
11
  import { basename, dirname, join, resolve } from "node:path";
@@ -1753,7 +1753,7 @@ async function closeQuietly(sql) {
1753
1753
 
1754
1754
  //#endregion
1755
1755
  //#region package.json
1756
- var version = "1.0.0-beta.1";
1756
+ var version = "1.0.0-beta.3";
1757
1757
 
1758
1758
  //#endregion
1759
1759
  //#region src/plugin-manifest.ts
@@ -2267,7 +2267,7 @@ var FastifySubstrateServer = class {
2267
2267
  port
2268
2268
  });
2269
2269
  const info = this.fastify.addresses()[0];
2270
- if (!info) {
2270
+ if (info === void 0 || typeof info === "string") {
2271
2271
  const match = /:(\d+)$/.exec(address);
2272
2272
  return {
2273
2273
  address: host,
@@ -1,12 +1,12 @@
1
- import { _ as AUDIT_EVENT_TYPE, g as buildAuditRow, it as saveSweepState, m as runInviteSweep, mn as validateHardDeleteEnv, nt as loadSweepState, rt as runSweep, u as isStoreProfileName, v as INVITE_TYPE } from "./src-CKSJ13p8.js";
1
+ import { _ as AUDIT_EVENT_TYPE, g as buildAuditRow, it as saveSweepState, m as runInviteSweep, mn as validateHardDeleteEnv, nt as loadSweepState, rt as runSweep, u as isStoreProfileName, v as INVITE_TYPE } from "./src-WYba7eEl.js";
2
2
  import { n as trimTrailingSlashes, s as makeAuthorizationProvider } from "./env-utils-s25Z1YSA.js";
3
3
  import { L as encodeList, T as SYSTEM_NAMESPACE, f as coversNamespace, m as grantedIn, p as grantOf } from "./src-DmiUWOLp.js";
4
4
  import { B as EXPR_AGGREGATES, H as EXPR_LIMITS, V as EXPR_FUNCTIONS, z as DATE_UNITS } from "./src-B_kHkbsr.js";
5
- import { X as AdminCliError, _ as version, a as MS_PER_DAY, c as parseEnv, d as redactStoreSpec, h as startSentinelClient, m as runDeferredIndexBuilds, n as resolvePluginDir, o as parseBridgeCreds, p as reportUnguardedIndexBuilds, s as parseBridges, t as bootStore, v as openPgDataset } from "./boot-store-BMQUbHKv.js";
5
+ import { X as AdminCliError, _ as version, a as MS_PER_DAY, c as parseEnv, d as redactStoreSpec, h as startSentinelClient, m as runDeferredIndexBuilds, n as resolvePluginDir, o as parseBridgeCreds, p as reportUnguardedIndexBuilds, s as parseBridges, t as bootStore, v as openPgDataset } from "./boot-store-u_1PJSvo.js";
6
6
  import { T as substrateFetch, a as SubstrateClient, d as NetworkError, i as tokenAudience, n as resolveAgentCapabilities, p as AdminBackfillError, r as noRedirectFetch, t as createClientFromEnv, u as AuthError } from "./src-FXO5JPyk.js";
7
7
  import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-ByQ9pzhC.js";
8
- import { D as tryWithPgAdvisoryLock } from "./src-BMD2OE--.js";
9
- import { n as PgLexicalStore, r as PgEmbeddingsStore } from "./src-CW7eRDss.js";
8
+ import { D as tryWithPgAdvisoryLock } from "./src-DQMA57_1.js";
9
+ import { n as PgLexicalStore, r as PgEmbeddingsStore } from "./src-D-UHaQiB.js";
10
10
  import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
11
11
  import { homedir, hostname, tmpdir } from "node:os";
12
12
  import { basename, dirname, join, resolve } from "node:path";
@@ -2165,7 +2165,7 @@ async function runInit(argv) {
2165
2165
  return 1;
2166
2166
  }
2167
2167
  if (!config.yes) try {
2168
- const { runRepl } = await import("./repl-BvDZy-Ut.js");
2168
+ const { runRepl } = await import("./repl-Bm2nSvCW.js");
2169
2169
  config = await runRepl(config);
2170
2170
  } catch (err) {
2171
2171
  if (err.message?.includes("User force closed")) return 130;
@@ -2644,6 +2644,7 @@ const CONVENTIONS = [
2644
2644
  "- In one `mutate` call the single-frame keys commit together or not at all, and an array under one key is one transaction. Send unrelated writes as separate calls.",
2645
2645
  "- `createdAt`, `updatedAt`, `createdBy` and `updatedBy` are server-set: never send them; read them through `_metadata`.",
2646
2646
  "- `whoami` says which identity this session reads and writes as.",
2647
+ "- If an admin tool (propose_type, propose_field, propose_index, drop_namespace, drop_type) or ask is missing from your tools, set SUBSTRATE_MCP_TOOLS=all (or core,<name>) in the MCP server env.",
2647
2648
  "- With a shell, `substrate run <script.mts>` runs many reads and writes in one call and returns one small report (GET /substrate/v1/onboard, `instructions.codeMode`)."
2648
2649
  ].join("\n");
2649
2650
  /** The MCP `instructions` text: the conventions, then this server's types as of session start. */
@@ -2719,22 +2720,22 @@ const payloadSchema = (example) => z.unknown().transform((raw, ctx) => {
2719
2720
  if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
2720
2721
  ctx.addIssue({
2721
2722
  code: "custom",
2722
- message: "payload must decode to a JSON object"
2723
+ message: "payload must decode to a JSON object — e.g. { \"default/Todo\": { \"params\": { \"limit\": 5 }, \"fields\": { \"id\": true } } }"
2723
2724
  });
2724
2725
  return z.NEVER;
2725
2726
  }
2726
2727
  return parsed;
2727
- } catch {
2728
+ } catch (err) {
2728
2729
  ctx.addIssue({
2729
2730
  code: "custom",
2730
- message: "payload must be valid JSON"
2731
+ message: `payload must be valid JSON (${err.message})`
2731
2732
  });
2732
2733
  return z.NEVER;
2733
2734
  }
2734
2735
  if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
2735
2736
  ctx.addIssue({
2736
2737
  code: "custom",
2737
- message: "payload must be an object or a JSON string decoding to an object"
2738
+ message: "payload must be an object or a JSON string decoding to an object — e.g. { \"default/Todo\": { \"params\": { \"limit\": 5 }, \"fields\": { \"id\": true } } }"
2738
2739
  });
2739
2740
  return z.NEVER;
2740
2741
  }
@@ -2904,12 +2905,51 @@ function createQueryHandler(endpoint) {
2904
2905
  }
2905
2906
  };
2906
2907
  }
2908
+ /** The refusal codes that mean the frame's params do not fit the type. */
2909
+ const SHAPE_CODES = /* @__PURE__ */ new Set([
2910
+ "unknown_field",
2911
+ "missing_required_field",
2912
+ "invalid_enum_value",
2913
+ "invalid_field_type"
2914
+ ]);
2915
+ /** The type a generated mutation key writes, or null for any other key. */
2916
+ function typeOfOp(key) {
2917
+ const slash = key.indexOf("/");
2918
+ if (slash < 1) return null;
2919
+ const m = /^(create|update|upsert|delete)(Many)?([A-Z][A-Za-z0-9_]*)$/.exec(key.slice(slash + 1));
2920
+ return m?.[3] === void 0 ? null : {
2921
+ ns: key.slice(0, slash),
2922
+ type: m[3]
2923
+ };
2924
+ }
2925
+ /** Each shape-refused type's write contract, keyed `<ns>/<Type>`; undefined when there is none. */
2926
+ async function shapeContracts(endpoint, errors) {
2927
+ const types = /* @__PURE__ */ new Map();
2928
+ for (const e of errors) {
2929
+ if (e.code === void 0 || !SHAPE_CODES.has(e.code)) continue;
2930
+ const t = typeof e.path?.[0] === "string" ? typeOfOp(e.path[0]) : null;
2931
+ if (t !== null) types.set(`${t.ns}/${t.type}`, t);
2932
+ }
2933
+ const found = (await Promise.all([...types].map(async ([key, { ns, type }]) => {
2934
+ try {
2935
+ return [key, await getSubstrate(endpoint, `/substrate/v1/schema/${encodeURIComponent(ns)}/${encodeURIComponent(type)}?shape=fields`)];
2936
+ } catch {
2937
+ return null;
2938
+ }
2939
+ }))).filter((f) => f !== null);
2940
+ return found.length === 0 ? void 0 : Object.fromEntries(found);
2941
+ }
2907
2942
  function createMutateHandler(endpoint) {
2908
2943
  return async (args) => {
2909
2944
  const payload = frameOf(args);
2910
2945
  if (payload === void 0) return errorResult(MISSING_PAYLOAD);
2911
2946
  try {
2912
- return okResult(await postSubstrate(endpoint, "/substrate/v1/mutate", payload));
2947
+ const envelope = await postSubstrate(endpoint, "/substrate/v1/mutate", payload);
2948
+ const contract = await shapeContracts(endpoint, envelope.errors ?? []);
2949
+ return okResult(contract === void 0 ? envelope : {
2950
+ ...envelope,
2951
+ contract
2952
+ });
2913
2953
  } catch (err) {
2914
2954
  return errorResult(toMessage(err));
2915
2955
  }
@@ -3037,16 +3077,16 @@ function createMcpServer(endpoint, options = {}) {
3037
3077
  {
3038
3078
  name: "schema",
3039
3079
  config: {
3040
- description: "Fetch the Substrate schema. No args → a compact overview: every namespace's types, one line of `field: type` each, enough to write a query. `full: true` → the whole federated schema plus the full expression catalogue under `$expressions` (large; rarely needed). SCOPED + CHEAP: pass `namespace` for one namespace, or `namespace` + `type` for a single type's write contract ({ fields, mutations }). Mine the scoped shape BEFORE a create/update so you send only declared fields — autoCRUD rejects undeclared fields with `unknown_field`. The type answer is compact: generated CRUD names the type ('Todo fields', 'Todo') instead of restating its field block; `mutationRefs` says how to read it. `shape: \"fields\"` drops the mutations to their names; `shape: \"full\"` inlines every block (several times larger).",
3080
+ description: "Schema lookup. No args: every namespace's types as `field: type` lines. `namespace`: one namespace. `namespace` + `type`: that type's write contract ({ fields, mutations }); read it before a create/update, since undeclared fields are refused (`unknown_field`). Compact answers name generated CRUD instead of repeating fields; `mutationRefs` explains. `full: true` with no namespace: the whole federated schema plus the expression catalogue (large).",
3041
3081
  inputSchema: {
3042
- namespace: z.string().min(1).optional().describe("Scope to one namespace, e.g. \"notes\". Omit for the full federated schema."),
3043
- type: z.string().min(1).optional().describe("Scope to one type within `namespace`, e.g. \"Todo\" — returns its field defs + create/update param shapes. Requires `namespace`."),
3082
+ namespace: z.string().min(1).optional().describe("e.g. \"notes\""),
3083
+ type: z.string().min(1).optional().describe("e.g. \"Todo\"; needs `namespace`"),
3044
3084
  shape: z.enum([
3045
3085
  "compact",
3046
3086
  "full",
3047
3087
  "fields"
3048
- ]).optional().describe("Projection of the type contract; requires `namespace` + `type`. \"compact\" (default) prints the field block once and names the type in generated CRUD. \"full\" inlines every mutation's params and returns. \"fields\" returns the field defs plus `mutationNames` — use it to answer \"what fields does this type have\"."),
3049
- full: z.boolean().optional().describe("With no `namespace`: true returns the whole federated schema instead of the overview.")
3088
+ ]).optional().describe("Type contract: \"compact\" (default), \"fields\" (fields + mutation names) or \"full\" (every block inlined)"),
3089
+ full: z.boolean().optional().describe("No namespace: the whole federated schema")
3050
3090
  }
3051
3091
  },
3052
3092
  handler: createSchemaHandler(endpoint)
@@ -3054,7 +3094,7 @@ function createMcpServer(endpoint, options = {}) {
3054
3094
  {
3055
3095
  name: "query",
3056
3096
  config: {
3057
- description: "Query Substrate. payload is a single frame object mapping qualified keys (<ns>/<Type>) to { params, fields }. ONE call can span multiple namespaces — e.g. { \"prices/Price\": {...}, \"products/Product\": {...} }. The expression functions for select, where.$expr, groupBy and having are listed by the `schema` tool. WALKS: a reference field is followed backwards with `_walk`, which names the inbound field as \"ns/Type.field\" (the schema overview marks it `←Type.field`). It filters in `where`, aggregates in `fields._agg`, or nests rows in `fields`. Example: orders with an item priced over 50, and their item count: { \"shop/Order\": { \"params\": { \"where\": { \"_walk\": { \"in\": \"shop/Item.order\", \"where\": { \"price\": { \"gt\": 50 } } } } }, \"fields\": { \"id\": true, \"_agg\": { \"items\": { \"in\": \"shop/Item.order\", \"count\": true } } } } }. `out: \"field\"` follows a reference forwards. A `_walk` takes `quantifier` \"any\" (default), \"none\" or \"all\", or `pick` one neighbour by { \"latest\": <date> }, { \"max\": <f> } or { \"min\": <f> }; an \"any\" walk binds `as: \"L\"`, and a later comparison reads it as { \"$ref\": \"L.price\", \"times\": 1.25 } (`$.f` is the seed row, `_agg.<name>` an aggregate; `times`/`plus` scale numbers, `plus` shifts a date in ms). `_agg` also takes avg/sum/min/max: <field> or latest: { by, value }, and in `where` compares beside a comparison: { \"_agg\": { \"in\": ..., \"count\": true }, \"gte\": 3 }. Frame params: `count: true` answers { count }; `aggregate: { name: { sum: \"price\" } }` answers one group, or one per key of `groupBy: { day: { dateTrunc: [{ \"lit\": \"day\" }, \"seenAt\"] } }` (a map of names to expressions; `having` filters the groups, `offset` skips them, `orderBy` names their outputs). `select: { m: { sub: [\"_agg.x\", \"price\"] } }` adds a computed value to each row, ordered by `orderBy: [{ \"m\": \"desc\" }]`. An expression is a field name, a literal, `{ \"lit\": \"text\" }` or `{ \"fn\": [args] }`. Walks are query-only: subscribe, stream and mutate refuse them, as does a store without walks (walks_unsupported_store).",
3097
+ description: "Query. payload maps <ns>/<Type> keys (any namespaces) to { params, fields }; `schema` lists expression functions. Walks: `_walk: { in: \"ns/Type.field\" }` follows a reference backwards (overview: `←Type.field`), `out: \"field\"` forwards; it filters in `where`, nests rows in `fields`, aggregates in `fields._agg`. E.g. orders with an item over 50, with item count: { \"shop/Order\": { \"params\": { \"where\": { \"_walk\": { \"in\": \"shop/Item.order\", \"where\": { \"price\": { \"gt\": 50 } } } } }, \"fields\": { \"_agg\": { \"items\": { \"in\": \"shop/Item.order\", \"count\": true } } } } }. `quantifier`: \"any\" (default), \"none\", \"all\"; `pick`: { latest | max | min: field }. An \"any\" walk binds `as: \"L\"`, read later as { \"$ref\": \"L.price\", \"times\": 1.25 } (`$.f` seed row, `_agg.<n>` aggregate; `times`/`plus` scale, `plus` on a date shifts ms). `_agg`: count, avg/sum/min/max: field, latest: { by, value }; in `where` it compares: { \"_agg\": {...}, \"gte\": 3 }. Params: `count: true`; `aggregate: { n: { sum: \"price\" } }`, per group with `groupBy: { day: { dateTrunc: [{ \"lit\": \"day\" }, \"seenAt\"] } }`, `having`, `offset`; `select: { m: { sub: [\"_agg.x\", \"price\"] } }` adds a value, sortable in `orderBy`. An expression is a field name, a literal, { \"lit\": \"text\" } or { \"fn\": [args] }. Walks are query-only.",
3058
3098
  inputSchema: frameInputSchema("Query frame. Example: { \"default/Todo\": { \"params\": { \"limit\": 20 }, \"fields\": { \"id\": true, \"title\": true } } }")
3059
3099
  },
3060
3100
  handler: createQueryHandler(endpoint)
@@ -3062,7 +3102,7 @@ function createMcpServer(endpoint, options = {}) {
3062
3102
  {
3063
3103
  name: "mutate",
3064
3104
  config: {
3065
- description: "Run one or more mutations. payload is a single frame object mapping qualified keys (<ns>/<mutationName>) to { params, fields } (single-frame) or to an array of frames (batched atomic). ONE op-key can accept a single frame or an array. An ARRAY op-key is its own transaction: it commits or rolls back as a unit, independently of every other op-key in the call. The SINGLE-FRAME op-keys share one transaction when they sit on one tx scope (every namespace on one pg handle); across two tx scopes they are refused rather than split. So a single-frame op-key beside an array is NOT rolled back when the array fails — to make writes atomic together, put them in one array under one op-key. The memory dataset mints a fresh tx scope per namespace, so single-frame op-keys in two namespaces are refused there.",
3105
+ description: "Mutate. payload maps <ns>/<mutation> keys to { params, fields } or an array of them. An array under one key is one transaction. Single-frame keys share one transaction on one tx scope and are refused across two; a single-frame key beside an array is not rolled back with it, so writes that must land together go in one array. A shape-refused write returns its type contract as `contract`.",
3066
3106
  inputSchema: frameInputSchema("Mutation frame. Single: { \"default/createTodo\": { \"params\": { \"title\": \"...\" }, \"fields\": { \"id\": true } } }. Batched atomic: { \"default/updateTodo\": [ { \"params\": { \"id\": \"1\", \"done\": true }, \"fields\": { \"id\": true } }, { \"params\": { \"id\": \"2\", \"done\": true }, \"fields\": { \"id\": true } } ] }. By filter: { \"default/updateManyTodo\": { \"params\": { \"where\": { \"done\": { \"eq\": false } }, \"set\": { \"done\": true } }, \"fields\": { \"count\": true, \"ids\": true, \"idsTruncated\": true } } }; deleteMany<Type> takes only \"where\".")
3067
3107
  },
3068
3108
  handler: createMutateHandler(endpoint)
@@ -3070,16 +3110,16 @@ function createMcpServer(endpoint, options = {}) {
3070
3110
  {
3071
3111
  name: "run",
3072
3112
  config: {
3073
- description: "Run a short script against Substrate in one call: many queries and writes, one small report back. Use it when the work takes three or more dependent calls (ids passed from one call to the next, a census that must page, a join, recall-then-hydrate, a batch of writes chosen by a read). `script` is a JS/TS module whose default export is `async (s) => result`; type syntax is stripped. `s` has: kid, mode, args; query(frame) (throws on a refused frame); queryAll(key, { params, fields }) (pages to the end); byShortId(key, n | n[], fields?) (rows in input order; throws naming any missing); recall({ query, namespace, type, k?, where?, row? }); schema(namespace?, type?); mutate(frame); log(...). Return counts, ids and short handles, not whole rows. Modes: \"read\" (default) refuses mutate; \"dry-run\" records each mutate payload in the report without sending it; \"write\" sends up to maxWrites frames (default 50; an array element counts one). Dry-run first, read report.mutations, then write. The script runs sandboxed: no files, network, processes or environment; it reaches only the store, as this agent. Report: { ok, kid, mode, result, error?, mutations[{ frame, applied, errors? }], warnings, stats }.",
3113
+ description: "Sandboxed script for 3+ dependent calls (paging, joins, read-driven writes). `script`: a module exporting default `async (s) => result`; type syntax is stripped. `s`: kid, mode, args, query(frame) (throws if refused), queryAll(key, { params, fields }), byShortId(key, n | n[], fields?), recall({ query, namespace, type, k?, where?, row? }), schema(ns?, type?), mutate(frame), log(). Modes: \"read\" (default; refuses mutate), \"dry-run\" (records, sends nothing), \"write\". Dry-run, check report.mutations, then write. Return ids/counts.",
3074
3114
  inputSchema: {
3075
- script: z.string().min(1).describe("Module text, e.g. \"export default async (s) => (await s.queryAll('cortext/Todo', { params: { where: { status: { eq: 'open' } } }, fields: { id: true } })).length\""),
3076
- args: z.record(z.string(), z.unknown()).optional().describe("Passed to the script as s.args."),
3115
+ script: z.string().min(1).describe("e.g. export default async (s) => (await s.queryAll('ns/Todo', {})).length"),
3116
+ args: z.record(z.string(), z.unknown()).optional().describe("Passed as s.args"),
3077
3117
  mode: z.enum([
3078
3118
  "read",
3079
3119
  "dry-run",
3080
3120
  "write"
3081
- ]).optional().describe("Default \"read\"."),
3082
- maxWrites: z.number().int().nonnegative().optional().describe("Write mode: most mutate frames to send. Default 50.")
3121
+ ]).optional().describe("Default \"read\""),
3122
+ maxWrites: z.number().int().nonnegative().optional().describe("Write mode: max mutate frames, default 50")
3083
3123
  }
3084
3124
  },
3085
3125
  handler: createRunHandler()
@@ -3180,7 +3220,7 @@ function createMcpServer(endpoint, options = {}) {
3180
3220
  {
3181
3221
  name: "whoami",
3182
3222
  config: {
3183
- description: "Ask the server who this MCP session is authenticated as. Returns { authEnabled, identity }, where `identity` is null for an anonymous caller and otherwise carries { id, grants } — a namespace -> capabilities map, AS RECORDED, so a wildcard stays a `'*'` key rather than expanding into every namespace. USE THIS BEFORE CONCLUDING A CREDENTIAL WORKS: on a reads-open stack an authenticated read and an anonymous one return byte-identical results, so a successful query is not evidence of identity. `authEnabled: false` means the deployment verifies nothing (a posture you cannot fix from here); `authEnabled: true` with `identity: null` means your own credential never arrived (SUBSTRATE_AGENT_KEY_ID / SUBSTRATE_AGENT_KEY_PATH). Those need different fixes, which is why they are separate fields.",
3223
+ description: "Who this session is authenticated as: { authEnabled, identity: { id, grants } | null }. Ask before concluding a credential works: reads can succeed anonymously. authEnabled false: the server verifies nothing. identity null with authEnabled true: your key never arrived (SUBSTRATE_AGENT_KEY_ID / SUBSTRATE_AGENT_KEY_PATH).",
3184
3224
  inputSchema: {}
3185
3225
  },
3186
3226
  handler: async () => {
@@ -3202,16 +3242,16 @@ function createMcpServer(endpoint, options = {}) {
3202
3242
  {
3203
3243
  name: "recall",
3204
3244
  config: {
3205
- description: "Semantic recall over embedded Substrate records. Returns top-K records by cosine similarity to the NL query. Use for finding prior context by meaning when structural `where`/`contains` queries miss. WHICH TYPES ARE EMBEDDED IS A SERVER FACT — ask it (`GET /substrate/v1/embed-stats` returns `embeddedTypes`) rather than assuming; a type is embedded iff its namespace definition declares an `embed.source`. The same operation is also reachable as `POST /substrate/v1/recall` (body param `query`) and as the frame key `recall/Hit` through query — where the search text is `params.to`, not `params.query` and not a `where` clause. See docs/surface-parity.md.",
3245
+ description: "Semantic search: top-k records by similarity to `query`; hits carry `id` + handle fields. As a query frame, recall/Hit takes the text in params.to.",
3206
3246
  inputSchema: {
3207
- query: z.string().min(1).describe("Natural-language query to embed and match against."),
3208
- k: z.number().int().min(1).max(100).optional().describe("Max results. Default 10."),
3209
- namespace: z.string().optional().describe("Namespace to search. Pass it: there is no default. Omitted, the server falls back to ITS OWN SUBSTRATE_NAMESPACE and refuses with `missing_namespace` if that is unset."),
3210
- type: z.string().min(1).describe("Type to search, e.g. \"Note\". Required."),
3211
- threshold: z.number().optional().describe("Minimum similarity (0..1). Default 0."),
3212
- lexicalThreshold: z.number().optional().describe("Cosine floor for hits only the lexical (keyword) arm found. Default: same as threshold. 0 keeps them unfloored, so keyword matches survive a high threshold."),
3213
- where: z.record(z.string(), z.unknown()).optional().describe("Row-field filter applied inside every candidate source, so k fills with matching rows: field -> { eq: scalar | null } or { in: [scalar | null, ...] }, every field must match; eq null matches a missing or null field. Example: { \"project\": { \"in\": [\"substrate\", null] } }."),
3214
- rowFields: z.union([z.record(z.string(), z.literal(true)), z.literal(true)]).optional().describe("Row-body projection. Omitted, each hit's `row` carries `id` plus its handle fields (name, title, topic, synopsis, description), which is enough to decide on. Ask for more only when you need it: field -> true keeps just those fields plus `id`, e.g. { \"synopsis\": true, \"body\": true }; true returns the whole body.")
3247
+ query: z.string().min(1).describe("Search text"),
3248
+ k: z.number().int().min(1).max(100).optional().describe("Default 10"),
3249
+ namespace: z.string().optional().describe("Required (no default)"),
3250
+ type: z.string().min(1).describe("e.g. \"Note\""),
3251
+ threshold: z.number().optional().describe("Min similarity 0..1"),
3252
+ lexicalThreshold: z.number().optional().describe("Keyword-only hit floor"),
3253
+ where: z.record(z.string(), z.unknown()).optional().describe("field -> { eq } | { in: [...] }; null matches missing"),
3254
+ rowFields: z.union([z.record(z.string(), z.literal(true)), z.literal(true)]).optional().describe("{ field: true } adds fields; true = whole row")
3215
3255
  }
3216
3256
  },
3217
3257
  handler: async (input) => {
@@ -3225,21 +3265,37 @@ function createMcpServer(endpoint, options = {}) {
3225
3265
  ];
3226
3266
  const allowed = resolveToolAllowlist(options.tools, TOOLS.map((t) => t.name));
3227
3267
  for (const t of TOOLS) {
3228
- if (allowed !== null && !allowed.has(t.name)) continue;
3268
+ if (!allowed.has(t.name)) continue;
3229
3269
  server.registerTool(t.name, t.config, t.handler);
3230
3270
  }
3231
3271
  return server;
3232
3272
  }
3273
+ /** The tools a worker agent needs; the admin tools and `ask` are opt-in. */
3274
+ const CORE_TOOLS = [
3275
+ "query",
3276
+ "mutate",
3277
+ "schema",
3278
+ "recall",
3279
+ "run",
3280
+ "whoami"
3281
+ ];
3233
3282
  /**
3234
- * Parse SUBSTRATE_MCP_TOOLS. `null` means register everything. An unknown name
3235
- * throws: a typo that silently registered nothing would read as "this server
3236
- * has no such tool", which is a worse failure than refusing to start.
3283
+ * Parse SUBSTRATE_MCP_TOOLS: tool names and the presets `core` and `all`
3284
+ * (`core` while unset or blank). An unknown name throws: a typo that silently registered nothing
3285
+ * would read as "this server has no such tool", which is a worse failure than
3286
+ * refusing to start.
3237
3287
  */
3238
3288
  function resolveToolAllowlist(raw, known) {
3239
- if (raw === void 0 || raw.trim() === "") return null;
3240
- const names = raw.split(",").map((n) => n.trim()).filter((n) => n !== "");
3241
- for (const n of names) if (!known.includes(n)) throw new Error(`SUBSTRATE_MCP_TOOLS: unknown tool '${n}'. Valid names: ${[...known].sort().join(", ")}`);
3242
- return new Set(names);
3289
+ if (raw === void 0 || raw.trim() === "") return new Set(CORE_TOOLS);
3290
+ const names = /* @__PURE__ */ new Set();
3291
+ for (const n of raw.split(",").map((t) => t.trim())) {
3292
+ if (n === "") continue;
3293
+ if (n === "core") for (const t of CORE_TOOLS) names.add(t);
3294
+ else if (n === "all") for (const t of known) names.add(t);
3295
+ else if (known.includes(n)) names.add(n);
3296
+ else throw new Error(`SUBSTRATE_MCP_TOOLS: unknown tool '${n}'. Valid names: core, all, ${[...known].sort().join(", ")}`);
3297
+ }
3298
+ return names;
3243
3299
  }
3244
3300
  /** The overview for the session's instructions, or null when the server is slow or down. */
3245
3301
  async function fetchOverview(endpoint) {
@@ -3290,7 +3346,9 @@ Usage:
3290
3346
  Subcommands:
3291
3347
  serve Boot the Substrate HTTP server (default port 3100).
3292
3348
  mcp Boot the stdio MCP server. Reads SUBSTRATE_URL, and
3293
- SUBSTRATE_MCP_TOOLS (csv) to register only those tools.
3349
+ SUBSTRATE_MCP_TOOLS (csv of tool names, core or all;
3350
+ core: query, mutate, schema, recall, run, whoami; default
3351
+ core).
3294
3352
  init [dir] [flags] Scaffold a new Substrate runtime directory. Interactive by
3295
3353
  default; pass --yes for non-interactive scripted use.
3296
3354
  federate <verb> Federation onboarding: enroll / join / check.
@@ -54,6 +54,8 @@ declare class ResolverFrameError extends Error {
54
54
  }
55
55
  /** `filter_too_broad`: a by-filter write on `<namespace>/<type>` matched more than `maxMatch` rows. */
56
56
  declare function filterTooBroad(namespace: string, type: string, maxMatch: number): ResolverFrameError;
57
+ /** A miss on an id that is not UUID-shaped is usually a shortId sent where the UUID belongs. */
58
+ declare function idHint(value: unknown): string;
57
59
  /**
58
60
  * Thrown by a write-path resolver when a crossRef declaring `onMissing: 'reject'`
59
61
  * references a target that does not exist (or has been tombstoned). Extends
@@ -167,4 +169,4 @@ declare function isResolverFrameError(err: unknown): err is ResolverFrameError;
167
169
  */
168
170
  declare function isRestrictViolation(err: unknown): err is RestrictViolation;
169
171
  //#endregion
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 };
172
+ export { isAuthCause as C, isRestrictViolation as E, idHint as S, isResolverFrameError 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, isBatchElementError as w, filterTooBroad as x, WALK_BUDGET_EXCEEDED as y };
@@ -1,6 +1,6 @@
1
- import { Bt as jsonResponse, Rt as buildContext, tt as applyObligations, wn as ResolverFrameError } from "./src-CKSJ13p8.js";
1
+ import { Bt as jsonResponse, Rt as buildContext, tt as applyObligations, wn as ResolverFrameError } from "./src-WYba7eEl.js";
2
2
  import "./src-B_kHkbsr.js";
3
- import { w as queryTimeoutError } from "./src-BMD2OE--.js";
3
+ import { w as queryTimeoutError } from "./src-DQMA57_1.js";
4
4
  import { Worker } from "node:worker_threads";
5
5
 
6
6
  //#region ../../plugins/substrate-recall/src/candidate-selection.ts
@@ -1,5 +1,5 @@
1
- import { Kn as defineBootstrap } from "./src-CKSJ13p8.js";
2
- import { n as createNoopPubSub, t as createProposalsPlugin } from "./src-DmjwFMu8.js";
1
+ import { qn as defineBootstrap } from "./src-WYba7eEl.js";
2
+ import { n as createNoopPubSub, t as createProposalsPlugin } from "./src-QOCo7BE_.js";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region ../../plugins/substrate-proposals/src/bootstrap.ts
@@ -1,5 +1,5 @@
1
1
  import { kn as OnDelete, kt as Dataset, x as CoordinatorPlugin } from "./schema-aIkY8sR3.js";
2
- import { u as ResolverFrameError } from "./errors-Cmkp1qxf.js";
2
+ import { u as ResolverFrameError } from "./errors-CuCMwPpb.js";
3
3
  //#region ../../plugins/substrate-proposals/src/config.d.ts
4
4
  /**
5
5
  * Multi-instance invalidation transport used by the plugin to broadcast
package/dist/proposals.js CHANGED
@@ -1,3 +1,3 @@
1
- import { i as ProposalError, n as createNoopPubSub, r as storageSettled, t as createProposalsPlugin } from "./src-DmjwFMu8.js";
1
+ import { i as ProposalError, n as createNoopPubSub, r as storageSettled, t as createProposalsPlugin } from "./src-QOCo7BE_.js";
2
2
 
3
3
  export { ProposalError, createNoopPubSub, createProposalsPlugin, storageSettled };
@@ -1,6 +1,6 @@
1
- import { Kn as defineBootstrap } from "./src-CKSJ13p8.js";
1
+ import { qn as defineBootstrap } from "./src-WYba7eEl.js";
2
2
  import { t as FakeEmbedder } from "./fake-DdXtb-m8.js";
3
- import { t as createRecallPlugin } from "./plugin-CEOhrEme.js";
3
+ import { t as createRecallPlugin } from "./plugin-DkYf0ng8.js";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region ../../packages/substrate-embedder/src/types.ts
package/dist/recall.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore, t as RECALL_VERSION } from "./src-CW7eRDss.js";
2
- import { $ as CLUSTERER_BACKEND_VERSION, A as CLUSTER_MEMBER_FIELDS, C as EmbedSourceRegistry, D as makeReembed, E as makeEmbedPostWrite, F as unknownParams, G as DEFAULT_CRYSTALLISE_CONFIG, H as CRYSTALLISE_IN_FLIGHT_CODE, I as handleRecallRequest, J as runClusterer, K as handleCrystallise, L as RRF_K, M as recallRouteHandler, N as checkParams, O as crystalliseRouteHandler, P as unknownParamMessage, Q as CLUSTERER_BACKEND, R as armRanks, S as createEmbedStats, T as embedRowReporting, U as createCrystalliseGuard, X as l2normalize, _ as EMBEDDINGS_FETCH_MAX_REFS, a as REINDEX_MAX_LIMIT, b as handleLexicalCoverage, c as SALIENCE_BOOST_MAX_TARGETS, d as embeddingsMigration, et as memberKey, f as recallMcpTool, g as embeddingsFetchRouteHandler, h as embeddingSimilarOperator, i as REINDEX_DEFAULT_LIMIT, j as buildClusterSurface, k as CLUSTER_FIELDS, l as lexicalMigration, m as makeLexicalPostWrite, n as salienceBoostRouteHandler, nt as validateSelector, o as handleReindex, p as makeLexicalClassify, q as validateCrystalliseInput, r as reindexRouteHandler, s as validateReindexInput, t as createRecallPlugin, tt as SELECT_CANDIDATES_MAX_LIMIT, u as recallClustersMigration, v as embedStatsRouteHandler, w as embedAndStore, x as validateLexicalCoverageInput, y as handleEmbedStatsRequest, z as fuseByRank } from "./plugin-CEOhrEme.js";
1
+ import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore, t as RECALL_VERSION } from "./src-D-UHaQiB.js";
2
+ import { $ as CLUSTERER_BACKEND_VERSION, A as CLUSTER_MEMBER_FIELDS, C as EmbedSourceRegistry, D as makeReembed, E as makeEmbedPostWrite, F as unknownParams, G as DEFAULT_CRYSTALLISE_CONFIG, H as CRYSTALLISE_IN_FLIGHT_CODE, I as handleRecallRequest, J as runClusterer, K as handleCrystallise, L as RRF_K, M as recallRouteHandler, N as checkParams, O as crystalliseRouteHandler, P as unknownParamMessage, Q as CLUSTERER_BACKEND, R as armRanks, S as createEmbedStats, T as embedRowReporting, U as createCrystalliseGuard, X as l2normalize, _ as EMBEDDINGS_FETCH_MAX_REFS, a as REINDEX_MAX_LIMIT, b as handleLexicalCoverage, c as SALIENCE_BOOST_MAX_TARGETS, d as embeddingsMigration, et as memberKey, f as recallMcpTool, g as embeddingsFetchRouteHandler, h as embeddingSimilarOperator, i as REINDEX_DEFAULT_LIMIT, j as buildClusterSurface, k as CLUSTER_FIELDS, l as lexicalMigration, m as makeLexicalPostWrite, n as salienceBoostRouteHandler, nt as validateSelector, o as handleReindex, p as makeLexicalClassify, q as validateCrystalliseInput, r as reindexRouteHandler, s as validateReindexInput, t as createRecallPlugin, tt as SELECT_CANDIDATES_MAX_LIMIT, u as recallClustersMigration, v as embedStatsRouteHandler, w as embedAndStore, x as validateLexicalCoverageInput, y as handleEmbedStatsRequest, z as fuseByRank } from "./plugin-DkYf0ng8.js";
3
3
 
4
4
  export { CLUSTERER_BACKEND, CLUSTERER_BACKEND_VERSION, CLUSTER_FIELDS, CLUSTER_MEMBER_FIELDS, CRYSTALLISE_IN_FLIGHT_CODE, DEFAULT_CRYSTALLISE_CONFIG, EMBEDDINGS_FETCH_MAX_REFS, EmbedSourceRegistry, InMemoryClusterStore, InMemoryEmbeddingsStore, InMemoryLexicalStore, PgClusterStore, PgEmbeddingsStore, PgLexicalStore, RECALL_VERSION, REINDEX_DEFAULT_LIMIT, REINDEX_MAX_LIMIT, RRF_K, SALIENCE_BOOST_MAX_TARGETS, SELECT_CANDIDATES_MAX_LIMIT, armRanks, buildClusterSurface, checkParams, createCrystalliseGuard, createEmbedStats, createRecallPlugin, crystalliseRouteHandler, embedAndStore, embedRowReporting, embedStatsRouteHandler, embeddingSimilarOperator, embeddingsFetchRouteHandler, embeddingsMigration, fuseByRank, handleCrystallise, handleEmbedStatsRequest, handleLexicalCoverage, handleRecallRequest, handleReindex, l2normalize, lexicalMigration, makeEmbedPostWrite, makeLexicalClassify, makeLexicalPostWrite, makeReembed, memberKey, recallClustersMigration, recallMcpTool, recallRouteHandler, reindexRouteHandler, runClusterer, salienceBoostRouteHandler, unknownParamMessage, unknownParams, validateCrystalliseInput, validateLexicalCoverageInput, validateReindexInput, validateSelector };
@@ -1,4 +1,4 @@
1
- import { a as parsePositive, i as DEFAULT_SIZING, n as defaultPluginsForPersona, r as parsePort, t as KNOWN_PLUGINS } from "./cli-DModIbnN.js";
1
+ import { a as parsePositive, i as DEFAULT_SIZING, n as defaultPluginsForPersona, r as parsePort, t as KNOWN_PLUGINS } from "./cli-jlDJeDZi.js";
2
2
  import { createRequire } from "node:module";
3
3
  import path from "node:path";
4
4
  import { stripVTControlCharacters, styleText } from "node:util";
@@ -1,10 +1,10 @@
1
- import { _ as AUDIT_EVENT_TYPE, g as buildAuditRow } from "./src-CKSJ13p8.js";
1
+ import { _ as AUDIT_EVENT_TYPE, g as buildAuditRow } from "./src-WYba7eEl.js";
2
2
  import { n as trimTrailingSlashes } from "./env-utils-s25Z1YSA.js";
3
3
  import { I as decodeList, L as encodeList, M as grantEntryError, g as checkUpdatable, h as checkRevocable, y as newlyGranted } from "./src-DmiUWOLp.js";
4
4
  import "./src-B_kHkbsr.js";
5
- import { A as REVOKE_EXIT_CODES, B as listActiveAdminKeys, C as runRegisterViaRoute, D as formatBootstrapOutput, E as formatDoctorReport, F as BootstrapError, G as ARGV_SPEC, H as describeAdminTarget, I as CLI_ACTOR_KID, J as USAGE, K as validateArgv, L as base64Url, M as runKeyListViaRoute, N as runKeyPatchViaRoute, O as parseBootstrapArgs, P as ACTOR_HINT, R as forUpdate, S as runRegister, T as doctorCommand, U as resolveAdminAuth, V as readKeyById, W as resolveAdminTarget, X as AdminCliError, Y as argvError, Z as pgNoticeOptions, _ as version, b as formatRegisterOutput, c as parseEnv, f as registeredTypes, g as loadPluginsFromDir, i as EnvConfigError, j as UPDATE_EXIT_CODES, k as runBootstrap, l as refuseContractViolation, n as resolvePluginDir, q as RESTART_NOTE, r as BINARY_CONTRACT_VERSION, t as bootStore, u as buildDeferredIndexes, v as openPgDataset, w as grantLines, x as parseRegisterArgs, y as onboardCommand, z as generateAdminKeypair } from "./boot-store-BMQUbHKv.js";
5
+ import { A as REVOKE_EXIT_CODES, B as listActiveAdminKeys, C as runRegisterViaRoute, D as formatBootstrapOutput, E as formatDoctorReport, F as BootstrapError, G as ARGV_SPEC, H as describeAdminTarget, I as CLI_ACTOR_KID, J as USAGE, K as validateArgv, L as base64Url, M as runKeyListViaRoute, N as runKeyPatchViaRoute, O as parseBootstrapArgs, P as ACTOR_HINT, R as forUpdate, S as runRegister, T as doctorCommand, U as resolveAdminAuth, V as readKeyById, W as resolveAdminTarget, X as AdminCliError, Y as argvError, Z as pgNoticeOptions, _ as version, b as formatRegisterOutput, c as parseEnv, f as registeredTypes, g as loadPluginsFromDir, i as EnvConfigError, j as UPDATE_EXIT_CODES, k as runBootstrap, l as refuseContractViolation, n as resolvePluginDir, q as RESTART_NOTE, r as BINARY_CONTRACT_VERSION, t as bootStore, u as buildDeferredIndexes, v as openPgDataset, w as grantLines, x as parseRegisterArgs, y as onboardCommand, z as generateAdminKeypair } from "./boot-store-u_1PJSvo.js";
6
6
  import { T as substrateFetch } from "./src-FXO5JPyk.js";
7
- import { C as detectLayout, E as parseSourceBody, S as UUID_REGEX, T as copyRows, _ as isDerivedMigration, a as seqName, c as loadTypeTable, d as MIGRATE_STORE_MARKER_TABLE, f as PLAIN_SCHEMA_NAME, l as typeTableRef, m as assertStoreSchema, o as ensureTypeTable, x as UUID_CHECK_MIGRATION } from "./src-BMD2OE--.js";
7
+ import { C as detectLayout, E as parseSourceBody, S as UUID_REGEX, T as copyRows, _ as isDerivedMigration, a as seqName, c as loadTypeTable, d as MIGRATE_STORE_MARKER_TABLE, f as PLAIN_SCHEMA_NAME, l as typeTableRef, m as assertStoreSchema, o as ensureTypeTable, x as UUID_CHECK_MIGRATION } from "./src-DQMA57_1.js";
8
8
  import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
9
9
  import { dirname } from "node:path";
10
10
  import { createHash, randomUUID } from "node:crypto";
package/dist/sdk.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { $ as VirtualMutationDef, $t as WalkAgg, A as KernelLifecycleContext, An as OnMissing, At as DatasetRegistry, B as NamespaceTypeDef, Bn as WriteRow, Bt as IndexPlan, C as EmbedSourceContext, Cn as CanDeleteResult, Ct as RowFilterObligation, D as FilterOperatorDef, Dn as EdgeWriteInput, Dt as ConditionalUpdateResult, E as EngineInput, En as EdgeRef, Et as AggFn, F as KernelRouteClaim, Fn as IdentityKind, Ft as FilterCapabilities, G as Registry, Gt as ReadParams, H as PluginRouteContext, Ht as OrderByClause, I as McpToolRegistration, In as ROW_METADATA_FIELDS, It as FilterWriteLimits, J as RegistryEntryInput, Jt as StorageReport, K as RegistryBase, Kt as ReadResult, L as NamespaceConfig, Ln as Row, Lt as FilterWriteOptions, M as KernelMigrationContext, Mn as CLIENT_SUPPLIED_SERVER_FIELD, Mt as DropResult, N as KernelNamespaceContribution, Nn as ClientSuppliedServerFieldError, Nt as FieldKind, O as FrameEntry, On as EdgesStore, Ot as DEFAULT_FILTER_WRITE_LIMITS, P as KernelPlugin, Pn as Id, Pt as FieldPredicate, Q as ScheduledTaskContext, Qt as UpdateFieldRef, R as NamespaceDefinition, Rn as RowMetadata, Rt as FilterWriteResult, S as DropParticipant, Sn as FunctionSig, St as ResolverReturn, T as EngineHandle, Tn as EdgePatch, Tt as WriteEvent, U as PostWriteHook, Ut as PoolStats, V as PluginLifecycleContext, Vn as assertNoRepeatedIds, Vt as NestedSelection, W as QualifiedFrame, Wt as PromotionEvent, X as RegistryEntryResolver, Xt as TypeIndexState, Y as RegistryEntryKind, Yt as TxScopeHandles, Z as ScheduledTask, Zt as TypeStorageReport, _ as naturalOrderOf, _n as EXPR_AGGREGATES, _t as PolicyDecision, a as FieldDefCrossRef, an as WriteOptions, at as RequestObserver, b as CommittedWritesHook, bn as Expr, bt as Resolver, c as FieldDefStruct, cn as ResolveObservation, ct as SubstrateRequest, d as OrderedBy, dn as RuntimeErrors, dt as TlsConfig, en as WalkAggOperand, et as VirtualTypeDef, f as PackEnvelope, fn as RuntimeMetrics, ft as AfterTxWork, g as isColumnField, gn as DATE_UNITS, gt as Policy, h as TypeSchema, hn as ArgType, ht as Obligation, i as FieldDef, in as WhereClause, it as RequestObservation, j as KernelMigration, jn as ActorIdentity, jt as DeleteResult, k as IndexDecl, kn as OnDelete, kt as Dataset, l as FieldInput, ln as ResolverStat, lt as SubstrateResponse, m as Schema, mn as TypeStats, mt as Identity, n as Dropped, nn as WalkNode, nt as HttpMethod, o as FieldDefList, on as WriteResult, ot as RuntimeOp, p as PlanClause, pn as SlowRequest, pt as AutoCrudVerb, q as RegistryEntry, qt as RefOperand, r as EnvelopeShape, rn as WalkPick, rt as PluginRouter, s as FieldDefScalar, sn as ProcessStat, st as StartOpts, t as DEFAULT_ORDERED_BY, tn as WalkAggPredicate, tt as HttpHandler, u as MutationSchema, un as RuntimeErrorEntry, ut as SubstrateServer, v as BatchResolver, vn as EXPR_FUNCTIONS, vt as PolicyProbeContext, w as EncodeContext, wn as Edge, wt as TypedResolver, x as CoordinatorPlugin, xn as ExprType, xt as ResolverArgs, y as CommittedWriteBatch, yn as EXPR_LIMITS, yt as RequestContext, z as NamespaceInstallContext, zn as RowMetadataField, zt as FrameAgg } from "./schema-aIkY8sR3.js";
2
2
  import { i as BridgeFrame, n as BridgeCredential, r as BridgeCredentialStore, t as BridgeClient } from "./bridge-DnToJedN.js";
3
- import { C as isBatchElementError, S as isAuthCause, T as isRestrictViolation, _ as WALKS_NEED_PARTITIONED, a as NamespaceMismatch, b as WALK_UNSUPPORTED_REF, c as ROW_POLICY_BLOCKS_WALK, d as RestrictViolation, f as STORE_BUSY, g as WALKS_IN_SUBSCRIPTION, h as WALKS_IN_MUTATION, i as MissingReferentError, l as ReservedField, m as VALUE_OUT_OF_RANGE, n as BridgeUnreachableError, o as QUERY_TIMEOUT, p as UnsupportedFilterError, r as FILTER_TOO_BROAD, s as REGEX_BUDGET_EXCEEDED, t as BatchElementError, u as ResolverFrameError, v as WALKS_UNSUPPORTED_STORE, w as isResolverFrameError, x as filterTooBroad, y as WALK_BUDGET_EXCEEDED } from "./errors-Cmkp1qxf.js";
3
+ import { C as isAuthCause, E as isRestrictViolation, S as idHint, T as isResolverFrameError, _ as WALKS_NEED_PARTITIONED, a as NamespaceMismatch, b as WALK_UNSUPPORTED_REF, c as ROW_POLICY_BLOCKS_WALK, d as RestrictViolation, f as STORE_BUSY, g as WALKS_IN_SUBSCRIPTION, h as WALKS_IN_MUTATION, i as MissingReferentError, l as ReservedField, m as VALUE_OUT_OF_RANGE, n as BridgeUnreachableError, o as QUERY_TIMEOUT, p as UnsupportedFilterError, r as FILTER_TOO_BROAD, s as REGEX_BUDGET_EXCEEDED, t as BatchElementError, u as ResolverFrameError, v as WALKS_UNSUPPORTED_STORE, w as isBatchElementError, x as filterTooBroad, y as WALK_BUDGET_EXCEEDED } from "./errors-CuCMwPpb.js";
4
4
  import { a as WsResponseFrame, c as ResolveTarget, d as TargetState, f as IdempotencyStore, i as WsRequestFrame, l as SweepDeps, n as WS_REASON_SERVER_RESTART, o as WsResponseKind, r as WS_REASON_SUBSCRIPTION_OVERLOADED, s as BridgeRegistry, t as WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, u as SweepState } from "./ws-DW8ng02H.js";
5
5
  import { $ as NlJudgeAction, 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 NlAggregate, K as resolveDefaultKeyPath, L as isEncryptedKey, M as or, N as ADMIN_CAPABILITIES, O as decodeList, P as DEFAULT_CAPABILITIES, Q as NlFieldPhrase, R as makeAuthorizationProvider, S as expandFlat, T as grantIsUniform, U as AdminCredential, V as describeGrant, W as AdminEnv, X as NlAskResult, Y as NlAskRequest, Z as NlEvidence, _ as newlyGrantedPairs, _t as NLVocabularyHint, a as denyAll, at as NlOutcome, b as capabilitiesFor, c as requireIdentity, ct as NlPackValueRef, d as KeyUpdateRefusal, dt as NlServedPack, et as NlJudgeChoice, f as checkRevocable, ft as NlTrailEvent, g as newlyGranted, gt as NLResult, h as grantEntriesConfer, ht as NLBase, i as allowVerbs, it as NlNamespaceRulings, j as not, k as encodeList, l as requireNamespace, lt as NlParseStatus, m as grantCovers, mt as NlWireEvent, n as row, nt as NlJudgedStatus, o as denyVerbs, ot as NlPackField, p as checkUpdatable, pt as NlValueAlias, q as resolveDefaultKidPath, r as allowAll, rt as NlNamespacePack, s as requireCapability, st as NlPackType, t as applyRowFilters, tt as NlJudgeStep, u as KeyMutationRefusal, ut as NlParsedData, v as revokedAtIso, vt as Query, w as grantEntryError, x as encodeGrant, y as Grant, z as makeTokenProvider } from "./row-D0If4qif.js";
6
6
  //#region ../../packages/substrate-types/src/assert-never.d.ts
@@ -895,4 +895,4 @@ export declare function resolveEntityId(dataset: Dataset, type: string, input: I
895
895
  */
896
896
  export declare function resolveEntityRow(dataset: Dataset, type: string, input: Id): Promise<Row | null>;
897
897
  //#endregion
898
- export { ADMIN_CAPABILITIES, ActorIdentity, type AdminCredential, type AdminEnv, AfterTxWork, AggFn, ArgType, AutoCrudVerb, BatchElementError, BatchResolver, BridgeClient, BridgeCredential, BridgeCredentialStore, BridgeFrame, BridgeRegistry, BridgeUnreachableError, CLIENT_SUPPLIED_SERVER_FIELD, CanDeleteResult, ClientSuppliedServerFieldError, CommittedWriteBatch, CommittedWritesHook, ConditionalUpdateResult, CoordinatorPlugin, type CrossRefFieldOptions, DATE_UNITS, DEFAULT_CAPABILITIES, DEFAULT_FILTER_WRITE_LIMITS, DEFAULT_ORDERED_BY, Dataset, DatasetRegistry, type DateFieldOptions, type DefineNamespaceOptions, DeleteResult, type DeleteRowArgs, type DeleteRowResult, DropParticipant, DropResult, Dropped, EXPR_AGGREGATES, EXPR_FUNCTIONS, EXPR_LIMITS, Edge, EdgePatch, EdgeRef, EdgeWriteInput, EdgesStore, EmbedSourceContext, EncodeContext, EngineHandle, EngineInput, EnvelopeShape, Expr, ExprType, FILTER_TOO_BROAD, FieldDef, FieldDefCrossRef, FieldDefList, FieldDefScalar, FieldDefStruct, FieldInput, FieldKind, FieldPredicate, FilterCapabilities, FilterOperatorDef, FilterWriteLimits, type FilterWriteMutationResult, FilterWriteOptions, FilterWriteResult, FrameAgg, FrameEntry, FunctionSig, type Grant, HttpHandler, HttpMethod, Id, IdempotencyStore, Identity, IdentityKind, IndexDecl, IndexPlan, type JsonFieldOptions, KernelLifecycleContext, KernelMigration, KernelMigrationContext, KernelNamespaceContribution, KernelPlugin, KernelRouteClaim, type KeyMutationRefusal, type KeyUpdateRefusal, type ListFieldOptions, McpToolRegistration, MissingReferentError, MutationSchema, NLBase, NLResult, NLVocabularyHint, NamespaceConfig, NamespaceDefinition, NamespaceInstallContext, NamespaceMismatch, NamespaceTypeDef, NestedSelection, NlAggregate, NlAskRequest, NlAskResult, NlEvidence, NlFieldPhrase, NlJudgeAction, NlJudgeChoice, NlJudgeStep, NlJudgedStatus, NlNamespacePack, NlNamespaceRulings, NlOutcome, NlPackField, NlPackType, NlPackValueRef, NlParseStatus, NlParsedData, NlServedPack, NlTrailEvent, NlValueAlias, NlWireEvent, Obligation, OnDelete, OnMissing, OrderByClause, OrderedBy, PackEnvelope, PlanClause, PluginLifecycleContext, PluginRouteContext, PluginRouter, Policy, PolicyDecision, PolicyProbeContext, PoolStats, PostWriteHook, ProcessStat, PromotionEvent, QUERY_TIMEOUT, QualifiedFrame, Query, REGEX_BUDGET_EXCEEDED, ROW_METADATA_FIELDS, ROW_POLICY_BLOCKS_WALK, ReadParams, ReadResult, RefOperand, Registry, RegistryBase, RegistryEntry, RegistryEntryInput, RegistryEntryKind, RegistryEntryResolver, RequestContext, RequestObservation, RequestObserver, ReservedField, ResolveObservation, ResolveTarget, Resolver, ResolverArgs, ResolverFrameError, ResolverReturn, ResolverStat, RestrictViolation, Row, RowFilterObligation, RowMetadata, RowMetadataField, RuntimeErrorEntry, RuntimeErrors, RuntimeMetrics, RuntimeOp, STORE_BUSY, SYSTEM_NAMESPACE, type ScalarFieldOptions, ScheduledTask, ScheduledTaskContext, Schema, SlowRequest, StartOpts, StorageReport, type StructFieldOptions, SubstrateRequest, SubstrateResponse, SubstrateServer, SweepDeps, SweepState, TargetState, TlsConfig, type TokenProviderOpts, TxScopeHandles, TypeIndexState, type TypeInput, TypeSchema, TypeStats, TypeStorageReport, TypedResolver, UnsupportedFilterError, UpdateFieldRef, type UpdateResolverOptions, VALUE_OUT_OF_RANGE, VirtualMutationDef, VirtualTypeDef, WALKS_IN_MUTATION, WALKS_IN_SUBSCRIPTION, WALKS_NEED_PARTITIONED, WALKS_UNSUPPORTED_STORE, WALK_BUDGET_EXCEEDED, WALK_UNSUPPORTED_REF, WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, WS_REASON_SERVER_RESTART, WS_REASON_SUBSCRIPTION_OVERLOADED, WalkAgg, WalkAggOperand, WalkAggPredicate, WalkNode, WalkPick, WhereClause, WriteEvent, WriteOptions, WriteResult, WriteRow, WsRequestFrame, WsResponseFrame, WsResponseKind, adminClaimCapabilities, allowAll, allowVerbs, and, applyRowFilters, assertNoRepeatedIds, capabilitiesFor, checkRevocable, checkUpdatable, decodeList, denyAll, denyVerbs, describeGrant, encodeGrant, encodeList, expandFlat, filterTooBroad, flattenGrant, grantCovers, grantEntriesConfer, grantEntryError, grantIsUniform, intersectGrants, isActiveAdminKeyRow, isAuthCause, isBatchElementError, isColumnField, isEncryptedKey, isResolverFrameError, isRestrictViolation, makeAuthorizationProvider, makeTokenProvider, naturalOrderOf, newlyGranted, newlyGrantedPairs, not, or, parseGrantEntries, requireCapability, requireIdentity, requireNamespace, resolveAdminCredential, resolveDefaultKeyPath, resolveDefaultKidPath, revokedAtIso, row };
898
+ export { ADMIN_CAPABILITIES, ActorIdentity, type AdminCredential, type AdminEnv, AfterTxWork, AggFn, ArgType, AutoCrudVerb, BatchElementError, BatchResolver, BridgeClient, BridgeCredential, BridgeCredentialStore, BridgeFrame, BridgeRegistry, BridgeUnreachableError, CLIENT_SUPPLIED_SERVER_FIELD, CanDeleteResult, ClientSuppliedServerFieldError, CommittedWriteBatch, CommittedWritesHook, ConditionalUpdateResult, CoordinatorPlugin, type CrossRefFieldOptions, DATE_UNITS, DEFAULT_CAPABILITIES, DEFAULT_FILTER_WRITE_LIMITS, DEFAULT_ORDERED_BY, Dataset, DatasetRegistry, type DateFieldOptions, type DefineNamespaceOptions, DeleteResult, type DeleteRowArgs, type DeleteRowResult, DropParticipant, DropResult, Dropped, EXPR_AGGREGATES, EXPR_FUNCTIONS, EXPR_LIMITS, Edge, EdgePatch, EdgeRef, EdgeWriteInput, EdgesStore, EmbedSourceContext, EncodeContext, EngineHandle, EngineInput, EnvelopeShape, Expr, ExprType, FILTER_TOO_BROAD, FieldDef, FieldDefCrossRef, FieldDefList, FieldDefScalar, FieldDefStruct, FieldInput, FieldKind, FieldPredicate, FilterCapabilities, FilterOperatorDef, FilterWriteLimits, type FilterWriteMutationResult, FilterWriteOptions, FilterWriteResult, FrameAgg, FrameEntry, FunctionSig, type Grant, HttpHandler, HttpMethod, Id, IdempotencyStore, Identity, IdentityKind, IndexDecl, IndexPlan, type JsonFieldOptions, KernelLifecycleContext, KernelMigration, KernelMigrationContext, KernelNamespaceContribution, KernelPlugin, KernelRouteClaim, type KeyMutationRefusal, type KeyUpdateRefusal, type ListFieldOptions, McpToolRegistration, MissingReferentError, MutationSchema, NLBase, NLResult, NLVocabularyHint, NamespaceConfig, NamespaceDefinition, NamespaceInstallContext, NamespaceMismatch, NamespaceTypeDef, NestedSelection, NlAggregate, NlAskRequest, NlAskResult, NlEvidence, NlFieldPhrase, NlJudgeAction, NlJudgeChoice, NlJudgeStep, NlJudgedStatus, NlNamespacePack, NlNamespaceRulings, NlOutcome, NlPackField, NlPackType, NlPackValueRef, NlParseStatus, NlParsedData, NlServedPack, NlTrailEvent, NlValueAlias, NlWireEvent, Obligation, OnDelete, OnMissing, OrderByClause, OrderedBy, PackEnvelope, PlanClause, PluginLifecycleContext, PluginRouteContext, PluginRouter, Policy, PolicyDecision, PolicyProbeContext, PoolStats, PostWriteHook, ProcessStat, PromotionEvent, QUERY_TIMEOUT, QualifiedFrame, Query, REGEX_BUDGET_EXCEEDED, ROW_METADATA_FIELDS, ROW_POLICY_BLOCKS_WALK, ReadParams, ReadResult, RefOperand, Registry, RegistryBase, RegistryEntry, RegistryEntryInput, RegistryEntryKind, RegistryEntryResolver, RequestContext, RequestObservation, RequestObserver, ReservedField, ResolveObservation, ResolveTarget, Resolver, ResolverArgs, ResolverFrameError, ResolverReturn, ResolverStat, RestrictViolation, Row, RowFilterObligation, RowMetadata, RowMetadataField, RuntimeErrorEntry, RuntimeErrors, RuntimeMetrics, RuntimeOp, STORE_BUSY, SYSTEM_NAMESPACE, type ScalarFieldOptions, ScheduledTask, ScheduledTaskContext, Schema, SlowRequest, StartOpts, StorageReport, type StructFieldOptions, SubstrateRequest, SubstrateResponse, SubstrateServer, SweepDeps, SweepState, TargetState, TlsConfig, type TokenProviderOpts, TxScopeHandles, TypeIndexState, type TypeInput, TypeSchema, TypeStats, TypeStorageReport, TypedResolver, UnsupportedFilterError, UpdateFieldRef, type UpdateResolverOptions, VALUE_OUT_OF_RANGE, VirtualMutationDef, VirtualTypeDef, WALKS_IN_MUTATION, WALKS_IN_SUBSCRIPTION, WALKS_NEED_PARTITIONED, WALKS_UNSUPPORTED_STORE, WALK_BUDGET_EXCEEDED, WALK_UNSUPPORTED_REF, WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, WS_REASON_SERVER_RESTART, WS_REASON_SUBSCRIPTION_OVERLOADED, WalkAgg, WalkAggOperand, WalkAggPredicate, WalkNode, WalkPick, WhereClause, WriteEvent, WriteOptions, WriteResult, WriteRow, WsRequestFrame, WsResponseFrame, WsResponseKind, adminClaimCapabilities, allowAll, allowVerbs, and, applyRowFilters, assertNoRepeatedIds, capabilitiesFor, checkRevocable, checkUpdatable, decodeList, denyAll, denyVerbs, describeGrant, encodeGrant, encodeList, expandFlat, filterTooBroad, flattenGrant, grantCovers, grantEntriesConfer, grantEntryError, grantIsUniform, idHint, intersectGrants, isActiveAdminKeyRow, isAuthCause, isBatchElementError, isColumnField, isEncryptedKey, isResolverFrameError, isRestrictViolation, makeAuthorizationProvider, makeTokenProvider, naturalOrderOf, newlyGranted, newlyGrantedPairs, not, or, parseGrantEntries, requireCapability, requireIdentity, requireNamespace, resolveAdminCredential, resolveDefaultKeyPath, resolveDefaultKidPath, revokedAtIso, row };
package/dist/sdk.js CHANGED
@@ -1,6 +1,6 @@
1
- import { $t as isColumnField, A as isReservedAutoCrudField, An as WALKS_IN_SUBSCRIPTION, B as createResolver, Bn as DEFAULT_FILTER_WRITE_LIMITS, Bt as jsonResponse, C as makeCtx, Cn as ReservedField, D as RESERVED_AUTOCRUD_FIELDS, Dn as UnsupportedFilterError, E as selectAll, En as STORE_BUSY, F as createResolverWithEdges, Fn as filterTooBroad, G as listResolver, Gn as BootstrapConfigError, Gt as WS_REASON_SERVER_RESTART, H as updateResolver, Hn as ROW_METADATA_FIELDS, I as installAutoCrud, In as isAuthCause, J as resolveIdentity, Jt as normaliseVocabValues, K as getResolver, Kn as defineBootstrap, Kt as WS_REASON_SUBSCRIPTION_OVERLOADED, L as deleteManyResolver, Ln as isBatchElementError, Lt as JSON_HEADERS, M as field, Mn as WALKS_UNSUPPORTED_STORE, N as AutoCrudNameCollisionError, Nn as WALK_BUDGET_EXCEEDED, O as RESERVED_AUTOCRUD_FIELD_NAMES, On as VALUE_OUT_OF_RANGE, P as autoCrudOptionsOf, Pn as WALK_UNSUPPORTED_REF, Qt as DEFAULT_ORDERED_BY, R as updateManyResolver, Rn as isResolverFrameError, S as EngineQueryError, Sn as ROW_POLICY_BLOCKS_WALK, T as queryOne, Tn as RestrictViolation, U as applyUpdatePatch, Un as assertNoRepeatedIds, V as deleteResolver, Vn as CLIENT_SUPPLIED_SERVER_FIELD, Vt as parseJsonBody, W as deleteRow, Wn as canonicalize, Wt as WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, X as resolveEntityRow, Xt as storedVocabSpellings, Y as resolveEntityId, Yt as normaliseVocabWhere, Zt as vocabImplication, _n as FILTER_TOO_BROAD, an as normaliseMetadataWhere, b as assertOrderedBy, bn as QUERY_TIMEOUT, cn as ISO_INSTANT_FORM, dn as isIsoTimestamp, en as naturalOrderOf, fn as normalizeIsoTimestamp, gn as BridgeUnreachableError, hn as BatchElementError, in as normaliseMetadataOrderBy, j as reservedMetadataFieldMessage, jn as WALKS_NEED_PARTITIONED, k as RESERVED_METADATA_FIELD_NAMES, kn as WALKS_IN_MUTATION, ln as isImpossibleIsoTimestamp, mn as validateHardDeleteEnv, nn as METADATA_AUTHOR_FIELDS, on as normaliseWalkNode, pn as assertHardDeleteAllowed, q as UnattributedWriteError, qt as canonicalVocabValue, rn as METADATA_FILTER_FIELDS, sn as createKeyedMutex, tn as RegistryBase, un as isIsoInstant, vn as MissingReferentError, w as queryAll, wn as ResolverFrameError, x as defineNamespace, xn as REGEX_BUDGET_EXCEEDED, y as assertIndexDecl, yn as NamespaceMismatch, z as purgeResolver, zn as isRestrictViolation, zt as error400 } from "./src-CKSJ13p8.js";
1
+ import { $t as isColumnField, A as isReservedAutoCrudField, An as WALKS_IN_SUBSCRIPTION, B as createResolver, Bn as isRestrictViolation, Bt as jsonResponse, C as makeCtx, Cn as ReservedField, D as RESERVED_AUTOCRUD_FIELDS, Dn as UnsupportedFilterError, E as selectAll, En as STORE_BUSY, F as createResolverWithEdges, Fn as filterTooBroad, G as listResolver, Gn as canonicalize, Gt as WS_REASON_SERVER_RESTART, H as updateResolver, Hn as CLIENT_SUPPLIED_SERVER_FIELD, I as installAutoCrud, In as idHint, J as resolveIdentity, Jt as normaliseVocabValues, K as getResolver, Kn as BootstrapConfigError, Kt as WS_REASON_SUBSCRIPTION_OVERLOADED, L as deleteManyResolver, Ln as isAuthCause, Lt as JSON_HEADERS, M as field, Mn as WALKS_UNSUPPORTED_STORE, N as AutoCrudNameCollisionError, Nn as WALK_BUDGET_EXCEEDED, O as RESERVED_AUTOCRUD_FIELD_NAMES, On as VALUE_OUT_OF_RANGE, P as autoCrudOptionsOf, Pn as WALK_UNSUPPORTED_REF, Qt as DEFAULT_ORDERED_BY, R as updateManyResolver, Rn as isBatchElementError, S as EngineQueryError, Sn as ROW_POLICY_BLOCKS_WALK, T as queryOne, Tn as RestrictViolation, U as applyUpdatePatch, Un as ROW_METADATA_FIELDS, V as deleteResolver, Vn as DEFAULT_FILTER_WRITE_LIMITS, Vt as parseJsonBody, W as deleteRow, Wn as assertNoRepeatedIds, Wt as WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, X as resolveEntityRow, Xt as storedVocabSpellings, Y as resolveEntityId, Yt as normaliseVocabWhere, Zt as vocabImplication, _n as FILTER_TOO_BROAD, an as normaliseMetadataWhere, b as assertOrderedBy, bn as QUERY_TIMEOUT, cn as ISO_INSTANT_FORM, dn as isIsoTimestamp, en as naturalOrderOf, fn as normalizeIsoTimestamp, gn as BridgeUnreachableError, hn as BatchElementError, in as normaliseMetadataOrderBy, j as reservedMetadataFieldMessage, jn as WALKS_NEED_PARTITIONED, k as RESERVED_METADATA_FIELD_NAMES, kn as WALKS_IN_MUTATION, ln as isImpossibleIsoTimestamp, mn as validateHardDeleteEnv, nn as METADATA_AUTHOR_FIELDS, on as normaliseWalkNode, pn as assertHardDeleteAllowed, q as UnattributedWriteError, qn as defineBootstrap, qt as canonicalVocabValue, rn as METADATA_FILTER_FIELDS, sn as createKeyedMutex, tn as RegistryBase, un as isIsoInstant, vn as MissingReferentError, w as queryAll, wn as ResolverFrameError, x as defineNamespace, xn as REGEX_BUDGET_EXCEEDED, y as assertIndexDecl, yn as NamespaceMismatch, z as purgeResolver, zn as isResolverFrameError, zt as error400 } from "./src-WYba7eEl.js";
2
2
  import { a as adminClaimCapabilities, c as makeTokenProvider, d as resolveDefaultKidPath, i as DEFAULT_CAPABILITIES, l as resolveAdminCredential, n as trimTrailingSlashes, o as isEncryptedKey, r as ADMIN_CAPABILITIES, s as makeAuthorizationProvider, t as parsePositiveInt, u as resolveDefaultKeyPath } from "./env-utils-s25Z1YSA.js";
3
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, d as confersAnywhere, f as coversNamespace, g as checkUpdatable, h as checkRevocable, i as allowVerbs, j as flattenGrant, k as encodeGrant, l as requireNamespace, m as grantedIn, n as row, o as denyVerbs, p as grantOf, r as allowAll, s as requireCapability, t as applyRowFilters, u as allCapabilities, v as grantEntriesConfer, w as or, x as revokedAtIso, y as newlyGranted } from "./src-DmiUWOLp.js";
4
4
  import { B as EXPR_AGGREGATES, F as isInt32, H as EXPR_LIMITS, I as parseInt64, L as stringifyJson, M as formatQualifiedKey, N as parseQualifiedKey, P as isInt16, R as stringifyJsonExact, U as assertNever, V as EXPR_FUNCTIONS, z as DATE_UNITS } from "./src-B_kHkbsr.js";
5
5
 
6
- export { ADMIN_CAPABILITIES, AutoCrudNameCollisionError, BatchElementError, BootstrapConfigError, BridgeUnreachableError, CLIENT_SUPPLIED_SERVER_FIELD, DATE_UNITS, DEFAULT_CAPABILITIES, DEFAULT_FILTER_WRITE_LIMITS, DEFAULT_ORDERED_BY, EXPR_AGGREGATES, EXPR_FUNCTIONS, EXPR_LIMITS, EngineQueryError, FILTER_TOO_BROAD, ISO_INSTANT_FORM, JSON_HEADERS, METADATA_AUTHOR_FIELDS, METADATA_FILTER_FIELDS, MissingReferentError, NamespaceMismatch, QUERY_TIMEOUT, REGEX_BUDGET_EXCEEDED, RESERVED_AUTOCRUD_FIELDS, RESERVED_AUTOCRUD_FIELD_NAMES, RESERVED_METADATA_FIELD_NAMES, ROW_METADATA_FIELDS, ROW_POLICY_BLOCKS_WALK, RegistryBase, ReservedField, ResolverFrameError, RestrictViolation, STORE_BUSY, SYSTEM_NAMESPACE, UnattributedWriteError, UnsupportedFilterError, VALUE_OUT_OF_RANGE, WALKS_IN_MUTATION, WALKS_IN_SUBSCRIPTION, WALKS_NEED_PARTITIONED, WALKS_UNSUPPORTED_STORE, WALK_BUDGET_EXCEEDED, WALK_UNSUPPORTED_REF, WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, WS_REASON_SERVER_RESTART, WS_REASON_SUBSCRIPTION_OVERLOADED, adminClaimCapabilities, allCapabilities, allowAll, allowVerbs, and, applyRowFilters, applyUpdatePatch, assertHardDeleteAllowed, assertIndexDecl, assertNever, assertNoRepeatedIds, assertOrderedBy, autoCrudOptionsOf, canonicalVocabValue, canonicalize, capabilitiesFor, checkRevocable, checkUpdatable, confersAnywhere, coversNamespace, createKeyedMutex, createResolver, createResolverWithEdges, decodeList, defineBootstrap, defineNamespace, deleteManyResolver, deleteResolver, deleteRow, denyAll, denyVerbs, describeGrant, encodeGrant, encodeList, error400, expandFlat, field, filterTooBroad, flattenGrant, formatQualifiedKey, getResolver, grantCovers, grantEntriesConfer, grantEntryError, grantIsUniform, grantOf, grantedIn, installAutoCrud, intersectGrants, isActiveAdminKeyRow, isAuthCause, isBatchElementError, isColumnField, isEncryptedKey, isImpossibleIsoTimestamp, isInt16, isInt32, isIsoInstant, isIsoTimestamp, isReservedAutoCrudField, isResolverFrameError, isRestrictViolation, jsonResponse, listResolver, makeAuthorizationProvider, makeCtx, makeTokenProvider, naturalOrderOf, newlyGranted, newlyGrantedPairs, normaliseMetadataOrderBy, normaliseMetadataWhere, normaliseVocabValues, normaliseVocabWhere, normaliseWalkNode, normalizeIsoTimestamp, not, or, parseGrantEntries, parseInt64, parseJsonBody, parsePositiveInt, parseQualifiedKey, purgeResolver, queryAll, queryOne, requireCapability, requireIdentity, requireNamespace, reservedMetadataFieldMessage, resolveAdminCredential, resolveDefaultKeyPath, resolveDefaultKidPath, resolveEntityId, resolveEntityRow, resolveIdentity, revokedAtIso, row, selectAll, storedVocabSpellings, stringifyJson, stringifyJsonExact, trimTrailingSlashes, updateManyResolver, updateResolver, validateHardDeleteEnv, vocabImplication };
6
+ export { ADMIN_CAPABILITIES, AutoCrudNameCollisionError, BatchElementError, BootstrapConfigError, BridgeUnreachableError, CLIENT_SUPPLIED_SERVER_FIELD, DATE_UNITS, DEFAULT_CAPABILITIES, DEFAULT_FILTER_WRITE_LIMITS, DEFAULT_ORDERED_BY, EXPR_AGGREGATES, EXPR_FUNCTIONS, EXPR_LIMITS, EngineQueryError, FILTER_TOO_BROAD, ISO_INSTANT_FORM, JSON_HEADERS, METADATA_AUTHOR_FIELDS, METADATA_FILTER_FIELDS, MissingReferentError, NamespaceMismatch, QUERY_TIMEOUT, REGEX_BUDGET_EXCEEDED, RESERVED_AUTOCRUD_FIELDS, RESERVED_AUTOCRUD_FIELD_NAMES, RESERVED_METADATA_FIELD_NAMES, ROW_METADATA_FIELDS, ROW_POLICY_BLOCKS_WALK, RegistryBase, ReservedField, ResolverFrameError, RestrictViolation, STORE_BUSY, SYSTEM_NAMESPACE, UnattributedWriteError, UnsupportedFilterError, VALUE_OUT_OF_RANGE, WALKS_IN_MUTATION, WALKS_IN_SUBSCRIPTION, WALKS_NEED_PARTITIONED, WALKS_UNSUPPORTED_STORE, WALK_BUDGET_EXCEEDED, WALK_UNSUPPORTED_REF, WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, WS_REASON_SERVER_RESTART, WS_REASON_SUBSCRIPTION_OVERLOADED, adminClaimCapabilities, allCapabilities, allowAll, allowVerbs, and, applyRowFilters, applyUpdatePatch, assertHardDeleteAllowed, assertIndexDecl, assertNever, assertNoRepeatedIds, assertOrderedBy, autoCrudOptionsOf, canonicalVocabValue, canonicalize, capabilitiesFor, checkRevocable, checkUpdatable, confersAnywhere, coversNamespace, createKeyedMutex, createResolver, createResolverWithEdges, decodeList, defineBootstrap, defineNamespace, deleteManyResolver, deleteResolver, deleteRow, denyAll, denyVerbs, describeGrant, encodeGrant, encodeList, error400, expandFlat, field, filterTooBroad, flattenGrant, formatQualifiedKey, getResolver, grantCovers, grantEntriesConfer, grantEntryError, grantIsUniform, grantOf, grantedIn, idHint, installAutoCrud, intersectGrants, isActiveAdminKeyRow, isAuthCause, isBatchElementError, isColumnField, isEncryptedKey, isImpossibleIsoTimestamp, isInt16, isInt32, isIsoInstant, isIsoTimestamp, isReservedAutoCrudField, isResolverFrameError, isRestrictViolation, jsonResponse, listResolver, makeAuthorizationProvider, makeCtx, makeTokenProvider, naturalOrderOf, newlyGranted, newlyGrantedPairs, normaliseMetadataOrderBy, normaliseMetadataWhere, normaliseVocabValues, normaliseVocabWhere, normaliseWalkNode, normalizeIsoTimestamp, not, or, parseGrantEntries, parseInt64, parseJsonBody, parsePositiveInt, parseQualifiedKey, purgeResolver, queryAll, queryOne, requireCapability, requireIdentity, requireNamespace, reservedMetadataFieldMessage, resolveAdminCredential, resolveDefaultKeyPath, resolveDefaultKidPath, resolveEntityId, resolveEntityRow, resolveIdentity, revokedAtIso, row, selectAll, storedVocabSpellings, stringifyJson, stringifyJsonExact, trimTrailingSlashes, updateManyResolver, updateResolver, validateHardDeleteEnv, vocabImplication };
@@ -1,8 +1,8 @@
1
- import { i as txScopeIdFor, l as typeTableRef, s as guardedRefRead, u as whileNoTypeTable } from "./src-BMD2OE--.js";
2
- import { B as ROW_FILTER_FIELD, V as matchesRowFilter, W as inFlightError, Y as unresolvedRow, Z as cosineSimilarity, et as memberKey } from "./plugin-CEOhrEme.js";
1
+ import { i as txScopeIdFor, l as typeTableRef, s as guardedRefRead, u as whileNoTypeTable } from "./src-DQMA57_1.js";
2
+ import { B as ROW_FILTER_FIELD, V as matchesRowFilter, W as inFlightError, Y as unresolvedRow, Z as cosineSimilarity, et as memberKey } from "./plugin-DkYf0ng8.js";
3
3
 
4
4
  //#region ../../plugins/substrate-recall/package.json
5
- var version = "1.0.0-beta.1";
5
+ var version = "1.0.0-beta.3";
6
6
 
7
7
  //#endregion
8
8
  //#region ../../plugins/substrate-recall/src/in-memory-cluster-store.ts
@@ -1,4 +1,4 @@
1
- import { $t as isColumnField, At as decodeCursor, Cn as ReservedField, Ct as metadataExprType, Dn as UnsupportedFilterError, Dt as LIKE_TRAILING_ESCAPE, En as STORE_BUSY, Et as isJsonPathPredicate, Fn as filterTooBroad, Ft as fieldRequested, Mt as normalizeOrderBy, Nt as fullBuiltinOperators, On as VALUE_OUT_OF_RANGE, Ot as endsWithEscape, Pn as WALK_UNSUPPORTED_REF, Pt as applyExtensionResultMeta, St as exprTypeOfField, Tt as assertJsonPathPredicate, Un as assertNoRepeatedIds, _t as refNames, at as forEachWalkHop, bn as QUERY_TIMEOUT, ct as windowGroupBy, dt as aggType, en as naturalOrderOf, fn as normalizeIsoTimestamp, ft as canRaise, gt as isRefOperand, ht as groupConjuncts, jt as encodeCursor, kt as CursorDecodeError, lt as preResolveExtensionOperatorsDetailed, mt as bindingWalks, ot as whereUsesWalks, pt as isDateField, rn as METADATA_FILTER_FIELDS, sn as createKeyedMutex, st as sharedPicks, ut as aggParts, wn as ResolverFrameError, wt as walkAggExprType, yn as NamespaceMismatch } from "./src-CKSJ13p8.js";
1
+ import { $t as isColumnField, At as decodeCursor, Cn as ReservedField, Ct as metadataExprType, Dn as UnsupportedFilterError, Dt as LIKE_TRAILING_ESCAPE, En as STORE_BUSY, Et as isJsonPathPredicate, Fn as filterTooBroad, Ft as fieldRequested, Mt as normalizeOrderBy, Nt as fullBuiltinOperators, On as VALUE_OUT_OF_RANGE, Ot as endsWithEscape, Pn as WALK_UNSUPPORTED_REF, Pt as applyExtensionResultMeta, St as exprTypeOfField, Tt as assertJsonPathPredicate, Wn as assertNoRepeatedIds, _t as refNames, at as forEachWalkHop, bn as QUERY_TIMEOUT, ct as windowGroupBy, dt as aggType, en as naturalOrderOf, fn as normalizeIsoTimestamp, ft as canRaise, gt as isRefOperand, ht as groupConjuncts, jt as encodeCursor, kt as CursorDecodeError, lt as preResolveExtensionOperatorsDetailed, mt as bindingWalks, ot as whereUsesWalks, pt as isDateField, rn as METADATA_FILTER_FIELDS, sn as createKeyedMutex, st as sharedPicks, ut as aggParts, wn as ResolverFrameError, wt as walkAggExprType, yn as NamespaceMismatch } from "./src-WYba7eEl.js";
2
2
  import { F as isInt32, I as parseInt64, L as stringifyJson, P as isInt16, R as stringifyJsonExact, z as DATE_UNITS } from "./src-B_kHkbsr.js";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
 
@@ -551,7 +551,8 @@ function buildRowProjection(sql, table, fields, alias = "r", walk = null) {
551
551
  const wanted = [...keys, RAW_KEY];
552
552
  const subset = sql`COALESCE(CASE WHEN pg_column_size(${ex}) < ${sql.unsafe(String(INLINE_EXTRA_BYTES))} THEN (SELECT jsonb_object_agg(k, ${ex} -> k) FROM unnest(${wanted}::text[]) k WHERE ${ex} ? k) ELSE (SELECT jsonb_object_agg(e.key, e.value) FROM jsonb_each(${ex}) e WHERE e.key = ANY(${wanted}::text[])) END, '{}'::jsonb)`;
553
553
  const allColumns = [...keys].every((k) => k === "id" || table.column(k)?.state === "column");
554
- const extra = fields === void 0 ? ex : allColumns ? sql`CASE WHEN ${ex} ?| ${["id", RAW_KEY]}::text[] THEN ${subset} ELSE '{}'::jsonb END` : subset;
554
+ const probe = (k) => sql`CASE WHEN ${ex} ? ${k}::text THEN jsonb_build_object(${k}::text, ${ex} -> ${k}::text) ELSE '{}'::jsonb END`;
555
+ const extra = fields === void 0 ? ex : allColumns ? sql`CASE WHEN ${ex} ?| ${["id", RAW_KEY]}::text[] THEN ${probe("id")} || ${probe(RAW_KEY)} ELSE '{}'::jsonb END` : subset;
555
556
  const head = columns.length === 0 ? "" : `${columns.join(", ")}, `;
556
557
  return sql`${sql.unsafe(head)}${extra} AS extra${walk === null ? sql`` : sql`, ${walk}`}`;
557
558
  }
@@ -2333,24 +2334,39 @@ async function freeTableName(tx, namespace, type) {
2333
2334
  WHERE relname = ${preferred} AND relnamespace = current_schema()::regnamespace`).length === 0 ? preferred : hashedName(preferred, [namespace, type]);
2334
2335
  }
2335
2336
  const kindCheck = (column) => `CHECK (${column} IS NULL OR ${column} IN ('agent','user','system'))`;
2337
+ /** Each column kind's alignment in bytes; 0 for variable-length (text), which goes last. */
2338
+ const ALIGN = {
2339
+ date: 8,
2340
+ number: 8,
2341
+ int64: 8,
2342
+ int32: 4,
2343
+ int16: 2,
2344
+ boolean: 1,
2345
+ text: 0,
2346
+ enum: 0,
2347
+ crossRef: 0
2348
+ };
2336
2349
  function createTableSql(table, declared, enforceUuidCheck) {
2350
+ const fields = [...declared].sort(([, a], [, b]) => ALIGN[b.kind] - ALIGN[a.kind]);
2351
+ const column = ([field, { kind, vocab }]) => {
2352
+ const c = columnName(field);
2353
+ const def = `${ident(c)} ${PG_TYPE$1[kind]}`;
2354
+ return kind === "enum" ? [def, `CONSTRAINT ${ident(enumCheckName(c))} ${enumCheck(c, vocab)}`] : [def];
2355
+ };
2337
2356
  const parts = [
2338
- "id text PRIMARY KEY",
2339
2357
  "deleted_at timestamptz NULL",
2340
2358
  "created_at timestamptz NULL",
2341
2359
  "updated_at timestamptz NULL",
2360
+ "seq bigint NULL",
2361
+ ...fields.filter(([, f]) => ALIGN[f.kind] > 0).flatMap(column),
2362
+ "id text PRIMARY KEY",
2342
2363
  `created_by_kind text NULL ${kindCheck("created_by_kind")}`,
2343
2364
  "created_by_id text NULL",
2344
2365
  `updated_by_kind text NULL ${kindCheck("updated_by_kind")}`,
2345
2366
  "updated_by_id text NULL",
2346
- "seq bigint NULL",
2347
- "extra jsonb NOT NULL DEFAULT '{}'"
2367
+ "extra jsonb NOT NULL DEFAULT '{}'",
2368
+ ...fields.filter(([, f]) => ALIGN[f.kind] === 0).flatMap(column)
2348
2369
  ];
2349
- for (const [field, { kind, vocab }] of declared) {
2350
- const column = columnName(field);
2351
- parts.push(`${ident(column)} ${PG_TYPE$1[kind]}`);
2352
- if (kind === "enum") parts.push(`CONSTRAINT ${ident(enumCheckName(column))} ${enumCheck(column, vocab)}`);
2353
- }
2354
2370
  if (enforceUuidCheck) parts.push(`CONSTRAINT id_uuid_format CHECK (id ~ '${UUID_REGEX}')`);
2355
2371
  return `CREATE TABLE ${ident(table)} (\n ${parts.join(",\n ")}\n)`;
2356
2372
  }
@@ -5804,7 +5820,9 @@ function buildGroupedRead(sql, spec, matched, joins, table, fieldDef) {
5804
5820
  }
5805
5821
  const raises = aggs.some((a) => a.raises) || Object.values(spec.groupBy ?? {}).some(canRaise) || canRaise(spec.having);
5806
5822
  const grouped = sql`SELECT ${list([...keys.map((k) => sql`${k.frag} AS ${u(`k${k.i}`)}`), ...aggs.map((a) => sql`${a.raw} AS ${u(`a${a.j}`)}`)])} FROM ${u(table.from)} r${joins} WHERE ${matched}${keys.length === 0 ? sql`` : sql` GROUP BY ${u(keys.map((_, i) => i + 1).join(", "))}`} OFFSET 0`;
5807
- const inner = raises ? sql`SELECT y.*, count(*) OVER () AS w FROM (${grouped}) y OFFSET 0` : grouped;
5823
+ const firstOrder = spec.orderBy?.[0] === void 0 ? void 0 : Object.keys(spec.orderBy[0])[0];
5824
+ const fenced = raises && spec.limit !== void 0 && !aggs.some((a) => a.name === firstOrder);
5825
+ const inner = fenced ? sql`SELECT y.*, count(*) OVER () AS w FROM (${grouped}) y OFFSET 0` : grouped;
5808
5826
  const outputs = new Map([...keys.map((k) => [k.name, u(`x.k${k.i}`)]), ...aggs.map((a) => [a.name, a.typed])]);
5809
5827
  const types = new Map([...keys.map((k) => [k.name, k.type]), ...aggs.map((a) => [a.name, a.type])]);
5810
5828
  const having = spec.having === void 0 ? sql`` : sql` WHERE ${compileExprTyped(sql, spec.having, {
@@ -5832,7 +5850,7 @@ function buildGroupedRead(sql, spec, matched, joins, table, fieldDef) {
5832
5850
  const limit = spec.limit === void 0 ? sql`` : sql` LIMIT ${spec.limit + 1}`;
5833
5851
  const offset = spec.offset === void 0 || spec.offset === 0 ? sql`` : sql` OFFSET ${spec.offset}`;
5834
5852
  return {
5835
- statement: sql`SELECT 1 AS g, ${list([...outs.map((o, n) => sql`${project(o.frag, o.type)} AS ${u(`o${n}`)}`), ...raises ? [sql`x.w`] : []])} FROM (${inner}) x${having}${order.length === 0 ? sql`` : sql` ORDER BY ${list(order)}`}${limit}${offset}`,
5853
+ statement: sql`SELECT 1 AS g, ${list([...outs.map((o, n) => sql`${project(o.frag, o.type)} AS ${u(`o${n}`)}`), ...fenced ? [sql`x.w`] : []])} FROM (${inner}) x${having}${order.length === 0 ? sql`` : sql` ORDER BY ${list(order)}`}${limit}${offset}`,
5836
5854
  decode: (row) => Object.fromEntries(outs.map((o, n) => {
5837
5855
  const v = row[`o${n}`] ?? null;
5838
5856
  return [o.name, o.type === "int64" && v !== null ? BigInt(v) : v];
@@ -1,4 +1,4 @@
1
- import { $ as publishSchema, D as RESERVED_AUTOCRUD_FIELDS, I as installAutoCrud, J as resolveIdentity, Lt as JSON_HEADERS, M as field, O as RESERVED_AUTOCRUD_FIELD_NAMES, P as autoCrudOptionsOf, Wn as canonicalize$1, b as assertOrderedBy, d as uuidFromName, f as emitFieldEvents, j as reservedMetadataFieldMessage, l as planServesShape, p as migrateFieldValues, wn as ResolverFrameError, x as defineNamespace, y as assertIndexDecl } from "./src-CKSJ13p8.js";
1
+ import { $ as publishSchema, D as RESERVED_AUTOCRUD_FIELDS, Gn as canonicalize$1, I as installAutoCrud, J as resolveIdentity, Lt as JSON_HEADERS, M as field, O as RESERVED_AUTOCRUD_FIELD_NAMES, P as autoCrudOptionsOf, b as assertOrderedBy, d as uuidFromName, f as emitFieldEvents, j as reservedMetadataFieldMessage, l as planServesShape, p as migrateFieldValues, wn as ResolverFrameError, x as defineNamespace, y as assertIndexDecl } from "./src-WYba7eEl.js";
2
2
  import { s as requireCapability } from "./src-DmiUWOLp.js";
3
3
  import "./src-B_kHkbsr.js";
4
4
  import { randomUUID } from "node:crypto";
@@ -154,6 +154,11 @@ var ResolverFrameError = class extends Error {
154
154
  function filterTooBroad(namespace, type, maxMatch) {
155
155
  return new ResolverFrameError(FILTER_TOO_BROAD, `${namespace}/${type}: the filter matches more than ${maxMatch} rows; nothing changed. Narrow the where, or raise SUBSTRATE_FILTER_WRITE_MAX_MATCH`, { maxMatch });
156
156
  }
157
+ const UUID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
158
+ /** A miss on an id that is not UUID-shaped is usually a shortId sent where the UUID belongs. */
159
+ function idHint(value) {
160
+ return typeof value === "string" && UUID_SHAPE.test(value) ? "" : " — if this is a shortId, resolve it with where: { shortId: { eq: N } }";
161
+ }
157
162
  /**
158
163
  * Thrown by a write-path resolver when a crossRef declaring `onMissing: 'reject'`
159
164
  * references a target that does not exist (or has been tombstoned). Extends
@@ -163,7 +168,7 @@ function filterTooBroad(namespace, type, maxMatch) {
163
168
  var MissingReferentError = class extends ResolverFrameError {
164
169
  name = "MissingReferentError";
165
170
  constructor(field, target) {
166
- super("missing_referent", `crossRef '${field}' references a non-existent ${target.ns}/${target.type} (id=${target.id})`, {
171
+ super("missing_referent", `crossRef '${field}' references a non-existent ${target.ns}/${target.type} (id=${target.id})${idHint(target.id)}`, {
167
172
  field,
168
173
  target
169
174
  });
@@ -6521,6 +6526,32 @@ function clientErrorMessage(err, metric, key) {
6521
6526
  });
6522
6527
  return "internal error";
6523
6528
  }
6529
+ const FRAME_KEYS = /* @__PURE__ */ new Set([
6530
+ "params",
6531
+ "fields",
6532
+ "idempotencyKey"
6533
+ ]);
6534
+ const PARAM_SPELLINGS = /* @__PURE__ */ new Set([
6535
+ "where",
6536
+ "limit",
6537
+ "orderBy",
6538
+ "cursor",
6539
+ "count",
6540
+ "offset"
6541
+ ]);
6542
+ /**
6543
+ * The refusal for a frame entry carrying a key other than `params`, `fields`
6544
+ * or `idempotencyKey`, or null when it carries none. An ignored `where` would
6545
+ * read every row, so an unknown key is refused rather than dropped.
6546
+ */
6547
+ function unknownFrameKeyMessage(entry) {
6548
+ if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return null;
6549
+ const bad = Object.keys(entry).filter((k) => !FRAME_KEYS.has(k));
6550
+ if (bad.length === 0) return null;
6551
+ const inParams = bad.filter((k) => PARAM_SPELLINGS.has(k));
6552
+ const hint = inParams.length > 0 ? `; ${inParams.map((k) => `'${k}'`).join(", ")} belongs in params (params.${inParams[0]})` : "";
6553
+ return `unknown frame key${bad.length > 1 ? "s" : ""} ${bad.map((k) => `'${k}'`).join(", ")}: a frame takes params, fields and idempotencyKey${hint}`;
6554
+ }
6524
6555
  /**
6525
6556
  * No-op `BridgeRegistry` — used when no bridges are wired. Every namespace
6526
6557
  * routes locally and is reachable.
@@ -7837,6 +7868,19 @@ var SubscribeSubsystem = class {
7837
7868
  }, this.#metric);
7838
7869
  return null;
7839
7870
  }
7871
+ const badKeys = unknownFrameKeyMessage(frameEntry);
7872
+ if (badKeys !== null) {
7873
+ deliverFrame(input.onFrame, {
7874
+ id: input.id,
7875
+ kind: "error",
7876
+ errors: [{
7877
+ message: badKeys,
7878
+ code: "unknown_frame_key",
7879
+ path: [key]
7880
+ }]
7881
+ }, this.#metric);
7882
+ return null;
7883
+ }
7840
7884
  const { ns, name } = parsed;
7841
7885
  if (!checkIdentityGrant(ctxBase.identity, ns, "subscribe").ok) {
7842
7886
  deliverFrame(input.onFrame, {
@@ -8531,6 +8575,11 @@ var StreamSubsystem = class {
8531
8575
  await emitError(`unqualified frame key '${key}' — expected '<ns>/<name>'`, "unqualified_key");
8532
8576
  return;
8533
8577
  }
8578
+ const badKeys = unknownFrameKeyMessage(frameEntry);
8579
+ if (badKeys !== null) {
8580
+ await emitError(badKeys, "unknown_frame_key");
8581
+ return;
8582
+ }
8534
8583
  const { ns, name } = parsed;
8535
8584
  if (!checkIdentityGrant(input.ctx.identity, ns, "stream").ok) {
8536
8585
  await emitError(`namespace '${ns}' not in identity's allowed namespaces`, "unauthorized_namespace");
@@ -9705,6 +9754,12 @@ var Engine = class {
9705
9754
  }
9706
9755
  return false;
9707
9756
  }
9757
+ /** An unqualified key's refusal, naming the fix when one is evident. */
9758
+ #unqualifiedMessage(key) {
9759
+ if (key === "params" || key === "fields" || key === "where") return `'${key}' is part of a frame, not a frame key: send { "<ns>/<op>": { "params": {...}, "fields": {...} } }`;
9760
+ const owners = [...this.#namespaces].filter(([, cfg]) => cfg.registry.get(key) !== void 0);
9761
+ return `unqualified frame key '${key}' — expected '<ns>/<name>'${owners.length === 1 ? ` — did you mean '${owners[0]?.[0]}/${key}'?` : ""}`;
9762
+ }
9708
9763
  /**
9709
9764
  * Everything a frame entry does before its resolver runs: the grant, the
9710
9765
  * lookups, policy, the walk refusals, the filter guard, the cursor and the
@@ -9712,10 +9767,16 @@ var Engine = class {
9712
9767
  */
9713
9768
  #prepareEntry(envelope, key, entry, ctxBase, operation, tx, txEdges, parsed, onWrite, signal, afterTx, txEntries) {
9714
9769
  if (!parsed) {
9715
- addError(envelope, [key], `unqualified frame key '${key}' — expected '<ns>/<name>'`, "unqualified_key");
9770
+ addError(envelope, [key], this.#unqualifiedMessage(key), "unqualified_key");
9716
9771
  this.#metric("engine_unqualified_key", key);
9717
9772
  return null;
9718
9773
  }
9774
+ const badKeys = unknownFrameKeyMessage(entry);
9775
+ if (badKeys !== null) {
9776
+ addError(envelope, [key], badKeys, "unknown_frame_key");
9777
+ this.#metric("engine_unknown_frame_key", key);
9778
+ return null;
9779
+ }
9719
9780
  const { ns, name } = parsed;
9720
9781
  if (this.#refuseUngranted(envelope, key, ns, ctxBase.identity, operation)) return null;
9721
9782
  if (this.#tombstoned.has(ns)) {
@@ -9946,7 +10007,7 @@ var Engine = class {
9946
10007
  */
9947
10008
  async #runArrayEntry(envelope, key, parsed, frames, ctxBase, onWrite, signal) {
9948
10009
  if (!parsed) {
9949
- addError(envelope, [key], `unqualified frame key '${key}' — expected '<ns>/<name>'`, "unqualified_key");
10010
+ addError(envelope, [key], this.#unqualifiedMessage(key), "unqualified_key");
9950
10011
  this.#metric("engine_unqualified_key", key);
9951
10012
  return;
9952
10013
  }
@@ -11766,7 +11827,7 @@ function preparePatch(rawParams, fields) {
11766
11827
  * missing row has a true answer; asserting a write against one does not.
11767
11828
  */
11768
11829
  function updateNotFound(typeName, id) {
11769
- return new ResolverFrameError("not_found", `updateResolver('${typeName}'): no row with id '${String(id)}'`, { field: "id" });
11830
+ return new ResolverFrameError("not_found", `updateResolver('${typeName}'): no row with id '${String(id)}'${idHint(id)}`, { field: "id" });
11770
11831
  }
11771
11832
 
11772
11833
  //#endregion
@@ -19602,4 +19663,4 @@ function kernelMigrationTracking(sql) {
19602
19663
  }
19603
19664
 
19604
19665
  //#endregion
19605
- export { publishSchema as $, isColumnField as $t, isReservedAutoCrudField as A, WALKS_IN_SUBSCRIPTION as An, decodeCursor as At, createResolver as B, DEFAULT_FILTER_WRITE_LIMITS as Bn, jsonResponse as Bt, makeCtx as C, ReservedField as Cn, metadataExprType as Ct, RESERVED_AUTOCRUD_FIELDS as D, UnsupportedFilterError as Dn, LIKE_TRAILING_ESCAPE as Dt, selectAll as E, STORE_BUSY as En, isJsonPathPredicate as Et, createResolverWithEdges as F, filterTooBroad as Fn, fieldRequested as Ft, listResolver as G, BootstrapConfigError as Gn, WS_REASON_SERVER_RESTART as Gt, updateResolver as H, ROW_METADATA_FIELDS as Hn, parseAuthConfig as Ht, installAutoCrud as I, isAuthCause as In, HttpBridgeClient as It, resolveIdentity as J, normaliseVocabValues as Jt, getResolver as K, defineBootstrap as Kn, WS_REASON_SUBSCRIPTION_OVERLOADED as Kt, deleteManyResolver as L, isBatchElementError as Ln, JSON_HEADERS as Lt, field as M, WALKS_UNSUPPORTED_STORE as Mn, normalizeOrderBy as Mt, AutoCrudNameCollisionError as N, WALK_BUDGET_EXCEEDED as Nn, fullBuiltinOperators as Nt, RESERVED_AUTOCRUD_FIELD_NAMES as O, VALUE_OUT_OF_RANGE as On, endsWithEscape as Ot, autoCrudOptionsOf as P, WALK_UNSUPPORTED_REF as Pn, applyExtensionResultMeta as Pt, loadPlugins as Q, DEFAULT_ORDERED_BY as Qt, updateManyResolver as R, isResolverFrameError as Rn, buildContext as Rt, EngineQueryError as S, ROW_POLICY_BLOCKS_WALK as Sn, exprTypeOfField as St, queryOne as T, RestrictViolation as Tn, assertJsonPathPredicate as Tt, applyUpdatePatch as U, assertNoRepeatedIds as Un, signHs256 as Ut, deleteResolver as V, CLIENT_SUPPLIED_SERVER_FIELD as Vn, parseJsonBody as Vt, deleteRow as W, canonicalize as Wn, WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME as Wt, resolveEntityRow as X, storedVocabSpellings as Xt, resolveEntityId as Y, normaliseVocabWhere as Yt, MemoryEdgesStore as Z, vocabImplication as Zt, AUDIT_EVENT_TYPE as _, FILTER_TOO_BROAD as _n, refNames as _t, composeFromManifests as a, normaliseMetadataWhere as an, forEachWalkHop as at, assertOrderedBy as b, QUERY_TIMEOUT as bn, registerExtensionOperator as bt, MemoryDataset as c, ISO_INSTANT_FORM as cn, windowGroupBy as ct, uuidFromName as d, isIsoTimestamp as dn, aggType as dt, naturalOrderOf as en, effectiveFilterOperators as et, emitFieldEvents as f, normalizeIsoTimestamp as fn, canRaise as ft, buildAuditRow as g, BridgeUnreachableError as gn, isRefOperand as gt, SYSTEM_TYPE_DEFS as h, BatchElementError as hn, groupConjuncts as ht, PluginLoadError as i, normaliseMetadataOrderBy as in, saveSweepState as it, reservedMetadataFieldMessage as j, WALKS_NEED_PARTITIONED as jn, encodeCursor as jt, RESERVED_METADATA_FIELD_NAMES as k, WALKS_IN_MUTATION as kn, CursorDecodeError as kt, planServesShape as l, isImpossibleIsoTimestamp as ln, preResolveExtensionOperatorsDetailed as lt, runInviteSweep as m, validateHardDeleteEnv as mn, bindingWalks as mt, kernelMigrationTracking as n, METADATA_AUTHOR_FIELDS as nn, loadSweepState as nt, DEFAULT_NAMESPACE as o, normaliseWalkNode as on, whereUsesWalks as ot, migrateFieldValues as p, assertHardDeleteAllowed as pn, isDateField as pt, UnattributedWriteError as q, canonicalVocabValue as qt, mountKernelRoute as r, METADATA_FILTER_FIELDS as rn, runSweep as rt, compose as s, createKeyedMutex as sn, sharedPicks as st, composeKernelPlugins as t, RegistryBase as tn, applyObligations as tt, isStoreProfileName as u, isIsoInstant as un, aggParts as ut, INVITE_TYPE as v, MissingReferentError as vn, getExtensionOperator as vt, queryAll as w, ResolverFrameError as wn, walkAggExprType as wt, defineNamespace as x, REGEX_BUDGET_EXCEEDED as xn, unregisterExtensionOperator as xt, assertIndexDecl as y, NamespaceMismatch as yn, listExtensionOperators as yt, purgeResolver as z, isRestrictViolation as zn, error400 as zt };
19666
+ export { publishSchema as $, isColumnField as $t, isReservedAutoCrudField as A, WALKS_IN_SUBSCRIPTION as An, decodeCursor as At, createResolver as B, isRestrictViolation as Bn, jsonResponse as Bt, makeCtx as C, ReservedField as Cn, metadataExprType as Ct, RESERVED_AUTOCRUD_FIELDS as D, UnsupportedFilterError as Dn, LIKE_TRAILING_ESCAPE as Dt, selectAll as E, STORE_BUSY as En, isJsonPathPredicate as Et, createResolverWithEdges as F, filterTooBroad as Fn, fieldRequested as Ft, listResolver as G, canonicalize as Gn, WS_REASON_SERVER_RESTART as Gt, updateResolver as H, CLIENT_SUPPLIED_SERVER_FIELD as Hn, parseAuthConfig as Ht, installAutoCrud as I, idHint as In, HttpBridgeClient as It, resolveIdentity as J, normaliseVocabValues as Jt, getResolver as K, BootstrapConfigError as Kn, WS_REASON_SUBSCRIPTION_OVERLOADED as Kt, deleteManyResolver as L, isAuthCause as Ln, JSON_HEADERS as Lt, field as M, WALKS_UNSUPPORTED_STORE as Mn, normalizeOrderBy as Mt, AutoCrudNameCollisionError as N, WALK_BUDGET_EXCEEDED as Nn, fullBuiltinOperators as Nt, RESERVED_AUTOCRUD_FIELD_NAMES as O, VALUE_OUT_OF_RANGE as On, endsWithEscape as Ot, autoCrudOptionsOf as P, WALK_UNSUPPORTED_REF as Pn, applyExtensionResultMeta as Pt, loadPlugins as Q, DEFAULT_ORDERED_BY as Qt, updateManyResolver as R, isBatchElementError as Rn, buildContext as Rt, EngineQueryError as S, ROW_POLICY_BLOCKS_WALK as Sn, exprTypeOfField as St, queryOne as T, RestrictViolation as Tn, assertJsonPathPredicate as Tt, applyUpdatePatch as U, ROW_METADATA_FIELDS as Un, signHs256 as Ut, deleteResolver as V, DEFAULT_FILTER_WRITE_LIMITS as Vn, parseJsonBody as Vt, deleteRow as W, assertNoRepeatedIds as Wn, WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME as Wt, resolveEntityRow as X, storedVocabSpellings as Xt, resolveEntityId as Y, normaliseVocabWhere as Yt, MemoryEdgesStore as Z, vocabImplication as Zt, AUDIT_EVENT_TYPE as _, FILTER_TOO_BROAD as _n, refNames as _t, composeFromManifests as a, normaliseMetadataWhere as an, forEachWalkHop as at, assertOrderedBy as b, QUERY_TIMEOUT as bn, registerExtensionOperator as bt, MemoryDataset as c, ISO_INSTANT_FORM as cn, windowGroupBy as ct, uuidFromName as d, isIsoTimestamp as dn, aggType as dt, naturalOrderOf as en, effectiveFilterOperators as et, emitFieldEvents as f, normalizeIsoTimestamp as fn, canRaise as ft, buildAuditRow as g, BridgeUnreachableError as gn, isRefOperand as gt, SYSTEM_TYPE_DEFS as h, BatchElementError as hn, groupConjuncts as ht, PluginLoadError as i, normaliseMetadataOrderBy as in, saveSweepState as it, reservedMetadataFieldMessage as j, WALKS_NEED_PARTITIONED as jn, encodeCursor as jt, RESERVED_METADATA_FIELD_NAMES as k, WALKS_IN_MUTATION as kn, CursorDecodeError as kt, planServesShape as l, isImpossibleIsoTimestamp as ln, preResolveExtensionOperatorsDetailed as lt, runInviteSweep as m, validateHardDeleteEnv as mn, bindingWalks as mt, kernelMigrationTracking as n, METADATA_AUTHOR_FIELDS as nn, loadSweepState as nt, DEFAULT_NAMESPACE as o, normaliseWalkNode as on, whereUsesWalks as ot, migrateFieldValues as p, assertHardDeleteAllowed as pn, isDateField as pt, UnattributedWriteError as q, defineBootstrap as qn, canonicalVocabValue as qt, mountKernelRoute as r, METADATA_FILTER_FIELDS as rn, runSweep as rt, compose as s, createKeyedMutex as sn, sharedPicks as st, composeKernelPlugins as t, RegistryBase as tn, applyObligations as tt, isStoreProfileName as u, isIsoInstant as un, aggParts as ut, INVITE_TYPE as v, MissingReferentError as vn, getExtensionOperator as vt, queryAll as w, ResolverFrameError as wn, walkAggExprType as wt, defineNamespace as x, REGEX_BUDGET_EXCEEDED as xn, unregisterExtensionOperator as xt, assertIndexDecl as y, NamespaceMismatch as yn, listExtensionOperators as yt, purgeResolver as z, isResolverFrameError as zn, error400 as zt };
@@ -36,7 +36,7 @@ function isEntrypointPath(moduleUrl, argv1) {
36
36
  */
37
37
  if (isEntrypointPath(import.meta.url, process.argv[1])) {
38
38
  assertNodeVersion();
39
- import("./run-BT123RV1.js").then(({ runAdminCli }) => runAdminCli());
39
+ import("./run-DmOyE-QQ.js").then(({ runAdminCli }) => runAdminCli());
40
40
  }
41
41
 
42
42
  //#endregion
package/dist/substrate.js CHANGED
@@ -3,7 +3,7 @@ import { t as assertNodeVersion } from "./node-version-BtK_Nq6z.js";
3
3
 
4
4
  //#region src/bin/substrate.ts
5
5
  assertNodeVersion();
6
- import("./cli-DModIbnN.js").then(({ runCli }) => runCli(process.argv.slice(2))).then((code) => process.exit(code));
6
+ import("./cli-jlDJeDZi.js").then(({ runCli }) => runCli(process.argv.slice(2))).then((code) => process.exit(code));
7
7
 
8
8
  //#endregion
9
9
  export { };
package/dist/testing.js CHANGED
@@ -1,6 +1,6 @@
1
- import { Gt as WS_REASON_SERVER_RESTART, Q as loadPlugins, Ut as signHs256, Z as MemoryEdgesStore, c as MemoryDataset, s as compose } from "./src-CKSJ13p8.js";
1
+ import { Gt as WS_REASON_SERVER_RESTART, Q as loadPlugins, Ut as signHs256, Z as MemoryEdgesStore, c as MemoryDataset, s as compose } from "./src-WYba7eEl.js";
2
2
  import "./src-B_kHkbsr.js";
3
- import { b as runMigrations, g as deriveListIndexMigration, n as PgEdgesStore, r as PgDataset, y as runDerivedMigrations } from "./src-BMD2OE--.js";
3
+ import { b as runMigrations, g as deriveListIndexMigration, n as PgEdgesStore, r as PgDataset, y as runDerivedMigrations } from "./src-DQMA57_1.js";
4
4
  import { t as FakeEmbedder } from "./fake-DdXtb-m8.js";
5
5
  import postgres from "postgres";
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mnmal-ai/substrate",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "Substrate — an agent-first typed-data server: the substrate and substrate-admin binaries, the built-in plugins and the SDK subpaths.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -35,24 +35,24 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@inquirer/prompts": "^8.7.2",
38
- "@mnmal-ai/substrate-bootstrap": "1.0.0-beta.1",
39
- "@mnmal-ai/substrate-client": "1.0.0-beta.1",
40
- "@mnmal-ai/substrate-compose": "1.0.0-beta.1",
41
- "@mnmal-ai/substrate-config": "1.0.0-beta.1",
42
- "@mnmal-ai/substrate-core": "1.0.0-beta.1",
43
- "@mnmal-ai/substrate-dataset-memory": "1.0.0-beta.1",
44
- "@mnmal-ai/substrate-dataset-pg": "1.0.0-beta.1",
45
- "@mnmal-ai/substrate-embedder": "1.0.0-beta.1",
46
- "@mnmal-ai/substrate-filter": "1.0.0-beta.1",
47
- "@mnmal-ai/substrate-pack": "1.0.0-beta.1",
48
- "@mnmal-ai/substrate-policy": "1.0.0-beta.1",
49
- "@mnmal-ai/substrate-proposals": "1.0.0-beta.1",
50
- "@mnmal-ai/substrate-recall": "1.0.0-beta.1",
51
- "@mnmal-ai/substrate-sdk": "1.0.0-beta.1",
52
- "@mnmal-ai/substrate-sentinel-client": "1.0.0-beta.1",
53
- "@mnmal-ai/substrate-server-fastify": "1.0.0-beta.1",
54
- "@mnmal-ai/substrate-server-memory": "1.0.0-beta.1",
55
- "@mnmal-ai/substrate-types": "1.0.0-beta.1",
38
+ "@mnmal-ai/substrate-bootstrap": "1.0.0-beta.3",
39
+ "@mnmal-ai/substrate-client": "1.0.0-beta.3",
40
+ "@mnmal-ai/substrate-compose": "1.0.0-beta.3",
41
+ "@mnmal-ai/substrate-config": "1.0.0-beta.3",
42
+ "@mnmal-ai/substrate-core": "1.0.0-beta.3",
43
+ "@mnmal-ai/substrate-dataset-memory": "1.0.0-beta.3",
44
+ "@mnmal-ai/substrate-dataset-pg": "1.0.0-beta.3",
45
+ "@mnmal-ai/substrate-embedder": "1.0.0-beta.3",
46
+ "@mnmal-ai/substrate-filter": "1.0.0-beta.3",
47
+ "@mnmal-ai/substrate-pack": "1.0.0-beta.3",
48
+ "@mnmal-ai/substrate-policy": "1.0.0-beta.3",
49
+ "@mnmal-ai/substrate-proposals": "1.0.0-beta.3",
50
+ "@mnmal-ai/substrate-recall": "1.0.0-beta.3",
51
+ "@mnmal-ai/substrate-sdk": "1.0.0-beta.3",
52
+ "@mnmal-ai/substrate-sentinel-client": "1.0.0-beta.3",
53
+ "@mnmal-ai/substrate-server-fastify": "1.0.0-beta.3",
54
+ "@mnmal-ai/substrate-server-memory": "1.0.0-beta.3",
55
+ "@mnmal-ai/substrate-types": "1.0.0-beta.3",
56
56
  "@mnmal-ai/surface-core": "0.17.1",
57
57
  "@types/node": "^26.6.4",
58
58
  "@types/semver": "^7.5.0",