@mnmal-ai/substrate 1.0.0-alpha.1 → 1.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -6
- package/dist/boot-store-C5vNZJ3i.js +4065 -0
- package/dist/{runtime-metrics-DwpDJ8vz.d.ts → bridge-COu0Tg_h.d.ts} +2 -87
- package/dist/cli-BrwW4tjO.js +3144 -0
- package/dist/client.d.ts +129 -8
- package/dist/client.js +6 -5
- package/dist/{agent-token-BIboWOU0.js → env-utils-CGNazUNt.js} +31 -2
- package/dist/{errors-D4vKuwz8.d.ts → errors-BOllGhVx.d.ts} +15 -2
- package/dist/{index-D7mSOFlM.d.ts → index-Cp74OcmS.d.ts} +1 -1
- package/dist/node-version-C5FSmwJX.js +26 -0
- package/dist/pack.d.ts +2 -2
- package/dist/pack.js +1 -1
- package/dist/pg-edges-store-BLsbcXkk.js +381 -0
- package/dist/{plugin-BuQQEzL-.js → plugin-DIYm2cZE.js} +171 -18
- package/dist/proposals-bootstrap.js +6 -4
- package/dist/proposals.config.schema.json +5 -0
- package/dist/proposals.d.ts +14 -4
- package/dist/proposals.default-config.json +2 -1
- package/dist/proposals.js +2 -2
- package/dist/recall-bootstrap.js +13 -4
- package/dist/recall.config.schema.json +12 -0
- package/dist/recall.d.ts +53 -9
- package/dist/recall.js +2 -2
- package/dist/{repl-C52wyfMs.js → repl-B8gy0YM7.js} +63 -30
- package/dist/{row-ByLFE2Wx.d.ts → row-DwaDU4b-.d.ts} +58 -9
- package/dist/run-B18qtGKc.js +2012 -0
- package/dist/{plugin-t2g2wX0b.d.ts → schema-CijHRfuk.d.ts} +957 -16
- package/dist/script-C6DSa_Na.js +134 -0
- package/dist/sdk.d.ts +104 -16
- package/dist/sdk.js +5 -110
- package/dist/{src-DuopV8u7.js → src-Br6aDUti.js} +153 -20
- package/dist/{src-5hVbeiAu.js → src-D041j6GS.js} +697 -57
- package/dist/{src-YXlv_RyL.js → src-DK7VEQT6.js} +4099 -1040
- package/dist/{src-C4DzaIQZ.js → src-Dbvuel6w.js} +392 -282
- package/dist/{row-DK7lPZVe.js → src-DpPdw2oL.js} +11 -11
- package/dist/{src-zcyUofMJ.js → src-DptNGNYQ.js} +39 -15
- package/dist/src-gz4I1F29.js +5097 -0
- package/dist/substrate-admin.js +17 -781
- package/dist/substrate.js +4 -5476
- package/dist/testing.d.ts +582 -9
- package/dist/testing.js +39 -3
- package/dist/{ws-C72iVS5T.d.ts → ws-DC8OhMaV.d.ts} +2 -3
- package/package.json +22 -20
- package/dist/dataset-DOXGRz50.js +0 -1535
- package/dist/env-utils-B7SGmoeJ.js +0 -21
- package/dist/schema-g4FQLr0V.d.ts +0 -433
- package/dist/src-CjEwiKXw.js +0 -2327
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 { n as defaultPluginsForPersona, r as parsePort, t as KNOWN_PLUGINS } from "./
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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,9 +1451,10 @@ var ScreenManager = class {
|
|
|
1451
1451
|
};
|
|
1452
1452
|
|
|
1453
1453
|
//#endregion
|
|
1454
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.
|
|
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
|
+
const nativeClearImmediate = globalThis.clearImmediate;
|
|
1457
1458
|
/**
|
|
1458
1459
|
* Register an event listener and return its disposer, so registrations collapse
|
|
1459
1460
|
* into a single statement: `cleanups.add(listenTo(rl, 'close', handler))`.
|
|
@@ -1556,8 +1557,10 @@ function createPrompt(view) {
|
|
|
1556
1557
|
}
|
|
1557
1558
|
});
|
|
1558
1559
|
};
|
|
1559
|
-
if ("readableFlowing" in input)
|
|
1560
|
-
|
|
1560
|
+
if ("readableFlowing" in input) {
|
|
1561
|
+
const immediate = nativeSetImmediate(startCycle);
|
|
1562
|
+
cleanups.add(() => nativeClearImmediate(immediate));
|
|
1563
|
+
} else startCycle();
|
|
1561
1564
|
return promptPromise;
|
|
1562
1565
|
});
|
|
1563
1566
|
};
|
|
@@ -1565,7 +1568,7 @@ function createPrompt(view) {
|
|
|
1565
1568
|
}
|
|
1566
1569
|
|
|
1567
1570
|
//#endregion
|
|
1568
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.
|
|
1571
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.5_@types+node@26.6.6/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
1569
1572
|
/**
|
|
1570
1573
|
* Separator object
|
|
1571
1574
|
* Used to space/separate choices group
|
|
@@ -1582,7 +1585,7 @@ var Separator = class {
|
|
|
1582
1585
|
};
|
|
1583
1586
|
|
|
1584
1587
|
//#endregion
|
|
1585
|
-
//#region ../../node_modules/.pnpm/@inquirer+checkbox@5.2.
|
|
1588
|
+
//#region ../../node_modules/.pnpm/@inquirer+checkbox@5.2.7_@types+node@26.6.6/node_modules/@inquirer/checkbox/dist/index.js
|
|
1586
1589
|
const checkboxTheme = {
|
|
1587
1590
|
icon: {
|
|
1588
1591
|
checked: styleText("green", figures.circleFilled),
|
|
@@ -1676,9 +1679,12 @@ var dist_default$3 = createPrompt((config, done) => {
|
|
|
1676
1679
|
const [active, setActive] = useState(bounds.first);
|
|
1677
1680
|
const [errorMsg, setError] = useState();
|
|
1678
1681
|
useKeypress(async (key) => {
|
|
1682
|
+
if (status !== "idle") return;
|
|
1679
1683
|
if (isEnterKey(key)) {
|
|
1684
|
+
setStatus("loading");
|
|
1680
1685
|
const selection = items.filter(isChecked);
|
|
1681
1686
|
const isValid = await validate([...selection]);
|
|
1687
|
+
setStatus("idle");
|
|
1682
1688
|
if (required && !selection.length) setError("At least one choice must be selected");
|
|
1683
1689
|
else if (isValid === true) {
|
|
1684
1690
|
setStatus("done");
|
|
@@ -1767,7 +1773,7 @@ var dist_default$3 = createPrompt((config, done) => {
|
|
|
1767
1773
|
});
|
|
1768
1774
|
|
|
1769
1775
|
//#endregion
|
|
1770
|
-
//#region ../../node_modules/.pnpm/@inquirer+confirm@6.3.
|
|
1776
|
+
//#region ../../node_modules/.pnpm/@inquirer+confirm@6.3.4_@types+node@26.6.6/node_modules/@inquirer/confirm/dist/index.js
|
|
1771
1777
|
const confirmTheme = {
|
|
1772
1778
|
keywords: {
|
|
1773
1779
|
yes: "Yes",
|
|
@@ -1841,7 +1847,7 @@ var dist_default$2 = createPrompt((config, done) => {
|
|
|
1841
1847
|
});
|
|
1842
1848
|
|
|
1843
1849
|
//#endregion
|
|
1844
|
-
//#region ../../node_modules/.pnpm/@inquirer+input@5.1.
|
|
1850
|
+
//#region ../../node_modules/.pnpm/@inquirer+input@5.1.8_@types+node@26.6.6/node_modules/@inquirer/input/dist/index.js
|
|
1845
1851
|
const inputTheme = { validationFailureMode: "keep" };
|
|
1846
1852
|
var dist_default$1 = createPrompt((config, done) => {
|
|
1847
1853
|
const { prefill = "tab" } = config;
|
|
@@ -1911,7 +1917,7 @@ var dist_default$1 = createPrompt((config, done) => {
|
|
|
1911
1917
|
});
|
|
1912
1918
|
|
|
1913
1919
|
//#endregion
|
|
1914
|
-
//#region ../../node_modules/.pnpm/@inquirer+select@5.2.
|
|
1920
|
+
//#region ../../node_modules/.pnpm/@inquirer+select@5.2.7_@types+node@26.6.6/node_modules/@inquirer/select/dist/index.js
|
|
1915
1921
|
const selectTheme = {
|
|
1916
1922
|
icon: { cursor: figures.pointer },
|
|
1917
1923
|
style: {
|
|
@@ -2146,18 +2152,18 @@ async function runRepl(seed) {
|
|
|
2146
2152
|
}));
|
|
2147
2153
|
const embedder = seed.embedder ?? await dist_default({
|
|
2148
2154
|
message: "Semantic recall embedder:",
|
|
2149
|
-
default: "
|
|
2155
|
+
default: "bge-base",
|
|
2150
2156
|
choices: [
|
|
2151
2157
|
{
|
|
2152
|
-
name: "
|
|
2153
|
-
value: "
|
|
2158
|
+
name: "bge-base — bge-base-en-v1.5, in-process (recommended)",
|
|
2159
|
+
value: "bge-base"
|
|
2154
2160
|
},
|
|
2155
2161
|
{
|
|
2156
|
-
name: "
|
|
2157
|
-
value: "
|
|
2162
|
+
name: "minilm — all-MiniLM-L6-v2, in-process, smaller and faster",
|
|
2163
|
+
value: "minilm"
|
|
2158
2164
|
},
|
|
2159
2165
|
{
|
|
2160
|
-
name: "ollama — bge-
|
|
2166
|
+
name: "ollama — bge-base-en-v1.5 via local Ollama",
|
|
2161
2167
|
value: "ollama"
|
|
2162
2168
|
},
|
|
2163
2169
|
{
|
|
@@ -2166,6 +2172,28 @@ async function runRepl(seed) {
|
|
|
2166
2172
|
}
|
|
2167
2173
|
]
|
|
2168
2174
|
});
|
|
2175
|
+
const ask = async (message, fallback, flag) => Number(await dist_default$1({
|
|
2176
|
+
message,
|
|
2177
|
+
default: String(fallback),
|
|
2178
|
+
validate: (v) => {
|
|
2179
|
+
try {
|
|
2180
|
+
parsePositive(flag, v);
|
|
2181
|
+
return true;
|
|
2182
|
+
} catch (err) {
|
|
2183
|
+
return err.message;
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
}));
|
|
2187
|
+
let { rowsPerDay, retentionDays, readTargetMs, writeHeavy } = seed;
|
|
2188
|
+
if (seed.profile === void 0 && process.stdin.isTTY === true) {
|
|
2189
|
+
rowsPerDay ??= await ask("Expected rows written per day:", DEFAULT_SIZING.rowsPerDay, "rows-per-day");
|
|
2190
|
+
retentionDays ??= await ask("Days of data to keep:", DEFAULT_SIZING.retentionDays, "retention-days");
|
|
2191
|
+
readTargetMs ??= await ask("Read latency target (ms):", DEFAULT_SIZING.readTargetMs, "read-target-ms");
|
|
2192
|
+
writeHeavy = writeHeavy || await dist_default$2({
|
|
2193
|
+
message: "Is write throughput a priority?",
|
|
2194
|
+
default: false
|
|
2195
|
+
});
|
|
2196
|
+
}
|
|
2169
2197
|
const tls = seed.tls || await dist_default$2({
|
|
2170
2198
|
message: "Terminate TLS in the binary (HTTPS)?",
|
|
2171
2199
|
default: false
|
|
@@ -2204,6 +2232,11 @@ async function runRepl(seed) {
|
|
|
2204
2232
|
tls,
|
|
2205
2233
|
tlsCertPath,
|
|
2206
2234
|
tlsKeyPath,
|
|
2235
|
+
rowsPerDay,
|
|
2236
|
+
retentionDays,
|
|
2237
|
+
readTargetMs,
|
|
2238
|
+
writeHeavy,
|
|
2239
|
+
profile: seed.profile,
|
|
2207
2240
|
yes: true,
|
|
2208
2241
|
force
|
|
2209
2242
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { J as AutoCrudVerb, Q as PolicyDecision, Z as Policy, et as RequestContext } from "./plugin-t2g2wX0b.js";
|
|
1
|
+
import { At as DeriveSpec, Cn as Row, Qt as WhereClause, _t as RequestContext, dt as AutoCrudVerb, ht as PolicyDecision, l as FieldInput, mt as Policy, n as Dropped, p as PlanClause } from "./schema-CijHRfuk.js";
|
|
2
|
+
import { n as BridgeCredential } from "./bridge-COu0Tg_h.js";
|
|
4
3
|
//#region ../../packages/substrate-types/src/nl.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The engine-dispatchable frame a successful NL translation produces. Keys
|
|
@@ -74,17 +73,39 @@ interface NlJudgeStep {
|
|
|
74
73
|
choice?: NlJudgeChoice;
|
|
75
74
|
/** Why the reply was not applied. */
|
|
76
75
|
rejected?: string;
|
|
76
|
+
/** Keys of an applied reply outside the offered options (a walk, a comparison), ignored. */
|
|
77
|
+
ignored?: string[];
|
|
77
78
|
}
|
|
78
|
-
/** What an ask answered. The
|
|
79
|
+
/** What an ask answered. The five kinds are exhaustive. */
|
|
79
80
|
type NlOutcome = {
|
|
80
81
|
kind: 'rows';
|
|
81
82
|
frame: Query;
|
|
82
83
|
answer: string;
|
|
83
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Absent on the wire when the engine rejected the frame; `errors` then says why.
|
|
86
|
+
* On a `count` answer it is the engine's `{ count }`, or the first page of rows
|
|
87
|
+
* when the server could not count and the rows were paged instead.
|
|
88
|
+
*/
|
|
84
89
|
data: unknown;
|
|
90
|
+
/** On a `count` answer: every row the frame matches. Absent when counting stopped short, with `errors` saying why. */
|
|
91
|
+
count?: number;
|
|
85
92
|
errors?: unknown[];
|
|
86
93
|
source: 'parser' | 'judge' | 'handoff';
|
|
87
94
|
handoff?: string;
|
|
95
|
+
/** Parts of the question this answer does not reflect. Empty when nothing was lost. */
|
|
96
|
+
dropped: Dropped[];
|
|
97
|
+
/** The plan the frame ran, clause by clause, with the engine's served flags where it gave them. */
|
|
98
|
+
plan: PlanClause[];
|
|
99
|
+
} | {
|
|
100
|
+
/**
|
|
101
|
+
* The question cannot be answered without fabricating: something that
|
|
102
|
+
* changes which rows count was dropped from a count, aggregate, `$ref`
|
|
103
|
+
* or pick reading. Nothing ran; `dropped` says what, `plan` what was understood.
|
|
104
|
+
*/
|
|
105
|
+
kind: 'unknown';
|
|
106
|
+
question: string;
|
|
107
|
+
dropped: Dropped[];
|
|
108
|
+
plan: PlanClause[];
|
|
88
109
|
} | {
|
|
89
110
|
kind: 'recall';
|
|
90
111
|
query: string;
|
|
@@ -114,7 +135,7 @@ interface NlParsedData {
|
|
|
114
135
|
type NlJudgedStatus = 'resolved' | 'recall' | 'clarify' | 'refuse' | 'escalated';
|
|
115
136
|
/**
|
|
116
137
|
* One SSE event, discriminated by the SSE event name. The terminal answer is
|
|
117
|
-
* named by its outcome kind (`rows` | `recall` | `clarify` | `refuse`) and
|
|
138
|
+
* named by its outcome kind (`rows` | `recall` | `clarify` | `refuse` | `unknown`) and
|
|
118
139
|
* carries the whole outcome; `done` always follows. An in-band `error` event
|
|
119
140
|
* is not in this union: the client throws on it.
|
|
120
141
|
*/
|
|
@@ -152,6 +173,11 @@ type NlWireEvent = {
|
|
|
152
173
|
data: Extract<NlOutcome, {
|
|
153
174
|
kind: 'refuse';
|
|
154
175
|
}>;
|
|
176
|
+
} | {
|
|
177
|
+
event: 'unknown';
|
|
178
|
+
data: Extract<NlOutcome, {
|
|
179
|
+
kind: 'unknown';
|
|
180
|
+
}>;
|
|
155
181
|
} | {
|
|
156
182
|
event: 'done';
|
|
157
183
|
data: Record<string, never>;
|
|
@@ -185,8 +211,11 @@ interface NlPackField {
|
|
|
185
211
|
/** `metadata` marks a server-managed virtual (createdAt, createdById, ...). */
|
|
186
212
|
kind: 'scalar' | 'crossRef' | 'list' | 'struct' | 'metadata';
|
|
187
213
|
valueType?: string;
|
|
188
|
-
/** crossRef target
|
|
189
|
-
target?:
|
|
214
|
+
/** crossRef target. */
|
|
215
|
+
target?: {
|
|
216
|
+
namespace: string;
|
|
217
|
+
type: string;
|
|
218
|
+
};
|
|
190
219
|
indexed: boolean;
|
|
191
220
|
operators: string[];
|
|
192
221
|
phrases: string[];
|
|
@@ -224,7 +253,21 @@ interface NlValueAlias {
|
|
|
224
253
|
startsWith?: string;
|
|
225
254
|
contains?: string;
|
|
226
255
|
}
|
|
256
|
+
/** One `fieldPhrases` ruling: what a phrase binds to. Field refs are `'<Type>.<field>'` in the ruling's namespace. */
|
|
257
|
+
interface NlFieldPhrase {
|
|
258
|
+
field?: string;
|
|
259
|
+
/** Needs `field`: an equality binding ("valued PSA 9" -> Cert.grade = 9). */
|
|
260
|
+
value?: unknown;
|
|
261
|
+
/** Needs `field`: the implicit filter on that field's type. Never silent: it shows in `plan`. */
|
|
262
|
+
exclude?: WhereClause;
|
|
263
|
+
/** Operands are `'<Type>.<field>'`, both on one type. */
|
|
264
|
+
derive?: DeriveSpec;
|
|
265
|
+
/** A namespace default pick for this phrase. */
|
|
266
|
+
pick?: 'latest' | 'max' | 'min';
|
|
267
|
+
}
|
|
227
268
|
interface NlNamespaceRulings {
|
|
269
|
+
/** Phrases bound to fields, values, implicit filters, derived orderings and pick defaults. Keys are normalised (trimmed, single-spaced, lower-cased). */
|
|
270
|
+
fieldPhrases?: Record<string, NlFieldPhrase>;
|
|
228
271
|
/** Types never scoped to the asking project (their `project` means "belongs to", not "applies to"). */
|
|
229
272
|
unscopedTypes?: string[];
|
|
230
273
|
/** Extra phrases naming a type, e.g. `backlog` -> Task. Win over the generated phrases. */
|
|
@@ -248,6 +291,12 @@ interface NlNamespaceRulings {
|
|
|
248
291
|
typeNotes?: Record<string, string>;
|
|
249
292
|
/** A phrase that means a predicate, e.g. `accepted` -> Decision.status in [active, accepted]. */
|
|
250
293
|
valueAliases?: Record<string, NlValueAlias[]>;
|
|
294
|
+
/**
|
|
295
|
+
* Rows of a type that never count unless asked for, e.g. `Run` -> `{ status: { in: ['skipped'] } }`.
|
|
296
|
+
* Applied as `NOT <clause>` whenever NL reads the type, as the seed or through a walk,
|
|
297
|
+
* and shown in `plan` as `ruling:<Type> default exclude`.
|
|
298
|
+
*/
|
|
299
|
+
typeExcludes?: Record<string, WhereClause>;
|
|
251
300
|
}
|
|
252
301
|
/** The body of `GET /substrate/v1/nl/pack/:ns`. */
|
|
253
302
|
interface NlServedPack extends NlNamespacePack {
|
|
@@ -716,4 +765,4 @@ declare function row<T>(predicate: (ctx: RequestContext, row: T) => boolean): Po
|
|
|
716
765
|
*/
|
|
717
766
|
declare function applyRowFilters<T>(decision: PolicyDecision, rows: T[], ctx: RequestContext): T[];
|
|
718
767
|
//#endregion
|
|
719
|
-
export {
|
|
768
|
+
export { NlJudgeChoice as $, and as A, SYSTEM_NAMESPACE as B, flattenGrant as C, parseGrantEntries as D, intersectGrants as E, TokenProviderOpts as F, resolveAdminCredential as G, isActiveAdminKeyRow as H, adminClaimCapabilities as I, NlAskRequest as J, resolveDefaultKeyPath as K, isEncryptedKey as L, or as M, ADMIN_CAPABILITIES as N, decodeList as O, DEFAULT_CAPABILITIES as P, NlJudgeAction as Q, makeAuthorizationProvider as R, expandFlat as S, grantIsUniform as T, AdminCredential as U, describeGrant as V, AdminEnv as W, NlEvidence as X, NlAskResult as Y, NlFieldPhrase as Z, newlyGrantedPairs as _, Query as _t, denyAll as a, NlPackField as at, capabilitiesFor as b, requireIdentity as c, NlParseStatus as ct, KeyUpdateRefusal as d, NlTrailEvent as dt, NlJudgeStep as et, checkRevocable as f, NlValueAlias as ft, newlyGranted as g, NLVocabularyHint as gt, grantEntriesConfer as h, NLResult as ht, allowVerbs as i, NlOutcome as it, not as j, encodeList as k, requireNamespace as l, NlParsedData as lt, grantCovers as m, NLBase as mt, row as n, NlNamespacePack as nt, denyVerbs as o, NlPackType as ot, checkUpdatable as p, NlWireEvent as pt, resolveDefaultKidPath as q, allowAll as r, NlNamespaceRulings as rt, requireCapability as s, NlPackValueRef as st, applyRowFilters as t, NlJudgedStatus as tt, KeyMutationRefusal as u, NlServedPack as ut, revokedAtIso as v, grantEntryError as w, encodeGrant as x, Grant as y, makeTokenProvider as z };
|