@substrat-run/adapter-sqlite 0.146.0 → 0.148.0

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.
@@ -0,0 +1,15 @@
1
+ import type { ScopeStoreHostOptions, ScopeStoreRunner } from '@substrat-run/kernel';
2
+ /**
3
+ * The `scopeStores.runners` a dev harness hands `SqliteScopeHost` (#2213), read from the
4
+ * vertical's own declaration (`runtimeNeeds.scopeStores`) so local bindings cannot drift
5
+ * from the ones a push declares. One runner per kind: two bindings of one kind share it,
6
+ * and the host starts it once.
7
+ *
8
+ * Refused: a declared kind with no runner, and a runner whose `kind` is not the key it
9
+ * was given under, since a dump records the runner's kind and a restore checks it.
10
+ */
11
+ export declare function scopeStoreRunnersFor(declared: readonly {
12
+ readonly binding: string;
13
+ readonly kind: string;
14
+ }[], runners: Readonly<Record<string, ScopeStoreRunner>>): NonNullable<ScopeStoreHostOptions['runners']>;
15
+ //# sourceMappingURL=scope-store-runners.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-store-runners.d.ts","sourceRoot":"","sources":["../src/scope-store-runners.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEpF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,SAAS;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EACxE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,GAClD,WAAW,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAa/C"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The `scopeStores.runners` a dev harness hands `SqliteScopeHost` (#2213), read from the
3
+ * vertical's own declaration (`runtimeNeeds.scopeStores`) so local bindings cannot drift
4
+ * from the ones a push declares. One runner per kind: two bindings of one kind share it,
5
+ * and the host starts it once.
6
+ *
7
+ * Refused: a declared kind with no runner, and a runner whose `kind` is not the key it
8
+ * was given under, since a dump records the runner's kind and a restore checks it.
9
+ */
10
+ export function scopeStoreRunnersFor(declared, runners) {
11
+ for (const [kind, runner] of Object.entries(runners)) {
12
+ if (runner.kind !== kind) {
13
+ throw new Error(`the runner given for scope-store kind '${kind}' is kind '${runner.kind}'`);
14
+ }
15
+ }
16
+ return declared.map(({ binding, kind }) => {
17
+ const runner = Object.hasOwn(runners, kind) ? runners[kind] : undefined;
18
+ if (!runner) {
19
+ throw new Error(`scope store '${binding}' is declared as kind '${kind}', and no runner is given for it`);
20
+ }
21
+ return { binding, runner };
22
+ });
23
+ }
24
+ //# sourceMappingURL=scope-store-runners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-store-runners.js","sourceRoot":"","sources":["../src/scope-store-runners.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAAwE,EACxE,OAAmD;IAEnD,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACrD,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,0CAA0C,IAAI,cAAc,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;QAC9F,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACxE,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,gBAAgB,OAAO,0BAA0B,IAAI,kCAAkC,CAAC,CAAC;QAC3G,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrat-run/adapter-sqlite",
3
- "version": "0.146.0",
3
+ "version": "0.148.0",
4
4
  "description": "Pure-SQLite scope host — real kernel semantics with no Cloudflare dependency (D-14): local dev, CI, self-host/escrow",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -39,17 +39,17 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "better-sqlite3": "^13.0.3",
42
- "@substrat-run/contracts": "^0.146.0",
43
- "@substrat-run/kernel": "^0.146.0"
42
+ "@substrat-run/contracts": "^0.148.0",
43
+ "@substrat-run/kernel": "^0.148.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/better-sqlite3": "^9.6.0",
47
47
  "hono": "^4.13.13",
48
48
  "typescript": "^7.0.0",
49
49
  "vitest": "^5.0.3",
50
- "@substrat-run/attachment-extractors": "^0.2.7",
51
- "@substrat-run/vertical-auth": "^0.24.1",
52
- "@substrat-run/contract-tests": "^0.146.0"
50
+ "@substrat-run/attachment-extractors": "^0.2.9",
51
+ "@substrat-run/contract-tests": "^0.148.0",
52
+ "@substrat-run/vertical-auth": "^0.24.3"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"