@mnmal-ai/substrate 1.0.0-alpha.17 → 1.0.0-alpha.18
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 +2 -2
- package/dist/{boot-store-DNU0UfX7.js → boot-store-C8KrACZ5.js} +38 -12
- package/dist/{cli-CwWUYUMv.js → cli-zZ7nHhY5.js} +174 -9
- package/dist/client.d.ts +5 -0
- package/dist/client.js +1 -1
- package/dist/{pg-edges-store-CSJ7sG2l.js → pg-edges-store-D7etFxNK.js} +1 -1
- package/dist/{plugin-Dk9RC3LH.js → plugin-DcoJGEMM.js} +1 -1
- package/dist/proposals-bootstrap.js +2 -2
- package/dist/proposals.js +1 -1
- package/dist/recall-bootstrap.js +2 -2
- package/dist/recall.js +2 -2
- package/dist/{repl-BNnKFG3y.js → repl-SY8cLOZl.js} +1 -1
- package/dist/{run-NmwNmVUD.js → run-Cr-53N3F.js} +3 -3
- package/dist/{script-C6DSa_Na.js → script-B-32wZGY.js} +11 -1
- package/dist/script-runner.js +78 -0
- package/dist/sdk.d.ts +3 -2
- package/dist/sdk.js +1 -1
- package/dist/{src-DwynOVMk.js → src-B4dTiEWw.js} +1 -1
- package/dist/{src-DWrFdHrY.js → src-BcuotITf.js} +1 -1
- package/dist/{src-BHh6UZ7L.js → src-D55T3ZcP.js} +123 -67
- package/dist/{src-7lp1y4HK.js → src-DZfgQ2gR.js} +3 -3
- package/dist/substrate-admin.js +1 -1
- package/dist/substrate.js +1 -1
- package/dist/testing.js +3 -3
- package/package.json +19 -19
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ A plugin package declares `@mnmal-ai/substrate` as a peer dependency and as a de
|
|
|
35
35
|
|
|
36
36
|
### MCP tools
|
|
37
37
|
|
|
38
|
-
`substrate mcp` serves `schema`, `query`, `mutate`, `recall`, `ask`, `whoami`, `propose_type`, `propose_field`, and the admin-gated `drop_namespace` / `drop_type`. It talks to a running server at `SUBSTRATE_URL` and signs requests when `SUBSTRATE_AGENT_KEY_ID` and `SUBSTRATE_AGENT_KEY_PATH` are set. [`docs/surface-parity.md`](https://github.com/mnmal-ai/substrate/blob/main/docs/surface-parity.md) maps what each surface (HTTP, MCP, WS, SSE) offers.
|
|
38
|
+
`substrate mcp` serves `schema`, `query`, `mutate`, `run`, `recall`, `ask`, `whoami`, `propose_type`, `propose_field`, `propose_index`, and the admin-gated `drop_namespace` / `drop_type`. `run` executes a short script against the store in one call (the same context as `substrate run`), in a child process with no file, network, process or environment access. It talks to a running server at `SUBSTRATE_URL` and signs requests when `SUBSTRATE_AGENT_KEY_ID` and `SUBSTRATE_AGENT_KEY_PATH` are set. [`docs/surface-parity.md`](https://github.com/mnmal-ai/substrate/blob/main/docs/surface-parity.md) maps what each surface (HTTP, MCP, WS, SSE) offers.
|
|
39
39
|
|
|
40
40
|
### `substrate ask`
|
|
41
41
|
|
|
@@ -139,7 +139,7 @@ The main ones; `substrate --help` and the header of `apps/substrate/src/main.ts`
|
|
|
139
139
|
| `SUBSTRATE_AUTH_KEY_REGISTRY` | Path to a JSON key registry file. Without it, auth reads keys registered in Postgres with `substrate-admin`. |
|
|
140
140
|
| `SUBSTRATE_PUBLIC_ORIGIN` | The origins callers reach this server by, comma-separated (`https://host:3100,https://alias`). A token whose `aud` names none of them is refused. **Required when auth is enabled and `HOST` is not loopback**; on loopback it defaults to the loopback origins. |
|
|
141
141
|
| `SUBSTRATE_STREAM_TICKET_SECRET` | HMAC key signing SSE stream tickets. **Required when auth is enabled**; at least 16 characters. The ticket signature is the only authentication on `GET /substrate/v1/stream` and `GET /substrate/v1/subscribe`, because `EventSource` can send no header or body. Rotating it invalidates every outstanding ticket. |
|
|
142
|
-
| `SUBSTRATE_TLS_KEY_PATH` / `SUBSTRATE_TLS_CERT_PATH` / `SUBSTRATE_TLS_CA_PATH` | Serve HTTPS. Key and cert are required together. |
|
|
142
|
+
| `SUBSTRATE_TLS_KEY_PATH` / `SUBSTRATE_TLS_CERT_PATH` / `SUBSTRATE_TLS_CA_PATH` | Serve HTTPS, over HTTP/2 with an HTTP/1.1 fallback. Key and cert are required together. |
|
|
143
143
|
| `SUBSTRATE_NAMESPACE` | Default namespace for recall requests that omit one; with neither, recall refuses with `missing_namespace`. |
|
|
144
144
|
| `SUBSTRATE_STATEMENT_TIMEOUT_MS` | Statement timeout for typed edge walk reads (default 30000). A read it cancels is refused `query_timeout`. It also bounds the wait for a free database connection; a request that waits longer is refused `store_busy`. |
|
|
145
145
|
| `SUBSTRATE_PAGE_LIMIT_DEFAULT` / `SUBSTRATE_PAGE_LIMIT_MAX` | Page size for a remote query that names no `limit` (default 100), and the largest `limit` accepted (default 1000). |
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { A as isReservedAutoCrudField, Ft as HttpBridgeClient, Lt as buildContext, Vt as parseAuthConfig, Wt as WS_REASON_SERVER_RESTART, Z as MemoryEdgesStore, _ as AUDIT_EVENT_TYPE, _t as getExtensionOperator, a as composeFromManifests, bt as unregisterExtensionOperator, 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 listExtensionOperators, yt as registerExtensionOperator } from "./src-
|
|
2
|
+
import { A as isReservedAutoCrudField, Ft as HttpBridgeClient, Lt as buildContext, Vt as parseAuthConfig, Wt as WS_REASON_SERVER_RESTART, Z as MemoryEdgesStore, _ as AUDIT_EVENT_TYPE, _t as getExtensionOperator, a as composeFromManifests, bt as unregisterExtensionOperator, 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 listExtensionOperators, yt as registerExtensionOperator } from "./src-D55T3ZcP.js";
|
|
3
3
|
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-CGNazUNt.js";
|
|
4
4
|
import { D as isActiveAdminKeyRow, E as describeGrant, L as encodeList, M as grantEntryError, T as SYSTEM_NAMESPACE, v as grantEntriesConfer } from "./src-DR_hUj2p.js";
|
|
5
5
|
import { L as DEFAULT_FILTER_WRITE_LIMITS } from "./src-CdbUzLhB.js";
|
|
6
6
|
import { C as diagnose, S as DIAGNOSE_CHECKS, _ 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-DV6PcXym.js";
|
|
7
|
-
import { _ as pendingMigrations, f as assertNotMigrating, h as deriveListIndexMigration, m as assertTablesLayout, n as PgDataset, t as PgIdempotencyStore, v as runDerivedMigrations, y as runMigrations } from "./src-
|
|
8
|
-
import { t as PgEdgesStore } from "./pg-edges-store-
|
|
9
|
-
import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore } from "./src-
|
|
10
|
-
import { et as memberKey } from "./plugin-
|
|
7
|
+
import { _ as pendingMigrations, f as assertNotMigrating, h as deriveListIndexMigration, m as assertTablesLayout, n as PgDataset, t as PgIdempotencyStore, v as runDerivedMigrations, y as runMigrations } from "./src-BcuotITf.js";
|
|
8
|
+
import { t as PgEdgesStore } from "./pg-edges-store-D7etFxNK.js";
|
|
9
|
+
import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore } from "./src-DZfgQ2gR.js";
|
|
10
|
+
import { et as memberKey } from "./plugin-DcoJGEMM.js";
|
|
11
11
|
import { existsSync, linkSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
12
12
|
import { homedir } from "node:os";
|
|
13
13
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -17,6 +17,7 @@ import WebSocket$1 from "ws";
|
|
|
17
17
|
import { readFile, readdir, stat, statfs } from "node:fs/promises";
|
|
18
18
|
import postgres from "postgres";
|
|
19
19
|
import { pathToFileURL } from "node:url";
|
|
20
|
+
import { constants } from "node:http2";
|
|
20
21
|
import compressPlugin from "@fastify/compress";
|
|
21
22
|
import corsPlugin from "@fastify/cors";
|
|
22
23
|
import websocketPlugin from "@fastify/websocket";
|
|
@@ -1747,7 +1748,7 @@ async function closeQuietly(sql) {
|
|
|
1747
1748
|
|
|
1748
1749
|
//#endregion
|
|
1749
1750
|
//#region package.json
|
|
1750
|
-
var version = "1.0.0-alpha.
|
|
1751
|
+
var version = "1.0.0-alpha.18";
|
|
1751
1752
|
|
|
1752
1753
|
//#endregion
|
|
1753
1754
|
//#region src/plugin-manifest.ts
|
|
@@ -2143,6 +2144,8 @@ async function applySubstrateResponse(reply, res) {
|
|
|
2143
2144
|
* caller's intent is ambiguous, fail loudly.
|
|
2144
2145
|
*/
|
|
2145
2146
|
const DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
|
|
2147
|
+
/** Streams one HTTP/2 connection may have open at once. Node's default is unbounded. */
|
|
2148
|
+
const H2_MAX_CONCURRENT_STREAMS = 128;
|
|
2146
2149
|
const DEFAULT_WS_MAX_PAYLOAD = 1 << 20;
|
|
2147
2150
|
const DEFAULT_WS_MAX_BUFFERED = 16 << 20;
|
|
2148
2151
|
/** How long a buffer-full socket gets to finish its close handshake before it is dropped. */
|
|
@@ -2171,15 +2174,19 @@ var FastifySubstrateServer = class {
|
|
|
2171
2174
|
...bodyLimit !== void 0 ? { bodyLimit } : {}
|
|
2172
2175
|
};
|
|
2173
2176
|
if (tls) {
|
|
2174
|
-
const httpsOptions = {
|
|
2175
|
-
cert: tls.cert,
|
|
2176
|
-
key: tls.key,
|
|
2177
|
-
...tls.ca !== void 0 ? { ca: tls.ca } : {}
|
|
2178
|
-
};
|
|
2179
2177
|
this.fastify = Fastify({
|
|
2180
2178
|
...common,
|
|
2181
|
-
|
|
2179
|
+
http2: true,
|
|
2180
|
+
https: {
|
|
2181
|
+
allowHTTP1: true,
|
|
2182
|
+
cert: tls.cert,
|
|
2183
|
+
key: tls.key,
|
|
2184
|
+
...tls.ca !== void 0 ? { ca: tls.ca } : {},
|
|
2185
|
+
settings: { maxConcurrentStreams: H2_MAX_CONCURRENT_STREAMS }
|
|
2186
|
+
}
|
|
2182
2187
|
});
|
|
2188
|
+
this.fastify.server.requestTimeout = requestTimeout;
|
|
2189
|
+
if (requestTimeout > 0) boundH2Requests(this.fastify, requestTimeout);
|
|
2183
2190
|
} else this.fastify = Fastify(common);
|
|
2184
2191
|
this.fastify.addContentTypeParser("application/octet-stream", { parseAs: "buffer" }, (_req, body, done) => done(null, body));
|
|
2185
2192
|
this.fastify.addContentTypeParser("application/vnd.substrate.pack", { parseAs: "buffer" }, (_req, body, done) => done(null, body));
|
|
@@ -2553,6 +2560,25 @@ function registerWsRoute(fastify, path, handler, inFlightWs, onHandlerError, max
|
|
|
2553
2560
|
wsHandler
|
|
2554
2561
|
});
|
|
2555
2562
|
}
|
|
2563
|
+
/**
|
|
2564
|
+
* HTTP/2 has no `requestTimeout`: give each h2 request `ms` to arrive in full
|
|
2565
|
+
* (headers and body), then reset its stream. The clock stops once the handler
|
|
2566
|
+
* runs, so a streamed response is not bounded by it.
|
|
2567
|
+
*/
|
|
2568
|
+
function boundH2Requests(fastify, ms) {
|
|
2569
|
+
const timers = /* @__PURE__ */ new WeakMap();
|
|
2570
|
+
fastify.addHook("onRequest", async (req) => {
|
|
2571
|
+
const stream = req.raw.stream;
|
|
2572
|
+
if (stream === void 0) return;
|
|
2573
|
+
const timer = setTimeout(() => stream.close(constants.NGHTTP2_CANCEL), ms);
|
|
2574
|
+
timers.set(req.raw, timer);
|
|
2575
|
+
stream.once("close", () => clearTimeout(timer));
|
|
2576
|
+
});
|
|
2577
|
+
fastify.addHook("preHandler", async (req, reply) => {
|
|
2578
|
+
clearTimeout(timers.get(req.raw));
|
|
2579
|
+
if (req.raw.stream?.closed === true) return reply.code(408).send();
|
|
2580
|
+
});
|
|
2581
|
+
}
|
|
2556
2582
|
|
|
2557
2583
|
//#endregion
|
|
2558
2584
|
//#region ../../packages/substrate-sentinel-client/src/client.ts
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { _ as AUDIT_EVENT_TYPE, cn as validateHardDeleteEnv, g as buildAuditRow, it as saveSweepState, m as runInviteSweep, nt as loadSweepState, rt as runSweep, u as isStoreProfileName, v as INVITE_TYPE } from "./src-
|
|
2
|
+
import { _ as AUDIT_EVENT_TYPE, cn as validateHardDeleteEnv, g as buildAuditRow, it as saveSweepState, m as runInviteSweep, nt as loadSweepState, rt as runSweep, u as isStoreProfileName, v as INVITE_TYPE } from "./src-D55T3ZcP.js";
|
|
3
3
|
import { n as trimTrailingSlashes, s as makeAuthorizationProvider } from "./env-utils-CGNazUNt.js";
|
|
4
4
|
import { L as encodeList, T as SYSTEM_NAMESPACE, f as coversNamespace, m as grantedIn, p as grantOf } from "./src-DR_hUj2p.js";
|
|
5
5
|
import { F as EXPR_FUNCTIONS, I as EXPR_LIMITS, N as DATE_UNITS, P as EXPR_AGGREGATES } from "./src-CdbUzLhB.js";
|
|
6
|
-
import { Y as AdminCliError, _ as openPgDataset, a as parseBridgeCreds, f as reportUnguardedIndexBuilds, g as version, i as MS_PER_DAY, m as startSentinelClient, n as resolvePluginDir, o as parseBridges, p as runDeferredIndexBuilds, s as parseEnv, t as bootStore, u as redactStoreSpec } from "./boot-store-
|
|
6
|
+
import { Y as AdminCliError, _ as openPgDataset, a as parseBridgeCreds, f as reportUnguardedIndexBuilds, g as version, i as MS_PER_DAY, m as startSentinelClient, n as resolvePluginDir, o as parseBridges, p as runDeferredIndexBuilds, s as parseEnv, t as bootStore, u as redactStoreSpec } from "./boot-store-C8KrACZ5.js";
|
|
7
7
|
import { 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-DV6PcXym.js";
|
|
8
|
-
import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-
|
|
9
|
-
import { T as tryWithPgAdvisoryLock } from "./src-
|
|
10
|
-
import { n as PgLexicalStore, r as PgEmbeddingsStore } from "./src-
|
|
11
|
-
import { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
12
|
-
import { homedir, hostname } from "node:os";
|
|
8
|
+
import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-B-32wZGY.js";
|
|
9
|
+
import { T as tryWithPgAdvisoryLock } from "./src-BcuotITf.js";
|
|
10
|
+
import { n as PgLexicalStore, r as PgEmbeddingsStore } from "./src-DZfgQ2gR.js";
|
|
11
|
+
import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
12
|
+
import { homedir, hostname, tmpdir } from "node:os";
|
|
13
13
|
import { basename, dirname, join, resolve } from "node:path";
|
|
14
14
|
import { createHash, generateKeyPairSync, randomBytes } from "node:crypto";
|
|
15
|
-
import { pathToFileURL } from "node:url";
|
|
15
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
16
16
|
import { z } from "zod";
|
|
17
17
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
18
18
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
19
|
+
import { fork } from "node:child_process";
|
|
19
20
|
|
|
20
21
|
//#region ../../node_modules/.pnpm/@mnmal-ai+surface-kit@0.17.1_ink@8.0.0_@types+react@19.3.0_react@19.3.1__react@19.3.1/node_modules/@mnmal-ai/surface-kit/dist/cells.js
|
|
21
22
|
const graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
@@ -2163,7 +2164,7 @@ async function runInit(argv) {
|
|
|
2163
2164
|
return 1;
|
|
2164
2165
|
}
|
|
2165
2166
|
if (!config.yes) try {
|
|
2166
|
-
const { runRepl } = await import("./repl-
|
|
2167
|
+
const { runRepl } = await import("./repl-SY8cLOZl.js");
|
|
2167
2168
|
config = await runRepl(config);
|
|
2168
2169
|
} catch (err) {
|
|
2169
2170
|
if (err.message?.includes("User force closed")) return 130;
|
|
@@ -2455,6 +2456,126 @@ function makeAgentJwtProvider(env, audience) {
|
|
|
2455
2456
|
return () => provider();
|
|
2456
2457
|
}
|
|
2457
2458
|
|
|
2459
|
+
//#endregion
|
|
2460
|
+
//#region src/mcp/run-sandbox.ts
|
|
2461
|
+
/**
|
|
2462
|
+
* Runs agent-supplied script text in a sandboxed child process (Decision #642).
|
|
2463
|
+
*
|
|
2464
|
+
* The child runs under Node's permission model: it may read only its runner and
|
|
2465
|
+
* the script, and has no network, child processes, workers or environment. Each
|
|
2466
|
+
* ScriptContext call it makes is relayed to a real one from `runScript`, so the
|
|
2467
|
+
* read / dry-run / write modes, `maxWrites`, signing and the report are exactly
|
|
2468
|
+
* the CLI's.
|
|
2469
|
+
*/
|
|
2470
|
+
const DEFAULT_RUN_TIMEOUT_MS = 6e4;
|
|
2471
|
+
/** Heap ceiling for one script's child, in MiB. */
|
|
2472
|
+
const CHILD_HEAP_MB = 256;
|
|
2473
|
+
const OPS = /* @__PURE__ */ new Set([
|
|
2474
|
+
"query",
|
|
2475
|
+
"queryAll",
|
|
2476
|
+
"recall",
|
|
2477
|
+
"schema",
|
|
2478
|
+
"mutate",
|
|
2479
|
+
"log"
|
|
2480
|
+
]);
|
|
2481
|
+
/** The runner beside this module: `.js` in the built package, `.ts` when run from source. */
|
|
2482
|
+
function runnerPath() {
|
|
2483
|
+
const js = fileURLToPath(new URL("./script-runner.js", import.meta.url));
|
|
2484
|
+
return existsSync(js) ? js : fileURLToPath(new URL("./script-runner.ts", import.meta.url));
|
|
2485
|
+
}
|
|
2486
|
+
async function runSandboxed(source, opts) {
|
|
2487
|
+
const dir = mkdtempSync(join(tmpdir(), "substrate-run-"));
|
|
2488
|
+
const script = join(dir, "script.mts");
|
|
2489
|
+
writeFileSync(script, source);
|
|
2490
|
+
const runner = runnerPath();
|
|
2491
|
+
const timeoutMs = opts.timeoutMs ?? 6e4;
|
|
2492
|
+
try {
|
|
2493
|
+
return await runScript((s) => inChild(s, runner, script, timeoutMs), {
|
|
2494
|
+
client: opts.client,
|
|
2495
|
+
kid: opts.kid,
|
|
2496
|
+
...opts.mode !== void 0 ? { mode: opts.mode } : {},
|
|
2497
|
+
...opts.args !== void 0 ? { args: opts.args } : {},
|
|
2498
|
+
...opts.maxWrites !== void 0 ? { maxWrites: opts.maxWrites } : {},
|
|
2499
|
+
...opts.log !== void 0 ? { log: opts.log } : {}
|
|
2500
|
+
});
|
|
2501
|
+
} finally {
|
|
2502
|
+
rmSync(dir, {
|
|
2503
|
+
recursive: true,
|
|
2504
|
+
force: true
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
function inChild(s, runner, script, timeoutMs) {
|
|
2509
|
+
return new Promise((resolve, reject) => {
|
|
2510
|
+
const child = fork(runner, [], {
|
|
2511
|
+
execArgv: [
|
|
2512
|
+
"--permission",
|
|
2513
|
+
`--allow-fs-read=${runner}`,
|
|
2514
|
+
`--allow-fs-read=${script}`,
|
|
2515
|
+
`--max-old-space-size=${CHILD_HEAP_MB}`
|
|
2516
|
+
],
|
|
2517
|
+
env: {},
|
|
2518
|
+
stdio: [
|
|
2519
|
+
"ignore",
|
|
2520
|
+
"ignore",
|
|
2521
|
+
"ignore",
|
|
2522
|
+
"ipc"
|
|
2523
|
+
],
|
|
2524
|
+
serialization: "advanced"
|
|
2525
|
+
});
|
|
2526
|
+
let settled = false;
|
|
2527
|
+
const finish = (err, value) => {
|
|
2528
|
+
if (settled) return;
|
|
2529
|
+
settled = true;
|
|
2530
|
+
clearTimeout(timer);
|
|
2531
|
+
child.kill("SIGKILL");
|
|
2532
|
+
if (err !== null) reject(err);
|
|
2533
|
+
else resolve(value);
|
|
2534
|
+
};
|
|
2535
|
+
const timer = setTimeout(() => finish(/* @__PURE__ */ new Error(`script timed out after ${timeoutMs} ms`)), timeoutMs);
|
|
2536
|
+
child.on("error", (err) => finish(err));
|
|
2537
|
+
child.on("exit", (code, signal) => finish(/* @__PURE__ */ new Error(`script process exited (${signal ?? `code ${code}`}) before finishing`)));
|
|
2538
|
+
child.on("message", (m) => {
|
|
2539
|
+
if (m.type === "done") {
|
|
2540
|
+
if (m.ok === true) finish(null, m.result);
|
|
2541
|
+
else finish(new Error(m.error ?? "script failed"));
|
|
2542
|
+
return;
|
|
2543
|
+
}
|
|
2544
|
+
if (m.type !== "call" || m.id === void 0) return;
|
|
2545
|
+
const id = m.id;
|
|
2546
|
+
const reply = (r) => {
|
|
2547
|
+
if (!settled) child.send({
|
|
2548
|
+
type: "reply",
|
|
2549
|
+
id,
|
|
2550
|
+
...r
|
|
2551
|
+
});
|
|
2552
|
+
};
|
|
2553
|
+
if (m.op === void 0 || !OPS.has(m.op)) {
|
|
2554
|
+
reply({
|
|
2555
|
+
ok: false,
|
|
2556
|
+
error: `unknown context call '${String(m.op)}'`
|
|
2557
|
+
});
|
|
2558
|
+
return;
|
|
2559
|
+
}
|
|
2560
|
+
const fn = s[m.op];
|
|
2561
|
+
Promise.resolve().then(() => fn(...m.input ?? [])).then((value) => reply({
|
|
2562
|
+
ok: true,
|
|
2563
|
+
value
|
|
2564
|
+
}), (err) => reply({
|
|
2565
|
+
ok: false,
|
|
2566
|
+
error: err instanceof Error ? err.message : String(err)
|
|
2567
|
+
}));
|
|
2568
|
+
});
|
|
2569
|
+
child.send({
|
|
2570
|
+
type: "start",
|
|
2571
|
+
script,
|
|
2572
|
+
kid: s.kid,
|
|
2573
|
+
mode: s.mode,
|
|
2574
|
+
args: { ...s.args }
|
|
2575
|
+
});
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2458
2579
|
//#endregion
|
|
2459
2580
|
//#region src/mcp/schema-overview.ts
|
|
2460
2581
|
/**
|
|
@@ -2861,6 +2982,33 @@ function createDropTypeHandler(endpoint) {
|
|
|
2861
2982
|
}
|
|
2862
2983
|
};
|
|
2863
2984
|
}
|
|
2985
|
+
/**
|
|
2986
|
+
* `run`: one script, sandboxed (Decision #642), signed as this MCP server's
|
|
2987
|
+
* agent. The client is made on first use and kept: building it reads the key.
|
|
2988
|
+
*/
|
|
2989
|
+
function createRunHandler(env = process.env) {
|
|
2990
|
+
let signed;
|
|
2991
|
+
return async (input) => {
|
|
2992
|
+
try {
|
|
2993
|
+
signed ??= createClientFromEnv({ env });
|
|
2994
|
+
if (signed.kid === null) return errorResult("run needs an agent identity: set SUBSTRATE_AGENT_KEY_ID and SUBSTRATE_AGENT_KEY_PATH");
|
|
2995
|
+
const report = await runSandboxed(input.script, {
|
|
2996
|
+
client: signed.client,
|
|
2997
|
+
kid: signed.kid,
|
|
2998
|
+
mode: input.mode ?? "read",
|
|
2999
|
+
args: input.args ?? {},
|
|
3000
|
+
maxWrites: input.maxWrites ?? 50,
|
|
3001
|
+
log: () => {}
|
|
3002
|
+
});
|
|
3003
|
+
return report.ok ? okResult(report) : {
|
|
3004
|
+
...okResult(report),
|
|
3005
|
+
isError: true
|
|
3006
|
+
};
|
|
3007
|
+
} catch (err) {
|
|
3008
|
+
return errorResult(toMessage(err));
|
|
3009
|
+
}
|
|
3010
|
+
};
|
|
3011
|
+
}
|
|
2864
3012
|
function createMcpServer(endpoint, options = {}) {
|
|
2865
3013
|
const server = new McpServer({
|
|
2866
3014
|
name: "substrate",
|
|
@@ -2896,6 +3044,23 @@ function createMcpServer(endpoint, options = {}) {
|
|
|
2896
3044
|
},
|
|
2897
3045
|
handler: createMutateHandler(endpoint)
|
|
2898
3046
|
},
|
|
3047
|
+
{
|
|
3048
|
+
name: "run",
|
|
3049
|
+
config: {
|
|
3050
|
+
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); 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 }.",
|
|
3051
|
+
inputSchema: {
|
|
3052
|
+
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\""),
|
|
3053
|
+
args: z.record(z.string(), z.unknown()).optional().describe("Passed to the script as s.args."),
|
|
3054
|
+
mode: z.enum([
|
|
3055
|
+
"read",
|
|
3056
|
+
"dry-run",
|
|
3057
|
+
"write"
|
|
3058
|
+
]).optional().describe("Default \"read\"."),
|
|
3059
|
+
maxWrites: z.number().int().nonnegative().optional().describe("Write mode: most mutate frames to send. Default 50.")
|
|
3060
|
+
}
|
|
3061
|
+
},
|
|
3062
|
+
handler: createRunHandler()
|
|
3063
|
+
},
|
|
2899
3064
|
{
|
|
2900
3065
|
name: "ask",
|
|
2901
3066
|
config: {
|
package/dist/client.d.ts
CHANGED
|
@@ -824,6 +824,11 @@ interface ScriptContext {
|
|
|
824
824
|
}): Promise<Record<string, unknown>[]>;
|
|
825
825
|
/** Recall hits, best first, through the `recall/Hit` frame. */
|
|
826
826
|
recall(input: ScriptRecallInput): Promise<ScriptRecallHit[]>;
|
|
827
|
+
/**
|
|
828
|
+
* The federated schema, one namespace's schema, or one type's. Throws naming
|
|
829
|
+
* an unknown namespace or type.
|
|
830
|
+
*/
|
|
831
|
+
schema(namespace?: string, type?: string): Promise<unknown>;
|
|
827
832
|
/**
|
|
828
833
|
* One mutate payload (one transaction). Returns null in `dry-run`, and throws
|
|
829
834
|
* in `read`, past `maxWrites`, or when the server refuses any frame.
|
package/dist/client.js
CHANGED
|
@@ -3,6 +3,6 @@ import { a as adminClaimCapabilities, c as makeTokenProvider, d as resolveDefaul
|
|
|
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, g as checkUpdatable, h as checkRevocable, i as allowVerbs, j as flattenGrant, k as encodeGrant, l as requireNamespace, n as row, o as denyVerbs, r as allowAll, s as requireCapability, t as applyRowFilters, v as grantEntriesConfer, w as or, x as revokedAtIso, y as newlyGranted } from "./src-DR_hUj2p.js";
|
|
4
4
|
import { f as SchemaDriftError } from "./src-CdbUzLhB.js";
|
|
5
5
|
import { C as diagnose, S as DIAGNOSE_CHECKS, _ as SKIPPABLE_STEPS, a as SubstrateClient, b as planOnboarding, c as reduceSubscribeRows, d as NetworkError, f as SubscribeError, g as ONBOARD_STEPS, h as CURRENT_MARK, i as tokenAudience, l as watchRows, m as BACKFILL_CHUNK, n as resolveAgentCapabilities, o as collectDiagnostics, p as AdminBackfillError, r as noRedirectFetch, s as createDefaultDiagnosticsSink, t as createClientFromEnv, u as AuthError, v as STEP_MARKS, w as reconcileIdentities, x as requiredOutstanding, y as currentStep } from "./src-DV6PcXym.js";
|
|
6
|
-
import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-
|
|
6
|
+
import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-B-32wZGY.js";
|
|
7
7
|
|
|
8
8
|
export { ADMIN_CAPABILITIES, AdminBackfillError, AuthError, BACKFILL_CHUNK, CURRENT_MARK, DEFAULT_CAPABILITIES, DEFAULT_MAX_WRITES, DIAGNOSE_CHECKS, NetworkError, ONBOARD_STEPS, SKIPPABLE_STEPS, STEP_MARKS, SYSTEM_NAMESPACE, SchemaDriftError, SubscribeError, SubstrateClient, adminClaimCapabilities, allowAll, allowVerbs, and, applyRowFilters, capabilitiesFor, checkRevocable, checkUpdatable, collectDiagnostics, createClientFromEnv, createDefaultDiagnosticsSink, currentStep, decodeList, denyAll, denyVerbs, describeGrant, diagnose, encodeGrant, encodeList, expandFlat, flattenGrant, grantCovers, grantEntriesConfer, grantEntryError, grantIsUniform, intersectGrants, isActiveAdminKeyRow, isEncryptedKey, makeAuthorizationProvider, makeTokenProvider, newlyGranted, newlyGrantedPairs, noRedirectFetch, not, or, parseGrantEntries, planOnboarding, reconcileIdentities, reduceSubscribeRows, requireCapability, requireIdentity, requireNamespace, requiredOutstanding, resolveAdminCredential, resolveAgentCapabilities, resolveDefaultKeyPath, resolveDefaultKidPath, revokedAtIso, row, runScript, tokenAudience, watchRows };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { r as txScopeIdFor } from "./src-
|
|
2
|
+
import { r as txScopeIdFor } from "./src-BcuotITf.js";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
|
|
5
5
|
//#region ../../packages/substrate-dataset-pg/src/pg-edges-store.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { Lt as buildContext, tt as applyObligations, vn as ResolverFrameError, zt as jsonResponse } from "./src-
|
|
2
|
+
import { Lt as buildContext, tt as applyObligations, vn as ResolverFrameError, zt as jsonResponse } from "./src-D55T3ZcP.js";
|
|
3
3
|
import "./src-CdbUzLhB.js";
|
|
4
4
|
import { Worker } from "node:worker_threads";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { zn as defineBootstrap } from "./src-
|
|
3
|
-
import { n as createNoopPubSub, t as createProposalsPlugin } from "./src-
|
|
2
|
+
import { zn as defineBootstrap } from "./src-D55T3ZcP.js";
|
|
3
|
+
import { n as createNoopPubSub, t as createProposalsPlugin } from "./src-B4dTiEWw.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region ../../plugins/substrate-proposals/src/bootstrap.ts
|
package/dist/proposals.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { i as ProposalError, n as createNoopPubSub, r as storageSettled, t as createProposalsPlugin } from "./src-
|
|
2
|
+
import { i as ProposalError, n as createNoopPubSub, r as storageSettled, t as createProposalsPlugin } from "./src-B4dTiEWw.js";
|
|
3
3
|
|
|
4
4
|
export { ProposalError, createNoopPubSub, createProposalsPlugin, storageSettled };
|
package/dist/recall-bootstrap.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { zn as defineBootstrap } from "./src-
|
|
2
|
+
import { zn as defineBootstrap } from "./src-D55T3ZcP.js";
|
|
3
3
|
import { t as FakeEmbedder } from "./fake-DUVtKVSE.js";
|
|
4
|
-
import { t as createRecallPlugin } from "./plugin-
|
|
4
|
+
import { t as createRecallPlugin } from "./plugin-DcoJGEMM.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region ../../packages/substrate-embedder/src/types.ts
|
package/dist/recall.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
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-
|
|
3
|
-
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-
|
|
2
|
+
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-DZfgQ2gR.js";
|
|
3
|
+
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-DcoJGEMM.js";
|
|
4
4
|
|
|
5
5
|
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,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { a as parsePositive, i as DEFAULT_SIZING, n as defaultPluginsForPersona, r as parsePort, t as KNOWN_PLUGINS } from "./cli-
|
|
2
|
+
import { a as parsePositive, i as DEFAULT_SIZING, n as defaultPluginsForPersona, r as parsePort, t as KNOWN_PLUGINS } from "./cli-zZ7nHhY5.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { _ as AUDIT_EVENT_TYPE, g as buildAuditRow } from "./src-
|
|
2
|
+
import { _ as AUDIT_EVENT_TYPE, g as buildAuditRow } from "./src-D55T3ZcP.js";
|
|
3
3
|
import { n as trimTrailingSlashes } from "./env-utils-CGNazUNt.js";
|
|
4
4
|
import { I as decodeList, L as encodeList, M as grantEntryError, g as checkUpdatable, h as checkRevocable, y as newlyGranted } from "./src-DR_hUj2p.js";
|
|
5
5
|
import "./src-CdbUzLhB.js";
|
|
6
|
-
import { A as UPDATE_EXIT_CODES, B as readKeyById, C as grantLines, D as parseBootstrapArgs, E as formatBootstrapOutput, F as CLI_ACTOR_KID, G as validateArgv, H as resolveAdminAuth, I as base64Url, J as argvError, K as RESTART_NOTE, L as forUpdate, M as runKeyPatchViaRoute, N as ACTOR_HINT, O as runBootstrap, P as BootstrapError, R as generateAdminKeypair, S as runRegisterViaRoute, T as formatDoctorReport, U as resolveAdminTarget, V as describeAdminTarget, W as ARGV_SPEC, X as pgNoticeOptions, Y as AdminCliError, _ as openPgDataset, b as parseRegisterArgs, c as refuseContractViolation, d as registeredTypes, g as version, h as loadPluginsFromDir, j as runKeyListViaRoute, k as REVOKE_EXIT_CODES, l as buildDeferredIndexes, n as resolvePluginDir, q as USAGE, r as BINARY_CONTRACT_VERSION, s as parseEnv, t as bootStore, v as onboardCommand, w as doctorCommand, x as runRegister, y as formatRegisterOutput, z as listActiveAdminKeys } from "./boot-store-
|
|
7
|
-
import { C as copyRows, S as detectLayout, a as ensureTypeTable, b as UUID_CHECK_MIGRATION, c as typeTableRef, d as PLAIN_SCHEMA_NAME, g as isDerivedMigration, i as seqName, p as assertStoreSchema, s as loadTypeTable, u as MIGRATE_STORE_MARKER_TABLE, w as parseSourceBody, x as UUID_REGEX } from "./src-
|
|
6
|
+
import { A as UPDATE_EXIT_CODES, B as readKeyById, C as grantLines, D as parseBootstrapArgs, E as formatBootstrapOutput, F as CLI_ACTOR_KID, G as validateArgv, H as resolveAdminAuth, I as base64Url, J as argvError, K as RESTART_NOTE, L as forUpdate, M as runKeyPatchViaRoute, N as ACTOR_HINT, O as runBootstrap, P as BootstrapError, R as generateAdminKeypair, S as runRegisterViaRoute, T as formatDoctorReport, U as resolveAdminTarget, V as describeAdminTarget, W as ARGV_SPEC, X as pgNoticeOptions, Y as AdminCliError, _ as openPgDataset, b as parseRegisterArgs, c as refuseContractViolation, d as registeredTypes, g as version, h as loadPluginsFromDir, j as runKeyListViaRoute, k as REVOKE_EXIT_CODES, l as buildDeferredIndexes, n as resolvePluginDir, q as USAGE, r as BINARY_CONTRACT_VERSION, s as parseEnv, t as bootStore, v as onboardCommand, w as doctorCommand, x as runRegister, y as formatRegisterOutput, z as listActiveAdminKeys } from "./boot-store-C8KrACZ5.js";
|
|
7
|
+
import { C as copyRows, S as detectLayout, a as ensureTypeTable, b as UUID_CHECK_MIGRATION, c as typeTableRef, d as PLAIN_SCHEMA_NAME, g as isDerivedMigration, i as seqName, p as assertStoreSchema, s as loadTypeTable, u as MIGRATE_STORE_MARKER_TABLE, w as parseSourceBody, x as UUID_REGEX } from "./src-BcuotITf.js";
|
|
8
8
|
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { dirname } from "node:path";
|
|
10
10
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
@@ -81,8 +81,18 @@ async function runScript(script, opts) {
|
|
|
81
81
|
...fields
|
|
82
82
|
} })).data["recall/Hit"];
|
|
83
83
|
},
|
|
84
|
+
async schema(namespace, type) {
|
|
85
|
+
const all = await client.federatedSchema();
|
|
86
|
+
if (namespace === void 0) return all;
|
|
87
|
+
const ns = all[namespace];
|
|
88
|
+
if (ns === void 0) throw new Error(`schema: unknown namespace '${namespace}'`);
|
|
89
|
+
if (type === void 0) return ns;
|
|
90
|
+
const t = ns.types[type];
|
|
91
|
+
if (t === void 0) throw new Error(`schema: unknown type '${namespace}/${type}'`);
|
|
92
|
+
return t;
|
|
93
|
+
},
|
|
84
94
|
async mutate(frame) {
|
|
85
|
-
if (mode === "read") throw new Error("mutate refused: read mode (
|
|
95
|
+
if (mode === "read") throw new Error("mutate refused: read mode (run in dry-run or write mode)");
|
|
86
96
|
if (mode === "dry-run") {
|
|
87
97
|
mutations.push({
|
|
88
98
|
frame,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
|
|
4
|
+
//#region src/mcp/script-runner.ts
|
|
5
|
+
/**
|
|
6
|
+
* Child entry for a sandboxed `run`: imports the script and hands its default
|
|
7
|
+
* export a ScriptContext whose every call goes to the parent over IPC. The
|
|
8
|
+
* child runs under `--permission` with no fs beyond this file and the script,
|
|
9
|
+
* no network, no child processes and no workers, so the store, reached through
|
|
10
|
+
* the parent, is all a script can touch.
|
|
11
|
+
*
|
|
12
|
+
* Imports node builtins only: any other import would need fs access the
|
|
13
|
+
* sandbox does not grant.
|
|
14
|
+
*/
|
|
15
|
+
const send = (m) => {
|
|
16
|
+
process.send?.(m);
|
|
17
|
+
};
|
|
18
|
+
const pending = /* @__PURE__ */ new Map();
|
|
19
|
+
let seq = 0;
|
|
20
|
+
function call(op, ...input) {
|
|
21
|
+
const id = ++seq;
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
pending.set(id, {
|
|
24
|
+
resolve,
|
|
25
|
+
reject
|
|
26
|
+
});
|
|
27
|
+
send({
|
|
28
|
+
type: "call",
|
|
29
|
+
id,
|
|
30
|
+
op,
|
|
31
|
+
input
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
process.on("message", (m) => {
|
|
36
|
+
if (m.type === "reply") {
|
|
37
|
+
const p = pending.get(m.id);
|
|
38
|
+
pending.delete(m.id);
|
|
39
|
+
if (m.ok) p?.resolve(m.value);
|
|
40
|
+
else p?.reject(new Error(m.error));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (m.type === "start") start(m);
|
|
44
|
+
});
|
|
45
|
+
async function start(m) {
|
|
46
|
+
const s = Object.freeze({
|
|
47
|
+
kid: m.kid,
|
|
48
|
+
mode: m.mode,
|
|
49
|
+
args: Object.freeze({ ...m.args }),
|
|
50
|
+
query: (frame) => call("query", frame),
|
|
51
|
+
queryAll: (key, frame) => call("queryAll", key, frame),
|
|
52
|
+
recall: (input) => call("recall", input),
|
|
53
|
+
schema: (namespace, type) => call("schema", namespace, type),
|
|
54
|
+
mutate: (frame) => call("mutate", frame),
|
|
55
|
+
log: (...args) => {
|
|
56
|
+
call("log", ...args);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
try {
|
|
60
|
+
const mod = await import(pathToFileURL(m.script).href);
|
|
61
|
+
if (typeof mod.default !== "function") throw new Error("the script must default-export a function (s) => result");
|
|
62
|
+
const result = await mod.default(s);
|
|
63
|
+
send({
|
|
64
|
+
type: "done",
|
|
65
|
+
ok: true,
|
|
66
|
+
result
|
|
67
|
+
});
|
|
68
|
+
} catch (err) {
|
|
69
|
+
send({
|
|
70
|
+
type: "done",
|
|
71
|
+
ok: false,
|
|
72
|
+
error: err instanceof Error ? err.message : String(err)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { };
|
package/dist/sdk.d.ts
CHANGED
|
@@ -464,7 +464,8 @@ interface PurgeResolverResult {
|
|
|
464
464
|
purged: boolean;
|
|
465
465
|
[field: string]: unknown;
|
|
466
466
|
}
|
|
467
|
-
|
|
467
|
+
/** With `policy`, a row its row filters hide is left in place and answers `purged: false`. */
|
|
468
|
+
export declare function purgeResolver(typeName: string, dataset: Dataset, policy?: Policy): TypedResolver<PurgeResolverResult>;
|
|
468
469
|
//#endregion
|
|
469
470
|
//#region ../../packages/substrate-sdk/src/autocrud/autocrud-update.d.ts
|
|
470
471
|
interface UpdateResolverOptions {
|
|
@@ -513,7 +514,7 @@ export declare function createResolver<T extends Row = Row>(typeName: string, da
|
|
|
513
514
|
/** `update<T>`: the batch resolver with one element. */
|
|
514
515
|
export declare function updateResolver<T extends Row = Row>(typeName: string, dataset: Dataset, edges: EdgesStore, options?: Pick<BatchResolverOptions, 'fields'>): TypedResolver<T | null>;
|
|
515
516
|
/** `delete<T>`: the batch resolver with one element. */
|
|
516
|
-
export declare function deleteResolver(typeName: string, dataset: Dataset, edges: EdgesStore): TypedResolver<DeleteResolverResult>;
|
|
517
|
+
export declare function deleteResolver(typeName: string, dataset: Dataset, edges: EdgesStore, options?: Pick<BatchResolverOptions, 'policy'>): TypedResolver<DeleteResolverResult>;
|
|
517
518
|
//#endregion
|
|
518
519
|
//#region ../../packages/substrate-sdk/src/autocrud/filter-writes.d.ts
|
|
519
520
|
/**
|
package/dist/sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { $t as METADATA_FILTER_FIELDS, A as isReservedAutoCrudField, An as isAuthCause, B as
|
|
2
|
+
import { $t as METADATA_FILTER_FIELDS, A as isReservedAutoCrudField, An as isAuthCause, B as createResolver, Bt as parseJsonBody, C as makeCtx, Cn as WALKS_IN_MUTATION, D as RESERVED_AUTOCRUD_FIELDS, Dn as WALK_BUDGET_EXCEEDED, E as selectAll, En as WALKS_UNSUPPORTED_STORE, F as createResolverWithEdges, Fn as ROW_METADATA_FIELDS, G as listResolver, Gt as WS_REASON_SUBSCRIPTION_OVERLOADED, H as updateResolver, I as installAutoCrud, In as assertNoRepeatedIds, It as JSON_HEADERS, J as resolveIdentity, Jt as normaliseVocabWhere, K as getResolver, Kt as canonicalVocabValue, L as deleteManyResolver, Ln as canonicalize, M as field, Mn as isResolverFrameError, N as AutoCrudNameCollisionError, Nn as isRestrictViolation, O as RESERVED_AUTOCRUD_FIELD_NAMES, On as WALK_UNSUPPORTED_REF, P as autoCrudOptionsOf, Pn as CLIENT_SUPPLIED_SERVER_FIELD, Qt as METADATA_AUTHOR_FIELDS, R as updateManyResolver, Rn as BootstrapConfigError, Rt as error400, S as EngineQueryError, Sn as VALUE_OUT_OF_RANGE, T as queryOne, Tn as WALKS_NEED_PARTITIONED, U as applyUpdatePatch, Ut as WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, V as deleteResolver, W as deleteRow, Wt as WS_REASON_SERVER_RESTART, X as resolveEntityRow, Xt as vocabImplication, Y as resolveEntityId, Yt as storedVocabSpellings, Zt as RegistryBase, _n as ReservedField, an as isIsoTimestamp, b as assertOrderedBy, bn as STORE_BUSY, cn as validateHardDeleteEnv, dn as FILTER_TOO_BROAD, en as normaliseMetadataOrderBy, fn as MissingReferentError, gn as ROW_POLICY_BLOCKS_WALK, hn as REGEX_BUDGET_EXCEEDED, in as isImpossibleIsoTimestamp, j as reservedMetadataFieldMessage, jn as isBatchElementError, k as RESERVED_METADATA_FIELD_NAMES, kn as filterTooBroad, ln as BatchElementError, mn as QUERY_TIMEOUT, nn as normaliseWalkNode, on as normalizeIsoTimestamp, pn as NamespaceMismatch, q as UnattributedWriteError, qt as normaliseVocabValues, rn as createKeyedMutex, sn as assertHardDeleteAllowed, tn as normaliseMetadataWhere, un as BridgeUnreachableError, vn as ResolverFrameError, w as queryAll, wn as WALKS_IN_SUBSCRIPTION, x as defineNamespace, xn as UnsupportedFilterError, y as assertIndexDecl, yn as RestrictViolation, z as purgeResolver, zn as defineBootstrap, zt as jsonResponse } from "./src-D55T3ZcP.js";
|
|
3
3
|
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-CGNazUNt.js";
|
|
4
4
|
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-DR_hUj2p.js";
|
|
5
5
|
import { A as parseInt64, C as DEFAULT_ORDERED_BY, D as parseQualifiedKey, E as formatQualifiedKey, F as EXPR_FUNCTIONS, I as EXPR_LIMITS, L as DEFAULT_FILTER_WRITE_LIMITS, M as stringifyJsonExact, N as DATE_UNITS, O as isInt16, P as EXPR_AGGREGATES, R as assertNever, T as naturalOrderOf, j as stringifyJson, k as isInt32, w as isColumnField } from "./src-CdbUzLhB.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { $ as publishSchema, D as RESERVED_AUTOCRUD_FIELDS, I as installAutoCrud, It as JSON_HEADERS, J as resolveIdentity, Ln as canonicalize$1, 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, vn as ResolverFrameError, x as defineNamespace, y as assertIndexDecl } from "./src-
|
|
2
|
+
import { $ as publishSchema, D as RESERVED_AUTOCRUD_FIELDS, I as installAutoCrud, It as JSON_HEADERS, J as resolveIdentity, Ln as canonicalize$1, 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, vn as ResolverFrameError, x as defineNamespace, y as assertIndexDecl } from "./src-D55T3ZcP.js";
|
|
3
3
|
import { s as requireCapability } from "./src-DR_hUj2p.js";
|
|
4
4
|
import "./src-CdbUzLhB.js";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { $t as METADATA_FILTER_FIELDS, At as encodeCursor, Ct as walkAggExprType, Dt as endsWithEscape, Et as LIKE_TRAILING_ESCAPE, In as assertNoRepeatedIds, Mt as fullBuiltinOperators, Nt as applyExtensionResultMeta, On as WALK_UNSUPPORTED_REF, Ot as CursorDecodeError, Pt as fieldRequested, Sn as VALUE_OUT_OF_RANGE, St as metadataExprType, Tt as isJsonPathPredicate, _n as ReservedField, at as forEachWalkHop, bn as STORE_BUSY, ct as preResolveExtensionOperatorsDetailed, dt as canRaise, ft as isDateField, gt as refNames, ht as isRefOperand, jt as normalizeOrderBy, kn as filterTooBroad, kt as decodeCursor, lt as aggParts, mn as QUERY_TIMEOUT, mt as groupConjuncts, on as normalizeIsoTimestamp, ot as sharedPicks, pn as NamespaceMismatch, pt as bindingWalks, rn as createKeyedMutex, st as windowGroupBy, ut as aggType, vn as ResolverFrameError, wt as assertJsonPathPredicate, xn as UnsupportedFilterError, xt as exprTypeOfField } from "./src-
|
|
2
|
+
import { $t as METADATA_FILTER_FIELDS, At as encodeCursor, Ct as walkAggExprType, Dt as endsWithEscape, Et as LIKE_TRAILING_ESCAPE, In as assertNoRepeatedIds, Mt as fullBuiltinOperators, Nt as applyExtensionResultMeta, On as WALK_UNSUPPORTED_REF, Ot as CursorDecodeError, Pt as fieldRequested, Sn as VALUE_OUT_OF_RANGE, St as metadataExprType, Tt as isJsonPathPredicate, _n as ReservedField, at as forEachWalkHop, bn as STORE_BUSY, ct as preResolveExtensionOperatorsDetailed, dt as canRaise, ft as isDateField, gt as refNames, ht as isRefOperand, jt as normalizeOrderBy, kn as filterTooBroad, kt as decodeCursor, lt as aggParts, mn as QUERY_TIMEOUT, mt as groupConjuncts, on as normalizeIsoTimestamp, ot as sharedPicks, pn as NamespaceMismatch, pt as bindingWalks, rn as createKeyedMutex, st as windowGroupBy, ut as aggType, vn as ResolverFrameError, wt as assertJsonPathPredicate, xn as UnsupportedFilterError, xt as exprTypeOfField } from "./src-D55T3ZcP.js";
|
|
3
3
|
import { A as parseInt64, M as stringifyJsonExact, N as DATE_UNITS, O as isInt16, T as naturalOrderOf, j as stringifyJson, k as isInt32, w as isColumnField } from "./src-CdbUzLhB.js";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
|
|
@@ -1200,14 +1200,27 @@ function nestedFields(sel) {
|
|
|
1200
1200
|
function projectEnvelope(envelope, frame) {
|
|
1201
1201
|
const data = {};
|
|
1202
1202
|
for (const [key, value] of Object.entries(envelope.data)) {
|
|
1203
|
-
const
|
|
1204
|
-
data[key] =
|
|
1203
|
+
const project = rowProjector(envelope, frame, key);
|
|
1204
|
+
data[key] = Array.isArray(value) ? value.map(project) : project(value, 0);
|
|
1205
1205
|
}
|
|
1206
1206
|
return {
|
|
1207
1207
|
...envelope,
|
|
1208
1208
|
data
|
|
1209
1209
|
};
|
|
1210
1210
|
}
|
|
1211
|
+
/**
|
|
1212
|
+
* How to project row `i` of `envelope.data[key]`. A batched mutate's element
|
|
1213
|
+
* `i` is frame `i`'s result, so it takes frame `i`'s own `fields`.
|
|
1214
|
+
*/
|
|
1215
|
+
function rowProjector(envelope, frame, key) {
|
|
1216
|
+
const entry = frame[key];
|
|
1217
|
+
if (Array.isArray(entry)) return (row, i) => {
|
|
1218
|
+
const fields = entry[i]?.fields;
|
|
1219
|
+
return fields === void 0 ? row : projectValue(row, fields);
|
|
1220
|
+
};
|
|
1221
|
+
const fields = projectionFields(envelope, frame, key);
|
|
1222
|
+
return (row) => fields === void 0 ? row : projectValue(row, fields);
|
|
1223
|
+
}
|
|
1211
1224
|
/** The selection `envelope.data[key]` is projected through, or undefined when it passes through whole. */
|
|
1212
1225
|
function projectionFields(envelope, frame, key) {
|
|
1213
1226
|
const entry = frame[key];
|
|
@@ -1311,10 +1324,9 @@ function* jsonParts(envelope, frame) {
|
|
|
1311
1324
|
sep = ",";
|
|
1312
1325
|
let dsep = "";
|
|
1313
1326
|
for (const [key, value] of Object.entries(envelope.data)) {
|
|
1314
|
-
const
|
|
1315
|
-
const project = (x) => fields === void 0 ? x : projectValue(x, fields);
|
|
1327
|
+
const project = rowProjector(envelope, frame, key);
|
|
1316
1328
|
if (!Array.isArray(value) || value.length <= ROWS_PER_CHUNK) {
|
|
1317
|
-
const s = stringifyJson(project(value));
|
|
1329
|
+
const s = stringifyJson(Array.isArray(value) ? value.map(project) : project(value, 0));
|
|
1318
1330
|
if (s === void 0) continue;
|
|
1319
1331
|
yield `${dsep}${JSON.stringify(key)}:${s}`;
|
|
1320
1332
|
dsep = ",";
|
|
@@ -1323,7 +1335,7 @@ function* jsonParts(envelope, frame) {
|
|
|
1323
1335
|
yield `${dsep}${JSON.stringify(key)}:[`;
|
|
1324
1336
|
dsep = ",";
|
|
1325
1337
|
for (let i = 0; i < value.length; i += ROWS_PER_CHUNK) {
|
|
1326
|
-
const chunk = stringifyJson(value.slice(i, i + ROWS_PER_CHUNK).map(project));
|
|
1338
|
+
const chunk = stringifyJson(value.slice(i, i + ROWS_PER_CHUNK).map((row, j) => project(row, i + j)));
|
|
1327
1339
|
yield `${i === 0 ? "" : ","}${chunk.slice(1, -1)}`;
|
|
1328
1340
|
}
|
|
1329
1341
|
yield "]";
|
|
@@ -7197,6 +7209,15 @@ function partitionMutateByTxScope(singleFrameKeys, parsedByKey, datasets) {
|
|
|
7197
7209
|
* short-form numeric ids legitimately miss and are excluded.
|
|
7198
7210
|
*/
|
|
7199
7211
|
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
7212
|
+
/**
|
|
7213
|
+
* Whether row-filter obligations are already settled for `entry`'s result. A
|
|
7214
|
+
* by-filter mutation's resolver filters the rows it writes, and a delete
|
|
7215
|
+
* returns `{ id, deleted }`, which carries no row values to filter: running a
|
|
7216
|
+
* row predicate on it drops a committed delete to null.
|
|
7217
|
+
*/
|
|
7218
|
+
function resolverFiltered(entry) {
|
|
7219
|
+
return entry.filterTarget !== void 0 || entry.verb === "delete";
|
|
7220
|
+
}
|
|
7200
7221
|
function shapeResult(input) {
|
|
7201
7222
|
const { envelope, key, entry, ctx, result, metric } = input;
|
|
7202
7223
|
const decision = input.resolverFiltered === true ? {
|
|
@@ -9769,7 +9790,7 @@ var Engine = class {
|
|
|
9769
9790
|
decision,
|
|
9770
9791
|
result,
|
|
9771
9792
|
metric: this.#metric,
|
|
9772
|
-
resolverFiltered: registryEntry
|
|
9793
|
+
resolverFiltered: resolverFiltered(registryEntry)
|
|
9773
9794
|
});
|
|
9774
9795
|
return false;
|
|
9775
9796
|
}
|
|
@@ -10136,7 +10157,7 @@ var Engine = class {
|
|
|
10136
10157
|
decision: p.decision,
|
|
10137
10158
|
result: rows[j] ?? null,
|
|
10138
10159
|
metric: this.#metric,
|
|
10139
|
-
resolverFiltered: p.registryEntry
|
|
10160
|
+
resolverFiltered: resolverFiltered(p.registryEntry)
|
|
10140
10161
|
});
|
|
10141
10162
|
const shaped = slotResultOf(scratch, key);
|
|
10142
10163
|
results[i] = shaped;
|
|
@@ -11117,6 +11138,15 @@ function rejectUnknownParams(resolverName, typeName, params, allowed) {
|
|
|
11117
11138
|
});
|
|
11118
11139
|
}
|
|
11119
11140
|
/**
|
|
11141
|
+
* Refuse a caller-supplied value for a `readonly` field, on create and update
|
|
11142
|
+
* alike. shortId is the main case: the engine allocates it.
|
|
11143
|
+
*
|
|
11144
|
+
* @throws ResolverFrameError `readonly_field` naming the first such field
|
|
11145
|
+
*/
|
|
11146
|
+
function assertNoReadonlyFields(params, fieldDefs) {
|
|
11147
|
+
for (const [name, def] of Object.entries(fieldDefs)) if (def.kind === "scalar" && def.readonly === true && name in params) throw new ResolverFrameError("readonly_field", `Cannot set read-only field '${name}' (engine-allocated)`, { field: name });
|
|
11148
|
+
}
|
|
11149
|
+
/**
|
|
11120
11150
|
* Assert that the caller has not supplied any server-controlled fields.
|
|
11121
11151
|
*
|
|
11122
11152
|
* Tier-0: `_metadata` is rejected explicitly — the resolver's spread ordering
|
|
@@ -11470,58 +11500,6 @@ function listResolver(typeName, dataset, options = {}) {
|
|
|
11470
11500
|
};
|
|
11471
11501
|
}
|
|
11472
11502
|
|
|
11473
|
-
//#endregion
|
|
11474
|
-
//#region ../../packages/substrate-sdk/src/autocrud/autocrud-purge.ts
|
|
11475
|
-
/**
|
|
11476
|
-
* autoCRUD `purge<T>` resolver. Spec: §5.1 (`purge<T>({ id })` — optional
|
|
11477
|
-
* admin-only hard-delete), §4.5 (`purge` on nonexistent row returns
|
|
11478
|
-
* `{ deleted: 0 }` without error).
|
|
11479
|
-
*
|
|
11480
|
-
* Purge is hard-delete: it bypasses the `_deletedAt` tombstone lifecycle and
|
|
11481
|
-
* removes the row outright. Downstream edges observe the row as MISSING on
|
|
11482
|
-
* subsequent reads; the sweep's non-bridged MISSING branch treats this as
|
|
11483
|
-
* deleted and fans policy per §6.3.
|
|
11484
|
-
*
|
|
11485
|
-
* Admin gate: this resolver does NOT embed a capability check. The gate is a
|
|
11486
|
-
* `Policy` composed at install time — see `installAutoCrud(..., { purgeable: true })`
|
|
11487
|
-
* which attaches `requireCapability(adminCapability)` by default. Callers can
|
|
11488
|
-
* override with any policy.
|
|
11489
|
-
*
|
|
11490
|
-
* Kill switch: assertHardDeleteAllowed() is the first thing — refusal
|
|
11491
|
-
* short-circuits before any state read.
|
|
11492
|
-
*/
|
|
11493
|
-
const KNOWN_PURGE_PARAMS = /* @__PURE__ */ new Set(["id"]);
|
|
11494
|
-
function purgeResolver(typeName, dataset) {
|
|
11495
|
-
return async (_ctx, args) => {
|
|
11496
|
-
rejectUnknownParams("purge", typeName, args.params, KNOWN_PURGE_PARAMS);
|
|
11497
|
-
assertHardDeleteAllowed();
|
|
11498
|
-
const ds = args.dataset ?? dataset;
|
|
11499
|
-
const id = coerceId(args.params?.id);
|
|
11500
|
-
if (id === void 0) throw new ResolverFrameError("missing_id", `purgeResolver('${typeName}'): params.id is required`, { field: "id" });
|
|
11501
|
-
const { rows: existing } = await ds.read(typeName, {
|
|
11502
|
-
id,
|
|
11503
|
-
includeDeleted: true
|
|
11504
|
-
});
|
|
11505
|
-
const preRow = existing[0];
|
|
11506
|
-
const { deleted } = await ds.purge(typeName, [id]);
|
|
11507
|
-
const purged = deleted > 0;
|
|
11508
|
-
if (purged && args.onWrite !== void 0) {
|
|
11509
|
-
const event = {
|
|
11510
|
-
ns: ds.namespace,
|
|
11511
|
-
type: typeName,
|
|
11512
|
-
id,
|
|
11513
|
-
operation: "delete",
|
|
11514
|
-
...preRow !== void 0 ? { row: preRow } : {}
|
|
11515
|
-
};
|
|
11516
|
-
args.onWrite(event);
|
|
11517
|
-
}
|
|
11518
|
-
return {
|
|
11519
|
-
id,
|
|
11520
|
-
purged
|
|
11521
|
-
};
|
|
11522
|
-
};
|
|
11523
|
-
}
|
|
11524
|
-
|
|
11525
11503
|
//#endregion
|
|
11526
11504
|
//#region ../../packages/substrate-sdk/src/delete.ts
|
|
11527
11505
|
async function deleteRow(args) {
|
|
@@ -11590,7 +11568,7 @@ function prepareCreateRow(rawParams, fields) {
|
|
|
11590
11568
|
const params = dropUndefinedParams(rawParams ?? {});
|
|
11591
11569
|
if (fields) {
|
|
11592
11570
|
assertNoClientServerFields(params, fields, "create");
|
|
11593
|
-
|
|
11571
|
+
assertNoReadonlyFields(params, fields);
|
|
11594
11572
|
Object.assign(params, normaliseVocabValues(params, fields));
|
|
11595
11573
|
assertEnumValues(params, fields);
|
|
11596
11574
|
assertNoUnknownFields(params, fields, "create");
|
|
@@ -11670,6 +11648,7 @@ function prepareUpdate(typeName, rawParams, fields) {
|
|
|
11670
11648
|
function preparePatch(rawParams, fields) {
|
|
11671
11649
|
if (fields) assertNoClientServerFields(rawParams ?? {}, fields, "update");
|
|
11672
11650
|
const sent = dropUndefinedParams(rawParams ?? {});
|
|
11651
|
+
if (fields) assertNoReadonlyFields(sent, fields);
|
|
11673
11652
|
const params = fields !== void 0 ? normaliseVocabValues(sent, fields) : sent;
|
|
11674
11653
|
if ("_deletedAt" in params) throw new ReservedField("_deletedAt");
|
|
11675
11654
|
if (fields) {
|
|
@@ -12275,8 +12254,65 @@ function updateResolver(typeName, dataset, edges, options = {}) {
|
|
|
12275
12254
|
return singleFrame(updateBatchResolver(typeName, dataset, edges, options));
|
|
12276
12255
|
}
|
|
12277
12256
|
/** `delete<T>`: the batch resolver with one element. */
|
|
12278
|
-
function deleteResolver(typeName, dataset, edges) {
|
|
12279
|
-
return singleFrame(deleteBatchResolver(typeName, dataset, edges));
|
|
12257
|
+
function deleteResolver(typeName, dataset, edges, options = {}) {
|
|
12258
|
+
return singleFrame(deleteBatchResolver(typeName, dataset, edges, options));
|
|
12259
|
+
}
|
|
12260
|
+
|
|
12261
|
+
//#endregion
|
|
12262
|
+
//#region ../../packages/substrate-sdk/src/autocrud/autocrud-purge.ts
|
|
12263
|
+
/**
|
|
12264
|
+
* autoCRUD `purge<T>` resolver. Spec: §5.1 (`purge<T>({ id })` — optional
|
|
12265
|
+
* admin-only hard-delete), §4.5 (`purge` on nonexistent row returns
|
|
12266
|
+
* `{ deleted: 0 }` without error).
|
|
12267
|
+
*
|
|
12268
|
+
* Purge is hard-delete: it bypasses the `_deletedAt` tombstone lifecycle and
|
|
12269
|
+
* removes the row outright. Downstream edges observe the row as MISSING on
|
|
12270
|
+
* subsequent reads; the sweep's non-bridged MISSING branch treats this as
|
|
12271
|
+
* deleted and fans policy per §6.3.
|
|
12272
|
+
*
|
|
12273
|
+
* Admin gate: this resolver does NOT embed a capability check. The gate is a
|
|
12274
|
+
* `Policy` composed at install time — see `installAutoCrud(..., { purgeable: true })`
|
|
12275
|
+
* which attaches `requireCapability(adminCapability)` by default. Callers can
|
|
12276
|
+
* override with any policy.
|
|
12277
|
+
*
|
|
12278
|
+
* Kill switch: assertHardDeleteAllowed() is the first thing — refusal
|
|
12279
|
+
* short-circuits before any state read.
|
|
12280
|
+
*/
|
|
12281
|
+
const KNOWN_PURGE_PARAMS = /* @__PURE__ */ new Set(["id"]);
|
|
12282
|
+
/** With `policy`, a row its row filters hide is left in place and answers `purged: false`. */
|
|
12283
|
+
function purgeResolver(typeName, dataset, policy) {
|
|
12284
|
+
return async (ctx, args) => {
|
|
12285
|
+
rejectUnknownParams("purge", typeName, args.params, KNOWN_PURGE_PARAMS);
|
|
12286
|
+
assertHardDeleteAllowed();
|
|
12287
|
+
const ds = args.dataset ?? dataset;
|
|
12288
|
+
const id = coerceId(args.params?.id);
|
|
12289
|
+
if (id === void 0) throw new ResolverFrameError("missing_id", `purgeResolver('${typeName}'): params.id is required`, { field: "id" });
|
|
12290
|
+
const { rows: existing } = await ds.read(typeName, {
|
|
12291
|
+
id,
|
|
12292
|
+
includeDeleted: true
|
|
12293
|
+
});
|
|
12294
|
+
const preRow = existing[0];
|
|
12295
|
+
if (guardRowWrites(ctx, policy, [args], [preRow ?? null])[0]) return {
|
|
12296
|
+
id,
|
|
12297
|
+
purged: false
|
|
12298
|
+
};
|
|
12299
|
+
const { deleted } = await ds.purge(typeName, [id]);
|
|
12300
|
+
const purged = deleted > 0;
|
|
12301
|
+
if (purged && args.onWrite !== void 0) {
|
|
12302
|
+
const event = {
|
|
12303
|
+
ns: ds.namespace,
|
|
12304
|
+
type: typeName,
|
|
12305
|
+
id,
|
|
12306
|
+
operation: "delete",
|
|
12307
|
+
...preRow !== void 0 ? { row: preRow } : {}
|
|
12308
|
+
};
|
|
12309
|
+
args.onWrite(event);
|
|
12310
|
+
}
|
|
12311
|
+
return {
|
|
12312
|
+
id,
|
|
12313
|
+
purged
|
|
12314
|
+
};
|
|
12315
|
+
};
|
|
12280
12316
|
}
|
|
12281
12317
|
|
|
12282
12318
|
//#endregion
|
|
@@ -12643,7 +12679,7 @@ function installAutoCrud(registry, typeName, dataset, edges, options = {}) {
|
|
|
12643
12679
|
const create = singleFrame(createBatch);
|
|
12644
12680
|
const update = singleFrame(updateBatch);
|
|
12645
12681
|
const del = singleFrame(deleteBatch);
|
|
12646
|
-
const purge = purgeResolver(typeName, dataset);
|
|
12682
|
+
const purge = purgeResolver(typeName, dataset, policy);
|
|
12647
12683
|
const cap = capOf(typeName);
|
|
12648
12684
|
const stillOwn = (key, own) => () => {
|
|
12649
12685
|
const get = registry.get?.bind(registry);
|
|
@@ -17615,6 +17651,9 @@ function healthRoute(deps) {
|
|
|
17615
17651
|
* by the registry. The route pulls each mutation's registry entry via
|
|
17616
17652
|
* `engine.registryFor(ns)` and threads the declared `returns` FieldDef into
|
|
17617
17653
|
* the substrate-pack encoder (§5.2).
|
|
17654
|
+
*
|
|
17655
|
+
* On the JSON wire, a create or update that names no `fields` answers with
|
|
17656
|
+
* `{ id, shortId }` rather than the whole written row.
|
|
17618
17657
|
*/
|
|
17619
17658
|
function mutateRoute(engine, trustedProxies, authEnabled) {
|
|
17620
17659
|
return async (req) => {
|
|
@@ -17629,7 +17668,8 @@ function mutateRoute(engine, trustedProxies, authEnabled) {
|
|
|
17629
17668
|
});
|
|
17630
17669
|
const returnsByKey = {};
|
|
17631
17670
|
const currentNsByKey = {};
|
|
17632
|
-
|
|
17671
|
+
const projectBy = { ...frame };
|
|
17672
|
+
for (const [key, frameEntry] of Object.entries(frame)) {
|
|
17633
17673
|
const parsed = parseQualifiedKey(key);
|
|
17634
17674
|
if (parsed === null) continue;
|
|
17635
17675
|
const { ns, name } = parsed;
|
|
@@ -17638,13 +17678,29 @@ function mutateRoute(engine, trustedProxies, authEnabled) {
|
|
|
17638
17678
|
returnsByKey[key] = entry.returns;
|
|
17639
17679
|
currentNsByKey[key] = ns;
|
|
17640
17680
|
}
|
|
17681
|
+
if (entry !== void 0 && writesRows(entry)) projectBy[key] = Array.isArray(frameEntry) ? frameEntry.map(withAckFields) : withAckFields(frameEntry);
|
|
17641
17682
|
}
|
|
17642
|
-
return serializeEnvelope(req, envelope, engine,
|
|
17683
|
+
return serializeEnvelope(req, envelope, engine, projectBy, {
|
|
17643
17684
|
returnsByKey,
|
|
17644
17685
|
currentNsByKey
|
|
17645
17686
|
});
|
|
17646
17687
|
};
|
|
17647
17688
|
}
|
|
17689
|
+
/** What a row-writing mutation answers when the frame names no `fields`. */
|
|
17690
|
+
const ACK_FIELDS = {
|
|
17691
|
+
id: true,
|
|
17692
|
+
shortId: true
|
|
17693
|
+
};
|
|
17694
|
+
/** A create or update that returns rows of a declared type, not a struct of its own (delete's `{ id, deleted }`). */
|
|
17695
|
+
function writesRows(entry) {
|
|
17696
|
+
return (entry.verb === "create" || entry.verb === "update") && entry.returns !== void 0 && entry.fields !== void 0 && Object.keys(entry.fields).length > 0;
|
|
17697
|
+
}
|
|
17698
|
+
function withAckFields(frameEntry) {
|
|
17699
|
+
return frameEntry.fields === void 0 ? {
|
|
17700
|
+
...frameEntry,
|
|
17701
|
+
fields: ACK_FIELDS
|
|
17702
|
+
} : frameEntry;
|
|
17703
|
+
}
|
|
17648
17704
|
|
|
17649
17705
|
//#endregion
|
|
17650
17706
|
//#region ../../packages/substrate-compose/src/routes/onboard.ts
|
|
@@ -19882,4 +19938,4 @@ function kernelMigrationTracking(sql) {
|
|
|
19882
19938
|
}
|
|
19883
19939
|
|
|
19884
19940
|
//#endregion
|
|
19885
|
-
export { publishSchema as $, METADATA_FILTER_FIELDS as $t, isReservedAutoCrudField as A, isAuthCause as An, encodeCursor as At,
|
|
19941
|
+
export { publishSchema as $, METADATA_FILTER_FIELDS as $t, isReservedAutoCrudField as A, isAuthCause as An, encodeCursor as At, createResolver as B, parseJsonBody as Bt, makeCtx as C, WALKS_IN_MUTATION as Cn, walkAggExprType as Ct, RESERVED_AUTOCRUD_FIELDS as D, WALK_BUDGET_EXCEEDED as Dn, endsWithEscape as Dt, selectAll as E, WALKS_UNSUPPORTED_STORE as En, LIKE_TRAILING_ESCAPE as Et, createResolverWithEdges as F, ROW_METADATA_FIELDS as Fn, HttpBridgeClient as Ft, listResolver as G, WS_REASON_SUBSCRIPTION_OVERLOADED as Gt, updateResolver as H, signHs256 as Ht, installAutoCrud as I, assertNoRepeatedIds as In, JSON_HEADERS as It, resolveIdentity as J, normaliseVocabWhere as Jt, getResolver as K, canonicalVocabValue as Kt, deleteManyResolver as L, canonicalize as Ln, buildContext as Lt, field as M, isResolverFrameError as Mn, fullBuiltinOperators as Mt, AutoCrudNameCollisionError as N, isRestrictViolation as Nn, applyExtensionResultMeta as Nt, RESERVED_AUTOCRUD_FIELD_NAMES as O, WALK_UNSUPPORTED_REF as On, CursorDecodeError as Ot, autoCrudOptionsOf as P, CLIENT_SUPPLIED_SERVER_FIELD as Pn, fieldRequested as Pt, loadPlugins as Q, METADATA_AUTHOR_FIELDS as Qt, updateManyResolver as R, BootstrapConfigError as Rn, error400 as Rt, EngineQueryError as S, VALUE_OUT_OF_RANGE as Sn, metadataExprType as St, queryOne as T, WALKS_NEED_PARTITIONED as Tn, isJsonPathPredicate as Tt, applyUpdatePatch as U, WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME as Ut, deleteResolver as V, parseAuthConfig as Vt, deleteRow as W, WS_REASON_SERVER_RESTART as Wt, resolveEntityRow as X, vocabImplication as Xt, resolveEntityId as Y, storedVocabSpellings as Yt, MemoryEdgesStore as Z, RegistryBase as Zt, AUDIT_EVENT_TYPE as _, ReservedField as _n, getExtensionOperator as _t, composeFromManifests as a, isIsoTimestamp as an, forEachWalkHop as at, assertOrderedBy as b, STORE_BUSY as bn, unregisterExtensionOperator as bt, MemoryDataset as c, validateHardDeleteEnv as cn, preResolveExtensionOperatorsDetailed as ct, uuidFromName as d, FILTER_TOO_BROAD as dn, canRaise as dt, normaliseMetadataOrderBy as en, effectiveFilterOperators as et, emitFieldEvents as f, MissingReferentError as fn, isDateField as ft, buildAuditRow as g, ROW_POLICY_BLOCKS_WALK as gn, refNames as gt, SYSTEM_TYPE_DEFS as h, REGEX_BUDGET_EXCEEDED as hn, isRefOperand as ht, PluginLoadError as i, isImpossibleIsoTimestamp as in, saveSweepState as it, reservedMetadataFieldMessage as j, isBatchElementError as jn, normalizeOrderBy as jt, RESERVED_METADATA_FIELD_NAMES as k, filterTooBroad as kn, decodeCursor as kt, planServesShape as l, BatchElementError as ln, aggParts as lt, runInviteSweep as m, QUERY_TIMEOUT as mn, groupConjuncts as mt, kernelMigrationTracking as n, normaliseWalkNode as nn, loadSweepState as nt, DEFAULT_NAMESPACE as o, normalizeIsoTimestamp as on, sharedPicks as ot, migrateFieldValues as p, NamespaceMismatch as pn, bindingWalks as pt, UnattributedWriteError as q, normaliseVocabValues as qt, mountKernelRoute as r, createKeyedMutex as rn, runSweep as rt, compose as s, assertHardDeleteAllowed as sn, windowGroupBy as st, composeKernelPlugins as t, normaliseMetadataWhere as tn, applyObligations as tt, isStoreProfileName as u, BridgeUnreachableError as un, aggType as ut, INVITE_TYPE as v, ResolverFrameError as vn, listExtensionOperators as vt, queryAll as w, WALKS_IN_SUBSCRIPTION as wn, assertJsonPathPredicate as wt, defineNamespace as x, UnsupportedFilterError as xn, exprTypeOfField as xt, assertIndexDecl as y, RestrictViolation as yn, registerExtensionOperator as yt, purgeResolver as z, defineBootstrap as zn, jsonResponse as zt };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { c as typeTableRef, l as whileNoTypeTable, o as guardedRefRead, r as txScopeIdFor } from "./src-
|
|
3
|
-
import { B as ROW_FILTER_FIELD, V as matchesRowFilter, W as inFlightError, Y as unresolvedRow, Z as cosineSimilarity, et as memberKey } from "./plugin-
|
|
2
|
+
import { c as typeTableRef, l as whileNoTypeTable, o as guardedRefRead, r as txScopeIdFor } from "./src-BcuotITf.js";
|
|
3
|
+
import { B as ROW_FILTER_FIELD, V as matchesRowFilter, W as inFlightError, Y as unresolvedRow, Z as cosineSimilarity, et as memberKey } from "./plugin-DcoJGEMM.js";
|
|
4
4
|
|
|
5
5
|
//#region ../../plugins/substrate-recall/package.json
|
|
6
|
-
var version = "1.0.0-alpha.
|
|
6
|
+
var version = "1.0.0-alpha.18";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region ../../plugins/substrate-recall/src/in-memory-cluster-store.ts
|
package/dist/substrate-admin.js
CHANGED
|
@@ -37,7 +37,7 @@ function isEntrypointPath(moduleUrl, argv1) {
|
|
|
37
37
|
*/
|
|
38
38
|
if (isEntrypointPath(import.meta.url, process.argv[1])) {
|
|
39
39
|
assertNodeVersion();
|
|
40
|
-
import("./run-
|
|
40
|
+
import("./run-Cr-53N3F.js").then(({ runAdminCli }) => runAdminCli());
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
//#endregion
|
package/dist/substrate.js
CHANGED
|
@@ -4,7 +4,7 @@ import { t as assertNodeVersion } from "./node-version-CxqcqECU.js";
|
|
|
4
4
|
|
|
5
5
|
//#region src/bin/substrate.ts
|
|
6
6
|
assertNodeVersion();
|
|
7
|
-
import("./cli-
|
|
7
|
+
import("./cli-zZ7nHhY5.js").then(({ runCli }) => runCli(process.argv.slice(2))).then((code) => process.exit(code));
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
10
10
|
export { };
|
package/dist/testing.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { Ht as signHs256, Q as loadPlugins, Wt as WS_REASON_SERVER_RESTART, Z as MemoryEdgesStore, c as MemoryDataset, s as compose } from "./src-
|
|
2
|
+
import { Ht as signHs256, Q as loadPlugins, Wt as WS_REASON_SERVER_RESTART, Z as MemoryEdgesStore, c as MemoryDataset, s as compose } from "./src-D55T3ZcP.js";
|
|
3
3
|
import "./src-CdbUzLhB.js";
|
|
4
|
-
import { h as deriveListIndexMigration, n as PgDataset, v as runDerivedMigrations, y as runMigrations } from "./src-
|
|
5
|
-
import { t as PgEdgesStore } from "./pg-edges-store-
|
|
4
|
+
import { h as deriveListIndexMigration, n as PgDataset, v as runDerivedMigrations, y as runMigrations } from "./src-BcuotITf.js";
|
|
5
|
+
import { t as PgEdgesStore } from "./pg-edges-store-D7etFxNK.js";
|
|
6
6
|
import { t as FakeEmbedder } from "./fake-DUVtKVSE.js";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
import postgres from "postgres";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mnmal-ai/substrate",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.18",
|
|
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": {
|
|
@@ -36,24 +36,24 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@inquirer/prompts": "^8.7.2",
|
|
39
|
-
"@mnmal-ai/substrate-bootstrap": "1.0.0-alpha.
|
|
40
|
-
"@mnmal-ai/substrate-client": "1.0.0-alpha.
|
|
41
|
-
"@mnmal-ai/substrate-compose": "1.0.0-alpha.
|
|
42
|
-
"@mnmal-ai/substrate-config": "1.0.0-alpha.
|
|
43
|
-
"@mnmal-ai/substrate-core": "1.0.0-alpha.
|
|
44
|
-
"@mnmal-ai/substrate-dataset-memory": "1.0.0-alpha.
|
|
45
|
-
"@mnmal-ai/substrate-dataset-pg": "1.0.0-alpha.
|
|
46
|
-
"@mnmal-ai/substrate-embedder": "1.0.0-alpha.
|
|
47
|
-
"@mnmal-ai/substrate-filter": "1.0.0-alpha.
|
|
48
|
-
"@mnmal-ai/substrate-pack": "1.0.0-alpha.
|
|
49
|
-
"@mnmal-ai/substrate-policy": "1.0.0-alpha.
|
|
50
|
-
"@mnmal-ai/substrate-proposals": "1.0.0-alpha.
|
|
51
|
-
"@mnmal-ai/substrate-recall": "1.0.0-alpha.
|
|
52
|
-
"@mnmal-ai/substrate-sdk": "1.0.0-alpha.
|
|
53
|
-
"@mnmal-ai/substrate-sentinel-client": "1.0.0-alpha.
|
|
54
|
-
"@mnmal-ai/substrate-server-fastify": "1.0.0-alpha.
|
|
55
|
-
"@mnmal-ai/substrate-server-memory": "1.0.0-alpha.
|
|
56
|
-
"@mnmal-ai/substrate-types": "1.0.0-alpha.
|
|
39
|
+
"@mnmal-ai/substrate-bootstrap": "1.0.0-alpha.18",
|
|
40
|
+
"@mnmal-ai/substrate-client": "1.0.0-alpha.18",
|
|
41
|
+
"@mnmal-ai/substrate-compose": "1.0.0-alpha.18",
|
|
42
|
+
"@mnmal-ai/substrate-config": "1.0.0-alpha.18",
|
|
43
|
+
"@mnmal-ai/substrate-core": "1.0.0-alpha.18",
|
|
44
|
+
"@mnmal-ai/substrate-dataset-memory": "1.0.0-alpha.18",
|
|
45
|
+
"@mnmal-ai/substrate-dataset-pg": "1.0.0-alpha.18",
|
|
46
|
+
"@mnmal-ai/substrate-embedder": "1.0.0-alpha.18",
|
|
47
|
+
"@mnmal-ai/substrate-filter": "1.0.0-alpha.18",
|
|
48
|
+
"@mnmal-ai/substrate-pack": "1.0.0-alpha.18",
|
|
49
|
+
"@mnmal-ai/substrate-policy": "1.0.0-alpha.18",
|
|
50
|
+
"@mnmal-ai/substrate-proposals": "1.0.0-alpha.18",
|
|
51
|
+
"@mnmal-ai/substrate-recall": "1.0.0-alpha.18",
|
|
52
|
+
"@mnmal-ai/substrate-sdk": "1.0.0-alpha.18",
|
|
53
|
+
"@mnmal-ai/substrate-sentinel-client": "1.0.0-alpha.18",
|
|
54
|
+
"@mnmal-ai/substrate-server-fastify": "1.0.0-alpha.18",
|
|
55
|
+
"@mnmal-ai/substrate-server-memory": "1.0.0-alpha.18",
|
|
56
|
+
"@mnmal-ai/substrate-types": "1.0.0-alpha.18",
|
|
57
57
|
"@mnmal-ai/surface-core": "0.17.1",
|
|
58
58
|
"@types/node": "^26.6.4",
|
|
59
59
|
"@types/semver": "^7.5.0",
|