@mnmal-ai/substrate 1.0.0-alpha.10 → 1.0.0-alpha.12
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 +4 -2
- package/dist/{boot-store-BVqfFxh1.js → boot-store-DHv9H1Gr.js} +170 -69
- package/dist/{bridge-Cp4PaIYO.d.ts → bridge-DQyQ6Qhn.d.ts} +1 -1
- package/dist/{cli-hSCBywhE.js → cli-_UNdneXr.js} +44 -24
- package/dist/client.d.ts +3 -4
- package/dist/client.js +3 -3
- package/dist/{errors-7mycvNGq.d.ts → errors-xP9Mo7Q1.d.ts} +38 -4
- package/dist/{index-DgSfwx7M.d.ts → index-baF5A5jU.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-B4FSN9yp.js} +72 -9
- package/dist/{plugin-CtwOINCM.js → plugin-BLm5IRdX.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 +10 -11
- package/dist/recall.js +2 -2
- package/dist/{repl-DqfHelK7.js → repl-DUJGBwie.js} +25 -25
- package/dist/{row-BKKCXIG6.d.ts → row-Cu_iRhcR.d.ts} +57 -10
- package/dist/{run-B5dTbZ3g.js → run-BpsTNvdI.js} +539 -145
- package/dist/{dataset-CejF-Fr_.d.ts → schema-oXfQyo0s.d.ts} +2455 -1589
- package/dist/sdk.d.ts +108 -34
- package/dist/sdk.js +4 -4
- package/dist/{src-CqT-QWZ_.js → src-Bew_JvTo.js} +32 -16
- package/dist/{src-Da0t6si5.js → src-Bi3NhEsT.js} +1 -1
- package/dist/{src-5SJ5GEIM.js → src-C4t1Gy-m.js} +4844 -1367
- package/dist/{src-7CUSMK66.js → src-CHND7-Pm.js} +7 -3
- package/dist/src-CSe2tJDf.js +6940 -0
- package/dist/{src-Bi849yhn.js → src-CzhKLsOV.js} +175 -91
- package/dist/{src-hZb8wfvg.js → src-DWqzrm3O.js} +400 -284
- package/dist/substrate-admin.js +1 -1
- package/dist/substrate.js +1 -1
- package/dist/testing.d.ts +255 -90
- package/dist/testing.js +6 -23
- package/dist/{ws-ByZyHk7m.d.ts → ws-Dx3A2B4U.d.ts} +2 -3
- package/package.json +20 -20
- package/dist/schema-DoSc-4ig.d.ts +0 -470
- package/dist/src-CyvV7dCK.js +0 -4333
|
@@ -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-_UNdneXr.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.6_@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.6_@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.6_@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.6_@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.6_@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();
|
|
@@ -209,7 +209,7 @@ function useEffect(cb, depArray) {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
//#endregion
|
|
212
|
-
//#region ../../node_modules/.pnpm/@inquirer+figures@2.0.
|
|
212
|
+
//#region ../../node_modules/.pnpm/@inquirer+figures@2.0.10/node_modules/@inquirer/figures/dist/index.js
|
|
213
213
|
function isUnicodeSupported() {
|
|
214
214
|
if (!process$1.platform.startsWith("win")) return process$1.env["TERM"] !== "linux";
|
|
215
215
|
return Boolean(process$1.env["CI"]) || Boolean(process$1.env["WT_SESSION"]) || Boolean(process$1.env["TERMINUS_SUBLIME"]) || process$1.env["ConEmuTask"] === "{cmd::Cmder}" || process$1.env["TERM_PROGRAM"] === "Terminus-Sublime" || process$1.env["TERM_PROGRAM"] === "vscode" || process$1.env["TERM"] === "xterm-256color" || process$1.env["TERM"] === "alacritty" || process$1.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
@@ -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.6_@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.6_@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.6_@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.6_@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.6_@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.6_@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.6_@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.6_@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.
|
|
1055
|
+
//#region ../../node_modules/.pnpm/@inquirer+type@4.2.1_@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
|
*
|
|
@@ -1373,7 +1373,7 @@ const process$2 = globalThis.process;
|
|
|
1373
1373
|
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
1374
1374
|
|
|
1375
1375
|
//#endregion
|
|
1376
|
-
//#region ../../node_modules/.pnpm/@inquirer+ansi@2.0.
|
|
1376
|
+
//#region ../../node_modules/.pnpm/@inquirer+ansi@2.0.10/node_modules/@inquirer/ansi/dist/index.js
|
|
1377
1377
|
const ESC = "\x1B[";
|
|
1378
1378
|
/** Hide the cursor */
|
|
1379
1379
|
const cursorHide = "\x1B[?25l";
|
|
@@ -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.6_@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.
|
|
1454
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.6_@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;
|
|
@@ -1557,7 +1557,7 @@ function createPrompt(view) {
|
|
|
1557
1557
|
}
|
|
1558
1558
|
});
|
|
1559
1559
|
};
|
|
1560
|
-
if ("readableFlowing" in input) {
|
|
1560
|
+
if ("readableFlowing" in input && input.isTTY) {
|
|
1561
1561
|
const immediate = nativeSetImmediate(startCycle);
|
|
1562
1562
|
cleanups.add(() => nativeClearImmediate(immediate));
|
|
1563
1563
|
} else startCycle();
|
|
@@ -1568,7 +1568,7 @@ function createPrompt(view) {
|
|
|
1568
1568
|
}
|
|
1569
1569
|
|
|
1570
1570
|
//#endregion
|
|
1571
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.
|
|
1571
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.6_@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.
|
|
1588
|
+
//#region ../../node_modules/.pnpm/@inquirer+checkbox@5.2.8_@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.
|
|
1776
|
+
//#region ../../node_modules/.pnpm/@inquirer+confirm@6.3.5_@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.
|
|
1850
|
+
//#region ../../node_modules/.pnpm/@inquirer+input@5.1.9_@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.
|
|
1920
|
+
//#region ../../node_modules/.pnpm/@inquirer+select@5.2.8_@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: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as BridgeCredential } from "./bridge-
|
|
3
|
-
import { Ct as AutoCrudVerb, Dt as PolicyDecision, Et as Policy, kt as RequestContext } from "./dataset-CejF-Fr_.js";
|
|
1
|
+
import { Ft as DeriveSpec, Mn as Row, ht as AutoCrudVerb, l as FieldInput, n as Dropped, p as PlanClause, sn as WhereClause, vt as Policy, xt as RequestContext, yt as PolicyDecision } from "./schema-oXfQyo0s.js";
|
|
2
|
+
import { n as BridgeCredential } from "./bridge-DQyQ6Qhn.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,19 +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;
|
|
85
|
-
/** On a `count` answer: every row the frame matches
|
|
90
|
+
/** On a `count` answer: every row the frame matches. Absent when counting stopped short, with `errors` saying why. */
|
|
86
91
|
count?: number;
|
|
87
92
|
errors?: unknown[];
|
|
88
93
|
source: 'parser' | 'judge' | 'handoff';
|
|
89
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[];
|
|
90
109
|
} | {
|
|
91
110
|
kind: 'recall';
|
|
92
111
|
query: string;
|
|
@@ -116,7 +135,7 @@ interface NlParsedData {
|
|
|
116
135
|
type NlJudgedStatus = 'resolved' | 'recall' | 'clarify' | 'refuse' | 'escalated';
|
|
117
136
|
/**
|
|
118
137
|
* One SSE event, discriminated by the SSE event name. The terminal answer is
|
|
119
|
-
* named by its outcome kind (`rows` | `recall` | `clarify` | `refuse`) and
|
|
138
|
+
* named by its outcome kind (`rows` | `recall` | `clarify` | `refuse` | `unknown`) and
|
|
120
139
|
* carries the whole outcome; `done` always follows. An in-band `error` event
|
|
121
140
|
* is not in this union: the client throws on it.
|
|
122
141
|
*/
|
|
@@ -154,6 +173,11 @@ type NlWireEvent = {
|
|
|
154
173
|
data: Extract<NlOutcome, {
|
|
155
174
|
kind: 'refuse';
|
|
156
175
|
}>;
|
|
176
|
+
} | {
|
|
177
|
+
event: 'unknown';
|
|
178
|
+
data: Extract<NlOutcome, {
|
|
179
|
+
kind: 'unknown';
|
|
180
|
+
}>;
|
|
157
181
|
} | {
|
|
158
182
|
event: 'done';
|
|
159
183
|
data: Record<string, never>;
|
|
@@ -187,8 +211,11 @@ interface NlPackField {
|
|
|
187
211
|
/** `metadata` marks a server-managed virtual (createdAt, createdById, ...). */
|
|
188
212
|
kind: 'scalar' | 'crossRef' | 'list' | 'struct' | 'metadata';
|
|
189
213
|
valueType?: string;
|
|
190
|
-
/** crossRef target
|
|
191
|
-
target?:
|
|
214
|
+
/** crossRef target. */
|
|
215
|
+
target?: {
|
|
216
|
+
namespace: string;
|
|
217
|
+
type: string;
|
|
218
|
+
};
|
|
192
219
|
indexed: boolean;
|
|
193
220
|
operators: string[];
|
|
194
221
|
phrases: string[];
|
|
@@ -226,7 +253,21 @@ interface NlValueAlias {
|
|
|
226
253
|
startsWith?: string;
|
|
227
254
|
contains?: string;
|
|
228
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
|
+
}
|
|
229
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>;
|
|
230
271
|
/** Types never scoped to the asking project (their `project` means "belongs to", not "applies to"). */
|
|
231
272
|
unscopedTypes?: string[];
|
|
232
273
|
/** Extra phrases naming a type, e.g. `backlog` -> Task. Win over the generated phrases. */
|
|
@@ -250,6 +291,12 @@ interface NlNamespaceRulings {
|
|
|
250
291
|
typeNotes?: Record<string, string>;
|
|
251
292
|
/** A phrase that means a predicate, e.g. `accepted` -> Decision.status in [active, accepted]. */
|
|
252
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>;
|
|
253
300
|
}
|
|
254
301
|
/** The body of `GET /substrate/v1/nl/pack/:ns`. */
|
|
255
302
|
interface NlServedPack extends NlNamespacePack {
|
|
@@ -718,4 +765,4 @@ declare function row<T>(predicate: (ctx: RequestContext, row: T) => boolean): Po
|
|
|
718
765
|
*/
|
|
719
766
|
declare function applyRowFilters<T>(decision: PolicyDecision, rows: T[], ctx: RequestContext): T[];
|
|
720
767
|
//#endregion
|
|
721
|
-
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 };
|