@mnmal-ai/substrate 1.0.0-alpha.10 → 1.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{boot-store-BVqfFxh1.js → boot-store-C5vNZJ3i.js} +13 -8
- package/dist/{bridge-Cp4PaIYO.d.ts → bridge-COu0Tg_h.d.ts} +1 -1
- package/dist/{cli-hSCBywhE.js → cli-BrwW4tjO.js} +41 -23
- package/dist/client.d.ts +3 -4
- package/dist/client.js +3 -3
- package/dist/{errors-7mycvNGq.d.ts → errors-BOllGhVx.d.ts} +15 -2
- package/dist/{index-DgSfwx7M.d.ts → index-Cp74OcmS.d.ts} +1 -1
- package/dist/pack.d.ts +2 -2
- package/dist/pack.js +1 -1
- package/dist/{pg-edges-store-Lxsl5ZnK.js → pg-edges-store-BLsbcXkk.js} +1 -1
- package/dist/{plugin-CtwOINCM.js → plugin-DIYm2cZE.js} +2 -2
- package/dist/proposals-bootstrap.js +2 -2
- package/dist/proposals.d.ts +2 -3
- package/dist/proposals.js +1 -1
- package/dist/recall-bootstrap.js +2 -2
- package/dist/recall.d.ts +1 -2
- package/dist/recall.js +2 -2
- package/dist/{repl-DqfHelK7.js → repl-B8gy0YM7.js} +22 -22
- package/dist/{row-BKKCXIG6.d.ts → row-DwaDU4b-.d.ts} +57 -10
- package/dist/{run-B5dTbZ3g.js → run-B18qtGKc.js} +23 -8
- package/dist/{dataset-CejF-Fr_.d.ts → schema-CijHRfuk.d.ts} +2225 -1604
- package/dist/sdk.d.ts +21 -11
- package/dist/sdk.js +4 -4
- package/dist/{src-7CUSMK66.js → src-Br6aDUti.js} +7 -3
- package/dist/{src-CqT-QWZ_.js → src-D041j6GS.js} +3 -3
- package/dist/{src-5SJ5GEIM.js → src-DK7VEQT6.js} +2572 -742
- package/dist/{src-hZb8wfvg.js → src-Dbvuel6w.js} +383 -284
- package/dist/{src-Da0t6si5.js → src-DpPdw2oL.js} +1 -1
- package/dist/{src-Bi849yhn.js → src-DptNGNYQ.js} +3 -3
- package/dist/{src-CyvV7dCK.js → src-gz4I1F29.js} +1027 -263
- package/dist/substrate-admin.js +1 -1
- package/dist/substrate.js +1 -1
- package/dist/testing.d.ts +28 -4
- package/dist/testing.js +4 -4
- package/dist/{ws-ByZyHk7m.d.ts → ws-DC8OhMaV.d.ts} +2 -3
- package/package.json +20 -19
- package/dist/schema-DoSc-4ig.d.ts +0 -470
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { D as isReservedAutoCrudField, W as MemoryEdgesStore, a as composeFromManifests, c as MemoryDataset,
|
|
2
|
+
import { D as isReservedAutoCrudField, St as parseAuthConfig, Tt as WS_REASON_SERVER_RESTART, W as MemoryEdgesStore, a as composeFromManifests, c as MemoryDataset, ct as registerExtensionOperator, gt as HttpBridgeClient, h as AUDIT_EVENT_TYPE, i as PluginLoadError, lt as unregisterExtensionOperator, m as buildAuditRow, n as kernelMigrationTracking, o as DEFAULT_NAMESPACE, ot as getExtensionOperator, q as effectiveFilterOperators, r as mountKernelRoute, s as compose, st as listExtensionOperators, t as composeKernelPlugins, u as isStoreProfileName, vt as buildContext } from "./src-DK7VEQT6.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
|
-
import { D as isActiveAdminKeyRow, E as describeGrant, L as encodeList, M as grantEntryError, T as SYSTEM_NAMESPACE, v as grantEntriesConfer } from "./src-
|
|
5
|
-
import "./src-
|
|
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-
|
|
7
|
-
import { f as pendingMigrations, g as detectLayout, l as deriveListIndexMigration, m as runMigrations, p as runDerivedMigrations, s as assertNotMigrating, t as PgDataset } 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-
|
|
4
|
+
import { D as isActiveAdminKeyRow, E as describeGrant, L as encodeList, M as grantEntryError, T as SYSTEM_NAMESPACE, v as grantEntriesConfer } from "./src-DpPdw2oL.js";
|
|
5
|
+
import "./src-Dbvuel6w.js";
|
|
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-Br6aDUti.js";
|
|
7
|
+
import { f as pendingMigrations, g as detectLayout, l as deriveListIndexMigration, m as runMigrations, p as runDerivedMigrations, s as assertNotMigrating, t as PgDataset } from "./src-gz4I1F29.js";
|
|
8
|
+
import { t as PgEdgesStore } from "./pg-edges-store-BLsbcXkk.js";
|
|
9
|
+
import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore } from "./src-DptNGNYQ.js";
|
|
10
10
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { homedir } from "node:os";
|
|
12
12
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1750,7 +1750,7 @@ async function closeQuietly(sql) {
|
|
|
1750
1750
|
|
|
1751
1751
|
//#endregion
|
|
1752
1752
|
//#region package.json
|
|
1753
|
-
var version = "1.0.0-alpha.
|
|
1753
|
+
var version = "1.0.0-alpha.11";
|
|
1754
1754
|
|
|
1755
1755
|
//#endregion
|
|
1756
1756
|
//#region src/plugin-manifest.ts
|
|
@@ -3978,6 +3978,11 @@ async function bootStore(opts) {
|
|
|
3978
3978
|
...config.cors !== null ? { cors: config.cors } : {},
|
|
3979
3979
|
...config.bodyLimit !== null ? { bodyLimit: config.bodyLimit } : {}
|
|
3980
3980
|
});
|
|
3981
|
+
server.onError((err, req) => {
|
|
3982
|
+
if ((err.statusCode ?? 500) < 500) return;
|
|
3983
|
+
const where = req !== void 0 ? `${req.method} ${req.path}` : "background";
|
|
3984
|
+
process.stderr.write(`[substrate] internal error on ${where}: ${err.stack ?? err.message}\n`);
|
|
3985
|
+
});
|
|
3981
3986
|
const { composeOpts, idempotencyStore, sentinelClientConfig, bridgeRegistry, disposeBridges } = await buildComposeOpts({
|
|
3982
3987
|
config,
|
|
3983
3988
|
server,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cn as Row, f as PackEnvelope, fn as EdgeRef, m as Schema } from "./schema-CijHRfuk.js";
|
|
2
2
|
//#region ../../packages/substrate-types/src/bridge.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Per-frame bucket sent to a bridge. Same shape as `QualifiedFrame` in the
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
2
|
+
import { Ut as validateHardDeleteEnv, X as runSweep, Y as loadSweepState, Z as saveSweepState, g as INVITE_TYPE, h as AUDIT_EVENT_TYPE, m as buildAuditRow, p as runInviteSweep, u as isStoreProfileName } from "./src-DK7VEQT6.js";
|
|
3
3
|
import { n as trimTrailingSlashes, s as makeAuthorizationProvider } from "./env-utils-CGNazUNt.js";
|
|
4
|
-
import { L as encodeList, T as SYSTEM_NAMESPACE, f as coversNamespace, m as grantedIn, p as grantOf } from "./src-
|
|
5
|
-
import "./src-
|
|
6
|
-
import { a as parseBridgeCreds, d as reportUnguardedIndexBuilds, f as runDeferredIndexBuilds, g as openPgDataset, h as version, i as MS_PER_DAY, n as resolvePluginDir, o as parseBridges, p as startSentinelClient, q as AdminCliError, s as parseEnv, t as bootStore, u as redactStoreSpec } from "./boot-store-
|
|
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-
|
|
4
|
+
import { L as encodeList, T as SYSTEM_NAMESPACE, f as coversNamespace, m as grantedIn, p as grantOf } from "./src-DpPdw2oL.js";
|
|
5
|
+
import "./src-Dbvuel6w.js";
|
|
6
|
+
import { a as parseBridgeCreds, d as reportUnguardedIndexBuilds, f as runDeferredIndexBuilds, g as openPgDataset, h as version, i as MS_PER_DAY, n as resolvePluginDir, o as parseBridges, p as startSentinelClient, q as AdminCliError, s as parseEnv, t as bootStore, u as redactStoreSpec } from "./boot-store-C5vNZJ3i.js";
|
|
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-Br6aDUti.js";
|
|
8
8
|
import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-C6DSa_Na.js";
|
|
9
|
-
import { _ as tryWithPgAdvisoryLock } from "./src-
|
|
10
|
-
import { n as PgLexicalStore, r as PgEmbeddingsStore } from "./src-
|
|
9
|
+
import { _ as tryWithPgAdvisoryLock } from "./src-gz4I1F29.js";
|
|
10
|
+
import { n as PgLexicalStore, r as PgEmbeddingsStore } from "./src-DptNGNYQ.js";
|
|
11
11
|
import { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
12
12
|
import { homedir, hostname } from "node:os";
|
|
13
13
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -17,6 +17,18 @@ 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
19
|
|
|
20
|
+
//#region ../../node_modules/.pnpm/@mnmal-ai+surface-core@0.15.0_ink@8.0.0_@types+react@19.3.0_react@19.3.1__react@19.3.1/node_modules/@mnmal-ai/surface-core/dist/overlay-DMjCbsaC.js
|
|
21
|
+
const SEGMENTER = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
22
|
+
const OSC = /(?:\u001b\]|\u009d)[^\u0007\u001b\u009c]*(?:\u0007|\u009c|\u001b\\)?/g;
|
|
23
|
+
const CSI = /(?:\u001b\[|\u009b)[0-?]*[ -/]*[@-~]?/g;
|
|
24
|
+
const ESC_PAIR = /\u001b[ -~]?/g;
|
|
25
|
+
const CONTROL = /[\u0000-\u0008\u000b-\u001f\u007f-\u009f]/g;
|
|
26
|
+
/** Strips ESC sequences and C0/C1 control characters; keeps `\n`, and a tab becomes a space. */
|
|
27
|
+
function sanitise(text) {
|
|
28
|
+
return text.replace(/\t/g, " ").replace(OSC, "").replace(CSI, "").replace(ESC_PAIR, "").replace(CONTROL, "");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
20
32
|
//#region src/cli/ask/main.ts
|
|
21
33
|
const USAGE$1 = "usage: substrate ask [--ns <namespace>] [--project <name>] [--json] <question…>\n";
|
|
22
34
|
async function runAsk(argv, options = {}) {
|
|
@@ -64,7 +76,7 @@ async function runAsk(argv, options = {}) {
|
|
|
64
76
|
...options.fetchImpl !== void 0 ? { fetch: options.fetchImpl } : {}
|
|
65
77
|
}));
|
|
66
78
|
} catch (err) {
|
|
67
|
-
write(`substrate ask: agent identity: ${messageOf$1(err)}\n`);
|
|
79
|
+
write(`substrate ask: agent identity: ${sanitise(messageOf$1(err))}\n`);
|
|
68
80
|
return 2;
|
|
69
81
|
}
|
|
70
82
|
let result;
|
|
@@ -76,15 +88,15 @@ async function runAsk(argv, options = {}) {
|
|
|
76
88
|
});
|
|
77
89
|
} catch (err) {
|
|
78
90
|
if (err instanceof NetworkError && err.status === 404 && err.code !== "nl_unknown_namespace") write("substrate ask: the server has no NL route (is @mnmal-ai/substrate-nl installed?)\n");
|
|
79
|
-
else if (err instanceof NetworkError && err.serverMessage !== void 0) write(`substrate ask: ${err.serverMessage}\n`);
|
|
80
|
-
else write(`substrate ask: ${messageOf$1(err)}\n`);
|
|
91
|
+
else if (err instanceof NetworkError && err.serverMessage !== void 0) write(`substrate ask: ${sanitise(err.serverMessage)}\n`);
|
|
92
|
+
else write(`substrate ask: ${sanitise(messageOf$1(err))}\n`);
|
|
81
93
|
return 1;
|
|
82
94
|
}
|
|
83
95
|
const outcome = result.outcome;
|
|
84
|
-
if (json) write(`${JSON.stringify(result, null, 2)}\n`);
|
|
85
|
-
else write(render(outcome));
|
|
96
|
+
if (json) write(`${JSON.stringify(result, null, 2).replace(/[\u0080-\u009f]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`)}\n`);
|
|
97
|
+
else write(render(outcome).split("\n").map(sanitise).join("\n"));
|
|
86
98
|
if (outcome === null) return 0;
|
|
87
|
-
if (outcome.kind === "refuse") return 1;
|
|
99
|
+
if (outcome.kind === "refuse" || outcome.kind === "unknown") return 1;
|
|
88
100
|
if (outcome.kind === "rows" && Array.isArray(outcome.errors) && outcome.errors.length > 0) return 1;
|
|
89
101
|
return 0;
|
|
90
102
|
}
|
|
@@ -97,11 +109,11 @@ function render(o) {
|
|
|
97
109
|
case "rows": {
|
|
98
110
|
const key = Object.keys(o.frame)[0] ?? "?";
|
|
99
111
|
const rows = Array.isArray(o.data) ? o.data : void 0;
|
|
100
|
-
const tail = rows === void 0 ? "rejected" : `${rows.length} rows`;
|
|
112
|
+
const tail = o.count !== void 0 ? `count ${o.count}` : rows === void 0 ? "rejected" : `${rows.length} rows`;
|
|
101
113
|
const head = `▸ ${key} · ${o.source}${o.handoff !== void 0 ? ` (${o.handoff})` : ""} · ${tail}\n`;
|
|
102
114
|
const errs = (o.errors ?? []).map((e) => ` ✗ ${JSON.stringify(e)}\n`).join("");
|
|
103
115
|
const body = (rows ?? []).map((r) => ` ${String(r.shortId ?? r.id ?? "")} ${String(r.title ?? r.synopsis ?? r.name ?? "")}\n`).join("");
|
|
104
|
-
return head + errs + body;
|
|
116
|
+
return head + errs + droppedText(o.dropped) + body;
|
|
105
117
|
}
|
|
106
118
|
case "recall": {
|
|
107
119
|
const errs = (o.errors ?? []).map((e) => ` ✗ ${JSON.stringify(e)}\n`).join("");
|
|
@@ -114,8 +126,15 @@ function render(o) {
|
|
|
114
126
|
return `? ${o.reason}\n${opts.map((x, i) => ` ${i + 1}. ${x.label}\n`).join("")}`;
|
|
115
127
|
}
|
|
116
128
|
case "refuse": return `✗ ${o.reason}\n`;
|
|
129
|
+
case "unknown": return `? unknown: not answered, because part of the question was dropped\n${droppedText(o.dropped)}${planText(o.plan)}`;
|
|
117
130
|
}
|
|
118
131
|
}
|
|
132
|
+
function droppedText(dropped) {
|
|
133
|
+
return (dropped ?? []).map((d) => ` dropped "${d.span}": ${d.reason}\n`).join("");
|
|
134
|
+
}
|
|
135
|
+
function planText(plan) {
|
|
136
|
+
return (plan ?? []).map((c) => ` plan ${c.path.join(".")} (${c.kind})\n`).join("");
|
|
137
|
+
}
|
|
119
138
|
|
|
120
139
|
//#endregion
|
|
121
140
|
//#region src/cli/backfill-field/main.ts
|
|
@@ -2138,7 +2157,7 @@ async function runInit(argv) {
|
|
|
2138
2157
|
return 1;
|
|
2139
2158
|
}
|
|
2140
2159
|
if (!config.yes) try {
|
|
2141
|
-
const { runRepl } = await import("./repl-
|
|
2160
|
+
const { runRepl } = await import("./repl-B8gy0YM7.js");
|
|
2142
2161
|
config = await runRepl(config);
|
|
2143
2162
|
} catch (err) {
|
|
2144
2163
|
if (err.message?.includes("User force closed")) return 130;
|
|
@@ -2467,7 +2486,7 @@ function schemaOverview(federated) {
|
|
|
2467
2486
|
for (const [ns, schema] of Object.entries(federated)) {
|
|
2468
2487
|
const typeDefs = schema.types ?? {};
|
|
2469
2488
|
const types = {};
|
|
2470
|
-
for (const [name, def] of Object.entries(typeDefs)) types[safe(name, NAME)] = Object.entries(def.fields ?? {}).map(([field, shape]) => `${safe(field, NAME)}: ${fieldType(shape, ns)}`).join(", ");
|
|
2489
|
+
for (const [name, def] of Object.entries(typeDefs)) types[safe(name, NAME)] = [...Object.entries(def.fields ?? {}).map(([field, shape]) => `${safe(field, NAME)}: ${fieldType(shape, ns)}`), ...(def.inboundRefs ?? []).map((r) => `←${safe(r.type, NAME)}.${safe(r.field, NAME)}`)].join(", ");
|
|
2471
2490
|
const mutations = Object.keys(schema.mutations ?? {}).filter((m) => {
|
|
2472
2491
|
const crud = AUTO_CRUD.exec(m);
|
|
2473
2492
|
return !(crud?.[2] !== void 0 && crud[2] in typeDefs);
|
|
@@ -2479,8 +2498,7 @@ function schemaOverview(federated) {
|
|
|
2479
2498
|
}
|
|
2480
2499
|
return out;
|
|
2481
2500
|
}
|
|
2482
|
-
|
|
2483
|
-
const OVERVIEW_LEGEND = "Each type is `field: type` pairs. `a|b` is an enum, `?` nullable, `T[]` a list, `→Type` a reference (`→ns/Type` across namespaces). No field needs an index to filter; json filters by path only, and only non-json scalars sort. [readonly] fields are server-set. Generated get/create/update/delete<Type> mutations are not listed; `mutations` holds the rest. For a type's exact write contract call `schema` with `namespace` and `type`.";
|
|
2501
|
+
const overviewLegend = "Each type is `field: type` pairs. `a|b` is an enum, `?` nullable, `T[]` a list, `→Type` a reference (`→ns/Type` across namespaces). No field needs an index to filter; json filters by path only, and only non-json scalars sort. [readonly] fields are server-set. Generated get/create/update/delete<Type> mutations are not listed; `mutations` holds the rest. For a type's exact write contract call `schema` with `namespace` and `type`. `←Type.field` is a reference TO this type; follow it backwards with `_walk: { in: \"ns/Type.field\" }` in `where`, as a nested `fields` entry, or in `_agg`.";
|
|
2484
2502
|
/** Past this, the instructions carry only type names; the full overview is one `schema` call away. */
|
|
2485
2503
|
const INSTRUCTIONS_OVERVIEW_MAX = 12e3;
|
|
2486
2504
|
const CONVENTIONS = [
|
|
@@ -2497,7 +2515,7 @@ const CONVENTIONS = [
|
|
|
2497
2515
|
function buildInstructions(overview) {
|
|
2498
2516
|
if (overview === null) return `${CONVENTIONS}\n\nThe type list was unavailable at session start; call \`schema\` with no arguments for it.`;
|
|
2499
2517
|
const full = JSON.stringify(overview);
|
|
2500
|
-
const body = full.length <= INSTRUCTIONS_OVERVIEW_MAX ? `${
|
|
2518
|
+
const body = full.length <= INSTRUCTIONS_OVERVIEW_MAX ? `${overviewLegend}\n${full}` : `Type names only (the full overview is large; call \`schema\` with no arguments for fields):\n${JSON.stringify(Object.fromEntries(Object.entries(overview).map(([ns, o]) => [ns, Object.keys(o.types)])))}`;
|
|
2501
2519
|
return `${CONVENTIONS}\n\nTypes on this server at session start:\n${body}`;
|
|
2502
2520
|
}
|
|
2503
2521
|
|
|
@@ -2659,7 +2677,7 @@ function createSchemaHandler(endpoint) {
|
|
|
2659
2677
|
if ((ns === void 0 || ns === "") && args?.full !== true) try {
|
|
2660
2678
|
const federated = await getSubstrate(endpoint, "/substrate/v1/federated-schema");
|
|
2661
2679
|
return okResult({
|
|
2662
|
-
legend:
|
|
2680
|
+
legend: overviewLegend,
|
|
2663
2681
|
overview: schemaOverview(federated)
|
|
2664
2682
|
});
|
|
2665
2683
|
} catch (err) {
|
|
@@ -2805,7 +2823,7 @@ function createMcpServer(endpoint, options = {}) {
|
|
|
2805
2823
|
{
|
|
2806
2824
|
name: "query",
|
|
2807
2825
|
config: {
|
|
2808
|
-
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\": {...} }.",
|
|
2826
|
+
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\": {...} }. 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\" } }` with optional `bucket: { field, by: \"day\"|\"hour\" }` answers groups; `derive: { m: { diff|ratio: [\"_agg.x\", \"$.f\"] } }` is ordered by `orderBy: [{ \"$m\": \"desc\" }]`. Walks are query-only: subscribe, stream and mutate refuse them, as does a store without walks (walks_unsupported_store).",
|
|
2809
2827
|
inputSchema: { payload: payloadSchema("Query frame. Example: { \"default/Todo\": { \"params\": { \"limit\": 20 }, \"fields\": { \"id\": true, \"title\": true } } }") }
|
|
2810
2828
|
},
|
|
2811
2829
|
handler: createQueryHandler(endpoint)
|
|
@@ -2821,7 +2839,7 @@ function createMcpServer(endpoint, options = {}) {
|
|
|
2821
2839
|
{
|
|
2822
2840
|
name: "ask",
|
|
2823
2841
|
config: {
|
|
2824
|
-
description: "Ask a natural-language question of one namespace. The parser answers first; a constrained judge handles what it escalates; a judge outage hands off honestly. Returns { outcome, trail }, where outcome.kind is rows | recall | clarify | refuse. Read-only. Requires the @mnmal-ai/substrate-nl plugin (404 otherwise).",
|
|
2842
|
+
description: "Ask a natural-language question of one namespace. The parser answers first; a constrained judge handles what it escalates; a judge outage hands off honestly. Returns { outcome, trail }, where outcome.kind is rows | recall | clarify | refuse | unknown. unknown means part of the question was dropped and the answer would change which rows count; it carries dropped and the plan, and nothing ran. rows also carries dropped (what it does not reflect) and plan. Read-only. Requires the @mnmal-ai/substrate-nl plugin (404 otherwise).",
|
|
2825
2843
|
inputSchema: {
|
|
2826
2844
|
namespace: z.string().min(1).describe("Namespace to ask, e.g. \"notes\"."),
|
|
2827
2845
|
question: z.string().min(1).describe("The question, e.g. \"open todos in billing\"."),
|
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
3
|
-
import {
|
|
4
|
-
import { s as SchemaDriftError } from "./index-DgSfwx7M.js";
|
|
1
|
+
import { B as QualifiedFrame, Cn as Row, an as RuntimeErrors, f as PackEnvelope, in as RuntimeErrorEntry, m as Schema, on as RuntimeMetrics, rn as ResolverStat, sn as SlowRequest, tn as ProcessStat } from "./schema-CijHRfuk.js";
|
|
2
|
+
import { A as and, B as SYSTEM_NAMESPACE, C as flattenGrant, D as parseGrantEntries, E as intersectGrants, F as TokenProviderOpts, G as resolveAdminCredential, H as isActiveAdminKeyRow, I as adminClaimCapabilities, J as NlAskRequest, K as resolveDefaultKeyPath, L as isEncryptedKey, M as or, N as ADMIN_CAPABILITIES, O as decodeList, P as DEFAULT_CAPABILITIES, R as makeAuthorizationProvider, S as expandFlat, T as grantIsUniform, U as AdminCredential, V as describeGrant, W as AdminEnv, Y as NlAskResult, _ as newlyGrantedPairs, a as denyAll, b as capabilitiesFor, c as requireIdentity, d as KeyUpdateRefusal, dt as NlTrailEvent, f as checkRevocable, g as newlyGranted, h as grantEntriesConfer, i as allowVerbs, it as NlOutcome, j as not, k as encodeList, l as requireNamespace, m as grantCovers, n as row, o as denyVerbs, p as checkUpdatable, pt as NlWireEvent, q as resolveDefaultKidPath, r as allowAll, s as requireCapability, t as applyRowFilters, u as KeyMutationRefusal, ut as NlServedPack, v as revokedAtIso, w as grantEntryError, x as encodeGrant, y as Grant, z as makeTokenProvider } from "./row-DwaDU4b-.js";
|
|
3
|
+
import { s as SchemaDriftError } from "./index-Cp74OcmS.js";
|
|
5
4
|
import { Signal } from "@preact/signals-core";
|
|
6
5
|
//#region ../../packages/substrate-client/src/admin/surgery.d.ts
|
|
7
6
|
type AdminDropCascade = 'refuse' | 'delete';
|
package/dist/client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
2
|
import { a as adminClaimCapabilities, c as makeTokenProvider, d as resolveDefaultKidPath, i as DEFAULT_CAPABILITIES, l as resolveAdminCredential, o as isEncryptedKey, r as ADMIN_CAPABILITIES, s as makeAuthorizationProvider, u as resolveDefaultKeyPath } from "./env-utils-CGNazUNt.js";
|
|
3
|
-
import { A as expandFlat, C as not, D as isActiveAdminKeyRow, E as describeGrant, F as parseGrantEntries, I as decodeList, L as encodeList, M as grantEntryError, N as grantIsUniform, O as capabilitiesFor, P as intersectGrants, S as and, T as SYSTEM_NAMESPACE, _ as grantCovers, a as denyAll, b as newlyGrantedPairs, c as requireIdentity, g as checkUpdatable, h as checkRevocable, i as allowVerbs, j as flattenGrant, k as encodeGrant, l as requireNamespace, n as row, o as denyVerbs, r as allowAll, s as requireCapability, t as applyRowFilters, v as grantEntriesConfer, w as or, x as revokedAtIso, y as newlyGranted } from "./src-
|
|
4
|
-
import {
|
|
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-
|
|
3
|
+
import { A as expandFlat, C as not, D as isActiveAdminKeyRow, E as describeGrant, F as parseGrantEntries, I as decodeList, L as encodeList, M as grantEntryError, N as grantIsUniform, O as capabilitiesFor, P as intersectGrants, S as and, T as SYSTEM_NAMESPACE, _ as grantCovers, a as denyAll, b as newlyGrantedPairs, c as requireIdentity, g as checkUpdatable, h as checkRevocable, i as allowVerbs, j as flattenGrant, k as encodeGrant, l as requireNamespace, n as row, o as denyVerbs, r as allowAll, s as requireCapability, t as applyRowFilters, v as grantEntriesConfer, w as or, x as revokedAtIso, y as newlyGranted } from "./src-DpPdw2oL.js";
|
|
4
|
+
import { f as SchemaDriftError } from "./src-Dbvuel6w.js";
|
|
5
|
+
import { C as diagnose, S as DIAGNOSE_CHECKS, _ as SKIPPABLE_STEPS, a as SubstrateClient, b as planOnboarding, c as reduceSubscribeRows, d as NetworkError, f as SubscribeError, g as ONBOARD_STEPS, h as CURRENT_MARK, i as tokenAudience, l as watchRows, m as BACKFILL_CHUNK, n as resolveAgentCapabilities, o as collectDiagnostics, p as AdminBackfillError, r as noRedirectFetch, s as createDefaultDiagnosticsSink, t as createClientFromEnv, u as AuthError, v as STEP_MARKS, w as reconcileIdentities, x as requiredOutstanding, y as currentStep } from "./src-Br6aDUti.js";
|
|
6
6
|
import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-C6DSa_Na.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,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fn as EdgeRef, un as Edge } from "./schema-CijHRfuk.js";
|
|
2
2
|
//#region ../../packages/substrate-types/src/errors.d.ts
|
|
3
|
+
/** Refusal codes for the typed-edge-walk grammar. */
|
|
4
|
+
declare const WALKS_NEED_PARTITIONED = "walks_need_partitioned";
|
|
5
|
+
declare const WALKS_IN_SUBSCRIPTION = "walks_in_subscription";
|
|
6
|
+
declare const WALKS_IN_MUTATION = "walks_in_mutation";
|
|
7
|
+
declare const ROW_POLICY_BLOCKS_WALK = "row_policy_blocks_walk";
|
|
8
|
+
declare const WALK_BUDGET_EXCEEDED = "walk_budget_exceeded";
|
|
9
|
+
declare const WALKS_UNSUPPORTED_STORE = "walks_unsupported_store";
|
|
10
|
+
/**
|
|
11
|
+
* A walk construct refused where it cannot be answered: inside a struct, over
|
|
12
|
+
* a list or struct-nested crossRef, under a reused field name, on a virtual
|
|
13
|
+
* type, or on a read path that does not evaluate walks.
|
|
14
|
+
*/
|
|
15
|
+
declare const WALK_UNSUPPORTED_REF = "walk_unsupported_ref";
|
|
3
16
|
/**
|
|
4
17
|
* Throwable by a resolver to surface a structured per-frame error with a
|
|
5
18
|
* caller-chosen `code` instead of the generic `resolver_error`. The engine's
|
|
@@ -127,4 +140,4 @@ declare function isResolverFrameError(err: unknown): err is ResolverFrameError;
|
|
|
127
140
|
*/
|
|
128
141
|
declare function isRestrictViolation(err: unknown): err is RestrictViolation;
|
|
129
142
|
//#endregion
|
|
130
|
-
export {
|
|
143
|
+
export { isRestrictViolation as _, ReservedField as a, UnsupportedFilterError as c, WALKS_NEED_PARTITIONED as d, WALKS_UNSUPPORTED_STORE as f, isResolverFrameError as g, isAuthCause as h, ROW_POLICY_BLOCKS_WALK as i, WALKS_IN_MUTATION as l, WALK_UNSUPPORTED_REF as m, MissingReferentError as n, ResolverFrameError as o, WALK_BUDGET_EXCEEDED as p, NamespaceMismatch as r, RestrictViolation as s, BridgeUnreachableError as t, WALKS_IN_SUBSCRIPTION as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as PackEnvelope, i as FieldDef, l as FieldInput, m as Schema } from "./schema-CijHRfuk.js";
|
|
2
2
|
import { pack as packFrame, unpack as unpackFrame } from "msgpackr";
|
|
3
3
|
//#region ../../packages/substrate-pack/src/decoder.d.ts
|
|
4
4
|
interface DecodeContext {
|
package/dist/pack.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as DecodeEnvelopeCtx, c as decodeEnvelope, i as DecodeContext, l as decodePositional, n as packFrame, o as PackDecodeError, r as unpackFrame, s as SchemaDriftError, t as WS_SUBPROTOCOL_SUBSTRATE_PACK, u as decodePositionalFromFieldDef } from "./index-
|
|
1
|
+
import { f as PackEnvelope, i as FieldDef, l as FieldInput, m as Schema } from "./schema-CijHRfuk.js";
|
|
2
|
+
import { a as DecodeEnvelopeCtx, c as decodeEnvelope, i as DecodeContext, l as decodePositional, n as packFrame, o as PackDecodeError, r as unpackFrame, s as SchemaDriftError, t as WS_SUBPROTOCOL_SUBSTRATE_PACK, u as decodePositionalFromFieldDef } from "./index-Cp74OcmS.js";
|
|
3
3
|
//#region ../../packages/substrate-pack/src/content-type.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Content-type negotiation. Spec: §7.0.
|
package/dist/pack.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { _ as
|
|
2
|
+
import { _ as encodeEnvelope, a as buildDecodePlan, c as isPlainRequestData, d as PackDecodeError, f as SchemaDriftError, g as PackEncodeError, h as decodePositionalFromFieldDef, i as applyDecodePlanInPlace, l as decodeStreamChunk, m as decodePositional, n as packFrame, o as decodeWsEnvelope, p as decodeEnvelope, r as unpackFrame, s as encodeWsFrame, t as WS_SUBPROTOCOL_SUBSTRATE_PACK, u as encodeStreamChunk, v as encodePositional, y as encodePositionalFromFieldDef } from "./src-Dbvuel6w.js";
|
|
3
3
|
import { n as acceptsPack, t as PACK_MIME } from "./content-type-C7T28xNb.js";
|
|
4
4
|
|
|
5
5
|
export { PACK_MIME, PackDecodeError, PackEncodeError, SchemaDriftError, WS_SUBPROTOCOL_SUBSTRATE_PACK, acceptsPack, applyDecodePlanInPlace, buildDecodePlan, decodeEnvelope, decodePositional, decodePositionalFromFieldDef, decodeStreamChunk, decodeWsEnvelope, encodeEnvelope, encodePositional, encodePositionalFromFieldDef, encodeStreamChunk, encodeWsFrame, isPlainRequestData, packFrame, unpackFrame };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { n as txScopeIdFor } from "./src-
|
|
2
|
+
import { n as txScopeIdFor } from "./src-gz4I1F29.js";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
|
|
5
5
|
//#region ../../packages/substrate-dataset-pg/src/pg-edges-store.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { J as applyObligations,
|
|
3
|
-
import "./src-
|
|
2
|
+
import { J as applyObligations, Yt as ResolverFrameError, bt as jsonResponse, vt as buildContext } from "./src-DK7VEQT6.js";
|
|
3
|
+
import "./src-Dbvuel6w.js";
|
|
4
4
|
import { Worker } from "node:worker_threads";
|
|
5
5
|
|
|
6
6
|
//#region ../../plugins/substrate-recall/src/candidate-selection.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
import { n as createNoopPubSub, t as createProposalsPlugin } from "./src-
|
|
2
|
+
import { fn as defineBootstrap } from "./src-DK7VEQT6.js";
|
|
3
|
+
import { n as createNoopPubSub, t as createProposalsPlugin } from "./src-D041j6GS.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region ../../plugins/substrate-proposals/src/bootstrap.ts
|
package/dist/proposals.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as ResolverFrameError } from "./errors-7mycvNGq.js";
|
|
1
|
+
import { Dt as Dataset, _ as CoordinatorPlugin, hn as OnDelete } from "./schema-CijHRfuk.js";
|
|
2
|
+
import { o as ResolverFrameError } from "./errors-BOllGhVx.js";
|
|
4
3
|
//#region ../../plugins/substrate-proposals/src/config.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Multi-instance invalidation transport used by the plugin to broadcast
|
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-D041j6GS.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 {
|
|
2
|
+
import { fn as defineBootstrap } from "./src-DK7VEQT6.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-DIYm2cZE.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region ../../packages/substrate-embedder/src/types.ts
|
package/dist/recall.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dt as PolicyDecision, F as FilterOperatorDef, H as KernelPlugin, Ot as PolicyProbeContext, W as McpToolRegistration, Z as PostWriteHook, j as EmbedSourceContext, jt as ResolverArgs, kt as RequestContext, lt as HttpHandler, n as Dataset, wt as Identity, z as KernelMigration } from "./dataset-CejF-Fr_.js";
|
|
1
|
+
import { A as KernelPlugin, C as FilterOperatorDef, Cn as Row, D as KernelMigration, Dt as Dataset, M as McpToolRegistration, Z as HttpHandler, _t as RequestContext, ft as Identity, gt as PolicyProbeContext, ht as PolicyDecision, i as FieldDef, mn as EdgesStore, y as EmbedSourceContext, yt as ResolverArgs, z as PostWriteHook } from "./schema-CijHRfuk.js";
|
|
3
2
|
import { t as Embedder } from "./types-8c0gtnd2.js";
|
|
4
3
|
import postgres, { Sql } from "postgres";
|
|
5
4
|
//#region ../../plugins/substrate-recall/src/candidate-selection.d.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-DptNGNYQ.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-DIYm2cZE.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-BrwW4tjO.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
37
37
|
|
|
38
38
|
//#endregion
|
|
39
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
39
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/key.js
|
|
40
40
|
const keybindingLookup = /* @__PURE__ */ new Set(["emacs", "vim"]);
|
|
41
41
|
function isKeybinding(value) {
|
|
42
42
|
return keybindingLookup.has(value);
|
|
@@ -55,7 +55,7 @@ const isNumberKey = (key) => "1234567890".includes(key.name);
|
|
|
55
55
|
const isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
56
56
|
|
|
57
57
|
//#endregion
|
|
58
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
58
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/errors.js
|
|
59
59
|
var AbortPromptError = class extends Error {
|
|
60
60
|
name = "AbortPromptError";
|
|
61
61
|
message = "Prompt was aborted";
|
|
@@ -79,7 +79,7 @@ var ValidationError = class extends Error {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
//#endregion
|
|
82
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
82
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
83
83
|
const hookStorage = new AsyncLocalStorage();
|
|
84
84
|
function createStore(rl) {
|
|
85
85
|
return {
|
|
@@ -174,7 +174,7 @@ const effectScheduler = {
|
|
|
174
174
|
};
|
|
175
175
|
|
|
176
176
|
//#endregion
|
|
177
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
177
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
178
178
|
function isFactory(value) {
|
|
179
179
|
return typeof value === "function";
|
|
180
180
|
}
|
|
@@ -199,7 +199,7 @@ function useState(defaultValue) {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
//#endregion
|
|
202
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
202
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
203
203
|
function useEffect(cb, depArray) {
|
|
204
204
|
withPointer((pointer) => {
|
|
205
205
|
const oldDeps = pointer.get();
|
|
@@ -495,7 +495,7 @@ const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
495
495
|
const replacements = Object.entries(specialMainSymbols);
|
|
496
496
|
|
|
497
497
|
//#endregion
|
|
498
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
498
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/theme.js
|
|
499
499
|
const defaultTheme = {
|
|
500
500
|
prefix: {
|
|
501
501
|
idle: styleText("blue", "?"),
|
|
@@ -535,7 +535,7 @@ function getDefaultTheme() {
|
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
//#endregion
|
|
538
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
538
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
539
539
|
function isPlainObject(value) {
|
|
540
540
|
if (typeof value !== "object" || value === null) return false;
|
|
541
541
|
let proto = value;
|
|
@@ -555,7 +555,7 @@ function makeTheme(...themes) {
|
|
|
555
555
|
}
|
|
556
556
|
|
|
557
557
|
//#endregion
|
|
558
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
558
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
559
559
|
function usePrefix({ status = "idle", theme }) {
|
|
560
560
|
const [showLoader, setShowLoader] = useState(false);
|
|
561
561
|
const [tick, setTick] = useState(0);
|
|
@@ -582,7 +582,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
//#endregion
|
|
585
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
585
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
586
586
|
function useMemo(fn, dependencies) {
|
|
587
587
|
return withPointer((pointer) => {
|
|
588
588
|
const prev = pointer.get();
|
|
@@ -599,13 +599,13 @@ function useMemo(fn, dependencies) {
|
|
|
599
599
|
}
|
|
600
600
|
|
|
601
601
|
//#endregion
|
|
602
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
602
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
603
603
|
function useRef(val) {
|
|
604
604
|
return useState({ current: val })[0];
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
//#endregion
|
|
608
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
608
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
609
609
|
function useKeypress(userHandler) {
|
|
610
610
|
const signal = useRef(userHandler);
|
|
611
611
|
signal.current = userHandler;
|
|
@@ -939,7 +939,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
939
939
|
}
|
|
940
940
|
|
|
941
941
|
//#endregion
|
|
942
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
942
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/utils.js
|
|
943
943
|
var import_cli_width = /* @__PURE__ */ __toESM(require_cli_width(), 1);
|
|
944
944
|
/**
|
|
945
945
|
* Force line returns at specific width. This function is ANSI code friendly and it'll
|
|
@@ -966,7 +966,7 @@ function readlineWidth() {
|
|
|
966
966
|
}
|
|
967
967
|
|
|
968
968
|
//#endregion
|
|
969
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
969
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
970
970
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
971
971
|
const state = useRef({
|
|
972
972
|
lastPointer: active,
|
|
@@ -1052,7 +1052,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
1054
|
//#endregion
|
|
1055
|
-
//#region ../../node_modules/.pnpm/@inquirer+type@4.2.0_@types+node@26.6.
|
|
1055
|
+
//#region ../../node_modules/.pnpm/@inquirer+type@4.2.0_@types+node@26.6.6/node_modules/@inquirer/type/dist/utils.js
|
|
1056
1056
|
/**
|
|
1057
1057
|
* Create a promise and get access to its `resolve` and `reject` functions.
|
|
1058
1058
|
*
|
|
@@ -1393,7 +1393,7 @@ const eraseLine = "\x1B[2K";
|
|
|
1393
1393
|
const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + "\x1B[2K\x1B[G" : "";
|
|
1394
1394
|
|
|
1395
1395
|
//#endregion
|
|
1396
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
1396
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
1397
1397
|
const height = (content) => content.split("\n").length;
|
|
1398
1398
|
const lastLine = (content) => content.split("\n").pop() ?? "";
|
|
1399
1399
|
var ScreenManager = class {
|
|
@@ -1451,7 +1451,7 @@ var ScreenManager = class {
|
|
|
1451
1451
|
};
|
|
1452
1452
|
|
|
1453
1453
|
//#endregion
|
|
1454
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
1454
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
1455
1455
|
var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
|
|
1456
1456
|
const nativeSetImmediate = globalThis.setImmediate;
|
|
1457
1457
|
const nativeClearImmediate = globalThis.clearImmediate;
|
|
@@ -1568,7 +1568,7 @@ function createPrompt(view) {
|
|
|
1568
1568
|
}
|
|
1569
1569
|
|
|
1570
1570
|
//#endregion
|
|
1571
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.
|
|
1571
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
1572
1572
|
/**
|
|
1573
1573
|
* Separator object
|
|
1574
1574
|
* Used to space/separate choices group
|
|
@@ -1585,7 +1585,7 @@ var Separator = class {
|
|
|
1585
1585
|
};
|
|
1586
1586
|
|
|
1587
1587
|
//#endregion
|
|
1588
|
-
//#region ../../node_modules/.pnpm/@inquirer+checkbox@5.2.7_@types+node@26.6.
|
|
1588
|
+
//#region ../../node_modules/.pnpm/@inquirer+checkbox@5.2.7_@types+node@26.6.6/node_modules/@inquirer/checkbox/dist/index.js
|
|
1589
1589
|
const checkboxTheme = {
|
|
1590
1590
|
icon: {
|
|
1591
1591
|
checked: styleText("green", figures.circleFilled),
|
|
@@ -1773,7 +1773,7 @@ var dist_default$3 = createPrompt((config, done) => {
|
|
|
1773
1773
|
});
|
|
1774
1774
|
|
|
1775
1775
|
//#endregion
|
|
1776
|
-
//#region ../../node_modules/.pnpm/@inquirer+confirm@6.3.4_@types+node@26.6.
|
|
1776
|
+
//#region ../../node_modules/.pnpm/@inquirer+confirm@6.3.4_@types+node@26.6.6/node_modules/@inquirer/confirm/dist/index.js
|
|
1777
1777
|
const confirmTheme = {
|
|
1778
1778
|
keywords: {
|
|
1779
1779
|
yes: "Yes",
|
|
@@ -1847,7 +1847,7 @@ var dist_default$2 = createPrompt((config, done) => {
|
|
|
1847
1847
|
});
|
|
1848
1848
|
|
|
1849
1849
|
//#endregion
|
|
1850
|
-
//#region ../../node_modules/.pnpm/@inquirer+input@5.1.8_@types+node@26.6.
|
|
1850
|
+
//#region ../../node_modules/.pnpm/@inquirer+input@5.1.8_@types+node@26.6.6/node_modules/@inquirer/input/dist/index.js
|
|
1851
1851
|
const inputTheme = { validationFailureMode: "keep" };
|
|
1852
1852
|
var dist_default$1 = createPrompt((config, done) => {
|
|
1853
1853
|
const { prefill = "tab" } = config;
|
|
@@ -1917,7 +1917,7 @@ var dist_default$1 = createPrompt((config, done) => {
|
|
|
1917
1917
|
});
|
|
1918
1918
|
|
|
1919
1919
|
//#endregion
|
|
1920
|
-
//#region ../../node_modules/.pnpm/@inquirer+select@5.2.7_@types+node@26.6.
|
|
1920
|
+
//#region ../../node_modules/.pnpm/@inquirer+select@5.2.7_@types+node@26.6.6/node_modules/@inquirer/select/dist/index.js
|
|
1921
1921
|
const selectTheme = {
|
|
1922
1922
|
icon: { cursor: figures.pointer },
|
|
1923
1923
|
style: {
|