@mnmal-ai/substrate 0.0.0 → 1.0.0-alpha.1

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.
Files changed (46) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +118 -1
  3. package/dist/agent-token-BIboWOU0.js +200 -0
  4. package/dist/client.d.ts +782 -0
  5. package/dist/client.js +7 -0
  6. package/dist/cluster-worker.js +35 -0
  7. package/dist/content-type-C7T28xNb.js +25 -0
  8. package/dist/dataset-DOXGRz50.js +1535 -0
  9. package/dist/env-utils-B7SGmoeJ.js +21 -0
  10. package/dist/errors-D4vKuwz8.d.ts +130 -0
  11. package/dist/fake-DUVtKVSE.js +36 -0
  12. package/dist/index-D7mSOFlM.d.ts +69 -0
  13. package/dist/pack.d.ts +192 -0
  14. package/dist/pack.js +5 -0
  15. package/dist/plugin-BuQQEzL-.js +3844 -0
  16. package/dist/plugin-t2g2wX0b.d.ts +1568 -0
  17. package/dist/proposals-bootstrap.js +37 -0
  18. package/dist/proposals.config.schema.json +20 -0
  19. package/dist/proposals.d.ts +118 -0
  20. package/dist/proposals.default-config.json +4 -0
  21. package/dist/proposals.js +4 -0
  22. package/dist/recall-bootstrap.js +451 -0
  23. package/dist/recall.config.schema.json +232 -0
  24. package/dist/recall.d.ts +1981 -0
  25. package/dist/recall.default-config.json +4 -0
  26. package/dist/recall.js +5 -0
  27. package/dist/repl-C52wyfMs.js +2213 -0
  28. package/dist/row-ByLFE2Wx.d.ts +719 -0
  29. package/dist/row-DK7lPZVe.js +732 -0
  30. package/dist/runtime-metrics-DwpDJ8vz.d.ts +159 -0
  31. package/dist/schema-g4FQLr0V.d.ts +433 -0
  32. package/dist/sdk.d.ts +694 -0
  33. package/dist/sdk.js +112 -0
  34. package/dist/src-5hVbeiAu.js +1797 -0
  35. package/dist/src-C4DzaIQZ.js +837 -0
  36. package/dist/src-CjEwiKXw.js +2327 -0
  37. package/dist/src-DuopV8u7.js +2408 -0
  38. package/dist/src-YXlv_RyL.js +13524 -0
  39. package/dist/src-zcyUofMJ.js +1015 -0
  40. package/dist/substrate-admin.js +808 -0
  41. package/dist/substrate.js +5482 -0
  42. package/dist/testing.d.ts +1240 -0
  43. package/dist/testing.js +702 -0
  44. package/dist/types-8c0gtnd2.d.ts +35 -0
  45. package/dist/ws-C72iVS5T.d.ts +143 -0
  46. package/package.json +117 -4
package/dist/client.js ADDED
@@ -0,0 +1,7 @@
1
+ import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
+ import { a as makeAuthorizationProvider, c as resolveDefaultKeyPath, i as isEncryptedKey, l as resolveDefaultKidPath, n as DEFAULT_CAPABILITIES, o as makeTokenProvider, r as adminClaimCapabilities, s as resolveAdminCredential, t as ADMIN_CAPABILITIES } from "./agent-token-BIboWOU0.js";
3
+ import { A as expandFlat, C as not, D as isActiveAdminKeyRow, E as describeGrant, F as parseGrantEntries, I as decodeList, L as encodeList, M as grantEntryError, N as grantIsUniform, O as capabilitiesFor, P as intersectGrants, S as and, T as SYSTEM_NAMESPACE, _ as grantCovers, a as denyAll, b as newlyGrantedPairs, c as requireIdentity, g as checkUpdatable, h as checkRevocable, i as allowVerbs, j as flattenGrant, k as encodeGrant, l as requireNamespace, n as row, o as denyVerbs, r as allowAll, s as requireCapability, t as applyRowFilters, v as grantEntriesConfer, w as or, x as revokedAtIso, y as newlyGranted } from "./row-DK7lPZVe.js";
4
+ import { g as SchemaDriftError } from "./src-C4DzaIQZ.js";
5
+ import { S as reconcileIdentities, _ as currentStep, a as createDefaultDiagnosticsSink, b as DIAGNOSE_CHECKS, c as AuthError, d as AdminBackfillError, f as BACKFILL_CHUNK, g as STEP_MARKS, h as SKIPPABLE_STEPS, i as collectDiagnostics, l as NetworkError, m as ONBOARD_STEPS, n as tokenAudience, o as reduceSubscribeRows, p as CURRENT_MARK, r as SubstrateClient, s as watchRows, t as noRedirectFetch, u as SubscribeError, v as planOnboarding, x as diagnose, y as requiredOutstanding } from "./src-DuopV8u7.js";
6
+
7
+ export { ADMIN_CAPABILITIES, AdminBackfillError, AuthError, BACKFILL_CHUNK, CURRENT_MARK, DEFAULT_CAPABILITIES, DIAGNOSE_CHECKS, NetworkError, ONBOARD_STEPS, SKIPPABLE_STEPS, STEP_MARKS, SYSTEM_NAMESPACE, SchemaDriftError, SubscribeError, SubstrateClient, adminClaimCapabilities, allowAll, allowVerbs, and, applyRowFilters, capabilitiesFor, checkRevocable, checkUpdatable, collectDiagnostics, 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, resolveDefaultKeyPath, resolveDefaultKidPath, revokedAtIso, row, tokenAudience, watchRows };
@@ -0,0 +1,35 @@
1
+ import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
+ import { parentPort } from "node:worker_threads";
3
+ import { WasmClusterer } from "@mnmal-ai/holomap-clusterer";
4
+
5
+ //#region ../../plugins/substrate-recall/src/cluster-worker.ts
6
+ /**
7
+ * Worker entry for a clustering pass. One message in, one message out.
8
+ *
9
+ * Nothing here runs at import time except the wasm module's own lazy load
10
+ * (`WasmClusterer` loads on first `cluster()` call, never at import), so the
11
+ * module is safe to load inside a Worker.
12
+ */
13
+ const port = parentPort;
14
+ if (port === null) throw new Error("cluster-worker: no parentPort — this module must be loaded as a Worker");
15
+ port.on("message", (req) => {
16
+ (async () => {
17
+ try {
18
+ const vectors = [];
19
+ for (let i = 0; i < req.rows; i++) vectors.push(req.flat.subarray(i * req.dims, (i + 1) * req.dims));
20
+ const result = await new WasmClusterer().cluster(vectors, req.params);
21
+ port.postMessage({
22
+ ok: true,
23
+ assignments: Int32Array.from(result.assignments)
24
+ });
25
+ } catch (err) {
26
+ port.postMessage({
27
+ ok: false,
28
+ message: err instanceof Error ? err.message : String(err)
29
+ });
30
+ }
31
+ })();
32
+ });
33
+
34
+ //#endregion
35
+ export { };
@@ -0,0 +1,25 @@
1
+ import { createRequire as __binCreateRequire } from 'node:module'; const require = __binCreateRequire(import.meta.url);
2
+ //#region ../../packages/substrate-pack/src/content-type.ts
3
+ /**
4
+ * Content-type negotiation. Spec: §7.0.
5
+ *
6
+ * A request that advertises `Accept: application/vnd.substrate.pack` gets the binary
7
+ * envelope; anything else falls back to JSON. We deliberately skip RFC 7231
8
+ * q-value ranking — the useful scenarios are exact match, the `; q=…` form,
9
+ * and comma-separated clauses. A real parser is overkill for a single-mime
10
+ * negotiation.
11
+ */
12
+ const PACK_MIME = "application/vnd.substrate.pack";
13
+ function acceptsPack(acceptHeader) {
14
+ if (acceptHeader === void 0 || acceptHeader.length === 0) return false;
15
+ for (const rawClause of acceptHeader.split(",")) {
16
+ const clause = rawClause.trim();
17
+ if (clause.length === 0) continue;
18
+ const semi = clause.indexOf(";");
19
+ if ((semi === -1 ? clause : clause.slice(0, semi)).trim() === "application/vnd.substrate.pack") return true;
20
+ }
21
+ return false;
22
+ }
23
+
24
+ //#endregion
25
+ export { acceptsPack as n, PACK_MIME as t };