@happyvertical/smrt-core 0.55.6 → 0.55.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/AGENTS.md +2 -1
- package/agents/browser-entry.md +44 -0
- package/agents/build-knowledge.md +20 -0
- package/agents/recipes.md +217 -0
- package/agents/revision-guard.md +72 -1
- package/dist/audit-context.d.ts.map +1 -1
- package/dist/audit-context.js +2 -2
- package/dist/audit-context.js.map +1 -1
- package/dist/browser.d.ts +2 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +7 -7
- package/dist/cascade.d.ts +1 -1
- package/dist/cascade.d.ts.map +1 -1
- package/dist/cascade.js +1 -1
- package/dist/cascade.js.map +1 -1
- package/dist/change-feed.d.ts.map +1 -1
- package/dist/change-feed.js +1 -2
- package/dist/change-feed.js.map +1 -1
- package/dist/class.d.ts +1 -1
- package/dist/class.d.ts.map +1 -1
- package/dist/class.js +7 -3
- package/dist/class.js.map +1 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +1 -1
- package/dist/collection.js.map +1 -1
- package/dist/consumer-plugin/index.js +2 -2
- package/dist/data-query.d.ts.map +1 -1
- package/dist/data-query.js +2 -13
- package/dist/data-query.js.map +1 -1
- package/dist/database.js +1 -1
- package/dist/database.js.map +1 -1
- package/dist/dispatch/bus.js +1 -1
- package/dist/dispatch/bus.js.map +1 -1
- package/dist/embedded-write-queue.d.ts +1 -1
- package/dist/embedded-write-queue.d.ts.map +1 -1
- package/dist/embedded-write-queue.js +7 -5
- package/dist/embedded-write-queue.js.map +1 -1
- package/dist/embeddings/hash.js +2 -2
- package/dist/embeddings/hash.js.map +1 -1
- package/dist/embeddings/storage.d.ts.map +1 -1
- package/dist/embeddings/storage.js +1 -2
- package/dist/embeddings/storage.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -0
- package/dist/errors.js.map +1 -1
- package/dist/generation-snapshot.js +1 -1
- package/dist/generators/index.js +1 -1
- package/dist/generators/mcp.js +3 -3
- package/dist/generators/preflight-route.js +1 -1
- package/dist/generators/rest.js +1 -1
- package/dist/generators.js +1 -1
- package/dist/host.browser.d.ts +12 -0
- package/dist/host.browser.d.ts.map +1 -0
- package/dist/host.browser.js +30 -0
- package/dist/host.browser.js.map +1 -0
- package/dist/host.d.ts +18 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +15 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/knowledge.d.ts.map +1 -1
- package/dist/knowledge.js +6 -4
- package/dist/knowledge.js.map +1 -1
- package/dist/manifest/browser-capability.generated.d.ts +14 -0
- package/dist/manifest/browser-capability.generated.d.ts.map +1 -0
- package/dist/manifest/browser-capability.generated.js +499 -0
- package/dist/manifest/browser-capability.generated.js.map +1 -0
- package/dist/manifest/discover-base-classes.js +1 -1
- package/dist/manifest/discover-smrt-packages.js +1 -1
- package/dist/manifest/generator.js +3 -3
- package/dist/manifest/index.js +2 -2
- package/dist/manifest/local-manifest-reader.d.ts +48 -0
- package/dist/manifest/local-manifest-reader.d.ts.map +1 -0
- package/dist/manifest/local-manifest-reader.js +81 -0
- package/dist/manifest/local-manifest-reader.js.map +1 -0
- package/dist/manifest/manager.d.ts +5 -28
- package/dist/manifest/manager.d.ts.map +1 -1
- package/dist/manifest/manager.js +10 -56
- package/dist/manifest/manager.js.map +1 -1
- package/dist/manifest/manifest-loader.d.ts +1 -1
- package/dist/manifest/manifest-loader.d.ts.map +1 -1
- package/dist/manifest/manifest-loader.js +43 -12
- package/dist/manifest/manifest-loader.js.map +1 -1
- package/dist/manifest/node-host.d.ts +38 -0
- package/dist/manifest/node-host.d.ts.map +1 -0
- package/dist/manifest/node-host.js +52 -0
- package/dist/manifest/node-host.js.map +1 -0
- package/dist/manifest/package-manifest-exports.js +1 -1
- package/dist/manifest/static-manifest.d.ts.map +1 -1
- package/dist/manifest/static-manifest.js +12 -2
- package/dist/manifest/static-manifest.js.map +1 -1
- package/dist/manifest/store.d.ts +2 -1
- package/dist/manifest/store.d.ts.map +1 -1
- package/dist/manifest/store.js +7 -4
- package/dist/manifest/store.js.map +1 -1
- package/dist/manifest.js +1 -1
- package/dist/manifest.json +14 -2
- package/dist/native-duckdb.d.ts +28 -0
- package/dist/native-duckdb.d.ts.map +1 -0
- package/dist/native-duckdb.js +51 -0
- package/dist/native-duckdb.js.map +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/_md.js +169 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/_md.js.map +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/_u64.js +13 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/_u64.js.map +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/sha2.js +198 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/sha2.js.map +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/utils.js +243 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/utils.js.map +1 -0
- package/dist/object.d.ts +56 -0
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +139 -16
- package/dist/object.js.map +1 -1
- package/dist/postgres-permissions.d.ts.map +1 -1
- package/dist/postgres-permissions.js +3 -3
- package/dist/postgres-permissions.js.map +1 -1
- package/dist/prebuild/index.js +1 -1
- package/dist/recipe-demo.d.ts +70 -0
- package/dist/recipe-demo.d.ts.map +1 -0
- package/dist/recipe-demo.js +130 -0
- package/dist/recipe-demo.js.map +1 -0
- package/dist/recipe.d.ts +64 -1
- package/dist/recipe.d.ts.map +1 -1
- package/dist/recipe.js +30 -0
- package/dist/recipe.js.map +1 -1
- package/dist/registry/class-registration.js +2 -2
- package/dist/registry/class-registration.js.map +1 -1
- package/dist/registry/db-cache-key.js +4 -5
- package/dist/registry/db-cache-key.js.map +1 -1
- package/dist/registry/inheritance-resolver.js +1 -1
- package/dist/registry/name-resolver.js +1 -1
- package/dist/registry/qualified-name-aliases.js +1 -1
- package/dist/registry/schema-builder.d.ts.map +1 -1
- package/dist/registry/schema-builder.js +3 -3
- package/dist/registry/schema-builder.js.map +1 -1
- package/dist/registry/types.d.ts +5 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +5 -8
- package/dist/registry.js.map +1 -1
- package/dist/revision-guard.js +1 -1
- package/dist/revision-guard.js.map +1 -1
- package/dist/scanner/manifest-generator.d.ts.map +1 -1
- package/dist/scanner/manifest-generator.js +19 -10
- package/dist/scanner/manifest-generator.js.map +1 -1
- package/dist/scanner/recipe-demo-pass.d.ts +14 -0
- package/dist/scanner/recipe-demo-pass.d.ts.map +1 -0
- package/dist/scanner/recipe-demo-pass.js +33 -0
- package/dist/scanner/recipe-demo-pass.js.map +1 -0
- package/dist/scanner/types.d.ts +9 -1
- package/dist/scanner/types.d.ts.map +1 -1
- package/dist/scanner/types.js.map +1 -1
- package/dist/schema/ddl/duckdb-strategy.d.ts.map +1 -1
- package/dist/schema/ddl/duckdb-strategy.js +1 -1
- package/dist/schema/ddl/duckdb-strategy.js.map +1 -1
- package/dist/schema/foreign-key-planner.d.ts.map +1 -1
- package/dist/schema/foreign-key-planner.js +1 -1
- package/dist/schema/foreign-key-planner.js.map +1 -1
- package/dist/schema/generator.d.ts.map +1 -1
- package/dist/schema/generator.js +10 -14
- package/dist/schema/generator.js.map +1 -1
- package/dist/schema/schema-aggregator.js +1 -1
- package/dist/scripts/browser-entry-evaluation.mjs +157 -0
- package/dist/smrt-knowledge.json +32 -12
- package/dist/system/browser.d.ts +16 -0
- package/dist/system/browser.d.ts.map +1 -0
- package/dist/system/browser.js +6 -0
- package/dist/system/index.d.ts +1 -6
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +2 -1
- package/dist/testing/database.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/unchanged-indexed.d.ts +85 -0
- package/dist/unchanged-indexed.d.ts.map +1 -0
- package/dist/unchanged-indexed.js +219 -0
- package/dist/unchanged-indexed.js.map +1 -0
- package/dist/utils/async-context.d.ts +22 -0
- package/dist/utils/async-context.d.ts.map +1 -0
- package/dist/utils/async-context.js +27 -0
- package/dist/utils/async-context.js.map +1 -0
- package/dist/utils/import-project-vite.js +1 -1
- package/dist/utils/import-workspace-module.js +1 -1
- package/dist/utils/json.browser.d.ts +18 -0
- package/dist/utils/json.browser.d.ts.map +1 -0
- package/dist/utils/json.browser.js +47 -0
- package/dist/utils/json.browser.js.map +1 -0
- package/dist/utils/sha256.d.ts +15 -0
- package/dist/utils/sha256.d.ts.map +1 -0
- package/dist/utils/sha256.js +29 -0
- package/dist/utils/sha256.js.map +1 -0
- package/dist/vite-plugin/changes-route.js +1 -1
- package/dist/vite-plugin/dev-plane-route.js +1 -1
- package/dist/vite-plugin/events-route.js +1 -1
- package/dist/vite-plugin/import-build-aware.js +1 -1
- package/dist/vite-plugin/index.js +2 -2
- package/dist/vite-plugin/resources-route.js +1 -1
- package/dist/vite-plugin/sveltekit-generator.js +2 -2
- package/dist/vite-plugin/sveltekit-path.js +1 -1
- package/dist/vite-plugin/sveltekit-register-injection.js +1 -1
- package/dist/vite-plugin/sveltekit-route-coordinator.js +1 -1
- package/dist/vite-plugin/sync-apply-route.js +1 -1
- package/dist/vite-plugin/web-collections.js +2 -2
- package/package.json +21 -11
package/AGENTS.md
CHANGED
|
@@ -9,7 +9,7 @@ and repository rules.
|
|
|
9
9
|
| Source | Scope | Module doc |
|
|
10
10
|
|---|---|---|
|
|
11
11
|
| `src/object.ts`, `src/collection.ts`, `src/child-accessors.ts` | Lifecycle, hydration, operators, STI, child accessors, dispatch | [agents/object-runtime.md](agents/object-runtime.md) |
|
|
12
|
-
| `src/revision-guard.ts` | Guarded writes
|
|
12
|
+
| `src/revision-guard.ts`, `src/unchanged-indexed.ts`, `src/native-duckdb.ts` | Guarded writes, PostgreSQL revision precision, unchanged indexed columns on referenced DuckDB rows (#3737) | [agents/revision-guard.md](agents/revision-guard.md) |
|
|
13
13
|
| `src/collection.ts` | Projections, latest-related, facets, counts, read plans | [agents/collection-reads.md](agents/collection-reads.md) |
|
|
14
14
|
| `src/collection.ts` | Limits, sort whitelist, generated list order | [agents/query-bounds.md](agents/query-bounds.md) |
|
|
15
15
|
| `src/data-query.ts` | Transport-neutral bounded query normalization | [agents/data-query.md](agents/data-query.md) |
|
|
@@ -27,6 +27,7 @@ and repository rules.
|
|
|
27
27
|
| `src/registry/qualified-name-aliases.ts`, `src/migrations/qualified-name-aliases.ts` | Model moves: `previousQualifiedNames` aliases, deprecation, doctor counts, opt-in backfill (#3338) | [agents/model-moves.md](agents/model-moves.md) |
|
|
28
28
|
| `src/run-once.ts` | Shared idempotency seam: insert-only claim + caller work in one transaction, replay on retry, typed in-flight/unknown-outcome answers (#3080) | [agents/run-once.md](agents/run-once.md) |
|
|
29
29
|
| `src/recipe.ts`, `../scanner/src/recipes.ts` | `SmrtRecipe`: declared user-facing units (models, nav, `requires`, curation `options`) collected into manifest and knowledge `recipes` (#3590) | [agents/recipes.md](agents/recipes.md) |
|
|
30
|
+
| `src/browser.ts`, `src/host.ts`, `src/host.browser.ts` | Browser entry that builds and evaluates without Node-only modules: host seam, `package.json#browser` swaps, `pnpm test:browser` (#2838) | [agents/browser-entry.md](agents/browser-entry.md) |
|
|
30
31
|
|
|
31
32
|
## Cross-module invariants
|
|
32
33
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Browser entry: no Node-only modules (#2838)
|
|
2
|
+
|
|
3
|
+
`src/browser.ts` is what `package.json#exports["."].browser` resolves to. Its
|
|
4
|
+
module graph must build for a browser **and evaluate** in one. Two guards hold
|
|
5
|
+
it:
|
|
6
|
+
|
|
7
|
+
- `packages/bundle-gate` builds it with Vite browser conditions and fails on
|
|
8
|
+
`node:` built-ins, `pg`, `cosmiconfig`, `jiti` and the rest of
|
|
9
|
+
`FORBIDDEN_NODE_ONLY_MODULES` (core is held to zero even while its ratchet
|
|
10
|
+
entry exists for another reason).
|
|
11
|
+
- `pnpm test:browser` bundles the built `dist/browser.js`, loads it in
|
|
12
|
+
Chromium, registers a decorated class, and fails on any evaluation error or
|
|
13
|
+
any module Vite externalized "for browser compatibility". Set
|
|
14
|
+
`PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH` to use another Chromium. CI runs it in
|
|
15
|
+
the workbench browser job.
|
|
16
|
+
|
|
17
|
+
## How a Node-only dependency stays out
|
|
18
|
+
|
|
19
|
+
Never import it statically from a module the browser graph reaches. Pick one:
|
|
20
|
+
|
|
21
|
+
| Need | Use |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `getDatabase`, `buildWhere`, `raw`, `NestedTransactionError`, the AI SDK, installed-package discovery | `src/host.ts`. `package.json#browser` maps `./dist/host.js` to `./dist/host.browser.js`; Node and every test resolve `host.ts`. |
|
|
24
|
+
| JSON parse/stringify | `src/utils/json.ts`; the browser build is `utils/json.browser.ts` (native `JSON`). |
|
|
25
|
+
| `node:fs`/`path`/`module` for manifest discovery | `src/manifest/node-host.ts`, which resolves them with `process.getBuiltinModule()`. No host answers "absent". |
|
|
26
|
+
| SHA-256 | `sha256Hex` (`src/utils/sha256.ts`, `@noble/hashes`). Not `node:crypto`. |
|
|
27
|
+
| Random ids | `globalThis.crypto.randomUUID()` / `getRandomValues()`. |
|
|
28
|
+
| Async-local state | `createAsyncContext()` (`src/utils/async-context.ts`). Check `propagatesAcrossAwait` before relying on the store. |
|
|
29
|
+
| A whole Node-only module (registry snapshot) | Keep it out of `system/browser.ts` and the browser entry. |
|
|
30
|
+
|
|
31
|
+
`browser.ts` and `host.browser.ts` are typed against their Node counterparts, so
|
|
32
|
+
the surfaces cannot drift. A new browser variant needs its source pair, an
|
|
33
|
+
`entries[...]` line in `vite.config.ts` (nothing imports it, so the build would
|
|
34
|
+
not emit it), and a `browser` mapping; `browser-field.test.ts` checks all three.
|
|
35
|
+
|
|
36
|
+
## Known limits
|
|
37
|
+
|
|
38
|
+
- The browser uses `getDatabase` from `@happyvertical/sql/pglite` and
|
|
39
|
+
`buildWhere`, `raw`, and `NestedTransactionError` from the browser-safe
|
|
40
|
+
`@happyvertical/sql/query` entry. It rejects non-PGlite engines.
|
|
41
|
+
- The AI SDK is unavailable in the browser build.
|
|
42
|
+
- The embedded write queue runs unqueued without async-local state; its only
|
|
43
|
+
browser database, PGlite, serializes statements itself.
|
|
44
|
+
- `smrt-config`'s browser loader resolves to `{}`; use `setConfig()`.
|
|
@@ -4,6 +4,13 @@ Key options: `tableName`, `tableStrategy` ('cti'|'sti'), `conflictColumns`, `ind
|
|
|
4
4
|
|
|
5
5
|
Registration sets `SMRT_TABLE_NAME` static property (survives minification).
|
|
6
6
|
|
|
7
|
+
An explicit `@smrt({ collection: 'domain.records' })` names the route/permission
|
|
8
|
+
namespace independently of `tableName`, including standalone non-STI models.
|
|
9
|
+
Scanner output preserves it in both `collection` and `decoratorConfig.collection`.
|
|
10
|
+
Generated registration reads the merged declaration, so older manifests with a
|
|
11
|
+
derived top-level collection still agree with native decorators. Explicit runtime
|
|
12
|
+
registration options win; absent declarations retain manifest/STI/default naming.
|
|
13
|
+
|
|
7
14
|
## @field() UI hints (#2046)
|
|
8
15
|
|
|
9
16
|
`@field({ ui: { basic, group, order, locked } })` — a static, presentation-only
|
|
@@ -216,3 +223,16 @@ checks the generated imports with `svelte-check`.
|
|
|
216
223
|
Core's `generate:test` task depends on its own `build`: both publish the local
|
|
217
224
|
`.smrt` manifest/knowledge pair, so Turbo must serialize production before test
|
|
218
225
|
generation instead of caching an interleaved pair.
|
|
226
|
+
|
|
227
|
+
## Model descriptions
|
|
228
|
+
|
|
229
|
+
Each manifest object and knowledge `objects[]` entry may carry a user-facing
|
|
230
|
+
`description` (for the planner Features tab and similar). The scanner
|
|
231
|
+
(`extractClassJsDocDescription` in `packages/scanner/src/oxc-parser.ts`) reads it
|
|
232
|
+
from the parsed source, in priority order: explicit `@smrt({ description })`,
|
|
233
|
+
else the first paragraph of the class JSDoc (the JSDoc may sit above `export`
|
|
234
|
+
and decorators), minus a leading `ClassName - ` / `ClassName: `, tags
|
|
235
|
+
(`{@link}`, backticks, HTML) and later paragraphs, capped at 200 chars on a
|
|
236
|
+
sentence boundary. `@internal` classes and classes without docs emit no key. It
|
|
237
|
+
is not inherited from a parent class. Generated MCP tool descriptions are
|
|
238
|
+
unchanged (they stay generic).
|
package/agents/recipes.md
CHANGED
|
@@ -31,6 +31,223 @@ spelled literally; `models` and `nav[].model` take identifiers. Write
|
|
|
31
31
|
`static options = { ... } as const` so `visibility` stays a literal type.
|
|
32
32
|
The emitted `options` are keyed by qualified model name.
|
|
33
33
|
|
|
34
|
+
## Host metadata: group, section, nav detail, alternatives (#3604)
|
|
35
|
+
|
|
36
|
+
Everything a catalog host (an app shell, an agent, a CLI) needs
|
|
37
|
+
to present a recipe lives on the recipe, so it reads the manifest or knowledge
|
|
38
|
+
artifact instead of importing runtime code. All are optional and additive:
|
|
39
|
+
|
|
40
|
+
| Static | Shape | Meaning |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| `group` | `{ id, label, summary? }` | Recipes with the same `group.id` share one card; the first declaration of an id supplies `label` and `summary`. Declaration order is the sub-switch order. |
|
|
43
|
+
| `section` | `{ id, label, icon?, description? }` | Navigation section the recipe suggests for its `nav` entries. The host owns sections and the user may rename them, so keep `id` stable; the same `id` shares a section. |
|
|
44
|
+
| `requiresAny` | `string[][]` | At least one id of each inner list must be on (`[['products.simple', 'products.clothing']]`); adding the recipe with none on adds the first. |
|
|
45
|
+
| `nav[].icon` / `description` | string | Shell icon name and one friendly line for a business owner. The icon must be a key of `SHELL_ICON_PATHS` (smrt-svelte `admin-shell/shell-icons.ts`, camelCase such as `fileText` or `shoppingBag`); the same holds for `section.icon`. `packages/scanner/src/__tests__/workspace-recipes.test.ts` fails on any other name. |
|
|
46
|
+
| `nav[].noun` | string | What "New" creates when the label is not countable ("Stock levels" -> `stock entry`). |
|
|
47
|
+
| `nav[].key` | slug | Fixed key for the layout id `item:<pkg>:<Model>:<key>`. Required for a second entry over the same model and for a `filter`. |
|
|
48
|
+
| `nav[].filter` | `{ field, value }` | Narrows the entry to rows where `field` equals `value` (Ingredients over Products: `productType` = `material`). Needs a `key`. |
|
|
49
|
+
| `options.<Model>.fields.<f>.required` | boolean | The form refuses to save without a value. |
|
|
50
|
+
|
|
51
|
+
Across recipes of one package the scanner also rejects a repeated nav `key`
|
|
52
|
+
over the same model (it names one layout id) and one `group`/`section` id with
|
|
53
|
+
two different labels. `packages/scanner/src/__tests__/workspace-recipes.test.ts`
|
|
54
|
+
scans every recipe in the workspace and checks ids, `requires`/`requiresAny`
|
|
55
|
+
targets (which a single package cannot see) and shared labels.
|
|
56
|
+
|
|
57
|
+
Child models (line items) are simply listed in `models` without a `nav` entry.
|
|
58
|
+
Validation: `group`/`section` take only their keys, slug ids, non-empty
|
|
59
|
+
strings; `requiresAny` ids follow the recipe-id format and cannot name the
|
|
60
|
+
recipe itself; each (model, key) pair appears once in `nav`; a `filter.field`
|
|
61
|
+
must be a field the model declares (checked in core on the merged manifest,
|
|
62
|
+
`assertRecipeOptions`).
|
|
63
|
+
|
|
64
|
+
Not part of the recipe declaration (still host-local): a host's
|
|
65
|
+
cross-package `forms` and `extends` (form records spanning profiles, variants
|
|
66
|
+
and SKUs).
|
|
67
|
+
|
|
68
|
+
User-facing field text for the recipes comes from `@field({ description })` on
|
|
69
|
+
the models (the glossary seed), so a package that declares a recipe carries the
|
|
70
|
+
descriptions of every field the recipe shows. A field the package does not
|
|
71
|
+
declare itself (`parentId` from `SmrtHierarchical`) is described by the recipe's
|
|
72
|
+
`options.<Model>.fields.<f>.help`, which wins over the description in the
|
|
73
|
+
glossary. Write all of it in plain words: no API, JSON, REST, MCP, SQL or UUID
|
|
74
|
+
outside help that is about connecting other tools.
|
|
75
|
+
|
|
76
|
+
## Non-model surfaces, providers, runtime, demo seed (#3708)
|
|
77
|
+
|
|
78
|
+
Many features are not a list of models: a shell widget (assistant dock,
|
|
79
|
+
notification bell), a component, a route, a settings panel. All four statics are
|
|
80
|
+
optional and additive; a recipe that declares none emits none of the keys. They
|
|
81
|
+
are emitted on the recipe entry in `manifest.json` and `smrt-knowledge.json`.
|
|
82
|
+
Components are named by `'<package specifier>#<ExportName>'` and never imported
|
|
83
|
+
at scan time; a host resolves them. Relative or absolute specifiers are rejected.
|
|
84
|
+
|
|
85
|
+
| Static | Shape | Meaning |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `surfaces` | `RecipeSurface[]` | `{ kind: 'shell-widget', slot, export, label, icon? }`, `{ kind: 'route', path, export, label }`, `{ kind: 'settings-panel', export, label }`, `{ kind: 'playground', export, label? }`, `{ kind: 'widget', type, export, label, ... }` (see below). `slot` is a smrt-svelte `ShellSlot`; `path` starts with `/` and has no whitespace, `?`, `#` or `..`. |
|
|
88
|
+
| `providers` | `RecipeProvider[]` | `{ id, kind, options, required, secrets?, browserOptions? }`: lowercase slugs, `options` non-empty and distinct, `required` always written, `secrets` distinct `UPPER_SNAKE` names (never values), `browserOptions` a non-empty subset of `options` that run in a browser with none of the secrets (#3709). Ids are unique per recipe. |
|
|
89
|
+
| `runtime` | `'browser' \| 'server' \| 'both'` | Where the recipe's runtime pieces can run. Omitted means `both`; the value is emitted as authored. The build refines it into `demo` (below). |
|
|
90
|
+
| `demoSeed` | `{ export } \| { data }` | A fixture export reference, or inline JSON of at most 8 KB, for demo hosts. Exactly one key. |
|
|
91
|
+
|
|
92
|
+
Write `surfaces` with `as const` (like `options`) so `kind` and `slot` stay
|
|
93
|
+
literal types. The slot union is `RecipeShellSlot` in smrt-types (types only) and the
|
|
94
|
+
scanner's `RECIPE_SHELL_SLOTS` list copies smrt-svelte's `SHELL_SLOTS`; a
|
|
95
|
+
type-level test in smrt-svelte and a scanner test keep them equal, so there is
|
|
96
|
+
no runtime dependency on smrt-svelte. Inline `demoSeed.data` must be finite JSON. Every violation (unknown
|
|
97
|
+
kind or slot, extra key, duplicate route path or provider id, malformed
|
|
98
|
+
reference) is a scan error. Example: `events.calendar` in
|
|
99
|
+
`packages/events/src/recipes.ts`.
|
|
100
|
+
|
|
101
|
+
## Widget surfaces (#3727)
|
|
102
|
+
|
|
103
|
+
`{ kind: 'widget', ... }` contributes a widget to customizable overviews
|
|
104
|
+
(smrt-svelte `./overview`). The manifest carries everything a host needs to
|
|
105
|
+
register it; the helper `registerRecipeWidgets` in smrt-svelte does that with an
|
|
106
|
+
injected module resolver, so nothing is imported at scan time.
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
static surfaces = [
|
|
110
|
+
{
|
|
111
|
+
kind: 'widget',
|
|
112
|
+
type: 'sales-total', // registry type, unique per package
|
|
113
|
+
export: '@acme/shop/svelte#SalesTotal', // the component
|
|
114
|
+
label: 'Sales total', // text or an i18n key
|
|
115
|
+
description: 'Order totals for the period.',
|
|
116
|
+
icon: 'chart',
|
|
117
|
+
version: 2, // option-schema version (default 1)
|
|
118
|
+
migrate: '@acme/shop/server#migrateSalesTotal', // needs version above 1
|
|
119
|
+
options: [
|
|
120
|
+
{ key: 'model', type: 'model', label: 'Model', required: true },
|
|
121
|
+
{ key: 'style', type: 'enum', label: 'Style', default: 'bar',
|
|
122
|
+
choices: [{ value: 'bar', label: 'Bar' }, { value: 'line', label: 'Line' }] },
|
|
123
|
+
],
|
|
124
|
+
data: { load: '@acme/shop/server#loadSalesTotal', models: ['@acme/shop:Order'] },
|
|
125
|
+
allowedIn: ['shop.home'], // overview ids; omit for any
|
|
126
|
+
defaultSpan: 2, minSpan: 1, maxSpan: 3,
|
|
127
|
+
},
|
|
128
|
+
] as const;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Emitted keys, in this order: `kind`, `type`, `export`, `label`, `description`,
|
|
132
|
+
`icon`, `version`, `migrate`, `options`, `data`, `allowedIn`, `defaultSpan`,
|
|
133
|
+
`minSpan`, `maxSpan`; absent ones are omitted. Rules (each violation is a scan
|
|
134
|
+
error, same strictness as the other kinds):
|
|
135
|
+
|
|
136
|
+
- `type` is a lowercase kebab id (`[a-z][a-z0-9-]{0,31}`), unique among a
|
|
137
|
+
recipe's surfaces and across the package's recipes. `export`, `data.load` and
|
|
138
|
+
`migrate` are `'<package specifier>#<ExportName>'`; relative specifiers are
|
|
139
|
+
rejected. `label` is required.
|
|
140
|
+
- `options` is a non-empty list of plain-JSON fields limited to the overview
|
|
141
|
+
option types: `text`, `markdown`, `identifier`, `model`, `integer`, `number`,
|
|
142
|
+
`boolean`, closed `enum` (non-empty distinct `choices`). There is no free-form
|
|
143
|
+
query, expression, URL or SQL type. Keys are camelCase (`[A-Za-z][A-Za-z0-9]{0,31}`)
|
|
144
|
+
and unique; `default` must pass its field's own rule; `min`/`max` only on
|
|
145
|
+
numbers, `maxLength` only on text. Only `key`, `type`, `label`, `help`,
|
|
146
|
+
`required`, `default`, `min`, `max`, `maxLength`, `choices` are accepted.
|
|
147
|
+
- `data` takes `load` and/or `models` (qualified class names, distinct). The
|
|
148
|
+
scanner cannot see other packages, so a model is checked for format only.
|
|
149
|
+
- `allowedIn` is a non-empty list of distinct overview ids
|
|
150
|
+
(`[A-Za-z0-9][A-Za-z0-9_.:-]{0,95}`); spans are integers 1 to 4 with
|
|
151
|
+
`minSpan <= defaultSpan <= maxSpan`.
|
|
152
|
+
|
|
153
|
+
The scanner's copies of these rules live in `packages/scanner/src/recipe-widgets.ts`
|
|
154
|
+
and a scanner test compares them to the smrt-svelte source. See
|
|
155
|
+
[overview-surfaces.md](../../smrt-svelte/agents/overview-surfaces.md#recipe-widgets-recipe-widgetsts)
|
|
156
|
+
for how a host registers them.
|
|
157
|
+
|
|
158
|
+
## Browser-demo mode: Live, Mock, Sample, Server (#3709)
|
|
159
|
+
|
|
160
|
+
A catalog host (smrt-planner) labels each feature by how far it runs in a
|
|
161
|
+
browser-only demo. The label is **derived at build time**, never authored: the
|
|
162
|
+
manifest build combines what the bundle-gate measured for the recipe's package
|
|
163
|
+
with the recipe's own `runtime`, `providers` and `demoSeed`, and emits it as
|
|
164
|
+
`demo` on the recipe entry and `browser` on the package. A recipe that declares
|
|
165
|
+
none of those keeps its shape except for `demo`, which every recipe of a
|
|
166
|
+
measured package gets.
|
|
167
|
+
|
|
168
|
+
```jsonc
|
|
169
|
+
// manifest.json and smrt-knowledge.json, top level
|
|
170
|
+
"browser": {
|
|
171
|
+
"status": "browser-safe" | "server-only",
|
|
172
|
+
"issues": ["#3624"], // tracking issues; omitted when browser-safe
|
|
173
|
+
"reason": "node:crypto", // the package's own blocker; omitted when only inherited
|
|
174
|
+
"via": ["@happyvertical/smrt-tenancy"] // inherited from these; omitted when none
|
|
175
|
+
}
|
|
176
|
+
// on each entry of "recipes"
|
|
177
|
+
"demo": {
|
|
178
|
+
"mode": "live" | "mock" | "sample" | "server",
|
|
179
|
+
"reasons": ["Needs a server because ..."], // plain sentences, in rule order
|
|
180
|
+
"mocked": ["smtp"] // providers a demo fakes; omitted when none
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
| Mode | Meaning |
|
|
185
|
+
| --- | --- |
|
|
186
|
+
| `live` | Real browser data layer (PGlite); nothing faked. |
|
|
187
|
+
| `mock` | Runs in the browser, but a provider (sending mail, OAuth) is faked. |
|
|
188
|
+
| `sample` | Runs in the browser on `demoSeed` fixtures only. |
|
|
189
|
+
| `server` | Needs a server; a browser-only host cannot offer it. |
|
|
190
|
+
|
|
191
|
+
**Package capability.** The browser gate (`packages/bundle-gate`) fails any
|
|
192
|
+
model package that is not in its expected-failures list and does not build for
|
|
193
|
+
a browser, and any listed package that now builds. So a package is `server-only`
|
|
194
|
+
exactly when it is listed. The ratchet attributes a defect to the package that
|
|
195
|
+
owns the fix, so a dependent passes while still dragging the failure into a
|
|
196
|
+
browser bundle; the derivation therefore also marks a package `server-only`
|
|
197
|
+
when a workspace package it depends on (transitively, through `dependencies`)
|
|
198
|
+
is, and records them in `via`. `smrt-core` is the platform baseline and does not
|
|
199
|
+
propagate. The table lives in `src/manifest/browser-capability.generated.ts`
|
|
200
|
+
(generated, never edited) and a bundle-gate spec fails when it is stale; see
|
|
201
|
+
that package's AGENTS.md for the regenerate command. A package the gate does
|
|
202
|
+
not measure (an app's own, a UI package) emits no `browser`, and its recipes get
|
|
203
|
+
a `demo` only when they declare `runtime`, `providers` or `demoSeed`.
|
|
204
|
+
|
|
205
|
+
**Rules** (`src/recipe-demo.ts`, pure and browser-safe; the worst mode wins,
|
|
206
|
+
`live` < `mock` < `sample` < `server`):
|
|
207
|
+
|
|
208
|
+
1. `runtime: 'server'` is `server`. `runtime: 'both'` or omitted makes no claim:
|
|
209
|
+
the package capability refines it, so `both` on a `server-only` package is
|
|
210
|
+
`server`.
|
|
211
|
+
2. A `server-only` package is `server`.
|
|
212
|
+
3. A **server provider** is one that lists `secrets` (credentials a browser
|
|
213
|
+
cannot hold). One with a `browserOptions` entry (an in-browser model such as
|
|
214
|
+
`webllm`) is satisfied in a browser and changes nothing. Otherwise it is
|
|
215
|
+
**mockable** when its `options` include `mock`. A *required* server provider
|
|
216
|
+
that is neither is `sample` when the recipe has a `demoSeed` (the fixtures
|
|
217
|
+
stand in for what the provider would feed), else `server`. An optional one
|
|
218
|
+
that is neither leaves the mode alone and adds a reason.
|
|
219
|
+
4. Any mockable server provider makes the recipe `mock` and lands in `mocked`.
|
|
220
|
+
5. Otherwise `live`.
|
|
221
|
+
|
|
222
|
+
**Contradictions fail the build** (like `assertRecipeOptions`), naming the
|
|
223
|
+
recipe: `runtime: 'browser'` on a `server-only` package, or beside a required
|
|
224
|
+
server provider with no in-browser and no `mock` option. Fix by giving the
|
|
225
|
+
provider a `browserOptions` entry or a `mock` option, making it optional, or
|
|
226
|
+
declaring `both`/`server`. An explicit `both` or
|
|
227
|
+
`server` on a `server-only` package is not a contradiction.
|
|
228
|
+
|
|
229
|
+
**Dependencies between recipes.** `demo` is the recipe's own answer. A host that
|
|
230
|
+
wants the answer including what the recipe needs calls
|
|
231
|
+
`effectiveRecipeDemo(id, recipes)` (exported from both core entries): the worst
|
|
232
|
+
of its own mode and every `requires` (transitively), counting the best known
|
|
233
|
+
alternative of each `requiresAny` list; unknown ids are ignored.
|
|
234
|
+
|
|
235
|
+
**Importing it in a browser page.** Use the subpath
|
|
236
|
+
`@happyvertical/smrt-core/recipe-demo` (`deriveRecipeDemo`,
|
|
237
|
+
`effectiveRecipeDemo`, `RECIPE_DEMO_MODES` and the demo types). Its module graph
|
|
238
|
+
is `src/recipe-demo.ts` alone, with type-only imports, so it carries no `node:`
|
|
239
|
+
import. The root entry and `/browser` both also export these names, but both
|
|
240
|
+
reach `manifest/manifest-loader.ts` through the registry, and that module calls
|
|
241
|
+
`createRequire` from `node:module` as it loads, which a browser page cannot
|
|
242
|
+
satisfy. `src/__tests__/recipe-demo-entry.test.ts` walks the module graph and
|
|
243
|
+
fails if the subpath gains a `node:` or package import.
|
|
244
|
+
|
|
245
|
+
The classification runs in `ManifestGenerator.applyGenerationPasses` (the one
|
|
246
|
+
pass sequence the Vite plugin, `ManifestBuilder` and `generateManifest()` share)
|
|
247
|
+
through `applyRecipeDemo` in `src/scanner/recipe-demo-pass.ts`, after the
|
|
248
|
+
merged-manifest recipe assertions. It needs the package name, so it cannot run
|
|
249
|
+
in the scanner, which resolves recipes before it knows the package.
|
|
250
|
+
|
|
34
251
|
## How the scanner collects it
|
|
35
252
|
|
|
36
253
|
The scanner class pass finds classes by decorator, which a recipe lacks, so
|
package/agents/revision-guard.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Revision compare-and-swap guard (`src/revision-guard.ts`)
|
|
1
|
+
# Revision compare-and-swap guard (`src/revision-guard.ts`, `src/unchanged-indexed.ts`)
|
|
2
2
|
|
|
3
3
|
Every persisted `save()` pins its `UPDATE` to the revision the writer loaded;
|
|
4
4
|
`claimRevision()` does the same without running domain hooks, and
|
|
@@ -64,3 +64,74 @@ runs the whole battery — guarded save, `save({ expectedUpdatedAt })`,
|
|
|
64
64
|
against both `updated_at` column shapes in the registered PostgreSQL suite (`pnpm --filter @happyvertical/smrt-core
|
|
65
65
|
test:postgres`). `src/__tests__/revision-guard.test.ts` covers the rendering
|
|
66
66
|
itself in the default suite.
|
|
67
|
+
|
|
68
|
+
## Unchanged indexed columns on referenced DuckDB rows (#3737)
|
|
69
|
+
|
|
70
|
+
Native DuckDB rewrites a row (delete + insert) when an *indexed* column is
|
|
71
|
+
assigned, even to its current value, and a foreign key that still references
|
|
72
|
+
the row then rejects the statement. `save()` serializes the whole model, so
|
|
73
|
+
toggling one plain field of a referenced parent used to assign `slug`,
|
|
74
|
+
`context`, `tenant_id` and `created_at` unchanged and fail. Unchanged indexed
|
|
75
|
+
columns are therefore left out of the write:
|
|
76
|
+
|
|
77
|
+
- **Where.** Only POSITIVELY native DuckDB (`isPositivelyNativeDuckDb()`: not the
|
|
78
|
+
JSON adapter, which shares the DuckDB client and dialect but persists to
|
|
79
|
+
`<table>.json` only from its own insert/update/upsert/delete, so a raw write
|
|
80
|
+
would be lost on the next process). Identification (`src/native-duckdb.ts`)
|
|
81
|
+
is deterministic: a root is native by structure (`getTableSchema`, no
|
|
82
|
+
JSON-only capability, or an explicit `duckdb` hint), and a transaction
|
|
83
|
+
handle, which carries only the root's `client`, is recognized through the
|
|
84
|
+
root core noted before binding it (`initialize()`, `withDatabase()`,
|
|
85
|
+
`withEmbeddedWriteTransaction()`). A transaction handle of a root core never
|
|
86
|
+
saw stays unidentified and keeps the adapter `upsert`. It applies to the three
|
|
87
|
+
existing-row writers only: the embedded revision write in `save()`
|
|
88
|
+
(`writeEmbeddedRevisionRow`), a new object's natural-key save that adopts an
|
|
89
|
+
existing row (`writeNaturalKeyUpsert`), and `claimRevision()`, which assigns
|
|
90
|
+
only `updated_at`. SQLite and PostgreSQL keep writing exactly what they
|
|
91
|
+
wrote, because they handle an unchanged key harmlessly.
|
|
92
|
+
- **Which columns.** `collectIndexedColumns()`: primary key, `unique`, foreign
|
|
93
|
+
keys, every declared index column (partial and JSON-path included), plus the
|
|
94
|
+
runtime keys `slug`, `context`, `tenant_id`, the conflict columns and the
|
|
95
|
+
ownership columns, for the class and its STI base. Over-inclusive is
|
|
96
|
+
harmless: a column is only skipped when it is also *proven* unchanged. An
|
|
97
|
+
index created outside the registry schema (a hand-written migration) is not
|
|
98
|
+
known and keeps being assigned.
|
|
99
|
+
- **Proof of "unchanged".** The stored row is read under the embedded write
|
|
100
|
+
queue after its `updated_at` matched the loaded revision (or, for an adopted
|
|
101
|
+
row, as read for the owner check), through `getCanonicalPersistedRow()` so
|
|
102
|
+
native UUIDs are text. `storedValueEquals()` then compares by column type:
|
|
103
|
+
text exactly, UUIDs case-insensitively, timestamps as instants (a string
|
|
104
|
+
must carry its zone), JSON structurally, booleans and numbers by value;
|
|
105
|
+
`null`/`undefined` match each other, never `''`. Binary values, unzoned
|
|
106
|
+
timestamp strings and anything of a different type are *not* equal. An
|
|
107
|
+
indexed timestamp is proven against the stored value read as text
|
|
108
|
+
(`CAST(col AS VARCHAR)`), at microsecond precision: a hydrated `Date` has
|
|
109
|
+
already lost sub-millisecond digits, so `.678901` stored versus `.678`
|
|
110
|
+
requested is a change and is written. JSON text is only proven when every
|
|
111
|
+
number literal outside its strings round-trips through a double exactly
|
|
112
|
+
(`jsonNumbersRoundTrip()`): `9007199254740993` and `9007199254740992` parse
|
|
113
|
+
to the same double, so text holding an unsafe integer, more digits than a
|
|
114
|
+
double holds, or a non-canonical form such as `1.0`/`1e2` is unprovable and
|
|
115
|
+
assigned. A `bigint` and a `number` compare exactly (`==`), never through a
|
|
116
|
+
double. Any doubt means "assign it as before". `id` and `updated_at` are always written.
|
|
117
|
+
- **How.** The adapter's `upsert` cannot restrict its `DO UPDATE SET`, and its
|
|
118
|
+
generic `update()` neither quotes column names (a column named `order` is a
|
|
119
|
+
syntax error) nor binds dates and structures. So the remaining columns go
|
|
120
|
+
through one id-targeted `UPDATE` that core renders itself
|
|
121
|
+
(`buildDuckDbIdUpdate`): every identifier quoted, values bound as the DuckDB
|
|
122
|
+
`upsert` binds them (`NULL` literals, `''` as `CAST(? AS TEXT)`, ISO dates,
|
|
123
|
+
`CAST(? AS JSON)` text). The revision was already verified in-process, so the
|
|
124
|
+
statement carries no revision predicate. Its affected-row count must be
|
|
125
|
+
reported by the driver; an absent or non-numeric count raises
|
|
126
|
+
`RUNTIME_INVALID_STATE` (never retried) instead of reading as success. When nothing is provably unchanged
|
|
127
|
+
the plain `upsert` runs as before.
|
|
128
|
+
- **A changed indexed column is still assigned** and DuckDB still refuses it
|
|
129
|
+
for a referenced parent (a real key change). Tenant isolation is untouched:
|
|
130
|
+
`beforeSave` interceptors and the natural-key owner check run before the
|
|
131
|
+
write, and a differing `tenant_id` is never "unchanged".
|
|
132
|
+
|
|
133
|
+
Coverage: `src/__tests__/unchanged-indexed.test.ts` (the pure decisions),
|
|
134
|
+
`src/__tests__/issue-3737-unchanged-indexed.optional.test.ts` (SQLite, DuckDB
|
|
135
|
+
and, with `SMRT_TEST_POSTGRES_URL`, PostgreSQL against a real referencing
|
|
136
|
+
child), and `packages/tenancy/src/__tests__/issue-3737-referenced-parent-duckdb.test.ts`
|
|
137
|
+
(the real tenant stack).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-context.d.ts","sourceRoot":"","sources":["../src/audit-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"audit-context.d.ts","sourceRoot":"","sources":["../src/audit-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAezD,kFAAkF;AAClF,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,MAAM,CAAC,GACjB,CAAC,CAEH"}
|
package/dist/audit-context.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAsyncContext } from "./utils/async-context.js";
|
|
2
2
|
//#region src/audit-context.ts
|
|
3
3
|
var STORAGE = Symbol.for("smrt.audit.storage");
|
|
4
4
|
var CONTEXT = Symbol.for("smrt.audit.context");
|
|
5
5
|
var shared = globalThis;
|
|
6
|
-
if (!shared[STORAGE]) shared[STORAGE] =
|
|
6
|
+
if (!shared[STORAGE]) shared[STORAGE] = createAsyncContext();
|
|
7
7
|
var storage = shared[STORAGE];
|
|
8
8
|
shared[CONTEXT] = () => storage.getStore();
|
|
9
9
|
/** Bind trusted identity/sink to this async request, including generated CRUD. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-context.js","names":[],"sources":["../src/audit-context.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"audit-context.js","names":[],"sources":["../src/audit-context.ts"],"sourcesContent":["import type { CollectionAuditOptions } from './audit.js';\nimport {\n type AsyncContext,\n createAsyncContext,\n} from './utils/async-context.js';\n\nconst STORAGE = Symbol.for('smrt.audit.storage');\nconst CONTEXT = Symbol.for('smrt.audit.context');\nconst shared = globalThis as unknown as Record<symbol, unknown>;\nif (!shared[STORAGE]) {\n shared[STORAGE] = createAsyncContext<CollectionAuditOptions>();\n}\nconst storage = shared[STORAGE] as AsyncContext<CollectionAuditOptions>;\nshared[CONTEXT] = () => storage.getStore();\n\n/** Bind trusted identity/sink to this async request, including generated CRUD. */\nexport function withAuditContext<T>(\n options: CollectionAuditOptions,\n operation: () => T,\n): T {\n return storage.run(Object.freeze({ ...options }), operation);\n}\n"],"mappings":";;AAMA,IAAM,UAAU,OAAO,IAAI,oBAAoB;AAC/C,IAAM,UAAU,OAAO,IAAI,oBAAoB;AAC/C,IAAM,SAAS;AACf,IAAI,CAAC,OAAO,UACV,OAAO,WAAW,mBAA2C;AAE/D,IAAM,UAAU,OAAO;AACvB,OAAO,iBAAiB,QAAQ,SAAS;;AAGzC,SAAgB,iBACd,SACA,WACG;CACH,OAAO,QAAQ,IAAI,OAAO,OAAO,EAAE,GAAG,QAAQ,CAAC,GAAG,SAAS;AAC7D"}
|
package/dist/browser.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ export { applyPostgresPermissions, type PostgresPermissionContract, type Postgre
|
|
|
77
77
|
export { applyPostgresRuntimeTimeouts, DEFAULT_POSTGRES_TIMEOUTS, POSTGRES_TIMEOUT_ENV_VARS, type PostgresTimeoutConfig, type ResolvedPostgresTimeouts, resolvePostgresTimeouts, } from "./postgres-timeouts.js";
|
|
78
78
|
export { buildDefaultListOrderBy, DEFAULT_LIST_LIMIT, DEFAULT_LIST_ORDER_BY, type ListBoundOptions, MAX_LIST_LIMIT, QueryBoundsError, QueryOrderByError, resolveListLimit, resolveListOffset, } from "./query-bounds.js";
|
|
79
79
|
export { SmrtRecipe, type SmrtRecipeModel, type SmrtRecipeModelOptions, type SmrtRecipeNavEntry, } from "./recipe.js";
|
|
80
|
+
export { deriveRecipeDemo, effectiveRecipeDemo, hasBrowserOption, isMockableProvider, isServerProvider, MOCK_PROVIDER_OPTION, type PackageBrowserCapability, RECIPE_DEMO_MODES, type RecipeDemo, type RecipeDemoDerivation, type RecipeDemoMode, } from "./recipe-demo.js";
|
|
80
81
|
export { buildConnectSection, buildGlossary, type ConnectSection, type ConnectSurface, createRecipeHelp, extractFieldRefs, findField, type GlossaryEntry, type HelpBlock, type HelpField, type HelpModel, helpToMarkdown, type Inline, parseHelp, type RecipeHelp, type RenderedHelp, type RenderHelpOptions, renderHelp, resolveHelp, validateHelp, } from "./recipe-help.js";
|
|
81
82
|
export * from "./registry.js";
|
|
82
83
|
export { smrt as smrtRegistry } from "./registry.js";
|
|
@@ -91,7 +92,7 @@ export { getSystemTableShapes, SYSTEM_TABLE_NAMES, type SystemTableShape, } from
|
|
|
91
92
|
export type { SchemaDefinition } from "./schema/types.js";
|
|
92
93
|
export * from "./signals/index.js";
|
|
93
94
|
export * from "./sync/apply.js";
|
|
94
|
-
export * from "./system/
|
|
95
|
+
export * from "./system/browser.js";
|
|
95
96
|
export type { DiscoveryStrategy, ForgetOptions, ForgetScopeOptions, NoteMetadata, NoteOptions, RecallAllOptions, RecallOptions, SystemTableConfig, } from "./system/types.js";
|
|
96
97
|
export { resetVerifiedTables } from "./table-cache.js";
|
|
97
98
|
export * from "./tools/index.js";
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,cAAc,qBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EACL,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,cAAc,EACnB,gBAAgB,GACjB,MAAM,cAAW,CAAC;AAGnB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,4BAA4B,EAC5B,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,eAAe,EACf,eAAe,EACf,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,kBAAe,CAAC;AAIvB,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,gCAAgC,EACrC,KAAK,mCAAmC,EACxC,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,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wBAAwB,GACzB,MAAM,yBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,EACL,cAAc,EACd,OAAO,EACP,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,EACL,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,SAAS,EACT,aAAa,EACb,SAAS,GACV,MAAM,iBAAc,CAAC;AAGtB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAgB,CAAC;AAE7C,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,2BAA2B,EAC3B,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,MAAM,EACN,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,4BAAyB,CAAC;AAQjC,cAAc,kBAAkB,CAAC"}
|
package/dist/browser.js
CHANGED
|
@@ -39,10 +39,6 @@ import { DEFAULT_FACET_LIMIT, EmbeddingUnavailableError, MAX_FACET_FIELDS, MAX_F
|
|
|
39
39
|
import { applyPendingDecoratorRegistrations, registerCompatibleFieldDecorator, registerCompatibleMethodDecorator } from "./decorators/compatibility.js";
|
|
40
40
|
import { clone, getAdapterInfo, isValid, parse, safeParse, safeStringify, stringify } from "./utils/json.js";
|
|
41
41
|
import { assertScopedPackageName, createQualifiedName, getClassName, getPackageFromQualifiedName, isFromPackage, isQualifiedName, isScopedPackageName, isType, parseQualifiedName, qualifiedNamesEqual } from "./utils/qualified-names.js";
|
|
42
|
-
import { convertTypeToJsonSchema, generateToolFromMethod, generateToolManifest, shouldIncludeMethod } from "./tools/tool-generator.js";
|
|
43
|
-
import { CRUD_OPERATIONS, SMRT_CUSTOM_ACTION_ERROR_METADATA_KEY, buildCustomActionInputSchema, buildCustomActionInvocationArgs, classifyMethodWireability, classifyParameterWireability, coerceCustomActionArgument, createClassNamePredicate, createManifestClassNamePredicate, customActionParameterInputName, declaredTypeAcceptsDate, declaresRuntimeRestRoute, declaresRuntimeRestRouteShape, isCrudOperation, isCrudToolAction, normalizeCustomActionFailure, queryStringDecoderFor, readMethodDecoratorConfig, resolveApiMethodExposure, resolveCustomActionMetadata, resolveDeclaredScopeMismatch, resolveEffectiveActionMetadata, toCustomActionBoolean, toCustomActionDate, toCustomActionNumber } from "./generators/custom-action.js";
|
|
44
|
-
import { buildConnectSection, buildGlossary, createRecipeHelp, extractFieldRefs, findField, helpToMarkdown, parseHelp, renderHelp, resolveHelp, validateHelp } from "./recipe-help.js";
|
|
45
|
-
import { DEFAULT_DISPLAY_LABEL_FIELDS, FIELD_UI_WIDGETS, FIELD_UI_WIDGET_TYPES, describeDisplayLabel, displayLabelFieldProblem, findSelectorFor, isFieldUIWidget, resolveDisplayLabelField } from "./ui-metadata.js";
|
|
46
42
|
import { ContentHasher } from "./embeddings/hash.js";
|
|
47
43
|
import { POSTGRES_REVISION_GUARD_EXPRESSION, postgresRevisionCandidates, postgresRevisionCondition } from "./revision-guard.js";
|
|
48
44
|
import { executeToolCall, executeToolCalls, formatToolResults, validateToolCall } from "./tools/tool-executor.js";
|
|
@@ -65,6 +61,9 @@ import { DispatchBus, createDispatchBus } from "./dispatch/bus.js";
|
|
|
65
61
|
import "./dispatch/index.js";
|
|
66
62
|
import "./embeddings/index.js";
|
|
67
63
|
import { createGeneratedCollectionAccess } from "./generated-collection-access.js";
|
|
64
|
+
import { convertTypeToJsonSchema, generateToolFromMethod, generateToolManifest, shouldIncludeMethod } from "./tools/tool-generator.js";
|
|
65
|
+
import { CRUD_OPERATIONS, SMRT_CUSTOM_ACTION_ERROR_METADATA_KEY, buildCustomActionInputSchema, buildCustomActionInvocationArgs, classifyMethodWireability, classifyParameterWireability, coerceCustomActionArgument, createClassNamePredicate, createManifestClassNamePredicate, customActionParameterInputName, declaredTypeAcceptsDate, declaresRuntimeRestRoute, declaresRuntimeRestRouteShape, isCrudOperation, isCrudToolAction, normalizeCustomActionFailure, queryStringDecoderFor, readMethodDecoratorConfig, resolveApiMethodExposure, resolveCustomActionMetadata, resolveDeclaredScopeMismatch, resolveEffectiveActionMetadata, toCustomActionBoolean, toCustomActionDate, toCustomActionNumber } from "./generators/custom-action.js";
|
|
66
|
+
import { DEFAULT_DISPLAY_LABEL_FIELDS, FIELD_UI_WIDGETS, FIELD_UI_WIDGET_TYPES, describeDisplayLabel, displayLabelFieldProblem, findSelectorFor, isFieldUIWidget, resolveDisplayLabelField } from "./ui-metadata.js";
|
|
68
67
|
import { runWithTenantGate, setTenantEntryPointRunner } from "./generators/tenant-gate.js";
|
|
69
68
|
import { MAX_SYNC_APPLY_BATCH_SIZE, SYNC_APPLY_ROUTE_SEGMENTS, SYNC_APPLY_UUID_PATTERN, applySyncWritablePolicy, isStaleWrite, parseSyncApplyBatch, payloadMatchesRow, processSyncApplyBatch, validateSyncApplyItem } from "./sync/apply.js";
|
|
70
69
|
import { normalizeTypedHttpError } from "./generators/typed-http-error.js";
|
|
@@ -72,6 +71,8 @@ import { SmrtHierarchical } from "./hierarchical.js";
|
|
|
72
71
|
import { SmrtJunction, SmrtJunctionBase } from "./junction.js";
|
|
73
72
|
import { getClassConfigResolvers, getConfigResolver, isLazyConfigSentinel, listConfigResolvers, registerConfigResolver, resetConfigResolvers, resolveLazyConfig, unregisterConfigResolver } from "./lazy-config.js";
|
|
74
73
|
import { DEFAULT_LEARNING_CONFIG, LearningMemory } from "./learning/memory.js";
|
|
74
|
+
import { buildConnectSection, buildGlossary, createRecipeHelp, extractFieldRefs, findField, helpToMarkdown, parseHelp, renderHelp, resolveHelp, validateHelp } from "./recipe-help.js";
|
|
75
|
+
import { MOCK_PROVIDER_OPTION, RECIPE_DEMO_MODES, deriveRecipeDemo, effectiveRecipeDemo, hasBrowserOption, isMockableProvider, isServerProvider } from "./recipe-demo.js";
|
|
75
76
|
import { planForeignKeyCreation } from "./schema/foreign-key-planner.js";
|
|
76
77
|
import { SchemaComparer, generateSchemaDiff, getSQLFromDiff, hasActionableChanges, isAdvisoryOnlyChange, isManualOrAdvisoryChange } from "./migrations/differ.js";
|
|
77
78
|
import { SmrtPolymorphicAssociation } from "./polymorphic-association.js";
|
|
@@ -82,8 +83,7 @@ import { collectForeignKeyOrphanCounts } from "./schema/foreign-key-orphan-repor
|
|
|
82
83
|
import { LiveSchemaParityError, checkLiveSchemaParity } from "./schema/live-parity.js";
|
|
83
84
|
import "./signals/index.js";
|
|
84
85
|
import { DIAGNOSTICS_DEFAULT_LIMIT, SYSTEM_DIAGNOSTICS_TABLES, readDispatchHealth, readJobHealth, readMigrationStatus, readRecentChanges, readRegistryDrift, readScheduleHealth, readSystemDiagnostics } from "./system/diagnostics.js";
|
|
85
|
-
import { BOOTED_PROVENANCE, assertPlainJson, sanitizeMessagePaths, snapshotRegistry } from "./system/registry-snapshot.js";
|
|
86
86
|
import { DEFAULT_RETENTION_POLICY, clearRetentionTasks, getRetentionTasks, pruneAiUsage, pruneExpiredContexts, pruneRunOnceClaims, registerRetentionTask, runRetentionSweep, unregisterRetentionTask } from "./system/retention.js";
|
|
87
|
-
import "./system/
|
|
87
|
+
import "./system/browser.js";
|
|
88
88
|
import "./tools/index.js";
|
|
89
|
-
export { AIError, AiUsageCollector, AiUsagePersistenceHandler,
|
|
89
|
+
export { AIError, AiUsageCollector, AiUsagePersistenceHandler, CACHE_INVALIDATION_CHANNEL, CHANGE_FEED_CREDENTIAL_TABLES, CHANGE_FEED_INTERCEPTOR_NAME, CHANGE_FEED_TABLE, CHANGE_SIGNAL_CHANNEL, CRUD_OPERATIONS, ConfigurationError, ContentHasher, CosineSimilarity, DEFAULT_AI_COST_RATES, DEFAULT_CHANGES_LIMIT, DEFAULT_DATA_QUERY_PAGE_LIMIT, DEFAULT_DATA_QUERY_RESULT_BYTES, DEFAULT_DISPLAY_LABEL_FIELDS, DEFAULT_EMBEDDING_CONFIG, DEFAULT_FACET_LIMIT, DEFAULT_LEARNING_CONFIG, DEFAULT_LIST_LIMIT, DEFAULT_LIST_ORDER_BY, DEFAULT_POSTGRES_TIMEOUTS, DEFAULT_RETENTION_POLICY, DIAGNOSTICS_DEFAULT_LIMIT, DataQueryValidationError, DatabaseError, Dispatch, DispatchBus, DispatchCollection, DispatchSubscription, DispatchSubscriptionCollection, EmbeddingProvider, EmbeddingStorage, EmbeddingUnavailableError, ErrorUtils, FIELD_UI_WIDGETS, FIELD_UI_WIDGET_TYPES, FilesystemError, GlobalInterceptors, IN_LIST_CHUNK_SIZE, LearningMemory, LiveSchemaParityError, MAX_CHANGES_LIMIT, MAX_DATA_QUERY_CURSOR_LENGTH, MAX_DATA_QUERY_FACETS, MAX_DATA_QUERY_FILTERS, MAX_DATA_QUERY_FILTER_DEPTH, MAX_DATA_QUERY_IN_VALUES, MAX_DATA_QUERY_OFFSET, MAX_DATA_QUERY_PAGE_LIMIT, MAX_DATA_QUERY_REQUEST_BYTES, MAX_DATA_QUERY_RESULT_BYTES, MAX_DATA_QUERY_WARNINGS, MAX_FACET_FIELDS, MAX_FACET_LIMIT, MAX_LIST_LIMIT, MAX_STI_READ_SCOPE_TYPES, MAX_SYNC_APPLY_BATCH_SIZE, MOCK_PROVIDER_OPTION, MetricsAdapter, NetworkError, ObjectRegistry, POSTGRES_REVISION_GUARD_EXPRESSION, POSTGRES_TIMEOUT_ENV_VARS, PubSubAdapter, QueryBoundsError, QueryOrderByError, RECIPE_DEMO_MODES, RunOnceClaimError, RuntimeError, SMRT_COLLECTION_BASE_NAMES, SMRT_CUSTOM_ACTION_ERROR_METADATA_KEY, SMRT_SCHEMA_VERSION, SYNC_APPLY_ROUTE_SEGMENTS, SYNC_APPLY_UUID_PATTERN, SYSTEM_DIAGNOSTICS_TABLES, SYSTEM_TABLE_NAMES, SchemaComparer, SignalBus, SignalSanitizer, SmrtClass, SmrtCollection, SmrtError, SmrtHierarchical, SmrtJunction, SmrtJunctionBase, SmrtObject, SmrtPolymorphicAssociation, SmrtRecipe, TenantIsolationError, ValidationError, ValidationReport, ValidationUtils, appendChange, appendChanges, applyOneToManyChildAccessors, applyPendingDecoratorRegistrations, applyPostgresPermissions, applyPostgresRuntimeTimeouts, applySyncWritablePolicy, assertFiniteUnitInterval, assertPostgresSystemTimestampsCurrent, assertScopedPackageName, auditChanges, auditSnapshot, broadcastCacheInvalidation, buildCascadePlan, buildConnectSection, buildCustomActionInputSchema, buildCustomActionInvocationArgs, buildDefaultListOrderBy, buildGlossary, bumpChangeFeed, canonicalizeDataQuery, cascadeReferencesTo, checkLiveSchemaParity, childAccessorName, chunkArray, classifyDatabaseError, classifyDialectMessage, classifyMethodWireability, classifyParameterWireability, clearRetentionTasks, clone, coerceCustomActionArgument, collectForeignKeyOrphanCounts, config, convertTypeToJsonSchema, createClassNamePredicate, createDataQueryFingerprint, createDispatchBus, createFilesystemAdapter, createGeneratedCollectionAccess, createInterceptorContext, createManifestClassNamePredicate, createQualifiedName, createRecipeHelp, createSmrtClient, crossPackageRef, customActionParameterInputName, declareChangeFeedSensitiveTable, declaredTypeAcceptsDate, declaresRuntimeRestRoute, declaresRuntimeRestRouteShape, deriveRecipeDemo, describeDisplayLabel, detectEngine, displayLabelFieldProblem, drainChangeFeed, effectiveRecipeDemo, ensureBootstrapSystemTableCompatibility, ensureCacheInvalidationListener, ensureChangeFeedTable, ensureDeferredSystemTableCompatibility, ensureDispatchSubscriptionsSystemTableCompatibility, ensureDispatchSystemTableCompatibility, ensureJobEventsSystemTableCompatibility, ensureJobsSystemTableCompatibility, ensureLegacySystemTableCompatibility, ensureSystemTables, estimateAiUsageCost, executeCollectionReadPlan, executeDecision, executeToolCall, executeToolCalls, extractFieldRefs, field, filterVisibleChangeFeedEntries, findField, findSelectorFor, foreignKey, formatToolResults, generateDDLForEngine, generateSchemaDiff, generateToolFromMethod, generateToolManifest, getActiveAuditOptions, getAdapterInfo, getAuthorizedChangesSince, getAuthorizedTenantScopedChangesSince, getCacheGeneration, getChangeFeedSensitiveTables, getChangesSince, getClassConfigResolvers, getClassName, getConfigResolver, getDatabaseEngine, getPackageFromQualifiedName, getRetentionTasks, getSQLFromDiff, getSystemTableShapes, getTableVersion, getTenantScopedChangesSince, hasActionableChanges, hasBrowserOption, hasChangeFeedEntryVisibilityHook, hasChangeFeedTableAuthorizerHook, helpToMarkdown, importOptionalDependency, invalidateCollectionCache, isAbortedTransactionError, isAdvisoryOnlyChange, isAudited, isChangeFeedDenyAll, isChangeFeedEntryVisible, isChangeFeedSensitiveTable, isCrudOperation, isCrudToolAction, isDatabaseInterface, isDeterministicDatabaseError, isEmbeddedDatabase, isFieldUIWidget, isFrameworkBaseClass, isFromPackage, isLazyConfigSentinel, isManualOrAdvisoryChange, isMockableProvider, isNotNullViolationError, isPostgresDatabase, isQualifiedName, isScopedPackageName, isSensitiveConnectionParam, isServerProvider, isSmrtCollectionExtendsName, isStaleWrite, isTenantScopedClassResolved, isTransientDatabaseError, isType, isUniqueViolationError, isValid, listConfigResolvers, manyToMany, meta, method, migratePostgresSystemTimestamps, normalizeCustomActionFailure, normalizeDataQueryRequest, normalizeDataQueryResult, normalizeDataQuerySchema, normalizeOnDelete, normalizeTypedHttpError, oneToMany, parse, parseHelp, parseQualifiedName, parseSyncApplyBatch, payloadMatchesRow, planForeignKeyCreation, planPostgresPermissions, planPostgresSystemTimestampMigrations, postgresRevisionCandidates, postgresRevisionCondition, processSyncApplyBatch, pruneAiUsage, pruneChangeFeed, pruneExpiredContexts, pruneRunOnceClaims, qualifiedNamesEqual, queryStringDecoderFor, readDispatchHealth, readJobHealth, readMethodDecoratorConfig, readMigrationStatus, readRecentChanges, readRegistryDrift, readScheduleHealth, readSystemDiagnostics, redactDatabaseUrl, redactDatabaseUrlsInText, registerChangeFeedWriter, registerCompatibleFieldDecorator, registerCompatibleMethodDecorator, registerConfigResolver, registerFilesystemAdapterFactory, registerOptionalDependency, registerRetentionTask, renderHelp, requireAuditOptions, resetChangeFeedWarnings, resetChangeSignals, resetCollectionCache, resetConfigResolvers, resetVerifiedTables, resolveApiMethodExposure, resolveAuthorizedChangeFeedTables, resolveCustomActionMetadata, resolveDatabase, resolveDbCacheKey, resolveDeclaredScopeMismatch, resolveDispatchTenantId, resolveDispatchTenantScope, resolveDisplayLabelField, resolveEffectiveActionMetadata, resolveGetStringFilter, resolveHelp, resolveLazyConfig, resolveListLimit, resolveListOffset, resolvePostgresTimeouts, runCascadeDelete, runRetentionSweep, runWithTenantGate, safeParse, safeStringify, setChangeFeedAuthorizer, setChangeFeedEntryVisibility, setDispatchTenantResolver, setTenantEntryPointRunner, setTenantScopedClassResolver, shouldIncludeMethod, smrt, smrt as smrtRegistry, stopCacheInvalidationListeners, stopChangeSignalListeners, stringify, subscribeToChangeSignals, tableExists, toCustomActionBoolean, toCustomActionDate, toCustomActionNumber, toSnakeCase, unregisterChangeFeedWriter, unregisterConfigResolver, unregisterRetentionTask, usesEmbeddedRevisionFallback, validateHelp, validatePostgresPermissionContract, validateSyncApplyItem, validateToolCall, withAuditContext, withEmbeddedWriteQueue, withEmbeddedWriteTransaction, writeAudit };
|
package/dist/cascade.d.ts
CHANGED
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
* @see https://github.com/happyvertical/smrt/issues/2371
|
|
65
65
|
* @module
|
|
66
66
|
*/
|
|
67
|
-
import {
|
|
67
|
+
import type { DatabaseInterface } from '@happyvertical/sql';
|
|
68
68
|
import type { ObjectRegistry } from './registry.js';
|
|
69
69
|
import type { ForeignKeyAction } from './schema/types.js';
|
|
70
70
|
/**
|
package/dist/cascade.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascade.d.ts","sourceRoot":"","sources":["../src/cascade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"cascade.d.ts","sourceRoot":"","sources":["../src/cascade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,M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CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,SAAS,EAAE,MAAM,GAChB,WAAW,CAkJb;AAyZD,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,iBAAiB,EACrB,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,GAC9D,OAAO,CAAC,aAAa,CAAC,CAwBxB;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,iBAAiB,EACrB,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE;IACN,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/B,EACD,UAAU,EAAE,CAAC,EAAE,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GACnD,OAAO,CAAC,aAAa,CAAC,CAyDxB"}
|
package/dist/cascade.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { classifyDatabaseError } from "./db-errors.js";
|
|
2
|
+
import { buildWhere } from "./host.js";
|
|
2
3
|
import { isEmbeddedDatabase, isFrameworkTransactionHandle, isPostgresDatabase, withEmbeddedWriteTransaction } from "./embedded-write-queue.js";
|
|
3
4
|
import { ConfigurationError, DatabaseError } from "./errors.js";
|
|
4
5
|
import { normalizeForeignKeyAction, resolveForeignKeyDeleteAction } from "./schema/foreign-key-policy.js";
|
|
5
6
|
import { chunkArray } from "./utils/chunk.js";
|
|
6
7
|
import { toSnakeCase } from "./utils/naming.js";
|
|
7
8
|
import { createLogger } from "@happyvertical/logger";
|
|
8
|
-
import { buildWhere } from "@happyvertical/sql";
|
|
9
9
|
//#region src/cascade.ts
|
|
10
10
|
/**
|
|
11
11
|
* App-side referential integrity for `SmrtObject.delete()` (#2371).
|