@mnmal-ai/substrate 1.0.0-alpha.7 → 1.0.0-alpha.8
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 +7 -7
- package/dist/client.d.ts +2 -1
- package/dist/client.js +1 -1
- package/dist/{dataset-DuPv47JG.js → dataset-jZS_4ci4.js} +4 -4
- package/dist/{pg-edges-store-CKu6M8PU.js → pg-edges-store-KH_FQCxx.js} +1 -1
- package/dist/{plugin-0dPAYAEm.js → plugin-B3NxUCVn.js} +1 -1
- package/dist/proposals-bootstrap.js +2 -2
- package/dist/proposals.js +1 -1
- package/dist/recall-bootstrap.js +2 -2
- package/dist/recall.js +2 -2
- package/dist/{repl-DiBeGwIW.js → repl-DeKzfvNV.js} +28 -22
- package/dist/sdk.js +1 -1
- package/dist/{src-CBV88iyK.js → src-BD27zeGF.js} +2 -2
- package/dist/{src-C9pC-AKI.js → src-CkZw6xVD.js} +3 -3
- package/dist/{src-DgLqCklp.js → src-DCy7Iy2l.js} +1 -1
- package/dist/{src-Dk3Zlsgd.js → src-DiNTSaFk.js} +4 -0
- package/dist/{src-B0BJcyKb.js → src-DjIuRjzF.js} +17 -3
- package/dist/substrate-admin.js +3 -3
- package/dist/substrate.js +10 -9
- package/dist/testing.js +3 -3
- package/package.json +19 -19
package/README.md
CHANGED
|
@@ -56,13 +56,13 @@ Imports the script and calls its default export with a `ScriptContext` (`args`,
|
|
|
56
56
|
```ts
|
|
57
57
|
import type { ScriptContext } from '@mnmal-ai/substrate/client';
|
|
58
58
|
|
|
59
|
-
// substrate run
|
|
59
|
+
// substrate run titled.mts --args '{"title":"hello"}'
|
|
60
60
|
export default async function (s: ScriptContext) {
|
|
61
|
-
const
|
|
62
|
-
params: { where: {
|
|
63
|
-
fields: { id: true
|
|
61
|
+
const notes = await s.queryAll('notes/Note', {
|
|
62
|
+
params: { where: { title: { eq: s.args.title } }, limit: 100 },
|
|
63
|
+
fields: { id: true }
|
|
64
64
|
});
|
|
65
|
-
return {
|
|
65
|
+
return { count: notes.length };
|
|
66
66
|
}
|
|
67
67
|
```
|
|
68
68
|
|
|
@@ -72,7 +72,7 @@ Guardrails:
|
|
|
72
72
|
- **A rejected frame throws.** A query whose key is missing from `data`, or a mutate the server refused, fails the run with the server's error rather than reading as empty.
|
|
73
73
|
- **Truncation is reported.** `query` adds a warning when a result has `hasMore`; `queryAll` pages to the end.
|
|
74
74
|
|
|
75
|
-
`s.recall({ query, namespace, type
|
|
75
|
+
`s.recall({ query, namespace, type, k?, threshold?, where?, row? })` returns hits best first, through the `recall/Hit` frame. Each hit's `row` is `id` plus the handle fields; pass `row: { body: true }` (or `true`) for more, on the hits you will read.
|
|
76
76
|
|
|
77
77
|
`--args` takes a JSON object, which the script reads as `s.args` (`{}` when omitted), so one script serves many calls.
|
|
78
78
|
|
|
@@ -99,7 +99,7 @@ set -a && source .env && set +a
|
|
|
99
99
|
./node_modules/.bin/substrate serve
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
`substrate init` writes a `package.json` pinning `@mnmal-ai/substrate` and the chosen optional plugins, a
|
|
102
|
+
`substrate init` writes a `package.json` pinning `@mnmal-ai/substrate` and the chosen optional plugins, a `pnpm-workspace.yaml`, a `.env` with `SUBSTRATE_PLUGIN_DIR=.`, a `substrate-recall.config.json` for the embedder, and, unless `--store=memory`, a `docker-compose.yml` running `pgvector/pgvector:pg17`. Flags: `--store=memory|postgres`, `--port`, `--pg-port`, `--plugins=<csv>` (from `cortext`, `substrate-nl`, `substrate-sentinel`; none by default), `--embedder=bge-base|minilm|ollama|none` (default `bge-base`), `--tls --tls-cert-path --tls-key-path`, `--substrate-url`, `--yes`, `--force`.
|
|
103
103
|
|
|
104
104
|
`SUBSTRATE_PLUGIN_DIR` is the directory whose `node_modules/` holds the plugins; in a scaffolded runtime that is the runtime directory itself. Recall and proposals load from `@mnmal-ai/substrate` itself, so they are present whenever the binary is installed there. Kernel plugins (`substrate-recall`, `substrate-nl`) compose first, then coordinators (`substrate-proposals`, `substrate-sentinel`, …), alphabetical within each tier. Per-plugin overrides live at `<SUBSTRATE_PLUGIN_DIR>/<pkg-basename>.config.json`. With `SUBSTRATE_PLUGIN_DIR` unset the binary boots with only the `_system` admin namespace and `/health`.
|
|
105
105
|
|
package/dist/client.d.ts
CHANGED
|
@@ -791,7 +791,8 @@ interface ScriptRecallInput {
|
|
|
791
791
|
query: string;
|
|
792
792
|
/** Required, as on every recall surface. */
|
|
793
793
|
namespace: string;
|
|
794
|
-
type
|
|
794
|
+
/** Required, as on every recall surface: there is no default type. */
|
|
795
|
+
type: string;
|
|
795
796
|
k?: number;
|
|
796
797
|
threshold?: number;
|
|
797
798
|
where?: Record<string, unknown>;
|
package/dist/client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire as __binCreateRequire } from 'node:module'; const require
|
|
|
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
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 "./row-DZ0Fnpc6.js";
|
|
4
4
|
import { g as SchemaDriftError } from "./src-BLgbLq2k.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-
|
|
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-DiNTSaFk.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,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { d as buildAuditRow, f as AUDIT_EVENT_TYPE } from "./src-
|
|
2
|
+
import { d as buildAuditRow, f as AUDIT_EVENT_TYPE } from "./src-DjIuRjzF.js";
|
|
3
3
|
import { a as adminClaimCapabilities, d as resolveDefaultKidPath, l as resolveAdminCredential, n as trimTrailingSlashes, r as ADMIN_CAPABILITIES, s as makeAuthorizationProvider, u as resolveDefaultKeyPath } from "./env-utils-CGNazUNt.js";
|
|
4
4
|
import { D as isActiveAdminKeyRow, E as describeGrant, L as encodeList, M as grantEntryError, T as SYSTEM_NAMESPACE, v as grantEntriesConfer } from "./row-DZ0Fnpc6.js";
|
|
5
|
-
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-
|
|
6
|
-
import { i as pendingMigrations, o as runMigrations, t as PgDataset } from "./src-
|
|
5
|
+
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-DiNTSaFk.js";
|
|
6
|
+
import { i as pendingMigrations, o as runMigrations, t as PgDataset } from "./src-BD27zeGF.js";
|
|
7
7
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { homedir } from "node:os";
|
|
9
9
|
import { dirname, join } from "node:path";
|
|
@@ -11,7 +11,7 @@ import { createHash, createPublicKey, generateKeyPairSync, randomUUID } from "no
|
|
|
11
11
|
import postgres from "postgres";
|
|
12
12
|
|
|
13
13
|
//#region package.json
|
|
14
|
-
var version = "1.0.0-alpha.
|
|
14
|
+
var version = "1.0.0-alpha.8";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/admin/errors.ts
|
|
@@ -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-BD27zeGF.js";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
|
|
5
5
|
//#region ../../packages/substrate-dataset-pg/src/pg-edges-store.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { L as applyObligations, Q as buildContext, et as jsonResponse, wt as ResolverFrameError } from "./src-
|
|
2
|
+
import { L as applyObligations, Q as buildContext, et as jsonResponse, wt as ResolverFrameError } from "./src-DjIuRjzF.js";
|
|
3
3
|
import { Worker } from "node:worker_threads";
|
|
4
4
|
|
|
5
5
|
//#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 { Pt as defineBootstrap } from "./src-
|
|
3
|
-
import { n as createNoopPubSub, t as createProposalsPlugin } from "./src-
|
|
2
|
+
import { Pt as defineBootstrap } from "./src-DjIuRjzF.js";
|
|
3
|
+
import { n as createNoopPubSub, t as createProposalsPlugin } from "./src-DCy7Iy2l.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region ../../plugins/substrate-proposals/src/bootstrap.ts
|
package/dist/proposals.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { n as createNoopPubSub, r as ProposalError, t as createProposalsPlugin } from "./src-
|
|
2
|
+
import { n as createNoopPubSub, r as ProposalError, t as createProposalsPlugin } from "./src-DCy7Iy2l.js";
|
|
3
3
|
|
|
4
4
|
export { ProposalError, createNoopPubSub, createProposalsPlugin };
|
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 { Pt as defineBootstrap } from "./src-
|
|
2
|
+
import { Pt as defineBootstrap } from "./src-DjIuRjzF.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-B3NxUCVn.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region ../../packages/substrate-embedder/src/types.ts
|
package/dist/recall.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore, t as RECALL_VERSION } from "./src-
|
|
3
|
-
import { $ as CLUSTERER_BACKEND_VERSION, A as CLUSTER_MEMBER_FIELDS, C as EmbedSourceRegistry, D as makeReembed, E as makeEmbedPostWrite, F as unknownParams, G as DEFAULT_CRYSTALLISE_CONFIG, H as CRYSTALLISE_IN_FLIGHT_CODE, I as handleRecallRequest, J as runClusterer, K as handleCrystallise, L as RRF_K, M as recallRouteHandler, N as checkParams, O as crystalliseRouteHandler, P as unknownParamMessage, Q as CLUSTERER_BACKEND, R as armRanks, S as createEmbedStats, T as embedRowReporting, U as createCrystalliseGuard, X as l2normalize, _ as EMBEDDINGS_FETCH_MAX_REFS, a as REINDEX_MAX_LIMIT, b as handleLexicalCoverage, c as SALIENCE_BOOST_MAX_TARGETS, d as embeddingsMigration, et as memberKey, f as recallMcpTool, g as embeddingsFetchRouteHandler, h as embeddingSimilarOperator, i as REINDEX_DEFAULT_LIMIT, j as buildClusterSurface, k as CLUSTER_FIELDS, l as lexicalMigration, m as makeLexicalPostWrite, n as salienceBoostRouteHandler, nt as validateSelector, o as handleReindex, p as makeLexicalClassify, q as validateCrystalliseInput, r as reindexRouteHandler, s as validateReindexInput, t as createRecallPlugin, tt as SELECT_CANDIDATES_MAX_LIMIT, u as recallClustersMigration, v as embedStatsRouteHandler, w as embedAndStore, x as validateLexicalCoverageInput, y as handleEmbedStatsRequest, z as fuseByRank } from "./plugin-
|
|
2
|
+
import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore, t as RECALL_VERSION } from "./src-CkZw6xVD.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-B3NxUCVn.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 };
|
|
@@ -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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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.5/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,
|
|
@@ -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.5/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.5/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.5/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.5/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.5/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.5/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.5/node_modules/@inquirer/select/dist/index.js
|
|
1915
1921
|
const selectTheme = {
|
|
1916
1922
|
icon: { cursor: figures.pointer },
|
|
1917
1923
|
style: {
|
package/dist/sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { $ as error400, A as resolveIdentity, At as CLIENT_SUPPLIED_SERVER_FIELD, C as purgeResolver, Ct as ReservedField, D as deleteRow, Dt as isAuthCause, E as deleteResolver, Et as UnsupportedFilterError, M as resolveEntityRow, Mt as canonicalize, Nt as BootstrapConfigError, O as createResolver, Ot as isResolverFrameError, Pt as defineBootstrap, S as updateResolver, St as NamespaceMismatch, T as getResolver, Tt as RestrictViolation, Z as JSON_HEADERS, _ as field, _t as createKeyedMutex, at as WS_REASON_SERVER_RESTART, b as installAutoCrud, bt as BridgeUnreachableError, ct as normaliseVocabValues, dt as vocabImplication, et as jsonResponse, ft as RegistryBase, g as RESERVED_AUTOCRUD_FIELD_NAMES, gt as normaliseMetadataWhere, h as RESERVED_AUTOCRUD_FIELDS, ht as normaliseMetadataOrderBy, it as WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, j as resolveEntityId, jt as ROW_METADATA_FIELDS, k as UnattributedWriteError, kt as isRestrictViolation, lt as normaliseVocabWhere, m as defineNamespace, mt as METADATA_FILTER_FIELDS, ot as WS_REASON_SUBSCRIPTION_OVERLOADED, pt as METADATA_AUTHOR_FIELDS, st as canonicalVocabValue, tt as parseJsonBody, ut as storedVocabSpellings, v as autoCrudOptionsOf, vt as assertHardDeleteAllowed, w as listResolver, wt as ResolverFrameError, x as applyUpdatePatch, xt as MissingReferentError, y as createResolverWithEdges, yt as validateHardDeleteEnv } from "./src-
|
|
2
|
+
import { $ as error400, A as resolveIdentity, At as CLIENT_SUPPLIED_SERVER_FIELD, C as purgeResolver, Ct as ReservedField, D as deleteRow, Dt as isAuthCause, E as deleteResolver, Et as UnsupportedFilterError, M as resolveEntityRow, Mt as canonicalize, Nt as BootstrapConfigError, O as createResolver, Ot as isResolverFrameError, Pt as defineBootstrap, S as updateResolver, St as NamespaceMismatch, T as getResolver, Tt as RestrictViolation, Z as JSON_HEADERS, _ as field, _t as createKeyedMutex, at as WS_REASON_SERVER_RESTART, b as installAutoCrud, bt as BridgeUnreachableError, ct as normaliseVocabValues, dt as vocabImplication, et as jsonResponse, ft as RegistryBase, g as RESERVED_AUTOCRUD_FIELD_NAMES, gt as normaliseMetadataWhere, h as RESERVED_AUTOCRUD_FIELDS, ht as normaliseMetadataOrderBy, it as WS_CODE_SUBSCRIPTION_UNSUPPORTED_FRAME, j as resolveEntityId, jt as ROW_METADATA_FIELDS, k as UnattributedWriteError, kt as isRestrictViolation, lt as normaliseVocabWhere, m as defineNamespace, mt as METADATA_FILTER_FIELDS, ot as WS_REASON_SUBSCRIPTION_OVERLOADED, pt as METADATA_AUTHOR_FIELDS, st as canonicalVocabValue, tt as parseJsonBody, ut as storedVocabSpellings, v as autoCrudOptionsOf, vt as assertHardDeleteAllowed, w as listResolver, wt as ResolverFrameError, x as applyUpdatePatch, xt as MissingReferentError, y as createResolverWithEdges, yt as validateHardDeleteEnv } from "./src-DjIuRjzF.js";
|
|
3
3
|
import { a as adminClaimCapabilities, c as makeTokenProvider, d as resolveDefaultKidPath, i as DEFAULT_CAPABILITIES, l as resolveAdminCredential, n as trimTrailingSlashes, o as isEncryptedKey, r as ADMIN_CAPABILITIES, s as makeAuthorizationProvider, t as parsePositiveInt, u as resolveDefaultKeyPath } from "./env-utils-CGNazUNt.js";
|
|
4
4
|
import { A as expandFlat, C as not, D as isActiveAdminKeyRow, E as describeGrant, F as parseGrantEntries, I as decodeList, L as encodeList, M as grantEntryError, N as grantIsUniform, O as capabilitiesFor, P as intersectGrants, S as and, T as SYSTEM_NAMESPACE, _ as grantCovers, a as denyAll, b as newlyGrantedPairs, c as requireIdentity, d as confersAnywhere, f as coversNamespace, g as checkUpdatable, h as checkRevocable, i as allowVerbs, j as flattenGrant, k as encodeGrant, l as requireNamespace, m as grantedIn, n as row, o as denyVerbs, p as grantOf, r as allowAll, s as requireCapability, t as applyRowFilters, u as allCapabilities, v as grantEntriesConfer, w as or, x as revokedAtIso, y as newlyGranted } from "./row-DZ0Fnpc6.js";
|
|
5
5
|
import { S as assertNever, b as formatQualifiedKey, x as parseQualifiedKey } from "./src-BLgbLq2k.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { Ct as ReservedField, Et as UnsupportedFilterError, H as assertJsonPathPredicate, J as fullBuiltinOperators, K as decodeCursor, St as NamespaceMismatch, U as isJsonPathPredicate, V as preResolveExtensionOperatorsDetailed, X as fieldRequested, Y as applyExtensionResultMeta, _t as createKeyedMutex, q as encodeCursor } from "./src-
|
|
2
|
+
import { Ct as ReservedField, Et as UnsupportedFilterError, H as assertJsonPathPredicate, J as fullBuiltinOperators, K as decodeCursor, St as NamespaceMismatch, U as isJsonPathPredicate, V as preResolveExtensionOperatorsDetailed, X as fieldRequested, Y as applyExtensionResultMeta, _t as createKeyedMutex, q as encodeCursor } from "./src-DjIuRjzF.js";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
|
|
5
5
|
//#region ../../packages/substrate-dataset-pg/src/advisory-lock.ts
|
|
@@ -652,7 +652,7 @@ var PgShortIdStore = class {
|
|
|
652
652
|
})), "namespace", "type", "short_id", "row_id")}
|
|
653
653
|
ON CONFLICT (namespace, type, short_id) DO NOTHING
|
|
654
654
|
`;
|
|
655
|
-
const max = entries.reduce((m, e) =>
|
|
655
|
+
const max = entries.reduce((m, e) => Math.max(m, e.shortId), 0);
|
|
656
656
|
const name = await this.ensureSequence(ns, type);
|
|
657
657
|
await this.sql.unsafe(`SELECT setval('"${name}"', GREATEST((SELECT last_value FROM "${name}"), ${max}))`);
|
|
658
658
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { n as txScopeIdFor } from "./src-
|
|
3
|
-
import { B as ROW_FILTER_FIELD, V as matchesRowFilter, W as inFlightError, Y as unresolvedRow, Z as cosineSimilarity, et as memberKey } from "./plugin-
|
|
2
|
+
import { n as txScopeIdFor } from "./src-BD27zeGF.js";
|
|
3
|
+
import { B as ROW_FILTER_FIELD, V as matchesRowFilter, W as inFlightError, Y as unresolvedRow, Z as cosineSimilarity, et as memberKey } from "./plugin-B3NxUCVn.js";
|
|
4
4
|
|
|
5
5
|
//#region ../../plugins/substrate-recall/package.json
|
|
6
|
-
var version = "1.0.0-alpha.
|
|
6
|
+
var version = "1.0.0-alpha.8";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region ../../plugins/substrate-recall/src/in-memory-cluster-store.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { A as resolveIdentity, F as publishSchema, Z as JSON_HEADERS, _ as field, b as installAutoCrud, h as RESERVED_AUTOCRUD_FIELDS, l as migrateFieldValues, m as defineNamespace, v as autoCrudOptionsOf, wt as ResolverFrameError } from "./src-
|
|
2
|
+
import { A as resolveIdentity, F as publishSchema, Z as JSON_HEADERS, _ as field, b as installAutoCrud, h as RESERVED_AUTOCRUD_FIELDS, l as migrateFieldValues, m as defineNamespace, v as autoCrudOptionsOf, wt as ResolverFrameError } from "./src-DjIuRjzF.js";
|
|
3
3
|
import { s as requireCapability } from "./row-DZ0Fnpc6.js";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
|
|
@@ -1742,6 +1742,10 @@ var WsTransport = class {
|
|
|
1742
1742
|
if (this.#destroyed) throw new NetworkError("WsTransport destroyed", null);
|
|
1743
1743
|
try {
|
|
1744
1744
|
const mux = await this.#openOnce();
|
|
1745
|
+
if (this.#destroyed) {
|
|
1746
|
+
mux.close();
|
|
1747
|
+
throw new NetworkError("WsTransport destroyed", null);
|
|
1748
|
+
}
|
|
1745
1749
|
scheduler.reset();
|
|
1746
1750
|
this.#hasOpened = true;
|
|
1747
1751
|
this.#mux = mux;
|
|
@@ -5462,7 +5462,8 @@ var Engine = class {
|
|
|
5462
5462
|
const entry = frame[key];
|
|
5463
5463
|
if (entry === void 0) continue;
|
|
5464
5464
|
const parsed = parsedByKey.get(key) ?? null;
|
|
5465
|
-
|
|
5465
|
+
const errorsBefore = envelope.errors?.length ?? 0;
|
|
5466
|
+
if (await this.#runEntry(envelope, key, entry, ctx, "mutate", parsed === null ? null : txFor(parsed.ns), txEdges, parsed, (event) => pending.push(event), signal, (fn) => settled.push(fn)) || (envelope.errors ?? []).slice(errorsBefore).some((e) => e.path?.[0] === key)) {
|
|
5466
5467
|
refusedKey = key;
|
|
5467
5468
|
throw new SharedTxRefusal();
|
|
5468
5469
|
}
|
|
@@ -11636,6 +11637,18 @@ const WS_INSTRUCTIONS = {
|
|
|
11636
11637
|
]
|
|
11637
11638
|
}
|
|
11638
11639
|
};
|
|
11640
|
+
const CODE_MODE_INSTRUCTIONS = {
|
|
11641
|
+
command: "substrate run <script.mts> [--args <json>] [--dry-run | --write] [--max-writes <n>] [--out <file>]",
|
|
11642
|
+
summary: "For an agent with a shell: run a TypeScript script whose default export receives a signed client, so many reads and writes cost one call and return one small JSON report. It composes the operations above; it adds none, and every call meets the same grants and policy.",
|
|
11643
|
+
when: "a count or census over many rows, a join across types, recall followed by fetching the bodies of the hits worth reading, or a batch of writes chosen by what a read found. One lookup or one write is simpler as a direct query or mutate",
|
|
11644
|
+
context: "the default export gets `s` with `args`, `query(frame)`, `queryAll(key, { params, fields })`, `recall({ query, namespace, type, ... })`, `mutate(payload)` and `log(...)`; return a reduced result (counts, ids, a verdict), not whole rows",
|
|
11645
|
+
notes: [
|
|
11646
|
+
"signs from SUBSTRATE_URL, SUBSTRATE_AGENT_KEY_ID and SUBSTRATE_AGENT_KEY_PATH, and refuses to run unsigned",
|
|
11647
|
+
"read-only by default: `mutate` throws unless `--dry-run` (records each payload and sends nothing) or `--write` (sends up to `--max-writes` frames, default 50). Dry-run first, read the recorded mutations, then write",
|
|
11648
|
+
"a frame the server rejected fails the run with its error rather than reading as empty; a truncated `query` is reported in `warnings`, and `queryAll` pages to the end",
|
|
11649
|
+
"stdout is one report `{ ok, kid, mode, args, result, error?, mutations, warnings, stats }`; `mutations` lists every payload with `applied`, including those sent before a failure. Exit codes: 0 ok, 1 the script failed, 2 usage or configuration"
|
|
11650
|
+
]
|
|
11651
|
+
};
|
|
11639
11652
|
const AUTH_INSTRUCTIONS = {
|
|
11640
11653
|
summary: "Bearer-JWT auth (§5.12). Present `Authorization: Bearer <jwt>` on every request, onboard included. Only /health, /substrate/v1/whoami and /substrate/v1/_system/register answer without one. Two paths to a token: (a) the invite→register exchange for a namespace-scoped JWT, or (b) a pre-registered per-principal key you sign with directly (the agent-identity path — see `identity`). How a MISSING token is treated depends on `mode`.",
|
|
11641
11654
|
modes: {
|
|
@@ -11679,8 +11692,8 @@ function buildFrameGrammar(coordinators) {
|
|
|
11679
11692
|
return {
|
|
11680
11693
|
queryKey: "<ns>/<TypeName>",
|
|
11681
11694
|
mutationKey: "<ns>/<mutationName>",
|
|
11682
|
-
batched: "A mutate op-key MAY carry an Array<FrameEntry>. All frames under one op-key run serially inside the same transaction (all-or-nothing per op-key)
|
|
11683
|
-
example: `{ "${exampleNs}/Todo": { "params": {"status": "open"}, "fields": {"id": true, "title": true} }, "${exampleNs}/createTodo": [{ "params": {"title": "first"}, "fields": {"id": true} }, { "params": {"title": "second"}, "fields": {"id": true} }] }`
|
|
11695
|
+
batched: "A mutate op-key MAY carry an Array<FrameEntry>. All frames under one array op-key run serially inside the same transaction (all-or-nothing per op-key), and each array op-key commits independently of every other op-key. The single-frame op-keys of one call share their own transaction: if any of them is refused, all of them roll back with `frame_rolled_back`. Query/subscribe/stream op-keys reject array values.",
|
|
11696
|
+
example: `{ "${exampleNs}/Todo": { "params": {"where": {"status": {"eq": "open"}}}, "fields": {"id": true, "title": true} }, "${exampleNs}/createTodo": [{ "params": {"title": "first"}, "fields": {"id": true} }, { "params": {"title": "second"}, "fields": {"id": true} }] }`
|
|
11684
11697
|
};
|
|
11685
11698
|
}
|
|
11686
11699
|
function buildPluginContributions(plugins) {
|
|
@@ -11723,6 +11736,7 @@ function buildOnboardBody(deps) {
|
|
|
11723
11736
|
stream: WS_INSTRUCTIONS.stream,
|
|
11724
11737
|
substratePack: WS_INSTRUCTIONS.substratePack,
|
|
11725
11738
|
sse: WS_INSTRUCTIONS.sse,
|
|
11739
|
+
codeMode: CODE_MODE_INSTRUCTIONS,
|
|
11726
11740
|
plugins: buildPluginContributions(deps.coordinators),
|
|
11727
11741
|
pluginRoutes: buildPluginRoutes(deps.coordinators)
|
|
11728
11742
|
};
|
package/dist/substrate-admin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
3
|
-
import { d as buildAuditRow, f as AUDIT_EVENT_TYPE } from "./src-
|
|
3
|
+
import { d as buildAuditRow, f as AUDIT_EVENT_TYPE } from "./src-DjIuRjzF.js";
|
|
4
4
|
import { d as resolveDefaultKidPath, u as resolveDefaultKeyPath } from "./env-utils-CGNazUNt.js";
|
|
5
5
|
import { E as describeGrant, I as decodeList, L as encodeList, M as grantEntryError, g as checkUpdatable, h as checkRevocable, y as newlyGranted } from "./row-DZ0Fnpc6.js";
|
|
6
|
-
import { w as reconcileIdentities } from "./src-
|
|
7
|
-
import { A as describeAdminTarget, B as version, C as CLI_ACTOR_KID, D as listActiveAdminKeys, E as generateAdminKeypair, F as RESTART_NOTE, I as USAGE, L as argvError, M as resolveAdminTarget, N as ARGV_SPEC, O as readEd25519PublicKey, P as validateArgv, S as BootstrapError, T as forUpdate, _ as REVOKE_EXIT_CODES, a as formatRegisterOutput, b as runKeyPatchViaRoute, c as runRegisterViaRoute, d as formatDoctorReport, f as runDoctor, g as bootstrapKidPath, h as runBootstrap, i as runOnboard, j as resolveAdminAuth, k as readKeyById, l as grantLines, m as parseBootstrapArgs, n as formatChecklist, o as parseRegisterArgs, p as formatBootstrapOutput, r as onboardCommand, s as runRegister, t as openPgDataset, u as doctorCommand, v as UPDATE_EXIT_CODES, w as base64Url, x as ACTOR_HINT, y as runKeyListViaRoute, z as AdminCliError } from "./dataset-
|
|
6
|
+
import { w as reconcileIdentities } from "./src-DiNTSaFk.js";
|
|
7
|
+
import { A as describeAdminTarget, B as version, C as CLI_ACTOR_KID, D as listActiveAdminKeys, E as generateAdminKeypair, F as RESTART_NOTE, I as USAGE, L as argvError, M as resolveAdminTarget, N as ARGV_SPEC, O as readEd25519PublicKey, P as validateArgv, S as BootstrapError, T as forUpdate, _ as REVOKE_EXIT_CODES, a as formatRegisterOutput, b as runKeyPatchViaRoute, c as runRegisterViaRoute, d as formatDoctorReport, f as runDoctor, g as bootstrapKidPath, h as runBootstrap, i as runOnboard, j as resolveAdminAuth, k as readKeyById, l as grantLines, m as parseBootstrapArgs, n as formatChecklist, o as parseRegisterArgs, p as formatBootstrapOutput, r as onboardCommand, s as runRegister, t as openPgDataset, u as doctorCommand, v as UPDATE_EXIT_CODES, w as base64Url, x as ACTOR_HINT, y as runKeyListViaRoute, z as AdminCliError } from "./dataset-jZS_4ci4.js";
|
|
8
8
|
import { existsSync, mkdirSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { dirname } from "node:path";
|
|
10
10
|
import { createHash, randomUUID } from "node:crypto";
|
package/dist/substrate.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
3
|
-
import { B as saveSweepState, G as registerExtensionOperator, I as effectiveFilterOperators, N as MemoryEdgesStore, Q as buildContext, R as loadSweepState, W as getExtensionOperator, a as composeFromManifests, at as WS_REASON_SERVER_RESTART, bt as BridgeUnreachableError, c as MemoryDataset, d as buildAuditRow, f as AUDIT_EVENT_TYPE, i as PluginLoadError, n as kernelMigrationTracking, nt as parseAuthConfig, o as DEFAULT_NAMESPACE, p as INVITE_TYPE, r as mountKernelRoute, s as compose, t as composeKernelPlugins, u as runInviteSweep, yt as validateHardDeleteEnv, z as runSweep } from "./src-
|
|
3
|
+
import { B as saveSweepState, G as registerExtensionOperator, I as effectiveFilterOperators, N as MemoryEdgesStore, Q as buildContext, R as loadSweepState, W as getExtensionOperator, a as composeFromManifests, at as WS_REASON_SERVER_RESTART, bt as BridgeUnreachableError, c as MemoryDataset, d as buildAuditRow, f as AUDIT_EVENT_TYPE, i as PluginLoadError, n as kernelMigrationTracking, nt as parseAuthConfig, o as DEFAULT_NAMESPACE, p as INVITE_TYPE, r as mountKernelRoute, s as compose, t as composeKernelPlugins, u as runInviteSweep, yt as validateHardDeleteEnv, z as runSweep } from "./src-DjIuRjzF.js";
|
|
4
4
|
import { n as trimTrailingSlashes, s as makeAuthorizationProvider, t as parsePositiveInt } from "./env-utils-CGNazUNt.js";
|
|
5
5
|
import { L as encodeList, T as SYSTEM_NAMESPACE, f as coversNamespace, m as grantedIn, p as grantOf } from "./row-DZ0Fnpc6.js";
|
|
6
|
-
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-
|
|
6
|
+
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-DiNTSaFk.js";
|
|
7
7
|
import { n as runScript, t as DEFAULT_MAX_WRITES } from "./script-C6DSa_Na.js";
|
|
8
|
-
import { a as runDerivedMigrations, o as runMigrations, r as deriveListIndexMigration, s as tryWithPgAdvisoryLock, t as PgDataset } from "./src-
|
|
9
|
-
import { t as PgEdgesStore } from "./pg-edges-store-
|
|
10
|
-
import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore } from "./src-
|
|
11
|
-
import { B as version, R as openSql, t as openPgDataset, z as AdminCliError } from "./dataset-
|
|
8
|
+
import { a as runDerivedMigrations, o as runMigrations, r as deriveListIndexMigration, s as tryWithPgAdvisoryLock, t as PgDataset } from "./src-BD27zeGF.js";
|
|
9
|
+
import { t as PgEdgesStore } from "./pg-edges-store-KH_FQCxx.js";
|
|
10
|
+
import { a as InMemoryLexicalStore, i as PgClusterStore, n as PgLexicalStore, o as InMemoryEmbeddingsStore, r as PgEmbeddingsStore, s as InMemoryClusterStore } from "./src-CkZw6xVD.js";
|
|
11
|
+
import { B as version, R as openSql, t as openPgDataset, z as AdminCliError } from "./dataset-jZS_4ci4.js";
|
|
12
12
|
import { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { homedir, hostname } from "node:os";
|
|
14
14
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -4356,7 +4356,7 @@ async function runInit(argv) {
|
|
|
4356
4356
|
return 1;
|
|
4357
4357
|
}
|
|
4358
4358
|
if (!config.yes) try {
|
|
4359
|
-
const { runRepl } = await import("./repl-
|
|
4359
|
+
const { runRepl } = await import("./repl-DeKzfvNV.js");
|
|
4360
4360
|
config = await runRepl(config);
|
|
4361
4361
|
} catch (err) {
|
|
4362
4362
|
if (err.message?.includes("User force closed")) return 130;
|
|
@@ -5114,8 +5114,9 @@ Subcommands:
|
|
|
5114
5114
|
run <script.mts> [--args <json>] [--dry-run | --write] [--max-writes <n>] [--out <file>]
|
|
5115
5115
|
Run a script's default export (s) => result against a client
|
|
5116
5116
|
signed from SUBSTRATE_URL + SUBSTRATE_AGENT_KEY_ID/_PATH, and
|
|
5117
|
-
print one JSON report. --args is a JSON object, read as
|
|
5118
|
-
|
|
5117
|
+
print one JSON report. --args is a JSON object, read as
|
|
5118
|
+
s.args. Read-only unless --dry-run (records mutations) or
|
|
5119
|
+
--write (sends up to --max-writes frames, 50).
|
|
5119
5120
|
check-enums [--json] [--record]
|
|
5120
5121
|
Report stored values outside a field's declared enum.
|
|
5121
5122
|
Read-only over HTTP (--record writes verdict rows); reads
|
package/dist/testing.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
|
|
2
|
-
import { N as MemoryEdgesStore, P as loadPlugins, at as WS_REASON_SERVER_RESTART, c as MemoryDataset, rt as signHs256, s as compose } from "./src-
|
|
3
|
-
import { a as runDerivedMigrations, o as runMigrations, r as deriveListIndexMigration, t as PgDataset } from "./src-
|
|
4
|
-
import { t as PgEdgesStore } from "./pg-edges-store-
|
|
2
|
+
import { N as MemoryEdgesStore, P as loadPlugins, at as WS_REASON_SERVER_RESTART, c as MemoryDataset, rt as signHs256, s as compose } from "./src-DjIuRjzF.js";
|
|
3
|
+
import { a as runDerivedMigrations, o as runMigrations, r as deriveListIndexMigration, t as PgDataset } from "./src-BD27zeGF.js";
|
|
4
|
+
import { t as PgEdgesStore } from "./pg-edges-store-KH_FQCxx.js";
|
|
5
5
|
import { t as FakeEmbedder } from "./fake-DUVtKVSE.js";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
import postgres from "postgres";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mnmal-ai/substrate",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.8",
|
|
4
4
|
"description": "Substrate — an agent-first typed-data server: the substrate and substrate-admin binaries, the built-in plugins and the SDK subpaths.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -36,24 +36,24 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@inquirer/prompts": "^8.7.2",
|
|
39
|
-
"@mnmal-ai/substrate-bootstrap": "1.0.0-alpha.
|
|
40
|
-
"@mnmal-ai/substrate-client": "1.0.0-alpha.
|
|
41
|
-
"@mnmal-ai/substrate-compose": "1.0.0-alpha.
|
|
42
|
-
"@mnmal-ai/substrate-config": "1.0.0-alpha.
|
|
43
|
-
"@mnmal-ai/substrate-core": "1.0.0-alpha.
|
|
44
|
-
"@mnmal-ai/substrate-dataset-memory": "1.0.0-alpha.
|
|
45
|
-
"@mnmal-ai/substrate-dataset-pg": "1.0.0-alpha.
|
|
46
|
-
"@mnmal-ai/substrate-embedder": "1.0.0-alpha.
|
|
47
|
-
"@mnmal-ai/substrate-filter": "1.0.0-alpha.
|
|
48
|
-
"@mnmal-ai/substrate-pack": "1.0.0-alpha.
|
|
49
|
-
"@mnmal-ai/substrate-policy": "1.0.0-alpha.
|
|
50
|
-
"@mnmal-ai/substrate-proposals": "1.0.0-alpha.
|
|
51
|
-
"@mnmal-ai/substrate-recall": "1.0.0-alpha.
|
|
52
|
-
"@mnmal-ai/substrate-sdk": "1.0.0-alpha.
|
|
53
|
-
"@mnmal-ai/substrate-sentinel-client": "1.0.0-alpha.
|
|
54
|
-
"@mnmal-ai/substrate-server-fastify": "1.0.0-alpha.
|
|
55
|
-
"@mnmal-ai/substrate-server-memory": "1.0.0-alpha.
|
|
56
|
-
"@mnmal-ai/substrate-types": "1.0.0-alpha.
|
|
39
|
+
"@mnmal-ai/substrate-bootstrap": "1.0.0-alpha.8",
|
|
40
|
+
"@mnmal-ai/substrate-client": "1.0.0-alpha.8",
|
|
41
|
+
"@mnmal-ai/substrate-compose": "1.0.0-alpha.8",
|
|
42
|
+
"@mnmal-ai/substrate-config": "1.0.0-alpha.8",
|
|
43
|
+
"@mnmal-ai/substrate-core": "1.0.0-alpha.8",
|
|
44
|
+
"@mnmal-ai/substrate-dataset-memory": "1.0.0-alpha.8",
|
|
45
|
+
"@mnmal-ai/substrate-dataset-pg": "1.0.0-alpha.8",
|
|
46
|
+
"@mnmal-ai/substrate-embedder": "1.0.0-alpha.8",
|
|
47
|
+
"@mnmal-ai/substrate-filter": "1.0.0-alpha.8",
|
|
48
|
+
"@mnmal-ai/substrate-pack": "1.0.0-alpha.8",
|
|
49
|
+
"@mnmal-ai/substrate-policy": "1.0.0-alpha.8",
|
|
50
|
+
"@mnmal-ai/substrate-proposals": "1.0.0-alpha.8",
|
|
51
|
+
"@mnmal-ai/substrate-recall": "1.0.0-alpha.8",
|
|
52
|
+
"@mnmal-ai/substrate-sdk": "1.0.0-alpha.8",
|
|
53
|
+
"@mnmal-ai/substrate-sentinel-client": "1.0.0-alpha.8",
|
|
54
|
+
"@mnmal-ai/substrate-server-fastify": "1.0.0-alpha.8",
|
|
55
|
+
"@mnmal-ai/substrate-server-memory": "1.0.0-alpha.8",
|
|
56
|
+
"@mnmal-ai/substrate-types": "1.0.0-alpha.8",
|
|
57
57
|
"@types/node": "^26.6.4",
|
|
58
58
|
"@types/semver": "^7.5.0",
|
|
59
59
|
"@types/ws": "^8.18.1",
|