@voltro/plugin-notifications 0.56.0 → 0.57.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +194 -0
  2. package/dist/index.js +64 -58
  3. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -39,6 +39,200 @@ _Changes staged for the next release accumulate here (rolled up from
39
39
 
40
40
  ---
41
41
 
42
+ ## [0.57.0] — 2026-08-30
43
+
44
+ ### Added
45
+
46
+ - **@voltro/client, @voltro/web** — <!-- `apiSurface: compatible` rather than `additive`: the golden line for `useFormBinding` CHANGED rather than being added, because the second parameter WIDENED from `string` to `string | ((values) => string)`. A widened parameter cannot turn a call site that compiled into one that does not — every existing `useFormBinding('app', 'todos.create', …)` still satisfies the union. The `@voltro/web` aggregate re-exports it, which is why it is listed: its golden describes a surface defined in `@voltro/client`, and regenerating the source package's golden does not regenerate the aggregate's. -->
47
+
48
+ **`useFormBinding`'s mutation may now be a FUNCTION of the current values.**
49
+
50
+ ```tsx
51
+ useFormBinding('app', (v) => (v.repeats ? 'calendarRecurringEvent.create' : 'calendarEntries.create'), { defaults })
52
+ ```
53
+
54
+ Some forms only learn their target from what the user does: a calendar entry becomes a recurring series the moment "repeats" is ticked, and the series mutation takes eleven more fields. Neither way out worked. Deriving the tag outside the binding is not available — the values belong to the binding and do not exist before it — and re-mounting with a different tag resets the engine, throwing away everything the user typed.
55
+
56
+ The schema in force follows the tag, so `fields` and validation always match what will actually be submitted, and the values survive the switch because the engine is constructed once and never rebuilt.
57
+
58
+ Two details that are decisions, not accidents. On the first render there are no values yet, so the function is called with the raw `defaults` — not the SEEDED ones, because seeding reads the schema and the schema comes from the tag being resolved. And the accessibility ids are pinned to the first resolved tag: they are DOM ids, and letting them move on the keystroke that flips the branch would remount every field, taking the focus and the caret with it — the opposite of what "switch the tag without losing the values" is for.
59
+
60
+ **Also: every hand-made `errorBus` in the client's own tests now uses the real `RpcErrorBus`.** Seven of them were `{ emit: () => {} }`, and they all broke the moment the bus grew a second channel — which is the cheap version of the failure a paraphrasing fake produces. A fake standing in for a seam that has a shared implementation should import it.
61
+ - **@voltro/plugin-audit** — **`redact*: 'shape'` now buckets a string's length below a floor: `string(<16)` rather than `string(6)`.**
62
+
63
+ The mode exists so an audit row can end a diagnosis the payload itself cannot be shown for — the motivating case is a 113-character value where 44 were due, and the length IS the whole finding. A length is a small disclosure at that size and not a small one at six: a TOTP reported as `string(6)`, or a four-digit PIN as `string(4)`, tells a reader with log access exactly what shape to try.
64
+
65
+ The floor is where the two stop overlapping. Nothing this mode is FOR lives under it, so the default costs no diagnostic value. `auditPlugin({ redactionLengthFloor })` moves it — `0` for a deployment whose audited payloads are ids and tokens and every character of length is worth having, higher for one holding short human-entered secrets.
66
+
67
+ Two details that are decisions. **An empty string stays exact** (`string(0)`): "the field arrived empty" is a real diagnosis, an empty string is not a secret, and collapsing it would hide the one short length worth seeing. And the floor applies to described KEYS as well as values — a key that failed the declared-field test is a key carrying data, so its length is the same disclosure.
68
+ - **@voltro/cli** — **`voltro logs --url` and `voltro traces --url` can read a deployed app now — and when they cannot, they say so instead of blaming your filters.**
69
+
70
+ Two defects, and the second is the cheap one that costs the most time.
71
+
72
+ **The flag existed for the case it could not serve.** `--url` addresses a deployed app; a deployed app runs `voltro serve`, which mounted neither `/_voltro/inspect/logs` nor `/_voltro/inspect/traces`. Our own docs name both commands as the way to debug a running app. A reader with cluster access can route around it by reading pod stdout — a customer on a hosted Voltro cannot, because inspect *is* the access.
73
+
74
+ `inspect: { logs, traces }` in `app.config.ts` arms a bounded in-process ring (`VOLTRO_INSPECT_LOGS` / `VOLTRO_INSPECT_TRACES` override per deployment, taking a size or `on`/`off`). **Off by default**, because a ring is memory on every replica for data most deployments already collect from stdout — the argument against a second span sink was an argument for a default, not for an absence. The endpoint handlers are the ones `voltro dev` already calls, and the span FILTER that decides what reaches the ring is now shared rather than copied: `traceRingSink.ts`, because a copied filter is a second definition nothing keeps in step, and this one is what stops `_voltro_traces` from recording its own INSERTs.
75
+
76
+ **"Found nothing" and "looked nowhere" read the same.** An empty result printed `no records matched the given filters.` — a claim that your filters were too narrow — with the truth in a `#` comment line below it, which is the first thing a pipe or a `| grep` drops. The invited reaction is to widen `--tail`, drop `--level`, extend `--since`, and get the identical sentence every time. When every target failed, the headline now says `NOTHING WAS SEARCHED` and carries the reason the endpoint gave — which the CLI was collapsing to `HTTP 404` and throwing away.
77
+
78
+ The 404 for these two also stopped saying "this endpoint is served by `voltro dev`". That was true and is now false in the one direction that matters: it tells a reader to stop looking when one config field stands between them and the answer. It names the switch.
79
+ - **@voltro/cli** — **Two `voltro doctor` rules for defects that are completely decidable from the source — and were reported because nothing decided them.**
80
+
81
+ **`executor-builds-an-undeclared-field`.** Since 0.37 a descriptor's `output` IS the serializer, so a key the struct does not declare is stripped on the way out. Nothing errors and nothing warns: every reader downstream gets `undefined` and renders a blank. A deployment hit it twice in one session — a list executor built two fields, declared neither, and every picker showed empty options.
82
+
83
+ **`nullable-column-a-mutation-cannot-clear`.** A nullable column written through an input field that does not accept `null` can be set once and never emptied. The mutation succeeds, the column keeps its old value, and the user's second attempt looks like a UI bug. A deployment found five real cases only after a formatter happened to wrap one of their own line-based checks — which is the argument for doing it here: their rule was blind to exactly the inputs small enough to fit on one line, and stayed blind silently.
84
+
85
+ Both are ADVISORY, like everything in that scan, and both REFUSE rather than guess. The refusals are where the work went:
86
+
87
+ - A spread on either side of the output comparison means the key set is not knowable; reporting the visible half would name the field the author can already see and miss the ones they cannot. - An `output` that is a named schema rather than a literal struct is UNJUDGEABLE, not empty — the second reading makes every field a finding. - Declared names are flattened across nesting, because a literal inside `versions: Schema.Array(Schema.Struct({ version, op }))` builds names the contract declares one level in. - A literal that shares NO name with the declared output is not the output: a declarative query executor returns `{ descriptor: { table, order, take } }`, which the framework runs. - A table declaration the scan cannot find produces no finding, because "this table has no nullable columns" and "I could not look" lead to opposite conclusions.
88
+
89
+ The last two exist because the first version of the output rule was measured against four real apps and flagged two files, both wrong — one query descriptor and one nested row. Both are pinned as regression cases, each beside a falsification proving the fix did not turn into accepting anything. After them: 156 real files, zero findings; and injecting an undeclared field into a real fixture makes the rule name exactly that file.
90
+
91
+ ### Fixed
92
+
93
+ - **@voltro/runtime, @voltro/cli** — **A schedule run whose process died suppressed every later firing of that schedule for six hours, on every replica, and logged `overlap skip` while doing it.**
94
+
95
+ The cross-instance overlap guard asks whether an occurrence is already running anywhere in the cluster. Its only evidence was the run row's `firedAt` against a constant, because that is all a row carried — and a constant that must never cut off a live run has to be longer than the longest one. So a pod killed mid-run left a `running` row that read as a live occurrence until the window expired. Against a half-hourly cron that is twelve missed occurrences from one restart.
96
+
97
+ `_voltro_schedule_runs` now carries **`heartbeatAt`**, bumped while the handler is in flight, and liveness is measured rather than assumed: silent for three beats is dead. A row with no beat — one written by a process still on the previous version during a rolling deploy — is dated by `firedAt` and bounded by the schedule's own `maxRuntimeMs`, because the watchdog records anything past it as `failed`. Same field and the same three cases as `_voltro_replace_in_progress.heartbeatAt`; it is deliberately not a lease, and nothing takes ownership of the run.
98
+
99
+ **The log line now carries what it measured.** `schedule: overlap skip` with `scope: 'cluster'` described two states — a peer genuinely working, and a corpse holding the schedule shut — while the word "overlap" asserted the first, and telling them apart meant reading the scheduler's source. It reports `heldBy` and `lastSeenMs` now.
100
+
101
+ **Two more defects found in the same function.** The query took the 200 most recent `running` rows across EVERY schedule and matched the name in JavaScript, so past 200 concurrent rows a live run falls out of the page and the guard silently stops guarding; the name is in the predicate now. And a `finishRun` whose update matched nothing returned in silence — the row stays `running`, which is exactly the state that suppresses the schedule, so the one write whose absence stops a cron had no failure signal at all.
102
+
103
+ `scheduling.scheduleHeartbeatMs` (env `VOLTRO_SCHEDULE_HEARTBEAT_MS`, default 30 s) is the cadence. Both boot paths pass the resolved value; a run shorter than one interval writes no beat and costs nothing.
104
+ - **@voltro/cli** — **`voltro dev` crashed on boot for every API-only app.**
105
+
106
+ `tryRunWebDev` asks `loadConfig` for the app's WEB config and gets `null` whenever there isn't one — which is every `type:'api'` project, and any config that fails to import. That null is expected and handled: the function returns `{ ran: false }` and the caller boots the api alone.
107
+
108
+ The `health` block's resolution was inserted ABOVE that guard, so the first thing the function did was read a field off the null:
109
+
110
+ ```
111
+ TypeError: Cannot read properties of null (reading 'health')
112
+ ```
113
+
114
+ Two things about how it stayed invisible are worth more than the one-line fix.
115
+
116
+ **`tsc` had no chance.** The read is written `(config as { health?: … }).health`, and a cast on a maybe-null value erases exactly the nullability the compiler would have refused. The guard has no type-level protection, so it needed a behavioural one — `webDevNoWebConfig.test.ts` asserts the CONTRACT (`{ ran: false, exitCode: 0 }`, no throw) rather than the line order, and fails with the production error when the guard is moved back.
117
+
118
+ **And every symptom pointed somewhere else.** Eight integration files went red together, and all of them reported a TIMEOUT — `both replicas must boot`, at 300 s — because what a fixture observes is a process that never starts listening. A crash at boot and a slow machine are the same observation from outside, and the second is the expensive diagnosis to start with.
119
+ - **@voltro/plugin-billing** — **A production boot with no `STRIPE_SECRET_KEY` silently selected the MOCK billing provider. It says so now.**
120
+
121
+ `resolveProvider` picks `stripe` when the key is present and `mock` when it is not. The zero-config default is right — add the plugin, see checkout flows, no account needed. What was wrong is how it failed later.
122
+
123
+ `STRIPE_SECRET_KEY` is a deployment variable, and one that silently stops being set is a routine event: a rotated secret, a typo in a values file, a CI variable nobody ever created. When that happens, an app that has been charging customers keeps answering every charge, subscription and invoice call SUCCESSFULLY, reaches nobody, and leaves nothing in the log to find afterwards.
124
+
125
+ A mock chosen by ABSENCE, under `NODE_ENV=production`, now warns — naming the consequence rather than the selection, and both ways out (set the key, or declare `provider: 'mock'` so the reader knows it was a decision). An explicitly declared mock stays silent: warning about a choice somebody made trains the reader to ignore the line that matters.
126
+
127
+ `NODE_ENV` decides only whether it is worth SAYING, never what is selected. Both environments resolve the same provider — an env-conditional behaviour is the shape a staging box sails past, and it is pinned as its own case.
128
+ - **@voltro/cli, @voltro/protocol** — **A plugin's `declaredEnv: [{ required: true }]` now ABORTS THE BOOT when the value does not resolve. Nothing checked it before.**
129
+
130
+ The field has existed for a long time and ten-odd plugins fill it in. Three consumers read it — the env manifest, `voltro env`, and the secret MINT (which only handles `generate`, a secret that is OURS to invent). None validated `required`. Its own doc said "declaration only — metadata, not a read path", while `PluginEnvVar.generate`'s said "in production a missing secret refuses the boot": true for the minted kind, false for the one that matters — a third-party credential nobody can invent.
131
+
132
+ Declared, documented, read by three consumers, enforced by none. Every surface read as wired.
133
+
134
+ Every required entry now resolves before any plugin activates, on BOTH api boot paths, and a failure names the PLUGIN — the variable name alone appears in no file the reader owns, so without the attribution the next step is a grep through `node_modules`.
135
+
136
+ **A `secret: true` variable resolves through the configured secrets backend**, not just `process.env`, because that is where its value lives when one exists. A backend that cannot answer therefore fails the boot too — reported as `unreadable` rather than as an absent variable, because those are different facts and one of them sends the reader to the wrong file. A non-secret variable never touches the backend, so a misconfigured vault cannot fail variables that never used it.
137
+
138
+ Merging, when two plugins declare the same variable: `required` takes the stricter (a plugin that can live without the value must not weaken one that cannot), `secret` takes `true` (over-classifying hides something that did not need hiding; under-classifying prints somebody's credential into a dashboard — it is the only direction with a failure mode on one side). An app that declares the variable in `app.config.ts` overrides the plugin entirely.
139
+
140
+ **Upgrade note.** One first-party declaration is affected: `plugin-notifications`' `VOLTRO_VAPID_PRIVATE_KEY`, declared `required: true` and reachable only when web push is enabled. `voltro dev` mints it, as before; a production `voltro serve` with web push and no key now refuses to start, which is what that declaration has always said.
141
+ - **@voltro/client** — **A consecutive-failure ceiling was counting a tab's LIFETIME, and the screen it stranded had nothing left to move it.**
142
+
143
+ `wireAuthRefresh` rebuilds the transport when a call comes back `Unauthenticated`, and `maxConsecutive` bounds it: after that many refreshes *with no successful call in between*, it stops, because at that point the credential is not stale — it is refused. "With no successful call in between" was carried by `AuthRefreshHandle.noteSuccess()`, a method the HOST had to call, and the only host never called it.
144
+
145
+ The consequence is not the loop the ceiling guards against. It is the opposite: three token rotations over an afternoon exhaust the budget, and from then on the tab never refreshes again. Every later expiry rejects every subscription the page opens, a rejected entry is terminal for its transport by design, so the screen waits on a spinner with nothing left to wait for.
146
+
147
+ `RpcErrorBus` has a SUCCESS channel now (`onSuccess` / `emitSuccess`), emitted by the same pipeline that emits the errors — a snapshot in the subscription cache, a settled mutation, a settled action. `wireAuthRefresh` subscribes to it itself, so no host has to remember anything; `noteSuccess()` stays for a host with a better signal of its own and is no longer what the policy depends on.
148
+
149
+ **`useSubscriptionHealth(apiName)` is new**, and it exists because the state it reports cannot be derived from any single hook. A refused subscription never retries, so there is no second error to react to, and `SubscriptionFailed` presents `data: undefined` — the value every reading layer derives `loading` from. A wrapper hook passing `{ data, loading }` through therefore turns a refusal into a permanent skeleton, and passing those two through is the natural shape to write.
150
+
151
+ const { healthy, failed } = useSubscriptionHealth('app') if (!healthy) return <Banner tags={failed.map((f) => f.tag)} />
152
+
153
+ Keyed by TAG, not counted — two failures of one call are one broken thing — and scoped to the api's runtime, reset when that runtime is rebuilt: carrying a failure across a transport swap would report a call as broken that has not been tried since.
154
+ - **@voltro/plugin-notifications, @voltro/cli** — **About one generated VAPID key in 256 was 31 bytes, and a 31-byte key can never send a push.**
155
+
156
+ `createECDH('prime256v1').getPrivateKey()` returns the private scalar the way OpenSSL stores a BIGNUM — minimal length, leading zero bytes stripped. A P-256 scalar is a fixed-width field element, so a draw whose high byte is zero comes back 31 bytes (measured: 82 in 20 000), and two zero bytes gives 30 (1 in 20 000). Both generators had it: the plugin's `generateVapidPrivateKey`, and the `p256` branch of `voltro dev`'s secret mint.
157
+
158
+ The consumers were already right, which is what made this survivable and also what hid it. `vapidPublicKeyFor` REFUSES a non-32-byte scalar — a wrong VAPID key must fail loudly rather than at the first delivery. But the refusal happens inside `sendWebPush`'s `try`, so it came back as `{ kind: 'failed', status: 0 }`: the same outcome as the push service being unreachable. Nothing named the key. And the minted value is written to `.env.local` and stays, so an affected project's push sending is broken permanently and looks like a network problem forever.
159
+
160
+ Both generators left-pad now, and both packages assert the width on their OWN generator — deliberately not one reading the other's source, because a cross-package guard does not run when the suite is filtered to a single package.
161
+
162
+ **Worth recording is how nearly it was written off.** It surfaced as a single test failing in a full run and passing alone, roughly 1.6 % of the time — the exact signature of a saturated machine. Isolation "cleared" it twice. What settled it was not another isolated run but generating 20 000 keys and counting the widths: 0.41 % at 31 bytes is not noise, it is 1/256, and that number names its own cause.
163
+ - **@voltro/runtime, @voltro/cli, @voltro/client, @voltro/kv, @voltro/plugin-broadcast** — **Seven reported points, all from one round. Every one of them is information the process already had, not reaching the person who needed it.**
164
+
165
+ **A `SqlError` reaching the client as a Defect carried no detail.** The log line said `Failed to execute statement` — no table, no column, no operation — while the trace exporter had written `db.query.text` for the same statement. The handler-failure logger has walked the driver cause for a long time; the DEFECT frame did not, so a failure that reaches the client without passing through that logger left an operator with nothing. It leads with the driver's own message now and points at `_voltro_traces`.
166
+
167
+ **A defect that repeats IDENTICALLY ends the resumable stream.** The reconnect loop is built for a transport drop, and a transport drop does not repeat itself verbatim; a broken statement does. So one broken query spent the whole `maxReconnects` budget, and the user watched a spinner and then read "connection lost" — describing the opposite of what happened. TWICE, not once: the first failure is genuinely ambiguous, the second identical one is not. Also documented: `reconnects` is the RUN TOTAL and `maxReconnects` bounds CONSECUTIVE reconnects without progress, so "attempt {reconnects} of {maxReconnects}" renders `5/2`.
168
+
169
+ **`voltro build` reported a config that failed to LOAD as "no web app found".** It used the wrapper that discards the import error, so an `app.config.ts` that IS an api and simply threw came out as a claim about the app's TYPE. The message now distinguishes the two, prints the error, and names both types.
170
+
171
+ **The `subscriber-effect-without-once` rule found one of four.** The helper name matched by EQUALITY, so `notifyAbsenceRequested` fell through while `notify` reported — a prefix now. And it read only the handler body, so a write one call level down inside the same file was invisible; the file is already parsed. What it still cannot see (a write in another module) is SAID: the report prints how many subscribers declare no `once:` against how many the rule found an effect in, because "1 file(s)" read as an inventory.
172
+
173
+ **`voltro dev` had no probe surface on a web app**, and `/internal/*` did not 404 — it fell into the page router. An SPA shell answered 200 with HTML, a loader redirect answered 303, an auth guard answered 303 to `/login`; a kubelet reads all three as PASS. One of those pages had a loader calling the api, so the WEB pod's readiness hung on the API's reachability once per probe interval. All three boot paths now answer through one matcher, before routing — and `health: { path, liveness, readiness }` in `app.config.ts` makes the paths and the answers the app's, for both app types. "Ready" is a dependency ping for an api and its opposite for a screen that must keep showing its last frame.
174
+
175
+ **Every hot reload ended as a crash.** ioredis emits `error` on an EventEmitter, and node turns an unhandled `error` event into an uncaught exception — so a client with no listener made every close with commands in flight a process crash. Functionally harmless (the supervisor restarts) and every reload read as a crash loop in Kubernetes. Both `@voltro/kv` and `@voltro/plugin-broadcast` register one on every client. The watcher also ignores a tool's scratch file (`vitest.config.ts.timestamp-…mjs`), which was restarting the app twice per test run.
176
+
177
+ **A row filter's resolution is now reported.** Between "refuses everything" (which an older version did, loudly) and "applies nothing" there was nothing to see: every read would widen and no log, test or `doctor` would say so. The framework says so the FIRST time a filter resolves on a live read path — a fact from the running system rather than an echo of the declaration. And a new advisory `doctor` rule reports a handler that hand-writes a predicate on a table the registered filter already covers: never a leak (two identical predicates ANDed are as tight as one), but an authorization rule maintained in places the framework already knew about.
178
+ - **@voltro/client** — **A mutation, workflow start or upload fired from a mount effect hit the client boot window and failed with the stub's message. Only `useAction` waited it out.**
179
+
180
+ Between the first client commit — children render against the loading stub so `hydrateRoot` can adopt the SSR DOM — and the moment the supervisor resolves the real rpc client, `handle.client` is a proxy that throws on any access. Measured in real chromium at ~15–30 ms, and wider in an app that mints a token in `authHeaders` before connecting. `useEffect(() => { mutate(...) }, [])` is the ordinary shape that lands inside it.
181
+
182
+ `useAction.run` was fixed for exactly this, with a unit test and a browser measurement. `useMutation.mutate`, `useWorkflow`'s five callbacks and `useUpload.upload` had the identical defect for as long, and the failure was worse than a delay: the stub's `not-yet-resolved api` DISPLACED whatever the real outcome would have been, so the message a developer read described our plumbing rather than their call.
183
+
184
+ All four seams go through one `awaitResolvedApi` now, and each reads the handle from a ref at CALL time. A `useCallback` dep list cannot solve this however correct it is — the callback a mount effect fires was built on the first render, before the re-render that would rebuild it.
185
+
186
+ `useMutation` waits BEFORE staging optimistic patches, not just before the network call: the stub carries a different `cache` instance, so patches staged against it would land in a cache no live subscription reads and then be reverted against the wrong one.
187
+
188
+ **The rule is asserted over the SET** (`bootWindowSeams.test.ts`), because a per-hook test can only demonstrate one member. A fifth imperative hook inherits it by being written rather than by being remembered — which is precisely what did not happen the first time.
189
+ - **@voltro/cli** — **The boot's `reactivity:` line reported what the dialect COULD run, not what was running — so the deployment with no cross-replica fan-out was the one told it had none missing.**
190
+
191
+ `wireBroadcastBus` derived it as `postgres || mysql || mariadb`. A dialect is capable of a native transport; that is not the same as one being started. With `CDC=0` — which any deployment whose database grants no REPLICATION privilege has to set — the change reader never runs, and the boot still announced
192
+
193
+ reactivity: cross-instance via native binlog CDC (mariadb)
194
+
195
+ The crooked sentence is the smaller half. Without a broadcast plugin this line is the ONLY thing said about cross-replica reactivity, and the branch it displaced is the WARNING that there is none. It is also the line our own guidance names as the check for whether the native-CDC amplification applies to you, and there it answered yes where the truth was no.
196
+
197
+ It reads `store.changeScope` now — `'fleet'` exactly when change capture is running, and the same value `remoteChangesVisible` takes two calls later, so the honest signal was already in scope. Derived rather than enumerated: a sixth dialect with a native transport joins by itself, and an app that turned capture off because every table is `.nonReactive()` is covered without anyone remembering that path exists.
198
+
199
+ The enumeration was also wrong in the other direction — **mssql (Change Tracking) was absent**, so a deployment running a real cross-instance transport was being warned it had none.
200
+
201
+ And the warning that fires in the CDC-off case names the cause instead of the dialect. The old fallback told a mariadb operator to "use ... mariadb (binlog CDC)", which reads as boilerplate to the one person who needed to act on it.
202
+ - **@voltro/runtime** — **A row-filtered table reached through `.with(...)` is narrowed now, where it used to be refused — and before that, served unfiltered.**
203
+
204
+ An eager load resolves BELOW the seam that AND-merges the filter onto a read's base table: the stores expand the eager tree themselves, the memory store by recursing through its own raw read and the SQL stores by folding the relation into one join or JSON aggregate. Measured when it was found: a filter restricting a relation target to the caller returned exactly the caller's row on a direct read and BOTH rows through `.with()` on the same data.
205
+
206
+ That shipped as a refusal, on the reasoning that the real fix meant applying the filter inside eager compilation across four dialect stores. **It is not that change.** Every eager branch already accepts a `where`, and both resolvers already honour it — the walker ANDs it into the relation's lookup descriptor, the JSON compiler emits it into the correlated subquery on all five dialects. So the middleware writes the filter where a caller could have written it, and every resolver applies it without knowing a row filter exists. One rewrite, six execution paths, no dialect emitter touched.
207
+
208
+ A caller's own `where` is kept and the filter goes UNDER it: a branch you narrowed stays narrower, and nothing a caller writes can widen the filter. Nested `.with(...)` is narrowed at every level.
209
+
210
+ **One case still refuses: a row-filtered `manyToMany` JUNCTION.** A branch `where` is a predicate on the relation's TARGET, so a filter narrowing the junction has nowhere to be expressed. Narrow and honest beats a rewrite that looks complete.
211
+
212
+ Verified on the walker (unit, in-memory store) AND on the JSON-aggregation path against a real postgres, because those are two separate implementations and the suites that cover them each mock the other's half.
213
+ - **@voltro/client** — **Two dev-time messages said something the code had not measured.**
214
+
215
+ **The store's equals-footgun warning blamed the selector.** It read *"the selector returns a NEW object each call"* — and the site cannot observe that: an identical state returns from the cache before the selector runs, so everything reaching the warning arrives with a CHANGED state. Shallow-equal-but-not- identical there has two producers, and the message asserted one of them:
216
+
217
+ - the selector BUILDS (`s => ({ a: s.a })`), or - the STORE wrote an equivalent new value — `set({ crumbs: [] })` on leaving a page and again on entering the next is two different empty arrays.
218
+
219
+ Both waste the render and both are fixed by `{ equals: shallow }`, so the advice was right while the diagnosis pointed at the wrong half — and a deployment reading the second case went looking at a selector that had been returning the same reference all along. The warning now MEASURES which one it is: it re-runs the selector on the previous state (dev only, at most once per store, on a selector required to be pure anyway) and says either "the selector builds" or "the store is writing an equal value".
220
+
221
+ **And a validation template rendered its own placeholder.** `interpolate` left an unfilled `{param}` in place, so a template whose parameter was missing put a literal `Mindestens {min}` into the interface. It reports the hole now and the caller falls through to the issue's own rendered sentence, which is complete by construction. The reported route is closed twice over: counting rules supply BOTH `count` (the name an i18n layer pluralises on) and `min` (the built-in template's), so a framework-derived issue cannot reach it; a hand-written annotation still can, and a raw placeholder is never the right answer.
222
+ - **@voltro/cli, @voltro/ai** — **`@voltro/ai`'s resumable-stream tables were declared, bounded, documented — and never added to the migration set.**
223
+
224
+ `dataStoreResumableStreamStore` writes to `_voltro_stream_events` and `_voltro_stream_state`. `frameworkTableAssembly.ts` imports six `@voltro/ai` tables and did not import these two, so `voltro db plan` answered *schema is up to date* while both were absent, and the first user's turn died inside the store rather than at boot.
225
+
226
+ They are assembled now for any app that DEPENDS on `@voltro/ai`, so all four schema-declaring paths plan them.
227
+
228
+ **The gate is the dependency, not a file convention, and that is the half worth knowing.** Every other flag in `FeatureMix` reads a filename — `*.agent.tsx`, `*.connection.ts` — and `dataStoreResumableStreamStore(ctx.store)` has none: it is an ordinary call, reachable from an action, a query, a workflow step. Gating on `agents` is the obvious guess and it is wrong, because an app can stream without declaring a single agent file. The manifest is the superset that CAN reach the store, it comes from the source tree, and every process in one deployment computes it identically — the constraint the declared set is under.
229
+
230
+ `loadDiscovered` now REQUIRES a `root` for the same reason: the flag is read from a manifest, so it cannot be derived from the file list, and a mix that quietly answered `false` because nobody passed a root would declare a smaller schema than the same tree declares elsewhere. An optional root would read exactly like one that was supplied.
231
+
232
+ **And the documentation said to do something that does not work.** The JSDoc and the docs page both instructed *"add them to the database barrel (or they ride along with a `*.agent.tsx` app)"* — both halves wrong, since discovery is file-based (`*.entity.ts`) and the store is not agent-only. That sentence had reached the shipped agent guide, so it was teaching every downstream coding agent a remedy with no effect on the plan. Corrected in the JSDoc, in both languages of the docs site, and regenerated.
233
+
234
+ ---
235
+
42
236
  ## [0.56.0] — 2026-08-29
43
237
 
44
238
  ### ⚠ BREAKING
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { BASE_NAME as e, archiveDescriptor as t, clearQuietHoursDescriptor as n,
2
2
  import { Context as h, Effect as g, Layer as ae, Schema as _ } from "effect";
3
3
  import { and as v, boolean as y, eq as b, generateId as x, id as S, integer as C, isNotNull as oe, isNull as w, json as T, lte as E, registerRetention as D, retentionTtlMsFromEnv as O, table as k, text as A, timestamp as j } from "@voltro/database";
4
4
  import { definePlugin as se, pluginInstanceName as ce } from "@voltro/protocol";
5
- import { createCipheriv as le, createDecipheriv as M, createECDH as N, createHash as ue, createHmac as de, createPrivateKey as fe, randomBytes as pe, randomUUID as P, sign as me, timingSafeEqual as he } from "node:crypto";
5
+ import { createCipheriv as M, createDecipheriv as le, createECDH as N, createHash as ue, createHmac as de, createPrivateKey as fe, randomBytes as pe, randomUUID as P, sign as me, timingSafeEqual as he } from "node:crypto";
6
6
  //#region src/errors.ts
7
7
  var F = class extends _.TaggedError()("PushTokenRejected", {
8
8
  token: _.String,
@@ -577,14 +577,20 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
577
577
  };
578
578
  }, V = (e) => e.toString("base64url"), H = (e) => Buffer.from(e, "base64url"), U = (e, t) => de("sha256", e).update(t).digest(), W = (e, t, n) => U(e, Buffer.concat([t, Buffer.from([1])])).subarray(0, n), De = () => {
579
579
  let e = N("prime256v1");
580
- return e.generateKeys(), V(e.getPrivateKey());
581
- }, G = (e) => {
580
+ return e.generateKeys(), V(Oe(e.getPrivateKey()));
581
+ }, Oe = (e) => {
582
+ if (e.length === 32) return e;
583
+ if (e.length > 32) throw Error(`P-256 scalar must be at most 32 bytes (got ${e.length})`);
584
+ return Buffer.concat([Buffer.alloc(32 - e.length), e]);
585
+ }, ke = (e) => {
582
586
  let t = H(e);
583
587
  if (t.length !== 32) throw Error(`VOLTRO_VAPID_PRIVATE_KEY must be a base64url 32-byte P-256 scalar (got ${t.length} bytes)`);
584
- let n = N("prime256v1");
588
+ return t;
589
+ }, G = (e) => {
590
+ let t = ke(e), n = N("prime256v1");
585
591
  return n.setPrivateKey(t), V(n.getPublicKey());
586
- }, Oe = (e) => {
587
- let t = H(e), n = N("prime256v1");
592
+ }, Ae = (e) => {
593
+ let t = ke(e), n = N("prime256v1");
588
594
  n.setPrivateKey(t);
589
595
  let r = n.getPublicKey();
590
596
  return fe({
@@ -597,7 +603,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
597
603
  },
598
604
  format: "jwk"
599
605
  });
600
- }, ke = (e, t, n, r = Date.now()) => {
606
+ }, je = (e, t, n, r = Date.now()) => {
601
607
  let i = new URL(e), a = {
602
608
  aud: `${i.protocol}//${i.host}`,
603
609
  exp: Math.floor(r / 1e3) + 43200,
@@ -607,44 +613,44 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
607
613
  alg: "ES256"
608
614
  })))}.${V(Buffer.from(JSON.stringify(a)))}`;
609
615
  return `vapid t=${o}.${V(me("sha256", Buffer.from(o), {
610
- key: Oe(t),
616
+ key: Ae(t),
611
617
  dsaEncoding: "ieee-p1363"
612
618
  }))}, k=${G(t)}`;
613
- }, K = Buffer.from("WebPush: info\0"), Ae = Buffer.from("Content-Encoding: aes128gcm\0"), je = Buffer.from("Content-Encoding: nonce\0"), Me = 4096, Ne = (e, t, n = {}) => {
619
+ }, Me = Buffer.from("WebPush: info\0"), K = Buffer.from("Content-Encoding: aes128gcm\0"), Ne = Buffer.from("Content-Encoding: nonce\0"), Pe = 4096, Fe = (e, t, n = {}) => {
614
620
  let r = H(e.p256dh), i = H(e.auth);
615
621
  if (r.length !== 65 || r[0] !== 4) throw Error("push subscription p256dh must be a 65-byte uncompressed P-256 point");
616
622
  if (i.length !== 16) throw Error("push subscription auth must be 16 bytes");
617
623
  let a = N("prime256v1");
618
624
  n.asPrivate ? a.setPrivateKey(n.asPrivate) : a.generateKeys();
619
625
  let o = a.getPublicKey(), s = W(U(i, a.computeSecret(r)), Buffer.concat([
620
- K,
626
+ Me,
621
627
  r,
622
628
  o
623
- ]), 32), c = n.salt ?? pe(16), l = U(c, s), u = W(l, Ae, 16), d = W(l, je, 12), f = le("aes-128-gcm", u, d), p = Buffer.concat([
629
+ ]), 32), c = n.salt ?? pe(16), l = U(c, s), u = W(l, K, 16), d = W(l, Ne, 12), f = M("aes-128-gcm", u, d), p = Buffer.concat([
624
630
  f.update(Buffer.concat([t, Buffer.from([2])])),
625
631
  f.final(),
626
632
  f.getAuthTag()
627
633
  ]), m = Buffer.alloc(21);
628
- return c.copy(m, 0), m.writeUInt32BE(Me, 16), m.writeUInt8(o.length, 20), Buffer.concat([
634
+ return c.copy(m, 0), m.writeUInt32BE(Pe, 16), m.writeUInt8(o.length, 20), Buffer.concat([
629
635
  m,
630
636
  o,
631
637
  p
632
638
  ]);
633
- }, Pe = (e, t) => {
639
+ }, Ie = (e, t) => {
634
640
  let n = e.subarray(0, 16), r = e.readUInt8(20), i = e.subarray(21, 21 + r), a = e.subarray(21 + r), o = N("prime256v1");
635
641
  o.setPrivateKey(t.uaPrivate);
636
642
  let s = o.getPublicKey(), c = o.computeSecret(i), l = U(n, W(U(t.authSecret, c), Buffer.concat([
637
- K,
643
+ Me,
638
644
  s,
639
645
  i
640
- ]), 32)), u = W(l, Ae, 16), d = W(l, je, 12), f = M("aes-128-gcm", u, d);
646
+ ]), 32)), u = W(l, K, 16), d = W(l, Ne, 12), f = le("aes-128-gcm", u, d);
641
647
  f.setAuthTag(a.subarray(a.length - 16));
642
648
  let p = Buffer.concat([f.update(a.subarray(0, a.length - 16)), f.final()]), m = p.length - 1;
643
649
  for (; m >= 0 && p[m] === 0;) m--;
644
650
  if (p[m] !== 2) throw Error("web-push record missing the last-record delimiter");
645
651
  return p.subarray(0, m);
646
- }, Fe = async (e, t, n) => {
647
- let r = Ne(e.keys, t), i = n.fetchImpl ?? fetch, a;
652
+ }, Le = async (e, t, n) => {
653
+ let r = Fe(e.keys, t), i = n.fetchImpl ?? fetch, a;
648
654
  try {
649
655
  a = await i(e.endpoint, {
650
656
  method: "POST",
@@ -653,7 +659,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
653
659
  "content-type": "application/octet-stream",
654
660
  ttl: String(n.ttl ?? 86400),
655
661
  urgency: "normal",
656
- authorization: ke(e.endpoint, n.privateKey, n.contact)
662
+ authorization: je(e.endpoint, n.privateKey, n.contact)
657
663
  },
658
664
  body: new Uint8Array(r)
659
665
  });
@@ -678,10 +684,10 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
678
684
  status: a.status,
679
685
  detail: o.slice(0, 200)
680
686
  };
681
- }, Ie = (e, t) => {
687
+ }, Re = (e, t) => {
682
688
  let n = Buffer.from(e), r = Buffer.from(t);
683
689
  return n.length === r.length && he(n, r);
684
- }, Le = k("_voltro_notification_push_subscriptions", {
690
+ }, ze = k("_voltro_notification_push_subscriptions", {
685
691
  id: S({ prefix: "notifpush" }),
686
692
  subjectId: A(),
687
693
  endpointHash: A(),
@@ -707,7 +713,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
707
713
  },
708
714
  countForSubject: async (t) => [...e.values()].filter((e) => e.subjectId === t).length
709
715
  };
710
- }, Y = "_voltro_notification_push_subscriptions", Re = (e) => {
716
+ }, Y = "_voltro_notification_push_subscriptions", Be = (e) => {
711
717
  let t = async (t, n) => e.query({
712
718
  table: Y,
713
719
  predicate: t,
@@ -761,23 +767,23 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
761
767
  },
762
768
  countForSubject: async (e) => (await t(b("subjectId", e))).length
763
769
  };
764
- }, ze = Symbol.for("@voltro/plugin-notifications:web-push"), X = () => {
770
+ }, Ve = Symbol.for("@voltro/plugin-notifications:web-push"), X = () => {
765
771
  let e = globalThis;
766
- return e[ze] ??= {
772
+ return e[Ve] ??= {
767
773
  store: J(),
768
774
  bound: !1
769
775
  };
770
- }, Be = (e) => {
776
+ }, He = (e) => {
771
777
  let t = X();
772
- t.store = Re(e), t.bound = !0;
773
- }, Ve = () => {
778
+ t.store = Be(e), t.bound = !0;
779
+ }, Ue = () => {
774
780
  let e = X();
775
781
  e.store = J(), e.bound = !1;
776
782
  }, Z = (e) => {
777
783
  let t = e ?? process.env.VOLTRO_VAPID_PRIVATE_KEY;
778
784
  if (t === void 0 || t.trim() === "") throw Error("web push needs VOLTRO_VAPID_PRIVATE_KEY (a base64url P-256 scalar). `voltro dev` mints one into .env.local; for production generate one and set it in the deployment environment. There is deliberately no default.");
779
785
  return t;
780
- }, Q = 3800, He = (e, t) => {
786
+ }, Q = 3800, We = (e, t) => {
781
787
  let n = typeof e.data?.url == "string" ? e.data.url : void 0, r = {
782
788
  title: e.title,
783
789
  body: e.body,
@@ -794,17 +800,17 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
794
800
  ...o,
795
801
  body: `${l}…`
796
802
  }));
797
- }, Ue = (e = {}) => (X().channelOptions = e, Ge(e)), We = () => {
803
+ }, Ge = (e = {}) => (X().channelOptions = e, qe(e)), Ke = () => {
798
804
  let e = X().channelOptions;
799
805
  G(Z(e?.privateKey));
800
- }, Ge = (e) => ({
806
+ }, qe = (e) => ({
801
807
  id: e.id ?? "webPush",
802
808
  deliver: async (t) => {
803
- let n = await Ke(t, e), r = n.filter((e) => e.status === "failed");
809
+ let n = await Je(t, e), r = n.filter((e) => e.status === "failed");
804
810
  if (n.length > 0 && r.length === n.length) throw Error(`web push failed for all ${r.length} endpoint(s): ${r[0].error ?? "unknown"}`);
805
811
  },
806
- deliverDetailed: (t) => Ke(t, e)
807
- }), Ke = async (e, t) => {
812
+ deliverDetailed: (t) => Je(t, e)
813
+ }), Je = async (e, t) => {
808
814
  let n = Z(t.privateKey), r = await X().store.listForSubject(e.to), i = [];
809
815
  for (let a of r) {
810
816
  let r = pe(16).toString("base64url"), o = {
@@ -812,13 +818,13 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
812
818
  ...t.contact === void 0 ? {} : { contact: t.contact },
813
819
  ...t.ttl === void 0 ? {} : { ttl: t.ttl },
814
820
  ...t.fetchImpl === void 0 ? {} : { fetchImpl: t.fetchImpl }
815
- }, s = await Fe({
821
+ }, s = await Le({
816
822
  endpoint: a.endpoint,
817
823
  keys: {
818
824
  p256dh: a.p256dh,
819
825
  auth: a.auth
820
826
  }
821
- }, He(e, r), o);
827
+ }, We(e, r), o);
822
828
  s.kind === "delivered" ? i.push({
823
829
  endpoint: a.endpoint,
824
830
  status: "sent",
@@ -835,7 +841,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
835
841
  });
836
842
  }
837
843
  return i;
838
- }, qe = (e) => G(Z(e)), Je = k("_voltro_notification_inbox", {
844
+ }, Ye = (e) => G(Z(e)), Xe = k("_voltro_notification_inbox", {
839
845
  id: S({ prefix: "notif" }),
840
846
  subjectId: A(),
841
847
  category: A(),
@@ -846,7 +852,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
846
852
  archivedAt: j().nullable(),
847
853
  createdAt: j().default("now"),
848
854
  tenantId: A().nullable()
849
- }).renamedFrom("notification_inbox").index("byInboxSubject", ["subjectId"]).index("byInboxSubjectCreatedAt", ["subjectId", "createdAt"]).index("byInboxSubjectUnread", ["subjectId"], { where: "\"readAt\" IS NULL" }), Ye = k("_voltro_notification_preferences", {
855
+ }).renamedFrom("notification_inbox").index("byInboxSubject", ["subjectId"]).index("byInboxSubjectCreatedAt", ["subjectId", "createdAt"]).index("byInboxSubjectUnread", ["subjectId"], { where: "\"readAt\" IS NULL" }), Ze = k("_voltro_notification_preferences", {
850
856
  id: S({ prefix: "notifpref" }),
851
857
  subjectId: A(),
852
858
  category: A(),
@@ -856,7 +862,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
856
862
  "subjectId",
857
863
  "category",
858
864
  "channel"
859
- ]), Xe = k("_voltro_notification_deliveries", {
865
+ ]), Qe = k("_voltro_notification_deliveries", {
860
866
  id: S({ prefix: "notifdlv" }),
861
867
  recipient: A(),
862
868
  category: A(),
@@ -867,32 +873,32 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
867
873
  endpoint: A().nullable(),
868
874
  clickToken: A().nullable(),
869
875
  clickedAt: j().nullable()
870
- }).renamedFrom("notification_deliveries").index("byDeliveriesAt", ["at"]).index("byDeliveriesClickToken", ["clickToken"]), Ze = k("_voltro_notification_topic_subscriptions", {
876
+ }).renamedFrom("notification_deliveries").index("byDeliveriesAt", ["at"]).index("byDeliveriesClickToken", ["clickToken"]), $e = k("_voltro_notification_topic_subscriptions", {
871
877
  id: S({ prefix: "notiftsub" }),
872
878
  topic: A(),
873
879
  subjectId: A(),
874
880
  tenantId: A().nullable()
875
- }).renamedFrom("notification_topic_subscriptions").unique("byTopicSubject", ["topic", "subjectId"]).index("byTopic", ["topic"]), Qe = k("_voltro_notification_quiet_hours", {
881
+ }).renamedFrom("notification_topic_subscriptions").unique("byTopicSubject", ["topic", "subjectId"]).index("byTopic", ["topic"]), et = k("_voltro_notification_quiet_hours", {
876
882
  id: S({ prefix: "notifqh" }),
877
883
  subjectId: A(),
878
884
  startMinute: C(),
879
885
  endMinute: C(),
880
886
  tz: A().default("UTC"),
881
887
  policy: A().default("hold")
882
- }).renamedFrom("notification_quiet_hours").unique("byQuietHoursSubject", ["subjectId"]), $e = k("_voltro_notification_held", {
888
+ }).renamedFrom("notification_quiet_hours").unique("byQuietHoursSubject", ["subjectId"]), tt = k("_voltro_notification_held", {
883
889
  id: S({ prefix: "notifheld" }),
884
890
  kind: A(),
885
891
  subjectId: A(),
886
892
  send: T(),
887
893
  flushAt: j()
888
- }).renamedFrom("notification_held").index("byHeldFlushAt", ["flushAt"]).index("byHeldSubjectKind", ["subjectId", "kind"]), et = class extends h.Tag("@voltro/plugin-notifications/NotificationService")() {}, tt = (e) => async (t) => {
894
+ }).renamedFrom("notification_held").index("byHeldFlushAt", ["flushAt"]).index("byHeldSubjectKind", ["subjectId", "kind"]), nt = class extends h.Tag("@voltro/plugin-notifications/NotificationService")() {}, rt = (e) => async (t) => {
889
895
  if (e !== void 0) try {
890
896
  let n = await e(t);
891
897
  if (typeof n == "string" && n !== "") return n;
892
898
  } catch {}
893
899
  return t.request.subject.id ?? "anonymous";
894
- }, nt = (e) => e.request.subject.tenantId ?? null, $ = e, rt = (e = {}) => {
895
- let h = tt(e.resolveSubjectId), _ = ce({
900
+ }, it = (e) => e.request.subject.tenantId ?? null, $ = e, at = (e = {}) => {
901
+ let h = rt(e.resolveSubjectId), _ = ce({
896
902
  base: $,
897
903
  alias: e.alias,
898
904
  instance: e.name
@@ -1001,7 +1007,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
1001
1007
  {
1002
1008
  ...d,
1003
1009
  description: "Subscribe the caller to a broadcast topic.",
1004
- execute: (e, t) => g.promise(async () => (await T.subscribe(e.topic, await h(t), nt(t)), { ok: !0 }))
1010
+ execute: (e, t) => g.promise(async () => (await T.subscribe(e.topic, await h(t), it(t)), { ok: !0 }))
1005
1011
  },
1006
1012
  {
1007
1013
  ...m,
@@ -1031,7 +1037,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
1031
1037
  {
1032
1038
  ...ee,
1033
1039
  description: "The VAPID application-server key a subscribing browser needs.",
1034
- execute: () => g.sync(() => ({ key: qe(X().channelOptions?.privateKey) }))
1040
+ execute: () => g.sync(() => ({ key: Ye(X().channelOptions?.privateKey) }))
1035
1041
  },
1036
1042
  {
1037
1043
  ...re,
@@ -1045,7 +1051,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
1045
1051
  p256dh: n.p256dh,
1046
1052
  auth: n.auth,
1047
1053
  ua: n.ua ?? null,
1048
- tenantId: nt(t)
1054
+ tenantId: it(t)
1049
1055
  }), { ok: !0 };
1050
1056
  })
1051
1057
  },
@@ -1062,11 +1068,11 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
1062
1068
  ] : [], j = (e) => ({
1063
1069
  kind: "json",
1064
1070
  data: e
1065
- }), le = (e, t) => ({
1071
+ }), M = (e, t) => ({
1066
1072
  kind: "json",
1067
1073
  status: e,
1068
1074
  data: { error: t }
1069
- }), M = (e, t) => new URLSearchParams(new URL(e, "http://x").search).get(t), N = [{
1075
+ }), le = (e, t) => new URLSearchParams(new URL(e, "http://x").search).get(t), N = [{
1070
1076
  method: "GET",
1071
1077
  path: "/deliveries",
1072
1078
  description: "Recent delivery records (newest first) + per-channel + per-status counts.",
@@ -1089,11 +1095,11 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
1089
1095
  path: "/inbox",
1090
1096
  description: "In-app inbox for a subject (?subjectId=…).",
1091
1097
  handler: (e) => {
1092
- let t = M(e.url, "subjectId");
1098
+ let t = le(e.url, "subjectId");
1093
1099
  return t ? g.promise(async () => j({
1094
1100
  items: await b.listInbox(t, { limit: 100 }),
1095
1101
  unread: await b.unreadCount(t)
1096
- })) : g.succeed(le(400, "subjectId query param required"));
1102
+ })) : g.succeed(M(400, "subjectId query param required"));
1097
1103
  }
1098
1104
  }];
1099
1105
  return se({
@@ -1102,13 +1108,13 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
1102
1108
  description: "Unified notifications — email/slack/sms/push/in-app with preference routing, inbox + delivery log.",
1103
1109
  permissions: ["inspect:read", "store:write"],
1104
1110
  ...e.tables === !1 ? {} : { extendSchema: { tables: [
1105
- Je,
1106
- Ye,
1107
1111
  Xe,
1108
1112
  Ze,
1109
1113
  Qe,
1110
1114
  $e,
1111
- Le
1115
+ et,
1116
+ tt,
1117
+ ze
1112
1118
  ] } },
1113
1119
  ...w ? {
1114
1120
  declaredEnv: [{
@@ -1126,7 +1132,7 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
1126
1132
  try {
1127
1133
  t = JSON.parse(Buffer.from(e.rawBody).toString("utf8")).token;
1128
1134
  } catch {}
1129
- if (typeof t != "string" || t === "" || !Ie(t, t)) return {
1135
+ if (typeof t != "string" || t === "" || !Re(t, t)) return {
1130
1136
  status: 400,
1131
1137
  body: JSON.stringify({ error: "token required" }),
1132
1138
  contentType: "application/json"
@@ -1141,19 +1147,19 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
1141
1147
  maxBodyBytes: 4096
1142
1148
  }]
1143
1149
  } : {},
1144
- services: ae.succeed(et, T),
1150
+ services: ae.succeed(nt, T),
1145
1151
  routes: [...k, ...A],
1146
1152
  rpcClientDescriptors: w ? [...s, ...te] : s,
1147
1153
  inspectEndpoints: N,
1148
1154
  bindDataStore: (t) => {
1149
- v && (y.current = xe(t)), Be(t);
1155
+ v && (y.current = xe(t)), He(t);
1150
1156
  let n = e.flushIntervalMs ?? 3e4;
1151
1157
  E = setInterval(() => {
1152
1158
  T.flushDue().catch(() => {});
1153
1159
  }, n), typeof E.unref == "function" && E.unref();
1154
1160
  },
1155
1161
  onActivate: (e) => g.sync(() => {
1156
- w && We(), e.logger.info("notifications active", {
1162
+ w && Ke(), e.logger.info("notifications active", {
1157
1163
  channels: S.map((e) => e.id),
1158
1164
  digestWindowMs: C
1159
1165
  });
@@ -1164,4 +1170,4 @@ var F = class extends _.TaggedError()("PushTokenRejected", {
1164
1170
  });
1165
1171
  };
1166
1172
  //#endregion
1167
- export { et as NotificationService, F as PushTokenRejected, Te as buildNotificationService, I as consoleChannel, ye as customChannel, xe as dataStoreNotificationStore, Re as dataStorePushSubscriptionStore, Pe as decryptWebPushPayload, Xe as deliveriesTable, _e as emailChannel, Ne as encryptWebPushPayload, q as endpointHashOf, De as generateVapidPrivateKey, $e as heldTable, Se as inAppChannel, Ce as inQuietHours, Je as inboxTable, tt as makeSubjectId, R as memoryNotificationStore, J as memoryPushSubscriptionStore, B as minuteOfDayInZone, rt as notificationsPlugin, Ye as preferencesTable, be as pushChannel, Le as pushSubscriptionsTable, we as quietHoursEnd, Qe as quietHoursTable, Ve as resetWebPushStoreForTest, L as resolveChannels, Fe as sendWebPush, ve as smsChannel, Ze as topicSubscriptionsTable, ke as vapidAuthorization, G as vapidPublicKeyFor, Ue as webPushChannel, qe as webPushPublicKey, ge as webhookChannel };
1173
+ export { nt as NotificationService, F as PushTokenRejected, Te as buildNotificationService, I as consoleChannel, ye as customChannel, xe as dataStoreNotificationStore, Be as dataStorePushSubscriptionStore, Ie as decryptWebPushPayload, Qe as deliveriesTable, _e as emailChannel, Fe as encryptWebPushPayload, q as endpointHashOf, De as generateVapidPrivateKey, tt as heldTable, Se as inAppChannel, Ce as inQuietHours, Xe as inboxTable, rt as makeSubjectId, R as memoryNotificationStore, J as memoryPushSubscriptionStore, B as minuteOfDayInZone, at as notificationsPlugin, Ze as preferencesTable, be as pushChannel, ze as pushSubscriptionsTable, we as quietHoursEnd, et as quietHoursTable, Ue as resetWebPushStoreForTest, L as resolveChannels, Le as sendWebPush, ve as smsChannel, $e as topicSubscriptionsTable, je as vapidAuthorization, G as vapidPublicKeyFor, Ge as webPushChannel, Ye as webPushPublicKey, ge as webhookChannel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-notifications",
3
- "version": "0.56.0",
3
+ "version": "0.57.0",
4
4
  "description": "One unified notification surface — email, Slack/webhook, SMS, push, in-app — with per-subject preference routing, an in-app inbox, and a delivery log. NotificationService + typed routes + useInbox/useUnreadCount hooks.",
5
5
  "keywords": [
6
6
  "voltro",
@@ -44,9 +44,9 @@
44
44
  "node": ">=24.0.0"
45
45
  },
46
46
  "dependencies": {
47
- "@voltro/client": "0.56.0",
48
- "@voltro/database": "0.56.0",
49
- "@voltro/protocol": "0.56.0"
47
+ "@voltro/client": "0.57.0",
48
+ "@voltro/database": "0.57.0",
49
+ "@voltro/protocol": "0.57.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "effect": "^3.22.0",